@ckeditor/ckeditor5-ai 48.0.0-alpha.0 → 48.0.0-alpha.10

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 (163) hide show
  1. package/LICENSE.md +0 -4
  2. package/dist/aiactions/aiactions.d.ts +1 -10
  3. package/dist/aiactions/model/aiactionsinteraction.d.ts +4 -0
  4. package/dist/aiassistant/adapters/awstextadapter.d.ts +15 -156
  5. package/dist/aiassistant/aiassistant.d.ts +2 -0
  6. package/dist/aichat/model/aichatcontext.d.ts +5 -5
  7. package/dist/aichat/ui/controls/aichatcontextitembuttonview.d.ts +1 -1
  8. package/dist/aichatshortcuts/aichatshortcuts.d.ts +7 -19
  9. package/dist/aicore/aiconnector.d.ts +1 -1
  10. package/dist/aicore/model/aicontext.d.ts +15 -36
  11. package/dist/aiquickactions/aiquickactions.d.ts +6 -15
  12. package/dist/aiquickactions/aiquickactionsui.d.ts +1 -9
  13. package/dist/index-editor.css +27 -14
  14. package/dist/index.css +27 -14
  15. package/dist/index.d.ts +2 -2
  16. package/dist/index.js +6 -5
  17. package/dist/translations/af.js +1 -1
  18. package/dist/translations/af.umd.js +1 -1
  19. package/dist/translations/ar.js +1 -1
  20. package/dist/translations/ar.umd.js +1 -1
  21. package/dist/translations/ast.js +1 -1
  22. package/dist/translations/ast.umd.js +1 -1
  23. package/dist/translations/az.js +1 -1
  24. package/dist/translations/az.umd.js +1 -1
  25. package/dist/translations/be.js +1 -1
  26. package/dist/translations/be.umd.js +1 -1
  27. package/dist/translations/bg.js +1 -1
  28. package/dist/translations/bg.umd.js +1 -1
  29. package/dist/translations/bn.js +1 -1
  30. package/dist/translations/bn.umd.js +1 -1
  31. package/dist/translations/bs.js +1 -1
  32. package/dist/translations/bs.umd.js +1 -1
  33. package/dist/translations/ca.js +1 -1
  34. package/dist/translations/ca.umd.js +1 -1
  35. package/dist/translations/cs.js +1 -1
  36. package/dist/translations/cs.umd.js +1 -1
  37. package/dist/translations/da.js +1 -1
  38. package/dist/translations/da.umd.js +1 -1
  39. package/dist/translations/de-ch.js +1 -1
  40. package/dist/translations/de-ch.umd.js +1 -1
  41. package/dist/translations/de.js +1 -1
  42. package/dist/translations/de.umd.js +1 -1
  43. package/dist/translations/el.js +1 -1
  44. package/dist/translations/el.umd.js +1 -1
  45. package/dist/translations/en-au.js +1 -1
  46. package/dist/translations/en-au.umd.js +1 -1
  47. package/dist/translations/en-gb.js +1 -1
  48. package/dist/translations/en-gb.umd.js +1 -1
  49. package/dist/translations/en.js +1 -1
  50. package/dist/translations/en.umd.js +1 -1
  51. package/dist/translations/eo.js +1 -1
  52. package/dist/translations/eo.umd.js +1 -1
  53. package/dist/translations/es-co.js +1 -1
  54. package/dist/translations/es-co.umd.js +1 -1
  55. package/dist/translations/es.js +1 -1
  56. package/dist/translations/es.umd.js +1 -1
  57. package/dist/translations/et.js +1 -1
  58. package/dist/translations/et.umd.js +1 -1
  59. package/dist/translations/eu.js +1 -1
  60. package/dist/translations/eu.umd.js +1 -1
  61. package/dist/translations/fa.js +1 -1
  62. package/dist/translations/fa.umd.js +1 -1
  63. package/dist/translations/fi.js +1 -1
  64. package/dist/translations/fi.umd.js +1 -1
  65. package/dist/translations/fr.js +1 -1
  66. package/dist/translations/fr.umd.js +1 -1
  67. package/dist/translations/gl.js +1 -1
  68. package/dist/translations/gl.umd.js +1 -1
  69. package/dist/translations/gu.js +1 -1
  70. package/dist/translations/gu.umd.js +1 -1
  71. package/dist/translations/he.js +1 -1
  72. package/dist/translations/he.umd.js +1 -1
  73. package/dist/translations/hi.js +1 -1
  74. package/dist/translations/hi.umd.js +1 -1
  75. package/dist/translations/hr.js +1 -1
  76. package/dist/translations/hr.umd.js +1 -1
  77. package/dist/translations/hu.js +1 -1
  78. package/dist/translations/hu.umd.js +1 -1
  79. package/dist/translations/hy.js +1 -1
  80. package/dist/translations/hy.umd.js +1 -1
  81. package/dist/translations/id.js +1 -1
  82. package/dist/translations/id.umd.js +1 -1
  83. package/dist/translations/it.js +1 -1
  84. package/dist/translations/it.umd.js +1 -1
  85. package/dist/translations/ja.js +1 -1
  86. package/dist/translations/ja.umd.js +1 -1
  87. package/dist/translations/jv.js +1 -1
  88. package/dist/translations/jv.umd.js +1 -1
  89. package/dist/translations/kk.js +1 -1
  90. package/dist/translations/kk.umd.js +1 -1
  91. package/dist/translations/km.js +1 -1
  92. package/dist/translations/km.umd.js +1 -1
  93. package/dist/translations/kn.js +1 -1
  94. package/dist/translations/kn.umd.js +1 -1
  95. package/dist/translations/ko.js +1 -1
  96. package/dist/translations/ko.umd.js +1 -1
  97. package/dist/translations/ku.js +1 -1
  98. package/dist/translations/ku.umd.js +1 -1
  99. package/dist/translations/lt.js +1 -1
  100. package/dist/translations/lt.umd.js +1 -1
  101. package/dist/translations/lv.js +1 -1
  102. package/dist/translations/lv.umd.js +1 -1
  103. package/dist/translations/ms.js +1 -1
  104. package/dist/translations/ms.umd.js +1 -1
  105. package/dist/translations/nb.js +1 -1
  106. package/dist/translations/nb.umd.js +1 -1
  107. package/dist/translations/ne.js +1 -1
  108. package/dist/translations/ne.umd.js +1 -1
  109. package/dist/translations/nl.js +1 -1
  110. package/dist/translations/nl.umd.js +1 -1
  111. package/dist/translations/no.js +1 -1
  112. package/dist/translations/no.umd.js +1 -1
  113. package/dist/translations/oc.js +1 -1
  114. package/dist/translations/oc.umd.js +1 -1
  115. package/dist/translations/pl.js +1 -1
  116. package/dist/translations/pl.umd.js +1 -1
  117. package/dist/translations/pt-br.js +1 -1
  118. package/dist/translations/pt-br.umd.js +1 -1
  119. package/dist/translations/pt.js +1 -1
  120. package/dist/translations/pt.umd.js +1 -1
  121. package/dist/translations/ro.js +1 -1
  122. package/dist/translations/ro.umd.js +1 -1
  123. package/dist/translations/ru.js +1 -1
  124. package/dist/translations/ru.umd.js +1 -1
  125. package/dist/translations/si.js +1 -1
  126. package/dist/translations/si.umd.js +1 -1
  127. package/dist/translations/sk.js +1 -1
  128. package/dist/translations/sk.umd.js +1 -1
  129. package/dist/translations/sl.js +1 -1
  130. package/dist/translations/sl.umd.js +1 -1
  131. package/dist/translations/sq.js +1 -1
  132. package/dist/translations/sq.umd.js +1 -1
  133. package/dist/translations/sr-latn.js +1 -1
  134. package/dist/translations/sr-latn.umd.js +1 -1
  135. package/dist/translations/sr.js +1 -1
  136. package/dist/translations/sr.umd.js +1 -1
  137. package/dist/translations/sv.js +1 -1
  138. package/dist/translations/sv.umd.js +1 -1
  139. package/dist/translations/th.js +1 -1
  140. package/dist/translations/th.umd.js +1 -1
  141. package/dist/translations/ti.js +1 -1
  142. package/dist/translations/ti.umd.js +1 -1
  143. package/dist/translations/tk.js +1 -1
  144. package/dist/translations/tk.umd.js +1 -1
  145. package/dist/translations/tr.js +1 -1
  146. package/dist/translations/tr.umd.js +1 -1
  147. package/dist/translations/tt.js +1 -1
  148. package/dist/translations/tt.umd.js +1 -1
  149. package/dist/translations/ug.js +1 -1
  150. package/dist/translations/ug.umd.js +1 -1
  151. package/dist/translations/uk.js +1 -1
  152. package/dist/translations/uk.umd.js +1 -1
  153. package/dist/translations/ur.js +1 -1
  154. package/dist/translations/ur.umd.js +1 -1
  155. package/dist/translations/uz.js +1 -1
  156. package/dist/translations/uz.umd.js +1 -1
  157. package/dist/translations/vi.js +1 -1
  158. package/dist/translations/vi.umd.js +1 -1
  159. package/dist/translations/zh-cn.js +1 -1
  160. package/dist/translations/zh-cn.umd.js +1 -1
  161. package/dist/translations/zh.js +1 -1
  162. package/dist/translations/zh.umd.js +1 -1
  163. package/package.json +12 -13
package/dist/index.js CHANGED
@@ -20,8 +20,9 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x230b74,Command as _0x231d2e,ContextPlugin as _0x4c168b,Editor as _0x54b56a}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x3043e5,IconCheck as _0x39bec0,IconError as _0x23c17a,IconSubmit as _0x2f79db,IconAIHistory as _0x4fbb31,IconMagicWand as _0x5ec5fd,IconRobotPencil as _0x13417a,IconMaximize as _0x2442ce,IconMinimize as _0xc10fbb,IconShowChangesOn as _0x50003b,IconShowChangesOff as _0x5a006f,IconDocument as _0x3dfd07,IconBoxWithCross as _0x557c2f,IconBoxWithCheck as _0x34a5d9,IconBoxWithMarker as _0x3e37fc,IconInfo as _0x194912,IconWeb as _0x13ebcc,IconClose as _0x3a48ae,IconSelection as _0x4303ff,IconFileUpload as _0x25934b,IconLink as _0x9697b8,IconBulb as _0x51861b,IconAI as _0x32e0db,IconPreviousArrow as _0x2bd0fe,IconDocumentOutline as _0x3b618a,IconLoupe as _0x3b4df8,IconCancel as _0x341e14,IconPaperClip as _0x5e7016,IconBrowseFiles as _0x80857d,IconDropdownArrow as _0x249f8c,IconStop as _0x53f40e,IconAIChat as _0x32ee8b,IconPlus as _0x59b996,IconPin as _0x12a202,IconThreeHorizontalDots as _0x2018d0,IconAIReview as _0x30b44c,IconAITranslate as _0x27d1e6,IconAIAskAI as _0x169e26,IconThumbUp as _0x22fc84,IconThumbDown as _0x195a3e,IconChevronDown as _0x239174,IconChevronUp as _0x20d9ed,IconAIQuickActions as _0x519088,IconAIChatCommands as _0x19ca17,IconAIImproveWriting as _0x1e82c5,IconAIContinueWriting as _0x333607,IconAIGrammarCheck as _0xb489c4,IconAIAdjustLength as _0x44f60d,IconAIChangeTone as _0x321721,IconAIOther as tt,IconRefresh as et,IconNextArrow as it,IconOutdated as st,IconEye as nt,IconEyeCrossedOut as rt,IconChevronRight as at}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as ot,CKEditorError as ht,ObservableMixin as ct,global as lt,isVisible as ut,Rect as dt,Collection as _t,FocusTracker as At,KeystrokeHandler as gt,first as It,toArray as Et,EmitterMixin as pt,logWarning as Tt,logError as mt,scrollViewportToShowTarget as Ct,insertToPriorityArray as wt,scrollAncestorsToShowTarget as ft,ResizeObserver as St,_isMotionReduced as bt,getConstrainedViewportRect as Rt,DomEmitterMixin as Ot}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as kt,ButtonView as Nt,View as vt,SpinnerView as yt,IconView as xt,AutocompleteView as Lt,ListView as Dt,ListItemGroupView as Pt,ListItemView as Ht,ButtonLabelView as Mt,FocusCycler as Ut,createLabeledTextarea as Vt,Dialog as Bt,createDropdown as Gt,addMenuToDropdown as Ft,MenuBarMenuView as Kt,MenuBarMenuListItemButtonView as Wt,DialogViewPosition as Yt,MenuBarMenuListView as $t,MenuBarMenuListItemView as qt,BodyCollection as Qt,BalloonPanelView as Xt,clickOutsideHandler as zt,addListToDropdown as jt,UIModel as Jt,submitHandler as Zt,LabeledFieldView as te,createLabeledInputText as _0x1f994d,FormHeaderView as _0x3c9a0a,HighlightedTextView as _0x5c2b37,ViewCollection as _0x43aab0,FileDialogButtonView as _0x5f41d3,InputTextView as _0x34fddb,SearchTextView as _0x2e6f71,ListItemButtonView as _0x32ee0a,ButtonLabelWithHighlightView as _0x5628a0,DropdownMenuPanelPositioningFunctions as _0x109813,BalloonToolbar as _0xa65665,FormRowView as _0x8f4d96,TextareaView as _0x1b3d75}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x43b795,ClipboardMarkersUtils as _0x5b826c}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x336776,ViewDataTransfer as _0x421b01,ViewUpcastWriter as _0xd16ef2,Matcher as _0x149500,_DetachOperation as _0x3af47c,_insertIntoModelNodeList as _0x40aebf,_removeFromModelNodeList as _0xe6d562,ModelRange as _0x309081,transformOperationSets as _0x5ccf4a,ViewDowncastWriter as _0x2d80f3,ModelDocumentFragment as _0x3d30fd,ModelPosition as _0x24e947,ModelTreeWalker as _0x5dd899,MarkerOperation as _0x5ca8dc,InsertOperation as _0x3b1ba7}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x345106,escape as _0x9da630,cloneDeep as _0x4f3072,escapeRegExp as _0x81a2b5,debounce as _0x123234}from'es-toolkit/compat';import{BedrockRuntimeClient as _0xb367e2,InvokeModelWithResponseStreamCommand as _0x3581b3,InvokeModelCommand as _0x59b6f7}from'@aws-sdk/client-bedrock-runtime';import{createParser as _0x588f5f}from'eventsource-parser';import{CloudServices as _0x26600c}from'@ckeditor/ckeditor5-cloud-services/dist/index.js';import{parseDocument as _0x12edac}from'htmlparser2';import{isTag as _0x699811,findOne as _0xff2f34,getParent as _0x6f12aa,findAll as _0x57e7f5,removeElement as _0x1e1233,replaceElement as _0x73cead,prepend as _0x428c7a,prependChild as _0x40ad33,appendChild as _0x5dc0c5,append as _0xfeeaba,find as _0x43e615,isComment as _0x1ecbda,getChildren as ti,textContent as _0x34da1c}from'domutils';import _0x18e7f8 from'dom-serializer';import{Document as _0x497c92,Element as _0x41fe55,Text as _0xde8693,cloneNode as _0x37db7f,isDocument as _0x764091,isText as _0x57ee3c,NodeWithChildren as _0x5854ba}from'domhandler';import{MarkdownGfmMdToHtmlDefaultPlugins as _0x3b6d6e,MarkdownGfmMdToHtml as _0x1c7603}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import _0x492a37 from'rehype-sanitize';import{fixElementSuggestionRange as _0x124e32,DocumentCompare as _0x28cdab,DATA_ID_MODEL_ATTRIBUTE as _0x2ac232,ConfirmMixin as _0x33f31e,LateFocusDropdownButtonView as _0xe5c505,getAllMarkersDomElementsSorted as _0x538ba1,SuggestionsConversion as _0x3c542e,DATA_ID_VIEW_ATTRIBUTE as _0x3615f8,getMarkerDomElement as _0x1c49cd}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import _0x369bb8 from'morphdom';import{diffArrays as _0x166995}from'diff';const Si='_ungrouppedCommands';function bi(_0xb9df8,_0x7aa0){const _0xc1abfd=(0x0,_0x7aa0['t'])('Other');return _0xb9df8['length']?'groupId'in _0xb9df8[0x0]?_0xb9df8:[{'groupId':Si,'groupLabel':_0xc1abfd,'order':0x1/0x0,'commands':_0xb9df8}]:[{'groupId':Si,'groupLabel':_0xc1abfd,'order':0x1/0x0,'commands':[]}];}const Ri=globalThis['DataTransfer'],Oi='ai-ui';class ki extends _0x230b74{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x179443}=this,_0x2e15ad=['ck-fake-ai-selection'];_0x179443['config']['get']('ai.assistant.useTheme')&&_0x2e15ad['push']('ck-ai-assistant-ui_theme'),_0x179443['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Oi,'view':{'classes':_0x2e15ad,'priority':0xc}}),_0x179443['conversion']['for']('editingDowncast')['markerToElement']({'model':Oi,'view':(_0x3768fe,{writer:_0x1faafd})=>{if(!_0x3768fe['markerRange']['isCollapsed'])return null;const _0xcc7f5=_0x1faafd['createUIElement']('span');return _0x1faafd['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0xcc7f5),_0xcc7f5;}});}['afterInit'](){!async function(_0x2c13b8){const _0x3245d8=_0x375db6([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]),_0x1c1468=0x3dffc4e1,_0x665d27=0x3df84029^_0x1c1468,_0x65d323=window[_0x375db6([0x44,0x61,0x74,0x65])][_0x375db6([0x6e,0x6f,0x77])](),_0xc3933f=_0x2c13b8[_0x375db6([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x530fcf=new window[(_0x375db6([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x384dbe=>{_0xc3933f[_0x375db6([0x6f,0x6e,0x63,0x65])](_0x375db6([0x72,0x65,0x61,0x64,0x79]),_0x384dbe);}),_0x6f2b13={[_0x375db6([0x6b,0x74,0x79])]:_0x375db6([0x45,0x43]),[_0x375db6([0x75,0x73,0x65])]:_0x375db6([0x73,0x69,0x67]),[_0x375db6([0x63,0x72,0x76])]:_0x375db6([0x50,0x2d,0x32,0x35,0x36]),[_0x375db6([0x78])]:_0x375db6([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]),[_0x375db6([0x79])]:_0x375db6([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]),[_0x375db6([0x61,0x6c,0x67])]:_0x375db6([0x45,0x53,0x32,0x35,0x36])},_0x3557c5=_0xc3933f[_0x375db6([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x375db6([0x67,0x65,0x74])](_0x375db6([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x549acf(){let _0x191024,_0x3fdcac=null,_0x3efd46=null;try{if(_0x3557c5==_0x375db6([0x47,0x50,0x4c]))return _0x375db6([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x191024=_0x59ed25(),!_0x191024)return _0x375db6([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x191024[_0x375db6([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x3efd46=_0x381848(_0x191024[_0x375db6([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x191024[_0x375db6([0x6a,0x74,0x69])])),await _0x2c8f27()?_0x6dc8a1()?_0x56f2cd()?_0x375db6([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x571815()?(_0x191024[_0x375db6([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x375db6([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x3fdcac=_0x351aa8(_0x375db6([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x1c6c07()):_0x375db6([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x375db6([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x375db6([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x375db6([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x56f2cd(){const _0x9baf41=[_0x375db6([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x375db6([0x74,0x72,0x69,0x61,0x6c])][_0x375db6([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x191024[_0x375db6([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x65d323/0x3e8:0xe10*_0x665d27;return _0x191024[_0x375db6([0x65,0x78,0x70])]<_0x9baf41;}function _0x6dc8a1(){const _0x18baf8=_0x191024[_0x375db6([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x18baf8&&(!!_0x18baf8[_0x375db6([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x375db6([0x2a]))||!!_0x18baf8[_0x375db6([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x375db6([0x41,0x49])));}function _0x571815(){const _0x4058bd=_0x191024[_0x375db6([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x4058bd||0x0==_0x4058bd[_0x375db6([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x499f3d}=new URL(window[_0x375db6([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x4058bd[_0x375db6([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x499f3d))return!0x0;const _0x262a91=_0x499f3d[_0x375db6([0x73,0x70,0x6c,0x69,0x74])](_0x375db6([0x2e]));return _0x4058bd[_0x375db6([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x898f3e=>_0x898f3e[_0x375db6([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x375db6([0x2a])))[_0x375db6([0x6d,0x61,0x70])](_0x31fce3=>_0x31fce3[_0x375db6([0x73,0x70,0x6c,0x69,0x74])](_0x375db6([0x2e])))[_0x375db6([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x334485=>_0x334485[_0x375db6([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x262a91[_0x375db6([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x375db6([0x6d,0x61,0x70])](_0x14fcf0=>Array(_0x262a91[_0x375db6([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x14fcf0[_0x375db6([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x375db6([0x66,0x69,0x6c,0x6c])](_0x14fcf0[0x0]===_0x375db6([0x2a])?_0x375db6([0x2a]):'')[_0x375db6([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x14fcf0))[_0x375db6([0x73,0x6f,0x6d,0x65])](_0x1fc9b8=>_0x262a91[_0x375db6([0x65,0x76,0x65,0x72,0x79])]((_0x2656ba,_0x2102c6)=>_0x1fc9b8[_0x2102c6]===_0x2656ba||_0x1fc9b8[_0x2102c6]===_0x375db6([0x2a])));}function _0x1c6c07(){return _0x3fdcac&&_0x3efd46?new window[(_0x375db6([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4efec1,_0x544c8e)=>{_0x3fdcac[_0x375db6([0x74,0x68,0x65,0x6e])](_0x4efec1,_0x544c8e),_0x3efd46[_0x375db6([0x74,0x68,0x65,0x6e])](_0x2d286e=>{_0x2d286e!=_0x375db6([0x56,0x61,0x6c,0x69,0x64])&&_0x4efec1(_0x2d286e);},_0x544c8e);}):_0x3fdcac||_0x3efd46||_0x375db6([0x56,0x61,0x6c,0x69,0x64]);}}function _0x381848(_0x1eae41,_0x459e38){return new window[(_0x375db6([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4fc6c7=>{if(_0x3ea33e())return _0x4fc6c7(_0x375db6([0x56,0x61,0x6c,0x69,0x64]));_0xae5e34(),_0xc3933f[_0x375db6([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x375db6([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x257081=!0x1;const _0x32ded1=ot();function _0x3584cd(_0x185c5c){return!!_0x185c5c&&(typeof _0x185c5c===_0x375db6([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x185c5c===_0x375db6([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x185c5c[_0x375db6([0x74,0x68,0x65,0x6e])]===_0x375db6([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x185c5c[_0x375db6([0x63,0x61,0x74,0x63,0x68])]===_0x375db6([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x176403(_0x5cded4){_0x423711(_0x5cded4)[_0x375db6([0x74,0x68,0x65,0x6e])](_0x1b87be=>{if(!_0x1b87be||_0x1b87be[_0x375db6([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x375db6([0x6f,0x6b]))return _0x375db6([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x3d136a(_0x40e395(_0x32ded1+_0x459e38))!=_0x1b87be[_0x375db6([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x375db6([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x375db6([0x56,0x61,0x6c,0x69,0x64]);})[_0x375db6([0x74,0x68,0x65,0x6e])](_0x436f0c=>(_0x1ec192(),_0x436f0c),()=>{const _0x28df28=_0xe3c782();return null==_0x28df28?(_0x1ec192(),_0x375db6([0x56,0x61,0x6c,0x69,0x64])):_0x375db6(_0x65d323-_0x28df28>(0x19f340e1^_0x1c1468)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x375db6([0x74,0x68,0x65,0x6e])](_0x4fc6c7)[_0x375db6([0x63,0x61,0x74,0x63,0x68])](()=>{_0x4fc6c7(_0x375db6([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x384af2=0x3dc92a61^_0x1c1468;function _0x1ec192(){const _0x369ee6=_0x375db6([0x6c,0x6c,0x63,0x74,0x2d])+_0x3d136a(_0x40e395(_0x1eae41)),_0x5e6ac6=_0xd51912(_0x3d136a(window[_0x375db6([0x4d,0x61,0x74,0x68])][_0x375db6([0x63,0x65,0x69,0x6c])](_0x65d323/_0x384af2)));window[_0x375db6([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x375db6([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x369ee6,_0x5e6ac6);}function _0xe3c782(){const _0xffab3f=_0x375db6([0x6c,0x6c,0x63,0x74,0x2d])+_0x3d136a(_0x40e395(_0x1eae41)),_0x192923=window[_0x375db6([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x375db6([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0xffab3f);return _0x192923?window[_0x375db6([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xd51912(_0x192923),0x10)*_0x384af2:null;}function _0x423711(_0x1a16ab){return new window[(_0x375db6([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x41e23a,_0x504be1)=>{_0x1a16ab[_0x375db6([0x74,0x68,0x65,0x6e])](_0x41e23a,_0x504be1),window[_0x375db6([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x504be1,0x3dfe1021^_0x1c1468);});}}_0xc3933f[_0x375db6([0x6f,0x6e])](_0x375db6([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x374673,_0x2a0a5d)=>{if(_0x2a0a5d[0x0]!=_0x1eae41)return _0x4fc6c7(_0x375db6([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x2a0a5d[0x1]={..._0x2a0a5d[0x1],[_0x375db6([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x32ded1};},{[_0x375db6([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x375db6([0x68,0x69,0x67,0x68])}),_0xc3933f[_0x375db6([0x6f,0x6e])](_0x375db6([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x209083=>{_0x3584cd(_0x209083[_0x375db6([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x257081=!0x0,_0x176403(_0x209083[_0x375db6([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x375db6([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x375db6([0x6c,0x6f,0x77])}),_0x530fcf[_0x375db6([0x74,0x68,0x65,0x6e])](()=>{_0x257081||_0x4fc6c7(_0x375db6([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x3ea33e(){return _0xc3933f[_0x375db6([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x375db6([0x76,0x69,0x65,0x77])][_0x375db6([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x375db6([0x61,0x75,0x74,0x6f]);}function _0xae5e34(){_0xc3933f[_0x375db6([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x375db6([0x76,0x69,0x65,0x77])][_0x375db6([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x375db6([0x61,0x75,0x74,0x6f]);}}function _0x351aa8(_0x3416f5){const _0x5d3d1f=[new window[(_0x375db6([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1234b5=>setTimeout(_0x1234b5,0x3df6fa2d^_0x1c1468)),_0x530fcf[_0x375db6([0x74,0x68,0x65,0x6e])](()=>new window[(_0x375db6([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3f6909=>{let _0x101135=0x0;_0xc3933f[_0x375db6([0x6d,0x6f,0x64,0x65,0x6c])][_0x375db6([0x6f,0x6e])](_0x375db6([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x2f7969,_0x4d69ba)=>{_0x4d69ba[0x0][_0x375db6([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x101135++,_0x101135==(0x3dffc109^_0x1c1468)&&(_0x3f6909(),_0x2f7969[_0x375db6([0x6f,0x66,0x66])]());});}))];return window[_0x375db6([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x375db6([0x72,0x61,0x63,0x65])](_0x5d3d1f)[_0x375db6([0x74,0x68,0x65,0x6e])](()=>_0x3416f5);}async function _0x4f4def(){await _0x530fcf,_0xc3933f[_0x375db6([0x6d,0x6f,0x64,0x65,0x6c])][_0x375db6([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x1d022d,_0xc3933f[_0x375db6([0x6d,0x6f,0x64,0x65,0x6c])][_0x375db6([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x1d022d,_0xc3933f[_0x375db6([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x375db6([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x4cffcd(_0x1f8cfc){const _0x2e9952=_0x41b285();_0xc3933f[_0x2e9952]=_0x375db6([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x1f8cfc,_0x1f8cfc!=_0x375db6([0x56,0x61,0x6c,0x69,0x64])&&_0x4f4def();}function _0x41b285(){const _0x217f4e=window[_0x375db6([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x375db6([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x375db6([0x6e,0x6f,0x77])]())[_0x375db6([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x375db6([0x2e]),'');let _0x1b0fec=_0x375db6([0x6e]);for(let _0x356118=0x0;_0x356118<_0x217f4e[_0x375db6([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x356118+=0x2){let _0x5ebf37=window[_0x375db6([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x217f4e[_0x375db6([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x356118,_0x356118+0x2));_0x5ebf37>=_0x3245d8[_0x375db6([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x5ebf37-=_0x3245d8[_0x375db6([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x1b0fec+=_0x3245d8[_0x5ebf37];}return _0x1b0fec;}function _0x59ed25(){const _0x18f452=_0x3557c5[_0x375db6([0x73,0x70,0x6c,0x69,0x74])](_0x375db6([0x2e]));if(0x3!=_0x18f452[_0x375db6([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x4f4f21(_0x18f452[0x1]);function _0x4f4f21(_0x1bbb3f){const _0x1782b6=_0x151196(_0x1bbb3f);return _0x1782b6&&_0xbf7996()?_0x1782b6:null;function _0xbf7996(){const _0x4cc8ca=_0x1782b6[_0x375db6([0x6a,0x74,0x69])],_0x1f45c8=window[_0x375db6([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4cc8ca[_0x375db6([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4cc8ca[_0x375db6([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x2c7e97={..._0x1782b6,[_0x375db6([0x6a,0x74,0x69])]:_0x4cc8ca[_0x375db6([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x4cc8ca[_0x375db6([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x2c7e97[_0x375db6([0x76,0x63])],_0x40e395(_0x2c7e97)==_0x1f45c8;}}}async function _0x2c8f27(){let _0x215deb=!0x0;try{const _0x1261ce=_0x3557c5[_0x375db6([0x73,0x70,0x6c,0x69,0x74])](_0x375db6([0x2e])),[_0x5a993f,_0x41f33a,_0x1a2ecb]=_0x1261ce;return _0x424ad5(_0x5a993f),await _0x165fe6(_0x5a993f,_0x41f33a,_0x1a2ecb),_0x215deb;}catch{return!0x1;}function _0x424ad5(_0x26ccd3){const _0x415800=_0x151196(_0x26ccd3);_0x415800&&_0x415800[_0x375db6([0x61,0x6c,0x67])]==_0x375db6([0x45,0x53,0x32,0x35,0x36])||(_0x215deb=!0x1);}async function _0x165fe6(_0x1d95db,_0xf39d9b,_0x56bee6){const _0x1c61ea=window[_0x375db6([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x375db6([0x66,0x72,0x6f,0x6d])](_0x48e13a(_0x56bee6),_0x1d826e=>_0x1d826e[_0x375db6([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x48f7a7=new window[(_0x375db6([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x375db6([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x1d95db+_0x375db6([0x2e])+_0xf39d9b),_0x3fba01=window[_0x375db6([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x375db6([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x3fba01)return;const _0x2f52e5=await _0x3fba01[_0x375db6([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x375db6([0x6a,0x77,0x6b]),_0x6f2b13,{[_0x375db6([0x6e,0x61,0x6d,0x65])]:_0x375db6([0x45,0x43,0x44,0x53,0x41]),[_0x375db6([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x375db6([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x375db6([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x3fba01[_0x375db6([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x375db6([0x6e,0x61,0x6d,0x65])]:_0x375db6([0x45,0x43,0x44,0x53,0x41]),[_0x375db6([0x68,0x61,0x73,0x68])]:{[_0x375db6([0x6e,0x61,0x6d,0x65])]:_0x375db6([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x2f52e5,_0x1c61ea,_0x48f7a7)||(_0x215deb=!0x1);}}function _0x151196(_0x539c05){return _0x539c05[_0x375db6([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x375db6([0x65,0x79]))?JSON[_0x375db6([0x70,0x61,0x72,0x73,0x65])](_0x48e13a(_0x539c05)):null;}function _0x48e13a(_0x5db5b9){return window[_0x375db6([0x61,0x74,0x6f,0x62])](_0x5db5b9[_0x375db6([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x375db6([0x2b]))[_0x375db6([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x375db6([0x2f])));}function _0x40e395(_0x655075){let _0x294c7f=0x1505;function _0x5b417b(_0x35ca78){for(let _0x15dac2=0x0;_0x15dac2<_0x35ca78[_0x375db6([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x15dac2++){const _0x1ff965=_0x35ca78[_0x375db6([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x15dac2);_0x294c7f=(_0x294c7f<<0x5)+_0x294c7f+_0x1ff965,_0x294c7f&=_0x294c7f;}}function _0x277b88(_0x187667){Array[_0x375db6([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x187667)?_0x187667[_0x375db6([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x277b88):_0x187667&&typeof _0x187667==_0x375db6([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x375db6([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x187667)[_0x375db6([0x73,0x6f,0x72,0x74])]()[_0x375db6([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x15c2a1,_0x1bcf83])=>{_0x5b417b(_0x15c2a1),_0x277b88(_0x1bcf83);}):_0x5b417b(window[_0x375db6([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x187667));}return _0x277b88(_0x655075),_0x294c7f>>>0x0;}function _0x3d136a(_0x529c3c){return _0x529c3c[_0x375db6([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x375db6([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x375db6([0x30]));}function _0xd51912(_0xc32c65){return _0xc32c65[_0x375db6([0x73,0x70,0x6c,0x69,0x74])]('')[_0x375db6([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x375db6([0x6a,0x6f,0x69,0x6e])]('');}function _0x1d022d(){}function _0x375db6(_0x506deb){return _0x506deb['map'](_0x1a068c=>String['fromCharCode'](_0x1a068c))['join']('');}_0x4cffcd(await _0x549acf());}(this);}['showFakeVisualSelection'](){const _0x3537e3=this['editor']['model'];_0x3537e3['change'](_0x3012f6=>{const _0x339b02=_0x3537e3['document']['selection']['getRanges']();let _0x1e0d12=0x0;for(const _0x1c3962 of _0x339b02){const _0x1d52b2=Oi+':'+_0x1e0d12;if(_0x3537e3['markers']['has'](_0x1d52b2))_0x3012f6['updateMarker'](_0x1d52b2,{'range':_0x1c3962});else{if(_0x1c3962['start']['isAtEnd']){const _0x3e5d3f=_0x1c3962['start']['getLastMatchingPosition'](({item:_0xcf890c})=>!_0x3537e3['schema']['isContent'](_0xcf890c),{'boundaries':_0x1c3962});_0x3012f6['addMarker'](_0x1d52b2,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3012f6['createRange'](_0x3e5d3f,_0x1c3962['end'])});}else _0x3012f6['addMarker'](_0x1d52b2,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1c3962});}_0x1e0d12++;}});}['hideFakeVisualSelection'](){const _0x225d15=this['editor']['model'],_0x2be1ed=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](Oi));_0x2be1ed['length']&&_0x225d15['change'](_0x2db0a1=>{_0x2be1ed['forEach'](_0x5b9f07=>{_0x2db0a1['removeMarker'](_0x5b9f07);});});}['insertContent'](_0x42e566,_0x267026){const _0x557d1c=this['_getAISelection'](),_0x46fd5f=_0x267026||_0x557d1c['getFirstRange']();this['editor']['model']['canEditAt'](_0x46fd5f)&&this['editor']['model']['change'](_0x16b7b7=>{this['hideFakeVisualSelection'](),_0x267026||this['_resetContentOfSelectedTableCells'](_0x16b7b7,_0x557d1c),this['_pasteHTMLUsingClipboard']({'insertAt':_0x46fd5f,'writer':_0x16b7b7,'html':_0x42e566});});}['insertContentBelow'](_0x3b8951){const {model:_0x46b699}=this['editor'],_0xbc171f=this['_getAISelection']();_0x46b699['change'](()=>{const _0x586f3b=this['_prepareTableInsertBelowPosition'](_0x3b8951,_0xbc171f)||this['_getDefaultInsertBelowPosition'](_0xbc171f);this['insertContent'](_0x3b8951,_0x586f3b);});}['_getAISelection'](){const _0x21985e=this['editor']['model'],_0x39ba59=Array['from'](_0x21985e['markers']['getMarkersGroup'](Oi))['map'](_0x25c1ae=>_0x25c1ae['getRange']());return _0x21985e['createSelection'](_0x39ba59);}['_pasteHTMLUsingClipboard']({writer:_0x71f241,html:_0x2b5942,insertAt:_0x381c65}){const {view:_0x544577}=this['editor']['editing'],_0x4796fa=this['editor']['plugins']['get'](_0x43b795),_0x5d167a=new Ri();_0x5d167a['setData']('text/html',_0x2b5942);const _0x4612e9=new ClipboardEvent('paste',{'clipboardData':_0x5d167a}),_0x38a4d2=new _0x336776(_0x544577,_0x4612e9,{'dataTransfer':new _0x421b01(_0x5d167a)});_0x71f241['setSelection'](_0x381c65);const _0x93924e=(_0x16406c,_0xdcec93)=>{_0xdcec93['resultRange']&&_0x71f241['setSelection'](_0xdcec93['resultRange']);};_0x4796fa['once']('contentInsertion',_0x93924e,{'priority':'lowest'}),_0x544577['document']['fire']('paste',_0x38a4d2),_0x4796fa['off']('contentInsertion',_0x93924e);}['_getDefaultInsertBelowPosition'](_0x4592ed){const {model:_0x1a004}=this['editor'],_0x4e4b2e=Array['from'](_0x4592ed['getSelectedBlocks']());return _0x4e4b2e['length']?_0x1a004['createPositionAfter'](_0x4e4b2e['pop']()):_0x4592ed['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x36266d,_0x1845d4){const {model:_0x1b75d3,plugins:_0x48a820}=this['editor'];if(_0x48a820['has']('TableUtils')){const _0x131ba5=_0x48a820['get']('TableUtils')['getSelectedTableCells'](_0x1845d4);if(_0x131ba5['length']){const _0x911993=this['_getTableRowCountFromContent'](_0x36266d),_0x537cdd=this['_createEmptyTableRows'](_0x131ba5,_0x911993);return _0x1b75d3['createPositionAt'](_0x537cdd,0x0);}}return null;}['_getTableRowCountFromContent'](_0x239a0e){const _0x3eab0f=this['editor']['plugins']['get']('TableUtils'),_0x48f844=this['editor']['data']['parse'](_0x239a0e),_0x56cf23=Array['from'](_0x48f844['getChildren']())['filter'](_0x3a49d0=>_0x3a49d0['is']('element','table'));let _0x53ee81=0x0;return _0x56cf23['forEach'](_0x5310e3=>{_0x53ee81+=_0x3eab0f['getRows'](_0x5310e3);}),_0x53ee81;}['_createEmptyTableRows'](_0x19e492,_0x447e5d){const _0x269cd7=this['editor']['plugins']['get']('TableUtils'),_0x23fc5a=_0x269cd7['getRowIndexes'](_0x19e492),_0x2e10b8=_0x269cd7['getColumnIndexes'](_0x19e492),_0x21304e=_0x23fc5a['last']+0x1,_0x4ac3e1=_0x2e10b8['first'],_0x2479ad=_0x19e492[0x0]['findAncestor']('table');for(let _0x58b413=0x0;_0x58b413<_0x447e5d;_0x58b413++)_0x269cd7['insertRows'](_0x2479ad,{'at':_0x21304e});return _0x2479ad['getChild'](_0x21304e)['getChild'](_0x4ac3e1);}['_resetContentOfSelectedTableCells'](_0x3dadca,_0x37cce4){const {plugins:_0x555d05}=this['editor'],{model:_0xaebd44}=_0x3dadca;if(!_0x555d05['has']('TableUtils'))return;_0x555d05['get']('TableUtils')['getSelectedTableCells'](_0x37cce4)['length']&&_0xaebd44['deleteContent'](_0x37cce4);}}class Ni extends _0x230b74{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new ht('aiadapter-text-adapter-not-set',null);}}class vi extends Error{constructor(_0x5cb551){super(_0x5cb551),this['name']='AIRequestError';}}function yi(_0x53e2d1,_0xc94b92,_0x5bd0c6){const t=_0x53e2d1['t'];switch(_0xc94b92){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',_0x5bd0c6);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5bd0c6);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'},_0x5bd0c6);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0xc94b92;}}class xi extends _0x231d2e{['_commandDefinitions'];constructor(_0x4a74bf,_0x3ebf63){super(_0x4a74bf),this['_commandDefinitions']=_0x3ebf63,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x4d20c9,_0x513402,_0x1d86d2)=>{this['isEnabled']&&(this['enabledCommandsIds']=Li(this['_commandDefinitions'],_0x1d86d2));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x1fe732,_0x26f30b,_0x226632)=>{this['enabledCommandsIds']=_0x226632?Li(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x2371a7=this['editor']['model'];this['_hasContext']=function(_0x506263){const _0x4d5e1c=_0x506263['document']['selection'];return _0x4d5e1c['isCollapsed']?0x0!==[..._0x4d5e1c['getSelectedBlocks']()]['length']&&![..._0x4d5e1c['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x506263['hasContent'](_0x4d5e1c['getFirstRange']());}(_0x2371a7);const _0x3eb73e=_0x2371a7['document']['selection'],_0x11937d=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x1751ec of _0x3eb73e['getRanges']())for(const _0x2ab5fd of _0x1751ec['getItems']())if(_0x2ab5fd['is']('element')&&_0x11937d['includes'](_0x2ab5fd['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x193e2f='',_0x461258='',_0x57d026='custom'){this['editor']['plugins']['get'](Xi)['showUI'](_0x193e2f,_0x461258,_0x57d026);}}function Li(_0x1ee163,_0x5a4f66){const _0x5e1bd0=new Set();for(const _0x91c2f of _0x1ee163['values']())(_0x5a4f66||!0x1===_0x91c2f['requiresContent'])&&_0x5e1bd0['add'](_0x91c2f['id']);return Array['from'](_0x5e1bd0);}const Di=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class Pi extends/* #__PURE__ -- @preserve */
24
- ct(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x5d2605,_0x3df5b6,_0x56e6c0){super(),this['editor']=_0x5d2605,this['textAdapter']=_0x3df5b6,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x56e6c0,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0xc4b065,_0x2cae93,_0x4f2784)=>{this['view']['value']=this['_sanitizeHTML'](_0x4f2784);}),this['listenTo'](this['view'],'submitPrompt',(_0x4c91ed,_0x89ce6c)=>{const _0x2b700e=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x89ce6c,_0x2b700e,'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:_0x55dd6a,query:_0x38e447,htmlContent:_0x5e973f,label:_0x20108e,mainActionLabel:_0x2c4eeb}){this['view']['prompt']=_0x20108e,this['view']['mainAction']=_0x2c4eeb,this['initialContext']=_0x5e973f,_0x38e447&&(this['view']['isRendered']?this['_handleQuery'](_0x38e447,_0x5e973f,_0x55dd6a,_0x20108e):this['view']['once']('render',()=>{this['_handleQuery'](_0x38e447,_0x5e973f,_0x55dd6a,_0x20108e);}));}['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'](_0x4b63b9,_0x36629a,_0x3628f6,_0x47117b){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x36629a,this['previousQuery']=_0x4b63b9,this['previousLabel']=_0x47117b||_0x4b63b9,this['previousActionId']=_0x3628f6,new Promise(_0x1fe6e5=>{this['textAdapter']['makeRequest']({'query':_0x4b63b9,'context':_0x36629a,'onData':_0x43c7fa=>{this['currentResponse']=_0x43c7fa,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x3628f6})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x218a32=>{_0x218a32 instanceof vi?this['view']['handleError'](_0x218a32['message']):this['view']['handleError'](),_0x1fe6e5();})['finally'](()=>{this['stopProcessing'](),_0x1fe6e5();});});}['_parseAndNormalizeContent'](_0x5d3ff5,_0x463ea1=!0x1){const _0x413722=Di['exec'](_0x5d3ff5);_0x5d3ff5=_0x413722?_0x5d3ff5['substring'](_0x413722[0x1]['length']):_0x5d3ff5['length']<0x64&&!_0x463ea1?'':this['_stripMarkdownSyntax'](_0x5d3ff5);const _0x5c20ca=this['_domParser']['parseFromString'](_0x5d3ff5,'text/html');if(_0x413722){const _0x2ca90f=Array['from'](_0x5c20ca['body']['childNodes']);_0x2ca90f['reverse']();for(const _0x10c19b of _0x2ca90f){if(_0x10c19b['nodeType']==Node['ELEMENT_NODE'])break;_0x10c19b['remove']();}}const _0xe5304a=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x5c20ca['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0xe5304a);const _0x59c2eb=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x2a6002=this['editor']['data']['toModel'](_0xe5304a);return _0x59c2eb||_0x2a6002['markers']['clear'](),this['editor']['data']['stringify'](_0x2a6002);}['_normalizeResponseHeadings'](_0x213620){const _0x409082=new _0xd16ef2(this['editor']['editing']['view']['document']),_0x679afc=new _0x149500({'name':/^h[1-5]$/}),_0x143354=[];let _0x9a2d43=!0x1;for(const _0x4e344b of _0x213620)_0x4e344b['is']('element')&&_0x679afc['match'](_0x4e344b)&&(_0x143354['push'](_0x4e344b),'h1'==_0x4e344b['name']&&(_0x9a2d43=!0x0));if(_0x9a2d43){for(const _0x1910be of _0x143354)_0x409082['rename']('h'+(parseInt(_0x1910be['name'][0x1])+0x1),_0x1910be);}}['_isH1TagSupportEnabled'](){const {data:_0x5477ec,editing:_0x3afc46}=this['editor'],_0x36c66c=_0x5477ec['htmlProcessor']['toView']('<h1></h1>'),_0x110525=_0x5477ec['toView'](_0x5477ec['toModel'](_0x36c66c));return!!_0x3afc46['view']['domConverter']['viewToDom'](_0x110525)['querySelector']('h1');}['_sanitizeHTML'](_0x21688c){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x21688c),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x5b8289){const _0xac02c5=_0x5b8289['trim']();return _0xac02c5['startsWith']('```html')?_0xac02c5['endsWith']('```')?_0xac02c5['substring'](0x7,_0xac02c5['length']-0x3):_0xac02c5['substring'](0x7):_0x5b8289;}}const Hi={'REPLACE':'replace','INSERT':'insert'};class Mi extends kt{constructor(_0xc47e38){super(_0xc47e38),this['set']('isVisible',!0x1),this['set']('mainAction',Hi['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x27d4a7=>yi(_0xc47e38,'AI_'+_0x27d4a7['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](yi(_0xc47e38,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](yi(_0xc47e38,'Try\x20again')),this['stopButton']=this['_createButton'](yi(_0xc47e38,'Stop'));const _0x321820=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x321820['if']('isVisible','ck-hidden',_0x3c6dc5=>!_0x3c6dc5)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x55542a,_0x1b1eaa){const _0x544280=new Nt(this['locale']);return _0x544280['set']({'label':_0x55542a,'class':_0x1b1eaa||'','isVisible':!0x0,'withText':!0x0}),_0x544280;}}class Ui extends vt{['contentFieldView'];['copyButtonView'];constructor(_0x5bda2c,_0x5ddd55=''){super(_0x5bda2c),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x193892=this['bindTemplate'];this['contentFieldView']=new Vi(_0x5bda2c,_0x5ddd55),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x193892['if']('isVisible','ck-hidden',_0x1ea29c=>!_0x1ea29c)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x193892['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 _0x3a7e83=!0x1;this['on']('change:value',(_0x3c144e,_0x53c671,_0x172d36)=>{const _0x1582be=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x172d36),this['isProcessing']&&_0x1582be&&!_0x3a7e83&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x562ea3,_0x1714c5,_0x52ff6e)=>{_0x3a7e83=!0x1,_0x52ff6e?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x3a7e83=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x3a7e83=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x24b45d=this['locale'],_0x4051c2=new Nt(this['locale']),_0x10a420='ck-ai-form__copy-button';return _0x4051c2['set']({'label':yi(_0x24b45d,'Copy'),'icon':_0x3043e5,'class':_0x10a420,'tooltip':!0x0}),_0x4051c2['bind']('isVisible')['to'](this,'value',_0x4ff9b5=>!!_0x4ff9b5),_0x4051c2['bind']('isEnabled')['to'](this,'isProcessing',_0x25bebb=>!_0x25bebb),_0x4051c2['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x4051c2['icon']=_0x39bec0,_0x4051c2['class']=_0x10a420+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x4051c2['icon']=_0x3043e5,_0x4051c2['class']=_0x10a420;},0x3e8);}),_0x4051c2;}['_copyHTMLToClipboard'](_0x186e9f){const {window:_0x879c5c,document:_0x1047f3}=lt;if(_0x879c5c['ClipboardItem']){const {Blob:_0x49591c,ClipboardItem:_0x266e9d}=_0x879c5c,_0x559530=[new _0x266e9d({'text/html':new _0x49591c([_0x186e9f['innerHTML']],{'type':'text/html'}),'text/plain':new _0x49591c([_0x186e9f['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x559530);}else{const _0x45868a=_0x1047f3['createElement']('div');_0x45868a['style']['position']='absolute',_0x45868a['style']['left']='-9999px',_0x45868a['innerHTML']='<span>[</span>'+_0x186e9f['innerHTML']+'<span>]</span>',_0x1047f3['body']['appendChild'](_0x45868a);const _0x22fa68=_0x1047f3['createRange']();_0x22fa68['setStartAfter'](_0x45868a['firstElementChild']),_0x22fa68['setEndBefore'](_0x45868a['lastElementChild']);const _0x1620e4=_0x879c5c['getSelection']();_0x1620e4['removeAllRanges'](),_0x1620e4['addRange'](_0x22fa68),_0x1047f3['execCommand']('copy'),_0x45868a['remove']();}}}class Vi extends vt{constructor(_0x3cd95d,_0x1b05fa=''){super(_0x3cd95d),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x1b05fa,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x3c221a){this['element']['innerHTML']=_0x3c221a;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x4ae572=new vt(),_0x7ba8c1=this['locale'],_0x562e7d=new yt();return _0x562e7d['isVisible']=!0x0,_0x4ae572['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x562e7d,{'text':yi(_0x7ba8c1,'AI\x20is\x20writing...')}]}),_0x4ae572['render'](),_0x4ae572;}}class Bi extends vt{constructor(_0x1ee9d4,_0x27b80c=''){super(_0x1ee9d4);const _0x3447a2=new xt(),_0x3e56f0=this['bindTemplate'];this['set']('text',_0x27b80c),_0x3447a2['content']=_0x23c17a,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x3447a2,{'text':_0x3e56f0['to']('text')}]});}}class Gi extends Lt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x3f3356,_0xcc71d){super(_0x3f3356,_0xcc71d),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',(_0x554d0d,_0x5d725b)=>{_0x554d0d['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x5d725b());});}['_createSubmitButton'](){const _0x1411c1=new Nt(this['locale']),_0x32e693=this['locale'];return _0x1411c1['set']({'icon':_0x2f79db,'label':yi(_0x32e693,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x1411c1['on']('execute',()=>{this['submit']();}),_0x1411c1['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x41b5a2,_0x15934f)=>!_0x41b5a2&&_0x15934f),_0x1411c1;}['_createShowHistoryButton'](){const _0x1cfff7=new Nt(this['locale']),_0x5c196f=this['resultsView'],_0x25edce=this['locale'];_0x1cfff7['set']({'label':yi(_0x25edce,'History'),'withText':!0x1,'icon':_0x4fbb31,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x1cfff7['bind']('isOn')['to'](_0x5c196f,'isVisible'),_0x1cfff7['bind']('isEnabled')['to'](this,'isEnabled'),_0x1cfff7['on']('execute',()=>{_0x5c196f['isVisible']=!_0x5c196f['isVisible'],_0x5c196f['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x5e334e=()=>{lt['window']['requestAnimationFrame'](()=>{if(ut(this['element'])){const _0x40d835=new dt(this['queryView']['fieldView']['element']),_0x1c74d8=_0x40d835['width'],_0x4f20cb='rtl'===_0x25edce['uiLanguageDirection']?'left':'right';_0x40d835['excludeScrollbarsAndBorders'](),_0x1cfff7['element']['style'][_0x4f20cb]=_0x1c74d8-_0x40d835['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x5e334e),this['on']('render',_0x5e334e),_0x1cfff7;}['submit'](){const _0x118c0f=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x118c0f);}['focus'](_0x143fc8){-0x1===_0x143fc8?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Fi extends Dt{['historyGroupView'];['clearHistoryButton'];constructor(_0x4f8b37){super(_0x4f8b37),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Pt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=yi(_0x4f8b37,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x350528=0x0;for(const _0xac4661 of this['items'])_0x350528+=_0xac4661['items']['length'];return{'resultsCount':_0x350528,'totalItemsCount':_0x350528};}['_createClearHistoryButton'](){const _0x40dcd7=this['locale'],_0x5337fb=new Nt(this['locale']);return _0x5337fb['set']({'label':'('+yi(_0x40dcd7,'Clear')+')','withText':!0x0}),_0x5337fb['on']('execute',()=>this['fire']('clearHistory')),_0x5337fb;}}class Ki extends Ht{constructor(_0xf23e40){super();const _0x2a6ea0=new Mt(),_0x56598b=new Nt(this['locale'],_0x2a6ea0);this['children']['add'](_0x56598b),_0x56598b['set']({'label':_0xf23e40['prompt'],'withText':!0x0}),_0x56598b['on']('execute',()=>{this['fire']('execute',{'value':_0x345106(_0xf23e40['prompt'])});});}}const Wi='CKEditor/AIFormView/PromptHistory';class Yi extends _t{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x5395a9,_0x5d6ecf)=>{const _0x3a6703=$i(_0x5d6ecf['prompt']);for(const _0x59dea1 of this)if(_0x59dea1!=_0x5d6ecf&&$i(_0x59dea1['prompt'])===_0x3a6703){this['remove'](_0x59dea1);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x845f24=sessionStorage['getItem'](Wi)||'[]';this['addMany'](JSON['parse'](_0x845f24));}['_saveToSessionStorage'](){sessionStorage['setItem'](Wi,JSON['stringify'](this['map'](_0xaa7d88=>_0xaa7d88)));}}function $i(_0x166876){return _0x166876['toLowerCase']()['trim']();}class qi extends vt{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x1f3343,_0x4f7cc4,_0x3efcd6=''){super(_0x1f3343),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',Hi['REPLACE']),this['_promptHistory']=new Yi(),this['errorView']=new Bi(_0x1f3343),this['contentArea']=new Ui(_0x1f3343,_0x3efcd6),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 At(),this['keystrokes']=new gt(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0x2c0566=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x4f7cc4],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x2c0566['if']('isError','ck-hidden',_0x237086=>!_0x237086)]},'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'](_0x871de2=0x1){-0x1===_0x871de2?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 _0x51c055=this['locale'],_0x121c1b=new Gi(_0x51c055,{'queryView':{'label':yi(_0x51c055,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':Vt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':yi(_0x51c055,'Empty\x20history'),'secondary':yi(_0x51c055,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x121c1b['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x29f785,_0x113651)=>_0x29f785&&!_0x113651),this['listenTo'](_0x121c1b,'submit',(_0xc51f22,_0x2e9966)=>{this['prompt']=_0x2e9966;const _0x559237=_0x9da630(_0x2e9966);this['fire']('submitPrompt',_0x559237),_0x2e9966['trim']()&&this['_promptHistory']['add']({'prompt':_0x559237},0x0);},{'priority':'high'}),_0x121c1b;}['_createHistoryView'](){const _0x223b6c=new Fi(this['locale']);return _0x223b6c['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Ki),_0x223b6c['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x223b6c;}['_createToolbar'](){const _0x21fc64=new Mi(this['locale']);return _0x21fc64['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x476bd2,_0x3fd0f3,_0x1f7ded)=>_0x476bd2&&!_0x3fd0f3&&!!_0x1f7ded),_0x21fc64['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x21fc64['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x1bad22,_0x1ab8c1,_0x613ecf)=>_0x1bad22&&!_0x1ab8c1&&!!_0x613ecf),_0x21fc64['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x21fc64['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x54ec93,_0x49a0a3)=>_0x54ec93&&!_0x49a0a3),_0x21fc64['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x21fc64['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x21fc64['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x21fc64;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x5c4f06=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=yi(_0x5c4f06,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x4ee9e9){const _0x3fc38c=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x4ee9e9||yi(_0x3fc38c,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const Qi=globalThis['DataTransfer'];class Xi extends _0x230b74{['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[_0x5b826c,ki,Ni,Bt];}constructor(_0x31766f){super(_0x31766f),_0x31766f['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x31766f['config']['define']('ai.assistant.contentAreaCssClass',''),_0x31766f['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x31766f['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0xcd97d6}=this;this['_aiAdapter']=_0xcd97d6['plugins']['get'](Ni),this['_dialog']=_0xcd97d6['plugins']['get'](Bt),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0xfec9c0=new xi(_0xcd97d6,Array['from'](this['_commandDefinitions']['values']()));_0xcd97d6['commands']['add']('showAIAssistant',_0xfec9c0),_0xcd97d6['ui']['componentFactory']['add']('aiCommands',_0x56da1e=>{const _0x2fc6e2=Gt(_0x56da1e);return _0x2fc6e2['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x2fc6e2['buttonView']['set']({'label':yi(_0x56da1e,'AI\x20Commands'),'icon':_0x5ec5fd,'tooltip':!0x0}),_0x2fc6e2['on']('execute',_0x4a5b46=>this['_onExecute'](_0x4a5b46['source']['id'])),Ft(_0x2fc6e2,_0xcd97d6['ui']['view']['body'],function(_0x56a625){const _0x4b8410=bi(_0x56a625['config']['get']('ai.assistant.commands'),_0x56a625['locale']),_0x12cc07=ji(_0x56a625,_0x4b8410)['filter'](_0xcaeaab=>_0xcaeaab['commands']['length']);if(0x1===_0x12cc07['length'])return ji(_0x56a625,_0x12cc07[0x0]['commands'])['map'](_0x29527c=>({'id':_0x29527c['id'],'label':_0x29527c['label']}));return _0x12cc07['map'](_0x2064cf=>{const {groupId:_0x317b98,groupLabel:_0x5da4f7,commands:_0x23e836}=_0x2064cf,_0x46118e=ji(_0x56a625,_0x23e836)['map'](_0x529e96=>({'id':_0x529e96['id'],'label':_0x529e96['label']}));return{'id':_0x317b98,'menu':_0x5da4f7||_0x317b98,'children':_0x46118e};});}(_0xcd97d6),{'ariaLabel':yi(_0x56da1e,'AI\x20Commands')}),_0x2fc6e2['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0xfec9c0['on']('change:enabledCommandsIds',_0x4063fd),_0x2fc6e2['menuView']['once']('render',_0x4063fd),_0x2fc6e2;function _0x4063fd(){_0x2fc6e2['isEnabled']=_0xfec9c0['enabledCommandsIds']['length']>0x0;for(const _0x451d9a of _0x2fc6e2['menuView']['buttons'])_0x451d9a['isEnabled']=_0xfec9c0['enabledCommandsIds']['includes'](_0x451d9a['id']);}}),_0xcd97d6['ui']['componentFactory']['add']('menuBar:aiCommands',_0x472c54=>{const _0x5f1b83=new Kt(_0x472c54);_0x5f1b83['buttonView']['set']({'label':yi(_0x472c54,'AI\x20Commands'),'icon':_0x5ec5fd}),_0x5f1b83['bind']('isEnabled')['to'](_0xfec9c0,'enabledCommandsIds',_0x3d0183=>_0x3d0183['length']>0x0);const _0x2b7345=bi(_0xcd97d6['config']['get']('ai.assistant.commands'),_0x472c54);return this['_populateMenuBarMenu'](_0xfec9c0,_0x5f1b83,_0x2b7345,_0x388ace=>this['_onExecute'](_0x388ace)),_0x5f1b83;}),_0xcd97d6['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x436698=this['_createAIAssistantUIButton'](Nt);return _0x436698['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x436698;}),_0xcd97d6['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x5e21cf=this['_createAIAssistantUIButton'](Wt);return _0x5e21cf['set']({'role':'menuitemcheckbox'}),_0x5e21cf;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x32d757=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x12c284;for(const _0x4814ba in _0x32d757){const _0x35cd87=_0x4814ba,_0x35b131=_0x32d757[_0x35cd87];if('aiLicenseKeyValid'==_0x35b131||'aiLicenseKeyInvalid'==_0x35b131||'aiLicenseKeyExpired'==_0x35b131||'aiLicenseKeyDomainLimit'==_0x35b131||'aiLicenseKeyNotAllowed'==_0x35b131||'aiLicenseKeyEvaluationLimit'==_0x35b131||'aiLicenseKeyUsageLimit'==_0x35b131){delete _0x32d757[_0x35cd87],_0x12c284=_0x35b131,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x12c284&&_0x32d757['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x12c284&&_0x32d757['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x12c284&&_0x32d757['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x12c284&&_0x32d757['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x12c284&&_0x32d757['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x12c284&&_0x32d757['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x4c7ebf='',_0x4ab7f7='',_0x1d3c55='custom'){const _0x3a06bf=this['editor'],_0x502d86=_0x3a06bf['editing']['view'],_0x1c98d6=_0x3a06bf['plugins']['get'](ki),_0x444aa9=_0x3a06bf['plugins']['get'](_0x5b826c);_0x1c98d6['showFakeVisualSelection']();const _0x255cc1=new Qi(),_0x1ccd0b=new ClipboardEvent('copy',{'clipboardData':_0x255cc1}),_0x101316=new _0x421b01(_0x255cc1),_0x504e14=new _0x336776(_0x502d86,_0x1ccd0b,{'dataTransfer':_0x101316});_0x444aa9['_forceMarkersCopy']('comment',()=>{_0x502d86['document']['fire']('copy',_0x504e14);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new Pi(_0x3a06bf,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x4cf5d4=_0x101316['getData']('text/html');const _0x5aa150=_0x3a06bf['model']['document']['selection'],_0x34d97b=Array['from'](_0x5aa150['getRanges']());0x1===_0x34d97b['length']&&_0x34d97b[0x0]['isFlat']&&!_0x5aa150['getSelectedElement']()&&''!==_0x4cf5d4['replace'](/&nbsp;/g,'')['trim']()&&(_0x4cf5d4='<p>'+_0x4cf5d4+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x1d3c55,'query':_0x4c7ebf,'htmlContent':_0x4cf5d4,'label':_0x4ab7f7,'mainActionLabel':Hi[_0x3a06bf['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x13417a,'title':yi(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':Yt['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x1c98d6['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x49a1d6=new Map(),_0x311ba6=bi(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x406e9f of _0x311ba6)for(const _0x2696d6 of _0x406e9f['commands'])_0x49a1d6['set'](_0x2696d6['id'],{..._0x2696d6,'groupId':_0x406e9f['groupId'],'groupLabel':_0x406e9f['groupLabel']||_0x406e9f['groupId']});return _0x49a1d6;}['_createAIAssistantUIButton'](_0x578559){const _0x4b4fa5=this['editor'],_0x43aba2=_0x4b4fa5['commands']['get']('showAIAssistant'),_0x1182c1=new _0x578559(_0x4b4fa5['locale']);return _0x1182c1['set']({'label':yi(_0x4b4fa5['locale'],'AI\x20Assistant'),'icon':_0x13417a,'isToggleable':!0x0}),_0x1182c1['bind']('isEnabled')['to'](_0x43aba2),_0x1182c1['bind']('isOn')['to'](this['_dialog'],'id',_0x5ec489=>'aiAssistant'===_0x5ec489),this['listenTo'](_0x1182c1,'execute',()=>{_0x1182c1['isOn']?this['hideUI']():_0x43aba2['execute']();}),_0x1182c1;}['_initView'](){const _0x405a32=this['editor']['plugins']['get'](ki);this['_formView']=new qi(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',()=>{_0x405a32['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x405a32['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x33d5b3,ui:{ariaLiveAnnouncer:_0x5c405b}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x23fcc4,_0x3f7595,_0x14b2d9)=>{const _0x35da0d=this['_aiAssistantController']['currentContext'];_0x14b2d9?_0x5c405b['announce'](yi(_0x33d5b3,'AI\x20is\x20writing')):_0x35da0d&&_0x5c405b['announce'](yi(_0x33d5b3,'Generated\x20content:\x20%0',_0x35da0d),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x19df7c,_0x510d87,_0x4aec6c)=>{if(_0x4aec6c){const _0x2a736a=this['_formView']['errorView']['text'];_0x5c405b['announce'](yi(_0x33d5b3,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2a736a));}});}['_onExecute'](_0x5bdd31){const _0xa6552=this['_commandDefinitions']['get'](_0x5bdd31),_0x1ba2fd=this['editor'],_0x203958=_0x1ba2fd['model']['document']['selection'],_0x5afbbc=_0x1ba2fd['commands']['get']('showAIAssistant'),_0x42aa19=_0x1ba2fd['plugins']['get'](ki),_0x1e98b6=''+(_0xa6552['groupId']!==Si?_0xa6552['groupLabel']+':\x20':'')+_0xa6552['label'];if(!0x1!==_0xa6552['requiresContent']&&_0x203958['isCollapsed']){const _0x429b35=It(_0x203958['getSelectedBlocks']())||_0x1ba2fd['model']['schema']['getLimitElement'](_0x203958);_0x1ba2fd['model']['change'](_0x38ec27=>{_0x38ec27['setSelection'](_0x429b35,'in');});}_0x42aa19['showFakeVisualSelection'](),_0x5afbbc['execute'](_0xa6552['prompt'],_0x1e98b6,'command:'+_0x5bdd31);}['_populateMenuBarMenu'](_0x5eeafc,_0xabbe7e,_0x3acc03,_0x3ba63e){const _0xa430ed=this['editor'],_0x1dbdd8=_0xa430ed['locale'],_0x274ef4=new $t(_0x1dbdd8),_0x14f67d=ji(_0xa430ed,_0x3acc03)['filter'](_0x4866ad=>_0x4866ad['commands']['length']);0x1===_0x14f67d['length']?this['_getMenuBarGroupButtons']({'command':_0x5eeafc,'commands':_0x14f67d[0x0]['commands'],'parentMenuView':_0xabbe7e,'onExecute':_0x3ba63e})['forEach'](_0x3036b5=>_0x274ef4['items']['add'](_0x3036b5)):_0x14f67d['forEach'](({groupId:_0x156b4c,groupLabel:_0x3e8c61,commands:_0x2bf354})=>{const _0x40edfd=new qt(_0x1dbdd8,_0xabbe7e),_0x423a4a=new Kt(_0x1dbdd8),_0x1978b9=new $t(_0x1dbdd8),_0x2a997a=this['_getMenuBarGroupButtons']({'command':_0x5eeafc,'commands':_0x2bf354,'parentMenuView':_0x423a4a,'onExecute':_0x3ba63e});_0x423a4a['buttonView']['set']({'label':_0x3e8c61||_0x156b4c}),_0x423a4a['delegate']('execute')['to'](_0xabbe7e),_0x1978b9['items']['addMany'](_0x2a997a),_0x423a4a['panelView']['children']['add'](_0x1978b9),_0x40edfd['children']['add'](_0x423a4a),_0x274ef4['items']['add'](_0x40edfd);}),_0xabbe7e['panelView']['children']['add'](_0x274ef4);}['_getMenuBarGroupButtons']({command:_0x98f543,commands:_0x408212,parentMenuView:_0x4503ad,onExecute:_0x70d920}){const _0x4fb26e=this['editor'],_0x4501ad=_0x4fb26e['locale'];return ji(_0x4fb26e,_0x408212)['map'](_0xf27cb6=>{const _0x594699=new qt(_0x4501ad,_0x4503ad),_0x1700e4=new Wt(_0x4501ad);return _0x1700e4['set']({'label':_0xf27cb6['label']}),_0x1700e4['delegate']('execute')['to'](_0x4503ad),_0x1700e4['on']('execute',()=>_0x70d920(_0xf27cb6['id'])),_0x1700e4['bind']('isEnabled')['to'](_0x98f543,'enabledCommandsIds',_0x5a22c5=>_0x5a22c5['includes'](_0xf27cb6['id'])),_0x594699['children']['add'](_0x1700e4),_0x594699;});}}function zi(_0x1ef364,_0x3a79cd){return void 0x0!==_0x1ef364['order']&&void 0x0===_0x3a79cd['order']?0x1:void 0x0===_0x1ef364['order']&&void 0x0!==_0x3a79cd['order']?-0x1:void 0x0!==_0x1ef364['order']&&void 0x0!==_0x3a79cd['order']?_0x1ef364['order']-_0x3a79cd['order']:0x0;}function ji(_0x537dfa,_0x4afb92){_0x4afb92['sort'](zi);const _0x3a2ca3={},_0x81a3b6=[];for(const _0x87e4ee of _0x4afb92)if(void 0x0!==_0x87e4ee['order']){if(_0x87e4ee['order']in _0x3a2ca3)throw new ht('ai-commands-config-order-collision',_0x537dfa,{'conflictingDefinitions':[_0x87e4ee,_0x3a2ca3[_0x87e4ee['order']]]});_0x3a2ca3[_0x87e4ee['order']]=_0x87e4ee,_0x81a3b6['splice'](_0x87e4ee['order'],0x0,_0x87e4ee);}else _0x81a3b6['push'](_0x87e4ee);return _0x81a3b6;}class Ji extends _0x230b74{static get['requires'](){return[Xi,ki];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5f5b4c){super(_0x5f5b4c);const _0x2e51c4=_0x5f5b4c['config'],_0x3e26f7=_0x5f5b4c['locale'];_0x2e51c4['define']('ai.assistant.preserveComments',!0x0),_0x2e51c4['define']('ai.assistant.commands',Zi(_0x3e26f7)),_0x2e51c4['define']('ai.assistant.extraCommandGroups',[]),_0x2e51c4['define']('ai.assistant.removeCommands',[]);let _0x51b932=bi(_0x2e51c4['get']('ai.assistant.commands'),_0x3e26f7);const _0x54924e=_0x2e51c4['get']('ai.assistant.extraCommandGroups'),_0x596635=_0x2e51c4['get']('ai.assistant.removeCommands');_0x54924e['forEach'](_0x35db61=>{const _0x12e85e=_0x51b932['find'](_0x2adbd7=>_0x2adbd7['groupId']===_0x35db61['groupId']);_0x12e85e?_0x12e85e['commands']=_0x12e85e['commands']['concat'](_0x35db61['commands']):_0x51b932['push'](_0x35db61);}),_0x51b932=_0x51b932['filter'](_0x5c54d1=>!_0x596635['includes'](_0x5c54d1['groupId'])),_0x51b932['forEach'](_0x2b1397=>{_0x2b1397['commands']=_0x2b1397['commands']['filter'](_0x62b2a6=>!_0x596635['includes'](_0x62b2a6['id']));}),_0x2e51c4['set']('ai.assistant.commands',_0x51b932);}}function Zi(_0x4dc81c){return[{'groupId':'editOrReview','groupLabel':yi(_0x4dc81c,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':yi(_0x4dc81c,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':yi(_0x4dc81c,'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':yi(_0x4dc81c,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':yi(_0x4dc81c,'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':yi(_0x4dc81c,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':yi(_0x4dc81c,'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':yi(_0x4dc81c,'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':yi(_0x4dc81c,'Change\x20tone'),'commands':[{'id':'professional','label':yi(_0x4dc81c,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':yi(_0x4dc81c,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':yi(_0x4dc81c,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':yi(_0x4dc81c,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':yi(_0x4dc81c,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':yi(_0x4dc81c,'Change\x20style'),'commands':[{'id':'business','label':yi(_0x4dc81c,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':yi(_0x4dc81c,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':yi(_0x4dc81c,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':yi(_0x4dc81c,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':yi(_0x4dc81c,'Translate'),'commands':[{'id':'translateEnglish','label':yi(_0x4dc81c,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':yi(_0x4dc81c,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':yi(_0x4dc81c,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':yi(_0x4dc81c,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':yi(_0x4dc81c,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':yi(_0x4dc81c,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':yi(_0x4dc81c,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':yi(_0x4dc81c,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ts extends _0x230b74{['abortController'];static get['requires'](){return[Ni];}constructor(_0xf0e508){super(_0xf0e508),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](Ni)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x4e962c){return this['sendRequest'](_0x4e962c)['catch'](_0x3ac133=>{if(_0x3ac133 instanceof vi)return Promise['reject'](_0x3ac133);if('AbortError'==_0x3ac133['name'])return Promise['resolve']();throw console['error'](_0x3ac133),new ht('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x179796,_0xc57eb7){const _0x5da58d=this['editor']['locale'],_0xf21d84={'Content-Type':'application/json'};if('object'==typeof _0x179796)Object['assign'](_0xf21d84,_0x179796);else{if(_0x179796)try{const _0x53b521=await _0x179796(_0xc57eb7);Object['assign'](_0xf21d84,_0x53b521);}catch{return Promise['reject'](new vi(yi(_0x5da58d,'AI_ERROR_GET_HEADERS')));}}return _0xf21d84;}async['_prepareRequestParameters'](_0x2dce39,_0x50f3fc){const _0x1cba42=this['editor']['locale'];if('object'==typeof _0x2dce39)return _0x2dce39;try{return await _0x2dce39(_0x50f3fc);}catch{return Promise['reject'](new vi(yi(_0x1cba42,'AI_ERROR_GET_PARAMETERS')));}}}class es extends ts{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x25f7d1){super(_0x25f7d1),_0x25f7d1['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x25f7d1['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x25f7d1['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x25f7d1['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x25f7d1['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x25f7d1['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x4bc289,context:_0x4cc16a,onData:_0x391b9d,actionId:_0x461a76}){const _0x551907=this['editor']['locale'],_0x6a1e77=await this['prepareMessages'](_0x4bc289,_0x4cc16a,_0x461a76),_0x5d41ca=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x461a76),_0x2ba4ba=await this['_prepareRequestParameters'](this['_requestParameters'],_0x461a76),_0x362d0b={'messages':_0x6a1e77,..._0x2ba4ba},_0x38b787={'method':'POST','headers':_0x5d41ca,'body':JSON['stringify'](_0x362d0b),'signal':this['abortController']['signal']},_0x53b7ed=await fetch(this['_apiUrl'],_0x38b787);if(_0x53b7ed['ok'])return _0x2ba4ba['stream']?await this['_readStreamableResponse'](_0x53b7ed,_0x391b9d):await this['_readStaticResponse'](_0x53b7ed,_0x391b9d),Promise['resolve']();{const _0x48fd44=await _0x53b7ed['text']();return _0x48fd44['includes']('context_length_exceeded')?Promise['reject'](new vi(yi(_0x551907,'AI_ERROR_CONTEXT_LENGTH'))):_0x48fd44['includes']('Moderation')?Promise['reject'](new vi(yi(_0x551907,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x48fd44));}}async['prepareMessages'](_0x10c192,_0xaa56d5,_0x75902a){let _0x4947d8,_0x3747cc;return _0xaa56d5?(_0x4947d8='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.',_0x3747cc='Instruction:\x0a'+_0x10c192+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0xaa56d5):(_0x4947d8='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.',_0x3747cc=_0x10c192),[{'role':'system','content':_0x4947d8},{'role':'user','content':_0x3747cc}];}async['_readStreamableResponse'](_0x381354,_0x2cced9){const _0x400f04=_0x381354['body']['getReader'](),_0x42360a=new TextDecoder();let _0x2fd06b='',_0x1e202b='',_0x21f9b8='',_0x1c9ca6=!0x1;for(;!_0x1c9ca6;){const {done:_0x1c8b58,value:_0x347116}=await _0x400f04['read'](),_0x14cf06=_0x2fd06b+_0x42360a['decode'](_0x347116);let _0x3c3c40='';_0x1c9ca6=_0x1c8b58;try{_0x3c3c40=this['_cleanUpData'](_0x14cf06),_0x2fd06b='';}catch{_0x2fd06b=_0x14cf06;continue;}_0x1e202b+=_0x3c3c40,!_0x1c9ca6&&this['_isBufferIncomplete'](_0x1e202b)||_0x1e202b&&(_0x21f9b8+=_0x1e202b,_0x1e202b='',_0x2cced9(_0x21f9b8));}return Promise['resolve']();}async['_readStaticResponse'](_0x2a78d5,_0x53c741){return _0x53c741((await _0x2a78d5['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x384af5){const _0x327c15=_0x384af5['split']('<')['length']!==_0x384af5['split']('>')['length'],_0xba84f=_0x384af5['length']<0x1e;return _0x327c15&&_0xba84f;}['_cleanUpData'](_0x56684e){return _0x56684e['split'](/\n(?![^{]*\})/g)['map'](_0x1408de=>_0x1408de['replace']('data:\x20',''))['filter'](_0x4d99ab=>_0x4d99ab&&_0x4d99ab['length']>0x0&&'[DONE]'!==_0x4d99ab)['map'](_0x2b9f76=>{const {choices:_0x1d4be4}=JSON['parse'](_0x2b9f76);if(_0x1d4be4[0x0]?.['delta']?.['content'])return _0x1d4be4[0x0]['delta']['content'];})['filter'](_0x25ca6b=>_0x25ca6b)['join']('');}}class is extends ts{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x217b95){super(_0x217b95),_0x217b95['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x217b95['config']['define']('ai.assistant.adapter.aws.requestParameters',{'model':'anthropic.claude-v2','max_tokens_to_sample':0x7d0,'temperature':0x1,'top_p':0x1,'top_k':0xfa,'anthropic_version':'bedrock-2023-05-31','stream':!0x0}),this['_apiUrl']=_0x217b95['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x217b95['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x217b95['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x217b95['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x162fbd,context:_0x265606,onData:_0x3b2c64,actionId:_0x1cfdc6}){const {model:_0x1952a5,stream:_0x1c4952,..._0x22d6d5}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x1cfdc6),_0x2fb4aa={'prompt':await this['preparePrompt'](_0x162fbd,_0x265606,_0x1952a5,_0x1cfdc6),..._0x22d6d5};this['_apiUrl']?await this['_processProxyRequest'](_0x2fb4aa,_0x1952a5,_0x1c4952,_0x3b2c64,_0x1cfdc6):await this['_processAWSRequest'](_0x2fb4aa,_0x1952a5,_0x1c4952,_0x3b2c64);}async['preparePrompt'](_0xf5ba2,_0x158d87,_0x552a43,_0x4102ce){let _0x4bd68c,_0x1dff26;return _0x158d87?(_0x4bd68c='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.',_0x1dff26='Instruction:\x0a'+_0xf5ba2+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x158d87):(_0x4bd68c='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.',_0x1dff26=_0xf5ba2),'meta.llama'==this['getModelFamily'](_0x552a43)?'<<SYS>>\x0a'+_0x4bd68c+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x1dff26+'\x0a[/INST]':'Human:\x0a'+_0x4bd68c+'\x0a'+_0x1dff26+'\x0a\x0aAssistant:';}['getModelFamily'](_0xb5fe24){if(/^anthropic\.claude/['test'](_0xb5fe24))return'anthropic.claude';if(/^ai21\.j2/['test'](_0xb5fe24))return'ai21.j2';if(/^cohere\.command/['test'](_0xb5fe24))return'cohere.command';if(/^meta\.llama/['test'](_0xb5fe24))return'meta.llama';throw new vi(yi(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0xb5fe24));}async['_processProxyRequest'](_0x4d0409,_0x46e154,_0x528d5d,_0x49d834,_0x2dc6f9){const _0x5dbb73={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2dc6f9),'body':JSON['stringify']({..._0x4d0409,'model':_0x46e154,'stream':_0x528d5d}),'signal':this['abortController']['signal']},_0x1d5280=await fetch(this['_apiUrl'],_0x5dbb73);_0x528d5d?await this['_readStreamableResponse'](_0x1d5280,_0x46e154,_0x49d834):await this['_readStaticResponse'](_0x1d5280,_0x46e154,_0x49d834);}async['_processAWSRequest'](_0x311871,_0x4002e9,_0x3c306c,_0x50cbd3){const _0x576f0a=new _0xb367e2(this['_bedrockClientConfig']),_0x3fdae0={'body':JSON['stringify'](_0x311871),'contentType':'application/json','accept':'application/json','modelId':_0x4002e9};let _0x3c0e22;if(_0x3c306c){const _0x4c0a63=new _0x3581b3(_0x3fdae0);_0x3c0e22=await _0x576f0a['send'](_0x4c0a63,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x3c0e22,_0x4002e9,_0x50cbd3);}else{const _0x5b40c2=new _0x59b6f7(_0x3fdae0);_0x3c0e22=await _0x576f0a['send'](_0x5b40c2,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x3c0e22,_0x4002e9,_0x50cbd3);}}async['_readAsyncIterableResponse'](_0x508fc1,_0x4a696a,_0x54b198){const _0x267f2e=_0x508fc1['body'],_0x53e337=new TextDecoder('utf-8');let _0x2dc518='';for await(const _0x28f23d of _0x267f2e)if(_0x28f23d['chunk']){const _0x1b2d7d=_0x53e337['decode'](_0x28f23d['chunk']['bytes']),_0xeac4=JSON['parse'](_0x1b2d7d);_0x2dc518+=this['_getGeneratedText'](_0xeac4,_0x4a696a),_0x54b198(_0x2dc518);}return Promise['resolve']();}async['_readStreamableResponse'](_0x53bae2,_0x3057e3,_0x4a656d){const _0x5037e0=_0x53bae2['body'],_0x236ef1=new TextDecoder('utf-8'),_0x106dc6=_0x5037e0['getReader']();let _0x5347a6='',_0x296602='',_0x1fb877=!0x1;for(;!_0x1fb877;){const {done:_0x275c11,value:_0x3673a9}=await _0x106dc6['read']();if(_0x1fb877=_0x275c11,_0x1fb877)break;const _0x3fa882=(_0x5347a6+_0x236ef1['decode'](_0x3673a9))['split']('\x0a')['map'](_0x4d9922=>{try{return _0x5347a6='',JSON['parse'](_0x4d9922);}catch{return _0x5347a6=_0x4d9922,null;}})['filter'](_0x5bebea=>null!==_0x5bebea);_0x3fa882['length']&&(_0x296602+=_0x3fa882['map'](_0x280651=>this['_getGeneratedText'](_0x280651,_0x3057e3))['join'](''),_0x4a656d(_0x296602));}return Promise['resolve']();}async['_readStaticResponse'](_0x4dd039,_0x164abd,_0x157379){let _0x3bb310;return _0x3bb310=_0x4dd039 instanceof Response?await _0x4dd039['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x4dd039['body'])),(_0x157379(this['_getGeneratedText'](_0x3bb310,_0x164abd)),Promise['resolve']());}['_getGeneratedText'](_0x3cd369,_0x1fd979){switch(this['getModelFamily'](_0x1fd979)){case'anthropic.claude':return _0x3cd369['completion'];case'ai21.j2':return _0x3cd369['completions'][0x0]['data']['text'];case'cohere.command':return _0x3cd369['generations'][0x0]['text'];case'meta.llama':return _0x3cd369['generation'];}}}class ss extends Nt{constructor(_0x56fbc6,_0x44b5f0={}){super(_0x56fbc6),this['isToggleable']=!0x0,this['set']('side',_0x44b5f0['side']||'top');const _0x2c3719=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...Et(_0x44b5f0['class']||[]),_0x2c3719['to']('side',_0x457c8b=>'ck-tab-button_'+_0x457c8b),_0x2c3719['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ns extends vt{['children'];constructor(_0x370110,_0x489abc={}){super(_0x370110);const _0x5b29ab=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',...Et(_0x489abc['class']||[]),_0x5b29ab['to']('class'),_0x5b29ab['if']('isVisible','ck-hidden',_0x10b976=>!_0x10b976)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class rs extends vt{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x274202,_0x47ba6e={}){super(_0x274202),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x47ba6e['side']||'top'),this['set']('isMaximized',!0x1);const _0x312372=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...Et(_0x47ba6e['class']||[]),_0x312372['to']('side',_0x2ca962=>'ck-tabs_'+_0x2ca962),_0x312372['to']('class'),_0x312372['to']('isMaximized',_0x1176b8=>_0x1176b8?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x312372['to']('side',_0x3a62ca=>'ck-tabs__buttons-container_'+_0x3a62ca)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x312372['to']('side',_0x8a5d4b=>'ck-tabs__panels-container_'+_0x8a5d4b)]},'children':this['panelViews']},...Et(_0x47ba6e['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0xa34d1a){const _0x472c18=this['_tabs']['get'](_0xa34d1a);return _0x472c18||null;}['addTab'](_0x1aab98){const _0x40890b=this['_setupButton']({'id':_0x1aab98['id'],'label':_0x1aab98['buttonLabel'],'icon':_0x1aab98['buttonIcon'],'order':_0x1aab98['order']}),_0x95326c=new ns(this['locale']);return _0x95326c['render'](),_0x1aab98['content']&&_0x95326c['children']['add'](_0x1aab98['content']),this['panelViews']['add'](_0x95326c),this['_tabs']['set'](_0x1aab98['id'],{'button':_0x40890b,'panel':_0x95326c,'order':void 0x0!==_0x1aab98['order']?_0x1aab98['order']:null}),this['fire']('addTab:'+_0x1aab98['id'],{'id':_0x1aab98['id'],'button':_0x40890b,'panel':_0x95326c}),null===this['activeTab']?this['activateTab'](_0x1aab98['id']):this['_hidePanel'](_0x1aab98['id']),{'button':_0x40890b,'panel':_0x95326c};}['activateTab'](_0x260182){if(null!==_0x260182&&!this['getTab'](_0x260182))throw new ht('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x260182});this['activeTab']!==_0x260182&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x260182,_0x260182&&this['_showPanel'](_0x260182),this['fire']('activateTab:'+_0x260182,_0x260182));}['showTab'](_0x1a29ce){if(!this['getTab'](_0x1a29ce))throw new ht('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x1a29ce});this['_showPanel'](_0x1a29ce),this['_showButton'](_0x1a29ce),this['fire']('show:'+_0x1a29ce,_0x1a29ce);}['hideTab'](_0x37fb4e){if(!this['getTab'](_0x37fb4e))throw new ht('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x37fb4e});const _0x2d3322=this['activeTab'];this['_hidePanel'](_0x37fb4e),this['_hideButton'](_0x37fb4e);const _0x2875ed=this['getTabIds']();_0x2d3322===_0x37fb4e&&_0x2875ed['length']>0x1&&this['activateTab'](_0x2875ed['find'](_0x4e2ae1=>_0x4e2ae1!==_0x37fb4e)),this['fire']('hide:'+_0x37fb4e,_0x37fb4e);}['_getPanel'](_0x2948c2){const _0x2f25a5=this['_tabs']['get'](_0x2948c2);return _0x2f25a5?_0x2f25a5['panel']:null;}['_showPanel'](_0x3c00cf){null!==this['activeTab']&&this['activeTab']!==_0x3c00cf||this['_getPanel'](_0x3c00cf)['show']();}['_hidePanel'](_0x2035b0){const _0x130d6a=this['_getPanel'](_0x2035b0);_0x130d6a['isVisible']&&(this['activeTab']===_0x2035b0&&(this['activeTab']=null),_0x130d6a['hide']());}['_getButton'](_0x1b376f){const _0x26bd4b=this['_tabs']['get'](_0x1b376f);return _0x26bd4b?_0x26bd4b['button']:null;}['_showButton'](_0x1559e9){this['_getButton'](_0x1559e9)['show']();}['_hideButton'](_0x360c84){this['_getButton'](_0x360c84)['hide']();}['_setupButton'](_0x209280){const _0x1771dc=new ss(this['locale'],{'side':this['side']}),_0x37c8e4=this['buttonViews'];if(_0x1771dc['set']({'label':_0x209280['label'],'icon':_0x209280['icon'],'tooltip':!0x0,'withText':!0x0}),_0x1771dc['bind']('isOn')['to'](this,'activeTab',_0x166cfc=>_0x166cfc===_0x209280['id']),_0x1771dc['bind']('side')['to'](this,'side'),_0x209280['order']){const _0x4e9109=[...this['_tabs']]['reduce']((_0x5b66db,_0xe51cf8)=>{const _0x3dd551=_0xe51cf8[0x0],{order:_0xefab7e}=_0xe51cf8[0x1];return!_0xefab7e||_0xefab7e>_0x209280['order']?_0x5b66db:_0xefab7e>=_0x5b66db['order']?{'id':_0x3dd551,'order':_0xefab7e}:_0x5b66db;},{'id':'','order':0x0}),_0x56e587=_0x37c8e4['getIndex'](this['_getButton'](_0x4e9109['id']));_0x37c8e4['add'](_0x1771dc,_0x56e587+0x1);}else _0x37c8e4['add'](_0x1771dc);return _0x1771dc['on']('execute',()=>{this['activateTab'](_0x209280['id']);}),_0x1771dc;}}const as=['overlay','sidebar','custom'],os=['left','right'];class hs extends rs{constructor(_0x3f0d4d,_0x42f360={}){super(_0x3f0d4d,_0x42f360),this['set']('type',_0x42f360['type']||'sidebar'),this['set']('side',_0x42f360['side']||'right'),this['set']('isVisible',_0x42f360['visibleByDefault']??!0x0);const _0x18cb16=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x18cb16['if']('type','ck-ai-tabs__overlay',_0x1cd034=>'overlay'===_0x1cd034),_0x18cb16['if']('type','ck-ai-tabs__sidebar',_0x366635=>'sidebar'===_0x366635),_0x18cb16['if']('isVisible','ck-hidden',_0x2bd0aa=>!_0x2bd0aa)]}}),this['buttonViews']['on']('add',(_0x1db722,_0x1178bb)=>{_0x1178bb['set']('withText',!0x1);});}}class cs extends _0x4c168b{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2e41bf){super(_0x2e41bf);const _0x314176=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x314176)throw new ht('ai-tabs-configuration-not-found');if(void 0x0!==_0x314176['showResizeButton']&&(this['showResizeButton']=_0x314176['showResizeButton']),'sidebar'!==_0x314176['type']&&'overlay'!==_0x314176['type']||_0x314176['side']&&(this['side']=_0x314176['side']),'sidebar'===_0x314176['type']){if(this['container']=_0x314176['element'],this['set']('type','sidebar'),!this['container'])throw new ht('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x314176['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new hs(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x314176['visibleByDefault']||_0x314176['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 _0x54b56a&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x4b773f){if(_0x4b773f&&this['type']!==_0x4b773f){if(!as['includes'](_0x4b773f))throw new ht('ai-tabs-unsupported-ui-type');this['type']=_0x4b773f;}}['switchSide'](_0x158677){if(_0x158677&&this['side']!==_0x158677){if(!os['includes'](_0x158677))throw new ht('ai-tabs-unsupported-ui-side');this['side']=_0x158677;}}['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 ls extends _0x4c168b{['_apiUrl'];['_token'];['_decoder'];['_responseCache'];static get['requires'](){return[_0x26600c];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x59ea7e){super(_0x59ea7e),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(),this['_responseCache']=new Map();}['init'](){const _0x977dee=this['context']['plugins']['get'](_0x26600c);if(!_0x977dee['token'])throw new ht('ai-missing-token',this);this['_token']=_0x977dee['token'];}['startConversation'](_0x4c3e46,_0x5cd2cc){const _0x50163b=this['_sendApiRequest']('/conversations','POST',{'id':_0x4c3e46,'group':_0x5cd2cc});return{'getConversation':async()=>(await _0x50163b['request'])['json'](),'abortController':_0x50163b['abortController']};}['queryAssistant']({message:_0x5a8f87,conversationId:_0x1e2e8c,parts:_0x321b3c,capabilities:_0x2dc96,model:_0x46aa4a,attributes:_0x9eebc3}){const _0x545a11={'prompt':_0x5a8f87,'content':_0x321b3c,'model':_0x46aa4a,..._0x2dc96&&{'capabilities':_0x2dc96},..._0x9eebc3&&{'attributes':_0x9eebc3}},_0x623a33=this['_sendApiRequest']('/conversations/'+_0x1e2e8c+'/messages','POST',_0x545a11);return{'getStream':async()=>{const _0x3af940=(await _0x623a33['request'])['body'];return this['_getStreamReader'](_0x3af940);},'abortController':_0x623a33['abortController']};}['executeCustomAction']({content:_0x28f0d8,message:_0x553799,model:_0x591bb1,outputFormat:_0xcaea6d}){const _0x29e0fe={'content':[{'type':'text','content':_0x28f0d8}],'prompt':_0x553799,'model':_0x591bb1,'outputFormat':_0xcaea6d},_0x5ff805=this['_sendApiRequest']('/actions/custom/calls','POST',_0x29e0fe);return{'getStream':async()=>{const _0x547913=(await _0x5ff805['request'])['body'];return this['_getStreamReader'](_0x547913);},'abortController':_0x5ff805['abortController']};}['executeAction']({actionName:_0xca7f59,content:_0x42ef39,args:_0x23a96c}){const _0x38d1e8={'content':[{'type':'text','content':_0x42ef39}],'args':_0x23a96c},_0x74d035=this['_sendApiRequest']('/actions/system/'+_0xca7f59+'/calls','POST',_0x38d1e8);return{'getStream':async()=>{const _0x303579=(await _0x74d035['request'])['body'];return this['_getStreamReader'](_0x303579);},'abortController':_0x74d035['abortController']};}['uploadFile'](_0x17e491,_0x2d45e2,_0x12c752){const _0x19cec9=new FormData();_0x19cec9['append']('file',_0x2d45e2,_0x2d45e2['name']),_0x12c752&&_0x19cec9['append']('attributes',JSON['stringify'](_0x12c752));const _0xf0e194=this['_sendApiRequest']('/conversations/'+_0x17e491+'/files','POST',_0x19cec9);return{'getId':async()=>(await _0xf0e194['request'])['json'](),'abortController':_0xf0e194['abortController']};}['fetchDocument'](_0x5b2bcf,_0x18c6e3){const _0x4fdaa5=this['_sendApiRequest']('/conversations/'+_0x5b2bcf+'/documents/'+_0x18c6e3,'GET');return{'getDocument':async()=>(await _0x4fdaa5['request'])['json'](),'abortController':_0x4fdaa5['abortController']};}['uploadDocument'](_0x56273a,_0x11c89a,_0x545d66){const _0x32f7d3={'content':_0x11c89a};_0x545d66&&(_0x32f7d3['attributes']=_0x545d66);const _0x5c6af1=this['_sendApiRequest']('/conversations/'+_0x56273a+'/documents','POST',_0x32f7d3);return{'getId':async()=>(await _0x5c6af1['request'])['json'](),'abortController':_0x5c6af1['abortController']};}['fetchConversations'](_0x2474c5,_0x31d0e8={}){const _0x39e1d6=new URLSearchParams();_0x39e1d6['append']('group',_0x2474c5),_0x39e1d6['append']('excludeEmpty',!0x1!==_0x31d0e8['excludeEmpty']?'true':'false'),_0x39e1d6['append']('limit',_0x31d0e8['limit']?_0x31d0e8['limit']['toString']():'100'),_0x39e1d6['append']('sortBy',_0x31d0e8['sortBy']?_0x31d0e8['sortBy']:'createdAt'),_0x39e1d6['append']('order',_0x31d0e8['order']?_0x31d0e8['order']:'desc');const _0x830a67=this['_sendApiRequest']('/conversations?'+_0x39e1d6['toString'](),'GET');return{'getConversations':async()=>{const _0x55af61=await _0x830a67['request'];return(await _0x55af61['json']())['items'];},'abortController':_0x830a67['abortController']};}['deleteConversation'](_0x2b6159){const _0x40c3a8=this['_sendApiRequest']('/conversations/'+_0x2b6159,'DELETE');return{'execute':async()=>{await _0x40c3a8['request'];},'abortController':_0x40c3a8['abortController']};}['updateConversation'](_0x49aa7f,_0x5f39d4){const _0x3b9418=this['_sendApiRequest']('/conversations/'+_0x49aa7f,'PATCH',_0x5f39d4);return{'getResult':async()=>(await _0x3b9418['request'],_0x5f39d4),'abortController':_0x3b9418['abortController']};}['fetchConversation'](_0x1d0a9b){const _0x36f9c0=this['_sendApiRequest']('/conversations/'+_0x1d0a9b,'GET');return{'getConversation':async()=>(await _0x36f9c0['request'])['json'](),'abortController':_0x36f9c0['abortController']};}['fetchConversationMessages'](_0x217350){const _0xea4012=this['_sendApiRequest']('/conversations/'+_0x217350+'/messages','GET');return{'getMessages':async()=>{const _0x5e6b95=await _0xea4012['request'];return(await _0x5e6b95['json']())['items'];},'abortController':_0xea4012['abortController']};}['uploadUrl'](_0x56e4b2,_0x294247,_0x96fda2){const _0x34b63d=this['_sendApiRequest']('/conversations/'+_0x56e4b2+'/web-resources','POST',{'url':_0x294247,'attributes':_0x96fda2});return{'getId':async()=>(await _0x34b63d['request'])['json'](),'abortController':_0x34b63d['abortController']};}['getModels'](_0x361321='en'){const _0x206f54=new URLSearchParams();_0x206f54['append']('language',_0x361321);const _0x2400ea='/models/1?'+_0x206f54['toString'](),_0x282eff=this['_sendApiRequest'](_0x2400ea,'GET',void 0x0,!0x0);return{'list':async()=>await(await _0x282eff['request'])['json'](),'abortController':_0x282eff['abortController']};}['deleteFile'](_0x243741,_0x11dc3c){const _0x4e0a04=this['_sendApiRequest']('/conversations/'+_0x243741+'/files/'+_0x11dc3c,'DELETE');return{'execute':async()=>{await _0x4e0a04['request'];},'abortController':_0x4e0a04['abortController']};}['deleteDocument'](_0x22dc78,_0x7b134){const _0x23bed5=this['_sendApiRequest']('/conversations/'+_0x22dc78+'/documents/'+_0x7b134,'DELETE');return{'execute':async()=>{await _0x23bed5['request'];},'abortController':_0x23bed5['abortController']};}['deleteWebResource'](_0x5b637e,_0x4baee8){const _0x32fd2b=this['_sendApiRequest']('/conversations/'+_0x5b637e+'/web-resources/'+_0x4baee8,'DELETE');return{'execute':async()=>{await _0x32fd2b['request'];},'abortController':_0x32fd2b['abortController']};}['callSystemReview']({reviewName:_0xe5126b,content:_0x45cac4,args:_0x5a41c0}){const _0x51c6e3=this['_sendApiRequest']('/reviews/system/'+_0xe5126b+'/calls','POST',{'content':[{'type':'text','content':_0x45cac4}],'args':_0x5a41c0});return{'getStream':async()=>{const _0x2e598e=(await _0x51c6e3['request'])['body'];return this['_getStreamReader'](_0x2e598e);},'abortController':_0x51c6e3['abortController']};}['callCustomReview']({content:_0x2d0e31,prompt:_0x4203b6,model:_0x3ed42a}){const _0x42c123=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x2d0e31}],'prompt':_0x4203b6,'model':_0x3ed42a});return{'getStream':async()=>{const _0x27c991=(await _0x42c123['request'])['body'];return this['_getStreamReader'](_0x27c991);},'abortController':_0x42c123['abortController']};}['upsertAIChatRating'](_0x487954,_0x22d7a6,_0x2a99b5){const _0x5bcb9f=this['_sendApiRequest']('/conversations/'+_0x487954+'/messages/'+_0x22d7a6+'/ratings','PUT',{'positiveCount':_0x2a99b5['positiveCount'],'totalCount':_0x2a99b5['totalCount'],'modificationId':_0x2a99b5['modificationId']});return{'execute':async()=>{await _0x5bcb9f['request'];},'abortController':_0x5bcb9f['abortController']};}['upsertAIActionRating'](_0x5a85c9,_0x6daab3,_0x335236){const _0x1fe114=this['_sendApiRequest']('/actions/system/'+_0x5a85c9+'/calls/'+_0x6daab3+'/ratings','PUT',{'positiveCount':_0x335236['positiveCount'],'totalCount':_0x335236['totalCount']});return{'execute':async()=>{await _0x1fe114['request'];},'abortController':_0x1fe114['abortController']};}['upsertCustomAIActionRating'](_0x256291,_0x5d133e){const _0x24d8f6=this['_sendApiRequest']('/actions/custom/calls/'+_0x256291+'/ratings','PUT',{'positiveCount':_0x5d133e['positiveCount'],'totalCount':_0x5d133e['totalCount']});return{'execute':async()=>{await _0x24d8f6['request'];},'abortController':_0x24d8f6['abortController']};}['upsertAIReviewRating'](_0x569679,_0x2befb8,_0x349b83,_0x1d36af){const _0x309e58=this['_sendApiRequest']('/reviews/system/'+_0x569679+'/calls/'+_0x2befb8+'/ratings','PUT',{'positiveCount':_0x349b83['positiveCount'],'totalCount':_0x349b83['totalCount'],'dataId':_0x1d36af});return{'execute':async()=>{await _0x309e58['request'];},'abortController':_0x309e58['abortController']};}['upsertCustomAIReviewRating'](_0x3b023f,_0x458953,_0x5106f7){const _0x20bc9a=this['_sendApiRequest']('/reviews/custom/calls/'+_0x3b023f+'/ratings','PUT',{'positiveCount':_0x458953['positiveCount'],'totalCount':_0x458953['totalCount'],'dataId':_0x5106f7});return{'execute':async()=>{await _0x20bc9a['request'];},'abortController':_0x20bc9a['abortController']};}['_sendApiRequest'](_0x5149bb,_0x906997,_0x361abc,_0x4b23a1=!0x1){const _0x156de1=new AbortController(),_0x3cd2dd=_0x4b23a1?_0x906997+':'+_0x5149bb:null;if(_0x3cd2dd){const _0x490d82=this['_responseCache']['get'](_0x3cd2dd);if(_0x490d82)return{'request':_0x490d82['then'](_0x4a25fe=>_0x4a25fe['clone']()),'abortController':_0x156de1};}const _0x42d066=_0x361abc instanceof FormData,_0x24406f={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x361abc&&!_0x42d066&&(_0x24406f['Content-Type']='application/json');const _0x85bdc0={'method':_0x906997,'headers':_0x24406f,'signal':_0x156de1['signal']};_0x361abc&&(_0x85bdc0['body']=_0x42d066?_0x361abc:JSON['stringify'](_0x361abc));const _0xb73316=fetch(''+this['_apiUrl']+_0x5149bb,_0x85bdc0)['catch'](_0x32b524=>{_0x3cd2dd&&this['_responseCache']['delete'](_0x3cd2dd),this['_handleError'](_0x32b524);})['then'](_0x5a42e=>_0x5a42e['ok']?_0x5a42e:_0x5a42e['json']()['then'](_0x5157a9=>{throw _0x3cd2dd&&this['_responseCache']['delete'](_0x3cd2dd),{'url':this['_apiUrl'],'path':_0x5149bb,'method':_0x906997,'body':_0x361abc,'status':(_0x5a42e||{})['status'],'statusText':(_0x5a42e||{})['statusText'],'code':_0x5157a9['code'],'message':_0x5157a9['message'],'traceId':_0x5157a9['traceId']};}));return _0x3cd2dd&&this['_responseCache']['set'](_0x3cd2dd,_0xb73316['then'](_0x309d19=>_0x309d19['clone']())),{'request':_0xb73316,'abortController':_0x156de1};}async*['_getStreamReader'](_0x40cf5e){const _0x3c4571=[],_0x1d84a8=_0x40cf5e['getReader'](),_0x594d4d=_0x588f5f({'onError':_0x1c92c1=>{this['_handleError'](_0x1c92c1);},'onEvent':_0x1a14cd=>{_0x1a14cd['data']=JSON['parse'](_0x1a14cd['data']),_0x3c4571['push'](_0x1a14cd);}});try{let _0x14010d=!0x1;for(;!_0x14010d;){const {done:_0x12d877,value:_0x91d1bd}=await _0x1d84a8['read']();_0x12d877&&(_0x14010d=!0x0),_0x594d4d['feed'](this['_decoder']['decode'](_0x91d1bd,{'stream':!0x0})),yield*_0x3c4571,_0x3c4571['length']=0x0;}}catch(_0x425014){this['_handleError'](_0x425014);}finally{_0x1d84a8['releaseLock'](),_0x594d4d['reset']();}}['_handleError'](_0x4dc053){if(_0x4dc053 instanceof ht)throw _0x4dc053;if(_0x4dc053 instanceof Error&&'AbortError'===_0x4dc053['name'])throw new ht('ai-request-aborted',this,{'originalError':_0x4dc053});throw new ht('ai-request-failed',this,{'originalError':_0x4dc053});}}function us(_0x587ddc,_0x3da400,_0x5d92d0){const t=_0x587ddc['t'];switch(_0x3da400){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'},_0x5d92d0);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.'},_0x5d92d0);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.'},_0x5d92d0);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.'},_0x5d92d0);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'},_0x5d92d0);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x5d92d0);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'},_0x5d92d0);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.'},_0x5d92d0);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.'},_0x5d92d0);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.'},_0x5d92d0);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.'},_0x5d92d0);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'},_0x5d92d0);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.'},_0x5d92d0);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 _0x3da400;}}const ds='ck-ai-button-primary',_s='ck-ai-button-secondary',As='ck-ai-button-tertiary';function gs(_0x830eff,_0x49bb10){const _0x5695fa=new Nt(_0x830eff),_0x56a3ab=us(_0x830eff,'AI_TABS_LABEL_MINIMIZE'),_0x20710f=us(_0x830eff,'AI_TABS_LABEL_MAXIMIZE');return _0x5695fa['set']({'withText':!0x1,'icon':_0x2442ce,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+As}),_0x5695fa['bind']('label')['to'](_0x49bb10,'isMaximized',_0x9e20ec=>_0x9e20ec?_0x56a3ab:_0x20710f),_0x5695fa['bind']('icon')['to'](_0x49bb10,'isMaximized',_0x27b94a=>_0x27b94a?_0xc10fbb:_0x2442ce),_0x5695fa['bind']('isOn')['to'](_0x49bb10,'isMaximized'),_0x5695fa['on']('execute',()=>{_0x49bb10['fire']('resizeTabs');}),_0x5695fa;}function Is(_0x2259e4){return _0x12edac(_0x2259e4);}function Es(_0x57ea12){return _0x18e7f8(_0x57ea12);}function ps(_0x1d792e,_0x5d898f,_0x339383){const _0x1986fb=null!==_0x5d898f?_0x18387b=>_0x18387b['attribs'][_0x1d792e]===_0x5d898f:_0x2bd759=>Boolean(_0x2bd759['attribs'][_0x1d792e]);return _0xff2f34(_0x2e216d=>_0x699811(_0x2e216d)&&_0x1986fb(_0x2e216d),_0x339383);}function Ts(_0x2f94c9,_0x10eec2,_0x33089b){const _0x51f7f6=null!==_0x10eec2?_0x30fe39=>_0x30fe39['attribs'][_0x2f94c9]===_0x10eec2:_0x288037=>Boolean(_0x288037['attribs'][_0x2f94c9]);return _0x57e7f5(_0x5edb49=>_0x699811(_0x5edb49)&&_0x51f7f6(_0x5edb49),_0x33089b);}function ms(_0x1946be,_0x47ad10){return _0x1946be&&_0x699811(_0x1946be)?_0x1946be['attribs'][_0x47ad10]:null;}function Cs(_0x4ed2e5,_0x38b9af,_0xca903b){_0x699811(_0x4ed2e5)&&(null===_0xca903b?delete _0x4ed2e5['attribs'][_0x38b9af]:_0x4ed2e5['attribs'][_0x38b9af]=_0xca903b);}function ws(_0x5d9cb5,_0x530f29,_0x5b5c6b){const _0x507fa3=_0x530f29['cloneNode'](!0x0);'beforebegin'===_0x5b5c6b?_0x428c7a(_0x5d9cb5,_0x507fa3):'afterbegin'===_0x5b5c6b?_0x40ad33(_0x5d9cb5,_0x507fa3):'beforeend'===_0x5b5c6b?_0x5dc0c5(_0x5d9cb5,_0x507fa3):'afterend'===_0x5b5c6b&&_0xfeeaba(_0x5d9cb5,_0x507fa3);}function fs(_0x4b1d82){const _0x203b0e=[];let _0xb724e7=_0x4b1d82;for(;_0xb724e7;)_0xb724e7=_0x6f12aa(_0xb724e7),_0xb724e7&&_0x203b0e['push'](_0xb724e7);return _0x203b0e;}function Ss(_0x574105){return _0x574105['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function bs(_0x643934){let _0x40649b=0x0;for(;_0x643934['parentNode'];)_0x643934=_0x643934['parentNode'],_0x40649b++;return _0x40649b;}function Rs(_0x444221){const _0xbe35d4=[];let _0x645acf=_0x444221['nextSibling'];for(;_0x645acf;)_0xbe35d4['push'](_0x645acf),_0x645acf=_0x645acf['nextSibling'];_0xbe35d4['forEach'](_0x14403c=>{_0x1e1233(_0x14403c);});}class Os extends/* #__PURE__ -- @preserve */
25
- ct(){['_m2html'];constructor(){super();const _0x206745=Object['entries'](_0x3b6d6e),_0x1096dc=_0x206745['findIndex'](([_0x305e54])=>'rehypeDomRaw'===_0x305e54);if(-0x1===_0x1096dc)throw new ht('ai-response-parser-unable-to-set-up-parser');_0x206745['splice'](_0x1096dc+0x1,0x0,['rehypeSanitize',_0x492a37]),this['_m2html']=new _0x1c7603({'plugins':Object['fromEntries'](_0x206745)});}['convertMarkdownToHTML'](_0x39db09){const _0x5b7d6f=this['_m2html']['parse'](_0x39db09);return this['parseAndNormalizeHTML'](_0x5b7d6f);}['parseAndNormalizeHTML'](_0x59b6da){return this['_parseHTML'](_0x59b6da);}['_parseHTML'](_0x5eee44){const _0x54f106=Is('<dummy>'+_0x5eee44['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x54f106['children']=_0x54f106['children'][0x0]['children'],_0x54f106;}}class ks extends/* #__PURE__ -- @preserve */
26
- ct(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x883788){super(),this['_generateUid']=_0x883788||ot;}['merge'](_0xf80568,_0xa289c4,_0x4e8892){const _0x18afcd=_0xf80568['cloneNode'](!0x0);if(0x0===_0xa289c4['childNodes']['length']){const _0x19b1c3=[];return Ts('data-id','new-element',_0x18afcd)['forEach'](_0x10cae0=>{const _0x5bd3b0=this['_generateUid']();Cs(_0x10cae0,'data-id',_0x5bd3b0),_0x19b1c3['push'](_0x5bd3b0);}),this['_removeSpecialComments'](_0x18afcd),{'parsedContent':_0x18afcd,'newNodeIds':_0x19b1c3,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x4e8892&&_0x4e8892['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x18afcd),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Ts('data-id',null,_0xa289c4)['map'](_0x49a995=>ms(_0x49a995,'data-id'))['filter'](_0x3e0ba6=>!!_0x3e0ba6));let _0x3500b5=-0x1,_0x1919da=!0x1;const _0x1aebf1=_0x18afcd['childNodes'],_0x2cbf4f=Array['from'](_0x1aebf1)['filter'](_0x515f96=>!(0x3===_0x515f96['nodeType']&&''===Es(_0x515f96)['trim']())),_0x4202ad=_0x2cbf4f['length'];for(let _0x25a9f8=0x0;_0x25a9f8<_0x4202ad;_0x25a9f8++){const _0x4147cc=_0x2cbf4f[_0x25a9f8],_0x3f1ac4=_0x2cbf4f[_0x25a9f8+0x1];if(this['_isNewNode'](_0x4147cc)){if(-0x1===_0x3500b5&&(_0x3500b5=_0x25a9f8),this['_markWrappedElements'](_0x4147cc),!this['_isNewNode'](_0x3f1ac4)){const [_0x523b92,_0x5ba7c5]=this['_findReferenceNode'](_0x4147cc,_0x1919da,_0xa289c4);if(_0x523b92){const _0x49651f=Array['from'](_0x2cbf4f)['slice'](_0x3500b5,_0x25a9f8+0x1);this['_insertNodes'](_0x523b92,_0x49651f,_0x5ba7c5),_0x3500b5=-0x1;}}}else{if(this['_isExistingContentComment'](_0x4147cc))_0x1919da=!0x0;else{if(this['_isExistingNode'](_0x4147cc)){const _0x37747f=ms(_0x4147cc,'data-id');if(_0x37747f&&this['_existingDataIds']['has'](_0x37747f)){const _0x414dde=ps('data-id',_0x37747f,_0xa289c4);this['_replaceNode'](_0x414dde,_0x4147cc);}if(this['_touchedNodesState']['removedIds']['includes'](_0x37747f)){const _0x571472=this['_touchedNodesState']['removedIds']['indexOf'](_0x37747f);this['_touchedNodesState']['removedIds']['splice'](_0x571472,0x1);}}else{if(this['_isDelNode'](_0x4147cc)){const _0x1a63dd=ms(_0x4147cc,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x1a63dd)||this['_storeDeletedElementIds'](_0x4147cc);}}}}}for(const _0x1b10c8 of this['_touchedNodesState']['removedIds']){const _0x45fd92=ps('data-id',_0x1b10c8,_0xa289c4);if(_0x45fd92){if(_0x4e8892&&_0x4e8892['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x1b10c8;const _0x48d639=_0x4e8892['replaceRemovedWith']['cloneNode'](!0x0);Cs(_0x48d639,'data-id',_0x1b10c8),Cs(_0x48d639,'data-removed','true'),_0x73cead(_0x45fd92,_0x48d639);}else _0x1e1233(_0x45fd92);}}if(Ts('data-wrapped-id',null,_0xa289c4)['forEach'](_0x191e41=>{const _0x2a3c06=ps('data-id',ms(_0x191e41,'data-wrapped-id'),_0xa289c4);var _0x4142a3,_0x48989b;_0x2a3c06&&(_0x48989b=_0x191e41,_0x1e1233(_0x4142a3=_0x2a3c06),_0x73cead(_0x48989b,_0x4142a3));}),Ts('data-id','new-element',_0xa289c4)['forEach'](_0x85a69=>{const _0x157464=this['_getUid'](_0x85a69);Cs(_0x85a69,'data-id',_0x157464),this['_touchedNodesState']['newIds']['push'](_0x157464);}),this['_removeSpecialComments'](_0xa289c4),_0x4e8892&&_0x4e8892['markUnstableElements']&&this['_markUnstableElements'](_0xa289c4,_0x4e8892['markUnstableElementsDepth']||0x0),_0x4e8892&&_0x4e8892['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x3e6e93=ps('data-id',this['_touchedNodesState']['lastTouchedId'],_0xa289c4);for(;_0x3e6e93;)Rs(_0x3e6e93),_0x3e6e93=_0x3e6e93['parentNode'];}return{'parsedContent':_0xa289c4,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x3a170f,_0x108cf6,_0x33698f){for(const _0x46bc5b of _0x108cf6){const _0x42e82a=this['_getUid'](_0x46bc5b);Cs(_0x46bc5b,'data-id',_0x42e82a),this['_touchedNodesState']['newIds']['push'](_0x42e82a),this['_touchedNodesState']['lastTouchedId']=_0x42e82a;}const _0x629126='afterbegin'===_0x33698f||'afterend'===_0x33698f?_0x108cf6['reverse']():_0x108cf6;for(const _0xee29ef of _0x629126)ws(_0x3a170f,_0xee29ef,_0x33698f);}['_replaceNode'](_0x10c06b,_0x55b7c7){if(!_0x10c06b)return;if(_0x17922a=_0x55b7c7,Ss(Es(_0x10c06b))===Ss(Es(_0x17922a)))return;var _0x17922a;const _0x5acf67=this['_getUid'](_0x10c06b);Cs(_0x55b7c7,'data-id',_0x5acf67),this['_touchedNodesState']['modifiedIds']['push'](_0x5acf67),this['_touchedNodesState']['lastTouchedId']=_0x5acf67,_0x73cead(_0x10c06b,_0x55b7c7['cloneNode'](!0x0));}['_findReferenceNode'](_0x1ea291,_0x2f7705,_0x43944f){const _0x58a4b2=this['_findPrevElementWithDataId'](_0x1ea291,!0x1);if(_0x58a4b2){const _0x53a4ce=this['_getNodeDataId'](_0x58a4b2),_0xe88e25=ps('data-id',_0x53a4ce,_0x43944f);if(_0xe88e25)return[_0xe88e25,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x53a4ce);}const _0x27328a=this['_findNextElementWithDataId'](_0x1ea291,!0x1);if(_0x27328a){const _0x2d3731=this['_getNodeDataId'](_0x27328a),_0x17d325=ps('data-id',_0x2d3731,_0x43944f);if(_0x17d325)return[_0x17d325,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x2d3731);}return _0x2f7705?_0x1ea291['nextSibling']?this['_findFallbackReferenceNode'](_0x1ea291,_0x43944f):[_0x43944f['childNodes'][_0x43944f['childNodes']['length']-0x1],'afterend']:[_0x43944f['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x3c639a,_0x486263){const _0x38ecf3=[],_0x4010d5=this['_findPrevElementWithDataId'](_0x3c639a,!0x0);if(_0x4010d5){const _0x3e5ae6=ps('data-id',this['_getNodeDataId'](_0x4010d5),_0x486263);_0x3e5ae6&&_0x38ecf3['push']([_0x3e5ae6,'afterend']);}const _0x31f439=this['_findNextElementWithDataId'](_0x3c639a,!0x0);if(_0x31f439){const _0x317b50=ps('data-id',this['_getNodeDataId'](_0x31f439),_0x486263);_0x317b50&&_0x38ecf3['push']([_0x317b50,'beforebegin']);}if(_0x38ecf3['length']>0x1)return bs(_0x38ecf3[0x0][0x0])<=bs(_0x38ecf3[0x1][0x0])?_0x38ecf3[0x0]:_0x38ecf3[0x1];return 0x1===_0x38ecf3['length']?_0x38ecf3[0x0]:[_0x486263['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x560651,_0x53bf2d){let _0x3fa8b9=_0x560651['nextSibling'],_0x2a1ef5=null,_0x5a254e=!0x1;for(;_0x3fa8b9;){if(_0x1ecbda(_0x3fa8b9)){if(this['_isDelNode'](_0x3fa8b9)&&(_0x2a1ef5=_0x3fa8b9),this['_isExistingContentComment'](_0x3fa8b9)&&_0x53bf2d&&!_0x5a254e){_0x5a254e=!0x0,_0x3fa8b9=_0x3fa8b9['nextSibling'];continue;}break;}const _0x176892=ms(_0x3fa8b9,'data-id');if(_0x176892&&'new-element'!==_0x176892&&this['_existingDataIds']['has'](_0x176892)){_0x2a1ef5=_0x3fa8b9;break;}_0x3fa8b9=_0x3fa8b9['nextSibling'];}return _0x2a1ef5;}['_findPrevElementWithDataId'](_0xdb9552,_0x3abdef){let _0x32b39e=_0xdb9552['previousSibling'],_0x328760=null,_0x6a21c9=!0x1;for(;_0x32b39e;){if(_0x1ecbda(_0x32b39e)){if(this['_isDelNode'](_0x32b39e)&&(_0x328760=_0x32b39e),this['_isExistingContentComment'](_0x32b39e)&&_0x3abdef&&!_0x6a21c9){_0x6a21c9=!0x0,_0x32b39e=_0x32b39e['previousSibling'];continue;}break;}const _0x3feddc=ms(_0x32b39e,'data-id');if(_0x3feddc&&'new-element'!==_0x3feddc&&this['_existingDataIds']['has'](_0x3feddc)){_0x328760=_0x32b39e;break;}_0x32b39e=_0x32b39e['previousSibling'];}return _0x328760;}['_markWrappedElements'](_0x3727ba){_0x699811(_0x3727ba)&&Ts('data-id',null,_0x3727ba)['forEach'](_0x58ce44=>{this['_isExistingNode'](_0x58ce44)&&!this['_hasWrappedParent'](_0x58ce44)&&(Cs(_0x58ce44,'data-wrapped-id',ms(_0x58ce44,'data-id')),Cs(_0x58ce44,'data-id',null));});}['_getNodeDataId'](_0x3708dc){if(!_0x3708dc)return null;if(_0x699811(_0x3708dc))return ms(_0x3708dc,'data-id');if(_0x1ecbda(_0x3708dc)){const _0x52d2ce=Es(_0x3708dc)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x52d2ce&&_0x52d2ce[0x1])return _0x52d2ce[0x1];}return null;}['_storeDeletedElementIds'](_0x5c218a){if(_0x1ecbda(_0x5c218a)){const _0x63833d=Es(_0x5c218a)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x63833d&&_0x63833d[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x63833d[0x1]);}}['_getUid'](_0x1961c0){return this['_isExistingNode'](_0x1961c0)?ms(_0x1961c0,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x2ce259){(function(_0x4cc65f){return _0x43e615(_0x352176=>_0x1ecbda(_0x352176),_0x4cc65f,!0x0,0x1/0x0);}(_0x2ce259)['filter'](_0xaee156=>this['_isDelNode'](_0xaee156)||this['_isExistingContentComment'](_0xaee156))['forEach'](_0x481e13=>{_0x1e1233(_0x481e13);}));}['_markLastTagElementUnstable'](_0x2a5b20){const _0x56bf04=_0x2a5b20['childNodes'],_0x880cdb=_0x56bf04[_0x56bf04['length']-0x1];_0x880cdb&&_0x699811(_0x880cdb)&&Cs(_0x880cdb,'data-unstable','true');}['_markUnstableElements'](_0x1060de,_0x5f4596){const _0x52e2e5=ps('data-unstable','true',_0x1060de);if(!_0x52e2e5)return;const _0x59d60d=fs(_0x52e2e5)['slice'](0x0,-0x1),_0x470ec0=_0x59d60d['length'];let _0x3eba54=_0x52e2e5;if(_0x470ec0>_0x5f4596){let _0x16b8d5=_0x470ec0,_0x26265a=null;for(;_0x16b8d5>_0x5f4596&&_0x16b8d5>=0x0;)_0x16b8d5--,_0x26265a=_0x59d60d[_0x16b8d5];_0x26265a&&(_0x3eba54=_0x26265a,Cs(_0x52e2e5,'data-unstable',null),Cs(_0x26265a,'data-unstable','true'));}else{if(_0x470ec0<_0x5f4596){let _0x35549e=_0x470ec0,_0x2937fa=_0x52e2e5;for(;_0x35549e<_0x5f4596;){const _0x54a243=_0x2937fa['childNodes']['filter'](_0x1e5c20=>_0x699811(_0x1e5c20));if(0x0===_0x54a243['length'])break;_0x35549e++,_0x2937fa=_0x54a243[_0x54a243['length']-0x1];}_0x2937fa&&(_0x3eba54=_0x2937fa,Cs(_0x52e2e5,'data-unstable',null),Cs(_0x2937fa,'data-unstable','true'));}}let _0x2506e5=_0x3eba54;for(;_0x2506e5;){for(;_0x2506e5['nextSibling'];)_0x2506e5=_0x2506e5['nextSibling'],_0x699811(_0x2506e5)&&Cs(_0x2506e5,'data-unstable','true');_0x2506e5=_0x2506e5['parentNode'];}}['_isNewNode'](_0x299569){return Boolean('new-element'===ms(_0x299569,'data-id'));}['_isExistingNode'](_0x487b80){return Boolean((ms(_0x487b80,'data-id')||'')['length']>0x0&&'new-element'!==ms(_0x487b80,'data-id'));}['_isDelNode'](_0x327d4f){return!!_0x327d4f&&Boolean(_0x1ecbda(_0x327d4f)&&Es(_0x327d4f)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x116171){let _0x22ca8e=_0x116171['parentNode'];for(;_0x22ca8e;){if(ms(_0x22ca8e,'data-wrapped-id'))return!0x0;_0x22ca8e=_0x22ca8e['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x3f14e2){return Boolean(_0x1ecbda(_0x3f14e2)&&Es(_0x3f14e2)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function Ns({editor:_0x58d15f,changeGroups:_0x4cab13,documentContextContent:_0x1cf372,showDiff:_0x1c0476,trimUnchanged:_0x1f0952=!0x0}){return _0x4cab13['map'](_0x567a26=>{const _0x38bb82=new _0x497c92([]),_0xdb80b7=new _0x497c92([]);for(const _0x5cdecd of _0x567a26['changes'])if(_0x1c0476&&'removed'==_0x5cdecd['type']||_0xdb80b7['children']['push'](_0x5cdecd['node']['cloneNode'](!0x0)),'new'!=_0x5cdecd['type']&&(_0x1c0476||'removed'!=_0x5cdecd['type'])){const _0x9c2982=_0xff2f34(_0x302290=>ms(_0x302290,'data-id')==_0x5cdecd['id'],_0x1cf372,!0x0);_0x9c2982&&_0x38bb82['children']['push'](_0x9c2982['cloneNode'](!0x0));}const {content:_0x351b81,hasChanges:_0x278cd6}=function(_0xcc17f1,_0xe651f9,_0x42641e,_0x40163e,_0x118088=!0x0){const _0x354ccd=_0xcc17f1['plugins']['get']('DocumentCompare'),_0x4cc02f=Es(_0xe651f9),_0x1b224b=Es(_0x42641e),_0x43ccd0=_0xcc17f1['data']['parse'](_0x4cc02f,'$root'),_0x20fb83=_0xcc17f1['model']['createPositionAt'](_0x43ccd0,0x0),_0x5275ff=_0x354ccd['getDiff'](_0x4cc02f,_0x1b224b,{'anchor':_0x20fb83,'markDeletions':_0x40163e}),_0x203fdc=_0x5275ff['getOperations']();if(0x0==_0x203fdc['length'])return{'content':_0xe651f9['cloneNode'](!0x0),'hasChanges':!0x1};_0x40163e?function(_0x340930,_0x570bd9,_0x47650e){if(0x0==_0x340930['length'])return;const _0x263c1a=_0x47650e['plugins']['get']('DocumentCompare'),_0x48e131=_0x47650e['plugins']['get']('SuggestionsConversion');_0x47650e['model']['change'](_0x506533=>{const _0x107840=new Set();for(let _0x138774=0x0;_0x138774<_0x340930['length'];_0x138774++){const _0xb80256=_0x340930[_0x138774];if(_0xb80256['baseVersion']=null,_0xb80256['isDocumentOperation']=!0x1,_0x263c1a['isMarkedRemoveOperation'](_0xb80256)){const _0x372b22=_0x124e32(_0xb80256['newRange'],_0x47650e['model']),_0x54d4e9='suggestion:deletion:'+ot()+':$aiSuggestion';_0x570bd9['markers']['set'](_0x54d4e9,_0x372b22);}else switch(_0xb80256['type']){case'rename':{if(_0xb80256['oldName']==_0xb80256['newName'])break;_0x506533['batch']['addOperation'](_0xb80256),_0x47650e['model']['applyOperation'](_0xb80256);const _0x33cbab='$elementName',_0x1028da=_0xb80256['position'],_0x17ca0a=_0x47650e['model']['createRange'](_0x1028da,_0x47650e['model']['createPositionAt'](_0x1028da['nodeAfter'],'end')),_0x1a7ead='suggestion:attribute:'+_0x33cbab+':'+ot()+':$aiSuggestion';_0x570bd9['markers']['set'](_0x1a7ead,_0x17ca0a);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0xb80256['oldValue']==_0xb80256['newValue'])break;_0x506533['batch']['addOperation'](_0xb80256),_0x47650e['model']['applyOperation'](_0xb80256);const _0x126783=_0xb80256['key'];if(!_0x48e131['isRegisteredAttribute'](_0x126783))break;const _0xc6c5ce=_0x124e32(_0xb80256['range'],_0x47650e['model']),_0x33cf7b='suggestion:attribute:'+_0x126783+':'+ot()+':$aiSuggestion';_0x570bd9['markers']['set'](_0x33cf7b,_0xc6c5ce);break;}case'insert':{_0x506533['batch']['addOperation'](_0xb80256),_0x47650e['model']['applyOperation'](_0xb80256);if(_0x340930[_0x138774+0x1]&&'move'==_0x340930[_0x138774+0x1]['type']){vs(_0x570bd9,_0xb80256);break;}const _0x27a575=_0xb80256['position'],_0x5d45ee=_0xb80256['howMany'],_0x192d8f=_0x124e32(_0x47650e['model']['createRange'](_0x27a575,_0x27a575['getShiftedBy'](_0x5d45ee)),_0x47650e['model']),_0x2011d0='suggestion:insertion:'+ot()+':$aiSuggestion';_0x570bd9['markers']['set'](_0x2011d0,_0x192d8f);break;}case'split':{_0x506533['batch']['addOperation'](_0xb80256),_0x47650e['model']['applyOperation'](_0xb80256);const _0x2d33ae=_0xb80256['splitPosition'],_0x152609=_0xb80256['moveTargetPosition'],_0x52da78=_0x47650e['model']['createRange'](_0x2d33ae,_0x152609),_0x13fbc8='suggestion:insertion:'+ot()+':$aiSuggestion';_0x570bd9['markers']['set'](_0x13fbc8,_0x52da78);break;}case'move':{_0x506533['batch']['addOperation'](_0xb80256),_0x47650e['model']['applyOperation'](_0xb80256),_0x340930[_0x138774-0x1]&&'insert'==_0x340930[_0x138774-0x1]['type']&&vs(_0x570bd9,_0xb80256);const _0xfcc78d=_0xb80256['getMovedRangeStart'](),_0x43f35e=_0xb80256['howMany'];for(let _0x3b8ef7=0x0;_0x3b8ef7<_0x43f35e;_0x3b8ef7++){const _0x496f15=_0xfcc78d['getShiftedBy'](_0x3b8ef7)['nodeAfter'];_0x107840['add'](_0x496f15);}break;}case'remove':{const _0x5d886d=_0xb80256['sourcePosition'],_0x47f2df=_0xb80256['howMany'],_0x455ecf=new _0x3af47c(_0x5d886d,_0x47f2df);_0x506533['batch']['addOperation'](_0x455ecf),_0x47650e['model']['applyOperation'](_0x455ecf);break;}}}for(const _0x11ec7c of _0x107840){const _0x167513=_0x47650e['model']['createRangeOn'](_0x11ec7c),_0x170b7a='suggestion:formatBlock:$fakeWrap:'+ot()+':$aiSuggestion';_0x570bd9['markers']['set'](_0x170b7a,_0x124e32(_0x167513,_0x47650e['model']));}});}(_0x203fdc,_0x43ccd0,_0xcc17f1):_0xcc17f1['model']['change'](_0xf4e5d7=>{for(const _0x4ee9b5 of _0x203fdc)if('remove'==_0x4ee9b5['type']){const _0x584da9=_0x4ee9b5['sourcePosition'],_0x45bf53=_0x4ee9b5['howMany'],_0x30e09f=new _0x3af47c(_0x584da9,_0x45bf53);_0xf4e5d7['batch']['addOperation'](_0x30e09f),_0xcc17f1['model']['applyOperation'](_0x30e09f);}else{if('marker'==_0x4ee9b5['type']){const _0x485990=_0x4ee9b5['name'],_0x4be2c8=_0x4ee9b5['newRange'];null!==_0x4be2c8?_0x43ccd0['markers']['set'](_0x485990,_0x4be2c8):_0x43ccd0['markers']['delete'](_0x485990);}else _0x4ee9b5['baseVersion']=null,_0x4ee9b5['isDocumentOperation']=!0x1,_0xf4e5d7['batch']['addOperation'](_0x4ee9b5),_0xcc17f1['model']['applyOperation'](_0x4ee9b5);}});if(_0x118088){const _0x3adc01=ys(_0xcc17f1,_0x203fdc,_0x43ccd0);xs(_0xcc17f1['model'],_0x3adc01),function(_0x16cf6d,_0x280824){const _0xd565c5=_0x280824['getFirstRange']()['start'];let _0x5d7f17=_0x280824['getFirstRange']()['end'];const _0x45fca9=_0xd565c5['root'];(_0x5d7f17['textNode']||_0x5d7f17['nodeAfter']&&_0x5d7f17['nodeAfter']['is']('$text'))&&(_0x40aebf(_0x5d7f17,'...'),_0x5d7f17=_0x5d7f17['getShiftedBy'](0x3)),(_0xd565c5['textNode']||_0xd565c5['nodeBefore']&&_0xd565c5['nodeBefore']['is']('$text'))&&(_0x40aebf(_0xd565c5,'...'),function(_0x4dfd6a,_0x118252,_0x939a21){for(let [_0x459ed0,_0x48002e]of _0x4dfd6a['markers']){const _0x56111d=_0x48002e['_getTransformedByInsertion'](_0x118252,_0x939a21,!0x1);_0x48002e=_0x56111d[0x0],_0x4dfd6a['markers']['set'](_0x459ed0,_0x48002e);}}(_0x45fca9,_0xd565c5,0x3),_0xd565c5['parent']==_0x5d7f17['parent']&&(_0x5d7f17=_0x5d7f17['getShiftedBy'](0x3)));const _0x3487ce=_0x16cf6d['createRange'](_0x16cf6d['createPositionAt'](_0x45fca9,0x0),_0xd565c5),_0x272bc0=_0x16cf6d['createRange'](_0x5d7f17,_0x16cf6d['createPositionAt'](_0x45fca9,'end')),_0xa2fe1b=[..._0x3487ce['getMinimalFlatRanges'](),..._0x272bc0['getMinimalFlatRanges']()];_0xa2fe1b['reverse']();for(const _0x1791f3 of _0xa2fe1b)_0xe6d562(_0x1791f3),Ds(_0x45fca9,_0x1791f3);}(_0xcc17f1['model'],_0x3adc01);}const _0x1a55f4=_0xcc17f1['data']['stringify'](_0x43ccd0,{'showSuggestionHighlights':!0x0});return{'content':Is(_0x1a55f4),'hasChanges':!0x0};}(_0x58d15f,_0x38bb82,_0xdb80b7,_0x1c0476,_0x1f0952);return{'type':_0x567a26['changes'][0x0]['type'],'index':_0x567a26['index'],'content':_0x351b81,'hasChanges':_0x278cd6};});}function vs(_0x11d76e,_0x4f7402){for(const [_0x363109,_0x58f395]of _0x11d76e['markers']){const _0x290d4f=_0x309081['_createFromRanges'](_0x58f395['getTransformedByOperation'](_0x4f7402));_0x11d76e['markers']['set'](_0x363109,_0x290d4f);}}function ys(_0x17d6f7,_0x2a1411,_0x59e32d){const _0xdaa705=_0x17d6f7['plugins']['get']('DocumentCompare');let _0x147c4d=_0x17d6f7['model']['createPositionAt'](_0x59e32d,Number['POSITIVE_INFINITY']),_0x1ab921=_0x17d6f7['model']['createPositionAt'](_0x59e32d,0x0);for(const _0x12ff43 of _0x2a1411){let _0x26087d,_0x2325ca;if(_0xdaa705['isMarkedRemoveOperation'](_0x12ff43))_0x26087d=_0x12ff43['newRange']['start'],_0x2325ca=_0x12ff43['newRange']['end'];else switch(_0x147c4d=_0x147c4d['getTransformedByOperation'](_0x12ff43),_0x1ab921=_0x1ab921['getTransformedByOperation'](_0x12ff43),_0x12ff43['type']){case'rename':_0x26087d=_0x12ff43['position'],_0x2325ca=_0x26087d['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x26087d=_0x12ff43['range']['start'],_0x2325ca=_0x12ff43['range']['end'];break;case'insert':_0x26087d=_0x12ff43['position'],_0x2325ca=_0x26087d['getShiftedBy'](_0x12ff43['howMany']);break;case'split':_0x26087d=_0x12ff43['splitPosition'],_0x2325ca=_0x12ff43['moveTargetPosition'];break;case'merge':{const _0x43f45b=_0x12ff43['targetPosition']['path']['slice'](0x0,-0x1);_0x26087d=_0x17d6f7['model']['createPositionFromPath'](_0x59e32d,_0x43f45b),_0x2325ca=_0x26087d['getShiftedBy'](0x1);break;}case'remove':{const _0x23a599=_0x12ff43['howMany'],_0x441693=_0x12ff43['sourcePosition']['_getTransformedByInsertion'](_0x12ff43['targetPosition'],_0x23a599),_0x5de54f=_0x12ff43['getMovedRangeStart']();'remove'==_0x12ff43['type']?(_0x26087d=_0x441693,_0x2325ca=_0x441693):(_0x26087d=_0x5de54f,_0x2325ca=_0x5de54f['getShiftedBy'](_0x23a599));break;}}_0x26087d&&_0x26087d['isBefore'](_0x147c4d)&&(_0x147c4d=_0x26087d['clone'](),_0x147c4d['stickiness']='toNone'),_0x2325ca&&_0x2325ca['isAfter'](_0x1ab921)&&(_0x1ab921=_0x2325ca['clone'](),_0x1ab921['stickiness']='toNone');}return _0x17d6f7['model']['createSelection'](_0x17d6f7['model']['createRange'](_0x147c4d,_0x1ab921));}function xs(_0x171af1,_0x198ca2){Ls(_0x171af1,_0x198ca2,'forward');const _0x2d8b72=_0x198ca2['getFirstRange']();_0x198ca2['setTo']([]),_0x198ca2['setTo'](_0x2d8b72,{'backward':!0x0}),Ls(_0x171af1,_0x198ca2,'backward');}function Ls(_0x102032,_0x5f2c88,_0x27ecee){let _0x550578=0x14;for(;_0x550578;){_0x102032['modifySelection'](_0x5f2c88,{'unit':'word','direction':_0x27ecee}),_0x550578--;const _0x441ea9=_0x5f2c88['focus']['forward'==_0x27ecee?'nodeBefore':'nodeAfter'];if(_0x441ea9&&_0x441ea9['is']('element')&&_0x102032['schema']['isBlock'](_0x441ea9)&&_0x102032['schema']['isObject'](_0x441ea9))break;}}function Ds(_0x43da3c,_0x234b3d){for(const [_0x1a8dc6,_0x4ded99]of _0x43da3c['markers']){const _0x239ee7=_0x4ded99['_getTransformedByDeletion'](_0x234b3d['start'],_0x234b3d['end']['offset']-_0x234b3d['start']['offset']);null!=_0x239ee7?_0x43da3c['markers']['set'](_0x1a8dc6,_0x239ee7):_0x43da3c['markers']['delete'](_0x1a8dc6);}}class Ps extends ct(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _0x497c92([]);['parsedMergedContent']=new _0x497c92([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x4d50cf,content:_0x568d5c='',isDone:_0xe68fad=!0x1,interactionId:_0x729540,areActionsDisabled:_0x36c23e,documentContextContent:_0x492ed4,editor:_0x5c7de4,id:_0x1e0bd0}){super(),this['id']=_0x1e0bd0||ot(),this['interactionId']=_0x729540,this['type']=_0x4d50cf,this['areActionsDisabled']=!!_0x36c23e,this['editor']=_0x5c7de4,this['aiResponseParser']=new Os(),this['aiResponseApplier']=new ks(),this['documentContextContent']=Is(_0x492ed4||''),this['set']('isDone',_0xe68fad),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x568d5c);}['appendContent'](_0x314438){this['set']('content',this['content']+_0x314438);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x2be032,_0x1e9d7f){this['changeGroups'][_0x2be032]['state']=_0x1e9d7f,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x2be032,'state':_0x1e9d7f});}['getContentParts']({showDiff:_0x3bd0f9,groupIndex:_0xdfb7b6}){if(!this['editor'])throw new ht('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x482091=this['_getCachedContentParts'](_0x3bd0f9,_0xdfb7b6);if(_0x482091)return _0x482091;let _0x403890=[];if(void 0x0===_0xdfb7b6)_0x403890=this['changeGroups'];else{const _0x4df5fb=this['changeGroups']['find'](({index:_0x7b6e7e})=>_0x7b6e7e===_0xdfb7b6);if(!_0x4df5fb)throw new ht('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0xdfb7b6});_0x403890=[_0x4df5fb];}const _0x2f11e4=Ns({'editor':this['editor'],'showDiff':_0x3bd0f9,'changeGroups':_0x403890,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x3bd0f9,_0x2f11e4),_0x2f11e4;}['_getCachedContentParts'](_0x1a60d4,_0x27e777){const _0x220ed1=_0x1a60d4?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x220ed1]['length'])return null;const _0x4da32c=this['cachedSuggestionContentParts'][_0x220ed1];if(void 0x0===_0x27e777)return _0x4da32c['length']>0x0&&_0x4da32c['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x1a60d4,null),null):_0x4f3072(_0x4da32c);{const _0x4bbcb3=_0x4da32c['find'](({index:_0x527755})=>_0x527755===_0x27e777);if(_0x4bbcb3)return[_0x4f3072(_0x4bbcb3)];}return null;}['_setCachedContentParts'](_0x237f54,_0x4cec7c){const _0x271dc9=_0x237f54?'withDiff':'withoutDiff';_0x4cec7c?_0x4cec7c['forEach'](_0x22d8a0=>{const _0x151a44=this['cachedSuggestionContentParts'][_0x271dc9],_0x2ac50f=_0x151a44['find'](({index:_0x2e5cf9})=>_0x2e5cf9===_0x22d8a0['index']);if(_0x2ac50f){const _0x177550=_0x151a44['indexOf'](_0x2ac50f);_0x151a44['splice'](_0x177550,0x1,_0x22d8a0);}else _0x151a44['push'](_0x22d8a0);}):this['cachedSuggestionContentParts'][_0x271dc9]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x584cee=this['changeGroups'];this['updateChangeGroups']();const _0xf6bf0e=this['_getDifferentChangeGroups'](_0x584cee,this['changeGroups']);(_0xf6bf0e['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0xf6bf0e),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x442c2d,_0x3603ab){const _0x4a49f2=[];for(const _0x4dd570 of _0x3603ab){const _0x370394=_0x442c2d[_0x4dd570['index']];_0x370394?_0x370394['changes']['length']!==_0x4dd570['changes']['length']?_0x4a49f2['push'](_0x4dd570):_0x370394['changes']['forEach']((_0x3ab040,_0xa09a3c)=>{const _0xa6d1f1=_0x4dd570['changes'][_0xa09a3c];_0x3ab040['id']!==_0xa6d1f1['id']&&_0x4a49f2['push'](_0x4dd570);}):_0x4a49f2['push'](_0x4dd570);}return _0x4a49f2;}['updateChangeGroups'](){const _0x4845b7=new _0x41fe55('p',{},[new _0x41fe55('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0xde8693(us(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x155007=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x4845b7,'cutAfterLastChange':!this['isDone']});if(!_0x155007['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x155007['parsedContent'];let _0x47187b=[];if(_0x57e7f5(_0x43cb7d=>{const _0x1cbd54=ms(_0x43cb7d,'data-id');if(!_0x1cbd54||!_0x2697c4(_0x1cbd54))return!0x1;const _0x34f41a=[_0x43cb7d,...fs(_0x43cb7d)]['at'](-0x2);if(_0x43cb7d!=_0x34f41a){const _0x4b7d24=ms(_0x34f41a,'data-id');_0x2697c4(_0x4b7d24)||(_0x47187b['push']({'node':_0x34f41a,'id':_0x4b7d24,'type':'modified'}),_0x155007['modifiedNodeIds']['push'](_0x4b7d24));}else _0x155007['modifiedNodeIds']['includes'](_0x1cbd54)?_0x47187b['push']({'node':_0x43cb7d,'type':'modified','id':_0x1cbd54}):_0x155007['newNodeIds']['includes'](_0x1cbd54)?_0x47187b['push']({'node':_0x43cb7d,'type':'new','id':_0x1cbd54,'anchorId':ms(_0x43cb7d['previousSibling'],'data-id')}):_0x47187b['push']({'node':_0x43cb7d,'type':'removed','id':_0x1cbd54});return!0x0;},this['parsedMergedContent']),_0x47187b=_0x47187b['filter'](({node:_0x33a397})=>[...fs(_0x33a397),_0x33a397]['every'](_0x2488b3=>!ms(_0x2488b3,'data-unstable'))),0x0==_0x47187b['length'])return;const _0x2d7d60=[[_0x47187b[0x0]]];for(let _0x3786dd=0x1;_0x3786dd<_0x47187b['length'];_0x3786dd++){const _0x3452fa=_0x2d7d60[_0x2d7d60['length']-0x1],_0x5dd4ca=_0x3452fa[_0x3452fa['length']-0x1];_0x47187b[_0x3786dd]['node']['previousSibling']==_0x5dd4ca['node']&&'modified'!=_0x47187b[_0x3786dd]['type']&&'modified'!=_0x5dd4ca['type']?_0x3452fa['push'](_0x47187b[_0x3786dd]):_0x2d7d60['push']([_0x47187b[_0x3786dd]]);}for(const _0x5d580e of _0x2d7d60){const _0x1f28e1=_0x5d580e[0x0],_0x18edea=_0x5d580e[_0x5d580e['length']-0x1],_0x436e8b=_0x4afa9d(_0x1f28e1['node']['previousSibling']);_0x436e8b&&_0x5d580e['unshift'](_0x436e8b);const _0x39720f=_0x4afa9d(_0x18edea['node']['nextSibling']);_0x39720f&&_0x5d580e['push'](_0x39720f);}function _0x2697c4(_0x3f693b){return _0x155007['modifiedNodeIds']['includes'](_0x3f693b)||_0x155007['newNodeIds']['includes'](_0x3f693b)||_0x155007['removedNodeIds']['includes'](_0x3f693b);}function _0x4afa9d(_0x31e88b){if(_0x31e88b&&ms(_0x31e88b,'data-id')&&!ms(_0x31e88b,'data-unstable')){const _0x1d254e=ms(_0x31e88b,'data-id');if(!_0x2697c4(_0x1d254e))return{'node':_0x31e88b,'type':'context','id':_0x1d254e};}return null;}this['changeGroups']=_0x2d7d60['map']((_0x437846,_0x4dfddb)=>({'changes':_0x437846,'state':'pending','index':_0x4dfddb}));}}const Hs=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class Ms extends pt(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x461b60,editor:_0x4d95d8}){super(),this['id']=ot(),this['connector']=_0x461b60,this['isStopped']=!0x0,this['editor']=_0x4d95d8;}async['start'](){const _0x589933=[];let _0x4bce0c,_0x311eab,_0x3fbab2;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0xb2c70a=await this['currentRequest']['getStream']();for await(const _0x468f0d of _0xb2c70a){if(this['isStopped'])return;if('error'==_0x468f0d['event'])return void this['fire']('error',{'error':new ht('ai-chat-interaction-error',this)});switch(_0x468f0d['event']){case'message-metadata':this['messageId']=_0x468f0d['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x468f0d['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x468f0d['data']['conversationTitle'],!0x0);break;case'source':_0x589933['push'](_0x468f0d['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'](),_0x4bce0c='modification-delta'==_0x468f0d['event']?'modification':'text',_0x311eab='modification-delta'==_0x468f0d['event']?_0x468f0d['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x4bce0c&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x4bce0c,'interactionId':this['id'],'id':_0x311eab}),'modification'==_0x4bce0c&&(this['currentReply']['sources']=_0x589933['splice'](0x0))),this['currentReply']['appendContent'](_0x468f0d['data']['textDelta']);break;case'mcp-tool-result':_0x3fbab2=JSON['parse'](_0x468f0d['data']['result']),this['_handleToolResultData']({'toolName':_0x468f0d['data']['toolName'],'data':_0x3fbab2['data'],'attributes':_0x3fbab2['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x468f0d['data']['toolName'],'data':_0x468f0d['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0x589933['length']>0x0&&(this['currentReply']['sources']=_0x589933['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x2d9ce4){return this['replies']['find'](_0x507aca=>_0x507aca['id']===_0x2d9ce4);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x8eb50a=>_0x8eb50a['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x1d0420){const _0x53ec66=new Ps({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x1d0420});return this['replies']['push'](_0x53ec66),_0x53ec66['delegate'](...Hs)['to'](this),this['fire']('replyCreated',_0x53ec66),_0x53ec66;}['setConversationTitle'](_0x2fcee4,_0x100ed3=!0x1){this['fire']('setConversationTitle',_0x2fcee4,_0x100ed3);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x412879){this['fire']('toolDataReceived',{'type':'result','toolName':_0x412879['toolName'],'data':structuredClone(_0x412879['data']||{}),'attributes':structuredClone(_0x412879['attributes']||{})},this);}['_handleToolNotificationData'](_0x22989f){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x22989f['toolName'],'data':structuredClone(_0x22989f['data'])},this);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var Us=function(_0x17d609){return _0x17d609['TOOL']='mcp-tool-context',_0x17d609['FILE']='file',_0x17d609['DOCUMENT']='document',_0x17d609['URL']='web-resource',_0x17d609['TEXT']='text',_0x17d609['SELECTION']='selection',_0x17d609;}({}),Vs=function(_0x528fa0){return _0x528fa0['TEXT']='text',_0x528fa0['MARKDOWN']='markdown',_0x528fa0['HTML']='html',_0x528fa0;}({});const Bs=new Map([['usage-limits-exceeded','ai-usage-limits-exceeded'],['rate-limits-exceeded','ai-rate-limits-exceeded'],['invalid-content-type','ai-invalid-content-type'],['invalid-request-data','ai-chat-invalid-request'],['model-already-set','ai-chat-model-already-set'],['model-not-found','ai-chat-model-not-found'],['unsafe-content-detected','ai-chat-unsafe-content-detected'],['unsupported-content-type','ai-chat-unsupported-content-type'],['content-too-large','ai-chat-content-too-large'],['unsupported-file-type','ai-chat-context-unsupported-file-type'],['file-too-large','ai-chat-context-file-too-large'],['file-too-many-pages','ai-chat-context-file-too-many-pages'],['form-data-size-limits-exceeded','ai-chat-context-form-data-size-limits-exceeded']]),Gs=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class Fs extends ct(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x60b646,config:_0xd6e7a,ownerId:_0x33b289}){super(),this['_connector']=_0x60b646,this['_config']=_0xd6e7a,this['_ownerId']=_0x33b289;}['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'](_0x523781){const _0x46bf7a=await this['_createContextItemFromContent'](_0x523781);return this['_addToConversationContextItem'](_0x46bf7a),'current-document'===_0x46bf7a['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x46bf7a;}async['_createContextItemFromContent'](_0x4629ad){if(_0x4629ad['type']===Us['DOCUMENT']){const _0x27dc3d=await this['_connector']['fetchDocument'](this['_ownerId'],_0x4629ad['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x4629ad['type'],'content':_0x27dc3d['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x27dc3d['attributes']?.['version'],'sessionId':_0x27dc3d['attributes']?.['sessionId']};}if(_0x4629ad['type']===Us['TOOL'])return{'id':_0x4629ad['id'],'uiId':_0x4629ad['id'],'label':_0x4629ad['data']?.['label']||_0x4629ad['id'],'type':Us['TOOL'],'mcpServerName':_0x4629ad['mcpServerName'],'toolName':_0x4629ad['toolName'],'data':_0x4629ad['data']||{}};return{'id':_0x4629ad['id'],'uiId':_0x4629ad['id'],'label':_0x4629ad['attributes']?.['label']||_0x4629ad['name']||_0x4629ad['url']||_0x4629ad['id'],'type':_0x4629ad['type'],..._0x4629ad?.['attributes']?.['resourceId']?{'resourceId':_0x4629ad['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x3425de){const _0x61e936=this['_pendingContextItems']['get'](_0x3425de);_0x61e936?.['isReadOnly']||this['_removeContextItem'](_0x3425de);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x1c5cda of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x1c5cda['uiId']);const _0x51d90a=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x51d90a&&this['_addContextItem']({..._0x51d90a,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x1dcbab){for(const _0x26a4d8 of _0x1dcbab['values']())this['_addToConversationContextItem'](_0x26a4d8);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'](_0x2d582d){return Array['from'](_0x2d582d['values']())['map'](_0x163d7d=>this['_mapContextItemToRequestData'](_0x163d7d))['filter'](_0x5ea107=>null!==_0x5ea107);}async['addFilesToContext'](_0x51f24d,_0x417fd3,_0x53f6b4=Us['FILE']){const _0x233ee2='files-'+ot();this['_startUploadOperation'](_0x233ee2);try{await Promise['all'](_0x51f24d['map'](async _0x3e5bcc=>{const _0x83e6d7='file-'+ot(),_0x2e8286=_0x9da630(_0x3e5bcc['name']);try{this['_addContextItem']({'type':_0x53f6b4,'label':_0x417fd3?.['label']||_0x2e8286,'uiId':_0x83e6d7,'resourceId':_0x417fd3?.['resourceId']},!0x0);const _0x1ca063=this['_connector']['uploadFile'](this['_ownerId'],_0x3e5bcc,_0x417fd3);this['_ongoingUploads']['set'](_0x83e6d7,_0x1ca063['abortController']);const {id:_0x3cc391}=await _0x1ca063['getId']();this['_ongoingUploads']['delete'](_0x83e6d7),this['_finishContextItemLoading']({'type':_0x53f6b4,'id':_0x3cc391,'label':_0x417fd3?.['label']||_0x2e8286,'uiId':_0x83e6d7,'resourceId':_0x417fd3?.['resourceId']},!0x1);}catch(_0x3740e2){this['_ongoingUploads']['delete'](_0x83e6d7);if(!(_0x3740e2 instanceof ht&&_0x3740e2['message']['startsWith']('ai-request-aborted'))){const _0xf436f1=Bs['get'](_0x3740e2['code'])||'ai-chat-file-upload-failed',_0x2031f4=new ht(_0xf436f1,null,{'fileName':_0x2e8286,..._0x3740e2});_0x2031f4['stack']=_0x3740e2['stack'],this['fire']('error',{'error':_0x2031f4});}this['_removeContextItem'](_0x83e6d7);}}));}finally{this['_finishUploadOperation'](_0x233ee2);}}['addCurrentDocumentToContext'](_0x2e9549){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x13fe91={'type':Us['DOCUMENT'],'uiId':'current-document','label':_0x2e9549,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x13fe91);}async['updateCurrentDocument'](_0x191b34,_0xb5f30c,_0x454dd8,_0x3d22e6){const _0x28d3ff=this['_pendingContextItems']['get']('current-document');if(_0x28d3ff&&_0x191b34){_0x28d3ff['selection']=_0x3d22e6?_0x3d22e6['map'](_0x5d0afc=>({'start':_0x5d0afc['start'],'end':_0x5d0afc['end']})):[];try{if(_0x28d3ff['version']===_0xb5f30c)return;const {id:_0x5ab703}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x191b34,{'version':_0xb5f30c,'sessionId':_0x454dd8})['getId']();_0x28d3ff['id']=_0x5ab703,_0x28d3ff['content']=_0x191b34,_0x28d3ff['version']=_0xb5f30c,_0x28d3ff['sessionId']=_0x454dd8;}catch(_0x1a522f){const _0x4fc851=new ht('ai-chat-document-upload-failed',null);_0x4fc851['stack']=_0x1a522f['stack'],this['fire']('error',{'error':_0x4fc851});}}}['addSelectionToContext'](_0x4d9996){this['_addContextItem']({'type':Us['SELECTION'],'label':_0x4d9996,'uiId':'selection','content':_0x4d9996});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x3a77f5,_0x3d2975){const _0x458077='url-'+ot();this['_startUploadOperation'](_0x458077);const _0xb8e424='url-'+ot();try{this['_addContextItem']({'type':Us['URL'],'label':_0x3d2975?.['label']||_0x3a77f5,'uiId':_0xb8e424,'resourceId':_0x3d2975?.['resourceId']},!0x0);const _0x4cca3e=this['_connector']['uploadUrl'](this['_ownerId'],_0x3a77f5,_0x3d2975);this['_ongoingUploads']['set'](_0xb8e424,_0x4cca3e['abortController']);const {id:_0x2afbbc}=await _0x4cca3e['getId']();this['_ongoingUploads']['delete'](_0xb8e424),this['_finishContextItemLoading']({'type':Us['URL'],'id':_0x2afbbc,'label':_0x3d2975?.['label']||_0x3a77f5,'uiId':_0xb8e424,'resourceId':_0x3d2975?.['resourceId']},!0x1);}catch(_0x413299){this['_ongoingUploads']['delete'](_0xb8e424),(_0x413299['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new ht('ai-chat-url-upload-failed',this,{'url':_0x3a77f5,'originalError':_0x413299}),'url':_0x3a77f5}),this['_removeContextItem'](_0xb8e424));}finally{this['_finishUploadOperation'](_0x458077);}}['addToolItemToContext'](_0xfaaa73){_0xfaaa73['id']=_0xfaaa73['id']??ot()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0xfaaa73['uiId'],_0xfaaa73),this['fire']('contextItemAdded',{'contextItem':_0xfaaa73,'isLoading':!0x1});}async['loadSourceResources'](_0x970a21,_0x2f7f69,_0x8829e7){const _0x1e0315=this['_addContextOptionsState']['sources']['find'](_0x51c8af=>_0x51c8af['id']===_0x970a21);if(!_0x1e0315)return this['fire']('error',{'error':new ht('ai-chat-source-not-found',this,{'sourceId':_0x970a21}),'sourceId':_0x970a21}),[];try{const _0x549ceb=(await _0x1e0315['getResources'](_0x2f7f69))['map'](_0x113ab8=>{const _0x4ea734=this['_isResourceInContext'](_0x113ab8['id']);return{..._0x113ab8,'isInContext':_0x4ea734};});return _0x1e0315['resources']=_0x549ceb,this['fire']('sourceResourcesLoaded',{'sourceId':_0x970a21,'source':_0x1e0315,'resources':_0x549ceb,'uid':_0x8829e7}),_0x549ceb;}catch(_0x388702){return this['fire']('error',{'error':new ht('ai-chat-source-resources-load-failed',this,{'sourceId':_0x970a21,'originalError':_0x388702}),'sourceId':_0x970a21,'sourceLabel':_0x1e0315['label']}),[];}}async['addResourceToContext'](_0x32f2dc,_0x1457b3){if(this['_isResourceInContext'](_0x1457b3['id']))return;let _0x27e7b8=_0x1457b3['data'];if(!_0x27e7b8&&_0x32f2dc['getData'])try{_0x27e7b8=await _0x32f2dc['getData'](_0x1457b3['id']);}catch(_0x157587){return void this['fire']('error',{'error':new ht('ai-chat-resource-load-failed',this,{'resourceId':_0x1457b3['id'],'sourceId':_0x32f2dc['id'],'originalError':_0x157587}),'resourceId':_0x1457b3['id'],'sourceId':_0x32f2dc['id']});}if(_0x27e7b8)switch(_0x1457b3['type']){case Us['URL']:if('string'!=typeof _0x27e7b8)return void this['fire']('error',{'error':new ht('ai-chat-context-invalid-data',this,{'resourceId':_0x1457b3['id'],'sourceId':_0x32f2dc['id'],'expectedType':'string','actualType':typeof _0x27e7b8}),'resourceId':_0x1457b3['id'],'sourceId':_0x32f2dc['id']});await this['addUrlToContext'](_0x27e7b8,{'label':_0x1457b3['label'],'resourceId':_0x1457b3['id']});break;case Us['FILE']:if(!(_0x27e7b8 instanceof File))return void this['fire']('error',{'error':new ht('ai-chat-context-invalid-data',this,{'resourceId':_0x1457b3['id'],'sourceId':_0x32f2dc['id'],'expectedType':'File','actualType':typeof _0x27e7b8}),'resourceId':_0x1457b3['id'],'sourceId':_0x32f2dc['id']});await this['addFilesToContext']([_0x27e7b8],{'label':_0x1457b3['label'],'resourceId':_0x1457b3['id']});break;case Us['TEXT']:if('object'!=typeof _0x27e7b8||!('content'in _0x27e7b8)||!('type'in _0x27e7b8))return void this['fire']('error',{'error':new ht('ai-chat-context-invalid-data',this,{'resourceId':_0x1457b3['id'],'sourceId':_0x32f2dc['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x27e7b8}),'resourceId':_0x1457b3['id'],'sourceId':_0x32f2dc['id']});_0x27e7b8=Fs['_convertTextResourceToFile'](_0x27e7b8,_0x1457b3['label']),await this['addFilesToContext']([_0x27e7b8],{'label':_0x1457b3['label'],'resourceId':_0x1457b3['id']},Us['TEXT']);break;case Us['TOOL']:break;default:this['fire']('error',{'error':new ht('ai-chat-context-unsupported-type',this,{'resourceId':_0x1457b3['id'],'sourceId':_0x32f2dc['id'],'resourceType':_0x1457b3['type']}),'resourceId':_0x1457b3['id'],'sourceId':_0x32f2dc['id']});}else this['fire']('error',{'error':new ht('ai-chat-resource-no-data',this,{'resourceId':_0x1457b3['id'],'sourceId':_0x32f2dc['id']}),'resourceId':_0x1457b3['id'],'sourceId':_0x32f2dc['id']});}static['_convertTextResourceToFile'](_0x5a6344,_0x12b014){switch(_0x5a6344['type']){case Vs['MARKDOWN']:return new File([_0x5a6344['content']],_0x12b014,{'type':'text/markdown'});case Vs['HTML']:return new File([_0x5a6344['content']],_0x12b014,{'type':'text/html'});default:return new File([_0x5a6344['content']],_0x12b014,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x31404f){switch(_0x31404f['type']){case Us['FILE']:return{'type':Us['FILE'],'id':_0x31404f['id']};case Us['URL']:return{'type':Us['URL'],'id':_0x31404f['id']};case Us['DOCUMENT']:return{'type':Us['DOCUMENT'],'id':_0x31404f['id'],..._0x31404f['selection']?.['length']&&{'selection':_0x31404f['selection']}};case Us['TEXT']:return{'type':Us['FILE'],'id':_0x31404f['id']};case Us['TOOL']:{const _0x5e02a3=_0x31404f;return{'type':Us['TOOL'],'mcpServerName':_0x5e02a3['mcpServerName'],'toolName':_0x5e02a3['toolName'],'data':_0x5e02a3['data'],'id':_0x5e02a3['id']};}default:return null;}}['_addContextItem'](_0xffc49d,_0x37f161=!0x1){if(this['_pendingContextItems']['set'](_0xffc49d['uiId'],_0xffc49d),_0xffc49d['hidden']||this['fire']('contextItemAdded',{'contextItem':_0xffc49d,'isLoading':_0x37f161}),'current-document'===_0xffc49d['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0xffc49d['resourceId']){const _0x53f46f=this['_findSourceIdsByResourceId'](_0xffc49d['resourceId']);_0x53f46f&&_0x53f46f['forEach'](_0x406ba7=>{this['_updateResourceInContextState'](_0x406ba7,_0xffc49d['resourceId'],!0x0);});}}['_removeContextItem'](_0x9c9539){const _0x3042db=this['_pendingContextItems']['get'](_0x9c9539),_0x55e461=this['_ongoingUploads']['get'](_0x9c9539);if(_0x55e461&&(_0x55e461['abort'](),this['_ongoingUploads']['delete'](_0x9c9539)),_0x3042db?.['resourceId']){const _0x101ee8=this['_findSourceIdsByResourceId'](_0x3042db['resourceId']);_0x101ee8&&_0x101ee8['forEach'](_0x2846ca=>{this['_updateResourceInContextState'](_0x2846ca,_0x3042db['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x9c9539),this['fire']('contextItemRemoved',{'uiId':_0x9c9539,'type':_0x3042db?.['type']}),'current-document'===_0x9c9539&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x2702e4,_0x5277c8){if(this['_pendingContextItems']['has'](_0x2702e4['uiId'])&&(this['_pendingContextItems']['set'](_0x2702e4['uiId'],_0x2702e4),this['fire']('contextItemLoadingEnded',{'contextItem':_0x2702e4,'isLoading':_0x5277c8}),_0x2702e4['resourceId'])){const _0x364414=this['_findSourceIdsByResourceId'](_0x2702e4['resourceId']);_0x364414&&_0x364414['forEach'](_0x48108f=>{this['_updateResourceInContextState'](_0x48108f,_0x2702e4['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x59d1d9){this['_conversationContextItems']['set'](_0x59d1d9['uiId'],_0x59d1d9);}['_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'](_0x17ec8f=>({..._0x17ec8f,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x327c3a=>({..._0x327c3a,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x3d5381=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x3d5381,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x57efbf){for(const _0x311522 of this['_pendingContextItems']['values']())if(_0x311522['resourceId']===_0x57efbf)return!0x0;for(const _0x3eec33 of this['_conversationContextItems']['values']())if(_0x3eec33['resourceId']===_0x57efbf)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x2a2bbd){const _0x416bde=[];for(const _0x485079 of this['_addContextOptionsState']['sources']){_0x485079['resources']['find'](_0x363328=>_0x363328['id']===_0x2a2bbd)&&_0x416bde['push'](_0x485079['id']);}return 0x0===_0x416bde['length']?null:_0x416bde;}['_updateResourceInContextState'](_0x2f39f7,_0x554602,_0x3cf858){const _0x198067=this['_addContextOptionsState']['sources']['find'](_0x1f6840=>_0x1f6840['id']===_0x2f39f7);if(!_0x198067)return;const _0x4c3bad=_0x198067['resources']['find'](_0x47cc4f=>_0x47cc4f['id']===_0x554602);_0x4c3bad&&(_0x4c3bad['isInContext']=_0x3cf858,this['fire']('resourceStateChanged',{'sourceId':_0x2f39f7,'resourceId':_0x554602,'isInContext':_0x3cf858}));}['_startUploadOperation'](_0x22d40b){this['_ongoingUploadOperations']['set'](_0x22d40b,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x5aef79){this['_ongoingUploadOperations']['delete'](_0x5aef79),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Ks=['capabilitiesUpdated'];class Ws extends pt(){['_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'](_0x1b7998){const _0x17d91f={};return _0x1b7998&&_0x1b7998['isWebSearchEnabled']&&(_0x17d91f['webSearch']={}),_0x1b7998&&_0x1b7998['isReasoningEnabled']&&(_0x17d91f['reasoning']={}),_0x17d91f;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x131c30){_0x131c30!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x131c30,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x1fa731){_0x1fa731!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x1fa731,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Ys extends Ms{['userMessage'];['conversationId'];['contextItems']=new Map();['capabilities'];['model'];['attributes'];constructor(_0x11dea0){super(_0x11dea0),this['conversationId']=_0x11dea0['conversationId'],this['contextItems']=_0x11dea0['contextItems'],this['capabilities']=_0x11dea0['capabilities'],this['userMessage']=_0x11dea0['userMessage'],this['model']=_0x11dea0['model'],this['attributes']=_0x11dea0['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':Fs['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Ws['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class $s extends pt(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x751e31){super(),this['options']=_0x751e31,this['connector']=_0x751e31['connector'],this['chatModels']=_0x751e31['chatModels'],this['id']=_0x751e31['conversationId'],this['isFromHistory']=_0x751e31['isFromHistory'];}async['init'](_0x1c758a){try{this['chatContext']=new Fs({'connector':this['connector'],'config':_0x1c758a,'ownerId':this['id']}),this['chatContext']['delegate'](...Gs)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Ws(),this['chatCapabilities']['delegate'](...Ks)['to'](this),this['chatCapabilities']['init']();const _0x17abdb=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x17abdb});const _0x448268=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x448268&&await this['setModel'](_0x448268);}catch(_0xe5e6cd){const _0x27044f=new ht('ai-chat-conversation-init-failed',null,{'message':_0xe5e6cd['message']||_0xe5e6cd});_0x27044f['stack']=_0xe5e6cd['stack'],this['fire']('error',{'error':_0x27044f});}}async['start'](){if(this['isStarted'])throw new ht('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new ht('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x43eafb}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x43eafb,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x177991){const _0x3bdddb=new ht('ai-chat-conversation-start-failed',null,{'message':_0x177991['message'],'conversationId':this['id']});throw _0x3bdddb['stack']=_0x177991['stack'],this['fire']('error',{'error':_0x3bdddb}),_0x3bdddb;}}async['load'](_0x4688bd,_0x581efe){try{const _0x3feac9=await this['connector']['fetchConversation'](_0x4688bd)['getConversation'](),_0xb73c24=await this['connector']['fetchConversationMessages'](_0x4688bd)['getMessages'](),_0x6501ef=_0xb73c24[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x3feac9['id'],'title'in _0x3feac9?this['fire']('setConversationTitle',_0x3feac9['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x50670b=(await this['chatModels']['getAll']())['find'](_0x13a782=>_0x13a782['id']['toLowerCase']()===_0x6501ef['toLowerCase']());return this['selectedModel']=_0x50670b,this['fire']('modelSelected',{'selectedModel':_0x50670b,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0xb73c24,_0x581efe,_0x6501ef),this['currentInteraction']=void 0x0,this;}catch(_0x203ac6){const _0x2622b7=new ht('ai-chat-conversation-init-from-id-failed',null,{'message':_0x203ac6['message'],'conversationId':_0x4688bd});throw _0x2622b7['stack']=_0x203ac6['stack'],this['fire']('error',{'error':_0x2622b7}),_0x2622b7;}}async['_processMessagesToInteractions'](_0x5c2469,_0x42054d,_0x115bf8){let _0x157a9f;for(const _0x1dabeb of _0x5c2469)if('user'===_0x1dabeb['role']){const _0x92f5a8=await this['_extractContextItems'](_0x1dabeb),_0x367cb3={'isReasoningEnabled':Object['hasOwn'](_0x1dabeb['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x1dabeb['capabilities'],'webSearch')};_0x157a9f=this['createInteraction']({'userMessage':_0x1dabeb['prompt'],'contextItems':_0x92f5a8,'capabilities':_0x367cb3,'modelId':_0x115bf8,'attributes':_0x1dabeb['attributes']}),this['currentInteraction']=_0x157a9f,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x1dabeb['role']&&_0x157a9f){const _0x30944f=[];for(const _0x46b84a of _0x1dabeb['content'])switch(_0x46b84a['type']){case'text':case'modification':{const _0x148718=_0x157a9f['getDocumentContext']()?.['sessionId']!==_0x42054d;_0x157a9f['currentReply']=_0x157a9f['createReply']({'type':_0x46b84a['type'],'isDone':!0x0,'interactionId':_0x157a9f['id'],'areActionsDisabled':_0x148718}),_0x157a9f['currentReply']['appendContent'](_0x46b84a['content']),_0x30944f['length']>0x0&&(_0x157a9f['currentReply']['sources']=_0x30944f['splice'](0x0));break;}case'url':_0x30944f['push'](_0x46b84a);break;case'mcp-tool-result':{const {data:_0x4d1f46,attributes:_0x2a5793}=JSON['parse'](_0x46b84a['content']);_0x157a9f['_handleToolResultData']({'toolName':_0x46b84a['toolName'],'data':_0x4d1f46,'attributes':_0x2a5793});break;}}}}}async['_extractContextItems'](_0x3badbf){const _0x12d1cc=new Map();if(!_0x3badbf['content'])return _0x12d1cc;for(const _0x212e07 of _0x3badbf['content']){const _0x5c8f38=await this['chatContext']['populateFromMessage'](_0x212e07);_0x5c8f38&&_0x12d1cc['set'](_0x5c8f38['id'],_0x5c8f38);}return _0x12d1cc;}async['handleUserInteraction']({userMessage:_0x162e2d,attributes:_0x2bb1f5}){if(!this['isStarted'])throw new ht('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new ht('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x4de3b2=this['chatContext']['getPendingContextItems'](),_0x375a42=this['chatCapabilities']['getCapabilitiesConfig'](),_0x52f410=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x162e2d,'contextItems':_0x4de3b2,'capabilities':_0x375a42,'modelId':_0x52f410,'attributes':_0x2bb1f5}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x547ef1){if(_0x547ef1 instanceof ht)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x547ef1});else{const _0x593e7c=Bs['get'](_0x547ef1['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new ht(_0x593e7c,null,{'error':_0x547ef1})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x5218fa,contextItems:_0xb9dc20,capabilities:_0x267cb5,modelId:_0x2a1542,attributes:_0x9232e6}){const _0x1b8adc=new Ys({'userMessage':_0x5218fa,'contextItems':_0xb9dc20,'capabilities':_0x267cb5,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x2a1542,'attributes':_0x9232e6});return _0x1b8adc['delegate'](...Hs)['to'](this),this['interactions']['push'](_0x1b8adc),this['fire']('interactionCreated',_0x1b8adc),_0x1b8adc;}['getInteraction'](_0x1bfd40){return this['interactions']['find'](_0x55b843=>_0x55b843['id']===_0x1bfd40);}['removeInteraction'](_0x43f760){const _0x592c38=this['getInteraction'](_0x43f760);_0x592c38&&(_0x592c38['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x592c38),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x102f87){this['chatContext']['addCurrentDocumentToContext'](_0x102f87);}async['updateCurrentDocumentInContext']({content:_0x36ab9d,version:_0x3da95f,sessionId:_0x4ed3c2,selections:_0x1e221e}){await this['chatContext']['updateCurrentDocument'](_0x36ab9d,_0x3da95f,_0x4ed3c2,_0x1e221e);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x3ed8a9){this['chatContext']['addSelectionToContext'](_0x3ed8a9);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x37d430){this['chatContext']['addFilesToContext'](_0x37d430);}['addUrlToContext'](_0x472bb2){this['chatContext']['addUrlToContext'](_0x472bb2);}['addToolItemToContext'](_0x4e4224){this['chatContext']['addToolItemToContext'](_0x4e4224);}['addResourceToContext'](_0x5dc00e,_0x4b30ca){this['chatContext']['addResourceToContext'](_0x5dc00e,_0x4b30ca);}['loadSourceResources'](_0x507ae3,_0x24596e,_0x2c00fa){return this['chatContext']['loadSourceResources'](_0x507ae3,_0x24596e,_0x2c00fa);}['removeFromContext'](_0x11663d){this['chatContext']['removeFromContext'](_0x11663d);}['setWebSearch'](_0xef09e9){this['chatCapabilities']['setWebSearch'](_0xef09e9);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x319e71){this['chatCapabilities']['setReasoning'](_0x319e71);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x47c498){_0x47c498?!0x1===await this['chatModels']['isAvailable'](_0x47c498)&&(Tt('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x47c498}),_0x47c498=(await this['chatModels']['getAvailableModels']())[0x0]):(Tt('ai-chat-conversation-set-model-null',{'conversation':this}),_0x47c498=(await this['chatModels']['getAvailableModels']())[0x0]),_0x47c498['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x47c498,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x47c498}));}}class qs extends pt(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x30b2ed,config:_0x5cee95,locale:_0x30ff4a}){super(),this['_connector']=_0x30b2ed,this['_config']=_0x5cee95,this['_locale']=_0x30ff4a;}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 _0x2bf05c=await this['getAll']();let _0x14ae6e;return _0x14ae6e=this['_availableModels']?this['_filterModels'](_0x2bf05c,this['_availableModels']):_0x2bf05c['filter'](_0xf8b47f=>_0xf8b47f['recommended']),_0x14ae6e;}async['getModel'](_0x2f2fac){const _0x558ec7=await this['getAll']();if(!_0x558ec7['length'])return null;if(_0x2f2fac){const _0x1b7319=this['_getModelById'](_0x558ec7,_0x2f2fac);if(_0x1b7319)return _0x1b7319;Tt('ai-chat-model-id-unrecognized',{'modelId':_0x2f2fac,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x5f516e=await this['getAvailableModels']();if(!_0x5f516e['length'])return null;if(this['_defaultModelId']){const _0x3c5ff9=this['_getModelById'](_0x5f516e,this['_defaultModelId']);if(_0x3c5ff9)return _0x3c5ff9;Tt('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x5f516e[0x0]['id']});}return _0x5f516e[0x0];}async['isAvailable'](_0xcc850){return(await this['getAvailableModels']())['some'](_0x3bbe3c=>_0x3bbe3c['name']===_0xcc850['name']&&_0x3bbe3c['provider']===_0xcc850['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0xda8658=this['_locale']['uiLanguage']||'en',_0x3bff2b=this['_connector']['getModels'](_0xda8658),_0x581734=await _0x3bff2b['list']();this['_modelList']=_0x581734['items']['map'](_0x2935e1=>Qs(_0x2935e1)?{..._0x2935e1,'name':us(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x2935e1);}catch(_0x3359d7){throw mt('ai-models-unable-to-retrieve',{'error':_0x3359d7}),_0x3359d7;}return[...this['_modelList']];}['_filterModels'](_0x3dd734,_0x3feb26){let _0x4062a3;if(_0x3feb26){_0x4062a3=[];const _0x1d9630=new Set(),_0x33bfbf='string'==typeof _0x3feb26?[_0x3feb26['toLocaleLowerCase']()]:_0x3feb26['map'](_0xe057a2=>_0xe057a2['toLocaleLowerCase']());for(const _0x219087 of _0x33bfbf)for(const _0xd7db64 of _0x3dd734)!_0x1d9630['has'](_0xd7db64['id'])&&this['_isMatchingFilter'](_0xd7db64,_0x219087)&&(_0x4062a3['push'](_0xd7db64),_0x1d9630['add'](_0xd7db64['id']));}else _0x4062a3=_0x3dd734;return _0x4062a3;}['_isMatchingFilter'](_0x6c9f1a,_0x56c7b0){const _0x33c32b=_0x6c9f1a['id']['toLocaleLowerCase'](),_0x5ac15f=_0x6c9f1a['name']['toLocaleLowerCase'](),_0x57b2ef=_0x6c9f1a['provider']['toLocaleLowerCase']();return _0x33c32b===_0x56c7b0||_0x5ac15f===_0x56c7b0||Qs(_0x6c9f1a)&&'auto'===_0x56c7b0||_0x57b2ef===_0x56c7b0||_0x33c32b['startsWith'](_0x56c7b0);}['_getModelById'](_0x11208f,_0x3f3dc5){return _0x11208f['find'](_0x3504f4=>Qs(_0x3504f4)&&'auto'===_0x3f3dc5?_0x3504f4:_0x3504f4['id']===_0x3f3dc5)||null;}}function Qs(_0x167835){return _0x167835['id']['startsWith']('agent');}function Xs(_0x237570){if(_0x237570 instanceof _0x54b56a)return _0x237570;if(_0x237570?.['editors']&&_0x237570['editors']['get'](0x0))return _0x237570['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.'),_0x237570['editors']['get'](0x0);throw new ht('ai-get-editor-from-context-no-editor');}function zs({editor:_0x3b4095,interaction:_0x229efa,reply:_0x1ae70c,groups:_0x20e045,transform:_0x57f240,documentCompare:_0x203a7b,documentCompareOptions:_0x524ac5}){const _0x569801=_0x229efa['getDocumentContext']();if(!_0x569801)return[];const _0x34d475=_0x569801['content'],_0x1fa143=_0x569801['version'],_0x4b7b73=_0x1ae70c['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x64dfac}of _0x20e045){const _0x447ca9=_0x64dfac['filter'](_0x241d12=>'new'!=_0x241d12['type'])['map'](_0x252d2e=>ps('data-id',_0x252d2e['id'],_0x4b7b73)),_0x23326b=_0x64dfac['filter'](_0x5099ea=>'removed'!=_0x5099ea['type'])['map'](_0x9360a5=>_0x9360a5['node']['cloneNode'](!0x0));let _0x12adba=null;if(_0x447ca9['length']){_0x12adba=_0x447ca9[0x0]['previousSibling'];for(let _0x16cc00=0x0;_0x16cc00<_0x447ca9['length'];_0x16cc00++)_0x1e1233(_0x447ca9[_0x16cc00]);}if(_0x23326b['length']){_0x12adba||(_0x64dfac[0x0]['anchorId']?_0x12adba=ps('data-id',_0x64dfac[0x0]['anchorId'],_0x4b7b73):(_0x12adba=_0x23326b['shift'](),_0x40ad33(_0x4b7b73,_0x12adba)));for(let _0x3396a9=0x0;_0x3396a9<_0x23326b['length'];_0x3396a9++)_0xfeeaba(_0x12adba,_0x23326b[_0x3396a9]),_0x12adba=_0x23326b[_0x3396a9];}}const _0x4ce9a5=Es(_0x4b7b73),_0x500a72=_0x203a7b['getDiff'](_0x34d475,_0x4ce9a5,_0x524ac5)['getOperations']();if(_0x57f240){const _0x5306c4=_0x3b4095['model']['document']['history']['getOperations'](_0x1fa143),_0x48bc2c={'document':_0x3b4095['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x5ccf4a(_0x500a72,_0x5306c4,_0x48bc2c)['operationsA'];}return _0x500a72;}function js(_0x4aaf33,_0x106617){if('marker'!=_0x106617['type'])return;const _0xd5b428=_0x4aaf33['model']['markers']['get'](_0x106617['name']);_0xd5b428&&(_0x106617['oldRange']=_0xd5b428['getRange']());}class Js extends _0x4c168b{['activeConversation'];['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[ls,_0x28cdab];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new Qt(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 qs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x2bdc98=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x556e4a,_0x2bb69f)=>{this['_handleUIUserMessage']({'message':_0x2bb69f});}),this['listenTo'](_0x2bdc98,'resizedTabs',(_0x3daec8,_0x52fb8f)=>{this['_setIsMaximized'](_0x52fb8f);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x2bdc98['resize']();}),this['listenTo'](_0x2bdc98['view'],'change:activeTab',(_0x2d987d,_0x37bdc5,_0x255e95)=>{'chat'!==_0x255e95&&this['removeSelectionFromChatContext']();}),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',(_0x534bdf,_0x32ed71)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x32ed71));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x30acaa,_0xd1183c)=>{this['activeConversation']?.['addUrlToContext'](_0xd1183c);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x291638,_0x3f55db)=>{_0x3f55db['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x47e6fc,_0x2282be)=>{this['activeConversation']?.['addResourceToContext'](_0x2282be['source'],_0x2282be['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x3936a8,_0x421e73)=>{this['_removeFromContext'](_0x421e73);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x12fd67,_0x5e4300)=>{this['activeConversation']?.['loadSourceResources'](_0x5e4300['sourceId'],_0x5e4300['query'],_0x5e4300['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x398257,_0x44b4b9)=>{this['activeConversation']?.['setModel'](_0x44b4b9);}),this['listenTo'](this['_aiChatUi'],'like',(_0x2e5928,{replyId:_0x388563})=>{console['log']('Liked\x20response',_0x388563);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x4f81b8,{replyId:_0x2a45f7})=>{console['log']('Disliked\x20response',_0x2a45f7);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x5ce691,_0x2c18df)=>{this['_insertSuggestion'](_0x2c18df);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x5ed0c9,{replyId:_0x1edf85,partIndex:_0xe9deff})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x1edf85,_0xe9deff);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x15c858,{replyId:_0x5cb6da,partIndex:_0x26f134})=>{const _0x9baa4f=this['_getDocumentRangeForReplyChanges'](_0x5cb6da,_0x26f134);_0x9baa4f&&'$graveyard'!=_0x9baa4f['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'ranges':[_0x9baa4f['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x140183,_0x1626aa)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x1626aa);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x38fead,{replyId:_0x4811be,showDiff:_0x47ab47})=>{const {reply:_0x5f5da4}=this['getInteractionAndReplyById'](_0x4811be),_0x415e3e=_0x5f5da4['getContentParts']({'showDiff':_0x47ab47});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x5f5da4['id'],'parts':_0x415e3e,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x584553,{replyId:_0x57e9fc,partIndex:_0x13354d})=>{this['_rejectSuggestion']({'replyId':_0x57e9fc,'partIndex':_0x13354d}),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),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:_0x469fc2,partIndex:_0x16873b}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x1d565b}=this['getInteractionAndReplyById'](_0x469fc2),_0x2e2026=_0x1d565b['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x16873b});this['_aiChatBalloon']['updateContent']({'part':_0x2e2026[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0x1a6467,partIndex:_0x15ac3b}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x1a6467,'partIndex':_0x15ac3b}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0xb3c2df,partIndex:_0x4b52d1}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0xb3c2df,'partIndex':_0x4b52d1}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x5bf3fe,partIndex:_0x54b140}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x5bf3fe,'partIndex':_0x54b140}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0xe0302f,partIndex:_0x4b497a}=this['_currentPreviewedChangeGroup'],_0x4f0db7=this['_getPresentableSiblingContentPartIndex'](_0xe0302f,_0x4b497a,'next');null!==_0x4f0db7&&this['_openBalloonFor'](_0xe0302f,_0x4f0db7);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0x1b979f,partIndex:_0x346d66}=this['_currentPreviewedChangeGroup'],_0x4630eb=this['_getPresentableSiblingContentPartIndex'](_0x1b979f,_0x346d66,'previous');null!==_0x4630eb&&this['_openBalloonFor'](_0x1b979f,_0x4630eb);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x5d9be7,{id:_0x2ccea7})=>{if('aiChatBalloon'!==_0x2ccea7)return;const {replyId:_0x4e8da8,partIndex:_0x493f06}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x4e8da8,'index':_0x493f06,'isActive':!0x1});}));}async['afterInit'](){this['context']instanceof _0x54b56a?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x5f59a5,_0x4eacb1)=>{_0x4eacb1['on']('ready',()=>{this['_integrateEditor'](_0x4eacb1);});});const _0x117067=this['context']['config']['get']('ai.chat.initialConversation');let _0x1ae46c=_0x117067;if('lastCreated'!=_0x117067||(_0x1ae46c=await this['_getLastCreatedConversationId'](),_0x1ae46c))return'new'==_0x1ae46c?this['_startConversationSafely']():this['loadConversation'](_0x1ae46c);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async['loadConversation'](_0x5d15a7){this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),(this['context']['plugins']['get'](cs)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x5d15a7)['getConversation'](),await this['_startConversationSafely'](_0x5d15a7),this['_updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x5d15a7,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x459aac){this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x5d15a7}),this['_logError'](new ht('ai-chat-conversation-not-found',this,{'error':_0x459aac}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['registerToolDataCallback'](_0x9883d6){let _0x3cfdb7=null,_0x29ca57=null;this['on']('toolDataReceived',(_0x259ebe,_0x404ba9,_0x1360bc)=>{_0x1360bc['id']!==_0x3cfdb7&&(_0x3cfdb7=_0x1360bc['id'],_0x29ca57=this['_getAIChatFeedAPI'](_0x1360bc)),_0x9883d6(_0x404ba9,_0x29ca57);});}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](us(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x284301=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x284301),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage'](_0x308e91){await this['_handleUIUserMessage'](_0x308e91);}['getGroupId'](){const _0x2f78ba=this['context']['config']['get']('collaboration.channelId');if(!_0x2f78ba)throw new ht('ai-chat-missing-channel-id',this);return _0x2f78ba;}['_handleRemovedConversation'](_0x1254cb){this['activeConversation']['id']===_0x1254cb&&this['_startConversationSafely']();}['_insertSuggestion'](_0xa4e6ea){const _0x25b970=Xs(this['context']);if(!_0x25b970['plugins']['has']('TrackChanges'))throw new ht('ai-no-track-changes',null);const _0x397ec2=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x304557,interaction:_0x374126}=this['getInteractionAndReplyById'](_0xa4e6ea['replyId']),_0x263193=this['_getDocumentRangeForReplyChanges'](_0xa4e6ea['replyId'],_0xa4e6ea['partIndex']),_0x5d4bea=void 0x0!==_0xa4e6ea['partIndex']?[_0x304557['changeGroups'][_0xa4e6ea['partIndex']]]:_0x304557['changeGroups']['filter'](_0x511389=>'pending'==_0x511389['state']),_0x389397=_0x5d4bea['map'](_0x5cdd90=>_0x304557['changeGroups']['indexOf'](_0x5cdd90));if(!_0x263193||'$graveyard'==_0x263193['range']['root']['rootName'])return void _0x389397['forEach'](_0x1dc4ef=>_0x304557['setChangeGroupState'](_0x1dc4ef,'outdated'));_0x389397['forEach'](_0xc57213=>_0x304557['setChangeGroupState'](_0xc57213,'accepted'));const _0x48588c=zs({'editor':_0x25b970,'reply':_0x304557,'interaction':_0x374126,'groups':_0x5d4bea,'transform':!0x0,'documentCompare':_0x397ec2,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x4b7675;_0x263193&&this['_scrollToSuggestionRange'](_0x263193['range']),_0x25b970['model']['change'](_0x52ba62=>{_0x4b7675=_0x52ba62['batch'],_0x25b970['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x48588c),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x4b7675,{'interactionId':_0x374126['id'],'replyId':_0x304557['id'],'indexes':_0x389397['slice']()}),this['_updateRatings'](_0x304557);}['_applySuggestion'](_0x25d260){const _0x103388=Xs(this['context']),_0xb05d6b=this['context']['plugins']['get'](_0x28cdab),{reply:_0x4c03e4,interaction:_0x59f6b1}=this['getInteractionAndReplyById'](_0x25d260['replyId']),_0x36c30c=this['_getDocumentRangeForReplyChanges'](_0x25d260['replyId'],_0x25d260['partIndex']),_0x23cd8e=void 0x0!==_0x25d260['partIndex']?[_0x4c03e4['changeGroups'][_0x25d260['partIndex']]]:_0x4c03e4['changeGroups']['filter'](_0xad56db=>'pending'==_0xad56db['state']),_0x5ab6fd=_0x23cd8e['map'](_0x27da5d=>_0x4c03e4['changeGroups']['indexOf'](_0x27da5d));if(!_0x36c30c||'$graveyard'==_0x36c30c['range']['root']['rootName'])return void _0x5ab6fd['forEach'](_0x3a85fc=>_0x4c03e4['setChangeGroupState'](_0x3a85fc,'outdated'));_0x5ab6fd['forEach'](_0x4c0527=>_0x4c03e4['setChangeGroupState'](_0x4c0527,'accepted'));const _0x61f220=zs({'editor':_0x103388,'reply':_0x4c03e4,'interaction':_0x59f6b1,'groups':_0x23cd8e,'transform':!0x0,'documentCompare':_0xb05d6b,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x11e40c;_0x36c30c&&this['_scrollToSuggestionRange'](_0x36c30c['range']),_0x103388['model']['change'](_0x5498cf=>{_0x11e40c=_0x5498cf['batch'];for(const _0x3236c9 of _0x61f220)_0x3236c9['baseVersion']=_0x103388['model']['document']['version'],js(_0x103388,_0x3236c9),_0x5498cf['batch']['addOperation'](_0x3236c9),_0x103388['model']['applyOperation'](_0x3236c9);}),this['_batchToChanges']['set'](_0x11e40c,{'interactionId':_0x59f6b1['id'],'replyId':_0x4c03e4['id'],'indexes':_0x5ab6fd['slice']()}),this['_updateRatings'](_0x4c03e4);}['_rejectSuggestion'](_0x1df0e8){const {reply:_0x4e7847}=this['getInteractionAndReplyById'](_0x1df0e8['replyId']);_0x4e7847['setChangeGroupState'](_0x1df0e8['partIndex'],'rejected');}['_openBalloonFor'](_0x124ffd,_0x54fe08){if(!this['_aiChatBalloon'])return;const {reply:_0x29e654}=this['getInteractionAndReplyById'](_0x124ffd),_0x383ba9=_0x29e654['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x437606,_0x211ef6;if(void 0x0!==_0x54fe08?(_0x211ef6=_0x383ba9['find'](_0x56f942=>_0x56f942['index']==_0x54fe08),_0x437606=_0x211ef6?.['index']):(_0x211ef6=_0x383ba9[0x0],_0x437606=_0x211ef6['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x124ffd&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x437606)return;const _0x40436a=this['_getUserPresentableContentPartDocumentRange'](_0x124ffd,_0x29e654,_0x211ef6);if(!_0x40436a)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x124ffd,'partIndex':_0x437606},this['_scrollToSuggestionRange'](_0x40436a,!0x0);const _0x59a991=this['_getPresentableSiblingContentPartIndex'](_0x124ffd,_0x437606,'next');this['_aiChatBalloon']['updateContent']({'part':_0x211ef6,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x437606,'title':us(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x437606+0x1)['toString']()),'showRotator':null!==_0x59a991,'ranges':[_0x40436a],'areActionsDisabled':_0x29e654['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x124ffd,_0x437606),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x124ffd,'index':_0x437606,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x2d2a03,_0x36bd41,_0x1a574a){const {reply:_0x296f34}=this['getInteractionAndReplyById'](_0x2d2a03),_0x349766=_0x296f34['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x349766['length'])return null;const _0x3ed4ad=_0x349766['findIndex'](_0x54feec=>_0x54feec['index']==_0x36bd41),_0x2b6eda='next'==_0x1a574a?0x1:-0x1;let _0x435ef6=_0x349766['at']((_0x3ed4ad+_0x2b6eda)%_0x349766['length'])['index'],_0x232223=_0x349766[_0x435ef6];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x2d2a03,_0x296f34,_0x232223);){if(_0x435ef6=_0x349766['at']((_0x435ef6+_0x2b6eda)%_0x349766['length'])['index'],_0x435ef6===_0x3ed4ad)return null;_0x232223=_0x349766[_0x435ef6];}return _0x435ef6;}['_getUserPresentableContentPartDocumentRange'](_0x585448,_0xd5fa2b,_0x47ed24){const _0x4a7963=_0xd5fa2b['changeGroups'];if(!_0x47ed24['hasChanges'])return null;const _0x33ffbc=_0x4a7963['find'](_0x4b4de7=>_0x4b4de7['index']==_0x47ed24['index']);if('pending'!==_0x33ffbc?.['state'])return null;const _0x4fed7d=this['_getDocumentRangeForReplyChanges'](_0x585448,_0x47ed24['index']);if(!_0x4fed7d)return null;const {range:_0x37714d,currentIndex:_0x2b54f3}=_0x4fed7d;return'$graveyard'==_0x37714d['root']['rootName']?(_0xd5fa2b['setChangeGroupState'](_0x2b54f3,'outdated'),null):_0x4fed7d['range'];}['_getDocumentRangeForReplyChanges'](_0x81106d,_0x1ea3ac){const _0x17cdb3=Xs(this['context']),{reply:_0x1b0bf1,interaction:_0x40a5f1}=this['getInteractionAndReplyById'](_0x81106d),_0x554c02=_0x1b0bf1['changeGroups']['filter'](_0x36b004=>'pending'==_0x36b004['state']),_0xf207b1=_0x554c02['map'](_0x1269b3=>_0x1b0bf1['changeGroups']['indexOf'](_0x1269b3));void 0x0===_0x1ea3ac&&(_0x1ea3ac=_0xf207b1[0x0]);const _0x153a22=_0xf207b1['indexOf'](_0x1ea3ac);if(-0x1==_0x153a22)return null;const _0x1a8b7d=_0x554c02[_0x153a22],_0xf0abb7=new _0x497c92([]),_0x42e28d=new _0x497c92([]);for(const _0x21a649 of _0x1a8b7d['changes'])if('removed'!=_0x21a649['type']&&_0x42e28d['children']['push'](_0x21a649['node']['cloneNode'](!0x0)),'new'!=_0x21a649['type']){const _0x1f70d8=_0xff2f34(_0xcedd9b=>ms(_0xcedd9b,'data-id')==_0x21a649['id'],_0x1b0bf1['documentContextContent'],!0x0);_0xf0abb7['children']['push'](_0x1f70d8['cloneNode'](!0x0));}if(0x0==_0xf0abb7['children']['length']){if(_0x1a8b7d['changes'][0x0]['anchorId']){const _0x3f1588=ps('data-id',_0x1a8b7d['changes'][0x0]['anchorId'],_0x1b0bf1['documentContextContent']);_0xf0abb7['children']['unshift'](_0x3f1588['cloneNode'](!0x0)),_0x42e28d['children']['unshift'](_0x3f1588['cloneNode'](!0x0)),_0x3f1588['nextSibling']&&(_0xf0abb7['children']['push'](_0x3f1588['nextSibling']['cloneNode'](!0x0)),_0x42e28d['children']['push'](_0x3f1588['nextSibling']['cloneNode'](!0x0)));}else{const _0x345228=_0x1b0bf1['documentContextContent']['children'][0x0];if(!_0x345228)return null;_0xf0abb7['children']['push'](_0x345228['cloneNode'](!0x0)),_0x42e28d['children']['push'](_0x345228['cloneNode'](!0x0));}}const _0x78511=_0x40a5f1['getDocumentContext'](),_0x4c6aba=_0x17cdb3['data']['parse'](_0x78511['content']),_0x4ef2b8=Es(_0xf0abb7),_0x27e3de=_0x17cdb3['data']['parse'](_0x4ef2b8),_0x23d015=_0x17cdb3['data']['parse'](_0x4ef2b8),_0x6f7cf0=_0x17cdb3['model']['createPositionAt'](_0x27e3de,0x0),_0x2eb152=Es(_0x42e28d),_0x39270e={'anchor':_0x6f7cf0,'markDeletions':!0x1},_0x53b2d8=_0x17cdb3['plugins']['get'](_0x28cdab)['getDiff'](_0x4ef2b8,_0x2eb152,_0x39270e)['getOperations']();if(!_0x53b2d8['length'])return null;_0x17cdb3['model']['change'](_0x57cf89=>{for(const _0x1c38f4 of _0x53b2d8)if('remove'==_0x1c38f4['type']){const _0x392cd6=_0x1c38f4['sourcePosition'],_0x6b960b=_0x1c38f4['howMany'],_0x534d66=new _0x3af47c(_0x392cd6,_0x6b960b);_0x57cf89['batch']['addOperation'](_0x534d66),_0x17cdb3['model']['applyOperation'](_0x534d66);}else'marker'!==_0x1c38f4['type']&&(_0x1c38f4['baseVersion']=null,_0x1c38f4['isDocumentOperation']=!0x1,_0x57cf89['batch']['addOperation'](_0x1c38f4),_0x17cdb3['model']['applyOperation'](_0x1c38f4));});const _0x54e23f=ys(_0x17cdb3,_0x53b2d8,_0x27e3de);xs(_0x17cdb3['model'],_0x54e23f);const _0x31fc6e=_0x54e23f['getFirstRange']()['start']['path']['slice'](),_0x160f0b=_0x54e23f['getFirstRange']()['end']['path']['slice'](),_0x5e677e=[];let _0x5f39ac=_0x27e3de,_0x4d0d38=_0x23d015;for(let _0x320d54=0x0;_0x320d54<_0x160f0b['length'];_0x320d54++){const _0x2855ab=_0x5f39ac['maxOffset']-_0x160f0b[_0x320d54];_0x5e677e[_0x320d54]=_0x4d0d38['maxOffset']-_0x2855ab,_0x5f39ac=_0x5f39ac['getChildAtOffset'](_0x160f0b[_0x320d54]),_0x4d0d38=_0x4d0d38['getChildAtOffset'](_0x5e677e[_0x320d54]);}const _0x31f9fc=_0x17cdb3['model']['createRange'](_0x17cdb3['model']['createPositionFromPath'](_0x23d015,_0x31fc6e),_0x17cdb3['model']['createPositionFromPath'](_0x23d015,_0x5e677e)),_0x1df287=_0x23d015['getChild'](0x0)['getAttribute'](_0x2ac232),_0x12fe74=Array['from'](_0x4c6aba['getChildren']())['find'](_0x343573=>_0x343573['getAttribute'](_0x2ac232)==_0x1df287)['getPath'](),_0x282fff=_0x31f9fc['start']['path']['slice'](),_0x288773=_0x31f9fc['end']['path']['slice']();_0x282fff[0x0]=_0x12fe74[0x0]+_0x282fff[0x0],_0x288773[0x0]=_0x12fe74[0x0]+_0x288773[0x0];let _0x4cfdc2=_0x17cdb3['model']['createRange'](_0x17cdb3['model']['createPositionFromPath'](_0x17cdb3['model']['document']['getRoot'](),_0x282fff),_0x17cdb3['model']['createPositionFromPath'](_0x17cdb3['model']['document']['getRoot'](),_0x288773));const _0x17537f=_0x17cdb3['model']['document']['history']['getOperations'](_0x78511['version']);for(const _0xbc34e0 of _0x17537f)_0x4cfdc2=_0x309081['_createFromRanges'](_0x4cfdc2['getTransformedByOperation'](_0xbc34e0));return{'range':_0x4cfdc2,'currentIndex':_0x1ea3ac};}['_integrateEditor'](_0x2a8d80){if(_0x2a8d80['plugins']['has']('Undo')){const _0x22728f=_0x2a8d80['commands']['get']('undo'),_0x19f618=_0x2a8d80['commands']['get']('redo');this['listenTo'](_0x22728f,'revert',(_0x633722,_0x2a1c1c,_0x28e75f)=>{const _0x2b2eb2=this['_batchToChanges']['get'](_0x2a1c1c);if(!_0x2b2eb2)return;const _0xa99a78=this['activeConversation']['getInteraction'](_0x2b2eb2['interactionId'])['getReply'](_0x2b2eb2['replyId']);_0x2b2eb2['indexes']['forEach'](_0x44cfec=>_0xa99a78['setChangeGroupState'](_0x44cfec,'pending')),this['_batchToChanges']['delete'](_0x2a1c1c),this['_batchToChanges']['set'](_0x28e75f,_0x2b2eb2);}),this['listenTo'](_0x19f618,'revert',(_0x468bd4,_0x4541aa,_0x2e06db)=>{const _0x2bcc90=this['_batchToChanges']['get'](_0x4541aa);if(!_0x2bcc90)return;const _0x225ecc=this['activeConversation']['getInteraction'](_0x2bcc90['interactionId'])['getReply'](_0x2bcc90['replyId']);_0x2bcc90['indexes']['forEach'](_0x51954e=>_0x225ecc['setChangeGroupState'](_0x51954e,'accepted')),this['_batchToChanges']['delete'](_0x4541aa),this['_batchToChanges']['set'](_0x2e06db,_0x2bcc90);});}const _0x5d3a2c=_0x2a8d80['config']['get']('ai.chat.context');_0x5d3a2c['alwaysAddSelection']&&_0x5d3a2c['document']['enabled']&&this['listenTo'](_0x2a8d80['model']['document']['selection'],'change:range',(_0x6f4df9,_0x2ac476)=>{if(!_0x2ac476['directChange'])return;'chat'===_0x2a8d80['plugins']['get']('AITabs')['view']['activeTab']&&(_0x2a8d80['model']['hasContent'](_0x2a8d80['model']['document']['selection'])?this['addSelectionToChatContext']():this['removeSelectionFromChatContext']());});}async['_getLastCreatedConversationId'](){const _0x28f237=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x143f85=await _0x28f237['getConversations']();return _0x143f85['length']?_0x143f85[0x0]['id']:'new';}catch(_0x7678bb){return this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':ot()}),this['_logError'](new ht('ai-chat-conversation-init-failed',this,{'error':_0x7678bb})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async['_startConversationSafely'](_0x20ec41){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x20ec41);}catch(_0x5ac719){this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x20ec41||ot()}),console['error'](_0x5ac719),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x56d7ed){let _0x21d0da;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0x56d7ed||!this['activeConversation']?_0x21d0da=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x21d0da=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x369187=this['getGroupId'](),_0x493577=_0x56d7ed||ot();this['activeConversation']=new $s({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x21d0da,'conversationId':_0x493577,'group':_0x369187,'getEditor':()=>Xs(this['context']),'isFromHistory':!!_0x56d7ed}),this['activeConversation']['delegate']('toolDataReceived','interactionStarted')['to'](this),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','replyCreated')['to'](this),this['on']('interactionCreated',(_0x503734,_0x3eeef0)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x3eeef0);}),this['on']('replyCreated',(_0x1777d3,_0x3813b8)=>{this['_addFeedItemReply'](_0x3813b8);}),this['activeConversation']['on']('conversationInitialized',(_0x48d608,_0x2b3a54)=>{this['_aiChatUi']['createConversation'](_0x2b3a54),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x56d7ed||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0xd12d76,_0x55bfa2)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x55bfa2['isUploadInProgress']);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x39effa=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x39effa);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x360219=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x360219);}),this['activeConversation']['on']('webSearchFinished',(_0x2a124e,_0x1bfee9)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x1bfee9,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x1d35c1,_0x41dff4)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x41dff4,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x387b52,_0x749fa9)=>{this['_aiChatUi']['removeFeedInteraction'](_0x749fa9['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x36e1aa,_0x5e4c9a,_0x1ebadf)=>{this['_updateConversationTitle'](_0x5e4c9a,_0x1ebadf);}),this['activeConversation']['on']('replyContentUpdated',async(_0x175809,_0x1b3637)=>{await this['_updateReplyContent']({'reply':_0x1b3637});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x325df3,{reply:_0x370803,index:_0x3ccfb5,state:_0x4d55ca})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x370803['id'],'index':_0x3ccfb5,'state':_0x4d55ca}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x370803['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x3ccfb5&&this['_aiChatBalloon']?.['setState'](_0x4d55ca);}),this['activeConversation']['on']('contextItemAdded',(_0x165888,_0xb574cf)=>{if(this['_aiChatUi']['addContextItem'](_0xb574cf['contextItem'],_0xb574cf['isLoading']),'selection'===_0xb574cf['contextItem']['type']){const _0x4be105=[...Xs(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'ranges':_0x4be105,'id':'context','priority':0x1});}}),this['activeConversation']['on']('contextItemRemoved',(_0x34fe55,_0x325ddd)=>{this['_aiChatUi']['removeContextItem'](_0x325ddd['uiId']),'current-document'==_0x325ddd['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x325ddd['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x2b7eba,_0x43613d)=>{this['_aiChatUi']['setContextItemLoading'](_0x43613d['contextItem']['uiId'],_0x43613d['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x6ec795,_0x54b758)=>{this['_aiChatUi']['setConversationContext'](_0x54b758['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x3aa70e,_0x57dfb0)=>{this['_aiChatUi']['setAddContextOptions'](_0x57dfb0['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x22ace8,_0x4d345c)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x4d345c['sourceId'],_0x4d345c['source'],_0x4d345c['resources'],_0x4d345c['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0xd5f703,_0x5e9c83)=>{this['_aiChatUi']['updateResourceState'](_0x5e9c83['sourceId'],_0x5e9c83['resourceId'],_0x5e9c83['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x125135,_0x3d612b)=>{this['_aiChatUi']['updateCapabilities'](_0x3d612b);}),this['activeConversation']['on']('modelSelected',async(_0x53ff06,_0x13f1b3)=>{const _0x46ff67=(await this['_aiChatModels']['getAll']())['find'](_0xbd5e9f=>_0xbd5e9f['id']===_0x13f1b3['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x46ff67,_0x13f1b3['isDisabled']);}),this['activeConversation']['on']('error',(_0x3ea80a,{error:_0x477ae6,interactionId:_0x584a06,fileName:_0x5cd81b,url:_0x17d958,sourceId:_0x16dbc1,sourceLabel:_0x301616})=>{const _0x5877c9=_0x584a06?_0x584a06+':'+ot():ot();_0x477ae6['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':us(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x5877c9}):_0x477ae6['message']['startsWith']('ai-chat-conversation-init-failed')||_0x477ae6['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x5877c9}),this['_logError'](_0x477ae6)):_0x477ae6['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x5cd81b),'id':_0x5877c9}):_0x477ae6['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x17d958),'id':_0x5877c9}):_0x477ae6['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x5877c9}):_0x477ae6['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x5877c9}):_0x477ae6['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x16dbc1&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x16dbc1),this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x301616||'source'),'id':_0x5877c9}),this['_logError'](_0x477ae6)):_0x477ae6['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x5877c9}),this['_logError'](_0x477ae6)):_0x477ae6['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x5877c9}),this['_logError'](_0x477ae6)):_0x477ae6['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x5877c9}),this['_logError'](_0x477ae6)):_0x477ae6['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x5877c9}),this['_logError'](_0x477ae6)):_0x477ae6['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x5877c9}),this['_logError'](_0x477ae6)):_0x477ae6['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x5877c9}),this['_logError'](_0x477ae6)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x5877c9}),this['_logError'](_0x477ae6));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x56d7ed||await this['activeConversation']['start']();}async['_handleUIUserMessage']({message:_0x296bd6,attributes:_0x26b13c}){if(!this['activeConversation'])throw new ht('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x303f45=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x303f45);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x296bd6,'attributes':_0x26b13c});}['_setIsMaximized'](_0x296a21){this['_aiChatUi']['setIsMaximized'](_0x296a21);}['_logError'](_0xb52330){mt(_0xb52330['message']);}['_removeFromContext'](_0x520656){this['activeConversation']?.['removeFromContext'](_0x520656);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x214e49){const [_0x2cf3bb,_0x5be0b8]=_0x214e49['split'](':'),_0x55a4d1=this['activeConversation']['getInteraction'](_0x2cf3bb),_0x316f46=_0x55a4d1['getReply'](_0x5be0b8);return{'interaction':_0x55a4d1,'reply':_0x316f46};}['_scrollToSuggestionRange'](_0x482068,_0x1e70f9=!0x1){const _0x1541fb=Xs(this['context']),_0x14fa07={'target':_0x1541fb['editing']['view']['domConverter']['viewRangeToDom'](_0x1541fb['editing']['mapper']['toViewRange'](_0x482068)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x1e70f9};_0x1e70f9&&(_0x14fa07['alignToTop']=!0x0),Ct(_0x14fa07);}['_updateConversationTitle'](_0x2e849c,_0x3d788b=!0x1){this['_aiChatUi']['setConversationTitle'](_0x2e849c||us(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x3d788b);}['_addFeedItemReply'](_0x4967e3){'text'===_0x4967e3['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x4967e3):this['_aiChatUi']['addFeedItemAISuggestion'](_0x4967e3);}async['_updateReplyContent']({reply:_0x850673,renderingStrategy:_0x5bbe3c}){const {id:_0x23a001,interactionId:_0x204dff,isDone:_0x23fcee,type:_0x42e6db,parsedContent:_0x2b1cb3}=_0x850673,_0x4088e0=_0x204dff+':'+_0x23a001;if('modification'===_0x42e6db){const _0x241b37=_0x850673['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x4088e0,'parts':_0x241b37,'renderingStrategy':_0x5bbe3c,'isDone':_0x23fcee});}else'text'===_0x42e6db&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x4088e0,'parsedContent':_0x2b1cb3,'renderingStrategy':_0x5bbe3c,'isDone':_0x23fcee});_0x23fcee&&_0x850673['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x4088e0,_0x850673['sources']);}async['_stopLastInteraction'](){const _0x2266e0=this['activeConversation']?.['lastInteraction'];_0x2266e0&&(_0x2266e0['stop'](),this['_aiChatUi']['stopInteraction'](_0x2266e0));}async['_flushLastInteractionUI'](){const _0x24bc5f=this['activeConversation']?.['lastInteraction'];if(_0x24bc5f){for await(const _0xa953c9 of _0x24bc5f['replies'])this['_aiChatUi']['hasFeedItem'](_0xa953c9['id'])||this['_addFeedItemReply'](_0xa953c9),await this['_updateReplyContent']({'reply':_0xa953c9,'renderingStrategy':'static'});}}['_updateRatings'](_0x49cfa4){const _0xc46547={'positiveCount':_0x49cfa4['changeGroups']['filter'](_0x161e57=>'accepted'===_0x161e57['state'])['length'],'totalCount':_0x49cfa4['changeGroups']['length'],'modificationId':_0x49cfa4['id']},_0x301474=this['activeConversation']['getInteraction'](_0x49cfa4['interactionId'])['messageId'];_0x301474&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x301474,_0xc46547);}['_getAIChatFeedAPI'](_0x4a71f8){const _0x541ff5=this['_aiChatUi'],_0x1bf231=()=>{_0x4a71f8['resetWebSearchState'](),_0x4a71f8['resetReasoningState'](),_0x541ff5['clearLoadingMessage']();},_0x26b9c1=()=>{_0x4a71f8['currentReply']&&(_0x4a71f8['currentReply']['done'](),_0x4a71f8['currentReply']=void 0x0);};return{'insertTextReply':(_0x2e6f0c,_0x57ea05)=>{_0x26b9c1(),_0x1bf231();const _0x32614d=_0x4a71f8['currentReply']=_0x4a71f8['createReply']({'type':'text','interactionId':_0x4a71f8['id'],'content':_0x2e6f0c,'id':_0x57ea05||ot()});return _0x26b9c1(),_0x32614d;},'insertCustomElement':async(_0x423dc1,_0x290488)=>(_0x26b9c1(),_0x1bf231(),_0x541ff5['addFeedItemCustomElement'](_0x423dc1,_0x290488||ot())),'setLoadingMessage':_0x110ce8=>{_0x541ff5['setLoadingMessage'](_0x110ce8);},'clearLoadingMessage':()=>{_0x541ff5['clearLoadingMessage']();}};}}const Zs='ai-selection';class tn extends _0x4c168b{constructor(_0x563ac4){super(_0x563ac4),this['context']['config']['define']('ai.models.showModelSelector',!0x0);}['_outputDataProcessor'];['_fakeSelections']=[];['_sessionId'];static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['sessionId'](){if(!this['_sessionId']){const _0x1316bd=Xs(this['context']),_0x4508a5=_0x1316bd['plugins']['has']('RealTimeCollaborationClient')&&_0x1316bd['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x4508a5||ot();}return this['_sessionId'];}async['getDocumentData'](){const _0x521bf7=Xs(this['context']),_0x2b1485=_0x521bf7['model'],_0x40fa50=_0x521bf7['data']['toView'](_0x2b1485['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x469840=new _0x2d80f3(_0x521bf7['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x40fa50,_0x469840);let _0x3b8bb6=await this['_getDocumentDataStringFromView'](_0x40fa50);const _0x40457d=this['_getMarkersInDocumentOrder'](),_0x5dc8f4=[];for(const _0x3038c9 of _0x40457d){const _0x2057ec='<'+_0x3038c9['name']+':start></'+_0x3038c9['name']+':start>',_0x2ce822=_0x3b8bb6['indexOf'](_0x2057ec);_0x3b8bb6=_0x3b8bb6['substring'](0x0,_0x2ce822)+_0x3b8bb6['substring'](_0x2ce822+_0x2057ec['length']);const _0x5a546e='<'+_0x3038c9['name']+':end></'+_0x3038c9['name']+':end>',_0x8df26a=_0x3b8bb6['indexOf'](_0x5a546e);_0x3b8bb6=_0x3b8bb6['substring'](0x0,_0x8df26a)+_0x3b8bb6['substring'](_0x8df26a+_0x5a546e['length']),_0x5dc8f4['push']({'markerName':_0x3038c9['name'],'start':_0x2ce822,'end':_0x8df26a,'htmlFragment':_0x3b8bb6['substring'](_0x2ce822,_0x8df26a)});}return{'content':_0x3b8bb6,'version':_0x521bf7['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x5dc8f4};}async['afterInit'](){this['context']instanceof _0x54b56a?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x39b892,_0x4e8494)=>{_0x4e8494['on']('ready',()=>{this['_integrateEditor'](_0x4e8494);});});}['_setOutputDataProcessor'](_0x4187c0){this['_outputDataProcessor']=_0x4187c0;}async['_getDocumentDataStringFromView'](_0x380cd9){let _0x1e6d32;const _0x24eb8e=Xs(this['context']);if(this['_outputDataProcessor']){const _0x1a6a98=_0x24eb8e['data']['processor']['domConverter']['viewToDom'](_0x380cd9),_0x5220f7=await this['_outputDataProcessor'](_0x1a6a98);_0x1e6d32=_0x24eb8e['data']['processor']['htmlWriter']['getHtml'](_0x5220f7);}else _0x1e6d32=_0x24eb8e['data']['processor']['toData'](_0x380cd9);return _0x1e6d32;}['_integrateEditor'](_0x506826){_0x506826['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Zs,'view':({markerName:_0x23008c})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x23008c['split'](':')[0x1]],'priority':0xc})}),_0x506826['conversion']['for']('dataDowncast')['markerToElement']({'model':Zs,'view':(_0x7d4c4b,{writer:_0xdb7f18,options:_0x32fd6a})=>_0x32fd6a['convertAiChatSelectionMarker']?_0xdb7f18['createUIElement'](_0x7d4c4b['markerName']+':'+(_0x7d4c4b['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x5c0bd9){const _0x1c14a2=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0x5c0bd9);const _0xf404cb=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x1c14a2,_0xf404cb);}['hideFakeVisualSelection'](_0x2925d7){const _0x1d08e7=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x2925d7);const _0x49ac90=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x1d08e7,_0x49ac90);}async['modelToDataWithIds'](_0x7757da){const _0x282b9c=Xs(this['context']),_0x1d5fe1=_0x282b9c['data']['toView'](_0x7757da),_0x2b315e=new _0x2d80f3(_0x282b9c['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x1d5fe1,_0x2b315e),this['_getDocumentDataStringFromView'](_0x1d5fe1);}['_setDataIdsOnChildren'](_0x1f8269,_0x3584f7){let _0x54495c=!0x1;const _0x1fd485=new Set();for(const _0x26996e of _0x1f8269['getChildren']()){if(!_0x26996e['is']('view:element'))continue;const _0x5be646=_0x26996e['is']('view:containerElement'),_0x438322=_0x26996e['is']('view:emptyElement'),_0x5c75bf=this['_setDataIdsOnChildren'](_0x26996e,_0x3584f7);if(_0x26996e['hasAttribute']('data-id')){_0x54495c=!0x0,_0x1fd485['add'](_0x26996e['getAttribute']('data-id'));continue;}(_0x5be646||_0x438322||_0x5c75bf)&&(_0x3584f7['setAttribute']('data-id',this['_nextDataId'](_0x1fd485),_0x26996e),_0x54495c=!0x0);}return _0x54495c;}['_nextDataId'](_0x51ef68){let _0x1e8191;do{_0x1e8191='';for(let _0x303ce9=0x0;_0x303ce9<0x4;_0x303ce9++)_0x1e8191+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x51ef68['has'](_0x1e8191));return _0x51ef68['add'](_0x1e8191),_0x1e8191;}['getSelectionText'](){const {model:_0x12740e}=Xs(this['context']),_0x50db7b=_0x12740e['document']['selection'],_0x3a764b=[],_0x2a6bb9=Array['from'](_0x50db7b['getRanges']());_0x2a6bb9['sort']((_0x5a510d,_0x3ad7ac)=>_0x5a510d['start']['isBefore'](_0x3ad7ac['start'])?-0x1:0x1);for(const _0x497f5c of _0x2a6bb9)for(const _0x2042a3 of _0x497f5c['getItems']())_0x2042a3['is']('$textProxy')?_0x3a764b['push'](_0x2042a3['data']):_0x2042a3['is']('element')&&_0x3a764b['length']>0x0&&'\x20'!==_0x3a764b[_0x3a764b['length']-0x1]&&_0x3a764b['push']('\x20');return _0x3a764b['length']?'\x22'+_0x3a764b['join']('')['trim']()+'\x22':us(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_removeFakeSelectionById'](_0x572c83){for(let _0x39d35a=0x0;_0x39d35a<this['_fakeSelections']['length'];_0x39d35a++)if(this['_fakeSelections'][_0x39d35a]['id']==_0x572c83)return void this['_fakeSelections']['splice'](_0x39d35a,0x1);}['_addFakeSelection'](_0x155863){this['_removeFakeSelectionById'](_0x155863['id']),wt(this['_fakeSelections'],_0x155863);}['_refreshFakeSelection'](_0x1eeed0,_0x1074b3){if(_0x1eeed0==_0x1074b3)return;const _0x2efc91=Xs(this['context']),_0x1743bd=_0x2efc91['model'];_0x1743bd['change'](_0x539eba=>{if(_0x1eeed0){const _0x3bf978=_0x2efc91['model']['markers']['getMarkersGroup'](Zs);for(const _0x232dd8 of _0x3bf978)_0x539eba['removeMarker'](_0x232dd8);}if(_0x1074b3)for(let _0x803caa=0x0;_0x803caa<_0x1074b3['ranges']['length'];_0x803caa++){let _0x365b1d=_0x1074b3['ranges'][_0x803caa];const _0x4e9e9d=Zs+':'+_0x1074b3['id']+':'+_0x803caa;if(_0x365b1d['start']['isAtEnd']){const _0x142fc0=_0x365b1d['start']['getLastMatchingPosition'](({item:_0x1069b1})=>!_0x1743bd['schema']['isContent'](_0x1069b1),{'boundaries':_0x365b1d});_0x365b1d=_0x539eba['createRange'](_0x142fc0,_0x365b1d['end']);}_0x539eba['addMarker'](_0x4e9e9d,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x365b1d});}});}['_getMarkersInDocumentOrder'](){const _0x535f1e=Xs(this['context'])['model'];return Array['from'](_0x535f1e['markers']['getMarkersGroup'](Zs))['sort']((_0x42fc31,_0x4db65b)=>_0x42fc31['getStart']()['isBefore'](_0x4db65b['getStart']())?-0x1:_0x42fc31['getStart']()['isAfter'](_0x4db65b['getStart']())?0x1:0x0);}}const en=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],sn=[...en,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class nn{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0xbac5ec){this['options']={'delay':_0xbac5ec['delay']??0x14,'textNodeStyle':_0xbac5ec['textNodeStyle'],'onStreamUpdate':_0xbac5ec['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x44e3f9,targetElement:_0x572da0,abortSignal:_0x764665}){this['isStreaming']&&this['stop'](),_0x764665?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x37db7f(_0x44e3f9,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x41a58f=0x0;_0x41a58f<this['currentIndex'];_0x41a58f++)this['nodesList'][_0x41a58f]['shouldBeStreamed']=!0x0;do{const _0x3c721a=Date['now'](),_0x4c7782=this['nodesList'][this['currentIndex']],_0x6319df=_0x3c721a-this['lastUpdateTime'];if(_0x4c7782){_0x4c7782['shouldBeStreamed']=!0x0;let _0x15a201=_0x4c7782['parent'];for(;_0x15a201;)_0x15a201['shouldBeStreamed']=!0x0,_0x15a201=_0x15a201['parent'];}if(_0x6319df<this['options']['delay'])try{const {promise:_0x46f9df,abortController:_0xe946aa}=hn(this['options']['delay']-_0x6319df);this['timeoutAbortController']=_0xe946aa,await _0x46f9df;}catch(_0x4da85d){return;}_0x369bb8(_0x572da0,'<'+_0x572da0['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x572da0['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:_0x7aa6bd}){Array['from'](_0x7aa6bd['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x2ea76c=>{_0x2ea76c['replaceWith'](_0x2ea76c['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0xc8b38c){let _0x37e384='';if(function(_0x3afed1){return _0x764091(_0x3afed1);}(_0xc8b38c)){for(const _0x4499fd of _0xc8b38c['children'])_0x37e384+=this['renderNode'](_0x4499fd);}else{if(on(_0xc8b38c)){if(!_0xc8b38c['shouldBeStreamed'])return'';const _0x560119=_0xc8b38c,_0x575dac=Object['entries'](_0x560119['attribs'])['map'](([_0x31eab1,_0x4a65cb])=>_0x31eab1+'=\x22'+_0x4a65cb+'\x22')['join']('\x20');_0x37e384+='<'+_0x560119['tagName']+(_0x575dac?'\x20'+_0x575dac:'')+'>';for(const _0x3a9a82 of ti(_0x560119))_0x37e384+=this['renderNode'](_0x3a9a82);_0x37e384+='</'+_0x560119['tagName']+'>';}else{if(!an(_0xc8b38c))return'';if(!_0xc8b38c['shouldBeStreamed'])return'';!function(_0x10f181){if(!_0x10f181['parent']||!on(_0x10f181['parent']))return!0x1;if(!rn['includes'](_0x10f181['parent']['tagName']))return!0x1;return!_0x34da1c(_0x10f181)['match'](/^\s*[<>]\s*$/);}(_0xc8b38c)?_0x37e384+=_0x18e7f8(_0xc8b38c):_0x37e384+=_0x18e7f8(new _0x41fe55('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0xc8b38c]));}}return _0x37e384;}['getParsedDocumentNodeList'](){const _0x4818bd=[];return function(_0x3e4185,_0x3bc495){const _0x29e26d=_0x35f2e6=>{if(_0x3bc495(_0x35f2e6),_0x35f2e6 instanceof _0x5854ba)for(let _0x16dfd4=0x0;_0x16dfd4<_0x35f2e6['children']['length'];_0x16dfd4++){const _0x267b36=_0x35f2e6['children'][_0x16dfd4];_0x29e26d(_0x267b36);}};for(let _0x23741d=0x0;_0x23741d<_0x3e4185['children']['length'];_0x23741d++)_0x29e26d(_0x3e4185['children'][_0x23741d]);}(this['document'],_0x1746fe=>{if(an(_0x1746fe)){const _0x1a740a=this['splitTextNodeIntoWordNodes'](_0x1746fe);_0x1a740a['length']&&_0x4818bd['push'](..._0x1a740a);}_0x1746fe['isWordSplitSource']||_0x1746fe['isWordSplitResult']||_0x4818bd['push'](_0x1746fe);}),_0x4818bd;}['splitTextNodeIntoWordNodes'](_0x54b84b){if(_0x54b84b['isWordSplitSource']||_0x54b84b['isWordSplitResult'])return[];const _0x207a51=_0x34da1c(_0x54b84b)['match'](/(?:\s*\S+\s*)/g),_0x1f454d=[];if(_0x207a51&&_0x207a51['length']>0x1){for(const _0x17d7ae of _0x207a51){const _0x4380db=new _0xde8693(_0x17d7ae);_0x4380db['isWordSplitResult']=!0x0,_0x428c7a(_0x54b84b,_0x4380db),_0x1f454d['push'](_0x4380db);}_0x54b84b['isWordSplitSource']=!0x0,_0x1e1233(_0x54b84b);}return _0x1f454d;}}const rn=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function an(_0x4cb9f2){return _0x57ee3c(_0x4cb9f2);}function on(_0x4c4eb5){return _0x699811(_0x4c4eb5);}function hn(_0x2998cf){const _0x44bca4=new AbortController();return{'promise':new Promise((_0x3dc556,_0x503b16)=>{const _0x390ee7=setTimeout(_0x3dc556,_0x2998cf);_0x44bca4['signal']['addEventListener']('abort',()=>{clearTimeout(_0x390ee7),_0x503b16();});}),'abortController':_0x44bca4};}class cn extends vt{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0xc3bc3){super();const _0x2e7f97=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new nn({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0xc3bc3,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x2e7f97['if']('isDone','ck-ai-chat__feed__item_done'),_0x2e7f97['if']('isVisible','ck-hidden',_0x9b2894=>!_0x9b2894),'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'](_0x32bbcd=>{_0x32bbcd['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x58e03f,_0x28c253,_0x3cc7a8){await this['htmlStreamer']['stream']({'document':_0x58e03f,'targetElement':_0x28c253,'abortSignal':_0x3cc7a8});}}class ln extends vt{['showChangesToggleView'];constructor(_0x16810c,_0x51568a){super(_0x16810c),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new un(_0x16810c),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+As,'label':us(_0x16810c,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x51568a['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x112698=>_0x112698?_0x50003b:_0x5a006f),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x47bec6=new xt();_0x47bec6['content']=_0x3dfd07,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x51568a['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x47bec6,{'tag':'span','children':[us(_0x16810c,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class un extends Nt{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const dn={'accepted':_0x34a5d9,'rejected':_0x557c2f,'outdated':_0x557c2f};class _n extends vt{['stateIconView'];constructor(_0x10c607){super(_0x10c607);const _0xafa3a6=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new An(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0xafa3a6['to']('state',_0x580c5a=>'ck-ai-suggestion__content-part-state_'+_0x580c5a),_0xafa3a6['if']('isVisible','ck-hidden',_0xfb9c29=>!_0xfb9c29)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0xafa3a6['to']('state',_0x1e40d1=>{switch(_0x1e40d1){case'accepted':return us(_0x10c607,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return us(_0x10c607,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return us(_0x10c607,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x7ab383){this['state']=_0x7ab383;}}class An extends xt{constructor(){super(),this['set']('state','accepted'),this['content']=dn[this['state']],this['on']('change:state',()=>{this['content']=dn[this['state']];});}}class gn extends kt{['_applyButton'];['_suggestButton'];constructor(_0x297302,_0x2f7559,_0x5ced67){super(_0x297302);const _0x64f322=Boolean(_0x5ced67);this['set']('isEnabled',!_0x64f322),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x38d6b6=[];if(_0x64f322){const _0x5100a8=new Nt(_0x297302);_0x5100a8['set']({'label':us(_0x297302,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x194912}),_0x38d6b6['push'](_0x5100a8);}else{_0x2f7559['includes']('applySuggestion')&&(this['_applyButton']=new Nt(_0x297302),this['_applyButton']['set']({'label':us(_0x297302,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x34a5d9}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x38d6b6['push'](this['_applyButton'])),_0x2f7559['includes']('insertSuggestion')&&(this['_suggestButton']=new Nt(_0x297302),this['_suggestButton']['set']({'label':us(_0x297302,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x3e37fc}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x38d6b6['push'](this['_suggestButton']));const _0x3390f3=new Nt(_0x297302);_0x3390f3['set']({'label':us(_0x297302,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x557c2f}),_0x3390f3['bind']('isEnabled')['to'](this),_0x3390f3['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x38d6b6['push'](_0x3390f3);}this['items']['addMany'](_0x38d6b6);const _0x660871=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x660871['if']('isVisible','ck-hidden',_0x40bf23=>!_0x40bf23)]}});}['setButtonsVisibility']({showApplyButton:_0x5c2f0a,showSuggestButton:_0x517037}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x5c2f0a),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x517037);}}class In extends vt{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x43da1b,{part:_0x264a00,uiIndex:_0x438891,availableActions:_0x280f49,areActionsDisabled:_0x2ac5bc}){super(_0x43da1b),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new gn(_0x43da1b,_0x280f49,_0x2ac5bc),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x264a00['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x264a00['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x264a00['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new _n(_0x43da1b),this['titleLabelView']=new En(_0x43da1b,_0x438891),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',(_0x160602,_0x2a1f83,_0x37db08,_0xdd581b)=>{'pending'===_0xdd581b?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x37db08?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x37db08),this['children']['add'](this['stateView']));});}}class En extends vt{constructor(_0x494342,_0xd421cd){super(_0x494342),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[us(_0x494342,'AI_SUGGESTION_CONTENT_PART_TITLE',_0xd421cd['toString']())]});}}class pn extends vt{['htmlStreamer'];constructor(_0xdb7a2c){super(_0xdb7a2c),this['htmlStreamer']=new nn({'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:_0x36f11d,renderingStrategy:_0x55b8d3,abortSignal:_0x1f4b39}){'streaming'===_0x55b8d3?await this['htmlStreamer']['stream']({'document':_0x36f11d['content'],'targetElement':this['element'],'abortSignal':_0x1f4b39}):this['element']['innerHTML']=Es(_0x36f11d['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class Tn extends vt{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x888ed0,{part:_0x21c555,uiIndex:_0x1aecc5,areActionsDisabled:_0x90acf3,availableActions:_0x4c2c52}){super(_0x888ed0);const _0x1c1ff1=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x307d33=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x90acf3;};this['on']('change:state',_0x307d33),this['on']('change:isDone',_0x307d33),_0x307d33(),this['_children']=this['createCollection'](),this['_headerView']=new In(_0x888ed0,{'part':_0x21c555,'uiIndex':_0x1aecc5,'availableActions':_0x4c2c52,'areActionsDisabled':_0x90acf3}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...en)['to'](this),this['_streamableContentView']=new pn(_0x888ed0),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x1c1ff1['to']('state',_0x2b2789=>'ck-ai-suggestion__body__content-part_'+_0x2b2789),_0x1c1ff1['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x1c1ff1['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x1c1ff1['if']('isVisible','ck-hidden',_0x44682a=>!_0x44682a)]},'children':this['_children'],'on':{'mouseenter':_0x1c1ff1['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x21c555['index']});}),'mouseleave':_0x1c1ff1['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x21c555['index']});}),'click':_0x1c1ff1['to'](_0x607d64=>{const _0x1aeede=_0x607d64['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x1aeede)&&this['fire']('showChangeInText',{'index':_0x21c555['index']});})}});}async['updateContent']({part:_0x3db54a,renderingStrategy:_0x340cab,showUnchangedParts:_0x433236=!0x1,abortSignal:_0x16062b}){this['partDefinition']=_0x3db54a,this['isVisible']=this['partDefinition']['hasChanges']||_0x433236,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x3db54a,'renderingStrategy':_0x340cab,'abortSignal':_0x16062b});}['markAsDone'](){this['isDone']=!0x0;}}class mn extends pt(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x10d8fe){const _0x17012e=this['createTask'](_0x10d8fe);return this['queue']['push'](_0x17012e),this['_processQueue'](),_0x17012e['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(_0x3a1111=>{this['once']('_queueEmpty',()=>{_0x3a1111();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x3ee2a8=this['queue']['shift']();try{await _0x3ee2a8['callback'](this['_abortController']['signal']),_0x3ee2a8['resolve']();}catch(_0x2ceb1f){_0x3ee2a8['reject'](_0x2ceb1f);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x1f0d63){let _0x5d86b8,_0x1283ad;const _0x561cd1=new Promise((_0x1ec32d,_0x64c169)=>{_0x5d86b8=_0x1ec32d,_0x1283ad=_0x64c169;});return{'callback':_0x1f0d63,'resolve':_0x5d86b8,'reject':_0x1283ad,'completePromise':_0x561cd1};}}class Cn extends cn{constructor(_0x37c74e){super(_0x37c74e),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x37c74e['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x5bbb0d){this['element']['innerHTML']=_0x5bbb0d;}}const wn=['applySuggestion','insertSuggestion'];class fn extends vt{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x510ad3,_0x208c31=[...wn],_0x326a96){super(_0x510ad3);const _0x3e9a49=this['bindTemplate'],_0x2b53ea=Boolean(_0x326a96);if(this['set']('isEnabled',!_0x2b53ea),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x2b53ea){const _0x241049=new Nt(_0x510ad3);_0x241049['set']({'label':us(_0x510ad3,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x194912});const _0x4f54d2=new vt(_0x510ad3);_0x4f54d2['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[us(_0x510ad3,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x241049]}]}),this['children']['add'](_0x4f54d2);}else this['_applyChangesButton']=new Nt(_0x510ad3),this['_applyChangesButton']['set']({'label':us(_0x510ad3,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x208c31['includes']('applySuggestion'),'class':ds}),this['_insertSuggestionsButton']=new Nt(_0x510ad3),this['_insertSuggestionsButton']['set']({'label':us(_0x510ad3,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x208c31['includes']('insertSuggestion'),'class':_s}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x55d9ad=>{_0x55d9ad['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',_0x3e9a49['if']('isVisible','ck-hidden',_0x59cc93=>!_0x59cc93)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x5d4a9a){this['isVisible']=_0x5d4a9a;}['_switchButtonLabelsPlurality'](_0x37f802){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x37f802?(this['_applyChangesButton']['label']=us(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=us(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=us(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=us(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class Sn extends vt{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x359130,_0x47847b){super(_0x359130),this['bodyCollection']=_0x47847b,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',_0x4a9414=>!_0x4a9414)]},'children':this['children']});const _0x3e3126=new vt(this['locale']),_0x385466=new xt();_0x385466['content']=_0x13ebcc,_0x3e3126['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x385466,{'tag':'span','children':[{'text':us(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x3e3126),this['_setupBalloonPanel'](_0x359130);}['addSource'](_0x3d0172){this['children']['add'](new bn(this['locale'],_0x3d0172,this['balloonPanelView']));}['_setupBalloonPanel'](_0x79cec9){this['balloonPanelView']=new Xt(_0x79cec9),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class bn extends Nt{['balloonPanelView'];['source'];constructor(_0x5966ba,_0x2b5c7d,_0x479662){super(_0x5966ba),this['source']=_0x2b5c7d,this['balloonPanelView']=_0x479662,this['set']({'label':_0x2b5c7d['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x26abcb=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x26abcb['to'](()=>{window['open'](_0x2b5c7d['url'],'_blank');}),'mouseenter':_0x26abcb['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x26abcb['to'](()=>{this['_hideTooltip']();})}}),_0x2b5c7d['favicon']){const _0x2fcecd=new vt(_0x5966ba);_0x2fcecd['setTemplate']({'tag':'img','attributes':{'src':_0x2b5c7d['favicon']||_0x13ebcc,'alt':_0x2b5c7d['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x2fcecd);}else this['set']('icon',_0x13ebcc);}['_createTooltipContentView'](_0x5796c3,_0x1274e4){const _0x439721=new vt(_0x5796c3),_0x2da6e2=[];let _0x37c0bc;_0x1274e4?.['favicon']?(_0x37c0bc=new vt(_0x5796c3),_0x37c0bc['setTemplate']({'tag':'img','attributes':{'src':_0x1274e4['favicon'],'alt':_0x1274e4['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x37c0bc=new xt(),_0x37c0bc['content']=_0x13ebcc,_0x37c0bc['extendTemplate']({'attributes':{'alt':_0x1274e4['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x2da6e2['push'](_0x37c0bc);const _0x5f3011=new vt(_0x5796c3);_0x5f3011['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x1274e4['url']},'children':[{'text':new URL(_0x1274e4['url'])?.['hostname']}]}),_0x2da6e2['push'](_0x5f3011);const _0x186333=new vt(_0x5796c3);_0x186333['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x2da6e2});const _0x4824d9=new vt(_0x5796c3);return _0x4824d9['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x1274e4['title']['length']>0x190?_0x1274e4['title']['substring'](0x0,0x190)+'...':_0x1274e4['title']}]}),_0x439721['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x186333,_0x4824d9]}),_0x439721;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[Xt['defaultPositions']['northArrowSouth'],Xt['defaultPositions']['northArrowSouthWest'],Xt['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 _0x338436=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x338436);}}class Rn extends vt{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x2fb0f2,_0xf9b1cf){super(_0x2fb0f2);const {areActionsDisabled:_0x47d7f,showUnchangedParts:_0xc559b8,availableActions:_0x3ef287}=_0xf9b1cf;this['_areActionsDisabled']=_0x47d7f,this['_showUnchangedParts']=_0xc559b8,this['_availableActions']=_0x3ef287,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new mn(),this['_emptyPartsWarningView']=new Cn({'id':'empty-parts-warning','initialContent':us(_0x2fb0f2,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new fn(_0x2fb0f2,_0xf9b1cf['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sn(this['locale'],_0xf9b1cf['bodyCollection']),_0xf9b1cf['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...en)['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:_0x42e1bc,renderingStrategy:_0x48a74e,abortSignal:_0x1de647}){this['_children']['length']?_0x42e1bc['forEach'](_0x4ebe23=>{const _0x2b19b6=this['_cachedContentParts']['findIndex'](_0x1cd181=>_0x1cd181['index']==_0x4ebe23['index']);-0x1===_0x2b19b6?this['_cachedContentParts']['push'](_0x4ebe23):this['_cachedContentParts'][_0x2b19b6]=_0x4ebe23;}):this['_cachedContentParts']=_0x42e1bc;const _0x1f2e2d=this['_showUnchangedParts']?_0x42e1bc:_0x42e1bc['filter'](_0x3fe520=>_0x3fe520['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x1f2e2d['length']>0x1);for(const _0x966a24 of _0x1f2e2d)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x593c9d=>{let _0x1a0479=this['getPartView'](_0x966a24['index']);_0x1a0479||(_0x1a0479=new Tn(this['locale'],{'part':_0x966a24,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x1a0479['delegate'](...en)['to'](this),this['_children']['add'](_0x1a0479),this['hasPendingParts']=!0x0),await _0x1a0479['updateContent']({'part':_0x966a24,'renderingStrategy':_0x48a74e,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x593c9d}),_0x1a0479['markAsDone']();});return _0x1de647?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x388b59,_0x4ea4d3){const _0x18be8b=this['getPartView'](_0x388b59);_0x18be8b&&(_0x18be8b['state']=_0x4ea4d3),this['hasPendingParts']='pending'==_0x4ea4d3||Array['from'](this['_children'])['some'](_0x4e6f28=>'pending'==_0x4e6f28['state']);}['setPartActive'](_0x30846f,_0x28ce50){if(!0x1===_0x30846f){for(const _0x396db4 of this['_children'])_0x396db4['isActive']=!0x1;}else{const _0x50faac=this['getPartView'](_0x30846f);_0x50faac&&(_0x50faac['isActive']=_0x28ce50);}}['updateSources'](_0x3dcbcc){_0x3dcbcc['forEach'](_0x4ada85=>this['_sourcesView']['addSource'](_0x4ada85)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x13a2b1){return this['_children']['find'](_0x43b755=>_0x43b755['partDefinition']['index']==_0x13a2b1)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x4d0258=!this['_cachedContentParts']['find'](({hasChanges:_0x474a11})=>_0x474a11),_0xa7bd6c=!!this['_cachedContentParts']['find'](({hasChanges:_0x5e8579})=>!_0x5e8579);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0xa7bd6c,_0x4d0258?this['_emptyPartsWarningView']['setContent'](us(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](us(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_children']['forEach'](_0x3bb6f9=>_0x3bb6f9['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0x46d110=>_0x46d110['partDefinition']['hasChanges'])['length']>0x0;}}class On extends vt{['bodyView'];['children'];['headerView'];constructor(_0x1306b5,_0x4f8d67,_0x106c9c){super(_0x1306b5);const {showDiff:_0x1ba9bc,areActionsDisabled:_0xe5461a,showUnchangedParts:_0x4a568c,availableActions:_0x57c998}=_0x4f8d67;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new ln(_0x1306b5,{'showDiff':_0x1ba9bc}),this['headerView']['on']('toggleShowChanges',(_0x1e3f8b,_0x4ad87b)=>{this['areChangesVisible']=_0x4ad87b['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x4ad87b['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new Rn(_0x1306b5,{'areActionsDisabled':_0xe5461a,'showUnchangedParts':!!_0x4a568c,'availableActions':_0x57c998,'bodyCollection':_0x106c9c}),this['bodyView']['delegate'](...en)['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'](_0x4225a4){await this['bodyView']['updateContentParts'](_0x4225a4);}['updateSources'](_0x44b53b){this['bodyView']['updateSources'](_0x44b53b);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class kn extends cn{['containerView'];constructor(_0x49cd2e,_0x4caad7,_0x87f6db){super(_0x4caad7),this['set']('isTrackChangesOn',!0x1),this['containerView']=new On(_0x49cd2e,{'showDiff':_0x4caad7['showDiff'],'areActionsDisabled':_0x4caad7['areActionsDisabled'],'availableActions':_0x4caad7['availableActions']},_0x87f6db),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x3e51ef,_0x5f10be)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x5f10be['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',(_0x30fc35,{index:_0x58138c})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x58138c});}),this['containerView']['on']('applySuggestion',(_0x340d56,{index:_0xf80d58}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0xf80d58});}),this['containerView']['on']('insertSuggestion',(_0x1cfbfa,{index:_0x51b694}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x51b694});}),this['containerView']['on']('rejectSuggestion',(_0x42f41c,{index:_0x20abd8})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x20abd8});}),this['containerView']['on']('mouseOverSuggestion',(_0x323759,{index:_0x2db6ae})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x2db6ae});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x3a1e90,{index:_0x473ada})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x473ada});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x22002a){await this['containerView']['updateContent'](_0x22002a);}['updatePartState'](_0x1a096c,_0x498f09){this['containerView']['bodyView']['updatePartState'](_0x1a096c,_0x498f09);}['setPartActive'](_0x51a900,_0x5e46d7){!0x1===_0x51a900?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x51a900,_0x5e46d7);}['updateSources'](_0x39132c){this['containerView']['updateSources'](_0x39132c);}['getPartView'](_0x498626){return this['containerView']['bodyView']['getPartView'](_0x498626);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class Nn extends cn{['replyContainer'];['_bodyCollection'];constructor(_0x177cbc,_0x1ded3e,_0x1ccf91){super(_0x1ded3e),this['_bodyCollection']=_0x1ccf91,this['locale']=_0x177cbc,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new vt(),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':Is(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x278554,renderingStrategy:_0x189b36,abortSignal:_0x44d9b5}){'streaming'===_0x189b36?await this['streamIntoElement'](_0x278554,this['replyContainer']['element'],_0x44d9b5):this['replyContainer']['element']['innerHTML']=_0x18e7f8(_0x278554);}['updateSources'](_0x20c14b){const _0x553029=new Sn(this['locale'],this['_bodyCollection']);_0x553029['children']['addMany'](_0x20c14b['map'](_0x1d3fa9=>new bn(this['locale'],_0x1d3fa9,_0x553029['balloonPanelView']))),_0x553029['isVisible']=!0x0,this['children']['add'](_0x553029);}}class vn extends yt{constructor(_0x540324=void 0x0){super();const _0x111083=_0x540324?'ck-ai-spinner_'+_0x540324:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x111083]}});}}const yn={'file':_0x25934b,'document':_0x3dfd07,'web-resource':_0x9697b8,'text':_0x25934b,'selection':_0x4303ff,'mcp-tool-context':_0x3dfd07},xn='ck-ai-chat-context-chip',Ln='ck-ai-chat-context-chip_wide',Dn='ck-ai-chat-context-chip_document',Pn='ck-ai-chat-context-chip__label',Hn='ck-ai-chat-context-chip__type-icon',Mn='ck-ai-chat-context-controls__chip-tooltip',Un='n';class Vn extends Nt{constructor(_0x2ad57f,_0x285d14,_0x56b0a2,_0x4cb089,_0x1400ac=!0x1){super(_0x2ad57f),this['_isAnimationOnEnterEnabled']=_0x4cb089,this['_initializeProperties'](_0x285d14,_0x56b0a2,_0x1400ac),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'](_0x97ac0d,_0x128af1,_0x11eacf){this['set']('label',_0x97ac0d['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x97ac0d['type']),this['set']('id',_0x97ac0d['uiId']),this['set']('readonly',_0x128af1),this['set']('isLoading',_0x11eacf);}['_setupTemplate'](){const _0xfd59e=this['_createIconView'](),_0x52b092=this['_createRemoveButton'](),_0x1d23bf=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x1d23bf),'children':this['_createTemplateChildren'](_0xfd59e,_0x52b092,_0x1d23bf)});}['_createTemplateAttributes'](_0x48d2dc){return{'class':[xn,_0x48d2dc['if']('itemType',Dn,_0xf95ec7=>'document'==_0xf95ec7),_0x48d2dc['if']('itemType',Ln,_0x4d1b9b=>'selection'==_0x4d1b9b)],'data-cke-tooltip-text':_0x48d2dc['to']('label',Bn),'data-cke-tooltip-position':Un,'data-cke-tooltip-class':Mn};}['_createTemplateChildren'](_0x2f2aa2,_0x3148f7,_0x3d43c7){const _0x3fa88c=this['_createLabelElement'](_0x3d43c7),_0x474f33=this['_createLoaderIcon']();return this['readonly']?[_0x2f2aa2,_0x3fa88c]:[_0x2f2aa2,_0x474f33,_0x3fa88c,_0x3148f7];}['_createLabelElement'](_0xb1f2c2){return{'tag':'span','attributes':{'class':Pn},'children':[{'text':_0xb1f2c2['to']('label')}]};}['_createRemoveButton'](){const _0x1544ce=new Nt(this['locale']);return _0x1544ce['set']({'label':us(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x3a48ae}),this['_setupRemoveButtonEvent'](_0x1544ce),_0x1544ce;}['_setupRemoveButtonEvent'](_0x1478aa){_0x1478aa['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x4d8790=this['bindTemplate'],_0x30c0d8=new xt();return _0x30c0d8['content']=yn[this['itemType']],_0x30c0d8['extendTemplate']({'attributes':{'class':[Hn,_0x4d8790['if']('isLoading','ck-hidden',_0x14d605=>_0x14d605)]}}),_0x30c0d8;}['_handleAnimationEndOnce'](_0x44443e,_0x567a4e){if(!_0x44443e)return;const _0x450482=()=>{_0x567a4e(),_0x44443e['removeEventListener']('animationend',_0x450482),_0x44443e['removeEventListener']('webkitAnimationEnd',_0x450482);};_0x44443e['addEventListener']('animationend',_0x450482),_0x44443e['addEventListener']('webkitAnimationEnd',_0x450482);}['_createLoaderIcon'](){const _0x1ea3d0=new vn('small');return _0x1ea3d0['bind']('isVisible')['to'](this,'isLoading',_0x4544f4=>_0x4544f4),_0x1ea3d0;}}function Bn(_0x4f6979){if(!_0x4f6979)return _0x4f6979;if(_0x4f6979['length']<=0x78)return _0x4f6979;const _0x453a1c=_0x4f6979['slice'](0x0,0x78),_0x5aa676=_0x453a1c['lastIndexOf']('\x20');return(_0x5aa676>0x0?_0x453a1c['slice'](0x0,_0x5aa676):_0x453a1c)+'…';}const Gn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},Fn='300px';class Kn{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x40a318,_0x851dbb,_0x6b944c,_0x2f49f6,_0x500cd0){this['_locale']=_0x40a318,this['_visibleChips']=_0x851dbb,this['_config']={...Gn,..._0x6b944c,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x6b944c['cssClasses']}},this['_overflowChips']=new _t(),this['_bodyCollection']=_0x2f49f6,this['_parentView']=_0x500cd0||null;}['setContainerElement'](_0x3b0b8e){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x3b0b8e,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 _0x157346=[...this['_visibleChips'],...this['_overflowChips']],_0x2c2f04=this['_createCalculationContainer'](),_0x3af01c=this['_calculateOverflowInContainer'](_0x2c2f04,_0x157346),_0x523bd9=_0x2c2f04['_ancestorsToRestore'];_0x523bd9&&this['_restoreAncestorVisibility'](_0x523bd9),_0x2c2f04['remove'](),this['_applyOverflowResults'](_0x157346,_0x3af01c);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),zt({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x22b1a7=new Nt(this['_locale']);_0x22b1a7['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x3669bb=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x3669bb['push'](this['_config']['cssClasses']['controlsButton']),_0x22b1a7['extendTemplate']({'attributes':{'class':_0x3669bb}}),_0x22b1a7;}['_createShowMoreBalloonPanelView'](){const _0x2060cd=new Xt(this['_locale']);return _0x2060cd['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x2060cd),_0x2060cd;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x5a293c=>{_0x5a293c['disableAnimationOnEnter']();});const _0x574bf6=new vt(this['_locale']);_0x574bf6['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x574bf6);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x383ae1=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x383ae1?'':'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'](_0x2c5e78){const _0x34108c=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x289395=this['_containerElement']?.['classList'];if(_0x289395){const _0x15049f=_0x289395[0x0]||'',_0x321c07=_0x2c5e78['querySelector']('.'+_0x15049f),_0x2470e1=_0x2c5e78['querySelector'](_0x34108c);return _0x321c07||_0x2470e1||_0x2c5e78;}return _0x2c5e78['querySelector'](_0x34108c)||_0x2c5e78;}['_calculateContainerWidth'](){const _0x24aca6=this['_parentView']?.['element']||this['_containerElement'];if(!_0x24aca6)return Fn;const _0x532291=window['getComputedStyle'](_0x24aca6)['width'];if('auto'===_0x532291||'0px'===_0x532291||!_0x532291){const _0x60f6b7=_0x24aca6['parentElement'];if(_0x60f6b7){const _0x26a24f=window['getComputedStyle'](_0x60f6b7);return'auto'!==_0x26a24f['width']?_0x26a24f['width']:Fn;}return Fn;}return _0x532291;}['_applyCalculationStyles'](_0x566cb4,_0x3138ec){this['_config']['cssClasses']['calculationContainer']&&_0x566cb4['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x566cb4['style']['width']=_0x3138ec,_0x566cb4['style']['position']='absolute',_0x566cb4['style']['top']='-9999px',_0x566cb4['style']['left']='-9999px',_0x566cb4['style']['opacity']='0',_0x566cb4['style']['pointerEvents']='none',_0x566cb4['style']['zIndex']='-1',_0x566cb4['style']['visibility']='visible\x20!important',_0x566cb4['style']['display']='block\x20!important',_0x566cb4['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x3085ca){_0x3085ca['forEach'](({element:_0x4627b8,originalDisplay:_0x2db79d,originalVisibility:_0x125e05})=>{_0x4627b8['style']['display']=_0x2db79d,_0x4627b8['style']['visibility']=_0x125e05;});}['_makeAncestorsVisible'](_0x5ec5d2){const _0x4db094=[];let _0x5f1073=_0x5ec5d2;for(;_0x5f1073&&_0x5f1073!==document['body'];){const _0x4f8d2c=window['getComputedStyle'](_0x5f1073);'none'!==_0x4f8d2c['display']&&'hidden'!==_0x4f8d2c['visibility']||(_0x4db094['push']({'element':_0x5f1073,'originalDisplay':_0x5f1073['style']['display'],'originalVisibility':_0x5f1073['style']['visibility']}),_0x5f1073['style']['display']='block',_0x5f1073['style']['visibility']='visible'),_0x5f1073=_0x5f1073['parentElement'];}return _0x4db094;}['_createContainerElements'](){let _0x30bc73,_0x3e30c7;return this['_parentView']?.['element']?(_0x30bc73=this['_parentView']['element']['cloneNode'](!0x0),_0x3e30c7=this['_findTargetContainer'](_0x30bc73)):(_0x30bc73=document['createElement']('div'),_0x3e30c7=_0x30bc73),{'calculationContainer':_0x30bc73,'targetContainer':_0x3e30c7};}['_createCalculationContainer'](){const {calculationContainer:_0x24d264,targetContainer:_0x2bd6fb}=this['_createContainerElements'](),_0x1528fb=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x24d264,_0x1528fb);const _0x584e8a=this['_parentView']?.['element']||this['_containerElement'],_0x27d055=_0x584e8a?.['parentElement'];_0x27d055?_0x27d055['appendChild'](_0x24d264):document['body']['appendChild'](_0x24d264),_0x24d264['_targetContainer']=_0x2bd6fb;const _0x4f02ab=this['_makeAncestorsVisible'](_0x27d055||null);return _0x24d264['offsetWidth'],_0x24d264['_ancestorsToRestore']=_0x4f02ab,_0x24d264;}['_calculateOverflowInContainer'](_0x5f5684,_0x40c383){const _0x125618=_0x5f5684['_targetContainer']||_0x5f5684,_0x3a0c55=[],{rowCount:_0x44d624}=this['_renderChipsAndCountRows'](_0x125618,_0x40c383);if(_0x44d624<=this['_config']['maxVisibleRows'])return _0x3a0c55;const _0x4a43b6=_0x40c383['slice']();for(;_0x4a43b6['length']>0x0;){if(this['_testButtonFit'](_0x5f5684,_0x125618,_0x4a43b6)){const _0x3de21c=_0x40c383['filter'](_0x31ccfa=>!_0x4a43b6['includes'](_0x31ccfa));_0x3a0c55['push'](..._0x3de21c);break;}if(!_0x4a43b6['pop']())break;}return _0x3a0c55;}['_renderChipsAndCountRows'](_0x30ac18,_0x26bc8f){_0x30ac18['innerHTML']='',_0x26bc8f['forEach'](_0x182612=>{if(_0x182612['element']){const _0x3e8701=_0x182612['element']['cloneNode'](!0x0);_0x30ac18['appendChild'](_0x3e8701);}}),_0x30ac18['offsetWidth'];const _0x151832=_0x30ac18['children'],_0x168ca0=[];return Array['from'](_0x151832)['forEach'](_0x21ddbd=>{const _0x24c36b=_0x21ddbd['getBoundingClientRect']()['top'];_0x168ca0['some'](_0x140766=>Math['abs'](_0x140766-_0x24c36b)<this['_config']['rowDetectionTolerance'])||_0x168ca0['push'](_0x24c36b);}),{'rowCount':_0x168ca0['length']};}['_createMockButton'](){const _0x31d1ec=document['createElement']('button');return _0x31d1ec['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x31d1ec['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x31d1ec['textContent']='+\x201',_0x31d1ec;}['_testButtonFit'](_0x600277,_0x15928b,_0x1fedf2){this['_renderChipsAndCountRows'](_0x15928b,_0x1fedf2);const _0xf11e7c=this['_createMockButton']();_0x600277['appendChild'](_0xf11e7c),_0x600277['offsetWidth'];const _0x290bc4=[..._0x15928b['children'],_0xf11e7c],_0x486dc6=[];_0x290bc4['forEach'](_0x53f4b3=>{const _0x242c00=_0x53f4b3['getBoundingClientRect']()['top'];_0x486dc6['some'](_0x49907c=>Math['abs'](_0x49907c-_0x242c00)<this['_config']['rowDetectionTolerance'])||_0x486dc6['push'](_0x242c00);});const _0x488f0c=_0x486dc6['length'];return _0xf11e7c['remove'](),_0x488f0c<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x33c872,_0x1dc199){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x33c872['forEach'](_0x529fe3=>{_0x1dc199['includes'](_0x529fe3)?this['_overflowChips']['add'](_0x529fe3):this['_visibleChips']['add'](_0x529fe3);});}['_updateOverflowUI'](_0x28f72f){if(_0x28f72f>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x28f72f>0x0&&this['_showMoreButtonView']){const _0x222d05=''+this['_config']['showMoreLabelPrefix']+(_0x28f72f<0x63?_0x28f72f:'99');this['_showMoreButtonView']['label']=_0x222d05;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x548f28,_0x1d3659){this['_distributeChips'](_0x548f28,_0x1d3659),this['_updateOverflowUI'](_0x1d3659['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x15ffd8=>{_0x15ffd8[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 _0x212595=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x212595['width']||0x0===_0x212595['height'])return!0x1;const _0x5142f4=window['innerHeight']||document['documentElement']['clientHeight'],_0x2befa1=window['innerWidth']||document['documentElement']['clientWidth'],_0x33e730=0xc8;return _0x212595['bottom']>=-0xc8&&_0x212595['top']<=_0x5142f4+_0x33e730&&_0x212595['right']>=-0xc8&&_0x212595['left']<=_0x2befa1+_0x33e730;}}const Wn='ck-ai-chat__feed__context-chips',Yn='ck-ai-chat-context-chips-wrapper',$n='ck-ai-chat-context-chips-wrapper-balloon',qn='ck-ai-chat-controls-button',Qn='ck-ai-chat-controls_context_show-more-button',Xn='ck-ai-chat-context-controls__show-more-balloon-panel';class zn extends vt{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x519cc8,_0x231509,_0x2627f0){super(_0x519cc8),this['_bodyCollection']=_0x2627f0,this['_createContextChips'](_0x231509);const _0x2d410f={'cssClasses':{'showMoreButton':Qn+'\x20'+As,'showMoreBalloon':Xn,'overflowContainer':$n,'controlsButton':qn}};this['_overflowManager']=new Kn(_0x519cc8,this['_contextChips'],_0x2d410f,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Wn,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Yn},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x3705a7=this['element']['querySelector']('.'+Yn);_0x3705a7&&(this['_overflowManager']['setContainerElement'](_0x3705a7),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x9036c3){for(const _0x2f06c5 of _0x9036c3){const _0x2721b9=new Vn(this['locale'],_0x2f06c5,!0x0,!0x1);this['_contextChips']['add'](_0x2721b9);}}}class jn extends cn{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x5ad779,_0x53a256,_0x280691){super(_0x53a256),this['_locale']=_0x5ad779,this['_bodyCollection']=_0x280691,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 zn(this['_locale'],this['options']['contextItems']['filter'](_0x4c11d5=>!_0x4c11d5['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new vt(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 Jn extends cn{['capabilities'];constructor(_0x336ff4,_0x2db687){super(_0x2db687);const {isWebSearchEnabled:_0x37adc4,isReasoningEnabled:_0x3e9391}=_0x2db687['capabilities'],_0x3b87ed=[];let _0x4b37b1='';_0x37adc4&&_0x3e9391?(_0x4b37b1=us(_0x336ff4,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x3b87ed['push'](Zn(_0x13ebcc)),_0x3b87ed['push'](Zn(_0x51861b))):_0x37adc4?(_0x4b37b1=us(_0x336ff4,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x3b87ed['push'](Zn(_0x13ebcc))):_0x3e9391&&(_0x4b37b1=us(_0x336ff4,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x3b87ed['push'](Zn(_0x51861b))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x4b37b1?'':'ck-hidden']}});const _0x2990d9=new vt();_0x2990d9['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x3b87ed,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x4b37b1]}]}),this['children']['add'](_0x2990d9),this['capabilities']=_0x2db687['capabilities'];}}function Zn(_0x1e61cb){const _0xb35df6=new xt();return _0xb35df6['content']=_0x1e61cb,_0xb35df6;}const tr=['wheel','touchstart','pointerdown','keydown'],er=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class ir{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x36caef){this['element']=_0x36caef,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x4a92d3 of tr){const _0x77b15d='keydown'!==_0x4a92d3;this['element']['addEventListener'](_0x4a92d3,this['_onUserEvent']['bind'](this),{'passive':_0x77b15d,'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'](_0x422bc2){if(this['isRunning']){if('keydown'===_0x422bc2['type']){const _0x38bb14=_0x422bc2['key'];if(!er['includes'](_0x38bb14))return;}_0x422bc2 instanceof WheelEvent?_0x422bc2['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x31f8b4,scrollHeight:_0x59c9f3,clientHeight:_0x169080}=this['element'];return _0x59c9f3-_0x31f8b4-_0x169080<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class sr extends vt{constructor(_0x2a9dcd,_0x3fe62d){super(_0x2a9dcd),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x3fe62d)});}['_createSkeletonItems'](_0x54762f){const _0x5a080e=['ck','ck-ai-skeleton__item'];return _0x54762f['map'](_0x264838=>{let _0xd50e88='';switch(_0x264838['attributes']['align']){case'right':_0xd50e88='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0xd50e88='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0xd50e88='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x264838['tag'],'attributes':{'class':[..._0x5a080e,_0x264838['attributes']['class']?_0x264838['attributes']['class']:''],'style':'width:\x20'+_0x264838['attributes']['width']+';\x20height:\x20'+_0x264838['attributes']['height']+';'+_0xd50e88}};});}}const nr={'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':rr(0x5,'100%','44px','right'),'aiChatResources':rr(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 rr(_0x457bee,_0x367e69,_0xa3c180,_0x557fbf){return new Array(_0x457bee)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x367e69,'height':_0xa3c180,'align':_0x557fbf}}));}class ar extends cn{constructor(_0x282d23){super(_0x282d23),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 or extends vt{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x186df8,_0x420ac3){super(_0x186df8),this['_bodyCollection']=_0x420ac3,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...sn)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new ir(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x1ebb49,_0x751e75){let _0x431aab;return'ai-reply'===_0x1ebb49?_0x431aab=new Nn(this['locale'],_0x751e75,this['_bodyCollection']):'ai-suggestion-reply'===_0x1ebb49?(_0x431aab=new kn(this['locale'],_0x751e75,this['_bodyCollection']),_0x431aab['bind']('isTrackChangesOn')['to'](this)):_0x431aab='user-message'===_0x1ebb49?new jn(this['locale'],_0x751e75,this['_bodyCollection']):'interaction-header'===_0x1ebb49?new Jn(this['locale'],_0x751e75):'custom-element'===_0x1ebb49?new ar(_0x751e75):new Cn(_0x751e75),this['children']['add'](_0x431aab),_0x431aab;}async['updateReplyItem']({id:_0x5edd08,parsedContent:_0x23a23d,renderingStrategy:_0xe5d675,abortSignal:_0x5f0ec6}){const _0x235be4=this['getItemById'](_0x5edd08);if(!(_0x235be4 instanceof Nn))throw new ht('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x235be4,'id':_0x5edd08,'parsedContent':_0x23a23d});await _0x235be4['updateContent']({'parsedContent':_0x23a23d,'renderingStrategy':_0xe5d675,'abortSignal':_0x5f0ec6});}async['updateWebSources'](_0x39d47a,_0x40d683){const _0x275e84=this['getItemById'](_0x39d47a);if(_0x275e84 instanceof kn)_0x275e84['updateSources'](_0x40d683);else{if(!(_0x275e84 instanceof Nn))throw new ht('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x275e84,'id':_0x39d47a,'sources':_0x40d683});_0x275e84['updateSources'](_0x40d683);}}async['updateSuggestionItem']({id:_0x14e728,parts:_0x43f15c,renderingStrategy:_0x3d46a3,abortSignal:_0x4e4a12}){const _0x4b5caf=this['getItemById'](_0x14e728);if(!(_0x4b5caf instanceof kn))throw new ht('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x4b5caf,'id':_0x14e728,'parts':_0x43f15c});await _0x4b5caf['updateContent']({'parts':_0x43f15c,'renderingStrategy':_0x3d46a3,'abortSignal':_0x4e4a12});}['updateSuggestionPartState']({id:_0x598205,index:_0x356f3b,state:_0x38b26b}){const _0xb18fbf=this['getItemById'](_0x598205);if(!(_0xb18fbf instanceof kn))throw new ht('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x598205});_0xb18fbf['updatePartState'](_0x356f3b,_0x38b26b);}['setSuggestionPartActive']({id:_0x512bba,index:_0x3f9066,isActive:_0x21b831}){const _0x426153=this['getItemById'](_0x512bba);if(!(_0x426153 instanceof kn))throw new ht('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x512bba});this['children']['filter'](_0x2103b9=>_0x2103b9 instanceof kn)['forEach'](_0x5bc5a5=>{_0x5bc5a5['setPartActive'](!0x1);}),_0x426153['setPartActive'](_0x3f9066,_0x21b831);}['markItemAsDone'](_0x1e8c19){this['getItemById'](_0x1e8c19)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0xc1f83f=>_0xc1f83f['options']['id']);}['removeItem'](_0x25a8f8){this['children']['remove'](this['getItemById'](_0x25a8f8));}['hasItem'](_0x41a080){return!!this['children']['find'](_0x245ad0=>_0x245ad0['options']['id']['includes'](_0x41a080));}['scrollToSuggestion'](_0x1ea674,_0x4f5a1a){const _0x516735=this['getItemById'](_0x1ea674);if(!(_0x516735 instanceof kn))return void Tt('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x1ea674,'partIndex':_0x4f5a1a});const _0x1d9e93=_0x516735['getPartView'](_0x4f5a1a);_0x1d9e93?ft(_0x1d9e93['element'],0x14,this['element']['parentElement'],!0x0,!0x0):Tt('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x1ea674,'partIndex':_0x4f5a1a});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x193f6e=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x193f6e,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x4ef61a=new sr(this['locale'],nr['aiFeed']);return _0x4ef61a['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x1a9cc5=>!_0x1a9cc5)]}}),_0x4ef61a;}['_createFeedItems'](){const _0xc3f7f=new vt(this['locale']);return _0xc3f7f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0xc3f7f;}['_createFeedLoader'](){const _0x3e4f1d=new vt(this['locale']);return _0x3e4f1d['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x4ec2fc=>!_0x4ec2fc)]},'children':this['_createLoaderChildren']()}),_0x3e4f1d;}['_createLoaderChildren'](){const _0x4eba37=new vn();return _0x4eba37['isVisible']=!0x0,[_0x4eba37,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x57f695){const _0x290e8c=this['children']['find'](_0x1c1cc8=>_0x1c1cc8['options']['id']['includes'](_0x57f695));if(!_0x290e8c)throw new ht('ai-chat-feed-view-item-not-found',this,{'id':_0x57f695});return _0x290e8c;}['setLoadingMessage'](_0x51a1e3){this['set']('loadingMessage',_0x51a1e3);}['toggleLoadingSkeleton'](_0x3c3d6c){this['set']('isLoadingSkeletonVisible',_0x3c3d6c);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class hr extends Dt{['filter'](){let _0x11d083=0x0;for(const _0x232c0c of this['items'])_0x11d083+=_0x232c0c['items']['length'];return{'resultsCount':_0x11d083,'totalItemsCount':_0x11d083};}}const cr='ck-ai-chat__prompt-input_highlighted';class lr extends Lt{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0xd59159,_0x27916e){super(_0xd59159,{'queryView':{'label':'','creator':Vt,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new hr(_0xd59159),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x27916e,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=lr['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=lr['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',(_0x4eee6a,_0x3a672e)=>!_0x4eee6a&&!_0x3a672e),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x3ee6a0,_0x339a69)=>{this['isUploadInProgress']||this['isEmpty']||_0x3ee6a0['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x339a69());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x306211=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x306211)return this['queryView']['errorText']=us(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0xe145c2=_0x9da630(_0x306211);this['fire']('sendUserMessage',_0xe145c2),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x545480){this['queryView']['fieldView']['set']('placeholder',_0x545480);}['focus'](_0x31d74f=!0x1){super['focus'](),_0x31d74f&&(this['element']['classList']['contains'](cr)||(this['element']['classList']['add'](cr),setTimeout(()=>{this['element']['classList']['remove'](cr);},0x320)));}['_createSubmitButton'](){const _0x1086e8=new Nt(this['locale']);return _0x1086e8['set']({'icon':_0x2f79db,'label':us(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+ds,'isEnabled':!0x1}),_0x1086e8['on']('execute',()=>{this['submit']();}),_0x1086e8;}['setIsUploadInProgress'](_0x38fe13){this['isUploadInProgress']=_0x38fe13;}['_setUpAddContextButtonPositioning'](){const _0x602a82=this['locale'],_0x5a1bca=()=>{lt['window']['requestAnimationFrame'](()=>{if(ut(this['element'])){const _0x3b0117=new dt(this['queryView']['fieldView']['element']),_0x170ddf=new dt(this['_addContextButtonView']['element']),_0x331fd2=_0x3b0117['width'],_0x4d323='rtl'===_0x602a82['uiLanguageDirection']?'right':'left';_0x3b0117['excludeScrollbarsAndBorders']();const _0x277d73=_0x331fd2-_0x3b0117['width']+0x1;this['_addContextButtonView']['element']['style'][_0x4d323]='calc('+(_0x331fd2-_0x170ddf['width']-_0x277d73)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x5a1bca),this['on']('render',()=>{_0x5a1bca(),this['_queryViewResizeObserver']=new St(this['queryView']['fieldView']['element'],()=>{_0x5a1bca();});});}}const ur='ck-ai-chat__prompt-capabilities',dr='ck-ai-chat-controls-button',_r='ck-ai-chat-controls-button--commands',Ar='ck-ai-chat-controls__model-selection',gr='ck-ai-chat-controls__model-selection__item-name',Ir='ck-ai-chat-controls__model-selection__item-description',Er='ck-ai-chat-controls__model-selection__item-capabilities',pr='n';class Tr extends vt{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x718fb7){super(_0x718fb7),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',_0x5d8f24=>'selector'===_0x5d8f24),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x206b18=>_0x206b18?this['_modelSelectionDropdown']['buttonView']['label']:us(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x537030=>_0x537030),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x3ac7b9=>_0x3ac7b9),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x4d0e80=>us(this['locale'],_0x4d0e80?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x5f1fd6=>_0x5f1fd6),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x236af7=>us(this['locale'],_0x236af7?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[ur]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _t(),jt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x3281c6,_0x4765b4){if(_0x4765b4)this['set']('modelDisplayMode','hidden');else{const _0x518348=0x1===_0x3281c6['length'];this['set']('modelDisplayMode',_0x518348?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x3281c6?.['length'])for(const _0x46e68d of _0x3281c6){const _0x43b155=new Jt({'label':_0x46e68d['name'],'withText':!0x0,'role':'menuitemradio','id':_0x46e68d['id'],'model':_0x46e68d});_0x43b155['bind']('isOn')['to'](this,'activeModelId',_0x4a110b=>_0x4a110b===_0x46e68d['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x43b155,'labelView':new mr(this['locale'],_0x46e68d)});}}['setWebSearch'](_0x5cf6e8){this['set']('webSearchActive',_0x5cf6e8);}['setReasoning'](_0x450657){this['set']('reasoningActive',_0x450657);}['setModel'](_0x18930f){if(!_0x18930f)return;this['activeModelId']=_0x18930f['id'],this['activeModelName']=_0x18930f['name']||_0x18930f['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x18930f['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x18930f['name']);const _0x53ae81=_0x18930f['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x53ae81),this['_webSearchButton']['set']('isVisible',_0x53ae81);const _0x43820d=_0x18930f['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x43820d),this['_reasoningButton']['set']('isVisible',_0x43820d);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x38207d){this['set']('modelSelectorEnabled',!0x1),_0x38207d&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x1c2c0f=new Nt();return _0x1c2c0f['set']({'label':us(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x13ebcc,'class':dr+'\x20'+As,'isToggleable':!0x0,'tooltipPosition':pr}),_0x1c2c0f['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x1c2c0f;}['_createReasoningButton'](){const _0x300df0=new Nt();return _0x300df0['set']({'label':us(this['locale'],'AI_CHAT_REASONING'),'icon':_0x51861b,'class':dr+'\x20'+As,'isToggleable':!0x0,'tooltipPosition':pr}),_0x300df0['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x300df0;}['_createCommandsButton'](){const _0x53e973=new Nt();return _0x53e973['set']({'label':us(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x32e0db,'withText':!0x0,'class':dr+'\x20'+As,'isToggleable':!0x0,'tooltip':us(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':pr}),_0x53e973['extendTemplate']({'attributes':{'class':[_r]}}),_0x53e973['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x53e973;}['_createModelSelectionDropdown'](){const _0x4cf7f2=Gt(this['locale']);return _0x4cf7f2['set']({'panelPosition':'ne','class':[Ar]}),_0x4cf7f2['buttonView']['set']({'label':us(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':pr,'class':As}),this['listenTo'](_0x4cf7f2,'execute',_0xcc4f03=>{this['fire']('selectModel',_0xcc4f03['source']['model']);}),_0x4cf7f2;}['_createModelNameView'](){const _0x2066ca=new Cr(this['locale']);return _0x2066ca['bind']('text')['to'](this,'activeModelName',_0x244329=>_0x244329??''),_0x2066ca['bind']('isVisible')['to'](this,'modelDisplayMode',_0xc324c3=>'name'===_0xc324c3),_0x2066ca;}}let mr=class extends Mt{constructor(_0x28a78a,_0x246e24){super();const _0x338a96=this['bindTemplate'],_0x1a90ce=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x338a96['to']('style'),'id':_0x338a96['to']('id')},'children':[{'tag':'div','attributes':{'class':[gr]},'children':[{'text':_0x338a96['to']('text')}]},{'tag':'div','attributes':{'class':[Ir]},'children':[{'tag':'span','children':[{'text':_0x246e24['description']}]}]},{'tag':'div','attributes':{'class':[Er]},'children':_0x1a90ce}]}),_0x1a90ce['addMany'](this['_getCapabilityParts'](_0x28a78a,_0x13ebcc,'AI_CHAT_SEARCH_WEB',_0x246e24['capabilities']['webSearch']?.['enabled']??!0x1)),_0x1a90ce['addMany'](this['_getCapabilityParts'](_0x28a78a,_0x51861b,'AI_CHAT_REASONING',_0x246e24['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x23832c,_0x14ed2f,_0x5d9155,_0x323b17){const _0x1d365e=new xt();_0x1d365e['content']=_0x14ed2f;const _0x527bfc=new vt(_0x23832c);_0x527bfc['setTemplate']({'tag':'span','children':[{'text':us(_0x23832c,_0x5d9155)+':\x20'}]});const _0x5ce420=new vt(_0x23832c);return _0x5ce420['setTemplate']({'tag':'span','children':[{'text':us(_0x23832c,_0x323b17?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x1d365e,_0x527bfc,_0x5ce420];}},Cr=class extends vt{constructor(_0x526ce2){super(_0x526ce2),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x277056=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x277056['if']('isVisible','ck-hidden',_0x5380a1=>!_0x5380a1)]},'children':[{'text':_0x277056['to']('text')}]});}};const wr='ck-ai-chat-context-controls__url-form',fr='ck-ai-chat-context-controls__url-input-section';class Sr extends vt{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x1f7fe0){super(_0x1f7fe0),this['focusTracker']=new At(),this['keystrokes']=new gt(),this['backButton']=this['_createBackButton'](),this['urlInputField']=this['_createUrlInputField'](),this['confirmButton']=this['_createConfirmButton'](),this['_focusables']=this['createCollection']([this['backButton'],this['urlInputField'],this['confirmButton']]),this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['set']('withBackButton',!0x0),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x3166f7=>{this['focusTracker']['add'](_0x3166f7['element']),this['keystrokes']['listenTo'](_0x3166f7['element']);}),Zt({'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'](_0x1d1cd2){this['urlInputField']['errorText']=_0x1d1cd2,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x15cb36=new Nt(this['locale']);return _0x15cb36['set']({'icon':_0x2bd0fe,'tooltip':us(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x1e6d21,_0x56e6c8,_0x41685b)=>{_0x15cb36['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x41685b?'':'\x20ck-hidden')]});}),_0x15cb36;}['_createUrlInputField'](){const _0x3cf769=new te(this['locale'],_0x1f994d);return _0x3cf769['set']({'label':us(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x3cf769['fieldView']['set']({'placeholder':us(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x3cf769;}['_createConfirmButton'](){const _0x549c81=new Nt(this['locale']);return _0x549c81['set']({'icon':_0x39bec0,'tooltip':us(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x549c81;}['_setupTemplate'](){const _0x5f6826=new _0x3c9a0a(this['locale'],{'label':us(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x5f6826['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':wr,'tabindex':'-1'},'children':[_0x5f6826,{'tag':'div','attributes':{'class':fr},'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',_0x124d5c=>{_0x124d5c['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x43367f,_0x26de6c)=>{this['clear'](),this['fire']('cancel'),_0x26de6c();});}['_handleSubmit'](){const _0x5bf11d=this['getValue']()['trim']();_0x5bf11d?this['_isValidUrl'](_0x5bf11d)?(this['clearError'](),this['fire']('submitUrl',_0x5bf11d)):this['setError'](us(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](us(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x549345=this['getValue']()['trim'](),_0x676dc8=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x549345['length']>0x0&&!_0x676dc8;}['_isValidUrl'](_0x44b46a){try{return!!new URL(_0x44b46a);}catch{return!0x1;}}}const br='ck-ai-chat-resources__item',Rr='ck-ai-chat-resources__item--in-context',Or='ck-ai-chat-resources__item-title',kr='ck-ai-chat-resources__item__icon';class Nr extends Ht{['resource'];['_titleView'];['_iconView'];constructor(_0x2baab6,_0x34b7c5){super(_0x2baab6),this['resource']=_0x34b7c5,this['set']('isInContext',!!_0x34b7c5['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x298ddc){if(_0x298ddc['isInContext'])return _0x39bec0;switch(_0x298ddc['type']){case Us['DOCUMENT']:return _0x3dfd07;case Us['URL']:return _0x9697b8;case Us['FILE']:case Us['TEXT']:return _0x25934b;default:return _0x3b618a;}}['highlightText'](_0x332383){if(!_0x332383||''===_0x332383['trim']())return void this['_titleView']['highlightText'](null);const _0x2b2799=new RegExp(_0x81a2b5(_0x332383),'gi');this['_titleView']['highlightText'](_0x2b2799);}['updateResourceState'](_0xd328a){this['resource']['isInContext']=_0xd328a,this['isInContext']=_0xd328a,this['_updateIcon']();}['_createTitleView'](){const _0x16e721=new _0x5c2b37();return _0x16e721['text']=this['resource']['label'],_0x16e721['extendTemplate']({'tag':'span','attributes':{'class':[Or]}}),_0x16e721;}['_createIconView'](){const _0x54260d=new xt();return _0x54260d['content']=this['getResourceIcon'](this['resource']),_0x54260d;}['_setupTemplate'](){const _0x119371=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[br,_0x119371['if']('isVisible','ck-hidden',_0x4b31db=>!_0x4b31db),_0x119371['if']('isInContext',Rr)]},'children':[{'tag':'div','attributes':{'class':[kr]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x119371['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const vr='ck-ai-chat-resources__list';class yr extends Dt{['_source'];constructor(_0x4de8c0,_0x34b427){super(_0x4de8c0),this['_source']=_0x34b427,this['extendTemplate']({'attributes':{'class':[vr]}});}['setResources'](_0x138e54,_0x1e7ec9){this['items']['clear']();let _0xfa6f01=_0x138e54;if(this['_source']['useDefaultFiltering']&&_0x1e7ec9&&''!==_0x1e7ec9['trim']()){const _0x283122=new RegExp(_0x1e7ec9['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0xfa6f01=_0x138e54['filter'](_0x5d6d8e=>_0x283122['test'](_0x5d6d8e['label']));}for(const _0x552231 of _0xfa6f01){const _0x161b08=new Nr(this['locale'],_0x552231);_0x161b08['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x552231);}),this['items']['add'](_0x161b08);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x1e7ec9);}['highlightText'](_0x4c0fd7){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x33c0ff=>{_0x33c0ff['highlightText'](_0x4c0fd7);});}['updateResourceState'](_0x52726a,_0x1ebe05){for(const _0x1cbdaf of this['items']){const _0xc9d801=_0x1cbdaf;_0xc9d801['resource']['id']===_0x52726a&&_0xc9d801['updateResourceState'](_0x1ebe05);}}['_handleResourceSelection'](_0x501fe9,_0x273bf6){this['fire']('addResourceToContext',{'source':_0x501fe9,'resource':_0x273bf6});}}class xr extends te{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x316e98){const t=_0x316e98['t'],_0x4912c5={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x1f994d,'label':us(_0x316e98,'AI_CHAT_SEARCH_RESOURCES')};super(_0x316e98,_0x4912c5['creator']),this['label']=_0x4912c5['label'],this['_viewConfig']=_0x4912c5,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x316e98,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x491633){this['fire']('search',_0x491633);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new xt(),this['iconView']['content']=_0x3b4df8,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x5742a5,t){this['resetButtonView']=new Nt(_0x5742a5),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x341e14,'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',_0x195886=>!_0x195886),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 Lr extends vt{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x3576f2,_0x3d8cd2){super(_0x3576f2),this['_source']=_0x3d8cd2['source'],this['_searchInputVisibleFrom']=_0x3d8cd2['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 _0x43aab0([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new xr(this['locale']);}['_createSearchSection'](){const _0x530587=new vt(this['locale']);return _0x530587['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x172a0f,_0x4fa10c)=>{this['loadResources'](_0x4fa10c),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x4fa10c);}),_0x530587;}['_createResourcesListView'](){const _0x58116f=new yr(this['locale'],this['_source']);return _0x58116f['delegate']('addResourceToContext')['to'](this),_0x58116f['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x58116f;}['_createSkeletonView'](){const _0x40836f=new sr(this['locale'],nr['aiChatResources']);return _0x40836f['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x4cea41=>!_0x4cea41)]}}),_0x40836f;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x1db5cd){const _0x30d5ed=ot();this['_latestLoadResourcesUid']=_0x30d5ed,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x1db5cd,'uid':_0x30d5ed}),this['isLoading']=!0x0;}['setResources'](_0xc42ef,_0x3177a1){if(_0x3177a1&&_0x3177a1!==this['_latestLoadResourcesUid'])return;const _0x11f449=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0xc42ef,_0x11f449),_0xc42ef['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0xb1dc98,_0x46c7ae){this['_resourcesListView']['updateResourceState'](_0xb1dc98,_0x46c7ae);}}const Dr='ck-ai-chat-context-controls__source-balloon-panel',Pr='ck-button-icon\x20ck-button-back',Hr='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Mr{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x3f9021,_0x4bf36f,_0x8744c8){this['_locale']=_0x3f9021,this['_bodyCollection']=_0x4bf36f,this['_config']=_0x8744c8;}['showSourceResourcesBalloon']({source:_0x342cf4,withBackButton:_0x1674e1}){let _0x39bb23=this['_sourceResourceBalloons']['get'](_0x342cf4['id']);_0x39bb23||(_0x39bb23=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x342cf4['id'],_0x39bb23),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x39bb23)),this['_addSourceResourceContent']({'balloonPanel':_0x39bb23,'source':_0x342cf4,'withBackButton':_0x1674e1}),_0x39bb23['show']();const _0x45cc49=this['_config']['getTargetElement']();_0x45cc49&&_0x39bb23['pin']({'target':_0x45cc49,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x3623c2,_0x48dc39,_0xdf98ed){const _0x30be18=this['_sourceResourceBalloons']['get'](_0x3623c2);if(!_0x30be18)return;const _0x135f3c=this['_getResourcesViewFromBalloon'](_0x30be18);_0x135f3c&&(_0x135f3c['setResources'](_0x48dc39,_0xdf98ed),_0x135f3c['once']('change:isLoading',()=>{_0x30be18['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x21d106){const _0x2c736a=this['_sourceResourceBalloons']['get'](_0x21d106);_0x2c736a&&requestAnimationFrame(()=>{_0x2c736a['hide'](),this['_sourceResourceBalloons']['delete'](_0x21d106),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x21802f of this['_sourceResourceBalloons']['values']())if(_0x21802f['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x4c01dd,_0x2cc7d0,_0xec2978){const _0x34dc8c=this['_sourceResourceBalloons']['get'](_0x4c01dd);if(!_0x34dc8c||!_0x34dc8c['isVisible'])return;const _0x6cb8e3=this['_config']['getTargetElement']();if(!_0x6cb8e3)return;_0x34dc8c['pin']({'target':_0x6cb8e3,'limiter':this['_config']['getLimiterElement']()});const _0x16c8d1=this['_getResourcesViewFromBalloon'](_0x34dc8c);_0x16c8d1&&_0x16c8d1['updateResourceState'](_0x2cc7d0,_0xec2978);}['destroy'](){for(const _0x57daa6 of this['_sourceResourceBalloons']['values']())_0x57daa6['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x2079ad=new Xt(this['_locale']);return _0x2079ad['extendTemplate']({'attributes':{'class':Dr}}),this['_bodyCollection']['add'](_0x2079ad),_0x2079ad;}['_addSourceResourceContent']({balloonPanel:_0x2d003c,source:_0x5d8e48,withBackButton:_0x4b343a}){_0x2d003c['content']['clear']();const _0x22bae9=this['_createBalloonHeader']({'balloonPanel':_0x2d003c,'source':_0x5d8e48,'withBackButton':_0x4b343a});_0x2d003c['content']['add'](_0x22bae9);const _0x1b660c=this['_createBalloonResourcesView'](_0x5d8e48);_0x2d003c['content']['add'](_0x1b660c);}['_createBalloonHeader']({balloonPanel:_0x12fd6f,source:_0x5af781,withBackButton:_0x81e7b0}){const _0x1c1333=new _0x3c9a0a(this['_locale'],{'label':_0x5af781['label'],'class':Hr});return _0x81e7b0&&_0x1c1333['children']['add'](this['_createBackButton'](_0x12fd6f),0x0),_0x1c1333;}['_createBackButton'](_0x415c0f){const _0x32d149=new Nt(this['_locale']);return _0x32d149['set']({'icon':_0x2bd0fe,'tooltip':us(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Pr}),_0x32d149['on']('execute',()=>{_0x415c0f['hide'](),this['_config']['onBackToContext']();}),_0x32d149;}['_createBalloonResourcesView'](_0x32d76a){const _0x59e829=new Lr(this['_locale'],{'source':_0x32d76a,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x59e829['on']('loadSourceResources',(_0x135b21,_0x318570)=>{this['_config']['onLoadSourceResources'](_0x318570);}),_0x59e829['on']('addResourceToContext',(_0x1357c6,_0x420a51)=>{this['_config']['onResourceSelected'](_0x420a51['source'],_0x420a51['resource']),this['closeSourceResourceBalloon'](_0x32d76a['id']);}),_0x59e829;}['_getResourcesViewFromBalloon'](_0x2dff84){const _0x5c413d=_0x2dff84['content']['get'](0x1);return _0x5c413d instanceof Lr?_0x5c413d:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x3df02f){zt({'emitter':_0x3df02f,'contextElements':[_0x3df02f['element']],'callback':()=>{_0x3df02f['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x3df02f['isVisible']});}}const Ur=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Vr='ck-ai-chat-context-controls',Br='ck-ai-chat-context-controls__pending-contexts',Gr='ck-ai-chat-context-controls__add-context-balloon-panel',Fr='ck-ai-chat-context-controls__add-context-button',Kr='ck-ai-chat-context-controls__url-balloon-panel',Wr='ck-ai-chat-context-controls__balloon-button',Yr='ck-ai-chat-context-controls__balloon-button-source',$r='ck-ai-chat-controls-button',qr='ck-ai-chat-context-chips-wrapper-balloon',Qr='ck-ai-chat-controls_context_show-more-button',Xr='ck-ai-chat-context-controls__show-more-balloon-panel',zr='ck-ai-chat',jr=[Xt['defaultPositions']['northArrowSouthWest'],Xt['defaultPositions']['northArrowSouth'],Xt['defaultPositions']['northArrowSouthEast'],Xt['defaultPositions']['southArrowNorthWest'],Xt['defaultPositions']['southArrowNorth'],Xt['defaultPositions']['southArrowNorthEast']];class Jr extends vt{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x4ca39f,_0x394d76){super(_0x4ca39f),this['bodyCollection']=_0x394d76['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x4ca39f),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x4ca39f),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x4ca39f),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x4ca39f,_0x394d76);const _0x17ad49={'cssClasses':{'showMoreButton':Qr+'\x20'+As,'showMoreBalloon':Xr,'overflowContainer':qr,'controlsButton':$r}};this['_overflowManager']=new Kn(_0x4ca39f,this['_currentContextsChips'],_0x17ad49,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'](_0x4054ac,_0x29365a){const _0x49bea4=this['_createContextButton'](_0x4054ac,'current',!0x0,_0x29365a);this['_addContextToCollection'](_0x49bea4,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x3b15ad){this['_removeContextFromCollection'](_0x3b15ad,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x3b15ad,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x1209ad,_0x369904){let _0x592f27=this['_currentContextsChips']['find'](_0x24fb1c=>_0x24fb1c['id']===_0x1209ad);_0x592f27||(_0x592f27=this['_overflowManager']['overflowChips']['find'](_0x1fdee6=>_0x1fdee6['id']===_0x1209ad)),_0x592f27&&(_0x592f27['isLoading']=_0x369904);}['setConversationContext'](_0x4ba0d0){this['_conversationContextsChips']['clear']();for(const _0x5ef402 of _0x4ba0d0){const _0x3a0175=this['_createContextButton'](_0x5ef402,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x3a0175,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x5cea06,_0x161184,_0x420da1){this['_resourcesBalloonView']['updateResourceState'](_0x5cea06,_0x161184,_0x420da1);}['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:_0x30ffc6,withBackButton:_0x5a7c2d}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x30ffc6,'withBackButton':_0x5a7c2d}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x39aee7,_0x2dff18,_0x19d8b1,_0x121dae){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x39aee7,_0x19d8b1,_0x121dae);}['closeSourceResourceBalloon'](_0x20c7c9){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x20c7c9),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x569cb8){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x569cb8),this['_setAddContextButtonEnabled'](_0x569cb8);}['_setAddContextButtonEnabled'](_0x43262b){const _0x2089fc=!_0x43262b['document']['isHidden']&&_0x43262b['document']['enabled'],_0x42b880=_0x43262b['urls']['enabled'],_0x71eb96=_0x43262b['files']['enabled'],_0x1342bb=_0x43262b['sources']['length']>0x0,_0x56b5ae=_0x43262b['customItems']&&_0x43262b['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x2089fc||_0x42b880||_0x71eb96||_0x1342bb||_0x56b5ae;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Vr,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Br},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x3c640f){const _0xf2c208=new Nt(_0x3c640f);return _0xf2c208['set']({'label':us(_0x3c640f,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':$r+'\x20'+Fr+'\x20'+As,'icon':_0x5e7016,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0xf2c208;}['_createAddContextBalloonPanelView'](_0xf20769){return this['_createBaseBalloonPanel'](_0xf20769,Gr);}['_createUrlBalloonPanelView'](_0x12c63d){const _0x2bcc24=this['_createBaseBalloonPanel'](_0x12c63d,Kr);return this['_addUrlContent'](_0x2bcc24,_0x12c63d),_0x2bcc24;}['_createResourcesBalloonView'](_0x3b0bd4,_0x4d4a9c){const _0x563fac={'searchInputVisibleFrom':_0x4d4a9c['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jr});},'onResourceSelected':(_0x139f3f,_0x2f6409)=>{this['fire']('addResourceToContext',{'source':_0x139f3f,'resource':_0x2f6409});},'onLoadSourceResources':_0x2eec40=>{this['fire']('loadSourceResources',_0x2eec40);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Mr(_0x3b0bd4,_0x4d4a9c['bodyCollection'],_0x563fac);}['_getLimiterElement'](){return this['element']?.['closest']('.'+zr)||document['body'];}['_createBaseBalloonPanel'](_0x53d24d,_0x2b9e2e){const _0x5239c9=new Xt(_0x53d24d);return _0x5239c9['extendTemplate']({'attributes':{'class':_0x2b9e2e}}),this['bodyCollection']['add'](_0x5239c9),_0x5239c9;}['_setBalloonPanelContent'](_0x3960f7,_0x37d13d,_0x5c8e76){if(_0x3960f7['content']['clear'](),!_0x5c8e76['document']['isHidden']&&_0x5c8e76['document']['enabled']){const _0x398e0d=this['_createBalloonButton'](_0x37d13d,{'label':us(_0x37d13d,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x3dfd07});_0x398e0d['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x3960f7['content']['add'](_0x398e0d);}if(_0x5c8e76['urls']['enabled']){const _0x1d12b7=this['_createBalloonButton'](_0x37d13d,{'label':us(_0x37d13d,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x9697b8});_0x1d12b7['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jr}),this['_urlInputView']['focus']();}),_0x3960f7['content']['add'](_0x1d12b7);}if(_0x5c8e76['files']['enabled']){const _0x4ed916=new _0x5f41d3(_0x37d13d);_0x4ed916['set']({'label':us(_0x37d13d,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x80857d,'withText':!0x0,'tooltip':!0x0,'class':Wr,'allowMultipleFiles':!0x0}),_0x4ed916['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x4ed916['on']('done',(_0x249267,_0xbdf4bd)=>{this['fire']('addFileToContext',_0xbdf4bd);}),_0x4ed916['tooltip']=!0x0,_0x3960f7['content']['add'](_0x4ed916);}for(const _0x575217 of _0x5c8e76['sources']){const _0x37382a=this['_createBalloonButton'](_0x37d13d,{'label':_0x575217['label'],'icon':_0x575217['icon']||_0x3b618a,'type':'source'});_0x3960f7['content']['add'](_0x37382a),_0x37382a['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x575217,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x53c196 of _0x5c8e76['customItems']||[]){const _0x2d37a1=this['_createBalloonButton'](_0x37d13d,{'label':_0x53c196['label'],'icon':_0x53c196['icon']||_0x3b618a,'type':'customItem'});_0x3960f7['content']['add'](_0x2d37a1),_0x2d37a1['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x53c196);});}this['_hasExactlyOneSource']=0x1===_0x3960f7['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x1bf4da,_0x577b14){this['_urlInputView']=new Sr(_0x577b14),this['_urlInputView']['on']('submitUrl',(_0x30ec03,_0x4f4e83)=>{this['_handleUrlSubmit'](_0x4f4e83);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jr}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jr});}),_0x1bf4da['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x5b2852,_0x160bd2){const _0x29d4fb='source'===_0x160bd2['type']?new Zr(_0x5b2852):new Nt(_0x5b2852);return _0x29d4fb['set']({'label':_0x160bd2['label'],'icon':_0x160bd2['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Wr}),_0x29d4fb;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){zt({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x5a0693){const _0x1f3aa2=this['_addContextBalloonConfig'];_0x1f3aa2['buttonView']['isOn']=_0x5a0693,_0x5a0693?_0x1f3aa2['balloonView']['show']():_0x1f3aa2['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x24266e,buttonView:_0x534d56,hideMethod:_0x1b0e5f}=this['_addContextBalloonConfig'];zt({'emitter':_0x24266e,'contextElements':[_0x24266e['element'],_0x534d56['element']],'callback':()=>{_0x1b0e5f();},'activator':()=>_0x534d56['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x8093b8,_0x195bb7,_0x4fde99=!0x1,_0x550440=!0x1){const _0x2bc424='conversation'===_0x195bb7||!0x0===_0x8093b8['isReadOnly'],_0x2831bf=new Vn(this['locale'],_0x8093b8,_0x2bc424,_0x4fde99,_0x550440);return _0x2bc424||_0x2831bf['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x2831bf['id']);}),_0x2831bf;}['_addContextToCollection'](_0x3488d4,_0x540b09){_0x540b09['add'](_0x3488d4,0x0);}['_removeContextFromCollection'](_0x36ef3f,_0x59f1ea){const _0x4d61ef=_0x59f1ea['find'](_0x31207e=>_0x31207e['id']===_0x36ef3f);_0x4d61ef&&_0x59f1ea['remove'](_0x4d61ef);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jr}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x3bdb79){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x3bdb79);}}class Zr extends Nt{['arrowView'];constructor(_0x27161a){super(_0x27161a),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Yr]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x5e8ed5=new xt();return _0x5e8ed5['content']=_0x249f8c,_0x5e8ed5['extendTemplate']({'attributes':{'class':Yr+'__arrow'}}),_0x5e8ed5;}}class ta extends vt{['_cancelButtonView'];['_loaderView'];constructor(_0x12154e){super(_0x12154e),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 _0x293b21=new Nt(this['locale']);return _0x293b21['set']({'label':us(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':_s+'\x20ck-ai-button-stop-generating','icon':_0x53f40e}),_0x293b21['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x293b21;}['_createLoaderView'](){const _0x54374d=new vt(this['locale']);return _0x54374d['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':us(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x54374d;}}class ea extends vt{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x21f74e,_0x466e79){super(_0x21f74e),this['_contextPanelView']=this['_createContextPanelView'](_0x21f74e,{'bodyCollection':_0x466e79['bodyCollection'],'searchInputVisibleFrom':_0x466e79['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x21f74e),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x21f74e),this['_loaderView']=this['_createLoaderView'](_0x21f74e),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x21f74e),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'](...Ur)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0xe2cbc6=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0xe2cbc6['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0xe2cbc6['if']('isLoading','ck-hidden',_0xee00b0=>_0xee00b0||!this['isModelAvailable']),_0xe2cbc6['if']('isModelAvailable','ck-hidden',_0x3300d9=>!_0x3300d9||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0xe2cbc6['if']('isLoading','ck-hidden',_0x32a0ba=>!_0x32a0ba)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0xe2cbc6['if']('isModelAvailable','ck-hidden',_0x44f9de=>_0x44f9de)]},'children':[this['_modelUnavailableMessageView']]}]}),zt({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x379651,_0x5ced5a){return new Jr(_0x379651,_0x5ced5a);}['_createPromptInputView'](_0x4ec266){return new lr(_0x4ec266,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x1a57bf){return new Tr(_0x1a57bf);}['_createLoaderView'](_0x5cff58){return new ta(_0x5cff58);}['_createModelUnavailableMessageView'](_0x1152b9){const _0x126ff1=new ia(_0x1152b9);return _0x126ff1['delegate']('startConversation')['to'](this),_0x126ff1;}['_handlePromptInputFocus'](_0x2d200a,_0x2e5fa9,_0xe4060a){_0xe4060a?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x41c69f,_0x4f2415){this['_contextPanelView']['addContextItem'](_0x41c69f,_0x4f2415);}['removeContextItem'](_0x2e57c9){this['_contextPanelView']['removeContextItem'](_0x2e57c9);}['setContextItemLoading'](_0xd40580,_0x39ec31){this['_contextPanelView']['setContextItemLoading'](_0xd40580,_0x39ec31);}['setIsUploadInProgress'](_0x15c55c){this['_promptInputView']['setIsUploadInProgress'](_0x15c55c);}['setConversationContext'](_0x1b6afe){this['_contextPanelView']['setConversationContext'](_0x1b6afe);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x2ad164,_0x4679e2,_0x376af6){this['_contextPanelView']['updateResourceState'](_0x2ad164,_0x4679e2,_0x376af6);}['setWebSearch'](_0x11bad7){this['_promptCapabilitiesView']['setWebSearch'](_0x11bad7);}['setReasoning'](_0x28f3a4){this['_promptCapabilitiesView']['setReasoning'](_0x28f3a4);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x49929b){this['_contextPanelView']['setAddContextOptions'](_0x49929b);}['setInputPlaceholder'](_0x33d2f1){this['_promptInputView']['setPlaceholderText'](_0x33d2f1);}['setModelList'](_0x356402,_0x131734){this['_promptCapabilitiesView']['setModelList'](_0x356402,_0x131734);}['setModel'](_0x2a7f7e){_0x2a7f7e?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x2a7f7e)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x2d8fee){this['_promptCapabilitiesView']['disableModelSelector'](_0x2d8fee);}['populateSourceResourceBalloon'](_0x4ad9f8,_0x102c8e,_0x42e8ee,_0x3bd2cd){this['_contextPanelView']['populateSourceResourceBalloon'](_0x4ad9f8,_0x102c8e,_0x42e8ee,_0x3bd2cd);}['closeSourceResourceBalloon'](_0x3be35f){this['_contextPanelView']['closeSourceResourceBalloon'](_0x3be35f);}['focusPromptInput'](_0x32af7e=!0x1){this['_promptInputView']['focus'](_0x32af7e);}['setPromptInputValue'](_0x42bb12){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x42bb12;}}class ia extends vt{constructor(_0x3649cc){super(_0x3649cc);const _0x14d157=new Nt(_0x3649cc);_0x14d157['set']({'label':us(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x14d157['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':us(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x14d157]}]});}}class sa extends _0x3c9a0a{['conversationStartButton'];['resizeButton'];constructor(_0x4dfea1,_0x2e9d35){super(_0x4dfea1,{'label':us(_0x4dfea1,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':_0x32ee8b}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x4dfea1),this['children']['add'](this['conversationStartButton']),_0x2e9d35&&(this['resizeButton']=gs(_0x4dfea1,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x4299b6){const _0x38aa8b=new Nt(_0x4299b6);return _0x38aa8b['set']({'label':us(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x59b996,'class':'ck-ai-chat__start-conversation\x20'+_s}),_0x38aa8b['on']('execute',()=>{this['fire']('startConversation');}),_0x38aa8b;}}class na extends vt{constructor(_0x2be48f){super(_0x2be48f),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':us(_0x2be48f,'AI_DISCLAIMER_TEXT')}]}]});}}class ra extends vt{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x346cec,_0x288384){super(_0x346cec),this['_bodyCollection']=new Qt(_0x346cec),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new sa(_0x346cec,_0x288384['showResizeButton']),this['chatHeader']['delegate'](...sn)['to'](this),this['chatFeed']=new or(_0x346cec,this['_bodyCollection']),this['chatFeed']['delegate'](...sn)['to'](this),this['chatControls']=new ea(_0x346cec,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x288384['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...sn)['to'](this),this['chatDisclaimer']=new na(_0x346cec),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x346cec['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x1435c2,_0xf2b75,_0xa9281d,_0x5e4859){this['chatControls']['populateSourceResourceBalloon'](_0x1435c2,_0xf2b75,_0xa9281d,_0x5e4859);}['closeSourceResourceBalloon'](_0x398b63){this['chatControls']['closeSourceResourceBalloon'](_0x398b63);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class aa extends _0x4c168b{static get['requires'](){return[cs];}['_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(_0x1b1e6b){super(_0x1b1e6b);const _0x4534f4=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new mn(),this['_view']=new ra(this['context']['locale'],{'showResizeButton':_0x4534f4['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...sn)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x9c0b0e,{showDiff:_0x1efab5})=>{this['showDiff']=_0x1efab5;}),_0x4534f4['view']['addTab']({'id':'chat','buttonLabel':us(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x32ee8b,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x422b13=>_0x422b13),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x516925=>_0x516925),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x275cba){const _0x4b8e53=this['context']['config']['get']('ai.chat.welcomeMessage')??us(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x275cba['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x4b8e53}),this['fire']('conversationCreated');}async['addFeedItemStaticMessage']({id:_0x45606f,staticMessage:_0x4fa420}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x45606f,'initialContent':'<p>'+_0x4fa420+'</p>'});});}async['addFeedItemUserMessage'](_0x13c708){const _0x135c50=_0x13c708['attributes']?.['displayedPrompt']||_0x13c708['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x13c708['contextItems']['values']()),'initialContent':'<p>'+_0x135c50+'</p>','id':_0x13c708['id']});});}async['addFeedItemError']({errorMessage:_0x31a0d9,id:_0x470da6}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x31a0d9+'</p>','id':_0x470da6});});}async['addFeedItemAIReply'](_0x342e2b){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x342e2b['interactionId']+':'+_0x342e2b['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x26827b){const _0x385cd9=Xs(this['context']);let _0x11510d=_0x385cd9['config']['get']('ai.availableReplyActions')||[...wn];if(_0x385cd9['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x4450e0=_0x385cd9['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x4450e0,'value');}}else _0x11510d=_0x11510d['filter'](_0x55af62=>'insertSuggestion'!=_0x55af62);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x26827b['interactionId']+':'+_0x26827b['id'],'areActionsDisabled':_0x26827b['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x11510d}),this['clearLoadingMessage']();});}async['addFeedInteractionHeader'](_0xf03ed4,_0x47cd5b){return this['_promiseQueue']['enqueue'](async()=>{const _0x3d36ea=this['_view']['chatFeed']['children']['last'];if(_0x3d36ea instanceof Jn)return this['_view']['chatFeed']['children']['remove'](_0x3d36ea),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0xf03ed4['id'],'capabilities':{'isWebSearchEnabled':_0x3d36ea['capabilities']['isWebSearchEnabled']||_0x47cd5b['isWebSearchEnabled'],'isReasoningEnabled':_0x3d36ea['capabilities']['isReasoningEnabled']||_0x47cd5b['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0xf03ed4['id'],'capabilities':_0x47cd5b});});}async['addFeedItemCustomElement'](_0x43cb09,_0x286b7f){let _0x402397;return await this['_promiseQueue']['enqueue'](async()=>{_0x402397=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x43cb09,'id':_0x286b7f});}),_0x402397;}['removeFeedItem'](_0xf543d4){this['_view']['chatFeed']['removeItem'](_0xf543d4);}['hasFeedItem'](_0xd68895){return this['_view']['chatFeed']['hasItem'](_0xd68895);}['updateFeedInteractionHeader'](_0x12421d){const _0xbb1410=this['_view']['chatFeed']['children']['find'](_0x429462=>_0x429462['options']['id']==_0x12421d['id']&&_0x429462 instanceof Jn);_0xbb1410&&_0xbb1410['set']('isVisible',_0x12421d['isVisible']);}async['updateFeedItemAIReplyContent'](_0x2941b4){const _0x41e17d=_0x2941b4['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x21f019=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x2941b4,'abortSignal':_0x21f019,'renderingStrategy':_0x41e17d}),_0x2941b4['isDone']&&this['markFeedItemAsDone'](_0x2941b4['id']);});}['updateFeedItemAIReplySources'](_0x38fc24,_0x557352){this['_view']['chatFeed']['updateWebSources'](_0x38fc24,_0x557352);}async['updateFeedItemAIReplySuggestionContent'](_0x508e8b){const _0x28986d=_0x508e8b['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x482f29=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x508e8b,'abortSignal':_0x482f29,'renderingStrategy':_0x28986d}),_0x508e8b['isDone']&&this['markFeedItemAsDone'](_0x508e8b['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x56d99a){this['_view']['chatFeed']['updateSuggestionPartState'](_0x56d99a);}['setFeedItemAIReplySuggestionPartActive'](_0x269037){this['_view']['chatFeed']['setSuggestionPartActive'](_0x269037);}['markFeedItemAsDone'](_0x472ad9){this['_view']['chatFeed']['markItemAsDone'](_0x472ad9);}['removeFeedInteraction'](_0x378484){this['_view']['chatFeed']['getItemIds']()['filter'](_0x2abe76=>_0x2abe76['startsWith'](_0x378484))['forEach'](_0x42b7c8=>this['_view']['chatFeed']['removeItem'](_0x42b7c8));}['startInteraction'](){const _0x56561d=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x56561d),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x45f6d7){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x2890d3=>_0x2890d3['startsWith'](_0x45f6d7['id']))['forEach'](_0x391312=>this['markFeedItemAsDone'](_0x391312)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x4f3186,_0xee126a){this['_view']['chatControls']['addContextItem'](_0x4f3186,_0xee126a);}['removeContextItem'](_0x48c601){this['_view']['chatControls']['removeContextItem'](_0x48c601);}['setContextItemLoading'](_0xbdf8e4,_0x1ec29f){this['_view']['chatControls']['setContextItemLoading'](_0xbdf8e4,_0x1ec29f);}['setIsUploadInProgress'](_0x3707a7){this['_view']['chatControls']['setIsUploadInProgress'](_0x3707a7);}['setConversationContext'](_0x72e663){this['_view']['chatControls']['setConversationContext'](_0x72e663);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x87d846,_0x5a78d5,_0x418f4a){this['_view']['chatControls']['updateResourceState'](_0x87d846,_0x5a78d5,_0x418f4a);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x2b3381){this['_view']['chatControls']['setAddContextOptions'](_0x2b3381);}['updateCapabilities'](_0x4d16f9){this['_view']['chatControls']['setWebSearch'](_0x4d16f9['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x4d16f9['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x4d16f9));}['setSelectedModel'](_0x4514c4,_0x5176da){this['_view']['chatControls']['setModel'](_0x4514c4),_0x5176da&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x75dfa1){this['feedItemRenderingStrategy']=_0x75dfa1;}['toggleLoadingSkeleton'](_0x565a92){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x565a92);}['resetConversationTitle'](){this['setConversationTitle'](us(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x55d572,_0x6cd56d=!0x1){if(_0x6cd56d&&!bt()&&_0x55d572['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x55d572);this['_view']['chatHeader']['label']=_0x55d572;}['setLoadingMessage'](_0x23e02e){this['_view']['chatFeed']['setLoadingMessage'](_0x23e02e);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x497923){let _0x478ce=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x497923[_0x478ce],_0x478ce++,_0x478ce===_0x497923['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0xf3afd2){this['_view']['chatHeader']['isMaximized']=_0xf3afd2;}['prepareLoadingMessage'](_0x568b37){return _0x568b37['isWebSearchEnabled']&&_0x568b37['isReasoningEnabled']?us(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x568b37['isWebSearchEnabled']?us(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x568b37['isReasoningEnabled']?us(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):us(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x295a07){return _0x295a07?_0x295a07['isWebSearchEnabled']&&_0x295a07['isReasoningEnabled']?us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x295a07['isWebSearchEnabled']?us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x295a07['isReasoningEnabled']?us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x24ba5a,_0x8e5170,_0xe7a117,_0x3b1765){this['_view']['populateSourceResourceBalloon'](_0x24ba5a,_0x8e5170,_0xe7a117,_0x3b1765);}['closeSourceResourceBalloon'](_0x425e93){this['_view']['closeSourceResourceBalloon'](_0x425e93);}['setPromptInputValue'](_0x4e5452){this['_view']['chatControls']['setPromptInputValue'](_0x4e5452);}['focusPromptInput'](_0x4353fb=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x4353fb);}['scrollFeedToSuggestion'](_0x51e850,_0x201293){this['_view']['chatFeed']['scrollToSuggestion'](_0x51e850,_0x201293);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class oa extends Dt{['sections'];constructor(_0x5140c3,_0x5a4e9c){super(_0x5140c3),this['sections']=_0x5a4e9c,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x2d0c6a){let _0x4b6d0a=0x0,_0x1d4323=0x0;for(const _0x703d of this['sections']){const {resultsCount:_0x365c06,totalItemsCount:_0x3ffb7b}=_0x703d['filter'](_0x2d0c6a);_0x4b6d0a+=_0x365c06,_0x1d4323+=_0x3ffb7b;}return{'resultsCount':_0x4b6d0a,'totalItemsCount':_0x1d4323};}}class ha extends Ht{['title'];['itemsViews'];['_itemsListView'];constructor(_0x1a75fa,{title:_0x504d3f,items:_0x468386}){super(_0x1a75fa);const _0x373aa4=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x504d3f,this['itemsViews']=_0x468386;const _0x444449=new vt(_0x1a75fa);_0x444449['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new Dt(_0x1a75fa),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x373aa4['if']('isVisible','ck-hidden',_0x53f683=>!_0x53f683)]},'children':[_0x444449,this['_itemsListView']]});}['filter'](_0x21b433){const _0xb0bbe6=this['itemsViews']['length'];let _0x4fd0f6=0x0;for(const _0x5af515 of this['itemsViews']){if(_0x21b433){const _0x509e5e=_0x5af515['isMatching'](_0x21b433);_0x5af515['isVisible']=!!_0x509e5e,_0x5af515['highlightText'](_0x21b433);}else _0x5af515['isVisible']=!0x0,_0x5af515['highlightText'](null);_0x5af515['isVisible']&&_0x4fd0f6++;}return this['isVisible']=_0x4fd0f6>0x0,{'resultsCount':_0x4fd0f6,'totalItemsCount':_0xb0bbe6};}['getItem'](_0x2d7bd8){return this['itemsViews']['find'](_0x5067a6=>_0x5067a6['id']===_0x2d7bd8);}['removeItem'](_0x41cb49){const _0x48757e=this['itemsViews']['indexOf'](_0x41cb49);-0x1!==_0x48757e&&(this['itemsViews']['splice'](_0x48757e,0x1),this['_itemsListView']['items']['remove'](_0x41cb49));}}class ca extends/* #__PURE__ -- @preserve */
27
- _0x33f31e(Ht){['id'];static ['LOADING_LABELS']={'remove':'AI_CHAT_HISTORY_LOADING_REMOVING','rename':'AI_CHAT_HISTORY_LOADING_RENAMING','pin':'AI_CHAT_HISTORY_LOADING_PINNING','unpin':'AI_CHAT_HISTORY_LOADING_UNPINNING'};['actions'];['mainContent'];['_titleView'];constructor(_0x29f51d,_0x3b80a1){super(_0x29f51d);const _0x85ee55=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x3b80a1['pinned']),this['set']('loadingState',null),this['id']=_0x3b80a1['id'];const {title:_0x32be87,createdAt:_0x12f03d,active:_0x179fff=!0x1}=_0x3b80a1;this['_titleView']=new _0x5c2b37(),this['_titleView']['text']=_0x32be87,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x4808a1=this['_createCheckView'](),_0x5400a2=this['_createPinButtonView'](_0x29f51d),_0x36c77a=this['_createMenuDropdownView'](),_0x181702=this['_createEditInputView'](_0x29f51d,_0x32be87),_0x7634e7=this['_createAcceptEditButtonView'](_0x29f51d,_0x181702),_0x212830=this['_createCancelEditButtonView'](_0x29f51d,_0x181702);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x5400a2),this['actions']['add'](_0x36c77a),this['on']('change:isEdit',(_0x272c5b,_0x428176,_0x2d7c35)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x2d7c35?(this['actions']['add'](_0x7634e7),this['actions']['add'](_0x212830),this['mainContent']['add'](_0x181702),_0x181702['element']['focus']()):(this['actions']['add'](_0x5400a2),this['actions']['add'](_0x36c77a),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x179fff?'ck-ai-chat-history__item--active':'',_0x85ee55['if']('isVisible','ck-hidden',_0x419636=>!_0x419636),_0x85ee55['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',_0x85ee55['if']('loadingState','ck-hidden',_0x9d557=>!!_0x9d557)]},'children':_0x179fff?[_0x4808a1]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x85ee55['if']('loadingState','ck-hidden',_0x2846f9=>!_0x2846f9)]},'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',_0x85ee55['if']('loadingState','ck-hidden',_0x22ebee=>!!_0x22ebee)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x85ee55['if']('loadingState','ck-hidden',_0x321a26=>!_0x321a26)]},'children':[{'text':_0x85ee55['to']('loadingState',_0xa389dc=>_0xa389dc?us(this['locale'],ca['LOADING_LABELS'][_0xa389dc]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x12f03d]}]},{'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'](_0x5314ae){this['_titleView']['text']=_0x9da630(_0x5314ae);}['updateLoadingState'](_0x3363b4,_0x5dff73){this['set']('loadingState',_0x5dff73?_0x3363b4:null);}['_createCheckView'](){const _0x460b76=new xt();return _0x460b76['set']({'content':_0x39bec0}),_0x460b76;}['_createPinButtonView'](_0x36d37c){const _0x3ef40f=new Nt(_0x36d37c);return _0x3ef40f['set']({'label':us(_0x36d37c,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x12a202,'withText':!0x1,'tooltip':!0x0}),_0x3ef40f['bind']('isOn')['to'](this,'pinned'),_0x3ef40f['on']('execute',()=>{const _0x2a6c89=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x2a6c89});}),_0x3ef40f;}['_createMenuDropdownView'](){const _0x23fb88=Gt(this['locale'],_0xe5c505),_0x14bf86=_0x23fb88['panelView']['children'];_0x23fb88['buttonView']['set']({'label':us(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x2018d0}),_0x23fb88['panelPosition']='sw';const _0x261125=new Nt(this['locale']);_0x261125['label']=us(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x261125['withText']=!0x0,_0x261125['on']('execute',()=>{this['isEdit']=!0x0;});const _0x5ab0c0=new Nt(this['locale']);_0x5ab0c0['label']=us(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x5ab0c0['withText']=!0x0,_0x5ab0c0['on']('execute',()=>{this['showConfirm'](us(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x4ea359=new Dt(this['locale']),_0x41dc3a=new Ht(this['locale']);_0x41dc3a['children']['add'](_0x261125);const _0x58a1ec=new Ht(this['locale']);return _0x58a1ec['children']['add'](_0x5ab0c0),_0x4ea359['items']['addMany']([_0x41dc3a,_0x58a1ec]),_0x14bf86['add'](_0x4ea359),_0x23fb88;}['_createEditInputView'](_0x48728b,_0x55c6aa){const _0x110529=new _0x34fddb(_0x48728b),_0x558085=_0x110529['bindTemplate'];return _0x110529['value']=_0x55c6aa,_0x110529['extendTemplate']({'on':{'keydown':_0x558085['to'](_0x1ee5c6=>{'Enter'==_0x1ee5c6['key']&&this['_commitEditInputValue'](_0x110529);})}}),_0x110529;}['_createAcceptEditButtonView'](_0x18f559,_0x54f80e){const _0x24daa3=new Nt(_0x18f559);return _0x24daa3['set']({'icon':_0x39bec0,'withText':!0x1,'tooltip':us(_0x18f559,'AI_CHAT_HISTORY_ACCEPT')}),_0x24daa3['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x24daa3['on']('execute',()=>{this['_commitEditInputValue'](_0x54f80e);}),_0x24daa3;}['_commitEditInputValue'](_0x4a9429){const _0x3d9832=_0x4a9429['element']['value']||'';this['_titleView']['text']=_0x3d9832,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x3d9832});}['_createCancelEditButtonView'](_0x22080a,_0x2a85bb){const _0x14885f=new Nt(_0x22080a);return _0x14885f['set']({'icon':_0x341e14,'withText':!0x1,'tooltip':us(_0x22080a,'AI_CHAT_HISTORY_CANCEL')}),_0x14885f['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x14885f['on']('execute',()=>{this['isEdit']=!0x1,_0x2a85bb['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x14885f;}['_createSpinnerView'](){const _0x5d7c6c=new vn('tiny');return _0x5d7c6c['isVisible']=!0x0,_0x5d7c6c;}['isMatching'](_0x3f0d29){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x3f0d29)?{'title':!0x0}:null;}['highlightText'](_0x5a7b1c){this['_titleView']['highlightText'](_0x5a7b1c);}}class la extends vt{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x58a62a,_0x2e6df5){super(_0x58a62a),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 _0x22667c=new _0x3c9a0a(_0x58a62a,{'label':us(_0x58a62a,'AI_CHAT_HISTORY_HEADING'),'icon':_0x4fbb31,'class':'ck-ai-header\x20ck-ai-header_history'});_0x2e6df5&&(this['resizeButton']=gs(_0x58a62a,this),_0x22667c['children']['add'](this['resizeButton'])),this['sectionsView']=new oa(_0x58a62a,[]),this['sectionsView']['delegate'](...ua)['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',_0x478060=>!_0x478060)]}}),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':[_0x22667c,{'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 _0x15b984=new _0x2e6f71(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':us(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x1e09c5=>us(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x1e09c5),'secondary':us(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x545034=this['_createErrorView']();return _0x545034['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x3d4268=>!_0x3d4268)]}}),_0x15b984['on']('render',()=>{_0x15b984['children']['add'](_0x545034,0x1);}),_0x15b984['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x2d275b=>!_0x2d275b)]}}),_0x15b984;}['_createSkeletonView'](){const _0x461884=new sr(this['locale'],nr['aiHistory']);return _0x461884['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x141cb5=>!_0x141cb5)]}}),_0x461884;}['_createErrorView'](){const _0x22fa91=new vt(this['locale']),_0x3e730d=new Nt(this['locale']);_0x3e730d['set']({'withText':!0x1,'icon':_0x341e14,'class':'ck-ai-notification_error__dismiss-button'}),_0x3e730d['bind']('isVisible')['to'](this,'hasItems',_0x258974=>!!_0x258974),_0x3e730d['on']('execute',()=>{this['errorMessage']='';});const _0x5137c5=this['bindTemplate'];return _0x22fa91['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x5137c5['to']('errorMessage')}]},_0x3e730d]}),_0x22fa91;}['_createEmptyStateView'](){const _0x40e680=new Nt(this['locale']);_0x40e680['set']({'label':us(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x59b996,'class':'ck-ai-chat__start-conversation\x20'+_s}),_0x40e680['on']('execute',()=>{this['fire']('openChat');});const _0xa563b3=new vt(this['locale']);return _0xa563b3['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x1f2920=>!_0x1f2920)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[us(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x40e680]}),_0xa563b3;}['_createListItemViews'](_0x361b12,_0x122496){const _0x24e73d=[];for(const _0x105056 of _0x361b12){const _0x552a12=new ca(_0x122496,_0x105056);_0x552a12['delegate'](...ua)['to'](this),_0x24e73d['push'](_0x552a12);}return _0x24e73d;}['updateHistoryItemsWithCategories'](_0x1cb0f1){const _0x1bd465=this['locale']||'en',_0x3e0d8c=[];for(const _0x1e2d9e of _0x1cb0f1){const _0x16c488=this['_createListItemViews'](_0x1e2d9e['items'],_0x1bd465);_0x3e0d8c['push'](new ha(_0x1bd465,{'title':_0x1e2d9e['title'],'items':_0x16c488}));}this['sectionsView']['sections']=_0x3e0d8c,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x3e0d8c),this['hasItems']=_0x1cb0f1['some'](_0x14be46=>_0x14be46['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x29dcc1){for(const _0xf385d6 of this['sectionsView']['sections']){const _0x29b050=_0xf385d6['getItem'](_0x29dcc1);if(_0x29b050){if(_0xf385d6['removeItem'](_0x29b050),0x0===_0xf385d6['itemsViews']['length']){const _0x11d8c3=this['sectionsView']['sections']['indexOf'](_0xf385d6);-0x1!==_0x11d8c3&&(this['sectionsView']['sections']['splice'](_0x11d8c3,0x1),this['sectionsView']['items']['remove'](_0xf385d6));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x415263,_0x7f0f2){for(const _0x2ffc9d of this['sectionsView']['sections']){const _0x5e8a6b=_0x2ffc9d['getItem'](_0x415263);if(_0x5e8a6b){_0x5e8a6b['updateTitle'](_0x7f0f2);break;}}}['updateItemLoadingState'](_0x327b70,_0x8260d7,_0x2c7fd0){for(const _0x4ad84b of this['sectionsView']['sections']){const _0x19a60a=_0x4ad84b['getItem'](_0x327b70);if(_0x19a60a){_0x19a60a['updateLoadingState'](_0x8260d7,_0x2c7fd0);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0xc2ce98=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0xc2ce98);}}}const ua=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class da extends _0x4c168b{static get['requires'](){return[cs];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xd01c57){super(_0xd01c57);const _0x1142fc=this['context']['plugins']['get']('AITabs');this['_historyView']=new la(this['context']['locale'],_0x1142fc['showResizeButton']),this['_historyView']['delegate'](...ua)['to'](this),_0x1142fc['view']['addTab']({'id':'history','buttonLabel':us(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x4fbb31,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x3a8738){this['_historyView']['removeHistoryItem'](_0x3a8738);}['updateItems'](_0x23cee7){this['_historyView']['updateHistoryItemsWithCategories'](_0x23cee7);}['updateItemTitle'](_0x40e353,_0x4e41c6){this['_historyView']['updateItemTitle'](_0x40e353,_0x4e41c6);}['updateItemLoadingState'](_0x8911a1,_0x59dccd,_0xc464e5){this['_historyView']['updateItemLoadingState'](_0x8911a1,_0x59dccd,_0xc464e5);}['setLoadingSkeleton'](_0x4b0e90){this['_historyView']['isLoading']=_0x4b0e90;}['showError'](_0xfddfda){this['_historyView']['errorMessage']=_0xfddfda;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x5dfba5){this['_historyView']['isMaximized']=_0x5dfba5;}}class _a extends ct(){['id'];['createdAt'];constructor({id:_0x359981,title:_0x228bc2,createdAt:_0x1bd65d,updatedAt:_0x4ca0ec,pinned:_0x343f22}){super(),this['id']=_0x359981,this['createdAt']=new Date(_0x1bd65d),this['set']('title',_0x228bc2),this['set']('updatedAt',_0x4ca0ec?new Date(_0x4ca0ec):null),this['set']('pinned',_0x343f22||!0x1);}['updateTitle'](_0x41364c){this['set']('title',_0x9da630(_0x41364c)),this['updatedAt']=new Date();}['updatePinned'](_0x42489f){this['set']('pinned',_0x42489f),this['updatedAt']=new Date();}}class Aa extends pt(){['items']=[];['connector'];['group'];constructor({connector:_0x3107a9,group:_0x1742ed}){super(),this['connector']=_0x3107a9,this['group']=_0x1742ed;}async['init'](){try{const _0x5f5989=this['connector']['fetchConversations'](this['group']),_0x47dda8=await _0x5f5989['getConversations']();this['loadItems'](_0x47dda8);}catch(_0x5c79d5){this['fire']('error',{'error':_0x5c79d5,'operation':'init'});}}['addItem'](_0x47f183){this['items']['push'](_0x47f183);}async['removeItem'](_0x3f5e12){const _0x532d02=this['items']['findIndex'](_0x202e67=>_0x202e67['id']===_0x3f5e12);if(-0x1===_0x532d02)return!0x1;try{return await this['connector']['deleteConversation'](_0x3f5e12)['execute'](),this['items']['splice'](_0x532d02,0x1),this['fire']('itemRemoved',{'itemId':_0x3f5e12}),!0x0;}catch(_0x5eb743){return this['fire']('error',{'error':_0x5eb743,'operation':'removeItem','itemId':_0x3f5e12}),!0x1;}}['getItem'](_0x2264d8){return this['items']['find'](_0xc0390a=>_0xc0390a['id']===_0x2264d8);}async['updateItemTitle'](_0x13561a,_0x56569e){const _0x130054=this['getItem'](_0x13561a);if(!_0x130054)return!0x1;try{return await this['connector']['updateConversation'](_0x13561a,{'title':_0x56569e})['getResult'](),_0x130054['updateTitle'](_0x56569e),this['fire']('itemUpdated',{'itemId':_0x13561a,'updates':{'title':_0x56569e}}),!0x0;}catch(_0x3bd5fe){return this['fire']('error',{'error':_0x3bd5fe,'operation':'updateItemTitle','itemId':_0x13561a}),!0x1;}}async['updateItemPinned'](_0x5a99c8,_0x4bd9ab){const _0x28dfd6=this['getItem'](_0x5a99c8);if(!_0x28dfd6)return!0x1;try{return await this['connector']['updateConversation'](_0x5a99c8,{'pinned':_0x4bd9ab})['getResult'](),_0x28dfd6['updatePinned'](_0x4bd9ab),this['fire']('itemUpdated',{'itemId':_0x5a99c8,'updates':{'pinned':_0x4bd9ab}}),!0x0;}catch(_0x5040b5){return this['fire']('error',{'error':_0x5040b5,'operation':'updateItemPinned','itemId':_0x5a99c8}),!0x1;}}['loadItems'](_0x36c2da){try{this['items']=[],_0x36c2da['map'](_0x5a38b8=>{this['addItem'](new _a(_0x5a38b8));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x2d9217){this['fire']('error',{'error':_0x2d9217,'operation':'loadItems'});}}['getItems'](_0x30ac8b={}){const _0x48533d=void 0x0!==_0x30ac8b['pinned']&&_0x30ac8b['pinned'],_0x319feb=_0x30ac8b['from']?new Date(_0x30ac8b['from']['getFullYear'](),_0x30ac8b['from']['getMonth'](),_0x30ac8b['from']['getDate']()):null,_0x3edf47=_0x30ac8b['to']?new Date(_0x30ac8b['to']['getFullYear'](),_0x30ac8b['to']['getMonth'](),_0x30ac8b['to']['getDate']()):null;return this['items']['filter'](_0x2e64d9=>{if(_0x2e64d9['pinned']!==_0x48533d)return!0x1;if(_0x3edf47){const _0x387300=new Date(_0x2e64d9['createdAt']['getFullYear'](),_0x2e64d9['createdAt']['getMonth'](),_0x2e64d9['createdAt']['getDate']());return _0x319feb?_0x319feb['getTime']()===_0x3edf47['getTime']()?_0x387300['getTime']()===_0x319feb['getTime']():_0x387300<_0x3edf47&&_0x387300>=_0x319feb:_0x387300<_0x3edf47;}return!0x0;});}}class ga extends _0x4c168b{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[ls,Js,da,cs];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](ls),this['_aiChatHistoryUi']=this['context']['plugins']['get'](da),this['_aiChatController']=this['context']['plugins']['get'](Js);const _0x594263=this['context']['plugins']['get'](cs);try{const _0x3a9d08=this['_aiChatController']['getGroupId']();this['history']=new Aa({'connector':this['_aiConnector'],'group':_0x3a9d08}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x4c45d3,_0x5e2107)=>{this['_setItemLoading'](_0x5e2107['id'],'remove'),this['_handleRemove'](_0x5e2107['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x1adc06,_0xd34bfa)=>{this['_setItemLoading'](_0xd34bfa['id'],'rename'),this['_handleEditTitle'](_0xd34bfa['id'],_0xd34bfa['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x35ccfe,_0x53dd8b)=>{void 0x0!==_0x53dd8b['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x53dd8b['itemId'],_0x53dd8b['updates']['title']),void 0x0!==_0x53dd8b['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x53dd8b['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x4f8cad,_0x25f345)=>{this['_aiChatController']['_handleRemovedConversation'](_0x25f345['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x25f345['itemId']),this['_clearItemLoading'](_0x25f345['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x3c5d3e,_0x4a2394)=>{this['_handleHistoryErrorUI'](_0x4a2394['error'],_0x4a2394['operation'],_0x4a2394['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x3cd202,_0x358111)=>{this['_handleSelectConversation'](_0x358111['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x9fe41a,_0x5689a7)=>{const _0x59c478=_0x5689a7['pinned']?'pin':'unpin';this['_setItemLoading'](_0x5689a7['id'],_0x59c478),this['_handleTogglePin'](_0x5689a7['id'],_0x5689a7['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x594263['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x594263['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x594263,'resizedTabs',(_0x19a09a,_0xfd38c6)=>{this['_setIsMaximized'](_0xfd38c6);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x594263['resize']();});}catch(_0x3c2095){this['_handleHistoryErrorUI'](_0x3c2095,'init');}}async['_handleEditTitle'](_0x2b245f,_0x4677eb){await this['history']['updateItemTitle'](_0x2b245f,_0x4677eb);}async['_handleTogglePin'](_0x2b9819,_0x56cadf){await this['history']['updateItemPinned'](_0x2b9819,_0x56cadf);}async['_handleRemove'](_0x30f50f){await this['history']['removeItem'](_0x30f50f);}async['_handleSelectConversation'](_0x5cdeb5){await this['_aiChatController']['loadConversation'](_0x5cdeb5);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x235fea=this['_aiChatController']['activeConversation']?.['id'],_0x417b5e=this['_getCategorizedItems']()['map'](_0x47200a=>({'title':_0x47200a['title'],'items':_0x47200a['items']['map'](_0x1f64bc=>({'id':_0x1f64bc['id'],'title':_0x1f64bc['title']||us(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x1f64bc['createdAt'])['toLocaleDateString'](),'active':_0x1f64bc['id']===_0x235fea,'pinned':_0x1f64bc['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x417b5e);}['_setItemLoading'](_0x2acdc0,_0x267ed1){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x2acdc0,_0x267ed1,!0x0);}['_clearItemLoading'](_0x32df15){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x32df15,null,!0x1);}['_handleHistoryErrorUI'](_0xb75895,_0x3a1672,_0x58f7c0){const _0xb2ef1e=this['_generateErrorMessage'](_0x3a1672,_0x58f7c0);this['_aiChatHistoryUi']['showError'](_0xb2ef1e),_0x58f7c0&&this['_clearItemLoading'](_0x58f7c0),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0xcef2a8,_0x2ca315){const _0x4aa00e=_0x2ca315?this['history']['getItem'](_0x2ca315):null,_0x40e2d5=_0x4aa00e?.['title']||us(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0xcef2a8){case'updateItemTitle':return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x40e2d5);case'updateItemPinned':{const _0x4f6d4c=us(this['context']['locale'],_0x4aa00e?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x4f6d4c,_0x40e2d5]);}case'removeItem':return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x40e2d5);case'init':case'loadItems':return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x3b6bf2=new Date(),_0x52ada7=new Date(_0x3b6bf2['getFullYear'](),_0x3b6bf2['getMonth'](),_0x3b6bf2['getDate']()),_0x560078=new Date(_0x52ada7);_0x560078['setDate'](_0x560078['getDate']()-0x1);const _0x13fdf7=new Date(_0x52ada7);_0x13fdf7['setDate'](_0x13fdf7['getDate']()-0xe);const _0x317837=this['history']['getItems']({'pinned':!0x0}),_0x5e873c=this['history']['getItems']({'from':_0x52ada7,'to':_0x52ada7}),_0x5c30f1=this['history']['getItems']({'from':_0x560078,'to':_0x560078}),_0x1cc7c9=this['history']['getItems']({'from':_0x13fdf7,'to':_0x560078}),_0x8931c7=this['history']['getItems']({'to':_0x13fdf7}),_0x39b792=[];return _0x317837['length']>0x0&&_0x39b792['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x317837}),_0x5e873c['length']>0x0&&_0x39b792['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x5e873c}),_0x5c30f1['length']>0x0&&_0x39b792['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x5c30f1}),_0x1cc7c9['length']>0x0&&_0x39b792['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x1cc7c9}),_0x8931c7['length']>0x0&&_0x39b792['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x8931c7}),_0x39b792;}['_setIsMaximized'](_0x12d333){this['_aiChatHistoryUi']['setIsMaximized'](_0x12d333);}}class Ia extends _0x4c168b{static get['requires'](){return[ga,da];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ea extends _0x4c168b{static get['requires'](){return[Js,tn,aa,Ia];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1b63ab){super(_0x1b63ab),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[],'alwaysAddSelection':!0x1}),this['context']['config']['define']('ai.chat.initialConversation','new');}}class pa extends Nt{['id'];constructor(_0x18d3ae,_0x3b2865){super(_0x18d3ae);const {id:_0x26b95d,type:_0x16f7f2,icon:_0x30f5}=_0x3b2865;this['id']=_0x26b95d,this['set']({'label':_0x3b2865['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x3b2865['id']}}),_0x30f5?this['icon']=_0x30f5:'chat'===_0x16f7f2?this['icon']=_0x32ee8b:'review'===_0x16f7f2?this['icon']=_0x30b44c:'translate'===_0x16f7f2&&(this['icon']=_0x27d1e6);}}class Ta extends vt{['listView'];constructor(_0x5ba0bb,_0xbbbb1a){super(_0x5ba0bb);const _0x728521=_0xbbbb1a['map'](_0x5475bf=>{const _0xb3c8a9=new Ht(this['locale']),_0x352c4d=new pa(this['locale'],_0x5475bf);return _0xb3c8a9['children']['add'](_0x352c4d),_0x352c4d['delegate']('execute')['to'](this),_0xb3c8a9;});this['listView']=new Dt(this['locale']),this['listView']['items']['addMany'](_0x728521),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const ma='chat-shortcuts';var Ca=function(_0x2eff3){return _0x2eff3['CHAT']='chat',_0x2eff3['REVIEW']='review',_0x2eff3['TRANSLATE']='translate',_0x2eff3;}({});class wa extends _0x4c168b{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[aa];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](aa),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x83b63=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x83b63['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x83b63,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x28d97d=Object['values'](Ca);this['_shortcuts']['forEach'](_0x5c1e87=>{let _0x212a88=!0x0;if(_0x5c1e87['id']&&_0x5c1e87['label']&&_0x28d97d['includes'](_0x5c1e87['type'])?'chat'===_0x5c1e87['type']&&(_0x212a88='string'==typeof _0x5c1e87['prompt']):_0x212a88=!0x1,!_0x212a88)throw new ht('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x5c1e87});});}['_injectShortcuts'](){const _0x15f03a=this['context']['plugins']['get'](aa);this['_shortcutsView']=new Ta(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x15f03a['addFeedItemCustomElement'](this['_shortcutsView']['element'],ma),this['_shortcutsView']['on']('execute',_0x134c8e=>{const _0x530446=_0x134c8e['source']['id'];this['_executeShortcut'](_0x530446);});}['_removeShortcuts'](){const _0x5aa764=this['context']['plugins']['get'](aa);_0x5aa764['hasFeedItem'](ma)&&_0x5aa764['removeFeedItem'](ma),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x2b835b){const _0x470712=this['_shortcuts']['find'](_0x8afc70=>_0x8afc70['id']===_0x2b835b),_0x4597be=_0x470712['type'];'chat'===_0x4597be?this['_runChatShortcut'](_0x470712):'review'===_0x4597be?_0x470712['commandId']?this['_runReviewShortcut'](_0x470712):this['_switchTab']('reviewMode'):'translate'===_0x4597be&&(_0x470712['language']?this['_runTranslateShortcut'](_0x470712):this['_switchTab']('translate'));}['_switchTab'](_0x2acd40){if(!this['context']['plugins']['has']('AITabs'))throw new ht('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x2acd40});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x2acd40);}async['_runChatShortcut']({prompt:_0x3b883b,draftMode:_0x301037,useWebSearch:_0xe421ff=!0x1,useReasoning:_0x14f660=!0x1,model:_0x328730}){const _0x5f571e=this['context']['plugins']['get']('AIChatController'),_0x521db3=_0x5f571e['activeConversation'];let _0x3c437;_0x3c437=_0x328730?await _0x521db3['chatModels']['getModel'](_0x328730):await _0x521db3['chatModels']['getDefault'](),_0x3c437&&await _0x521db3['setModel'](_0x3c437),_0x521db3['setWebSearch'](_0xe421ff),_0x521db3['setReasoning'](_0x14f660),_0x5f571e['addCurrentDocumentToChatContext'](),_0x301037?(this['_aiChatUI']['setPromptInputValue'](_0x3b883b),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x5f571e['sendMessage']({'message':_0x3b883b});}['_runReviewShortcut']({commandId:_0x495cc6,model:_0x4a9989,prompt:_0x3ac5d0,params:_0x542f01}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new ht('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x42ce03={'id':_0x495cc6,'isCustom':'custom'===_0x495cc6};_0x4a9989&&_0x3ac5d0&&(_0x42ce03['args']={'model':_0x4a9989,'prompt':_0x3ac5d0}),_0x542f01&&(_0x42ce03['params']=_0x542f01),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x42ce03);}['_runTranslateShortcut']({language:_0x7adb87}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new ht('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x7adb87,'args':{'language':_0x7adb87}});}}class fa extends _0x231d2e{constructor(_0x4dc7ee){super(_0x4dc7ee);const _0x1b4709=_0x4dc7ee['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x1b4709,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x4408e1=this['editor']['plugins']['get']('AITabs')['view'];_0x4408e1['isVisible']=!_0x4408e1['isVisible'];}}class Sa extends _0x230b74{static get['requires'](){return[cs];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x2d490c=this['editor'];_0x2d490c['commands']['add']('toggleAi',new fa(_0x2d490c)),_0x2d490c['ui']['componentFactory']['add']('toggleAi',()=>{const _0x37b316=this['_createAIUIButton'](Nt);return _0x37b316['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x37b316;}),_0x2d490c['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x5a5b6f=this['_createAIUIButton'](Wt);return _0x5a5b6f['set']({'role':'menuitemcheckbox'}),_0x5a5b6f;});}['_createAIUIButton'](_0x217c5c){const _0x52dcc2=this['editor'],_0xdfeb45=_0x52dcc2['commands']['get']('toggleAi'),_0x29b2ba=new _0x217c5c(_0x52dcc2['locale']);return _0x29b2ba['set']({'label':us(_0x52dcc2['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x169e26,'isToggleable':!0x0}),_0x29b2ba['bind']('isEnabled')['to'](_0xdfeb45),_0x29b2ba['bind']('isOn')['to'](_0xdfeb45,'value',_0xc14ebf=>!!_0xc14ebf),this['listenTo'](_0x29b2ba,'execute',()=>{_0xdfeb45['execute']();}),_0x29b2ba;}}const ba=['applySuggestion','insertSuggestion','showNext','showPrevious'];class Ra extends vt{['_errorView'];constructor(_0x44f661){super(_0x44f661),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x46aec6){this['showError'](_0x46aec6);}['showError'](_0x291daf){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x291daf,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x340ad0=new vt(this['locale']),_0x90cda7=new vt(this['locale']);return _0x90cda7['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x340ad0['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x554f5f=>!_0x554f5f)]},'children':[_0x90cda7]}),_0x340ad0;}}const Oa=0xa;class ka extends _0x4c168b{static get['requires'](){return[tn];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_isUpdatingMarkers']=!0x1;['open'](_0x24ccdb){const {id:_0x30dc33}=this['_currentConfig']??{};this['_currentConfig']=_0x24ccdb;const {id:_0x3b25de}=this['_currentConfig'];this['isOpen']&&_0x30dc33===_0x3b25de?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x60d8f4=Xs(this['context'])['plugins']['get']('Dialog');_0x60d8f4['isOpen']&&this['_currentConfig']&&_0x60d8f4['id']===this['_currentConfig']['id']&&_0x60d8f4['hide']();}['_updateDialog'](){const _0x54c302=Xs(this['context'])['plugins']['get']('Dialog'),{icon:_0xc1ed23,title:_0x4d9e08}=this['_currentConfig'];_0x54c302['view']?.['headerView']&&(_0x54c302['view']['headerView']['label']=_0x4d9e08,_0x54c302['view']['headerView']['iconView']&&_0xc1ed23&&(_0x54c302['view']['headerView']['iconView']['content']=_0xc1ed23)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x54c302['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](tn)['showFakeVisualSelection']({'ranges':this['_currentConfig']['ranges'],'id':'balloon','priority':0x64}),window['getSelection']()?.['removeAllRanges']();}['_hideFakeVisualSelection'](){this['context']['plugins']['get'](tn)['hideFakeVisualSelection']('balloon');}['_showDialog'](){const _0x3d7c9b=Xs(this['context'])['plugins']['get']('Dialog'),{id:_0x30c3c2,title:_0x562638,icon:_0x3d7703,class:_0x30f341,mainView:_0x4a4274}=this['_currentConfig'];_0x4a4274['delegate'](...ba)['to'](this),_0x3d7c9b['show']({'title':_0x562638,'icon':_0x3d7703,'hasCloseButton':!0x0,'id':_0x30c3c2,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x30f341||''),'content':_0x4a4274,'onShow':_0x107702=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x5e4138=this['_getSelectionElements']();_0x5e4138&&_0x5e4138[0x0]&&Ct({'target':_0x5e4138[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x107702['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x30c3c2});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x30c3c2}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x3551f1,_0x596793){if(!_0x596793)return null;const _0x910ca1=this['_getSelectionElements']();if(!_0x910ca1||0x0===_0x910ca1['length'])return{'left':Math['round'](_0x596793['left']+_0x596793['width']/0x2-_0x3551f1['width']/0x2),'top':Math['round'](_0x596793['top']+_0x596793['height']/0x2-_0x3551f1['height']/0x2)};const _0x1853e2=Math['round'](_0x596793['left']+_0x596793['width']/0x2-_0x3551f1['width']/0x2),_0x2a3037=_0x910ca1['map'](_0x2d7714=>new dt(_0x2d7714)),_0x5725f1=_0x3551f1['height'];return{'left':_0x1853e2,'top':this['_calculateOptimalTopPosition'](_0x2a3037,_0x5725f1,_0x596793)};}['_calculateOptimalTopPosition'](_0x52c2a3,_0x51a13a,_0x4cc181){const _0x3615ec=new dt(lt['window']),_0x171046=_0x52c2a3['map'](_0x38b298=>_0x38b298['getVisible']())['filter'](_0x234092=>_0x234092),_0x49f047=dt['getBoundingRect'](_0x171046);if(!_0x49f047)return Math['round'](_0x4cc181['top']+_0x4cc181['height']/0x2);const _0x3e697e=_0x3615ec['getIntersection'](_0x49f047);if(!_0x3e697e)return Math['round'](_0x4cc181['top']+_0x4cc181['height']/0x2);const _0x1e7b0a=_0x4cc181['getVisible'](),_0x398b22=_0x1e7b0a&&_0x49f047['height']>_0x1e7b0a['height'],_0x411bce=_0x3e697e['top'],_0x428b15=_0x3e697e['bottom'];if(_0x398b22){const _0x462fac=(_0x1e7b0a||_0x3615ec)['height']/0x2-_0x51a13a/0x2,_0x3a5cf8=_0x411bce-Oa-_0x4cc181['top'],_0x480493=_0x4cc181['bottom']-_0x428b15-Oa;return _0x3a5cf8>=_0x51a13a?Math['max'](Oa,_0x411bce-_0x51a13a-Oa):_0x480493>=_0x51a13a?_0x428b15+Oa:Math['max'](Oa,_0x462fac);}const _0x2b8fc5=_0x411bce-_0x51a13a,_0x156816=_0x4cc181['bottom']-_0x428b15-Oa,_0x1f3a3a=_0x411bce-Oa-_0x4cc181['top'];let _0x4b79d9;if(_0x156816>=_0x51a13a)_0x4b79d9=_0x428b15+Oa;else{if(_0x1f3a3a>=_0x51a13a)_0x4b79d9=_0x2b8fc5-Oa;else _0x4b79d9=_0x411bce+_0x49f047['height']/0x2-_0x51a13a/0x2;}return _0x4b79d9;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x58b8b2=Xs(this['context']);this['listenTo'](_0x58b8b2['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x1d1db8,data:{newRange:_0x5abf27}}of _0x58b8b2['model']['document']['differ']['getChangedMarkers']())if(_0x1d1db8['startsWith'](Zs+':')&&(_0x5abf27&&(_0x5abf27['start']['isEqual'](_0x5abf27['end'])||'$graveyard'==_0x5abf27['root']['rootName'])||null==_0x5abf27)){const _0x20b7f0=us(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x20b7f0),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x825ce8=Xs(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x825ce8['model']['document']);}['_getSelectionElements'](){const _0x49e8ee=Xs(this['context']);return _0x538ba1(_0x49e8ee['editing'],[..._0x49e8ee['model']['markers']['getMarkersGroup']('ai-selection'),..._0x49e8ee['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class Na extends kt{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x4ebc3e,_0x5eb9a2={}){super(_0x4ebc3e),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x5eb9a2};const _0x516333=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x516333?'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'](_0x35936d){this['showChangesButton']['isEnabled']=_0x35936d;}['_setupRatingButtons'](){this['likeButton']=new Nt(this['locale']),this['likeButton']['set']({'icon':_0x22fc84,'label':us(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'class':As,'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new Nt(this['locale']),this['dislikeButton']['set']({'icon':_0x195a3e,'label':us(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'class':As,'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new Nt(this['locale']),this['copyButton']['set']({'icon':_0x3043e5,'label':us(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button\x20'+As,'tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0xb7f074=new xt();_0xb7f074['set']({'content':_0x39bec0}),_0xb7f074['extendTemplate']({'attributes':{'class':['ck-ai-mini-toolbar-copy-button__check-mark']}}),this['copyButton']['on']('execute',()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20ck-ai-mini-toolbar-copy-button_copied\x20'+As,setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20'+As;},0x7d0);}),this['copyButton']['children']['add'](_0xb7f074);}['_setupShowChangesButton'](){this['showChangesButton']=new Nt(this['locale']),this['showChangesButton']['set']({'icon':_0x5a006f,'label':us(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':As}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x246cd3=>_0x246cd3?_0x50003b:_0x5a006f),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class va extends Ra{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x43b885,_0x27d127){super(_0x43b885);const _0x32841b=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new At(),this['_keystrokes']=new gt(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x27d127,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new pn(_0x43b885),this['_partToolbarView']=new gn(_0x43b885,_0x27d127['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x27d127),this['_stateView']=new _n(_0x43b885),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new Na(_0x43b885,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new ya(_0x43b885,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x44a717,_0x5457dc,_0x16cf88,_0x39a4d3)=>{let _0x15a36b,_0x37cd9e;'pending'===_0x39a4d3?(_0x15a36b=this['_partToolbarView'],_0x37cd9e=this['_stateView']):(_0x15a36b=this['_stateView'],_0x37cd9e=this['_partToolbarView']),this['_stateView']['setState'](_0x16cf88),_0x15a36b['isVisible']=!0x1,_0x37cd9e['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x32841b['to']('_state',_0x1708e1=>'ck-ai-chat-balloon-main_state_'+_0x1708e1)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x27d127);});}['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'](_0x52e85d){_0x52e85d?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x52e85d);}['setState'](_0x433a9d){this['_state']=_0x433a9d;}['showError'](_0xebe7d0){super['showError'](_0xebe7d0),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x42d1a7){super['showBlockingError'](_0x42d1a7),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x423122){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x423122;}['togglePartToolbarEnabled'](_0x343fad){this['_partToolbarView']['isEnabled']=_0x343fad;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x309ffa,showSuggestButton:_0x37dfcd}){_0x309ffa=_0x309ffa&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x37dfcd=_0x37dfcd&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x309ffa,'showSuggestButton':_0x37dfcd});}['_createNextButtonView'](){const _0x5a0efb=new Nt(this['locale']);return _0x5a0efb['set']({'icon':_0x239174,'label':us(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x5a0efb['on']('execute',()=>{this['fire']('showNext');}),_0x5a0efb;}['_createPreviousButtonView'](){const _0x3d0658=new Nt(this['locale']);return _0x3d0658['set']({'icon':_0x20d9ed,'label':us(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x3d0658['on']('execute',()=>{this['fire']('showPrevious');}),_0x3d0658;}}class ya extends vt{constructor(_0x4a0dd5,_0x5d16a0){super(_0x4a0dd5),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x5d16a0});}}class xa extends _0x230b74{static get['requires'](){return[Bt,ka];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x4c006e){super(_0x4c006e),this['set']('showDiff',!0x1);}['open'](_0x3363f1){const _0x575a21=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x575a21['plugins']['get']('AIBalloon')['open']({..._0x3363f1,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x3363f1['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x3363f1['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0xc1838f){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0xc1838f);}['setState'](_0x2f3895){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x2f3895);}['_createChatBalloonView'](){const _0x23fc3c=this['editor'],_0x29e391=_0x23fc3c['plugins']['get']('AIBalloon'),_0x18a0d2=_0x23fc3c['commands']['get']('trackChanges');let _0xbf98e3=_0x23fc3c['config']['get']('ai.availableReplyActions')||[...wn];_0x23fc3c['plugins']['has']('TrackChanges')||(_0xbf98e3=_0xbf98e3['filter'](_0x53fe98=>'insertSuggestion'!=_0x53fe98));const _0x164dc2=new va(_0x23fc3c['locale'],{'availableActions':_0xbf98e3,'showApplyButton':!0x0,'showSuggestButton':!!_0x18a0d2});return _0x164dc2['bind']('showDiff')['to'](this),_0x164dc2['delegate'](...en)['to'](this),_0x164dc2['delegate']('showPrevious','showNext')['to'](this),_0x29e391['delegate']('dialogClosed')['to'](this),_0x164dc2['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x164dc2['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x164dc2['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x18a0d2&&_0x164dc2['bind']('isTrackChangesOn')['to'](_0x18a0d2,'value'),_0x164dc2['render'](),_0x164dc2;}['_toggleRotatorButtonsInDialogHeader'](_0x20b4c6){const _0x51b39e=this['editor'],_0x5f4612=_0x51b39e['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x20b4c6),_0x5f4612['has'](this['_chatBalloonView']['previousButtonView'])||(_0x5f4612['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x51b39e['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x5f4612['remove'](this['_chatBalloonView']['previousButtonView']),_0x5f4612['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class La extends _0x230b74{static get['requires'](){return[Sa,xa,_0x3c542e];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Da(_0x44eb7b){const {editor:_0x432183,action:_0x225453,withText:_0x1d5761=!0x1,withIcon:_0x3e66ca=!0x0,isInDropdown:_0x5c5261=!0x0,shouldPreventFocus:_0x4f6116=!0x1}=_0x44eb7b;return()=>{const _0x30e521=_0x432183['locale'],_0x12d188=new Nt(_0x30e521),_0x985db4=_0x12d188['bindTemplate'];_0x5c5261&&_0x12d188['extendTemplate']({'on':{'mouseenter':_0x985db4['to'](()=>{_0x4f6116&&_0x4f6116()||_0x12d188['focus']();})}});const _0x15f641=_0x225453['icon']??_0x225453['parent']?.['icon'];return _0x12d188['set']({'label':_0x225453['label'],'withText':_0x1d5761,'role':'menuitem','icon':_0x3e66ca?_0x15f641??_0x519088:void 0x0,'tooltip':!_0x1d5761,'class':'ck-ai-quick-actions-button','isEnabled':_0x225453['isEnabled']}),_0x12d188['on']('execute',()=>{_0x432183['editing']['view']['focus'](),_0x432183['commands']['execute']('aiQuickAction',_0x225453);}),_0x12d188;};}class Pa extends _0x32ee0a{['arrowView'];constructor(_0x5663e8,_0x43e3e6){super(_0x5663e8,_0x43e3e6);const _0x19a0c5=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',_0x3f7a3b=>String(_0x3f7a3b)),'data-cke-tooltip-disabled':_0x19a0c5['to']('isOn')},'on':{'mouseenter':_0x19a0c5['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0xb4f0d0=new xt();return _0xb4f0d0['content']=_0x249f8c,_0xb4f0d0['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0xb4f0d0;}}class Ha extends Dt{['_allListItems'];['_allSearchableItems'];constructor(_0x3fbda5,_0x217731,_0xc437cc){super(_0x3fbda5),this['_allListItems']=_0x217731,this['_allSearchableItems']=_0xc437cc;}['filter'](_0xfce56e){if(!_0xfce56e)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x2aa4a5=_0xfce56e['source']['toLowerCase']()['trim'](),_0x2907c5=this['_allSearchableItems']['filter'](_0x4d02a2=>(_0x4d02a2['groupLabel']?_0x4d02a2['label']+'\x20('+_0x4d02a2['groupLabel']+')':_0x4d02a2['label'])['toLowerCase']()['includes'](_0x2aa4a5));return this['items']['clear'](),this['items']['addMany'](_0x2907c5['sort']((_0x53d0c5,_0x242986)=>{const _0x2f04ab=_0x53d0c5['groupLabel'],_0x4b3b1e=_0x242986['groupLabel'];return _0x2f04ab||_0x4b3b1e?_0x2f04ab?0x1:-0x1:0x0;})['map'](_0x49e032=>_0x49e032['item'])),this['_highlightQuery'](_0x2aa4a5,_0x2907c5),{'resultsCount':_0x2907c5['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x522e61,_0x1fefb6){if(!_0x522e61)return;const _0x304d62=new RegExp(_0x81a2b5(_0x522e61),'gi');_0x1fefb6['forEach'](_0x694483=>{_0x694483['highlightViews']&&_0x694483['highlightViews']['forEach'](_0x5c2699=>{'function'==typeof _0x5c2699['highlightText']&&_0x5c2699['highlightText'](_0x304d62);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x3dab80=>{_0x3dab80['highlightViews']&&_0x3dab80['highlightViews']['forEach'](_0x2c904b=>{'function'==typeof _0x2c904b['highlightText']&&_0x2c904b['highlightText'](null);});});}}const Ma='menu',Ua='menuitem';class Va extends vt{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x11f577,_0x26d1e1,_0x9fe702,_0x41734f,_0x36b27f=!0x1){const _0x4092fc=_0x11f577['locale'];super(_0x4092fc),this['_bodyCollection']=_0x41734f,this['_hasSearch']=_0x36b27f;const _0x5aacba=this['_createListItems'](_0x11f577,_0x26d1e1,_0x9fe702);this['optionsListView']=new Ha(_0x4092fc,_0x5aacba,this['_allSearchableItems']),this['optionsListView']['role']=Ma,this['optionsListView']['items']['addMany'](_0x5aacba),this['focusTracker']=new At(),this['keystrokes']=new gt(),_0x36b27f&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x5aacba,this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x36b27f&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x9ea79c=_0x36b27f&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x43aab0(_0x9ea79c),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x4092fc['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x2e6f71(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':us(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':us(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x2b6880=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x2b6880);}['_createListItems'](_0x2dbe16,_0x46bac6,_0x1e5443){const _0x4108a3=new _0x43aab0();return _0x46bac6['forEach'](_0x19aefc=>{if('actions'in _0x19aefc){const {listItem:_0xb6e837}=this['_createActionGroupButton'](_0x2dbe16,_0x19aefc,_0x1e5443);_0x4108a3['add'](_0xb6e837),_0x19aefc['actions']['forEach'](_0x2143ab=>{this['_createActionButton'](_0x2dbe16,_0x2143ab,_0x19aefc['label'],_0x19aefc['icon']);const {listItem:_0x49d5bb,highlightViews:_0x56fed2}=this['_createSearchResultActionButton'](_0x2dbe16,_0x2143ab,_0x19aefc['label'],_0x19aefc['icon']);this['_allSearchableItems']['push']({'item':_0x49d5bb,'label':_0x2143ab['label'],'groupLabel':_0x19aefc['label'],'highlightViews':_0x56fed2});});}else{const {listItem:_0x5b8d2b}=this['_createActionButton'](_0x2dbe16,_0x19aefc);_0x4108a3['add'](_0x5b8d2b);const _0x5e285a=_0x5b8d2b['children']['first'];if(_0x5e285a){const {listItem:_0x545d5f,highlightViews:_0x266da1}=this['_createSearchResultActionButton'](_0x2dbe16,_0x19aefc);this['_allSearchableItems']['push']({'item':_0x545d5f,'label':_0x5e285a['label']||'','highlightViews':_0x266da1});}}}),_0x4108a3;}['_createActionButton'](_0x24a060,_0x40e237,_0x333ec2,_0x3e6f09){const _0x4f3bcc=new Ht(this['locale']);if(_0x333ec2&&_0x3e6f09){const _0x37d5ce=new Nt(this['locale']),_0x4b1b7d=_0x37d5ce['bindTemplate'],_0x6d2ee4=new _0x5c2b37();_0x6d2ee4['text']=_0x40e237['label'];const _0x435cea=new _0x5c2b37();_0x435cea['text']=_0x333ec2;const _0x29fa37=new xt();_0x29fa37['content']=_0x3e6f09,_0x29fa37['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x1ec372=new vt(this['locale']);_0x1ec372['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x2b6d29=new vt(this['locale']);return _0x2b6d29['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x37d5ce['set']({'label':_0x40e237['label']+'\x20('+_0x333ec2+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x37d5ce['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':[_0x6d2ee4,_0x1ec372,_0x29fa37,_0x435cea,_0x2b6d29],'on':{'mouseenter':_0x4b1b7d['to'](()=>{this['_isSearchFocused']()||_0x37d5ce['focus']();}),'click':_0x4b1b7d['to'](()=>{_0x37d5ce['fire']('execute');})}}),_0x37d5ce['on']('execute',()=>{_0x24a060['editing']['view']['focus'](),_0x24a060['commands']['execute']('aiQuickAction',_0x40e237);}),_0x4f3bcc['children']['add'](_0x37d5ce),{'listItem':_0x4f3bcc,'highlightViews':[_0x6d2ee4,_0x435cea]};}{const _0x5e53a2=new _0x5628a0(),_0x16db33=new Nt(this['locale'],_0x5e53a2),_0x4995d2=_0x16db33['bindTemplate'],_0x50e1b1=_0x40e237['icon']??_0x40e237['parent']?.['icon'],_0x9f8f37=void 0x0!==_0x40e237['icon'];return _0x16db33['set']({'label':_0x40e237['label'],'withText':!0x0,'role':'menuitem','icon':_0x9f8f37?_0x50e1b1??_0x519088:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x16db33['extendTemplate']({'on':{'mouseenter':_0x4995d2['to'](()=>{this['_isSearchFocused']()||_0x16db33['focus']();})}}),_0x16db33['on']('execute',()=>{_0x24a060['editing']['view']['focus'](),_0x24a060['commands']['execute']('aiQuickAction',_0x40e237);}),_0x4f3bcc['children']['add'](_0x16db33),{'listItem':_0x4f3bcc,'highlightViews':[_0x5e53a2]};}}['_createSearchResultActionButton'](_0x58a5e5,_0x34567a,_0x25797a,_0x30d0e1){return _0x25797a&&_0x30d0e1?this['_createSearchResultGroupedActionButton'](_0x58a5e5,_0x34567a,_0x25797a,_0x30d0e1):this['_createSearchResultIndividualActionButton'](_0x58a5e5,_0x34567a);}['_createSearchResultGroupedActionButton'](_0x46bd04,_0x3a587f,_0x434a23,_0x56b01f){const _0x3f549a=new Ht(this['locale']),_0x57ef8a=new Nt(this['locale']),_0x5eaa2f=_0x57ef8a['bindTemplate'],{view:_0x1a213f,highlightView:_0x1a30f3}=this['_createSearchResultGroupRow'](_0x434a23,_0x56b01f),{view:_0x40f41a,highlightView:_0x1ce702}=this['_createSearchResultActionRow'](_0x3a587f['label']),_0x5713a4=this['_createSearchResultContentView'](_0x1a213f,_0x40f41a);return _0x57ef8a['set']({'label':_0x3a587f['label'],'withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button\x20ck-ai-quick-actions-search-result-button_with-group','tooltip':!0x1}),_0x57ef8a['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':[_0x5713a4],'on':{'mouseenter':_0x5eaa2f['to'](()=>{this['_isSearchFocused']()||_0x57ef8a['focus']();}),'click':_0x5eaa2f['to'](()=>{this['_handleSearchResultButtonClick'](_0x57ef8a);})}}),this['_setupActionButtonExecution'](_0x57ef8a,_0x46bd04,_0x3a587f),_0x3f549a['children']['add'](_0x57ef8a),{'listItem':_0x3f549a,'highlightViews':[_0x1a30f3,_0x1ce702]};}['_createSearchResultIndividualActionButton'](_0x4d3073,_0x1c0d49){const _0x4e928a=new Ht(this['locale']),_0x58c10b=new _0x5628a0(),_0x4313dc=new Nt(this['locale'],_0x58c10b),_0x4f13b0=_0x4313dc['bindTemplate'];return _0x4313dc['set']({'label':_0x1c0d49['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x4313dc['extendTemplate']({'on':{'mouseenter':_0x4f13b0['to'](()=>{this['_isSearchFocused']()||_0x4313dc['focus']();})}}),this['_setupActionButtonExecution'](_0x4313dc,_0x4d3073,_0x1c0d49),_0x4e928a['children']['add'](_0x4313dc),{'listItem':_0x4e928a,'highlightViews':[_0x58c10b]};}['_createSearchResultGroupRow'](_0x1d666a,_0x339567){const _0x4a12de=new vt(this['locale']),_0x5d6891=new xt();_0x5d6891['content']=_0x339567,_0x5d6891['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x375631=new _0x5c2b37();return _0x375631['text']=_0x1d666a,_0x4a12de['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x5d6891,_0x375631]}),{'view':_0x4a12de,'highlightView':_0x375631};}['_createSearchResultActionRow'](_0x1f5837){const _0x3cefc6=new vt(this['locale']),_0x32d2c3=new _0x5c2b37();return _0x32d2c3['text']=_0x1f5837,_0x3cefc6['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x32d2c3]}),{'view':_0x3cefc6,'highlightView':_0x32d2c3};}['_createSearchResultContentView'](_0x5b8ab2,_0x499336){const _0x2ae29b=new vt(this['locale']);return _0x2ae29b['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x5b8ab2,_0x499336]}),_0x2ae29b;}['_setupActionButtonExecution'](_0x1a9d0e,_0x577ac6,_0x3641d0){_0x1a9d0e['on']('execute',()=>{_0x577ac6['editing']['view']['focus'](),_0x577ac6['commands']['execute']('aiQuickAction',_0x3641d0);});}['_createActionGroupButton'](_0x4f6d5c,_0x13c78a,_0x71e9d3){const _0x35e7d1=new Ht(this['locale']),_0xb0217d=new _0x5628a0(),_0x80f8ca=new Pa(this['locale'],_0xb0217d),_0x385826=_0x80f8ca['bindTemplate'],_0x29cc96=this['_getPanelKeystroke'](_0x71e9d3),_0xea0247=this['_createGroupActionsList'](_0x4f6d5c,_0x13c78a['actions'],_0x71e9d3);_0x80f8ca['set']({'label':_0x13c78a['label'],'withText':!0x0,'role':Ua,'icon':_0x13c78a['icon']??_0x519088,'isEnabled':_0x13c78a['actions']['some'](_0x3b931b=>_0x3b931b['isEnabled'])}),_0x80f8ca['extendTemplate']({'on':{'mouseenter':_0x385826['to'](()=>{this['_isSearchFocused']()||_0x80f8ca['focus']();})}});const _0x38b0bc=new Xt(this['locale']);return _0x38b0bc['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x385826['to'](_0x3c787b=>{this['_handlePanelKeydown'](_0x3c787b,_0x29cc96,_0x80f8ca,_0x38b0bc);})}}),_0x80f8ca['bind']('isOn')['to'](_0x38b0bc,'isVisible'),this['_bodyCollection']['add'](_0x38b0bc),_0x38b0bc['content']['add'](_0xea0247),this['_setupGroupMenuBehavior'](_0x80f8ca,_0x38b0bc),_0x35e7d1['children']['add'](_0x80f8ca),{'listItem':_0x35e7d1,'highlightView':_0xb0217d};}['_createGroupActionsList'](_0x3d9dcb,_0x2349f3,_0x4a4cba){const _0x3e3be3=new Dt(this['locale']);return _0x3e3be3['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x2349f3['forEach'](_0xc6c4ff=>{const _0xd6478d=new Ht(this['locale']),_0x551dc2=Da({'editor':_0x3d9dcb,'action':_0xc6c4ff,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0xd6478d['children']['add'](_0x551dc2),_0x4a4cba['focusTracker']['add'](_0x551dc2),_0x3e3be3['items']['add'](_0xd6478d);}),_0x3e3be3;}['_setupGroupMenuBehavior'](_0x321a46,_0x4f0d7e){const _0x4936af=_0x321a46['bindTemplate'],_0x15918e=this['_getButtonKeystroke'](_0x321a46);_0x321a46['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x4936af['to'](()=>{this['_showNestedPanel'](_0x4f0d7e,_0x321a46);}),'mouseleave':_0x4936af['to'](_0x50a2de=>{const _0x50dcba=_0x50a2de['relatedTarget'];this['_isMovingToNestedMenu'](_0x50dcba,_0x4f0d7e)||this['_hideNestedPanel'](_0x4f0d7e);}),'keydown':_0x4936af['to'](_0x5f478f=>{_0x5f478f['key']==_0x15918e&&(this['_showNestedPanel'](_0x4f0d7e,_0x321a46),_0x4f0d7e['content']['get'](0x0)['focus']());})}}),_0x4f0d7e['on']('render',()=>{_0x4f0d7e['element']?.['addEventListener']('mouseleave',_0x3c27a2=>{const _0x3ea581=_0x3c27a2['relatedTarget'];_0x321a46['element']?.['contains'](_0x3ea581)||this['_isMovingToNestedMenu'](_0x3ea581,_0x4f0d7e)||this['_hideNestedPanel'](_0x4f0d7e);});});}['_showNestedPanel'](_0x584fdc,_0x25711c){this['_openNestedPanels']['forEach'](_0x2f982c=>{_0x2f982c!==_0x584fdc&&_0x2f982c['isVisible']&&_0x2f982c['hide']();}),_0x584fdc['show'](),_0x584fdc['pin']({'positions':[_0x109813['eastSouth']],'target':_0x25711c['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x584fdc);}['_hideNestedPanel'](_0x2ab5fe){_0x2ab5fe['hide'](),this['_openNestedPanels']['delete'](_0x2ab5fe);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x305184=>_0x305184['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x305307,_0x4cbc27){if(!_0x305307)return!0x1;if(_0x4cbc27['element']?.['contains'](_0x305307))return!0x0;const _0x57ca89=_0x305307;return _0x57ca89['closest']&&(null!==_0x57ca89['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x57ca89['closest']('.ck-ai-quick-actions-group-list')||null!==_0x57ca89['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'](_0x1f9827){return'rtl'===_0x1f9827['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x5b837e){return'rtl'===_0x5b837e['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x1164f4,_0x948fbc,_0x11fe7c,_0x50024c){_0x1164f4['key']==_0x948fbc&&(_0x11fe7c['focus'](),this['_hideNestedPanel'](_0x50024c));}['_handleSearchResultButtonClick'](_0x5f31f2){_0x5f31f2['fire']('execute');}}function Ba(_0x3ac8d3){const {editor:_0x3eff30,content:_0x22bf82,buttonDefinition:_0x1c006a,bodyCollection:_0x179ce2,hasSearch:_0x47cdf3=!0x1}=_0x3ac8d3;return()=>{const _0x5202e5=_0x3eff30['locale'],_0x4d65b2=Gt(_0x5202e5);_0x4d65b2['buttonView']['set']({'icon':_0x1c006a['icon']??_0x519088,'label':_0x1c006a['label'],'tooltip':!0x0}),_0x4d65b2['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x2ab4a8=new Va(_0x3eff30,_0x22bf82,_0x4d65b2,_0x179ce2,_0x47cdf3);return _0x4d65b2['panelView']['children']['add'](_0x2ab4a8),_0x47cdf3&&_0x4d65b2['on']('change:isOpen',(_0x57ada0,_0x511ba2,_0x11f47e)=>{if(_0x11f47e){if(_0x3eff30['plugins']['has']('AIEditing')){const _0x3cbbfc=_0x3eff30['plugins']['get'](tn),_0x3f85e9=_0x3eff30['model']['document']['selection'],_0x2b2195=Array['from'](_0x3f85e9['getRanges']());_0x2b2195['length']>0x0&&_0x3cbbfc['showFakeVisualSelection']({'ranges':_0x2b2195,'id':'quick-action','priority':0x14});}}else _0x3eff30['plugins']['has']('AIEditing')&&_0x3eff30['plugins']['get'](tn)['hideFakeVisualSelection']('quick-action'),_0x2ab4a8['resetSearch']();}),_0x4d65b2;};}const Ga='<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>',Fa='<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>',Ka='<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 Wa=function(_0x57c806){return _0x57c806['chat']='AIChat',_0x57c806['action']='AIActions',_0x57c806;}({});class Ya extends _0x230b74{static get['requires'](){return[_0xa65665,ls];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0xfe4519=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0xfe4519),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x489ff1){return function(_0x14f0a1){const _0x378c5e=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x14f0a1['uiLanguage']),_0x7e08f=_0x378c5e||'English',_0x390407=[{'id':'ask-ai','label':us(_0x14f0a1,'AI_QUICK_ACTIONS_ASK_AI'),'type':no['CHAT'],'icon':_0x19ca17},{'id':'chat-commands','label':us(_0x14f0a1,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0x19ca17,'actions':[{'id':'explain','label':us(_0x14f0a1,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':us(_0x14f0a1,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Ga['replace']('%0',_0x7e08f),'type':no['CHAT']},{'id':'summarize','label':us(_0x14f0a1,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':us(_0x14f0a1,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Fa['replace']('%0',_0x7e08f),'type':no['CHAT']},{'id':'highlight-key-points','label':us(_0x14f0a1,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':us(_0x14f0a1,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Ka['replace']('%0',_0x7e08f),'type':no['CHAT']}]},{'id':'improve-writing','label':us(_0x14f0a1,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':no['ACTION'],'icon':_0x1e82c5},{'id':'continue','label':us(_0x14f0a1,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':no['ACTION'],'icon':_0x333607},{'id':'fix-grammar','label':us(_0x14f0a1,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':no['ACTION'],'icon':_0xb489c4},{'id':'adjust-length','label':us(_0x14f0a1,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x44f60d,'actions':[{'id':'make-shorter','label':us(_0x14f0a1,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':no['ACTION']},{'id':'make-longer','label':us(_0x14f0a1,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':no['ACTION']}]},{'id':'change-tone','label':us(_0x14f0a1,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x321721,'actions':[{'id':'make-tone-casual','label':us(_0x14f0a1,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':no['ACTION']},{'id':'make-tone-direct','label':us(_0x14f0a1,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':no['ACTION']},{'id':'make-tone-friendly','label':us(_0x14f0a1,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':no['ACTION']},{'id':'make-tone-confident','label':us(_0x14f0a1,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':no['ACTION']},{'id':'make-tone-professional','label':us(_0x14f0a1,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':no['ACTION']}]},{'id':'translate','label':us(_0x14f0a1,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x27d1e6,'actions':[{'id':'translate-to-english','label':us(_0x14f0a1,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':no['ACTION'],'actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':us(_0x14f0a1,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':no['ACTION'],'actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':us(_0x14f0a1,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':no['ACTION'],'actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':us(_0x14f0a1,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':no['ACTION'],'actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':us(_0x14f0a1,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':no['ACTION'],'actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':us(_0x14f0a1,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':no['ACTION'],'actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':us(_0x14f0a1,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':no['ACTION'],'actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':us(_0x14f0a1,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':no['ACTION'],'actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':us(_0x14f0a1,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':no['ACTION'],'actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':us(_0x14f0a1,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':no['ACTION'],'actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':us(_0x14f0a1,'AI_QUICK_ACTIONS_OTHER'),'icon':tt,'actions':[]}];return _0x390407;}(_0x489ff1);}async['_getDefaultAndCustomActions'](){const _0x2046fd=Ya['getDefaultQuickActions'](this['editor']['locale']),_0x3458d7=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x55cb4e=[];try{_0x55cb4e=await new qs({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0x431743){const _0x4e1290=new ht('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x431743});mt(_0x4e1290['message']);}finally{const _0x543845=_0x3458d7['map'](_0x574e07=>({..._0x574e07,'type':'chat'===_0x574e07['type']?no['CHAT']:no['ACTION'],'icon':void 0x0}));_0x2046fd['find'](_0x10b1e1=>'other'===_0x10b1e1['id'])['actions']['push'](..._0x543845),_0x2046fd['forEach'](_0x466bf5=>{if('actions'in _0x466bf5)_0x466bf5['actions']['forEach'](_0x595984=>{if(_0x595984['isEnabled']=!!_0x55cb4e['find'](_0x230766=>_0x230766['id']===_0x595984['model'])||void 0x0===_0x595984['model'],!_0x595984['isEnabled']){const _0x37ba47=new ht('ai-quick-actions-unavailable-model',this,{'actionId':_0x595984['id'],'modelId':_0x595984['model']});mt(_0x37ba47['message']);}});else{if(_0x466bf5['isEnabled']=!!_0x55cb4e['find'](_0xe2f979=>_0xe2f979['id']===_0x466bf5['model'])||void 0x0===_0x466bf5['model'],!_0x466bf5['isEnabled']){const _0x37eca0=new ht('ai-quick-actions-unavailable-model',this,{'actionId':_0x466bf5['id'],'modelId':_0x466bf5['model']});mt(_0x37eca0['message']);}}});}return _0x2046fd;}['_initializeQuickActionsComponentsAndCommands'](){const _0x1c1e85=new Qt(this['editor']['locale']);_0x1c1e85['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x1c1e85),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x1c1e85);}['_initializeQuickActionsDropdown'](_0x48f2e8){const _0x49e94a=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Ba({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x519088,'label':us(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x48f2e8,'hasSearch':_0x49e94a}));}['_prepareQuickActionsDefinition'](_0x100abd){this['_quickActionsDefinition']=_0x100abd['map'](_0xd4e960=>{if('actions'in _0xd4e960){const _0xa150f0=_0xd4e960;return{..._0xa150f0,'actions':_0xa150f0['actions']['map'](_0x3161c3=>{const {actions:_0x3b52c8,..._0x5a7b09}=_0xa150f0;return{..._0x3161c3,'parent':_0x5a7b09};})['filter'](_0x33ab03=>this['_shouldIncludeAction'](_0x33ab03))};}return _0xd4e960;})['filter'](_0x518102=>'actions'in _0x518102?_0x518102['actions']['length']>0x0:this['_shouldIncludeAction'](_0x518102));}['_shouldIncludeAction'](_0x46e2ce){const _0x24bff7=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Wa[_0x46e2ce['type']])&&!_0x24bff7['includes'](_0x46e2ce['id'])&&!(_0x46e2ce['type']===no['CHAT']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x52c8fe){this['_quickActionsDefinition']['forEach'](_0x591fd2=>{if('actions'in _0x591fd2){const _0x412cbe=Ba({'editor':this['editor'],'content':_0x591fd2['actions'],'buttonDefinition':_0x591fd2,'bodyCollection':_0x52c8fe});this['editor']['ui']['componentFactory']['add'](_0x591fd2['id'],_0x412cbe),_0x591fd2['actions']['forEach'](_0x220940=>{const _0x42e518=Da({'editor':this['editor'],'action':_0x220940});this['editor']['ui']['componentFactory']['add'](_0x220940['id'],_0x42e518);});}else{const _0xf3658a=Da({'editor':this['editor'],'action':_0x591fd2,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x591fd2['id'],_0xf3658a);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0xebda82=>{const _0x757fa4=new Kt(_0xebda82),_0x574ed7=us(_0xebda82,'AI_QUICK_ACTIONS_HEADING');_0x757fa4['buttonView']['set']({'label':_0x574ed7,'icon':_0x519088});const _0x436b05=new $t(_0xebda82);_0x436b05['set']({'ariaLabel':_0x574ed7,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x502714=>{if('actions'in _0x502714){const _0x16b70b=_0x502714,_0x127695=new qt(_0xebda82,_0x757fa4),_0x2f10b4=new Kt(_0xebda82),_0x337cc8=new $t(_0xebda82);_0x2f10b4['buttonView']['set']({'label':_0x16b70b['label'],'icon':_0x16b70b['icon']}),_0x16b70b['actions']['forEach'](_0x1d8547=>{const _0x30a9d4=new qt(_0xebda82,_0x2f10b4),_0x40e4fe=new Wt(_0xebda82);_0x40e4fe['set']({'label':_0x1d8547['label'],'icon':_0x1d8547['icon'],'role':'menuitem','isEnabled':_0x1d8547['isEnabled']}),_0x40e4fe['on']('execute',()=>{this['_executeQuickAction'](_0x1d8547);}),_0x40e4fe['delegate']('execute')['to'](_0x2f10b4),_0x30a9d4['children']['add'](_0x40e4fe),_0x337cc8['items']['add'](_0x30a9d4);}),_0x2f10b4['panelView']['children']['add'](_0x337cc8),_0x127695['children']['add'](_0x2f10b4),_0x436b05['items']['add'](_0x127695);}else{const _0x38fdd7=_0x502714,_0x17ff19=new qt(_0xebda82,_0x757fa4),_0xce0cc4=new Wt(_0xebda82);_0xce0cc4['set']({'label':_0x38fdd7['label'],'icon':_0x38fdd7['icon'],'role':'menuitem','isEnabled':_0x38fdd7['isEnabled']}),_0xce0cc4['on']('execute',()=>{this['_executeQuickAction'](_0x38fdd7);}),_0xce0cc4['delegate']('execute')['to'](_0x757fa4),_0x17ff19['children']['add'](_0xce0cc4),_0x436b05['items']['add'](_0x17ff19);}});const _0x994aeb=Object['values'](Wa)['some'](_0x4b9190=>this['editor']['plugins']['has'](_0x4b9190));return _0x757fa4['set']({'isEnabled':_0x994aeb}),_0x757fa4['panelView']['children']['add'](_0x436b05),_0x757fa4;});}['_executeQuickAction'](_0x4f4f9e){const _0x385a01=this['editor'];_0x385a01['editing']['view']['focus'](),_0x385a01['commands']['execute']('aiQuickAction',_0x4f4f9e);const _0x842250=_0x385a01['ui']['view']['menuBarView'];_0x842250&&_0x842250['close']&&_0x842250['close']();}}class $a extends _0x231d2e{['execute'](_0x87610b){switch(this['_expandSelectionIfCollapsed'](),_0x87610b['type']){case no['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x5d74ad=us(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new ht('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5d74ad});}this['_handleAIChatAction'](_0x87610b);break;case no['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x5e1ee1=us(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new ht('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5e1ee1});}this['_handleAIActionsAction'](_0x87610b);}}async['_handleAIChatAction'](_0x1fde2c){const _0x128369=this['editor']['plugins']['get']('AIChatController'),_0x55dba6=this['editor']['plugins']['get']('AITabs')['view'];if(_0x55dba6['isVisible']||(_0x55dba6['isVisible']=!0x0),'chat'!==_0x55dba6['activeTab']&&_0x55dba6['activateTab']('chat'),'ask-ai'===_0x1fde2c['id'])_0x128369['removeSelectionFromChatContext'](),_0x128369['addSelectionToChatContext'](),_0x128369['focusPromptInput']();else await _0x128369['startConversation'](),_0x128369['removeSelectionFromChatContext'](),_0x128369['addSelectionToChatContext'](),_0x128369['focusPromptInput'](),await _0x128369['sendMessage']({'message':_0x1fde2c['prompt']||_0x1fde2c['displayedPrompt']||_0x1fde2c['label'],'attributes':{'quickActionData':{'id':_0x1fde2c['id']},'displayedPrompt':_0x1fde2c['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x59425c=this['editor'],_0x184212=_0x59425c['model']['document']['selection'];if(!_0x184212['isCollapsed'])return;const _0x2a73e3=It(_0x184212['getSelectedBlocks']())||_0x59425c['model']['schema']['getLimitElement'](_0x184212);_0x59425c['model']['change'](_0xab2e00=>{_0xab2e00['setSelection'](_0x2a73e3,'in');});}['_handleAIActionsActionLabel'](_0x4701a2){return _0x4701a2['parent']?.['label']&&'other'!==_0x4701a2['parent']?.['id']?_0x4701a2['parent']['label']+':\x20'+_0x4701a2['label']:_0x4701a2['label'];}async['_handleAIActionsAction'](_0x1155c6){const _0x5a484e=this['editor']['plugins']['get']('AIActions'),_0x492527=_0x1155c6['prompt']?{'userMessage':_0x1155c6['prompt'],'model':_0x1155c6['model']}:{'actionName':_0x1155c6['actionName']||_0x1155c6['id'],'args':_0x1155c6['args']},_0x184bba=this['_handleAIActionsActionLabel'](_0x1155c6);await _0x5a484e['executeAction'](_0x492527,_0x184bba,_0x1155c6['icon']);}}class qa extends _0x230b74{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x16b55f=this['editor'],_0x25cec0=new $a(this['editor']);if(_0x16b55f['commands']['add']('aiQuickAction',_0x25cec0),_0x16b55f['plugins']['has']('AIChat')){const _0xffa0de=this['editor']['plugins']['get']('AIChatController');_0x16b55f['model']['document']['selection']['on']('change:range',(_0x9c9adc,_0x2d9583)=>{_0x2d9583['directChange']&&_0xffa0de['removeSelectionFromChatContext']();});}}}class Qa extends Ps{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x32c068=this['documentContextContent']['children']['map'](_0x4fc8e9=>({'node':_0x4fc8e9,'id':ms(_0x4fc8e9,'data-id')})),_0x2c334c=this['parsedMergedContent']['children']['map'](_0x19955f=>({'node':_0x19955f,'id':ms(_0x19955f,'data-id')||ot()})),_0x1be924=_0x166995(_0x32c068,_0x2c334c,{'comparator':(_0x359bd7,_0x27c07e)=>_0x359bd7['id']==_0x27c07e['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x1be924['length']&&_0x1be924[_0x1be924['length']-0x1]['removed'];)_0x1be924['pop']();}const _0x2c41c1=_0x1be924['map'](_0x47417d=>{const _0x5a3b9c=_0x47417d['added']?'new':_0x47417d['removed']?'removed':'modified';return{'node':_0x47417d['value'][0x0]['node'],'type':_0x5a3b9c,'id':_0x47417d['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x2c41c1,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x5e005b,_0x175b2a){return _0x175b2a;}}class Xa extends Ms{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x3de3c1){super(_0x3de3c1),this['content']=_0x3de3c1['content'],this['version']=_0x3de3c1['version'],this['actionName']=_0x3de3c1['actionName'],this['args']=_0x3de3c1['args'],this['userMessage']=_0x3de3c1['userMessage'],this['model']=_0x3de3c1['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':Us['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x2ff853){const _0x471e4d=new Qa({'editor':this['editor'],'documentContextContent':this['content'],..._0x2ff853});return this['replies']['push'](_0x471e4d),_0x471e4d['delegate'](...Hs)['to'](this),this['fire']('replyCreated',_0x471e4d),_0x471e4d;}}class za extends kt{constructor(_0x4efd70,_0x1f0ce9=!0x0,_0x2659e5=!0x0){super(_0x4efd70),this['set']('isEnabled',!0x1),_0x1f0ce9&&(this['applyButton']=this['_createButton'](us(_0x4efd70,'AI_BALLOON_APPLY_BUTTON'),ds),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x2659e5&&(this['suggestButton']=this['_createButton'](us(_0x4efd70,'AI_BALLOON_SUGGEST_BUTTON'),_0x1f0ce9?_s:ds),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x1f0ce9,'showSuggestButton':_0x2659e5}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x59cbcf,showSuggestButton:_0x4531b5}){this['applyButton']&&(this['applyButton']['isVisible']=_0x59cbcf),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x4531b5);}['_createButton'](_0x2bd161,_0x560a23){const _0x5de558=new Nt(this['locale']);return _0x5de558['set']({'label':_0x2bd161,'class':_0x560a23,'isVisible':!0x0,'withText':!0x0}),_0x5de558;}}class ja extends vt{constructor(_0x5af699){super(_0x5af699),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':us(_0x5af699,'AI_DISCLAIMER_TEXT')}]}]});}}class Ja extends vt{constructor(_0xf0f8df){super(_0xf0f8df),this['set']('isVisible',!0x0);const _0x2b0045=new vn('small');_0x2b0045['isVisible']=!0x0;const _0x1dcfb3=new vt(this['locale']);_0x1dcfb3['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[us(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0xbc9beb=>!_0xbc9beb)]},'children':[_0x2b0045,_0x1dcfb3]});}}class Za extends Ra{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x2fb910,_0x422712){super(_0x2fb910),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x422712,this['_focusTracker']=new At(),this['_keystrokes']=new gt(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x43aab0(),this['_addContentWrapper'](_0x422712),this['_addDisclaimerView'](),this['_addToolbar'](_0x422712),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'](_0x422712);});}['render'](){super['render']();for(const _0x484eea of this['_focusables'])this['_focusTracker']['add'](_0x484eea['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x25c46b){-0x1===_0x25c46b?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x110cf4){this['_isLoading']=_0x110cf4;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x38dd56){super['showError'](_0x38dd56),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x1135e8){super['showBlockingError'](_0x1135e8),this['setErrorState']();}['addMiniToolbarItem'](_0x5b4985){this['_miniToolbarView']['items']['has'](_0x5b4985)||this['_miniToolbarView']['items']['add'](_0x5b4985);}['removeMiniToolbarItem'](_0x1cd623){this['_miniToolbarView']['items']['has'](_0x1cd623)&&this['_miniToolbarView']['items']['remove'](_0x1cd623);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x599cdd,showSuggestButton:_0x2e837a}){_0x599cdd=_0x599cdd&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x2e837a=_0x2e837a&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x599cdd,'showSuggestButton':_0x2e837a});}async['updateContent'](_0x406810){await this['_streamableContentView']['update'](_0x406810);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x31f217){this['_contentWrapper']=new vt(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'](_0x31f217['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new ja(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x5f457e,showSuggestButton:_0xf5a2f3}){this['_toolbarView']=new za(this['locale'],_0x5f457e,_0xf5a2f3),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',(_0xa5435f,_0x5074f3,_0x10f6b0)=>!(_0xa5435f||_0x5074f3||_0x10f6b0)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x5f457e,'showSuggestButton':_0xf5a2f3}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x39a33e){return this['_miniToolbarView']=new Na(this['locale'],_0x39a33e),this['_miniToolbarView']['delegate'](...en)['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',(_0x109b45,_0xcb0836)=>!(_0x109b45||_0xcb0836)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new Ja(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new pn(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x580799=new Nt(this['locale']),_0x4f3044=new Nt(this['locale']),_0x9e2f39=new to(this['locale']),_0x153aa0=new Nt(this['locale']);_0x580799['set']({'icon':et,'label':us(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+As}),_0x4f3044['set']({'icon':_0x2bd0fe,'tooltip':us(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+As}),_0x153aa0['set']({'icon':it,'tooltip':us(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+As}),_0x580799['bind']('isEnabled')['to'](this,'isBusy',_0x5e11af=>!_0x5e11af),_0x580799['on']('execute',()=>{this['fire']('tryAgain');}),_0x4f3044['bind']('isEnabled')['to'](this,'isBusy',_0x4c0367=>!_0x4c0367),_0x4f3044['on']('execute',()=>{this['fire']('showPrevious');}),_0x153aa0['bind']('isEnabled')['to'](this,'isBusy',_0x5a59ac=>!_0x5a59ac),_0x153aa0['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x4f3044,this['_navigationCounter']=_0x9e2f39,this['_navigationNextButton']=_0x153aa0,this['_navigationTryAgainButton']=_0x580799;}['updateMiniToolbarButtons'](_0x1678b7,_0x2e34a2){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x3f1ba5=_0x1678b7>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x3f1ba5){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x10c984=_0x1678b7-_0x2e34a2;this['_navigationCounter']['setInteractionCount'](_0x10c984+'/'+_0x1678b7),this['_navigationPreviousButton']['isEnabled']=_0x2e34a2<_0x1678b7-0x1,this['_navigationNextButton']['isEnabled']=_0x2e34a2>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'](_0x301a4a){this['_isLoading']=_0x301a4a;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x275c70=this['_getScrollableElement']();_0x275c70&&!this['_scrollManager']&&(this['_scrollManager']=new ir(_0x275c70));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class to extends vt{constructor(_0x41cebe){super(_0x41cebe);const _0x24ea05=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x24ea05['to']('interactionCount')}]});}['setInteractionCount'](_0x562237){this['set']('interactionCount',_0x562237);}}class eo extends _0x230b74{static get['requires'](){return[ls,Bt,tn,ka,_0x28cdab];}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(_0x51fdc0){super(_0x51fdc0),this['_bodyCollection']=new Qt(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new mn();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x264068,_0x5c3f42,_0x1193de){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x33f033,anchorData:_0x27e9b8}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x264068,_0x33f033,_0x27e9b8,_0x5c3f42,_0x1193de);}}const {modelFragment:_0x16a9f0,anchorData:_0x2344c9}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x264068,_0x16a9f0,_0x2344c9,_0x5c3f42,_0x1193de);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x40c225=this['editor']['plugins']['has']('TrackChanges');let _0x158884=this['editor']['config']['get']('ai.availableReplyActions')||[...wn];_0x40c225||(_0x158884=_0x158884['filter'](_0x514570=>'insertSuggestion'!=_0x514570));const _0x11185f=this['editor']['commands']['get']('trackChanges'),_0x9efc0e=new Za(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x40c225,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x158884});return _0x9efc0e['bind']('isBusy')['to'](this),_0x11185f&&_0x9efc0e['bind']('isTrackChangesOn')['to'](_0x11185f,'value'),_0x9efc0e['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x9efc0e['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x9efc0e['on']('showNext',()=>{this['_navigateToNext']();}),_0x9efc0e;}['_getExecuteDataRegular'](){const _0x2dec4e=this['editor']['model']['document']['selection'];if(_0x2dec4e['isCollapsed']){const _0x585f81=It(_0x2dec4e['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x2dec4e);this['editor']['model']['change'](_0x27b2a4=>{_0x27b2a4['setSelection'](_0x585f81,'in');});}const _0x92764d=_0x2dec4e['getFirstRange'](),_0x294723=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x2dec4e),_0x92764d['start'],_0x92764d['end']);this['_copyMarkersToFragment'](_0x294723,_0x2dec4e,{'isTableSelection':!0x1});const _0x3c68b5=_0x2dec4e['getFirstRange']()['start'],_0x1c6089=new Map();let _0x285f58=_0x294723;for(let _0x5e9cdf=0x0;_0x5e9cdf<_0x3c68b5['path']['length'];_0x5e9cdf++)_0x1c6089['set'](_0x285f58,_0x3c68b5['path'][_0x5e9cdf]),_0x285f58=_0x285f58['getChild'](0x0);return{'modelFragment':_0x294723,'anchorData':_0x1c6089};}['_getExecuteDataInTable'](){const _0xd75ea3=this['editor']['model']['document']['selection'],_0x572097=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x52fa47=_0xd75ea3['getFirstRange']()['start']['parent']['parent'],_0x351a56=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x52fa47),this['editor']['model']['createPositionAfter'](_0x52fa47)),_0x4d07d7=this['_wrapWithCommonAncestors'](_0x572097,_0x351a56['start'],_0x351a56['end']);this['_copyMarkersToFragment'](_0x4d07d7,_0xd75ea3,{'isTableSelection':!0x0});const _0x8cab16=_0xd75ea3['getFirstRange']()['start'],_0x1263b2=new Map();let _0x2348c9=_0x4d07d7;for(let _0x5ca1e7=0x0;_0x5ca1e7<_0x8cab16['path']['length'];_0x5ca1e7++)if(_0x1263b2['set'](_0x2348c9,_0x8cab16['path'][_0x5ca1e7]),_0x5ca1e7<_0x8cab16['path']['length']-0x1)_0x2348c9=_0x2348c9['getChild'](0x0);else{let _0x3cb47e=_0x2348c9['nextSibling'];for(;_0x3cb47e;)_0x1263b2['set'](_0x3cb47e,_0x8cab16['path'][_0x5ca1e7]),_0x3cb47e=_0x3cb47e['nextSibling'];}return{'modelFragment':_0x4d07d7,'anchorData':_0x1263b2};}async['_executeAction'](_0x21f1b4,_0x13cd35,_0x4aac29,_0x7da6ca,_0x57972d){const _0x23e779=this['editor']['plugins']['get'](tn),_0x5c6307=this['editor']['plugins']['get'](ka),_0x3acfc5=this['editor']['model']['document']['selection'],_0x29f01a=await _0x23e779['modelToDataWithIds'](_0x13cd35),_0x4444d0=this['editor']['model']['document']['version'],_0x50ad7c=[..._0x3acfc5['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0x5c6307['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x7da6ca,'icon':_0x57972d||_0x519088,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x50ad7c,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x5c6307),this['_interactionParams']={'action':_0x21f1b4,'content':_0x29f01a,'version':_0x4444d0,'aiBalloon':_0x5c6307,'modelFragment':_0x13cd35,'anchorData':_0x4aac29},this['_setupApplyListeners'](),this['listenTo'](_0x5c6307,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x5c6307,'dialogClosed',(_0x3d972e,{id:_0x50c19f})=>{if('aiActionsBalloon'===_0x50c19f){if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x5ee49e=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x78c065=_0x5ee49e['changeGroups'][0x0];_0x78c065&&'pending'===_0x78c065['state']&&_0x5ee49e['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x5c6307);}}),this['_createInteraction'](_0x29f01a,_0x4444d0,_0x5c6307,_0x21f1b4);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x5373ee,anchorData:_0x3cc9a3}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x5373ee,_0x3cc9a3,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x5373ee,_0x3cc9a3,!0x0);});}['_wrapWithCommonAncestors'](_0x1923b7,_0x25f595,_0x25405c){const _0x200dea=this['editor']['model']['createRange'](_0x25f595,_0x25405c)['getCommonAncestor'](),_0x1355ce=_0x200dea['is']('documentFragment')?[]:_0x200dea['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x1355ce['length']){const _0xd0f0e0=_0x1355ce['map'](_0x56d0fa=>_0x56d0fa['_clone'](!0x1));for(let _0x451f66=0x1;_0x451f66<_0xd0f0e0['length'];_0x451f66++)_0xd0f0e0[_0x451f66-0x1]['_appendChild'](_0xd0f0e0[_0x451f66]);return _0xd0f0e0[_0xd0f0e0['length']-0x1]['_appendChild'](_0x1923b7),new _0x3d30fd(_0xd0f0e0[0x0]);}return _0x1923b7;}['_copyMarkersToFragment'](_0x3dbcd2,_0x2d83eb,_0x38b41f={'isTableSelection':!0x1}){const _0x2b3f95=this['editor']['model'],_0x38b151=Array['from'](_0x2d83eb['getRanges']()),_0x365f72=_0x2d83eb['getFirstRange']()['start'];for(const _0x4b0e73 of _0x2b3f95['markers']){if(_0x4b0e73['name']['startsWith'](Zs)||!_0x4b0e73['affectsData'])continue;const _0x1be2d7=_0x4b0e73['getRange']();if(!_0x38b151['some'](_0x2c2d2=>_0x2c2d2['containsRange'](_0x1be2d7,!0x0)))continue;const _0x4779a5=this['_regularCalculateMarkerPath'](_0x1be2d7['start'],_0x365f72,_0x38b41f['isTableSelection']),_0x19dc42=this['_regularCalculateMarkerPath'](_0x1be2d7['end'],_0x365f72,_0x38b41f['isTableSelection']),_0x57ea93=_0x2b3f95['createPositionFromPath'](_0x3dbcd2,_0x4779a5),_0x51771d=_0x2b3f95['createPositionFromPath'](_0x3dbcd2,_0x19dc42);if(!_0x57ea93['isEqual'](_0x51771d)){const _0x3b1e41=_0x2b3f95['createRange'](_0x57ea93,_0x51771d);_0x3dbcd2['markers']['set'](_0x4b0e73['name'],_0x3b1e41);}}}['_regularCalculateMarkerPath'](_0x28794c,_0x2bb630,_0x1921b3=!0x1){const _0x21449a=[..._0x28794c['path']['slice']()];for(let _0x421880=0x0;_0x421880<Math['max'](_0x2bb630['path']['length'],_0x28794c['path']['length']);_0x421880++){const _0x2e0835=_0x2bb630['path'][_0x421880]||0x0,_0x385128=(_0x28794c['path'][_0x421880]||0x0)-_0x2e0835;if(_0x21449a[_0x421880]=_0x385128,0x0!==_0x385128&&!_0x1921b3)break;}return _0x21449a;}async['_createInteraction'](_0x92af19,_0x20ead5,_0x38ec55,_0x19f99a){const _0x188a8a=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x19f99a,'content':_0x92af19,'version':_0x20ead5,'aiBalloon':_0x38ec55,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x2d27fb=new Xa({'connector':this['_aiConnector'],'editor':_0x188a8a,'content':_0x92af19,'version':_0x20ead5,..._0x19f99a});this['_interactions']['push'](_0x2d27fb);const _0x3fc45c=(_0x5a9a0c,_0x170d08=!0x1,_0x2bba9d='streaming')=>this['_promiseQueue']['enqueue'](async _0x397866=>{try{const _0x5c4c33=Ns({'editor':_0x188a8a,'changeGroups':_0x5a9a0c['changeGroups'],'documentContextContent':_0x5a9a0c['documentContextContent'],'showDiff':_0x170d08,'trimUnchanged':!0x1});_0x5c4c33['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x5c4c33[0x0],'renderingStrategy':_0x2bba9d,'abortSignal':_0x397866});}catch(_0x358887){if(this['_isAbortError'](_0x358887))return;throw _0x358887;}});this['_interaction']['on']('replyCreated',(_0x8b9537,_0x1ca10d)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x3fc45c(_0x1ca10d)['catch'](_0x13776b=>{this['_isAbortError'](_0x13776b)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x13776b),this['_setErrorState'](_0x2d27fb));});}),this['_interaction']['on']('replyContentUpdated',(_0x78d09e,_0x4c9092)=>{_0x3fc45c(_0x4c9092)['catch'](_0x236992=>{this['_isAbortError'](_0x236992)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x236992),this['_setErrorState'](_0x2d27fb));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x4afbcd){this['_isAbortError'](_0x4afbcd)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x4afbcd),this['_setErrorState'](_0x2d27fb));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x3b54b7,{showDiff:_0x4eee5f})=>{try{this['_balloonShowDiff']=_0x4eee5f;const _0x3c7e0a=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x3c7e0a&&await _0x3fc45c(_0x3c7e0a,_0x4eee5f,'static');}catch(_0xa73677){this['_isAbortError'](_0xa73677)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0xa73677),this['_setErrorState'](_0x2d27fb));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x45ef35,{reply:_0x1c141a})=>{const _0x5966c7={'positiveCount':_0x1c141a['changeGroups']['filter'](_0x34d532=>'accepted'===_0x34d532['state'])['length'],'totalCount':_0x1c141a['changeGroups']['length']},_0x5b189c=this['_interaction']['actionCallId'],_0x3c3b6e=this['_interaction']['actionName'];_0x3c3b6e?this['_aiConnector']['upsertAIActionRating'](_0x3c3b6e,_0x5b189c,_0x5966c7):this['_aiConnector']['upsertCustomAIActionRating'](_0x5b189c,_0x5966c7);}),this['_setLoadingState']();try{const _0x508de8=await this['_interaction']['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x508de8;}catch(_0x3b89a8){if(this['_isAbortError'](_0x3b89a8))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x2d27fb);}}['_applyChanges'](_0x22549f,_0x4d9ba4,_0x49f07b){const _0x38c593=this['editor'];if(_0x49f07b&&!_0x38c593['plugins']['has']('TrackChanges'))throw new ht('ai-no-track-changes',null);const _0x291aaa=this['editor']['plugins']['get'](_0x28cdab),_0x4b9c6a=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x4b9c6a||!_0x4b9c6a['replies']['length'])return;const _0x1da4e8=_0x4b9c6a['replies'][_0x4b9c6a['replies']['length']-0x1],_0x5979fc=_0x1da4e8['changeGroups'];_0x1da4e8['setChangeGroupState'](0x0,'accepted');let _0x4d0322=zs({'editor':_0x38c593,'reply':_0x1da4e8,'interaction':_0x4b9c6a,'groups':_0x5979fc,'transform':!0x1,'documentCompare':_0x291aaa,'documentCompareOptions':{'anchor':_0x38c593['model']['createPositionAt'](_0x22549f,0x0),'markDeletions':_0x49f07b}});_0x4d0322=this['_filterOperationsOutsideRange'](_0x4d0322,_0x4d9ba4);for(const _0x13d427 of _0x4d0322)this['_anchorOperation'](_0x4d9ba4,_0x13d427,_0x38c593['model']['document']['getRoot']());const _0x3c0c80=_0x4b9c6a['getDocumentContext']()['version'],_0x558960=_0x38c593['model']['document']['history']['getOperations'](_0x3c0c80),_0x84f677={'document':_0x38c593['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x28ff2e=_0x5ccf4a(_0x4d0322,_0x558960,_0x84f677)['operationsA'];_0x38c593['model']['change'](_0xe9a99d=>{if(_0xe9a99d['setSelection'](_0x38c593['model']['document']['selection']['focus']),_0x49f07b)_0x38c593['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x28ff2e);else{for(const _0x3a8b5e of _0x28ff2e)_0x3a8b5e['baseVersion']=_0x38c593['model']['document']['version'],js(_0x38c593,_0x3a8b5e),_0xe9a99d['batch']['addOperation'](_0x3a8b5e),_0x38c593['model']['applyOperation'](_0x3a8b5e);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x12ea5f,_0x5cfeea){return _0x12ea5f['filter'](_0xaa921b=>{if('rename'==_0xaa921b['type']){const _0x552c8a=_0xaa921b['position']['nodeAfter'];return!_0x5cfeea['has'](_0x552c8a);}if(_0xaa921b['type']['indexOf']('Attribute')>-0x1){const _0x44f8cc=_0xaa921b['range']['start']['nodeAfter'];return!_0x5cfeea['has'](_0x44f8cc);}return!0x0;});}['_anchorOperation'](_0x202286,_0x217a0d,_0x45a864){const _0x57dd95=_0x217a0d['clone']();for(const _0x4315e7 in _0x217a0d){const _0xd5e473=_0x217a0d[_0x4315e7];_0xd5e473 instanceof _0x309081?_0x217a0d[_0x4315e7]=new _0x309081(_0x514ef9(_0xd5e473['start']),_0x514ef9(_0xd5e473['end'])):_0xd5e473 instanceof _0x24e947&&(_0x217a0d[_0x4315e7]=_0x514ef9(_0xd5e473));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x57dd95['type'])){if(_0x57dd95['isDocumentOperation']=!0x1,_0x57dd95['baseVersion']=null,'remove'==_0x57dd95['type']){const _0x523a86=_0x57dd95['sourcePosition'],_0x501008=_0x57dd95['howMany'];new _0x3af47c(_0x523a86,_0x501008)['_execute']();}else _0x57dd95['_execute']();}function _0x514ef9(_0x2337d6){if('$graveyard'==_0x2337d6['root']['rootName'])return _0x2337d6;const _0x2e7f0c=[];let _0xce4c21=_0x2337d6['root'];for(let _0x189c2e=0x0;_0x189c2e<_0x2337d6['path']['length'];_0x189c2e++){const _0x5df647=_0x202286['get'](_0xce4c21)||0x0;_0x2e7f0c[_0x189c2e]=_0x2337d6['path'][_0x189c2e]+_0x5df647,_0xce4c21=_0xce4c21['getChildAtOffset'](_0x2337d6['path'][_0x189c2e]);}return new _0x24e947(_0x45a864,_0x2e7f0c,_0x2337d6['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x198951,content:_0x2aafa4,version:_0x239cae,aiBalloon:_0x594564}=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'](_0x2aafa4,_0x239cae,_0x594564,_0x198951)['catch'](_0xebf04b=>{this['_isAbortError'](_0xebf04b)||console['error']('Error\x20refreshing\x20interaction:',_0xebf04b);});}['_isAbortError'](_0xf71588){return!!_0xf71588['message']&&_0xf71588['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 _0x28508e=this['_interactions']['length'];this['_currentInteractionIndex']<_0x28508e-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x2d3e02){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x2d3e02;const _0x257fd3=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x257fd3)return;if(_0x257fd3['hasError'])return this['_setErrorState'](_0x257fd3),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x257fd3['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x1068ed=_0x257fd3['replies'][_0x257fd3['replies']['length']-0x1];if(_0x1068ed){const _0x268118=this['editor'];try{const _0x3665cc=Ns({'editor':_0x268118,'changeGroups':_0x1068ed['changeGroups'],'documentContextContent':_0x1068ed['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x480fb4=>setTimeout(_0x480fb4,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x3665cc[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x2daa09){this['_isAbortError'](_0x2daa09)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x2daa09);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x218817){const _0x526e28=us(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x526e28),_0x218817['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);}}var io=function(_0x17d30d){return _0x17d30d['CONTINUE']='continue',_0x17d30d['FIX_GRAMMAR']='fix-grammar',_0x17d30d['IMPROVE_WRITING']='improve-writing',_0x17d30d['MAKE_LONGER']='make-longer',_0x17d30d['MAKE_SHORTER']='make-shorter',_0x17d30d['MAKE_TONE_CASUAL']='make-tone-casual',_0x17d30d['MAKE_TONE_FORMAL']='make-tone-formal',_0x17d30d['TRANSLATE']='translate',_0x17d30d;}({});class so extends _0x230b74{static get['requires'](){return[Ya,qa,eo];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4fcd9f){super(_0x4fcd9f),_0x4fcd9f['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}var no=function(_0x1654b6){return _0x1654b6['CHAT']='chat',_0x1654b6['ACTION']='action',_0x1654b6;}({});class ro extends vt{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x4cc1ff,_0x216fb4){super(_0x4cc1ff),this['id']=_0x216fb4,this['set']('status','pending'),this['set']('changeId',_0x216fb4),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',(_0x13c80b,_0x602b93)=>{_0x602b93&&_0x602b93['target']&&'A'===_0x602b93['target']['tagName']&&_0x602b93['preventDefault'](),this['fire']('activateChange',{'id':_0x216fb4,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x216fb4,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x216fb4,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x5e559b=new vt(this['locale']);return _0x5e559b['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',_0x4eeeae=>!_0x4eeeae)]}}),_0x5e559b;}['_createAcceptButtonView'](){const _0x2d3904=new Nt(this['locale']);return _0x2d3904['set']({'label':us(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x2d3904['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x180392=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x180392['stopPropagation']();})},'attributes':{'class':[_s,'ck-ai_review__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x21dadd=>'pending'!==_0x21dadd&&'accepted'!==_0x21dadd),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-accept-button',_0x5329a3=>'pending'===_0x5329a3),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x511f8b=>'accepted'===_0x511f8b)]}}),this['on']('change:status',(_0x466c70,_0x3bf57d,_0x4d41fe)=>{_0x2d3904['isEnabled']='pending'===_0x4d41fe,'accepted'===_0x4d41fe&&(_0x2d3904['label']=us(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x2d3904['icon']=_0x39bec0);}),_0x2d3904;}['_createDismissButtonView'](){const _0x4133e1=new Nt(this['locale']);return _0x4133e1['set']({'label':us(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x4133e1['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x14b9a0=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x14b9a0['stopPropagation']();})},'attributes':{'class':[As,this['bindTemplate']['if']('status','ck-hidden',_0x5a7bba=>'pending'!==_0x5a7bba&&'rejected'!==_0x5a7bba),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x57f005=>'pending'===_0x57f005),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x3da9c6=>'rejected'===_0x3da9c6)]}}),this['on']('change:status',(_0xd6910,_0x19f52e,_0x11d935)=>{_0x4133e1['isEnabled']='pending'===_0x11d935,'rejected'===_0x11d935&&(_0x4133e1['label']=us(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x4133e1['icon']=_0x341e14);}),_0x4133e1;}['_createInfoButtonView'](){const _0x1dc6fb=new Nt(this['locale']);return _0x1dc6fb['set']({'label':us(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x194912,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':As+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x1dc6fb['bind']('isOn')['to'](this,'isInfoToggleOn',_0x3ddbf5=>_0x3ddbf5),_0x1dc6fb['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x1dc6fb;}['_createOutdatedButtonView'](){const _0x2ec56b=new Nt(this['locale']);return _0x2ec56b['set']({'label':us(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':st,'withText':!0x0,'isEnabled':!0x1}),_0x2ec56b['extendTemplate']({'attributes':{'class':[As,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x210145=>'outdated'!==_0x210145)],'disabled':'disabled'}}),_0x2ec56b;}}class ao extends Xt{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x2c2d25,_0x37a10a){super(_0x2c2d25),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']()),_0x37a10a['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x409776){this['resultItemView']['changeId']=_0x409776['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x409776['contentDiffed'];}['showBalloon'](_0x5c5ca9,_0x10c085,_0x2a2f5a,_0x1a1ec6,_0x5d7448,_0x6ee209){const _0x2b1a5d=_0x10c085();if(!_0x2b1a5d)return;this['updateContent'](_0x5c5ca9),this['show']();const _0x47e657=Array['from'](_0x2b1a5d['getClientRects']())['reverse'](),_0x1b9b00=this['_getPointedRectIndexFromEvent'](_0x2a2f5a,_0x47e657),_0x5d0678=_0x47e657[_0x1b9b00??0x0];'click'===_0x1a1ec6?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x10c085(),_0x1b9b00,_0x5c5ca9['id'],_0x5d7448,_0x6ee209)||_0x5d0678})):'hover'===_0x1a1ec6&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x10c085(),_0x1b9b00,_0x5c5ca9['id'])||_0x5d0678}));}['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'](){zt({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x3f5a73=[this['element']];return this['_pinnedTargetElement']&&_0x3f5a73['push'](this['_pinnedTargetElement']),_0x3f5a73;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x4af715=new vt();return this['resultItemView']=new ro(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x4af715['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']]}]}),_0x4af715;}['_getBestRectPositionOnClick'](_0x21d0a1,_0x5acc1c,_0x5601d0,_0x50cf08,_0x5842d5){if(!_0x21d0a1)return null;const _0x111d74=this['position']['replace']('arrow_',''),_0x513d5d=Array['from'](_0x21d0a1['getClientRects']());let _0x4b77bd,_0xa285bc=_0x513d5d['reverse']();return void 0x0!==_0x5acc1c&&this['_isPinnedRectVisible'](_0xa285bc[_0x5acc1c],_0x50cf08,_0x5842d5)?(_0x4b77bd=_0xa285bc[_0x5acc1c],this['_pinnedRectIndex']=_0x5acc1c):this['_isPinnedRectVisible'](_0xa285bc[0x0],_0x50cf08,_0x5842d5)&&void 0x0===_0x5acc1c?_0x4b77bd=_0xa285bc[0x0]:(_0xa285bc='s'==_0x111d74[0x0]?[..._0x513d5d]['reverse']():_0x513d5d,_0xa285bc['forEach'](_0x422b35=>{this['_isPinnedRectVisible'](_0x422b35,_0x50cf08,_0x5842d5)&&(_0x4b77bd=_0x422b35);})),this['_pinnedTargetChangeId']=_0x5601d0,this['_pinnedTargetElement']=_0x21d0a1,_0x4b77bd||_0x21d0a1['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x22bdd0,_0x236822,_0x9cf72e){if(!_0x22bdd0)return null;const _0x5ee6d3=Array['from'](_0x22bdd0['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x236822&&this['_pinnedTargetChangeId']!==_0x9cf72e)return this['_pinnedRectIndex']=_0x236822,this['_pinnedTargetElement']=_0x22bdd0,this['_pinnedTargetChangeId']=_0x9cf72e,_0x5ee6d3[_0x236822];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x9cf72e){if(_0x22bdd0!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x5ee6d3[this['_pinnedRectIndex']];}return void 0x0!==_0x236822&&this['_pinnedTargetChangeId']!==_0x9cf72e?(this['_pinnedRectIndex']=_0x236822,this['_pinnedTargetElement']=_0x22bdd0,this['_pinnedTargetChangeId']=_0x9cf72e,_0x5ee6d3[_0x236822]):_0x22bdd0['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x50b010,_0x2232bc){if(_0x50b010)for(let _0x235b6a=0x0;_0x235b6a<_0x2232bc['length'];_0x235b6a++){const _0x500e25=_0x2232bc[_0x235b6a];if(_0x50b010['clientX']>=_0x500e25['left']-0x3&&_0x50b010['clientX']<=_0x500e25['right']+0x3&&_0x50b010['clientY']>=_0x500e25['top']-0x3&&_0x50b010['clientY']<=_0x500e25['bottom']+0x3)return _0x235b6a;}}['_isPinnedRectVisible'](_0x18601f,_0x13b464,_0x2115e9){const _0x2cca5a=new dt(_0x18601f),_0x1f6187=_0x13b464||document['documentElement'],_0xd590b5=_0x2cca5a['getIntersection'](Rt(_0x2115e9)),_0x3cc8bf=new dt(_0x1f6187)['getIntersection'](_0x2cca5a);return!!(_0xd590b5&&_0x3cc8bf&&_0x2cca5a['width']>0x0);}}const oo=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ho extends _0x4c168b{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[cs];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x169bf3){super(_0x169bf3),this['_bodyCollection']=new Qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...oo)['to'](this),this['_balloonSuggestionView']=new ao(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x805859=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x805859);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x1bfce1){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x41fb41=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x1bfce1,_0x41fb41);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0xa471ad){_0xa471ad&&('error-general'!==_0xa471ad['status']?'error-chunk'!==_0xa471ad['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x38a940){this['_mainView']['addCheckRunResult'](_0x38a940);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x18000e){this['_mainView']['showGeneralReviewCoreErrorView'](_0x18000e??us(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x2178de,_0x461c68){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x2178de,_0x461c68);}['setActiveStateInResults'](_0x4ff942){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x18c63f=>{_0x18c63f['id']===_0x4ff942&&_0x18c63f['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0xc94023=>_0xc94023['setItemAsInactive']());}['updateChangeState'](_0x3fb0ff,_0x50141e){'accepted'===_0x50141e||'rejected'===_0x50141e||'outdated'===_0x50141e?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x3fb0ff,_0x50141e):this['_mainView']['reviewCheckResultsView']['showResult'](_0x3fb0ff,_0x50141e);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x5d8014,_0x3f0fca,_0x5bc967,_0x24e230,_0x1fee90,_0x3aef03){this['_balloonSuggestionView']['showBalloon'](_0x5d8014,_0x3f0fca,_0x5bc967,_0x24e230,_0x1fee90,_0x3aef03);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x469add){const _0x9f8509=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x3b4bdc=>_0x3b4bdc['id']===_0x469add);return _0x9f8509?_0x9f8509['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class co extends vt{constructor(_0x35bc73){super(_0x35bc73),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x240a11=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x240a11['if']('isVisible','ck-hidden',_0x35cf14=>!_0x35cf14)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x240a11['to']('errorMessage')}]}]});}}class lo extends vt{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x18d0cf,_0x438979){super(_0x18d0cf),this['reviewCoreHeader']=_0x438979['header'],this['generalErrorView']=new co(_0x18d0cf),this['reviewCheckListView']=_0x438979['list'],this['reviewCheckListView']['delegate'](...oo)['to'](this),this['reviewCheckResultsView']=_0x438979['results'],this['reviewCheckResultsView']['delegate'](...oo)['to'](this),this['reviewCompletedView']=_0x438979['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'](_0x2c6795){this['reviewCheckResultsView']['addResult'](_0x2c6795),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'](_0x32a869){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x32a869;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class uo extends Nt{constructor(_0x3fd7a1,_0x1322e8){super(_0x1322e8),this['set']({'label':_0x3fd7a1,'withText':!0x0,'class':ds}),this['on']('execute',()=>{this['fire']('finishReview');});}}class _o extends Ht{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x5a00cf,_0x3c25d3){super(_0x5a00cf),this['_contents']=_0x3c25d3,this['_resultViews']=new _0x43aab0(),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 na(_0x5a00cf),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 _0x4a9786=this['_createCombinedSkeletonLoader'](),_0x9098b1=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x9098b1['if']('isLoading','ck-ai_review__check-run_loading',_0xa60eaa=>_0xa60eaa),_0x9098b1['if']('isResultReady','ck-ai_review__check-run_ready',_0x4ce0ed=>_0x4ce0ed),_0x9098b1['if']('isVisible','ck-hidden',_0x21bd50=>!_0x21bd50)]},'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',_0x128ec6=>_0x128ec6)]},'children':this['_resultViews']},_0x4a9786]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x4d73cf){const _0x25c4a2=new ro(this['locale'],_0x4d73cf['id']);_0x25c4a2['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x25c4a2),_0x25c4a2['resultResponseView']['element']['innerHTML']=_0x4d73cf['contentDiffed'];}['hideResult'](_0x2d899d,_0x2565f8){if('pending'===_0x2565f8)return;const _0x338b5f=this['_resultViews']['find'](_0x28f8ba=>_0x28f8ba['id']===_0x2d899d);_0x338b5f&&(_0x338b5f['status']=_0x2565f8,_0x338b5f['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x58cf28,_0x5c580e){if('pending'!==_0x5c580e)return;const _0x5d5425=this['_resultViews']['find'](_0x4602a6=>_0x4602a6['id']===_0x58cf28);_0x5d5425&&(_0x5d5425['status']=_0x5c580e,_0x5d5425['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x124956,_0x22fc29){this['headerTitle']=_0x124956,this['headerSubtitle']=_0x22fc29||'';}['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 sr(this['locale'],nr['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x3c0734=new vt(this['locale']),_0x51a21f=[];for(let _0x1cf390=0x0;_0x1cf390<0x10;_0x1cf390++){const _0x29a176=this['_createSkeletonLoader']();_0x29a176['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x51a21f['push'](_0x29a176);}return _0x3c0734['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x5546c6=>!_0x5546c6)]},'children':_0x51a21f}),_0x3c0734;}['_createErrorView'](){const _0x31e62f=new vt(this['locale']),_0x1bbaf8=new Nt(this['locale']),t=this['locale']['t'];return _0x31e62f['delegate']('retryReview')['to'](this),_0x1bbaf8['set']({'label':t('Try\x20again'),'withText':!0x0,'class':_s+'\x20ck-ai_review__check-run-error-retry-button'}),_0x1bbaf8['on']('execute',()=>{this['fire']('retryReview');}),_0x31e62f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x458e00=>!_0x458e00),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x414c32=>'chunk'===_0x414c32)]},'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',_0x2ad938=>'chunk'===_0x2ad938)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x488ec4=>'general'!==_0x488ec4)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x11eef3=>'chunk'!==_0x11eef3)]},'children':[{'text':us(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x1bbaf8]}),_0x31e62f;}['_createCancelButtonView'](){const _0x3f9da0=new Nt(this['locale']);return _0x3f9da0['set']({'label':us(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[_s+'\x20ck-ai-button-stop-generating'],'icon':_0x53f40e}),_0x3f9da0['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x9f2930=>_0x9f2930),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x50437d=>_0x50437d)]}}),_0x3f9da0['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x3f9da0;}['_createToggleDiffButtonView'](){const _0x1ff5bb=new Nt(this['locale']);_0x1ff5bb['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x1ff5bb['bind']('isEnabled')['to'](this,'isError',_0x49e631=>!_0x49e631),_0x1ff5bb['extendTemplate']({'attributes':{'class':[_s,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x45adb4=>!_0x45adb4),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x104db3=>_0x104db3)]}});const _0x46a415=us(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x510023=us(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x1ff5bb['bind']('isOn')['to'](this,'isToggleDiffOn',_0x27aa6a=>_0x27aa6a),_0x1ff5bb['bind']('icon')['to'](this,'isToggleDiffOn',_0x2ea115=>_0x2ea115?nt:rt),_0x1ff5bb['bind']('label')['to'](this,'isToggleDiffOn',_0x31d5e0=>_0x31d5e0?_0x46a415:_0x510023),_0x1ff5bb['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x1ff5bb;}['_createAcceptAllButtonView'](){const _0x6127bc=new Nt(this['locale']);return _0x6127bc['set']({'label':us(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x6127bc['bind']('isEnabled')['to'](this,'isError',_0x50bdeb=>!_0x50bdeb),_0x6127bc['extendTemplate']({'attributes':{'class':[ds,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x45f209=>!_0x45f209),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1ff066=>_0x1ff066)]}}),_0x6127bc['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x6127bc;}['_createExitReviewButtonView'](){const _0x381cf6=new Nt(this['locale']);return _0x381cf6['set']({'label':us(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x381cf6['extendTemplate']({'attributes':{'class':[As,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x3116c4=>!_0x3116c4),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x12a3e7=>_0x12a3e7)]}}),_0x381cf6['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x381cf6;}['_createResultHeaderView'](){const _0x4f497e=new vt(this['locale']),_0x424d10=this['_createTitleView']();return _0x4f497e['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x1f748c=>_0x1f748c)]},'children':[_0x424d10,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x4f497e;}['_createTitleView'](){const _0x43a309=new vt(this['locale']),_0x146542=new vn();return _0x146542['bind']('isVisible')['to'](this,'isResultReady',_0x5af188=>!_0x5af188),_0x43a309['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x146542,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x197f43=>_0x197f43)]},'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',_0x11628e=>!_0x11628e)]},'children':[{'text':us(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x43a309;}['_createFinishReviewButtonView'](){const _0x51ce73=new uo(us(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x51ce73['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3b7a7e=>!_0x3b7a7e)]}}),_0x51ce73['delegate']('finishReview')['to'](this),_0x51ce73;}}class Ao extends Ht{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x5a09bd,_0x35dda3){super(_0x5a09bd),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x35dda3['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x35dda3['headerText']);const _0x273de5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x273de5['if']('isVisible','ck-hidden',_0x221fb0=>!_0x221fb0)]},'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':_0x35dda3['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x3f151c){const _0x10e55c=new uo(_0x3f151c,this['locale']);return _0x10e55c['delegate']('finishReview')['to'](this),_0x10e55c;}['_createResultHeaderView'](_0x1e8da5){const _0x2a6351=new vt(this['locale']);return _0x2a6351['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':_0x1e8da5}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x2a6351;}}class go extends vt{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x163926,_0x5dc52b){super(_0x163926),this['_defaultValue']=_0x5dc52b['default']||(_0x5dc52b['data']['length']>0x0?_0x5dc52b['data'][0x0]['id']:''),this['_defaultLabel']=_0x5dc52b['data']['find'](_0xaf18eb=>_0xaf18eb['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=Gt(this['locale']);const _0x4c3a7e=this['_prepareListOptions'](_0x5dc52b['data']);jt(this['_dropdownView'],_0x4c3a7e,{'role':'menu','ariaLabel':_0x5dc52b['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x360050=>{_0x360050['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x235ab8=>{this['formValue']=_0x235ab8['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x235ab8['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'](_0x3c106b=[]){const _0x1f3ad1=new _t();this['resetToDefault']();for(const _0x2bb011 of _0x3c106b){const _0x13fd83=new Jt({'label':_0x2bb011['label'],'withText':!0x0,'role':'menuitemradio','id':_0x2bb011['id'],'model':_0x2bb011});_0x13fd83['bind']('isOn')['to'](this,'formValue',_0x8374a3=>_0x8374a3===_0x13fd83['id']);const _0x54d4d8={'type':'button','model':_0x13fd83};_0x1f3ad1['add'](_0x54d4d8);}return _0x1f3ad1;}}class Io extends Ht{['_formItem']=null;constructor(_0x3abedb,_0x366c19,_0x4df3b2){super(_0x3abedb),this['argsKey']=_0x366c19?.['argsKey'];if('dropdown'===_0x366c19['formType'])this['_formItem']=new go(this['locale'],_0x366c19);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x29ec37=new _0x8f4d96(this['locale'],{'children':[this['_formItem']],'class':[_0x4df3b2?'ck-form__row_with-submit':'']});_0x4df3b2&&_0x29ec37['children']['add'](_0x4df3b2),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x29ec37]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class Eo extends _0x1b3d75{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x3ec4b0){super(_0x3ec4b0),this['set']('isEmpty',!0x0),this['keystrokes']=new gt(),this['minRows']=Eo['MIN_ROWS'],this['maxRows']=Eo['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 po extends vt{['focusTracker']=new At();['keystrokes']=new gt();['focusCycler'];['_focusables']=new _0x43aab0();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x4c76bd,_0x42be94,_0x20e0e4=!0x1){super(_0x4c76bd),this['_check']=_0x42be94,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x42be94['defaultModel']?_0x42be94['defaultModel']['id']:'',this['_defaultLabel']=_0x42be94['defaultModel']?_0x42be94['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new te(this['locale'],()=>new Eo(_0x4c76bd)),this['promptInputView']['fieldView']['bind']('value')['to'](this,'prompt'),this['promptInputView']['fieldView']['on']('input',()=>{this['prompt']=this['promptInputView']['fieldView']['element']['value'];}),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelSelectionDropdownItems']=new _t(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x20e0e4),jt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x8f4d96(this['locale'],{'children':[this['promptInputView']]}),new _0x8f4d96(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x81a51,_0x409b19)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x409b19()):_0x409b19();}),this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}));}['render'](){super['render'](),([this['promptInputView'],this['_modelSelectionDropdown'],this['cancelButtonView'],this['submitButtonView']]['forEach'](_0x1a60a6=>{this['_focusables']['add'](_0x1a60a6),this['focusTracker']['add'](_0x1a60a6['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 _0xbf55e1 of this['_getFormValidators']()){const _0x14cb09=_0xbf55e1();if(_0x14cb09)return this['promptInputView']['errorText']=_0x14cb09,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return us(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x221079=new Nt(this['locale']),t=this['locale']['t'];return _0x221079['set']({'label':t('Submit'),'withText':!0x0,'class':ds}),_0x221079['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x221079;}['_createCancelButtonView'](){const _0x15b875=new Nt(this['locale']),t=this['locale']['t'];return _0x15b875['set']({'label':t('Cancel'),'withText':!0x0,'class':As}),_0x15b875['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x47e220=>{_0x47e220['stopPropagation']();})}}),_0x15b875['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x15b875;}['_setModelList'](_0xb2c4c4){this['_modelSelectionDropdownItems']['clear']();const _0x47a4c1=this['_check']['models'];if(_0xb2c4c4)this['set']('modelDisplayMode','hidden');else{const _0x3a5891=0x1===_0x47a4c1['length'];this['set']('modelDisplayMode',_0x3a5891?'name':'selector');}if(this['resetToDefault'](),_0x47a4c1?.['length']){0x1===_0x47a4c1['length']&&this['set']('activeModelName',_0x47a4c1[0x0]['name']||_0x47a4c1[0x0]['id']);for(const _0x2bc52d of _0x47a4c1){const _0x1d9257=new Jt({'label':_0x2bc52d['name'],'withText':!0x0,'role':'menuitemradio','id':_0x2bc52d['id'],'model':_0x2bc52d});_0x1d9257['bind']('isOn')['to'](this,'modelId',_0x585885=>_0x585885===_0x2bc52d['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x1d9257,'labelView':new mo(this['locale'],_0x2bc52d)});}}}['_createModelSelectionDropdown'](){const _0x4607c4=Gt(this['locale']);return _0x4607c4['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x4607c4['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0,'class':As}),_0x4607c4['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x6c6ed=>'selector'===_0x6c6ed),this['listenTo'](_0x4607c4,'execute',_0x1cf073=>{this['modelId']=_0x1cf073['source']['model']['id'],_0x4607c4['buttonView']['label']=_0x1cf073['source']['label'];}),_0x4607c4;}['_createModelNameView'](){const _0x1d0eec=new To(this['locale']);return _0x1d0eec['bind']('text')['to'](this,'activeModelName',_0x536cd5=>_0x536cd5??''),_0x1d0eec['bind']('isVisible')['to'](this,'modelDisplayMode',_0x2f1894=>'name'===_0x2f1894),_0x1d0eec;}['_createActionsFooterView'](){const _0x47af8e=new vt(this['locale']);return _0x47af8e['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']]}]}),_0x47af8e;}}class To extends vt{constructor(_0x557924){super(_0x557924),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x556646=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x556646['if']('isVisible','ck-hidden',_0x2d9aad=>!_0x2d9aad)]},'children':[{'text':_0x556646['to']('text')}]});}}class mo extends Mt{constructor(_0x439999,_0x3118d4){super();const _0x38ab84=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x38ab84['to']('style'),'id':_0x38ab84['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x38ab84['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x3118d4['description']||'']}]}]});}}class Co extends Ht{['_formItemsCollection']=new _0x43aab0();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x581907,_0x5509b8,_0x12f877,_0x2df219=!0x1){super(_0x581907),this['_hideModels']=_0x2df219,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x5509b8['isParameterized']);const _0x928b6f=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',_0x57268=>_0x57268),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x2ca864=>_0x2ca864)],'style':{'--ck-ai-review-check-list-item-index':_0x12f877}},'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':_0x5509b8['title']}]},_0x928b6f]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x5509b8['description']?[{'text':_0x5509b8['description']}]:[]}]}]},..._0x5509b8['isParameterized']?[this['_createParameterizedView'](_0x5509b8)]:[],...'custom'===_0x5509b8['id']?[this['_createCustomView'](_0x5509b8,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x5509b8['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x5509b8['id'],'args':_0x5509b8['useArgs']?_0x5509b8['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&zt({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x5912c3=>{_0x5912c3['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x2d0fb4=new xt();return _0x2d0fb4['content']=at,_0x2d0fb4['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x2d0fb4;}['_createParameterizedView'](_0x3bc57c){const _0x161d46=new vt(),_0x25f0c6=this['_createFormView'](_0x3bc57c);return _0x161d46['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x4ad500=>!_0x4ad500)]},'children':[_0x25f0c6]}),_0x161d46;}['_createFormView'](_0x179f80){const _0x5d733b=new vt(),_0x4c744a=Array['isArray'](_0x179f80['options'])?_0x179f80['options']:[],_0x111f1f=new Nt(this['locale']),t=this['locale']['t'];_0x111f1f['set']({'label':t('Submit'),'withText':!0x0,'class':ds}),_0x111f1f['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x143a1e=>{_0x143a1e['stopPropagation']();})}}),_0x111f1f['on']('execute',()=>{const _0x18cd9e=[],_0x4cc7c6={};this['_formItemsCollection']['forEach'](_0x26ad4a=>{_0x18cd9e['push'](_0x26ad4a['value']),_0x179f80['useArgs']&&_0x179f80['options']&&(_0x4cc7c6[_0x26ad4a['argsKey']]=_0x26ad4a['value']);}),this['fire']('runReviewCheck',{'id':_0x179f80['id'],'params':_0x18cd9e['length']?_0x18cd9e:void 0x0,'args':Object['keys'](_0x4cc7c6)['length']?_0x4cc7c6:void 0x0});});const _0x2be029=_0x4c744a['length'];return _0x4c744a['forEach']((_0x355c9b,_0x2c0d8a)=>{const _0x4a3edd=_0x2c0d8a===_0x2be029-0x1;this['_formItemsCollection']['add'](new Io(this['locale'],_0x355c9b,_0x4a3edd?_0x111f1f:null));}),_0x5d733b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x5d733b;}['_createCustomView'](_0x2ccb66,_0x2c7680=!0x1){return this['_customCheckView']=new po(this['locale'],_0x2ccb66,_0x2c7680),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',_0x3756ff=>!_0x3756ff)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x57d744,_0x551406,_0x1dbbb2)=>{_0x1dbbb2||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class wo extends Ht{['_checkViews'];constructor(_0xc045f5){super(_0xc045f5),this['_checkViews']=new _0x43aab0(),this['_setupTemplate']();}['setChecks'](_0x512420,_0x691a55=!0x1){this['_checkViews']['clear']();for(const [_0x1fbd04,_0x32547b]of _0x512420['entries']()){const _0x55ab05=new Co(this['locale'],_0x32547b,_0x1fbd04,_0x691a55);_0x55ab05['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x55ab05);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x385851 of this['_checkViews'])_0x385851 instanceof Co&&_0x385851['resetToDefault']();}['_setupTemplate'](){const _0x31b71b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x31b71b['if']('isVisible','ck-hidden',_0x3b4b6c=>!_0x3b4b6c)]},'children':this['_checkViews']});}}class fo extends ho{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x3e8a90=this['context']['locale'],_0x13d3b5=new _0x3c9a0a(_0x3e8a90,{'label':us(_0x3e8a90,'AI_REVIEW_MODE'),'icon':_0x30b44c,'class':'ck-ai-header\x20ck-ai-header_review'});return new lo(this['context']['locale'],{'header':_0x13d3b5,'list':new wo(_0x3e8a90),'results':new _o(_0x3e8a90,{'generalErrorText':us(_0x3e8a90,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new Ao(_0x3e8a90,{'headerText':us(_0x3e8a90,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':us(_0x3e8a90,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':us(_0x3e8a90,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x3b68ba=this['context']['plugins']['get']('AITabs');_0x3b68ba['view']['on']('activateTab',(_0xd18d3c,_0x5baaac)=>{'reviewMode'===_0x5baaac?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x3b68ba['view']['addTab']({'id':'reviewMode','buttonLabel':us(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x30b44c,'order':0x0,'content':this['_mainView']});}}const So='review-';class bo extends _0x4c168b{static get['requires'](){return[_0x28cdab,tn];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];constructor(_0x37995c){super(_0x37995c),this['_domEmitter']=new(Ot())(),this['_eventEmitter']=new(pt())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x26d7d6=Xs(this['context']);_0x26d7d6['conversion']['for']('editingDowncast')['markerToElement']({'model':So+'insert','view':(_0x5f4bea,{writer:_0x6c8eaa})=>{const _0x78214f=this['_markers']['get'](_0x5f4bea['markerName']),_0x404df0={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x78214f?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x5f4bea['markerName']};return _0x6c8eaa['createUIElement']('span',_0x404df0,function(_0x53d01b){const _0x5f1b5b=this['toDomElement'](_0x53d01b);return _0x5f1b5b['innerHTML']=_0x78214f?.['content']?.['asString']||'',_0x5f1b5b;});}}),_0x26d7d6['conversion']['for']('editingDowncast')['markerToHighlight']({'model':So+'remove-only','view':_0x767e9c=>{const _0xaa1324=this['_markers']['get'](_0x767e9c['markerName']),_0x25c01c=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0xaa1324?.['id']||'')&&_0x25c01c['push']('ck-ai_review__change_active'),{'classes':_0x25c01c,'attributes':{'data-marker-id':_0x767e9c['markerName']}};}}),_0x26d7d6['conversion']['for']('editingDowncast')['markerToHighlight']({'model':So+'remove-context','view':_0x585bef=>{const _0x560c27=this['_markers']['get'](_0x585bef['markerName']),_0x5dd95b=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x560c27?.['id']||'')&&_0x5dd95b['push']('ck-ai_review__change_active'),{'classes':_0x5dd95b,'attributes':{'data-marker-id':_0x585bef['markerName']}};}}),_0x26d7d6['conversion']['for']('editingDowncast')['markerToHighlight']({'model':So+'remove-text','view':_0x424136=>{const _0x119f96=this['_markers']['get'](_0x424136['markerName']),_0xd0fca0=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x119f96?.['id']||'')&&_0xd0fca0['push']('ck-ai_review__change_active'),{'classes':_0xd0fca0,'attributes':{'data-marker-id':_0x424136['markerName']}};}}),_0x26d7d6['conversion']['for']('dataDowncast')['markerToElement']({'model':So+'suggestion-context','view':(_0x3e7e6f,{writer:_0x22c5b1})=>_0x22c5b1['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x3e7e6f['isOpening']?'start':'end')})}),_0x26d7d6['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x2ac232,'view':_0x3615f8});const _0x407ceb=_0x26d7d6['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x407ceb,'mouseup',(_0x4d635e,_0x538728)=>{const _0x1cdd9a=_0x538728['target'],_0x11e25f=this['_findMarkerElement'](_0x1cdd9a);if(!_0x11e25f)return;const _0x3c12a6=_0x11e25f['getAttribute']('data-marker-id'),_0x387e7f=_0x3c12a6['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x3c12a6,'changeId':_0x387e7f,'markerElement':()=>this['_findMarkerElementById'](_0x3c12a6),'domEvent':_0x538728});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x407ceb,'mouseover',(_0x23b717,_0x4c274d)=>{const _0x3d7efa=_0x4c274d['target'],_0x2ef321=_0x4c274d['relatedTarget'];let _0x4df99c=this['_findMarkerElement'](_0x3d7efa);if(!_0x4df99c&&_0x2ef321&&(_0x4df99c=this['_findMarkerElement'](_0x2ef321)),!_0x4df99c)return;const _0x488a59=_0x4df99c['getAttribute']('data-marker-id'),_0x1c41e8=_0x488a59['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x1c41e8,'markerElement':()=>this['_findMarkerElementById'](_0x488a59),'domEvent':_0x4c274d});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x123234((_0x439f5a,_0xced60)=>{const _0x2ea93f=_0xced60['target'];if(this['_findMarkerElement'](_0x2ea93f))return;_0x2ea93f['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x26d7d6['model']['document']['registerPostFixer'](_0x472b21=>this['_validateMarkers'](_0x26d7d6,_0x472b21)),_0x26d7d6['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x26d7d6));}['getDocumentData'](){const _0x7ff957=this['context']['plugins']['get']('AIEditing'),_0x3ca64f=Xs(this['context']),_0x24e452=_0x3ca64f['model'],_0x4012ae=new _0x3d30fd();for(const _0x4ee5e1 of _0x24e452['document']['getRoot']()['getChildren']()){const _0x27a84e=_0x4ee5e1['_clone'](!0x0);_0x4012ae['_appendChild'](_0x27a84e);}for(const _0x4ec79d of _0x24e452['markers'])_0x4012ae['markers']['set'](_0x4ec79d['name'],this['_changeRangeOwnerDocument'](_0x4ec79d['getRange']()['clone'](),_0x4012ae));const _0x4f1ecf=new _0x5dd899({'ignoreElementEnd':!0x0,'startPosition':_0x24e452['createPositionAt'](_0x4012ae,0x0)}),_0x210f91=new Set(),_0x239157=new Map();for(const {item:_0x1901e7}of _0x4f1ecf){if(!_0x1901e7['is']('$textProxy'))continue;const _0x277ee0=_0x1901e7['parent'];if(_0x277ee0&&_0x277ee0['is']('element')){const _0x3aa21f=this['_upsertDataId'](_0x277ee0,()=>_0x7ff957['_nextDataId'](_0x210f91));_0x210f91['add'](_0x3aa21f);for(const _0x26cae4 of _0x277ee0['getChildren']())_0x26cae4['is']('element')&&_0x210f91['add'](this['_upsertDataId'](_0x26cae4,()=>_0x7ff957['_nextDataId'](_0x210f91)));let _0x355216=_0x277ee0;for(;_0x355216['parent']&&!_0x355216['parent']['is']('documentFragment');)_0x355216=_0x355216['parent'],_0x355216['hasAttribute'](_0x2ac232)&&_0x355216['_removeAttribute'](_0x2ac232);_0x239157['set'](_0x3aa21f,{'path':_0x277ee0['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x355216['_clone'](!0x0),_0x3aa21f,_0x3ca64f['data'])}),_0x4f1ecf['jumpTo'](_0x24e452['createPositionAfter'](_0x277ee0));}}return{'content':_0x3ca64f['data']['processor']['toData'](_0x3ca64f['data']['toView'](_0x4012ae)),'version':_0x3ca64f['model']['document']['version'],'elements':_0x239157};}['diffContent'](_0x3b577b,_0x253594,_0x17643e=!0x1){const _0x113c5f=[],_0x1ece4a=Xs(this['context']),_0x19bd82=_0x1ece4a['data']['parse'](_0x253594,'$documentFragment'),_0x11623a=_0x1ece4a['data']['parse'](_0x3b577b,'$documentFragment'),_0x4fb88c=_0x1ece4a['model']['createPositionAt'](_0x11623a,0x0);if(this['_haveSingleTopLevelElement'](_0x19bd82)){if(!this['_hasSameTopLevelElement'](_0x11623a,_0x19bd82))return _0x113c5f;}else{const _0x207698=_0x1ece4a['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x11623a,_0x207698)||!this['_haveOnlyInlineContent'](_0x19bd82,_0x207698))return _0x113c5f;}const _0x514e5a=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x3b577b,_0x253594,{'anchor':_0x4fb88c,'markDeletions':!0x0})['getOperations']()['filter'](_0x355149=>'insert'===_0x355149['type']||'marker'===_0x355149['type']&&_0x355149['name']['startsWith']('$markedRemove')),_0x43bd18=this['_groupAdjacentOperations'](_0x514e5a),_0x5323da=[];if(_0x17643e){if(_0x43bd18['length']){const _0x947474=_0x43bd18[0x0]['operations'][0x0],_0x145495='insert'===_0x947474['type']?_0x947474['position']:_0x947474['newRange']['start'],_0x206ef9=this['_getPositionLimitingRange'](_0x145495,_0x1ece4a,'inside'),_0x8e29d1=_0x206ef9?_0x19bd82['getChild'](0x0)['getChildren']():_0x19bd82['getChildren'](),_0x4b5a80=_0x206ef9||_0x1ece4a['model']['createRangeIn'](_0x11623a),_0x24e750=[new _0x5ca8dc('$markedRemove:synthetic'+ot(),null,_0x4b5a80,_0x1ece4a['model']['document']['model']['markers'],!0x0,_0x1ece4a['model']['document']['version']+0x1),new _0x3b1ba7(_0x4b5a80['end'],_0x8e29d1,_0x1ece4a['model']['document']['version']+0x2)];_0x5323da['push']({'operations':_0x24e750,'operationsIsolated':_0x24e750,'groupOffset':0x0});}}else _0x5323da['push'](..._0x43bd18);let _0x302761=0x0;return _0x1ece4a['model']['change'](_0xdeccbd=>{for(let _0xe00790=0x0;_0xe00790<_0x5323da['length'];_0xe00790++){const _0x106726=_0x5323da[_0xe00790],_0x1af699=_0xdeccbd['createDocumentFragment']();for(const _0x2791ca of _0x11623a['getChildren']())_0xdeccbd['append'](_0x2791ca['_clone'](!0x0),_0x1af699);for(const _0x1cb7b4 of _0x106726['operationsIsolated'])if('insert'===_0x1cb7b4['type']){const _0xaa7a5d=_0x1cb7b4;_0xaa7a5d['baseVersion']=null,_0xaa7a5d['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0xaa7a5d,_0x1af699),_0xdeccbd['batch']['addOperation'](_0x1cb7b4),_0x1ece4a['model']['applyOperation'](_0x1cb7b4);const _0x46b197='suggestion:insertion:id:authorId:'+_0x302761++,_0x2f6c20=_0x1ece4a['model']['createRange'](_0xaa7a5d['position'],_0xaa7a5d['position']['getShiftedBy'](_0xaa7a5d['howMany']));_0x1af699['markers']['set'](_0x46b197,_0x2f6c20);}else{if('marker'===_0x1cb7b4['type']&&_0x1cb7b4['name']['startsWith']('$markedRemove')){const _0x1f2447=_0x1cb7b4,_0x467453='suggestion:deletion:id:authorId:'+_0x302761++;this['_changeOperationOwnerDocument'](_0x1f2447,_0x1af699),_0x1af699['markers']['set'](_0x467453,_0x1f2447['newRange']);}}if(_0x17643e)_0x113c5f['push']({..._0x106726,'context':this['_createGetContentFn'](_0x11623a,_0x1ece4a['data']),'content':this['_createGetContentFn'](_0x11623a,_0x1ece4a['data'])});else{const _0x1e1810=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x106726['operationsIsolated'][0x0]),_0x1af699),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x106726['operationsIsolated'][_0x106726['operationsIsolated']['length']-0x1]),_0x1af699));_0x1af699['markers']['set'](So+'suggestion-context',new _0x309081(_0x1e1810['start'],_0x1e1810['end'])),_0x113c5f['push']({..._0x106726,'context':this['_createGetContextFn'](_0x1af699,_0x1ece4a['data'],{'ellipsisBefore':_0x1e1810['hasContentBefore'],'ellipsisAfter':_0x1e1810['hasContentAfter']}),'content':this['_createGetContentFn'](_0x1af699,_0x1ece4a['data'])});}}}),_0x113c5f;}['markChangePositionInEditorContent'](_0x11b838,_0x314d0e){if(!_0x11b838['length'])return;const _0x40ae53=_0x11b838[0x0]['parent']['id'],_0x2a4a5f=_0x314d0e['elements']['get'](_0x40ae53);if(!_0x2a4a5f)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x40ae53);const _0x1ea745=_0x2a4a5f['path'],_0x3d4228=Xs(this['context']),_0x36ac2d=_0x3d4228['model']['document']['history']['getOperations'](_0x314d0e['version']),_0xe0cfad=[];for(const _0x1a0e24 of _0x11b838){const _0x4da1b0=_0x1a0e24['operationsIsolated']['map'](_0x3aa4bb=>this['_translateOperationToEditorContent'](_0x3aa4bb,_0x1ea745,_0x3d4228['model']['document']['getRoots']()[0x0]));if(!_0x4da1b0||!_0x4da1b0['length'])continue;const _0x16c7f0=_0x4da1b0['every'](_0x29b566=>'marker'===_0x29b566['type']&&_0x29b566['name']['startsWith']('$markedRemove')),_0x291ca9={'document':_0x3d4228['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x1c66ba=_0x5ccf4a(_0x4da1b0,_0x36ac2d,_0x291ca9)['operationsA'];for(const _0xbdd4c3 of _0x1c66ba)if('insert'===_0xbdd4c3['type']){const _0x30630b=_0xbdd4c3,_0x51cfa4=_0x30630b['nodes'];_0x3d4228['model']['change'](_0x1611ac=>{const _0x288bab=_0x1611ac['createDocumentFragment']();for(const _0x1aab32 of _0x51cfa4)_0x1611ac['append'](_0x1aab32['_clone'](!0x0),_0x288bab);_0xe0cfad['push']({'start':_0x30630b['position'],'end':_0x30630b['position'],'type':'insert','groupId':_0x1a0e24['id'],'content':{'asString':this['_createGetContentFn'](_0x288bab,_0x3d4228['data'])(),'asFragment':_0x288bab}});});}else{if('marker'===_0xbdd4c3['type']&&_0xbdd4c3['name']['startsWith']('$markedRemove')){const _0x4e0d70=_0xbdd4c3;let _0x2b9d60='remove-text';if(_0x16c7f0){const _0x1626da=this['_findAdjacentContextDistance'](_0x4e0d70['newRange']['start'],'backward',_0x3d4228['model']['schema']),_0x24144c=this['_findAdjacentContextDistance'](_0x4e0d70['newRange']['end'],'forward',_0x3d4228['model']['schema']);if(_0x1626da||_0x24144c){const _0x3e9728=_0x4e0d70['newRange']['start']['getShiftedBy'](-_0x1626da),_0x138703=_0x4e0d70['newRange']['end']['getShiftedBy'](_0x24144c);_0xe0cfad['push']({'start':_0x3e9728,'end':_0x138703,'groupId':_0x1a0e24['id'],'type':'remove-context'});}else _0x2b9d60='remove-only';}_0xe0cfad['push']({'start':_0x4e0d70['newRange']['start'],'end':_0x4e0d70['newRange']['end'],'groupId':_0x1a0e24['id'],'type':_0x2b9d60});}}}this['_insertMarkers'](_0xe0cfad);}['clearAllMarkers'](){const _0x4742e3=Xs(this['context']);_0x4742e3['model']['change'](_0x597632=>{for(const _0x2abf94 of this['_markers']['keys']())_0x4742e3['model']['markers']['get'](_0x2abf94)&&_0x597632['removeMarker'](_0x2abf94);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){Xs(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){Xs(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x599db1){const _0x427ba3=Xs(this['context']),_0x5dfe68=_0x427ba3['model'],_0x247ca1=_0x599db1['map'](_0x374225=>this['_getMarkersDataForGroup'](_0x374225))['flat']();_0x5dfe68['change'](_0x2598ec=>{for(const _0x2ca61b of _0x247ca1){const _0x145aeb=_0x427ba3['model']['markers']['get'](_0x2ca61b['id']);if(_0x145aeb){if('insert'===_0x2ca61b['type']){if(!_0x2ca61b['content'])continue;_0x5dfe68['insertContent'](_0x2ca61b['content']['asFragment']||null,_0x145aeb['getRange']()['start']);}else'remove-text'!==_0x2ca61b['type']&&'remove-only'!==_0x2ca61b['type']||_0x5dfe68['deleteContent'](_0x5dfe68['createSelection'](_0x145aeb['getRange']()));_0x2598ec['removeMarker'](_0x2ca61b['id']),this['_markers']['delete'](_0x2ca61b['id']);}}});}['rejectChange'](_0x4c0a22){const _0x26e11e=Xs(this['context']),_0x2b89fa=this['_getMarkersDataForGroup'](_0x4c0a22);_0x26e11e['model']['change'](_0x1842dd=>{for(const _0xb2d50b of _0x2b89fa)_0x1842dd['removeMarker'](_0xb2d50b['id']),this['_markers']['delete'](_0xb2d50b['id']);});}['getEditor'](){return Xs(this['context']);}['getMarkerElementForChange'](_0x25c74a){const _0x3361b8=Array['from'](this['_markers']['values']())['filter'](_0x5368b5=>_0x5368b5['groupId']===_0x25c74a);if(!_0x3361b8['length'])return null;const _0x2b82d7=0x1===_0x3361b8['length']?_0x3361b8[0x0]:this['_sortMarkers'](_0x3361b8)[0x0],_0x184d30=Xs(this['context'])['model']['markers']['get'](_0x2b82d7['id']);if(!_0x184d30)return null;return{'modelRange':_0x184d30['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x2b82d7['id'])};}['getContentElementForChange'](_0x11c990){const _0x3d53f9=Array['from'](this['_markers']['values']())['filter'](_0x532e0c=>_0x532e0c['groupId']===_0x11c990);if(!_0x3d53f9['length'])return null;const _0x3a51fa=0x1===_0x3d53f9['length']?_0x3d53f9[0x0]:this['_sortMarkers'](_0x3d53f9)[0x0],_0x1d8137=Xs(this['context']),_0x41f0ed=_0x1d8137['model']['markers']['get'](_0x3a51fa['id']);if(!_0x41f0ed)return null;const _0x16b3a9=_0x41f0ed['getRange'](),_0x122646=_0x1d8137['editing']['view']['getDomRoot']();if(!_0x122646||!_0x16b3a9)return null;let _0x30fe15=_0x16b3a9['start']['parent'];for(;_0x30fe15['parent']&&'$root'!==_0x30fe15['parent']['name'];)_0x30fe15=_0x30fe15['parent'];if(!_0x30fe15||!_0x30fe15['name'])return null;const _0x4bc4ea=_0x122646['querySelector']('[data-marker-id=\x22'+_0x3a51fa['id']+'\x22]');if(!_0x4bc4ea)return null;let _0x463465=null;_0x1d8137['model']['change'](_0x4bea4e=>{_0x463465=_0x4bea4e['createDocumentFragment'](),_0x4bea4e['append'](_0x30fe15['_clone'](!0x0),_0x463465);});const _0x2c9167=_0x1d8137['data']['toView'](_0x463465)['getChild'](0x0);return _0x4bc4ea['closest'](_0x2c9167['name']);}['reactivateMarkers'](_0x5d3f3b){const _0x59e942=this['_getMarkersDataForGroup'](_0x5d3f3b);if(!_0x59e942['length'])return;const _0x3450b7=Array['from'](this['_activeMarkers'])['sort'](),_0x763a37=Array['from'](new Set(_0x59e942['map'](_0x304345=>_0x304345['id'])))['sort']();_0x3450b7['join']('|')!==_0x763a37['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x5d3f3b));}['setMarkersInElementAsActive'](_0x5d7b61){const _0x32da61=this['_getMarkersDataForGroup'](_0x5d7b61);if(!_0x32da61['length'])return;const _0x586a3c=Xs(this['context']),_0x581fd1=new Set(_0x32da61['map'](_0x32b1d4=>_0x32b1d4['id'])),_0x457595=Array['from'](_0x581fd1['values']())['map'](_0x5a2cc7=>_0x586a3c['model']['markers']['get'](_0x5a2cc7))['filter'](_0x5a7e52=>!!_0x5a7e52);_0x581fd1['forEach'](_0xd5aadd=>{this['_activeMarkers']['add'](_0xd5aadd);}),_0x586a3c['model']['change'](()=>{_0x457595['forEach'](_0x47f6fb=>{_0x586a3c['editing']['reconvertMarker'](_0x47f6fb);});});}['setAllMarkersAsInactive'](){const _0x1d6b46=Array['from'](this['_activeMarkers']);if(!_0x1d6b46['length'])return;this['_activeMarkers']['clear']();const _0x133c3a=Xs(this['context']),_0x410f70=_0x1d6b46['map'](_0x40e0ca=>_0x133c3a['model']['markers']['get'](_0x40e0ca))['filter'](_0x373b4a=>!!_0x373b4a);_0x133c3a['model']['change'](()=>{_0x410f70['forEach'](_0x1c837d=>{_0x133c3a['editing']['reconvertMarker'](_0x1c837d);});});}['_getPositionLimitingRange'](_0x540945,_0x2259a9,_0x2b79a9='outside'){if(!_0x540945)return null;let _0x3fe038=_0x540945['parent'];for(;_0x3fe038&&_0x3fe038['parent']&&'$root'!==_0x3fe038['parent']['name']&&!_0x2259a9['model']['schema']['isLimit'](_0x3fe038)&&!_0x2259a9['model']['schema']['isBlock'](_0x3fe038);)_0x3fe038=_0x3fe038['parent'];if(!_0x3fe038||!_0x3fe038['name']||'$root'===_0x3fe038['name'])return null;let _0x23ebaf=null;return _0x2259a9['model']['change'](_0x12e0e0=>{_0x23ebaf='inside'===_0x2b79a9?_0x12e0e0['createRangeIn'](_0x3fe038):_0x12e0e0['createRangeOn'](_0x3fe038);}),_0x23ebaf;}['_validateMarkers'](_0x372622,_0x4aaa39){const _0x36adf3=Array['from'](this['_markers']['keys']()),_0x4bf016=new Map();for(const _0x2ac787 of _0x36adf3){const _0xf747c2=_0x372622['model']['markers']['get'](_0x2ac787);if(!_0xf747c2)continue;const _0x17b075=_0xf747c2['getStart']()['path'][0x0];_0x4bf016['has'](_0x17b075)||_0x4bf016['set'](_0x17b075,[]),_0x4bf016['get'](_0x17b075)['push'](_0xf747c2);}const _0x1f813c=new Set();for(const _0x5ab441 of _0x372622['model']['document']['differ']['getChanges']()){let _0x4f0c00=-0x1,_0x2e9e2d=null;if('insert'===_0x5ab441['type'])_0x2e9e2d=new _0x309081(_0x5ab441['position'],_0x5ab441['position']['getShiftedBy'](_0x5ab441['length'])),_0x4f0c00=_0x5ab441['position']['path'][0x0];else{if('remove'!==_0x5ab441['type'])continue;_0x2e9e2d=new _0x309081(_0x5ab441['position']),_0x4f0c00=_0x5ab441['position']['path'][0x0];}const _0x2de493=_0x4bf016['get'](_0x4f0c00)||[];if(_0x2de493['length']){for(const _0x195dec of _0x2de493)if(_0x2e9e2d['root']['rootName']===_0x195dec['getRange']()['root']['rootName']&&('insert'!==_0x5ab441['type']||!_0x2e9e2d['containsRange'](_0x195dec['getRange']()))&&(_0x2e9e2d['isIntersecting'](_0x195dec['getRange']())||_0x2e9e2d['start']['isTouching'](_0x195dec['getRange']()['end'])||_0x2e9e2d['end']['isTouching'](_0x195dec['getRange']()['start']))){const _0x1c0085=this['_parseMarkerName'](_0x195dec['name']);Array['from'](this['_markers']['values']())['filter'](_0xb1a60c=>_0xb1a60c['groupId']===_0x1c0085['groupId'])['forEach'](_0x51f31e=>_0x1f813c['add'](_0x51f31e['id']));}}}if(_0x1f813c['size']){for(const _0x76e491 of _0x1f813c)_0x4aaa39['removeMarker'](_0x76e491);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x48ab0a){for(const {name:_0x487e91,data:_0x2c96d8}of _0x48ab0a['model']['document']['differ']['getChangedMarkers']()){if(!_0x487e91['startsWith'](So))continue;const _0x2af93b=_0x2c96d8['oldRange'],_0x140ed4=_0x2c96d8['newRange'],_0xaef869=_0x2af93b&&'$graveyard'===_0x2af93b['root']['rootName'],_0x417874=_0x140ed4&&'$graveyard'===_0x140ed4['root']['rootName'];if(_0xaef869&&_0x417874)continue;const _0x27399f=this['_parseMarkerName'](_0x487e91);this['_markers']['get'](_0x487e91)&&(_0x417874||!_0x140ed4?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x487e91,'changeId':_0x27399f['groupId']}):_0xaef869&&_0x140ed4&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x487e91,'changeId':_0x27399f['groupId']}));}}['_parseMarkerName'](_0x1faec0){const _0x8ac09e=_0x1faec0['split'](':'),_0x45d4e8=(_0x8ac09e[0x1]||'')['split']('_');return{'prefix':_0x8ac09e[0x0],'groupId':_0x45d4e8[0x0],'suffix':_0x45d4e8[0x1]};}['_translateOperationToEditorContent'](_0x4c00d2,_0x5bef22,_0x39f2fa){if('insert'===_0x4c00d2['type']){const _0x261477=_0x4c00d2;return new _0x3b1ba7(this['_changePosition'](_0x5bef22['concat'](_0x261477['position']['offset']),_0x39f2fa),_0x261477['nodes'],_0x261477['baseVersion']);}if('marker'===_0x4c00d2['type']&&_0x4c00d2['name']['startsWith']('$markedRemove')){const _0x4df2d9=_0x4c00d2;return new _0x5ca8dc(_0x4df2d9['name'],_0x4df2d9['oldRange'],this['_changeRange'](_0x4df2d9['newRange'],_0x5bef22['concat'](_0x4df2d9['newRange']['start']['offset']),_0x5bef22['concat'](_0x4df2d9['newRange']['end']['offset']),_0x39f2fa),_0x4df2d9['_markers'],_0x4df2d9['affectsData'],_0x4df2d9['baseVersion']);}return _0x4c00d2;}['_groupAdjacentOperations'](_0x517de4){if(!_0x517de4['length'])return[];const _0x262468=[];let _0x4a8599=0x0,_0x544ec6=0x0,_0x659dc1=[];for(let _0x58953e=0x0;_0x58953e<=_0x517de4['length'];_0x58953e++){const _0x5e4067=_0x517de4[_0x58953e],_0x48df31=_0x517de4[_0x58953e-0x1];!_0x5e4067||_0x48df31&&!this['_getOperationEnd'](_0x48df31)['isTouching'](this['_getOperationStart'](_0x5e4067))?(_0x262468['push']({'operations':_0x659dc1,'operationsIsolated':_0x659dc1['map'](_0x1442e0=>this['_shiftOperation'](_0x1442e0['clone'](),-_0x544ec6)),'groupOffset':_0x4a8599}),_0x659dc1=_0x5e4067?[_0x5e4067]:[],_0x544ec6+=_0x4a8599,_0x4a8599=0x0):_0x659dc1['push'](_0x5e4067),_0x5e4067&&'insert'===_0x5e4067['type']&&(_0x4a8599+=_0x5e4067['howMany']);}return _0x262468;}['_findAdjacentContextDistance'](_0x480cf0,_0x3d8dfa,_0x184a69,_0x41946d=0x1){const _0x56c31a=new _0x5dd899({'startPosition':_0x480cf0,'direction':_0x3d8dfa});let _0x4a1a52=0x0;for(let _0x50d541=0x0;_0x50d541<_0x41946d;_0x50d541++){let _0x15fb59=0x0,_0x1fc411=!0x1,_0x2e3bfe='forward'===_0x3d8dfa?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x40336d}of _0x56c31a)if(_0x40336d['is']('$textProxy')){const _0x6d4d3d=_0x2e3bfe['exec'](_0x40336d['data']);if(_0x6d4d3d&&_0x6d4d3d['length']){if(_0x15fb59+='forward'===_0x3d8dfa?_0x6d4d3d['index']+_0x6d4d3d[0x0]['length']:_0x40336d['data']['length']-_0x6d4d3d['index'],_0x6d4d3d[0x0]['length']!==_0x40336d['data']['length'])break;_0x1fc411=!0x0,_0x2e3bfe='forward'===_0x3d8dfa?/^\w+/:/\w+$/;}else{if(_0x1fc411)break;_0x15fb59+=_0x40336d['offsetSize'];}}else{if(_0x40336d['is']('element')){_0x184a69['isInline'](_0x40336d)&&!_0x1fc411&&(_0x15fb59+=0x1);break;}}_0x4a1a52+=_0x15fb59,_0x56c31a['jumpTo'](_0x480cf0['getShiftedBy']('forward'===_0x3d8dfa?_0x4a1a52:-_0x4a1a52));}return _0x4a1a52;}['_getChangeContext'](_0x6dd21,_0x387f97){const _0x3e65d9=Xs(this['context'])['model']['schema'],_0x211edf=this['_findAdjacentContextDistance'](_0x6dd21,'backward',_0x3e65d9,0x6),_0x553378=this['_findAdjacentContextDistance'](_0x387f97,'forward',_0x3e65d9,0x6),_0x196cf7=_0x6dd21['getShiftedBy'](-_0x211edf),_0x17080d=_0x387f97['getShiftedBy'](_0x553378);return{'start':_0x196cf7,'end':_0x17080d,'hasContentBefore':!_0x196cf7['isAtStart'],'hasContentAfter':!_0x17080d['isAtEnd']};}['_insertMarkers'](_0x3c0ed1){const _0x393736=this['context']['plugins']['get']('AIEditing'),_0x267eba=new Set();Xs(this['context'])['model']['change'](_0x337cda=>{for(const _0x265422 of _0x3c0ed1){const _0x35750b=''+So+_0x265422['type']+':'+_0x265422['groupId']+'_'+_0x393736['_nextDataId'](_0x267eba);this['_markers']['set'](_0x35750b,{'id':_0x35750b,'groupId':_0x265422['groupId'],'type':_0x265422['type'],'content':_0x265422['content']}),_0x337cda['addMarker'](_0x35750b,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x337cda['createRange'](_0x265422['start'],_0x265422['end'])});}});}['_createGetContextFn'](_0x3d0bbb,_0x1c15cd,_0x12aa4c){let _0x14839e='';return()=>{if(!_0x14839e){const _0x506622=_0x1c15cd['toView'](_0x3d0bbb,{'showSuggestionHighlights':!0x0});let _0x75f5e8=_0x506622['getChild'](0x0);if(_0x75f5e8['is']('containerElement')||(_0x75f5e8=_0x506622),!_0x75f5e8)return'';let _0x32bd8a=!0x1;const _0x4c68d4=[];for(const _0x1b7163 of _0x75f5e8['getChildren']())_0x1b7163['is']('element','span')&&_0x1b7163['hasClass']('ck-ai_review-marker_context-end')&&(_0x32bd8a=!0x1),_0x32bd8a&&_0x4c68d4['push'](_0x1b7163),_0x1b7163['is']('element','span')&&_0x1b7163['hasClass']('ck-ai_review-marker_context-start')&&(_0x32bd8a=!0x0);_0x75f5e8['_removeChildren'](0x0,_0x75f5e8['childCount']),_0x12aa4c?.['ellipsisBefore']&&_0x75f5e8['_appendChild']('…'),_0x75f5e8['_appendChild'](_0x4c68d4),_0x12aa4c?.['ellipsisAfter']&&_0x75f5e8['_appendChild']('…');const _0x9f564f=_0x1c15cd['htmlProcessor']['domConverter']['viewToDom'](_0x506622),_0x2ed64b=_0x1c15cd['htmlProcessor']['htmlWriter']['getHtml'](_0x9f564f);_0x14839e=_0x2ed64b;}return _0x14839e;};}['_createGetContentFn'](_0x1bba1f,_0x195914){let _0x26c6dd='';return()=>(_0x26c6dd||(_0x26c6dd=_0x195914['stringify'](_0x1bba1f,{'showSuggestionHighlights':!0x0})),_0x26c6dd);}['_createGetContentUsingDataIdFn'](_0x2a9e03,_0xc6d465,_0x58577e){let _0x219952='';return()=>{if(!_0x219952){const _0x3f06c6=_0x58577e['toView'](new _0x3d30fd(_0x2a9e03)),_0x5f3e33=_0x58577e['htmlProcessor']['domConverter']['viewToDom'](_0x3f06c6)['querySelector']('[data-id=\x22'+_0xc6d465+'\x22]');_0x219952=_0x5f3e33?.['outerHTML']||'';}return _0x219952;};}['_findMarkerElement'](_0xf47a6f,_0x49871e=0x5){let _0x2b3b9d=_0xf47a6f,_0x7b983c=null;for(let _0x8461b4=0x0;_0x8461b4<_0x49871e&&_0x2b3b9d;_0x8461b4++){if(!_0x2b3b9d['className']){_0x2b3b9d=_0x2b3b9d['parentElement'];continue;}if(!(''+_0x2b3b9d['className'])['includes']('ck-ai_review-marker_')){_0x2b3b9d=_0x2b3b9d['parentElement'];continue;}if(!_0x2b3b9d['getAttribute']('data-marker-id'))break;_0x7b983c=_0x2b3b9d;break;}return _0x7b983c;}['_findMarkerElementById'](_0x4178de){const _0x309dc5=Xs(this['context']),_0x13db14=_0x309dc5['model']['markers']['get'](_0x4178de);return _0x13db14?_0x1c49cd(_0x309dc5['editing'],_0x13db14):null;}['_getMarkersDataForGroup'](_0x400491){return Array['from'](this['_markers']['values']())['filter'](_0x14a0b2=>_0x14a0b2['groupId']===_0x400491);}['_getOperationStart'](_0x4084f3){return'insert'===_0x4084f3['type']?_0x4084f3['position']:_0x4084f3['newRange']['start'];}['_getOperationEnd'](_0x34b2b8,_0x34aaf0=!0x1){return'insert'===_0x34b2b8['type']?_0x34aaf0?_0x34b2b8['position']:_0x34b2b8['position']['getShiftedBy'](_0x34b2b8['howMany']):_0x34b2b8['newRange']['end'];}['_shiftOperation'](_0x3a4318,_0x1b7668){return'insert'===_0x3a4318['type']?_0x3a4318['position']=_0x3a4318['position']['getShiftedBy'](_0x1b7668):'marker'===_0x3a4318['type']&&_0x3a4318['newRange']&&(_0x3a4318['newRange']=new _0x309081(_0x3a4318['newRange']['start']['getShiftedBy'](_0x1b7668),_0x3a4318['newRange']['end']['getShiftedBy'](_0x1b7668))),_0x3a4318;}['_changeOperationOwnerDocument'](_0x18593e,_0x4f6821){'insert'===_0x18593e['type']?_0x18593e['position']=this['_changePositionOwnerDocument'](_0x18593e['position'],_0x4f6821):'marker'===_0x18593e['type']&&_0x18593e['newRange']&&(_0x18593e['newRange']=this['_changeRangeOwnerDocument'](_0x18593e['newRange'],_0x4f6821));}['_changePositionOwnerDocument'](_0x5292ec,_0x2464a1){return new _0x24e947(_0x2464a1,_0x5292ec['path']);}['_changeRangeOwnerDocument'](_0x47ab34,_0x2425fb){return new _0x309081(this['_changePositionOwnerDocument'](_0x47ab34['start'],_0x2425fb),this['_changePositionOwnerDocument'](_0x47ab34['end'],_0x2425fb));}['_changePosition'](_0x57db14,_0x25ba60){return new _0x24e947(_0x25ba60,[..._0x57db14]);}['_changeRange'](_0x4677c8,_0x175926,_0x2e3100,_0x1fa608){return new _0x309081(this['_changePosition'](_0x175926,_0x1fa608),this['_changePosition'](_0x2e3100,_0x1fa608));}['_sortMarkers'](_0x1e2998){const _0x3174b9=_0x2537ef=>{switch(_0x2537ef){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x1e2998['sort']((_0x5b107e,_0xd51eea)=>_0x3174b9(_0x5b107e['type'])-_0x3174b9(_0xd51eea['type']));}['_hasSameTopLevelElement'](_0x14e1df,_0x134e45){const _0x2ea518=_0x14e1df['getChild'](0x0),_0x3ad95b=_0x134e45['getChild'](0x0);return!(!_0x2ea518||!_0x3ad95b)&&((!_0x2ea518['is']('element')||!_0x3ad95b['is']('element')||_0x2ea518['name']===_0x3ad95b['name'])&&!(_0x2ea518['is']('element')&&!_0x3ad95b['is']('element')||!_0x2ea518['is']('element')&&_0x3ad95b['is']('element')));}['_haveSingleTopLevelElement'](_0x34bb16){return 0x1===_0x34bb16['childCount'];}['_haveOnlyInlineContent'](_0x11cdf8,_0x38ca9a){for(const _0x55aa73 of _0x11cdf8['getChildren']())if(_0x55aa73['is']('element')&&!_0x38ca9a['isInline'](_0x55aa73))return!0x1;return!0x0;}['_upsertDataId'](_0x5f2398,_0x491f64){let _0x8fb6e5=_0x5f2398['getAttribute'](_0x2ac232);return _0x8fb6e5||(_0x8fb6e5=_0x491f64(),_0x5f2398['_setAttribute'](_0x2ac232,_0x8fb6e5)),_0x8fb6e5;}}class Ro extends pt(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x249bb9,contentNew:_0x23ecb8,contentInitial:_0x1e163e,documentVersion:_0x18f018}){super(),this['id']=_0x249bb9,this['contentNew']=_0x23ecb8,this['contentInitial']=_0x1e163e,this['documentVersion']=_0x18f018;}}class Oo extends ct(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x457269,_0x14e4e7,_0x55cc76){super(),this['id']=_0x457269,this['parent']=_0x55cc76,this['_data']=_0x14e4e7,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 ko extends ct(){['id']=ot();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x5e9268,_0x439bb2,_0x141baa,_0x290eb6,_0x186cc3){super(),this['_sourceCheck']=_0x439bb2,this['_documentData']=_0x5e9268,this['_aiConnector']=_0x141baa,this['_reviewParams']=_0x290eb6,this['_reviewArgs']=_0x186cc3,this['on']('change:status',(_0x2ee22a,_0x25f63c,_0x3ad162)=>{'aborted'==_0x3ad162&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x3ad162,'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'](_0xe07024=>'pending'===_0xe07024['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x5d7e8e){this['_documentData']=_0x5d7e8e;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x30a989=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x235921 of _0x30a989)'unmodified'!==_0x235921['data']['operation']&&('error'!==_0x235921['data']['operation']?'review-metadata'!==_0x235921['event']?this['_addReviewCheckResult'](_0x235921['data']['dataId'],_0x235921['data']['textDelta']):this['callId']=_0x235921['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(_0x42b186){this['_currentError']=_0x42b186,_0x42b186 instanceof Error&&_0x42b186['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'](_0x39a248,_0x4cd286){const _0x47469c=this['_results']['get'](_0x39a248);if(!_0x47469c)return;if(0x0===_0x4cd286['length'])return;const _0x513df8=[];_0x4cd286['forEach']((_0x2d47fe,_0x139226)=>{const _0x367b3e=new Oo(_0x47469c['id']+'-'+_0x139226,_0x2d47fe,_0x47469c);_0x367b3e['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x367b3e,'status':_0x367b3e['status']});}),_0x367b3e['on']('change:isActivated',()=>{_0x367b3e['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x367b3e}):this['fire']('reviewCheckResultDeactivated',{'change':_0x367b3e});}),this['_changes']['push'](_0x367b3e),_0x513df8['push'](_0x367b3e);}),this['fire']('reviewCheckResultReady',{'changes':_0x513df8,'result':_0x47469c,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x383c21){const _0x46117d=this['_changes']['find'](_0x3763a1=>_0x3763a1['id']===_0x383c21);return!(!_0x46117d||'pending'!==_0x46117d['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x10b45f=>!0x0===_0x10b45f['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x2b5bfa=>'pending'===_0x2b5bfa['status']);}['getChangeById'](_0x2f15cd){return this['_changes']['find'](_0x58df37=>_0x58df37['id']===_0x2f15cd);}['markAllChangesAsAccepted'](){for(const _0x414d67 of this['_changes'])'pending'===_0x414d67['status']&&(_0x414d67['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x6638d3){const _0x361153=this['_changes']['find'](_0x5b02a7=>_0x5b02a7['id']===_0x6638d3);_0x361153&&'pending'===_0x361153['status']&&(_0x361153['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0xccc42b){const _0x17a0f6=this['_changes']['find'](_0x583dcd=>_0x583dcd['id']===_0xccc42b);_0x17a0f6&&'pending'===_0x17a0f6['status']&&(_0x17a0f6['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0xa921b7){const _0x15b2bf=this['_changes']['find'](_0x4764b1=>_0x4764b1['id']===_0xa921b7);_0x15b2bf&&'pending'===_0x15b2bf['status']&&(_0x15b2bf['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x4bb9a4){const _0x3cb5c1=this['_changes']['find'](_0x460ba1=>_0x460ba1['id']===_0x4bb9a4);_0x3cb5c1&&'outdated'===_0x3cb5c1['status']&&(_0x3cb5c1['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x1c28fe){this['_changes']['filter'](_0x277596=>_0x277596['isActivated']&&_0x277596['id']!==_0x1c28fe)['forEach'](_0x54f9c4=>{_0x54f9c4['isActivated']=!0x1;});const _0x255c24=this['_changes']['find'](_0x22514b=>_0x22514b['id']===_0x1c28fe);_0x255c24&&'pending'===_0x255c24['status']&&(_0x255c24['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x451566=>_0x451566['isActivated'])['forEach'](_0x1293a3=>{_0x1293a3['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x563b1d){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x53d025;if(_0x563b1d){const _0x3f3148=this['_changes']['find'](_0x1187fc=>_0x1187fc['id']===_0x563b1d);if(_0x3f3148&&_0x3f3148['isRated'])return;_0x3f3148&&(_0x53d025=_0x3f3148['parent']['id'],_0x3f3148['isRated']=!0x0);}const _0x1a1dfb={'positiveCount':this['_changes']['filter'](_0x515256=>'accepted'===_0x515256['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x1a1dfb,this['callId'],_0x53d025);}['_addReviewCheckResult'](_0x24d367,_0x29c892){const _0x4c8c70=this['_documentData']['elements']['get'](_0x24d367);if(!_0x4c8c70)return;const _0xaa2ae6=_0x4c8c70['getContent']();if(_0xaa2ae6===_0x29c892)return;const _0x33afda=new Ro({'id':_0x24d367,'contentInitial':_0xaa2ae6,'contentNew':_0x29c892,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x33afda['id'],_0x33afda),this['fire']('reviewCheckResultAdded',{'result':_0x33afda,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x1fdb0a=>'pending'===_0x1fdb0a['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x5adedc=>'pending'===_0x5adedc['status'])['length']&&(this['status']='finished'));}}class No extends ko{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x1cfd2d=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x23c1ac=0x0;_0x23c1ac<this['_reviewParams']['length'];_0x23c1ac++){if(!this['_reviewParams'][_0x23c1ac]||!this['_sourceCheck']['options'][_0x23c1ac])continue;const _0x26fedf=this['_sourceCheck']['options'][_0x23c1ac],_0x12cdc9=_0x26fedf['data']?.['find'](_0x3b0b63=>_0x3b0b63['id']===this['_reviewParams'][_0x23c1ac]);_0x12cdc9&&_0x1cfd2d['push'](_0x12cdc9['label']);}return _0x1cfd2d['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x427eb0,_0x3655c9,_0x1861d6){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x3655c9,_0x427eb0,_0x1861d6);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class vo extends _0x4c168b{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[ls];}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(_0x27240e,_0x4eb53)=>{const _0x4b848b=this['_aiReviewCheckList']['getCheckById'](_0x4eb53['id']);if(_0x4b848b){this['_onReviewCheckRun'](_0x4eb53),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x4eb53,_0x4b848b),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x52fdb0,_0x395355)=>{switch(_0x395355['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x395355);break;case'finished':this['_onCheckRunFinished']();break;case'ready':this['_aiReviewCoreUi']['showActionsWhenResultIsReady']();break;case'unmodified':this['_aiReviewCoreUi']['showNoChangesView']();break;case'error-general':this['_aiReviewCoreUi']['showGeneralResultsErrorView'](),this['_logError'](new ht('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new ht('ai-review-mode-check-run-chunk-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'aborted':this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewRunLeave'](!0x0);}'ready'!==_0x395355['status']&&'error-chunk'!==_0x395355['status']&&'error-general'!==_0x395355['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x2536e5,_0x176ada)=>{if(!this['_currentReviewCheckRun'])throw new ht('ai-review-mode-no-current-check-run',this);const _0x4d4f52=this['_diffContent'](_0x176ada['result']['contentInitial'],_0x176ada['result']['contentNew']);_0x176ada['source']['addResultChanges'](_0x176ada['result']['id'],_0x4d4f52);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x4786c8,_0x27285a)=>{for(const _0x1f1fd0 of _0x27285a['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x1f1fd0);this['_markChangePositionInEditorContent'](_0x27285a['changes'],_0x27285a['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x4355b4,_0x4e453c)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x4e453c['change']['id'],_0x4e453c['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x40a4bf,_0x40f8e4)=>{this['_onReviewCheckResultActivated'](_0x40f8e4);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x1d3a4e){_0x1d3a4e instanceof Error&&_0x1d3a4e['message']['includes']('ai-request-aborted')||(_0x1d3a4e instanceof ht?this['_logError'](_0x1d3a4e):this['_logError'](new ht('ai-review-mode-check-run-failed',this,void 0x0,_0x1d3a4e)));}}else this['_logError'](new ht('ai-review-mode-source-check-not-found',this,{'checkId':_0x4eb53['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 _0x44af77=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x44af77['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x44af77['map'](_0x4f47d6=>_0x4f47d6['id']));const _0x139f4a=this['_currentReviewCheckRun'];_0x139f4a['markAllChangesAsAccepted'](),_0x139f4a['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x1bc89c,_0xc54841)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0xc54841['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0xc54841['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0xc54841['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0xc54841['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x11c5b6,_0x234177)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x234177['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x234177['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x234177['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x234177['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',(_0xc19592,_0x5c6d86)=>{this['_onActivateChange'](_0x5c6d86);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x54a018,_0x4fcdcf)=>{this['_onDeactivateChange'](_0x4fcdcf);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x38bec9,_0x4c3c69)=>{this['_onChangeMarkerClicked'](_0x38bec9,_0x4c3c69);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x54ed8e,_0x4a2cb4)=>{this['_onChangeMarkerHovered'](_0x54ed8e,_0x4a2cb4);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x1c9873,_0xd90522)=>{this['_onChangeMarkerRemoved'](_0x1c9873,_0xd90522);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x42dd1e,_0x3aa3d6)=>{this['_onChangeMarkerRestored'](_0x42dd1e,_0x3aa3d6);});}['_createReviewCheckRun'](_0x1f56a1,_0xc9cbf4){return new No(this['_aiReviewCoreEditing']['getDocumentData'](),_0xc9cbf4,this['_aiConnector'],_0x1f56a1['params'],_0x1f56a1['args']);}['_onChangeMarkerRemoved'](_0x4ddaf6,_0x5d737e){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x5d737e['changeId']);}['_onChangeMarkerRestored'](_0x411657,_0x39bd26){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x39bd26['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x4d0d3d=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x4d0d3d&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x56304d=this['_aiReviewCoreEditing']['getEditor']();_0x56304d&&_0x56304d['editing']['view']['change'](_0x3df5ea=>{const _0xca6032=_0x56304d['editing']['view']['document']['getRoot']();_0x3df5ea['removeClass']('ck-ai_review-diff',_0xca6032),_0x3df5ea['removeClass']('ck-ai_review-highlights',_0xca6032),_0x3df5ea['removeClass']('ck-ai-translate-mode-content',_0xca6032);});}['_getTranslationWithDefault'](_0x318099,_0x1945e7){const _0x44599b=us(this['context']['locale'],_0x318099);return _0x44599b===_0x318099?_0x1945e7:_0x44599b;}['_logError'](_0x4fe0ac,_0x3cb905=!0x1){mt(_0x4fe0ac['message']),_0x3cb905||(_0x4fe0ac['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x320895){if('content'===this['_changeActivationSource']){const _0x350ccf=this['_aiReviewCoreUi']['getChangeElement'](_0x320895);_0x350ccf&&ft(_0x350ccf['closest']('.ck-ai_review__check-run-result')||_0x350ccf);}else{if('panel'===this['_changeActivationSource']){const _0x58a173=this['_getChangeContentElement'](_0x320895);if(!_0x58a173)return;Ct({'target':_0x58a173,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}const yo=[{'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 xo{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x58615c){this['id']=_0x58615c['id'],this['commandId']=_0x58615c['commandId'],this['title']=_0x58615c['title'],this['description']=_0x58615c['description'],this['isParameterized']=_0x58615c['isParameterized'],this['useArgs']=_0x58615c['useArgs'],this['options']=_0x58615c['options'],this['args']=_0x58615c['args'];}}class Lo extends ct(){['_checks']=[];['setupChecks'](_0x463a7d){this['_checks']=_0x463a7d['map'](_0x2148e5=>new xo(_0x2148e5));}get['checks'](){return this['_checks'];}['getCheckById'](_0x3618b3){return this['checks']['find'](_0x59851b=>_0x59851b['id']===_0x3618b3);}['removeCheckById'](_0x1f135a){this['_checks']=this['_checks']['filter'](_0x2c4291=>_0x2c4291['id']!==_0x1f135a);}}class Do extends xo{['_models']=[];['_defaultModel']=null;constructor(_0x380567,_0x12a99e,_0x3c3c1b){super(_0x380567),this['_models']=_0x12a99e,this['_defaultModel']=_0x3c3c1b;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class Po extends xo{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x3b2b0e,_0x35ed1a,_0x1a1192){super(_0x3b2b0e),this['prompt']=_0x3b2b0e['prompt'],this['model']=_0x3b2b0e['model'],this['model']?this['_defaultModel']=_0x35ed1a['find'](_0x594d9f=>_0x594d9f['id']===this['model'])||null:this['_defaultModel']=_0x1a1192;}get['defaultModel'](){return this['_defaultModel'];}}class Ho extends Lo{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x2b4aa6,_0x4d58fe,_0x272265){super(),this['_allModels']=_0x2b4aa6,this['_recommendedModels']=_0x4d58fe,this['_defaultModel']=_0x272265;}['setupChecks'](_0x109d33){this['_checks']=_0x109d33['map'](_0x4aab4a=>!0x0===_0x4aab4a['isExtra']?new Po(_0x4aab4a,this['_allModels'],this['_defaultModel']):'custom'===_0x4aab4a['id']?new Do(_0x4aab4a,this['_recommendedModels'],this['_defaultModel']):new xo(_0x4aab4a));}}class Mo extends ko{['_prompt'];['_model'];constructor(_0x37cb85,_0x240081,_0x29c1e2,_0x298d13,_0x142f7d){super(_0x29c1e2,_0x298d13,_0x142f7d),this['_prompt']=_0x37cb85,this['_model']=_0x240081;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x2dbf10,_0x3dafa5,_0x1bedf8){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x3dafa5,_0x2dbf10,_0x1bedf8);}}class Uo extends Mo{get['subTitle'](){return'';}set['prompt'](_0xf84e92){this['_prompt']=_0xf84e92;}set['model'](_0x21b456){this['_model']=_0x21b456;}}class Vo extends vo{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x21bf41){super(_0x21bf41),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',yo['map'](_0x101a54=>_0x101a54['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x43f707,_0x8192e4)=>{this['_isDiffOn']=_0x8192e4['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x2a6677,_0x2482c3){return _0x2a6677['isCustom']?new Mo(_0x2a6677['args']['prompt'],_0x2a6677['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x2482c3,this['_aiConnector']):_0x2482c3['isExtra']?new Uo(_0x2482c3['prompt'],_0x2482c3['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x2482c3,this['_aiConnector']):new No(this['_aiReviewCoreEditing']['getDocumentData'](),_0x2482c3,this['_aiConnector'],_0x2a6677['params'],_0x2a6677['args']);}['_onReviewCheckResultActivated'](_0x268d2a){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x268d2a['change']['id']),this['_scrollToChange'](_0x268d2a['change']['id']);const _0x143240=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x268d2a['change']['id']);if(!_0x143240)return;const _0x5b5041=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x268d2a['change'],()=>_0x143240['getElement'](),void 0x0,'click',_0x5b5041?.['editing']?.['view']?.['getDomRoot'](),_0x5b5041?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x268d2a['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x1ab572){this['_currentReviewCheckRun']&&'click'===_0x1ab572['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x1ab572['id']));}['_onDeactivateChange'](_0xb33f8a){this['_currentReviewCheckRun']&&'balloon'===_0xb33f8a['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x4f1bbc,_0x48771b){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x48771b['changeId']);const _0x1e49e8=this['_currentReviewCheckRun']['getChangeById'](_0x48771b['changeId']);if(!_0x1e49e8)return;const _0x309def=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x1e49e8,_0x48771b['markerElement'],_0x48771b['domEvent'],'click',_0x309def?.['editing']?.['view']?.['getDomRoot'](),_0x309def?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x36b588,_0x544922){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x248223=this['_currentReviewCheckRun']['getChangeById'](_0x544922['changeId']);if(!_0x248223)return;const _0x13175b=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x248223,_0x544922['markerElement'],_0x544922['domEvent'],'hover',_0x13175b?.['editing']?.['view']?.['getDomRoot'](),_0x13175b?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x45d9fd){const _0x4283e4=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x45d9fd);return _0x4283e4?_0x4283e4['getElement']():null;}['_markChangePositionInEditorContent'](_0x764381,_0x1919ae){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x764381,_0x1919ae);}['_diffContent'](_0x46dade,_0x3c0f7d){return this['_aiReviewCoreEditing']['diffContent'](_0x46dade,_0x3c0f7d);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x13fbde){const _0x4ee436=this['_aiReviewCoreEditing']['getEditor']();_0x13fbde?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x4ee436&&_0x4ee436['editing']['view']['change'](_0x5c7e83=>{const _0x345915=_0x4ee436['editing']['view']['document']['getRoot']();for(const _0x5070b5 of _0x345915['getClassNames']())_0x5070b5['startsWith']('ck-ai_review-')&&_0x5c7e83['removeClass'](_0x5070b5,_0x345915);_0x5c7e83['addClass'](_0x13fbde?'ck-ai_review-diff':'ck-ai_review-highlights',_0x345915);});}async['_getChecksList'](){const _0x57c1b6=[...yo,...this['_getExtraChecks']()],_0x38dfec=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x38dfec,_0x57c1b6);let _0x35715f=_0x57c1b6;this['_hasDefaultAvailableCommands']||(_0x35715f=_0x38dfec['map'](_0x35b881=>_0x57c1b6['find'](_0x37f99b=>_0x37f99b['id']===_0x35b881))['filter'](_0x250637=>!!_0x250637)),_0x35715f=_0x35715f['map'](_0xacf66e=>_0xacf66e['isExtra']?_0xacf66e:this['_translateReviewCheck'](_0xacf66e));const _0xb0bde3=_0x35715f['some'](_0x338a6c=>_0x338a6c['isExtra']||'custom'===_0x338a6c['id']);let _0x340e69=[],_0x4f19e8=[],_0x222185=null;if(_0xb0bde3){const _0x5a9c93=await this['_getModels']();_0x340e69=_0x5a9c93['all'],_0x4f19e8=_0x5a9c93['recommended'],_0x222185=_0x5a9c93['default'];}const _0xc7186=new Ho(_0x340e69,_0x4f19e8,_0x222185);return _0xc7186['setupChecks'](_0x35715f),_0xb0bde3&&this['_filterChecksWithMissingModel'](_0xc7186),_0xc7186;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x33751=>({'id':_0x33751['id'],'commandId':_0x33751['id'],'title':_0x33751['label'],'description':_0x33751['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x33751['prompt'],'model':_0x33751['model']}));}['_logErrorForNonExistentChecks'](_0x412af5,_0x12c8df){const _0x2a2ed5=_0x412af5['filter'](_0x244219=>!_0x12c8df['some'](_0x5599c9=>_0x5599c9['id']===_0x244219));_0x2a2ed5['length']&&this['_logError'](new ht('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x2a2ed5['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x43243e=new qs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x43243e['getAll'](),'recommended':await _0x43243e['getAvailableModels'](),'default':await _0x43243e['getDefault']()};}catch(_0x23fa7f){return this['_logError'](new ht('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x23fa7f)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x2093d9){const _0x4c6166='AI_REVIEW_CHECK_'+_0x2093d9['id']['toUpperCase']()['replaceAll']('-','_'),_0x5229b3={..._0x2093d9,'title':this['_getTranslationWithDefault'](_0x4c6166+'_TITLE',_0x2093d9['title']),'description':this['_getTranslationWithDefault'](_0x4c6166+'_DESCRIPTION',_0x2093d9['description'])};return _0x2093d9['options']&&(_0x5229b3['options']=_0x2093d9['options']['map'](_0x33c3bc=>({..._0x33c3bc,'label':this['_getTranslationWithDefault'](_0x4c6166+'_OPTIONS_LABEL',_0x33c3bc['label']||''),'data':_0x33c3bc['data']?_0x33c3bc['data']['map'](_0x197239=>({..._0x197239,'label':this['_getTranslationWithDefault'](_0x4c6166+'_OPTIONS_DATA_'+_0x197239['id']['toUpperCase'](),_0x197239['label'])})):void 0x0}))),_0x5229b3;}['_filterChecksWithMissingModel'](_0x532505){const _0x5e3473=[];_0x532505['checks']['forEach'](_0x5bda53=>{(_0x5bda53 instanceof Po&&!_0x5bda53['defaultModel']||_0x5bda53 instanceof Do&&!_0x5bda53['models']['length'])&&_0x5e3473['push'](_0x5bda53['id']);}),_0x5e3473['length']&&_0x5e3473['forEach'](_0xeda1=>{_0x532505['removeCheckById'](_0xeda1),this['_logError'](new ht('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0xeda1}),!0x0);});}}class Bo extends _0x4c168b{static get['requires'](){return[Vo,fo,bo];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Go extends xo{get['apiId'](){return'translate';}}class Fo extends Lo{['setupChecks'](_0x5e529e){this['_checks']=_0x5e529e['map'](_0x12f01c=>new Go(_0x12f01c));}}class Ko extends No{['_title'];constructor(_0x2ee9df,_0x55dcd9,_0x5ee64a,_0x5983e6,_0x189b0c,_0x4743f5){super(_0x2ee9df,_0x55dcd9,_0x5ee64a,_0x189b0c,_0x4743f5),this['_title']=_0x5983e6;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class Wo extends vo{static get['pluginName'](){return'AITranslateController';}constructor(_0x461ffb){super(_0x461ffb),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'](_0x36a7a1,_0x46c20c){return new Ko(this['_aiReviewCoreEditing']['getDocumentData'](),_0x46c20c,this['_aiConnector'],us(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x36a7a1['params'],_0x36a7a1['args']);}['_onReviewCheckResultActivated'](_0xac63ac){this['_aiReviewCoreUi']['setActiveStateInResults'](_0xac63ac['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0xac63ac['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0xf2dc82){this['_currentReviewCheckRun']&&('hover'===_0xf2dc82['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0xf2dc82['id'])),'click'===_0xf2dc82['uiInteraction']&&this['_scrollToChange'](_0xf2dc82['id']));}['_onDeactivateChange'](_0x4a198c){this['_currentReviewCheckRun']&&'panel'===_0x4a198c['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x5dceb1,_0x197bdb){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x197bdb['changeId']),this['_scrollToChange'](_0x197bdb['changeId']));}['_onChangeMarkerHovered'](_0x40623a,_0x1a3e95){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x1a3e95['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x1a3e95['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x56dd8f){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x56dd8f);}['_markChangePositionInEditorContent'](_0x3fdaa1,_0x2925ba){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x3fdaa1,_0x2925ba);}['_diffContent'](_0x2e546b,_0xff38c1){return this['_aiReviewCoreEditing']['diffContent'](_0x2e546b,_0xff38c1,!0x0);}['_onReviewCheckRun'](){const _0x5dfcca=this['_aiReviewCoreEditing']['getEditor']();_0x5dfcca&&_0x5dfcca['editing']['view']['change'](_0x45c9bb=>{const _0x3a08d8=_0x5dfcca['editing']['view']['document']['getRoot']();for(const _0x36ce34 of _0x3a08d8['getClassNames']())(_0x36ce34['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0x36ce34)&&_0x45c9bb['removeClass'](_0x36ce34,_0x3a08d8);_0x45c9bb['addClass']('ck-ai-translate-mode-content',_0x3a08d8);});}async['_getChecksList'](){const _0x215785=[],_0x54e66f=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x22f239 of _0x54e66f)_0x215785['push']({'title':_0x22f239['label'],'id':_0x22f239['id'],'commandId':_0x22f239['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x22f239['id']}});const _0xf2d998=new Fo();return _0xf2d998['setupChecks'](this['_translateChecks'](_0x215785)),_0xf2d998;}['_translateChecks'](_0x424857){return _0x424857['map'](_0x37d7fb=>{const _0x5e0736='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x37d7fb['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x37d7fb,'title':this['_getTranslationWithDefault'](_0x5e0736,_0x37d7fb['title'])};});}}class Yo extends _o{constructor(_0x27cd4e,_0x42f68d){super(_0x27cd4e,_0x42f68d),this['on']('set:isLoading',(_0x1b21ba,_0x3b6087,_0x2f5429)=>{_0x2f5429&&(this['headerTitle']=us(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x19c431,_0x26c4cc,_0x6d10de)=>{_0x6d10de&&(this['headerTitle']=us(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x3d4a22=super['_createAcceptAllButtonView']();return _0x3d4a22['set']('label',us(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x3d4a22;}['_createExitReviewButtonView'](){const _0x373d54=super['_createExitReviewButtonView']();return _0x373d54['set']('label',us(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x373d54;}}class $o extends wo{['_setupTemplate'](){const _0x1c4a61=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x1c4a61['if']('isVisible','ck-hidden',_0x4e29b5=>!_0x4e29b5)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':us(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':us(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x1c4a61['if']('isVisible','ck-hidden',_0xd4396=>!_0xd4396)]},'children':this['_checkViews']}]});}}class qo extends ho{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x4a69ad=this['context']['locale'],_0x2ef390=new _0x3c9a0a(_0x4a69ad,{'label':us(_0x4a69ad,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x27d1e6,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x5a69d2=new lo(_0x4a69ad,{'header':_0x2ef390,'list':new $o(_0x4a69ad),'results':new Yo(_0x4a69ad,{'generalErrorText':us(_0x4a69ad,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new Ao(_0x4a69ad,{'headerText':us(_0x4a69ad,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':us(_0x4a69ad,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':us(_0x4a69ad,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x5a69d2['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x5a69d2;}['registerTab'](){const _0x570279=this['context']['plugins']['get']('AITabs');_0x570279['view']['on']('activateTab',(_0x4422e2,_0x8b490e)=>{'translate'===_0x8b490e?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x570279['view']['addTab']({'id':'translate','buttonLabel':us(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x27d1e6,'order':0x0,'content':this['_mainView']});}}class Qo extends _0x4c168b{static get['requires'](){return[Wo,qo,bo];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{eo as AIActions,io as AIActionsNames,Ni as AIAdapter,Ji as AIAssistant,Xi as AIAssistantUI,ka as AIBalloon,Ea as AIChat,Js as AIChatController,Ia as AIChatHistory,ga as AIChatHistoryController,da as AIChatHistoryUI,wa as AIChatShortcuts,aa as AIChatUI,ls as AIConnector,tn as AIEditing,La as AIEditorIntegration,no as AIQuickActionType,so as AIQuickActions,Ya as AIQuickActionsUI,vi as AIRequestError,xo as AIReviewCheck,Ro as AIReviewCheckResult,ko as AIReviewCheckRun,Bo as AIReviewMode,vo as AIReviewModeController,bo as AIReviewModeEditing,fo as AIReviewModeUI,cs as AITabs,ts as AITextAdapter,Sa as AIToggleButtonUI,Qo as AITranslate,Wo as AITranslateController,qo as AITranslateUI,is as AWSTextAdapter,es as OpenAITextAdapter,xi as ShowAIAssistantCommand,fa as ToggleAICommand,gs as createResizeButton,Zi as getDefaultAICommands};
23
+ import{Plugin as _0x43ff17,Command as _0x2228a8,ContextPlugin as _0x3627a2,Editor as _0x384afe}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x59cf80,IconCheck as _0x464c2a,IconError as _0x387f7c,IconSubmit as _0x4dc6e3,IconAIHistory as _0x596529,IconMagicWand as _0x8fe631,IconRobotPencil as _0x1a84a7,IconMaximize as _0x5bc3ee,IconMinimize as _0x1ca6da,IconShowChangesOn as _0x2c7f0b,IconShowChangesOff as _0x375f54,IconDocument as _0x2e0dbc,IconBoxWithCross as _0x28fe3a,IconBoxWithCheck as _0x618867,IconBoxWithMarker as _0x5c141e,IconInfo as _0x525c75,IconWeb as _0x2744df,IconCancel as _0x15dd63,IconSelection as _0x585ec3,IconFileUpload as _0x193c98,IconLink as _0x3bb8f4,IconBulb as _0x21368f,IconAI as _0x56a7dd,IconPreviousArrow as _0x4a9e46,IconDocumentOutline as _0x287bcc,IconLoupe as _0x413c10,IconPaperClip as _0x279e8a,IconBrowseFiles as _0x2f4323,IconDropdownArrow as _0x38dbb6,IconStop as _0x7c8fb,IconAIChat as _0x5ac6f6,IconPlus as _0x1f8e2f,IconPin as _0x1d3cb6,IconThreeHorizontalDots as _0x2a3090,IconAIReview as _0x217aa1,IconAITranslate as _0x2c155e,IconAIAskAI as _0xd0d6ef,IconThumbUp as _0x3476bd,IconThumbDown as _0x203942,IconChevronDown as _0x320d1d,IconChevronUp as _0x12423b,IconAIQuickActions as _0x1161ca,IconAIChatCommands as _0x5e9b2c,IconAIImproveWriting as _0x398c1e,IconAIContinueWriting as _0x102de9,IconAIGrammarCheck as _0x1c0d0e,IconAIAdjustLength as _0x139570,IconAIChangeTone as _0x51a8af,IconAIOther as _0x405cab,IconRefresh as tt,IconNextArrow as et,IconOutdated as it,IconEye as st,IconEyeCrossedOut as nt,IconChevronRight as rt}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as at,CKEditorError as ot,ObservableMixin as ht,global as ct,isVisible as lt,Rect as ut,Collection as dt,FocusTracker as _t,KeystrokeHandler as At,first as gt,logWarning as It,logError as Et,toArray as Tt,EmitterMixin as pt,scrollViewportToShowTarget as mt,insertToPriorityArray as Ct,scrollAncestorsToShowTarget as wt,ResizeObserver as ft,_isMotionReduced as St,getConstrainedViewportRect as bt,DomEmitterMixin as Rt}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as Ot,ButtonView as kt,View as Nt,SpinnerView as vt,IconView as yt,AutocompleteView as xt,ListView as Lt,ListItemGroupView as Dt,ListItemView as Pt,ButtonLabelView as Ht,FocusCycler as Mt,createLabeledTextarea as Ut,Dialog as Vt,createDropdown as Bt,addMenuToDropdown as Gt,MenuBarMenuView as Ft,MenuBarMenuListItemButtonView as Kt,DialogViewPosition as Wt,MenuBarMenuListView as Yt,MenuBarMenuListItemView as $t,BodyCollection as qt,BalloonPanelView as Qt,clickOutsideHandler as Xt,addListToDropdown as zt,UIModel as jt,submitHandler as Jt,LabeledFieldView as Zt,createLabeledInputText as te,FormHeaderView as _0x222d65,HighlightedTextView as _0x387701,ViewCollection as _0x192828,FileDialogButtonView as _0x48643e,InputTextView as _0x1ecad1,SearchTextView as _0x337eea,ListItemButtonView as _0x356921,ButtonLabelWithHighlightView as _0x3a0961,DropdownMenuPanelPositioningFunctions as _0x511df3,BalloonToolbar as _0x16d5e0,FormRowView as _0x8ed428,TextareaView as _0x4d4702}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x37a20,ClipboardMarkersUtils as _0x4712da}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x27c07a,ViewDataTransfer as _0x2d0edf,ViewUpcastWriter as _0x423e20,Matcher as _0x540477,_DetachOperation as _0x4c0de8,_insertIntoModelNodeList as _0x278795,_removeFromModelNodeList as _0x51dc35,ModelRange as _0x25d743,transformOperationSets as _0x510b2f,ViewDowncastWriter as _0x3290f9,ModelDocumentFragment as _0x15fa01,ModelPosition as _0x5f4486,ModelTreeWalker as _0x451881,MarkerOperation as _0x46b1c0,InsertOperation as _0x2274ec}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x58e669,escape as _0x589baa,cloneDeep as _0x8a7085,escapeRegExp as _0x474e41,debounce as _0x17bcb8}from'es-toolkit/compat';import{createParser as _0x2dd8b7}from'eventsource-parser';import{CloudServices as _0x1c65ab}from'@ckeditor/ckeditor5-cloud-services/dist/index.js';import{parseDocument as _0x13062e}from'htmlparser2';import{isTag as _0x580299,findOne as _0x290822,getParent as _0x5453a3,findAll as _0x40b708,removeElement as _0x592694,replaceElement as _0x41e91b,prepend as _0x39adba,prependChild as _0x4c35bf,appendChild as _0x2618a1,append as _0x38ed53,find as _0x3bdfea,isComment as _0x10998d,getChildren as _0x28867a,textContent as _0x107521}from'domutils';import _0xaa1346 from'dom-serializer';import{Document as _0x4c3622,Element as ti,Text as _0x230874,cloneNode as _0x17fa10,isDocument as _0x3cd231,isText as _0xe5f4cc,NodeWithChildren as _0x3d4e85}from'domhandler';import{MarkdownGfmMdToHtmlDefaultPlugins as _0x6d33e3,MarkdownGfmMdToHtml as _0x3a73d2}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import _0x2c24e0 from'rehype-sanitize';import{fixElementSuggestionRange as _0x3ad3ef,DocumentCompare as _0x45eadc,DATA_ID_MODEL_ATTRIBUTE as _0x2332a9,ConfirmMixin as _0x5ab1ce,getAllMarkersDomElementsSorted as _0xfa1faa,SuggestionsConversion as _0x3d3d21,DATA_ID_VIEW_ATTRIBUTE as _0x289a09,getMarkerDomElement as _0x5686b2}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import _0x1d2c9c from'morphdom';import{diffArrays as _0x53b741}from'diff';const pi='_ungrouppedCommands';function mi(_0x493f71,_0x178e4c){const _0x1f3f3c=(0x0,_0x178e4c['t'])('Other');return _0x493f71['length']?'groupId'in _0x493f71[0x0]?_0x493f71:[{'groupId':pi,'groupLabel':_0x1f3f3c,'order':0x1/0x0,'commands':_0x493f71}]:[{'groupId':pi,'groupLabel':_0x1f3f3c,'order':0x1/0x0,'commands':[]}];}const Ci=globalThis['DataTransfer'],wi='ai-ui';class fi extends _0x43ff17{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x20cd91}=this,_0x4f8847=['ck-fake-ai-selection'];_0x20cd91['config']['get']('ai.assistant.useTheme')&&_0x4f8847['push']('ck-ai-assistant-ui_theme'),_0x20cd91['conversion']['for']('editingDowncast')['markerToHighlight']({'model':wi,'view':{'classes':_0x4f8847,'priority':0xc}}),_0x20cd91['conversion']['for']('editingDowncast')['markerToElement']({'model':wi,'view':(_0xc62208,{writer:_0x13c3f7})=>{if(!_0xc62208['markerRange']['isCollapsed'])return null;const _0x510929=_0x13c3f7['createUIElement']('span');return _0x13c3f7['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x510929),_0x510929;}});}['afterInit'](){!async function(_0x341969){const _0x2efc1b=_0x1eeef3([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]),_0x6b3d72=0x3dffc4e1,_0x10546a=0x3df84159^_0x6b3d72,_0x55edb1=window[_0x1eeef3([0x44,0x61,0x74,0x65])][_0x1eeef3([0x6e,0x6f,0x77])](),_0x36d588=_0x341969[_0x1eeef3([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x253a9f=new window[(_0x1eeef3([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4d6fc5=>{_0x36d588[_0x1eeef3([0x6f,0x6e,0x63,0x65])](_0x1eeef3([0x72,0x65,0x61,0x64,0x79]),_0x4d6fc5);}),_0x3bc3a0={[_0x1eeef3([0x6b,0x74,0x79])]:_0x1eeef3([0x45,0x43]),[_0x1eeef3([0x75,0x73,0x65])]:_0x1eeef3([0x73,0x69,0x67]),[_0x1eeef3([0x63,0x72,0x76])]:_0x1eeef3([0x50,0x2d,0x32,0x35,0x36]),[_0x1eeef3([0x78])]:_0x1eeef3([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]),[_0x1eeef3([0x79])]:_0x1eeef3([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]),[_0x1eeef3([0x61,0x6c,0x67])]:_0x1eeef3([0x45,0x53,0x32,0x35,0x36])},_0x473b76=_0x36d588[_0x1eeef3([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x1eeef3([0x67,0x65,0x74])](_0x1eeef3([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x10f6c2(){let _0x30c01b,_0x55c73a=null,_0x55e0e9=null;try{if(_0x473b76==_0x1eeef3([0x47,0x50,0x4c]))return _0x1eeef3([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x30c01b=_0x39b788(),!_0x30c01b)return _0x1eeef3([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x30c01b[_0x1eeef3([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x55e0e9=_0x57e3bb(_0x30c01b[_0x1eeef3([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x30c01b[_0x1eeef3([0x6a,0x74,0x69])])),await _0x449741()?_0x392642()?_0x153658()?_0x1eeef3([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x49b307()?(_0x30c01b[_0x1eeef3([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x1eeef3([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x55c73a=_0x2ba161(_0x1eeef3([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x3f684f()):_0x1eeef3([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x1eeef3([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x1eeef3([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x1eeef3([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x153658(){const _0x1c0a36=[_0x1eeef3([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x1eeef3([0x74,0x72,0x69,0x61,0x6c])][_0x1eeef3([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x30c01b[_0x1eeef3([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x55edb1/0x3e8:0xe10*_0x10546a;return _0x30c01b[_0x1eeef3([0x65,0x78,0x70])]<_0x1c0a36;}function _0x392642(){const _0xc7bfc0=_0x30c01b[_0x1eeef3([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0xc7bfc0&&(!!_0xc7bfc0[_0x1eeef3([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1eeef3([0x2a]))||!!_0xc7bfc0[_0x1eeef3([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1eeef3([0x41,0x49])));}function _0x49b307(){const _0x4498fa=_0x30c01b[_0x1eeef3([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x4498fa||0x0==_0x4498fa[_0x1eeef3([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x1ddcd7}=new URL(window[_0x1eeef3([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x4498fa[_0x1eeef3([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1ddcd7))return!0x0;const _0x3187d6=_0x1ddcd7[_0x1eeef3([0x73,0x70,0x6c,0x69,0x74])](_0x1eeef3([0x2e]));return _0x4498fa[_0x1eeef3([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x12894f=>_0x12894f[_0x1eeef3([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1eeef3([0x2a])))[_0x1eeef3([0x6d,0x61,0x70])](_0x16493f=>_0x16493f[_0x1eeef3([0x73,0x70,0x6c,0x69,0x74])](_0x1eeef3([0x2e])))[_0x1eeef3([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x16ec0d=>_0x16ec0d[_0x1eeef3([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x3187d6[_0x1eeef3([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x1eeef3([0x6d,0x61,0x70])](_0x1e39dc=>Array(_0x3187d6[_0x1eeef3([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x1e39dc[_0x1eeef3([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x1eeef3([0x66,0x69,0x6c,0x6c])](_0x1e39dc[0x0]===_0x1eeef3([0x2a])?_0x1eeef3([0x2a]):'')[_0x1eeef3([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x1e39dc))[_0x1eeef3([0x73,0x6f,0x6d,0x65])](_0x2411e7=>_0x3187d6[_0x1eeef3([0x65,0x76,0x65,0x72,0x79])]((_0x11cde9,_0x632ea2)=>_0x2411e7[_0x632ea2]===_0x11cde9||_0x2411e7[_0x632ea2]===_0x1eeef3([0x2a])));}function _0x3f684f(){return _0x55c73a&&_0x55e0e9?new window[(_0x1eeef3([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x563849,_0x26bc5c)=>{_0x55c73a[_0x1eeef3([0x74,0x68,0x65,0x6e])](_0x563849,_0x26bc5c),_0x55e0e9[_0x1eeef3([0x74,0x68,0x65,0x6e])](_0x130ed1=>{_0x130ed1!=_0x1eeef3([0x56,0x61,0x6c,0x69,0x64])&&_0x563849(_0x130ed1);},_0x26bc5c);}):_0x55c73a||_0x55e0e9||_0x1eeef3([0x56,0x61,0x6c,0x69,0x64]);}}function _0x57e3bb(_0x3d5eaa,_0x432218){return new window[(_0x1eeef3([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x161cdc=>{if(_0x1c313d())return _0x161cdc(_0x1eeef3([0x56,0x61,0x6c,0x69,0x64]));_0xcaaebd(),_0x36d588[_0x1eeef3([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x1eeef3([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x43aea9=!0x1;const _0x5f0a75=at();function _0x33dacd(_0x4a1d0a){return!!_0x4a1d0a&&(typeof _0x4a1d0a===_0x1eeef3([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x4a1d0a===_0x1eeef3([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x4a1d0a[_0x1eeef3([0x74,0x68,0x65,0x6e])]===_0x1eeef3([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x4a1d0a[_0x1eeef3([0x63,0x61,0x74,0x63,0x68])]===_0x1eeef3([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x8ef45d(_0x2ddac2){_0x1fd997(_0x2ddac2)[_0x1eeef3([0x74,0x68,0x65,0x6e])](_0x5150f9=>{if(!_0x5150f9||_0x5150f9[_0x1eeef3([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x1eeef3([0x6f,0x6b]))return _0x1eeef3([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x2e8228(_0x5e6eba(_0x5f0a75+_0x432218))!=_0x5150f9[_0x1eeef3([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x1eeef3([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x1eeef3([0x56,0x61,0x6c,0x69,0x64]);})[_0x1eeef3([0x74,0x68,0x65,0x6e])](_0x12bdc9=>(_0x5558e1(),_0x12bdc9),()=>{const _0x5574f6=_0x124fa7();return null==_0x5574f6?(_0x5558e1(),_0x1eeef3([0x56,0x61,0x6c,0x69,0x64])):_0x1eeef3(_0x55edb1-_0x5574f6>(0x19f340e1^_0x6b3d72)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x1eeef3([0x74,0x68,0x65,0x6e])](_0x161cdc)[_0x1eeef3([0x63,0x61,0x74,0x63,0x68])](()=>{_0x161cdc(_0x1eeef3([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x158ea2=0x3dc92a61^_0x6b3d72;function _0x5558e1(){const _0x11ae84=_0x1eeef3([0x6c,0x6c,0x63,0x74,0x2d])+_0x2e8228(_0x5e6eba(_0x3d5eaa)),_0x380707=_0x190473(_0x2e8228(window[_0x1eeef3([0x4d,0x61,0x74,0x68])][_0x1eeef3([0x63,0x65,0x69,0x6c])](_0x55edb1/_0x158ea2)));window[_0x1eeef3([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x1eeef3([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x11ae84,_0x380707);}function _0x124fa7(){const _0x198de8=_0x1eeef3([0x6c,0x6c,0x63,0x74,0x2d])+_0x2e8228(_0x5e6eba(_0x3d5eaa)),_0x2cec03=window[_0x1eeef3([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x1eeef3([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x198de8);return _0x2cec03?window[_0x1eeef3([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x190473(_0x2cec03),0x10)*_0x158ea2:null;}function _0x1fd997(_0x2f984a){return new window[(_0x1eeef3([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x72cea2,_0x3f5de9)=>{_0x2f984a[_0x1eeef3([0x74,0x68,0x65,0x6e])](_0x72cea2,_0x3f5de9),window[_0x1eeef3([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x3f5de9,0x3dfe1021^_0x6b3d72);});}}_0x36d588[_0x1eeef3([0x6f,0x6e])](_0x1eeef3([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x5d32db,_0x355aa7)=>{if(_0x355aa7[0x0]!=_0x3d5eaa)return _0x161cdc(_0x1eeef3([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x355aa7[0x1]={..._0x355aa7[0x1],[_0x1eeef3([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x5f0a75};},{[_0x1eeef3([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x1eeef3([0x68,0x69,0x67,0x68])}),_0x36d588[_0x1eeef3([0x6f,0x6e])](_0x1eeef3([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x31c759=>{_0x33dacd(_0x31c759[_0x1eeef3([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x43aea9=!0x0,_0x8ef45d(_0x31c759[_0x1eeef3([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x1eeef3([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x1eeef3([0x6c,0x6f,0x77])}),_0x253a9f[_0x1eeef3([0x74,0x68,0x65,0x6e])](()=>{_0x43aea9||_0x161cdc(_0x1eeef3([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x1c313d(){return _0x36d588[_0x1eeef3([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x1eeef3([0x76,0x69,0x65,0x77])][_0x1eeef3([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x1eeef3([0x61,0x75,0x74,0x6f]);}function _0xcaaebd(){_0x36d588[_0x1eeef3([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x1eeef3([0x76,0x69,0x65,0x77])][_0x1eeef3([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x1eeef3([0x61,0x75,0x74,0x6f]);}}function _0x2ba161(_0x6cc20){const _0x1b1cfd=[new window[(_0x1eeef3([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5b3d43=>setTimeout(_0x5b3d43,0x3df6fa2d^_0x6b3d72)),_0x253a9f[_0x1eeef3([0x74,0x68,0x65,0x6e])](()=>new window[(_0x1eeef3([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x56a685=>{let _0x1f5560=0x0;_0x36d588[_0x1eeef3([0x6d,0x6f,0x64,0x65,0x6c])][_0x1eeef3([0x6f,0x6e])](_0x1eeef3([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x29fd70,_0x265434)=>{_0x265434[0x0][_0x1eeef3([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x1f5560++,_0x1f5560==(0x3dffc109^_0x6b3d72)&&(_0x56a685(),_0x29fd70[_0x1eeef3([0x6f,0x66,0x66])]());});}))];return window[_0x1eeef3([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x1eeef3([0x72,0x61,0x63,0x65])](_0x1b1cfd)[_0x1eeef3([0x74,0x68,0x65,0x6e])](()=>_0x6cc20);}async function _0x28bfbe(){await _0x253a9f,_0x36d588[_0x1eeef3([0x6d,0x6f,0x64,0x65,0x6c])][_0x1eeef3([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x421c20,_0x36d588[_0x1eeef3([0x6d,0x6f,0x64,0x65,0x6c])][_0x1eeef3([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x421c20,_0x36d588[_0x1eeef3([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x1eeef3([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x216a5c(_0x55d588){const _0x140cca=_0x46dcef();_0x36d588[_0x140cca]=_0x1eeef3([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x55d588,_0x55d588!=_0x1eeef3([0x56,0x61,0x6c,0x69,0x64])&&_0x28bfbe();}function _0x46dcef(){const _0x5f4590=window[_0x1eeef3([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x1eeef3([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x1eeef3([0x6e,0x6f,0x77])]())[_0x1eeef3([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x1eeef3([0x2e]),'');let _0x19688d=_0x1eeef3([0x6e]);for(let _0x169aca=0x0;_0x169aca<_0x5f4590[_0x1eeef3([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x169aca+=0x2){let _0x280ecb=window[_0x1eeef3([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5f4590[_0x1eeef3([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x169aca,_0x169aca+0x2));_0x280ecb>=_0x2efc1b[_0x1eeef3([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x280ecb-=_0x2efc1b[_0x1eeef3([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x19688d+=_0x2efc1b[_0x280ecb];}return _0x19688d;}function _0x39b788(){const _0x520708=_0x473b76[_0x1eeef3([0x73,0x70,0x6c,0x69,0x74])](_0x1eeef3([0x2e]));if(0x3!=_0x520708[_0x1eeef3([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x4a47e7(_0x520708[0x1]);function _0x4a47e7(_0x48b584){const _0x306835=_0x4d0de9(_0x48b584);return _0x306835&&_0x48d2cd()?_0x306835:null;function _0x48d2cd(){const _0x1f9894=_0x306835[_0x1eeef3([0x6a,0x74,0x69])],_0x1e7bc8=window[_0x1eeef3([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1f9894[_0x1eeef3([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x1f9894[_0x1eeef3([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x171795={..._0x306835,[_0x1eeef3([0x6a,0x74,0x69])]:_0x1f9894[_0x1eeef3([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x1f9894[_0x1eeef3([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x171795[_0x1eeef3([0x76,0x63])],_0x5e6eba(_0x171795)==_0x1e7bc8;}}}async function _0x449741(){let _0x574326=!0x0;try{const _0xb25add=_0x473b76[_0x1eeef3([0x73,0x70,0x6c,0x69,0x74])](_0x1eeef3([0x2e])),[_0x49730a,_0x1f05cd,_0x1b8b07]=_0xb25add;return _0x27c141(_0x49730a),await _0x49ce15(_0x49730a,_0x1f05cd,_0x1b8b07),_0x574326;}catch{return!0x1;}function _0x27c141(_0x4230ba){const _0x1f270a=_0x4d0de9(_0x4230ba);_0x1f270a&&_0x1f270a[_0x1eeef3([0x61,0x6c,0x67])]==_0x1eeef3([0x45,0x53,0x32,0x35,0x36])||(_0x574326=!0x1);}async function _0x49ce15(_0x1ade71,_0x23b055,_0x52e4b8){const _0x26eef=window[_0x1eeef3([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x1eeef3([0x66,0x72,0x6f,0x6d])](_0x30639c(_0x52e4b8),_0x29c0fb=>_0x29c0fb[_0x1eeef3([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x2d0686=new window[(_0x1eeef3([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x1eeef3([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x1ade71+_0x1eeef3([0x2e])+_0x23b055),_0x26acdc=window[_0x1eeef3([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x1eeef3([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x26acdc)return;const _0x3707f8=await _0x26acdc[_0x1eeef3([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x1eeef3([0x6a,0x77,0x6b]),_0x3bc3a0,{[_0x1eeef3([0x6e,0x61,0x6d,0x65])]:_0x1eeef3([0x45,0x43,0x44,0x53,0x41]),[_0x1eeef3([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x1eeef3([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x1eeef3([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x26acdc[_0x1eeef3([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x1eeef3([0x6e,0x61,0x6d,0x65])]:_0x1eeef3([0x45,0x43,0x44,0x53,0x41]),[_0x1eeef3([0x68,0x61,0x73,0x68])]:{[_0x1eeef3([0x6e,0x61,0x6d,0x65])]:_0x1eeef3([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x3707f8,_0x26eef,_0x2d0686)||(_0x574326=!0x1);}}function _0x4d0de9(_0x507d6e){return _0x507d6e[_0x1eeef3([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x1eeef3([0x65,0x79]))?JSON[_0x1eeef3([0x70,0x61,0x72,0x73,0x65])](_0x30639c(_0x507d6e)):null;}function _0x30639c(_0x3ec535){return window[_0x1eeef3([0x61,0x74,0x6f,0x62])](_0x3ec535[_0x1eeef3([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x1eeef3([0x2b]))[_0x1eeef3([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x1eeef3([0x2f])));}function _0x5e6eba(_0xc223fb){let _0x18b2f4=0x1505;function _0x4f5ef5(_0xbacf4){for(let _0x250f14=0x0;_0x250f14<_0xbacf4[_0x1eeef3([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x250f14++){const _0x58e826=_0xbacf4[_0x1eeef3([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x250f14);_0x18b2f4=(_0x18b2f4<<0x5)+_0x18b2f4+_0x58e826,_0x18b2f4&=_0x18b2f4;}}function _0x3210b4(_0x506519){Array[_0x1eeef3([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x506519)?_0x506519[_0x1eeef3([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x3210b4):_0x506519&&typeof _0x506519==_0x1eeef3([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x1eeef3([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x506519)[_0x1eeef3([0x73,0x6f,0x72,0x74])]()[_0x1eeef3([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x810279,_0x4fa02d])=>{_0x4f5ef5(_0x810279),_0x3210b4(_0x4fa02d);}):_0x4f5ef5(window[_0x1eeef3([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x506519));}return _0x3210b4(_0xc223fb),_0x18b2f4>>>0x0;}function _0x2e8228(_0x3be55c){return _0x3be55c[_0x1eeef3([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x1eeef3([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x1eeef3([0x30]));}function _0x190473(_0x1ce6ff){return _0x1ce6ff[_0x1eeef3([0x73,0x70,0x6c,0x69,0x74])]('')[_0x1eeef3([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x1eeef3([0x6a,0x6f,0x69,0x6e])]('');}function _0x421c20(){}function _0x1eeef3(_0x22b717){return _0x22b717['map'](_0xc91fc2=>String['fromCharCode'](_0xc91fc2))['join']('');}_0x216a5c(await _0x10f6c2());}(this);}['showFakeVisualSelection'](){const _0x1fde2e=this['editor']['model'];_0x1fde2e['change'](_0x42834e=>{const _0x256a1d=_0x1fde2e['document']['selection']['getRanges']();let _0x396d8b=0x0;for(const _0x4197f0 of _0x256a1d){const _0x370ed5=wi+':'+_0x396d8b;if(_0x1fde2e['markers']['has'](_0x370ed5))_0x42834e['updateMarker'](_0x370ed5,{'range':_0x4197f0});else{if(_0x4197f0['start']['isAtEnd']){const _0x2d30a1=_0x4197f0['start']['getLastMatchingPosition'](({item:_0x2d3159})=>!_0x1fde2e['schema']['isContent'](_0x2d3159),{'boundaries':_0x4197f0});_0x42834e['addMarker'](_0x370ed5,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x42834e['createRange'](_0x2d30a1,_0x4197f0['end'])});}else _0x42834e['addMarker'](_0x370ed5,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4197f0});}_0x396d8b++;}});}['hideFakeVisualSelection'](){const _0x4999ed=this['editor']['model'],_0x2314a7=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](wi));_0x2314a7['length']&&_0x4999ed['change'](_0x6cf0ea=>{_0x2314a7['forEach'](_0x56f0dd=>{_0x6cf0ea['removeMarker'](_0x56f0dd);});});}['insertContent'](_0x5427e7,_0x3e0516){const _0x569819=this['_getAISelection'](),_0x33463b=_0x3e0516||_0x569819['getFirstRange']();this['editor']['model']['canEditAt'](_0x33463b)&&this['editor']['model']['change'](_0x797105=>{this['hideFakeVisualSelection'](),_0x3e0516||this['_resetContentOfSelectedTableCells'](_0x797105,_0x569819),this['_pasteHTMLUsingClipboard']({'insertAt':_0x33463b,'writer':_0x797105,'html':_0x5427e7});});}['insertContentBelow'](_0x3c4848){const {model:_0x1cd075}=this['editor'],_0x530497=this['_getAISelection']();_0x1cd075['change'](()=>{const _0x807758=this['_prepareTableInsertBelowPosition'](_0x3c4848,_0x530497)||this['_getDefaultInsertBelowPosition'](_0x530497);this['insertContent'](_0x3c4848,_0x807758);});}['_getAISelection'](){const _0x2ff146=this['editor']['model'],_0x486b05=Array['from'](_0x2ff146['markers']['getMarkersGroup'](wi))['map'](_0x2a0bbc=>_0x2a0bbc['getRange']());return _0x2ff146['createSelection'](_0x486b05);}['_pasteHTMLUsingClipboard']({writer:_0x3f47dc,html:_0x4da3a1,insertAt:_0x4ad7a6}){const {view:_0xe805dc}=this['editor']['editing'],_0x2191d5=this['editor']['plugins']['get'](_0x37a20),_0x545c72=new Ci();_0x545c72['setData']('text/html',_0x4da3a1);const _0x27a666=new ClipboardEvent('paste',{'clipboardData':_0x545c72}),_0x56e449=new _0x27c07a(_0xe805dc,_0x27a666,{'dataTransfer':new _0x2d0edf(_0x545c72)});_0x3f47dc['setSelection'](_0x4ad7a6);const _0x5db4d0=(_0x471686,_0x4feb50)=>{_0x4feb50['resultRange']&&_0x3f47dc['setSelection'](_0x4feb50['resultRange']);};_0x2191d5['once']('contentInsertion',_0x5db4d0,{'priority':'lowest'}),_0xe805dc['document']['fire']('paste',_0x56e449),_0x2191d5['off']('contentInsertion',_0x5db4d0);}['_getDefaultInsertBelowPosition'](_0x5910f2){const {model:_0x57af2f}=this['editor'],_0x127f22=Array['from'](_0x5910f2['getSelectedBlocks']());return _0x127f22['length']?_0x57af2f['createPositionAfter'](_0x127f22['pop']()):_0x5910f2['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x45f9dd,_0xf24775){const {model:_0x326efb,plugins:_0x27492f}=this['editor'];if(_0x27492f['has']('TableUtils')){const _0x34b03f=_0x27492f['get']('TableUtils')['getSelectedTableCells'](_0xf24775);if(_0x34b03f['length']){const _0x1f4646=this['_getTableRowCountFromContent'](_0x45f9dd),_0x589d86=this['_createEmptyTableRows'](_0x34b03f,_0x1f4646);return _0x326efb['createPositionAt'](_0x589d86,0x0);}}return null;}['_getTableRowCountFromContent'](_0x2f4334){const _0x4adb16=this['editor']['plugins']['get']('TableUtils'),_0x49a72c=this['editor']['data']['parse'](_0x2f4334),_0x36e791=Array['from'](_0x49a72c['getChildren']())['filter'](_0x4aa9d2=>_0x4aa9d2['is']('element','table'));let _0x403fe5=0x0;return _0x36e791['forEach'](_0xf249ee=>{_0x403fe5+=_0x4adb16['getRows'](_0xf249ee);}),_0x403fe5;}['_createEmptyTableRows'](_0x4a48f8,_0x137a45){const _0xa0fd6c=this['editor']['plugins']['get']('TableUtils'),_0x5bc452=_0xa0fd6c['getRowIndexes'](_0x4a48f8),_0x1fc240=_0xa0fd6c['getColumnIndexes'](_0x4a48f8),_0x55c9cd=_0x5bc452['last']+0x1,_0x3c7a8f=_0x1fc240['first'],_0x5abb8f=_0x4a48f8[0x0]['findAncestor']('table');for(let _0x531554=0x0;_0x531554<_0x137a45;_0x531554++)_0xa0fd6c['insertRows'](_0x5abb8f,{'at':_0x55c9cd});return _0x5abb8f['getChild'](_0x55c9cd)['getChild'](_0x3c7a8f);}['_resetContentOfSelectedTableCells'](_0x365cc6,_0x55e502){const {plugins:_0x4229b2}=this['editor'],{model:_0x37c229}=_0x365cc6;if(!_0x4229b2['has']('TableUtils'))return;_0x4229b2['get']('TableUtils')['getSelectedTableCells'](_0x55e502)['length']&&_0x37c229['deleteContent'](_0x55e502);}}class Si extends _0x43ff17{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new ot('aiadapter-text-adapter-not-set',null);}}class bi extends Error{constructor(_0x5ecfed){super(_0x5ecfed),this['name']='AIRequestError';}}function Ri(_0xae7338,_0x2ee0a7,_0x3bec05){const t=_0xae7338['t'];switch(_0x2ee0a7){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',_0x3bec05);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3bec05);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'},_0x3bec05);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 _0x2ee0a7;}}class Oi extends _0x2228a8{['_commandDefinitions'];constructor(_0x4efb4e,_0x1f158e){super(_0x4efb4e),this['_commandDefinitions']=_0x1f158e,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x37be28,_0x4fb556,_0x306b96)=>{this['isEnabled']&&(this['enabledCommandsIds']=ki(this['_commandDefinitions'],_0x306b96));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x141cc2,_0x45f8db,_0x420437)=>{this['enabledCommandsIds']=_0x420437?ki(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0xd443b1=this['editor']['model'];this['_hasContext']=function(_0x52340e){const _0x3979a4=_0x52340e['document']['selection'];return _0x3979a4['isCollapsed']?0x0!==[..._0x3979a4['getSelectedBlocks']()]['length']&&![..._0x3979a4['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x52340e['hasContent'](_0x3979a4['getFirstRange']());}(_0xd443b1);const _0x52e2e6=_0xd443b1['document']['selection'],_0x55e0ea=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x1ee34c of _0x52e2e6['getRanges']())for(const _0x14c1ea of _0x1ee34c['getItems']())if(_0x14c1ea['is']('element')&&_0x55e0ea['includes'](_0x14c1ea['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0xaaa22a='',_0xaeb09d='',_0x4045e9='custom'){this['editor']['plugins']['get'](Wi)['showUI'](_0xaaa22a,_0xaeb09d,_0x4045e9);}}function ki(_0x426877,_0x3e3652){const _0x5a6921=new Set();for(const _0x4bfbe9 of _0x426877['values']())(_0x3e3652||!0x1===_0x4bfbe9['requiresContent'])&&_0x5a6921['add'](_0x4bfbe9['id']);return Array['from'](_0x5a6921);}const Ni=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class vi extends/* #__PURE__ -- @preserve */
24
+ ht(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x239b06,_0x2853e9,_0x16aa06){super(),this['editor']=_0x239b06,this['textAdapter']=_0x2853e9,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x16aa06,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x3ac697,_0x1bf580,_0x114b9a)=>{this['view']['value']=this['_sanitizeHTML'](_0x114b9a);}),this['listenTo'](this['view'],'submitPrompt',(_0x335fc8,_0x1aebf4)=>{const _0x159afc=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x1aebf4,_0x159afc,'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:_0x1a5d1c,query:_0x1bdeeb,htmlContent:_0x3f2be8,label:_0x17f57a,mainActionLabel:_0x1540e7}){this['view']['prompt']=_0x17f57a,this['view']['mainAction']=_0x1540e7,this['initialContext']=_0x3f2be8,_0x1bdeeb&&(this['view']['isRendered']?this['_handleQuery'](_0x1bdeeb,_0x3f2be8,_0x1a5d1c,_0x17f57a):this['view']['once']('render',()=>{this['_handleQuery'](_0x1bdeeb,_0x3f2be8,_0x1a5d1c,_0x17f57a);}));}['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'](_0x347e71,_0x4aba1b,_0x8aef9d,_0xc8ddb8){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x4aba1b,this['previousQuery']=_0x347e71,this['previousLabel']=_0xc8ddb8||_0x347e71,this['previousActionId']=_0x8aef9d,new Promise(_0x2b8380=>{this['textAdapter']['makeRequest']({'query':_0x347e71,'context':_0x4aba1b,'onData':_0x20329a=>{this['currentResponse']=_0x20329a,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x8aef9d})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x2b631e=>{_0x2b631e instanceof bi?this['view']['handleError'](_0x2b631e['message']):this['view']['handleError'](),_0x2b8380();})['finally'](()=>{this['stopProcessing'](),_0x2b8380();});});}['_parseAndNormalizeContent'](_0x4bec0c,_0x2b51c8=!0x1){const _0x477b67=Ni['exec'](_0x4bec0c);_0x4bec0c=_0x477b67?_0x4bec0c['substring'](_0x477b67[0x1]['length']):_0x4bec0c['length']<0x64&&!_0x2b51c8?'':this['_stripMarkdownSyntax'](_0x4bec0c);const _0xe09d4d=this['_domParser']['parseFromString'](_0x4bec0c,'text/html');if(_0x477b67){const _0x535538=Array['from'](_0xe09d4d['body']['childNodes']);_0x535538['reverse']();for(const _0x40616f of _0x535538){if(_0x40616f['nodeType']==Node['ELEMENT_NODE'])break;_0x40616f['remove']();}}const _0x19a4e3=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0xe09d4d['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x19a4e3);const _0x170633=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x5bbd12=this['editor']['data']['toModel'](_0x19a4e3);return _0x170633||_0x5bbd12['markers']['clear'](),this['editor']['data']['stringify'](_0x5bbd12);}['_normalizeResponseHeadings'](_0x3d1b24){const _0x1ddd53=new _0x423e20(this['editor']['editing']['view']['document']),_0x52fc3e=new _0x540477({'name':/^h[1-5]$/}),_0x31546a=[];let _0x4f6dc9=!0x1;for(const _0x560b94 of _0x3d1b24)_0x560b94['is']('element')&&_0x52fc3e['match'](_0x560b94)&&(_0x31546a['push'](_0x560b94),'h1'==_0x560b94['name']&&(_0x4f6dc9=!0x0));if(_0x4f6dc9){for(const _0x482c43 of _0x31546a)_0x1ddd53['rename']('h'+(parseInt(_0x482c43['name'][0x1])+0x1),_0x482c43);}}['_isH1TagSupportEnabled'](){const {data:_0x36339f,editing:_0x3cb854}=this['editor'],_0x52d9f9=_0x36339f['htmlProcessor']['toView']('<h1></h1>'),_0x43ee86=_0x36339f['toView'](_0x36339f['toModel'](_0x52d9f9));return!!_0x3cb854['view']['domConverter']['viewToDom'](_0x43ee86)['querySelector']('h1');}['_sanitizeHTML'](_0x22fbd3){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x22fbd3),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x5d9216){const _0x1da631=_0x5d9216['trim']();return _0x1da631['startsWith']('```html')?_0x1da631['endsWith']('```')?_0x1da631['substring'](0x7,_0x1da631['length']-0x3):_0x1da631['substring'](0x7):_0x5d9216;}}const yi={'REPLACE':'replace','INSERT':'insert'};class xi extends Ot{constructor(_0x3dd7d4){super(_0x3dd7d4),this['set']('isVisible',!0x1),this['set']('mainAction',yi['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x4ded6d=>Ri(_0x3dd7d4,'AI_'+_0x4ded6d['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Ri(_0x3dd7d4,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Ri(_0x3dd7d4,'Try\x20again')),this['stopButton']=this['_createButton'](Ri(_0x3dd7d4,'Stop'));const _0x216b1a=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x216b1a['if']('isVisible','ck-hidden',_0x3b6773=>!_0x3b6773)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x1308b4,_0x32f08f){const _0x54adf6=new kt(this['locale']);return _0x54adf6['set']({'label':_0x1308b4,'class':_0x32f08f||'','isVisible':!0x0,'withText':!0x0}),_0x54adf6;}}class Li extends Nt{['contentFieldView'];['copyButtonView'];constructor(_0x4b761c,_0x1b15de=''){super(_0x4b761c),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x1eb062=this['bindTemplate'];this['contentFieldView']=new Di(_0x4b761c,_0x1b15de),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x1eb062['if']('isVisible','ck-hidden',_0x5664c4=>!_0x5664c4)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x1eb062['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 _0x25ae29=!0x1;this['on']('change:value',(_0x21d5c7,_0x40c086,_0x38d225)=>{const _0x590d75=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x38d225),this['isProcessing']&&_0x590d75&&!_0x25ae29&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x457dba,_0x178711,_0x479779)=>{_0x25ae29=!0x1,_0x479779?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x25ae29=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x25ae29=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x411cd8=this['locale'],_0x1a1147=new kt(this['locale']),_0x1db65f='ck-ai-form__copy-button';return _0x1a1147['set']({'label':Ri(_0x411cd8,'Copy'),'icon':_0x59cf80,'class':_0x1db65f,'tooltip':!0x0}),_0x1a1147['bind']('isVisible')['to'](this,'value',_0x48c152=>!!_0x48c152),_0x1a1147['bind']('isEnabled')['to'](this,'isProcessing',_0xf785f6=>!_0xf785f6),_0x1a1147['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x1a1147['icon']=_0x464c2a,_0x1a1147['class']=_0x1db65f+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x1a1147['icon']=_0x59cf80,_0x1a1147['class']=_0x1db65f;},0x3e8);}),_0x1a1147;}['_copyHTMLToClipboard'](_0x5aa5d9){const {window:_0x2e4d1a,document:_0x22fd28}=ct;if(_0x2e4d1a['ClipboardItem']){const {Blob:_0x50784b,ClipboardItem:_0x1912fe}=_0x2e4d1a,_0x177f5e=[new _0x1912fe({'text/html':new _0x50784b([_0x5aa5d9['innerHTML']],{'type':'text/html'}),'text/plain':new _0x50784b([_0x5aa5d9['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x177f5e);}else{const _0x48e43d=_0x22fd28['createElement']('div');_0x48e43d['style']['position']='absolute',_0x48e43d['style']['left']='-9999px',_0x48e43d['innerHTML']='<span>[</span>'+_0x5aa5d9['innerHTML']+'<span>]</span>',_0x22fd28['body']['appendChild'](_0x48e43d);const _0x5061db=_0x22fd28['createRange']();_0x5061db['setStartAfter'](_0x48e43d['firstElementChild']),_0x5061db['setEndBefore'](_0x48e43d['lastElementChild']);const _0x16798e=_0x2e4d1a['getSelection']();_0x16798e['removeAllRanges'](),_0x16798e['addRange'](_0x5061db),_0x22fd28['execCommand']('copy'),_0x48e43d['remove']();}}}class Di extends Nt{constructor(_0x3e69c2,_0x1a227c=''){super(_0x3e69c2),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x1a227c,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x14fa6b){this['element']['innerHTML']=_0x14fa6b;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x475b99=new Nt(),_0x1d1660=this['locale'],_0x529309=new vt();return _0x529309['isVisible']=!0x0,_0x475b99['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x529309,{'text':Ri(_0x1d1660,'AI\x20is\x20writing...')}]}),_0x475b99['render'](),_0x475b99;}}class Pi extends Nt{constructor(_0x10edc2,_0x3be708=''){super(_0x10edc2);const _0x5a0b81=new yt(),_0x4bd490=this['bindTemplate'];this['set']('text',_0x3be708),_0x5a0b81['content']=_0x387f7c,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x5a0b81,{'text':_0x4bd490['to']('text')}]});}}class Hi extends xt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x255fb5,_0x30f455){super(_0x255fb5,_0x30f455),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',(_0x265537,_0x362625)=>{_0x265537['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x362625());});}['_createSubmitButton'](){const _0x2f0858=new kt(this['locale']),_0x38a6d7=this['locale'];return _0x2f0858['set']({'icon':_0x4dc6e3,'label':Ri(_0x38a6d7,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x2f0858['on']('execute',()=>{this['submit']();}),_0x2f0858['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x35dcfe,_0x23db68)=>!_0x35dcfe&&_0x23db68),_0x2f0858;}['_createShowHistoryButton'](){const _0x391646=new kt(this['locale']),_0x1ce757=this['resultsView'],_0x8e5d23=this['locale'];_0x391646['set']({'label':Ri(_0x8e5d23,'History'),'withText':!0x1,'icon':_0x596529,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x391646['bind']('isOn')['to'](_0x1ce757,'isVisible'),_0x391646['bind']('isEnabled')['to'](this,'isEnabled'),_0x391646['on']('execute',()=>{_0x1ce757['isVisible']=!_0x1ce757['isVisible'],_0x1ce757['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x2cf67d=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x19c758=new ut(this['queryView']['fieldView']['element']),_0x6f5352=_0x19c758['width'],_0x4ae78f='rtl'===_0x8e5d23['uiLanguageDirection']?'left':'right';_0x19c758['excludeScrollbarsAndBorders'](),_0x391646['element']['style'][_0x4ae78f]=_0x6f5352-_0x19c758['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x2cf67d),this['on']('render',_0x2cf67d),_0x391646;}['submit'](){const _0x35475e=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x35475e);}['focus'](_0x1c2aaf){-0x1===_0x1c2aaf?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Mi extends Lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x57f1f2){super(_0x57f1f2),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Dt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Ri(_0x57f1f2,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0xd7081d=0x0;for(const _0x1c4cea of this['items'])_0xd7081d+=_0x1c4cea['items']['length'];return{'resultsCount':_0xd7081d,'totalItemsCount':_0xd7081d};}['_createClearHistoryButton'](){const _0x3255b5=this['locale'],_0x1fd63f=new kt(this['locale']);return _0x1fd63f['set']({'label':'('+Ri(_0x3255b5,'Clear')+')','withText':!0x0}),_0x1fd63f['on']('execute',()=>this['fire']('clearHistory')),_0x1fd63f;}}class Ui extends Pt{constructor(_0x3a1e2c){super();const _0x4f8885=new Ht(),_0x12df14=new kt(this['locale'],_0x4f8885);this['children']['add'](_0x12df14),_0x12df14['set']({'label':_0x3a1e2c['prompt'],'withText':!0x0}),_0x12df14['on']('execute',()=>{this['fire']('execute',{'value':_0x58e669(_0x3a1e2c['prompt'])});});}}const Vi='CKEditor/AIFormView/PromptHistory';class Bi extends dt{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x59df57,_0x47ecc3)=>{const _0x32e20b=Gi(_0x47ecc3['prompt']);for(const _0x2d8b9d of this)if(_0x2d8b9d!=_0x47ecc3&&Gi(_0x2d8b9d['prompt'])===_0x32e20b){this['remove'](_0x2d8b9d);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x2c10b4=sessionStorage['getItem'](Vi)||'[]';this['addMany'](JSON['parse'](_0x2c10b4));}['_saveToSessionStorage'](){sessionStorage['setItem'](Vi,JSON['stringify'](this['map'](_0xda3c4f=>_0xda3c4f)));}}function Gi(_0x23aaa1){return _0x23aaa1['toLowerCase']()['trim']();}class Fi extends Nt{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x16742c,_0xfb9a78,_0x580750=''){super(_0x16742c),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',yi['REPLACE']),this['_promptHistory']=new Bi(),this['errorView']=new Pi(_0x16742c),this['contentArea']=new Li(_0x16742c,_0x580750),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 _t(),this['keystrokes']=new At(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new Mt({'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 _0x5c9027=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0xfb9a78],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x5c9027['if']('isError','ck-hidden',_0x476d5a=>!_0x476d5a)]},'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'](_0x398f81=0x1){-0x1===_0x398f81?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 _0x35805f=this['locale'],_0x49828e=new Hi(_0x35805f,{'queryView':{'label':Ri(_0x35805f,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':Ut,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Ri(_0x35805f,'Empty\x20history'),'secondary':Ri(_0x35805f,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x49828e['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x5eb86c,_0x29d7a8)=>_0x5eb86c&&!_0x29d7a8),this['listenTo'](_0x49828e,'submit',(_0x2f517e,_0x52b099)=>{this['prompt']=_0x52b099;const _0x2fc69f=_0x589baa(_0x52b099);this['fire']('submitPrompt',_0x2fc69f),_0x52b099['trim']()&&this['_promptHistory']['add']({'prompt':_0x2fc69f},0x0);},{'priority':'high'}),_0x49828e;}['_createHistoryView'](){const _0x59c5e5=new Mi(this['locale']);return _0x59c5e5['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Ui),_0x59c5e5['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x59c5e5;}['_createToolbar'](){const _0x246b0a=new xi(this['locale']);return _0x246b0a['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x1c507e,_0x320dad,_0x4ee31e)=>_0x1c507e&&!_0x320dad&&!!_0x4ee31e),_0x246b0a['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x246b0a['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x3720c0,_0x4c5e09,_0x2d7c73)=>_0x3720c0&&!_0x4c5e09&&!!_0x2d7c73),_0x246b0a['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x246b0a['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x23fc9c,_0xeb6930)=>_0x23fc9c&&!_0xeb6930),_0x246b0a['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x246b0a['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x246b0a['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x246b0a;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x4f6224=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Ri(_0x4f6224,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x26eb7b){const _0x32257d=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x26eb7b||Ri(_0x32257d,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const Ki=globalThis['DataTransfer'];class Wi extends _0x43ff17{['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[_0x4712da,fi,Si,Vt];}constructor(_0x1aa0e9){super(_0x1aa0e9),_0x1aa0e9['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x1aa0e9['config']['define']('ai.assistant.contentAreaCssClass',''),_0x1aa0e9['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x1aa0e9['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x54fc3c}=this;this['_aiAdapter']=_0x54fc3c['plugins']['get'](Si),this['_dialog']=_0x54fc3c['plugins']['get'](Vt),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x59e679=new Oi(_0x54fc3c,Array['from'](this['_commandDefinitions']['values']()));_0x54fc3c['commands']['add']('showAIAssistant',_0x59e679),_0x54fc3c['ui']['componentFactory']['add']('aiCommands',_0x461bef=>{const _0x3004b4=Bt(_0x461bef);return _0x3004b4['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x3004b4['buttonView']['set']({'label':Ri(_0x461bef,'AI\x20Commands'),'icon':_0x8fe631,'tooltip':!0x0}),_0x3004b4['on']('execute',_0xecc2c4=>this['_onExecute'](_0xecc2c4['source']['id'])),Gt(_0x3004b4,_0x54fc3c['ui']['view']['body'],function(_0x19034f){const _0x18d47c=mi(_0x19034f['config']['get']('ai.assistant.commands'),_0x19034f['locale']),_0xf148e9=$i(_0x19034f,_0x18d47c)['filter'](_0x5b5e53=>_0x5b5e53['commands']['length']);if(0x1===_0xf148e9['length'])return $i(_0x19034f,_0xf148e9[0x0]['commands'])['map'](_0xa01d09=>({'id':_0xa01d09['id'],'label':_0xa01d09['label']}));return _0xf148e9['map'](_0x124276=>{const {groupId:_0x2e87ad,groupLabel:_0xe53daa,commands:_0x41a809}=_0x124276,_0x258c0d=$i(_0x19034f,_0x41a809)['map'](_0x103780=>({'id':_0x103780['id'],'label':_0x103780['label']}));return{'id':_0x2e87ad,'menu':_0xe53daa||_0x2e87ad,'children':_0x258c0d};});}(_0x54fc3c),{'ariaLabel':Ri(_0x461bef,'AI\x20Commands')}),_0x3004b4['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x59e679['on']('change:enabledCommandsIds',_0x5eb0b9),_0x3004b4['menuView']['once']('render',_0x5eb0b9),_0x3004b4;function _0x5eb0b9(){_0x3004b4['isEnabled']=_0x59e679['enabledCommandsIds']['length']>0x0;for(const _0x4c7338 of _0x3004b4['menuView']['buttons'])_0x4c7338['isEnabled']=_0x59e679['enabledCommandsIds']['includes'](_0x4c7338['id']);}}),_0x54fc3c['ui']['componentFactory']['add']('menuBar:aiCommands',_0x5574a6=>{const _0x510605=new Ft(_0x5574a6);_0x510605['buttonView']['set']({'label':Ri(_0x5574a6,'AI\x20Commands'),'icon':_0x8fe631}),_0x510605['bind']('isEnabled')['to'](_0x59e679,'enabledCommandsIds',_0x43daa4=>_0x43daa4['length']>0x0);const _0x1a5f5a=mi(_0x54fc3c['config']['get']('ai.assistant.commands'),_0x5574a6);return this['_populateMenuBarMenu'](_0x59e679,_0x510605,_0x1a5f5a,_0x502cbf=>this['_onExecute'](_0x502cbf)),_0x510605;}),_0x54fc3c['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x4db0a0=this['_createAIAssistantUIButton'](kt);return _0x4db0a0['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x4db0a0;}),_0x54fc3c['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x36cbdb=this['_createAIAssistantUIButton'](Kt);return _0x36cbdb['set']({'role':'menuitemcheckbox'}),_0x36cbdb;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x13095f=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x214935;for(const _0x5409f9 in _0x13095f){const _0x3c7029=_0x5409f9,_0x4cbf62=_0x13095f[_0x3c7029];if('aiLicenseKeyValid'==_0x4cbf62||'aiLicenseKeyInvalid'==_0x4cbf62||'aiLicenseKeyExpired'==_0x4cbf62||'aiLicenseKeyDomainLimit'==_0x4cbf62||'aiLicenseKeyNotAllowed'==_0x4cbf62||'aiLicenseKeyEvaluationLimit'==_0x4cbf62||'aiLicenseKeyUsageLimit'==_0x4cbf62){delete _0x13095f[_0x3c7029],_0x214935=_0x4cbf62,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x214935&&_0x13095f['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x214935&&_0x13095f['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x214935&&_0x13095f['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x214935&&_0x13095f['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x214935&&_0x13095f['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x214935&&_0x13095f['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x11721a='',_0x388ab2='',_0x490a92='custom'){const _0x2e1e60=this['editor'],_0x474c38=_0x2e1e60['editing']['view'],_0x348812=_0x2e1e60['plugins']['get'](fi),_0x380a73=_0x2e1e60['plugins']['get'](_0x4712da);_0x348812['showFakeVisualSelection']();const _0x2ad69c=new Ki(),_0x22db1c=new ClipboardEvent('copy',{'clipboardData':_0x2ad69c}),_0x13e55a=new _0x2d0edf(_0x2ad69c),_0x273aec=new _0x27c07a(_0x474c38,_0x22db1c,{'dataTransfer':_0x13e55a});_0x380a73['_forceMarkersCopy']('comment',()=>{_0x474c38['document']['fire']('copy',_0x273aec);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new vi(_0x2e1e60,this['_aiAdapter']['textAdapter'],this['_formView']));let _0xd6bcb1=_0x13e55a['getData']('text/html');const _0x29ce90=_0x2e1e60['model']['document']['selection'],_0x1722ec=Array['from'](_0x29ce90['getRanges']());0x1===_0x1722ec['length']&&_0x1722ec[0x0]['isFlat']&&!_0x29ce90['getSelectedElement']()&&''!==_0xd6bcb1['replace'](/&nbsp;/g,'')['trim']()&&(_0xd6bcb1='<p>'+_0xd6bcb1+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x490a92,'query':_0x11721a,'htmlContent':_0xd6bcb1,'label':_0x388ab2,'mainActionLabel':yi[_0x2e1e60['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x1a84a7,'title':Ri(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':Wt['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x348812['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x51b8b7=new Map(),_0x1f8ab3=mi(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0xf3a78f of _0x1f8ab3)for(const _0x1d493d of _0xf3a78f['commands'])_0x51b8b7['set'](_0x1d493d['id'],{..._0x1d493d,'groupId':_0xf3a78f['groupId'],'groupLabel':_0xf3a78f['groupLabel']||_0xf3a78f['groupId']});return _0x51b8b7;}['_createAIAssistantUIButton'](_0x2d2cad){const _0x6e8a11=this['editor'],_0x2523ba=_0x6e8a11['commands']['get']('showAIAssistant'),_0x5e03e8=new _0x2d2cad(_0x6e8a11['locale']);return _0x5e03e8['set']({'label':Ri(_0x6e8a11['locale'],'AI\x20Assistant'),'icon':_0x1a84a7,'isToggleable':!0x0}),_0x5e03e8['bind']('isEnabled')['to'](_0x2523ba),_0x5e03e8['bind']('isOn')['to'](this['_dialog'],'id',_0xddd4dd=>'aiAssistant'===_0xddd4dd),this['listenTo'](_0x5e03e8,'execute',()=>{_0x5e03e8['isOn']?this['hideUI']():_0x2523ba['execute']();}),_0x5e03e8;}['_initView'](){const _0x18aae8=this['editor']['plugins']['get'](fi);this['_formView']=new Fi(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',()=>{_0x18aae8['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x18aae8['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0xb8989d,ui:{ariaLiveAnnouncer:_0x395c59}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x93cacc,_0x101348,_0x331fc9)=>{const _0x1743af=this['_aiAssistantController']['currentContext'];_0x331fc9?_0x395c59['announce'](Ri(_0xb8989d,'AI\x20is\x20writing')):_0x1743af&&_0x395c59['announce'](Ri(_0xb8989d,'Generated\x20content:\x20%0',_0x1743af),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x1a3862,_0x491bd2,_0x307fa3)=>{if(_0x307fa3){const _0x20cc8c=this['_formView']['errorView']['text'];_0x395c59['announce'](Ri(_0xb8989d,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x20cc8c));}});}['_onExecute'](_0x573ca4){const _0xada83b=this['_commandDefinitions']['get'](_0x573ca4),_0x183b70=this['editor'],_0xfc143f=_0x183b70['model']['document']['selection'],_0x578efa=_0x183b70['commands']['get']('showAIAssistant'),_0x43a12b=_0x183b70['plugins']['get'](fi),_0x37d7ca=''+(_0xada83b['groupId']!==pi?_0xada83b['groupLabel']+':\x20':'')+_0xada83b['label'];if(!0x1!==_0xada83b['requiresContent']&&_0xfc143f['isCollapsed']){const _0xa4d7b9=gt(_0xfc143f['getSelectedBlocks']())||_0x183b70['model']['schema']['getLimitElement'](_0xfc143f);_0x183b70['model']['change'](_0x433bb7=>{_0x433bb7['setSelection'](_0xa4d7b9,'in');});}_0x43a12b['showFakeVisualSelection'](),_0x578efa['execute'](_0xada83b['prompt'],_0x37d7ca,'command:'+_0x573ca4);}['_populateMenuBarMenu'](_0x549975,_0x5db390,_0x4a4def,_0x55dc5f){const _0x43d9ab=this['editor'],_0xc68101=_0x43d9ab['locale'],_0x4afc1e=new Yt(_0xc68101),_0x2b4488=$i(_0x43d9ab,_0x4a4def)['filter'](_0x56b96f=>_0x56b96f['commands']['length']);0x1===_0x2b4488['length']?this['_getMenuBarGroupButtons']({'command':_0x549975,'commands':_0x2b4488[0x0]['commands'],'parentMenuView':_0x5db390,'onExecute':_0x55dc5f})['forEach'](_0x211c39=>_0x4afc1e['items']['add'](_0x211c39)):_0x2b4488['forEach'](({groupId:_0x351b0b,groupLabel:_0x62fc4d,commands:_0x4b9988})=>{const _0x477932=new $t(_0xc68101,_0x5db390),_0x4f196b=new Ft(_0xc68101),_0x5c508b=new Yt(_0xc68101),_0x3d9922=this['_getMenuBarGroupButtons']({'command':_0x549975,'commands':_0x4b9988,'parentMenuView':_0x4f196b,'onExecute':_0x55dc5f});_0x4f196b['buttonView']['set']({'label':_0x62fc4d||_0x351b0b}),_0x4f196b['delegate']('execute')['to'](_0x5db390),_0x5c508b['items']['addMany'](_0x3d9922),_0x4f196b['panelView']['children']['add'](_0x5c508b),_0x477932['children']['add'](_0x4f196b),_0x4afc1e['items']['add'](_0x477932);}),_0x5db390['panelView']['children']['add'](_0x4afc1e);}['_getMenuBarGroupButtons']({command:_0x2d1cdc,commands:_0x49a6ab,parentMenuView:_0x71508f,onExecute:_0x43fa95}){const _0x8aab56=this['editor'],_0x2e3848=_0x8aab56['locale'];return $i(_0x8aab56,_0x49a6ab)['map'](_0x4364ef=>{const _0x58579e=new $t(_0x2e3848,_0x71508f),_0x41540b=new Kt(_0x2e3848);return _0x41540b['set']({'label':_0x4364ef['label']}),_0x41540b['delegate']('execute')['to'](_0x71508f),_0x41540b['on']('execute',()=>_0x43fa95(_0x4364ef['id'])),_0x41540b['bind']('isEnabled')['to'](_0x2d1cdc,'enabledCommandsIds',_0x4e18d8=>_0x4e18d8['includes'](_0x4364ef['id'])),_0x58579e['children']['add'](_0x41540b),_0x58579e;});}}function Yi(_0x24397f,_0xbc9813){return void 0x0!==_0x24397f['order']&&void 0x0===_0xbc9813['order']?0x1:void 0x0===_0x24397f['order']&&void 0x0!==_0xbc9813['order']?-0x1:void 0x0!==_0x24397f['order']&&void 0x0!==_0xbc9813['order']?_0x24397f['order']-_0xbc9813['order']:0x0;}function $i(_0x13d1de,_0xe9dc2){_0xe9dc2['sort'](Yi);const _0xd72c67={},_0x3a3292=[];for(const _0x1c780d of _0xe9dc2)if(void 0x0!==_0x1c780d['order']){if(_0x1c780d['order']in _0xd72c67)throw new ot('ai-commands-config-order-collision',_0x13d1de,{'conflictingDefinitions':[_0x1c780d,_0xd72c67[_0x1c780d['order']]]});_0xd72c67[_0x1c780d['order']]=_0x1c780d,_0x3a3292['splice'](_0x1c780d['order'],0x0,_0x1c780d);}else _0x3a3292['push'](_0x1c780d);return _0x3a3292;}class qi extends _0x43ff17{static get['requires'](){return[Wi,fi];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4c7fa2){super(_0x4c7fa2);const _0x29e823=_0x4c7fa2['config'],_0x41c691=_0x4c7fa2['locale'];_0x29e823['define']('ai.assistant.preserveComments',!0x0),_0x29e823['define']('ai.assistant.commands',Qi(_0x41c691)),_0x29e823['define']('ai.assistant.extraCommandGroups',[]),_0x29e823['define']('ai.assistant.removeCommands',[]);let _0x36e0d2=mi(_0x29e823['get']('ai.assistant.commands'),_0x41c691);const _0x1479f0=_0x29e823['get']('ai.assistant.extraCommandGroups'),_0x51b0dd=_0x29e823['get']('ai.assistant.removeCommands');_0x1479f0['forEach'](_0x2b8350=>{const _0x2046a2=_0x36e0d2['find'](_0x12a6aa=>_0x12a6aa['groupId']===_0x2b8350['groupId']);_0x2046a2?_0x2046a2['commands']=_0x2046a2['commands']['concat'](_0x2b8350['commands']):_0x36e0d2['push'](_0x2b8350);}),_0x36e0d2=_0x36e0d2['filter'](_0x535d59=>!_0x51b0dd['includes'](_0x535d59['groupId'])),_0x36e0d2['forEach'](_0x1c8a35=>{_0x1c8a35['commands']=_0x1c8a35['commands']['filter'](_0xb640cf=>!_0x51b0dd['includes'](_0xb640cf['id']));}),_0x29e823['set']('ai.assistant.commands',_0x36e0d2);}}function Qi(_0x4071b9){return[{'groupId':'editOrReview','groupLabel':Ri(_0x4071b9,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Ri(_0x4071b9,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Ri(_0x4071b9,'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':Ri(_0x4071b9,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Ri(_0x4071b9,'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':Ri(_0x4071b9,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Ri(_0x4071b9,'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':Ri(_0x4071b9,'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':Ri(_0x4071b9,'Change\x20tone'),'commands':[{'id':'professional','label':Ri(_0x4071b9,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Ri(_0x4071b9,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Ri(_0x4071b9,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Ri(_0x4071b9,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Ri(_0x4071b9,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Ri(_0x4071b9,'Change\x20style'),'commands':[{'id':'business','label':Ri(_0x4071b9,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Ri(_0x4071b9,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Ri(_0x4071b9,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Ri(_0x4071b9,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Ri(_0x4071b9,'Translate'),'commands':[{'id':'translateEnglish','label':Ri(_0x4071b9,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Ri(_0x4071b9,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Ri(_0x4071b9,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Ri(_0x4071b9,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Ri(_0x4071b9,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Ri(_0x4071b9,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Ri(_0x4071b9,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Ri(_0x4071b9,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class Xi extends _0x43ff17{['abortController'];static get['requires'](){return[Si];}constructor(_0x3a40b9){super(_0x3a40b9),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](Si)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x2c924c){return this['sendRequest'](_0x2c924c)['catch'](_0x332a7e=>{if(_0x332a7e instanceof bi)return Promise['reject'](_0x332a7e);if('AbortError'==_0x332a7e['name'])return Promise['resolve']();throw console['error'](_0x332a7e),new ot('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x2b21d5,_0x2cdc67){const _0x3dff67=this['editor']['locale'],_0xd5aed8={'Content-Type':'application/json'};if('object'==typeof _0x2b21d5)Object['assign'](_0xd5aed8,_0x2b21d5);else{if(_0x2b21d5)try{const _0x7748aa=await _0x2b21d5(_0x2cdc67);Object['assign'](_0xd5aed8,_0x7748aa);}catch{return Promise['reject'](new bi(Ri(_0x3dff67,'AI_ERROR_GET_HEADERS')));}}return _0xd5aed8;}async['_prepareRequestParameters'](_0x33ac4b,_0x2c98a4){const _0x450a3c=this['editor']['locale'];if('object'==typeof _0x33ac4b)return _0x33ac4b;try{return await _0x33ac4b(_0x2c98a4);}catch{return Promise['reject'](new bi(Ri(_0x450a3c,'AI_ERROR_GET_PARAMETERS')));}}}class zi extends Xi{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x3331ee){super(_0x3331ee),_0x3331ee['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x3331ee['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x3331ee['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x3331ee['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x3331ee['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x3331ee['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x1fa4b1,context:_0x784eeb,onData:_0x27aa5a,actionId:_0x4cf9ab}){const _0xbfac26=this['editor']['locale'],_0x331460=await this['prepareMessages'](_0x1fa4b1,_0x784eeb,_0x4cf9ab),_0x328c35=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x4cf9ab),_0x4d0233=await this['_prepareRequestParameters'](this['_requestParameters'],_0x4cf9ab),_0x2eacf1={'messages':_0x331460,..._0x4d0233},_0x56a37b={'method':'POST','headers':_0x328c35,'body':JSON['stringify'](_0x2eacf1),'signal':this['abortController']['signal']},_0x42f4ec=await fetch(this['_apiUrl'],_0x56a37b);if(_0x42f4ec['ok'])return _0x4d0233['stream']?await this['_readStreamableResponse'](_0x42f4ec,_0x27aa5a):await this['_readStaticResponse'](_0x42f4ec,_0x27aa5a),Promise['resolve']();{const _0x2fa84a=await _0x42f4ec['text']();return _0x2fa84a['includes']('context_length_exceeded')?Promise['reject'](new bi(Ri(_0xbfac26,'AI_ERROR_CONTEXT_LENGTH'))):_0x2fa84a['includes']('Moderation')?Promise['reject'](new bi(Ri(_0xbfac26,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x2fa84a));}}async['prepareMessages'](_0x39be91,_0x550748,_0x3df390){let _0x54ca87,_0x5ec1b4;return _0x550748?(_0x54ca87='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.',_0x5ec1b4='Instruction:\x0a'+_0x39be91+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x550748):(_0x54ca87='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.',_0x5ec1b4=_0x39be91),[{'role':'system','content':_0x54ca87},{'role':'user','content':_0x5ec1b4}];}async['_readStreamableResponse'](_0xb7e434,_0x5ab8a4){const _0xee167a=_0xb7e434['body']['getReader'](),_0x50cb1f=new TextDecoder();let _0x48ec48='',_0x54f48b='',_0x735b50='',_0x29cbd9=!0x1;for(;!_0x29cbd9;){const {done:_0x2b86e0,value:_0x1520ee}=await _0xee167a['read'](),_0x495b78=_0x48ec48+_0x50cb1f['decode'](_0x1520ee);let _0x57a4c6='';_0x29cbd9=_0x2b86e0;try{_0x57a4c6=this['_cleanUpData'](_0x495b78),_0x48ec48='';}catch{_0x48ec48=_0x495b78;continue;}_0x54f48b+=_0x57a4c6,!_0x29cbd9&&this['_isBufferIncomplete'](_0x54f48b)||_0x54f48b&&(_0x735b50+=_0x54f48b,_0x54f48b='',_0x5ab8a4(_0x735b50));}return Promise['resolve']();}async['_readStaticResponse'](_0x409acf,_0x52fced){return _0x52fced((await _0x409acf['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x559447){const _0x30641b=_0x559447['split']('<')['length']!==_0x559447['split']('>')['length'],_0x39af76=_0x559447['length']<0x1e;return _0x30641b&&_0x39af76;}['_cleanUpData'](_0x11e606){return _0x11e606['split'](/\n(?![^{]*\})/g)['map'](_0x308629=>_0x308629['replace']('data:\x20',''))['filter'](_0x2fa62d=>_0x2fa62d&&_0x2fa62d['length']>0x0&&'[DONE]'!==_0x2fa62d)['map'](_0x4a4240=>{const {choices:_0x3d8c0d}=JSON['parse'](_0x4a4240);if(_0x3d8c0d[0x0]?.['delta']?.['content'])return _0x3d8c0d[0x0]['delta']['content'];})['filter'](_0x3259cb=>_0x3259cb)['join']('');}}class ji extends Xi{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),It('ai-aws-adapter-not-supported');}async['sendRequest'](_0x3e3253){throw Et('ai-aws-adapter-not-supported'),new bi(Ri(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class Ji extends kt{constructor(_0xd3d30f,_0x1bf57d={}){super(_0xd3d30f),this['isToggleable']=!0x0,this['set']('side',_0x1bf57d['side']||'top');const _0x3a131a=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...Tt(_0x1bf57d['class']||[]),_0x3a131a['to']('side',_0x3ebf92=>'ck-tab-button_'+_0x3ebf92),_0x3a131a['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class Zi extends Nt{['children'];constructor(_0x2e3e0f,_0x7dda64={}){super(_0x2e3e0f);const _0x6c3e89=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',...Tt(_0x7dda64['class']||[]),_0x6c3e89['to']('class'),_0x6c3e89['if']('isVisible','ck-hidden',_0x27476e=>!_0x27476e)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ts extends Nt{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x382d5b,_0x1fb0ed={}){super(_0x382d5b),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x1fb0ed['side']||'top'),this['set']('isMaximized',!0x1);const _0x931319=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...Tt(_0x1fb0ed['class']||[]),_0x931319['to']('side',_0x16d812=>'ck-tabs_'+_0x16d812),_0x931319['to']('class'),_0x931319['to']('isMaximized',_0x4eaab4=>_0x4eaab4?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x931319['to']('side',_0x22f5d0=>'ck-tabs__buttons-container_'+_0x22f5d0)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x931319['to']('side',_0x465a75=>'ck-tabs__panels-container_'+_0x465a75)]},'children':this['panelViews']},...Tt(_0x1fb0ed['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x562bfd){const _0x4e829d=this['_tabs']['get'](_0x562bfd);return _0x4e829d||null;}['addTab'](_0xba4d2d){const _0x391084=this['_setupButton']({'id':_0xba4d2d['id'],'label':_0xba4d2d['buttonLabel'],'icon':_0xba4d2d['buttonIcon'],'order':_0xba4d2d['order']}),_0x5a6c4c=new Zi(this['locale']);return _0x5a6c4c['render'](),_0xba4d2d['content']&&_0x5a6c4c['children']['add'](_0xba4d2d['content']),this['panelViews']['add'](_0x5a6c4c),this['_tabs']['set'](_0xba4d2d['id'],{'button':_0x391084,'panel':_0x5a6c4c,'order':void 0x0!==_0xba4d2d['order']?_0xba4d2d['order']:null}),this['fire']('addTab:'+_0xba4d2d['id'],{'id':_0xba4d2d['id'],'button':_0x391084,'panel':_0x5a6c4c}),null===this['activeTab']?this['activateTab'](_0xba4d2d['id']):this['_hidePanel'](_0xba4d2d['id']),{'button':_0x391084,'panel':_0x5a6c4c};}['activateTab'](_0x396e65){if(null!==_0x396e65&&!this['getTab'](_0x396e65))throw new ot('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x396e65});this['activeTab']!==_0x396e65&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x396e65,_0x396e65&&this['_showPanel'](_0x396e65),this['fire']('activateTab:'+_0x396e65,_0x396e65));}['showTab'](_0x1637bb){if(!this['getTab'](_0x1637bb))throw new ot('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x1637bb});this['_showPanel'](_0x1637bb),this['_showButton'](_0x1637bb),this['fire']('show:'+_0x1637bb,_0x1637bb);}['hideTab'](_0x3ebf40){if(!this['getTab'](_0x3ebf40))throw new ot('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x3ebf40});const _0x199f26=this['activeTab'];this['_hidePanel'](_0x3ebf40),this['_hideButton'](_0x3ebf40);const _0x238493=this['getTabIds']();_0x199f26===_0x3ebf40&&_0x238493['length']>0x1&&this['activateTab'](_0x238493['find'](_0x26bd6f=>_0x26bd6f!==_0x3ebf40)),this['fire']('hide:'+_0x3ebf40,_0x3ebf40);}['_getPanel'](_0x5bac1f){const _0x436ae1=this['_tabs']['get'](_0x5bac1f);return _0x436ae1?_0x436ae1['panel']:null;}['_showPanel'](_0xc565b1){null!==this['activeTab']&&this['activeTab']!==_0xc565b1||this['_getPanel'](_0xc565b1)['show']();}['_hidePanel'](_0x26dc9c){const _0x1b29c2=this['_getPanel'](_0x26dc9c);_0x1b29c2['isVisible']&&(this['activeTab']===_0x26dc9c&&(this['activeTab']=null),_0x1b29c2['hide']());}['_getButton'](_0x2d0176){const _0x4ce223=this['_tabs']['get'](_0x2d0176);return _0x4ce223?_0x4ce223['button']:null;}['_showButton'](_0x971cc8){this['_getButton'](_0x971cc8)['show']();}['_hideButton'](_0x53f093){this['_getButton'](_0x53f093)['hide']();}['_setupButton'](_0x280ccb){const _0x3224bc=new Ji(this['locale'],{'side':this['side']}),_0x1f1e9f=this['buttonViews'];if(_0x3224bc['set']({'label':_0x280ccb['label'],'icon':_0x280ccb['icon'],'tooltip':!0x0,'withText':!0x0}),_0x3224bc['bind']('isOn')['to'](this,'activeTab',_0x38d6ad=>_0x38d6ad===_0x280ccb['id']),_0x3224bc['bind']('side')['to'](this,'side'),_0x280ccb['order']){const _0x3e58cb=[...this['_tabs']]['reduce']((_0x168742,_0x2becd4)=>{const _0x339961=_0x2becd4[0x0],{order:_0x557c8d}=_0x2becd4[0x1];return!_0x557c8d||_0x557c8d>_0x280ccb['order']?_0x168742:_0x557c8d>=_0x168742['order']?{'id':_0x339961,'order':_0x557c8d}:_0x168742;},{'id':'','order':0x0}),_0x14e591=_0x1f1e9f['getIndex'](this['_getButton'](_0x3e58cb['id']));_0x1f1e9f['add'](_0x3224bc,_0x14e591+0x1);}else _0x1f1e9f['add'](_0x3224bc);return _0x3224bc['on']('execute',()=>{this['activateTab'](_0x280ccb['id']);}),_0x3224bc;}}const es=['overlay','sidebar','custom'],is=['left','right'];class ss extends ts{constructor(_0x3aa1d1,_0x38e48a={}){super(_0x3aa1d1,_0x38e48a),this['set']('type',_0x38e48a['type']||'sidebar'),this['set']('side',_0x38e48a['side']||'right'),this['set']('isVisible',_0x38e48a['visibleByDefault']??!0x0);const _0x1cf4a6=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x1cf4a6['if']('type','ck-ai-tabs__overlay',_0x378619=>'overlay'===_0x378619),_0x1cf4a6['if']('type','ck-ai-tabs__sidebar',_0x5ae7f3=>'sidebar'===_0x5ae7f3),_0x1cf4a6['if']('isVisible','ck-hidden',_0x42a789=>!_0x42a789)]}}),this['buttonViews']['on']('add',(_0x52ece1,_0x177175)=>{_0x177175['set']('withText',!0x1);});}}class ns extends _0x3627a2{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x7a1097){super(_0x7a1097);const _0x48bea6=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x48bea6)throw new ot('ai-tabs-configuration-not-found');if(void 0x0!==_0x48bea6['showResizeButton']&&(this['showResizeButton']=_0x48bea6['showResizeButton']),'sidebar'!==_0x48bea6['type']&&'overlay'!==_0x48bea6['type']||_0x48bea6['side']&&(this['side']=_0x48bea6['side']),'sidebar'===_0x48bea6['type']){if(this['container']=_0x48bea6['element'],this['set']('type','sidebar'),!this['container'])throw new ot('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x48bea6['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new ss(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x48bea6['visibleByDefault']||_0x48bea6['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 _0x384afe&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x5c4bbd){if(_0x5c4bbd&&this['type']!==_0x5c4bbd){if(!es['includes'](_0x5c4bbd))throw new ot('ai-tabs-unsupported-ui-type');this['type']=_0x5c4bbd;}}['switchSide'](_0x40f0a4){if(_0x40f0a4&&this['side']!==_0x40f0a4){if(!is['includes'](_0x40f0a4))throw new ot('ai-tabs-unsupported-ui-side');this['side']=_0x40f0a4;}}['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 rs extends _0x3627a2{['_apiUrl'];['_token'];['_decoder'];['_responseCache'];static get['requires'](){return[_0x1c65ab];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x14e613){super(_0x14e613),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(),this['_responseCache']=new Map();}['init'](){const _0xa5d435=this['context']['plugins']['get'](_0x1c65ab);if(!_0xa5d435['token'])throw new ot('ai-missing-token',this);this['_token']=_0xa5d435['token'];}['startConversation'](_0x5258ec,_0x4996c5){const _0x3f4a13=this['_sendApiRequest']('/conversations','POST',{'id':_0x5258ec,'group':_0x4996c5});return{'getConversation':async()=>(await _0x3f4a13['request'])['json'](),'abortController':_0x3f4a13['abortController']};}['queryAssistant']({message:_0x54597e,conversationId:_0x5dfaec,parts:_0xb743b8,capabilities:_0x1e960d,model:_0x2f2d70,attributes:_0x21c47b}){const _0x409af1={'prompt':_0x54597e,'content':_0xb743b8,'model':_0x2f2d70,..._0x1e960d&&{'capabilities':_0x1e960d},..._0x21c47b&&{'attributes':_0x21c47b}},_0x2c2fc0=this['_sendApiRequest']('/conversations/'+_0x5dfaec+'/messages','POST',_0x409af1);return{'getStream':async()=>{const _0x16c8e5=(await _0x2c2fc0['request'])['body'];return this['_getStreamReader'](_0x16c8e5);},'abortController':_0x2c2fc0['abortController']};}['executeCustomAction']({content:_0x2931cd,message:_0x26e378,model:_0x23e83c,outputFormat:_0x3c2211}){const _0x417acf={'content':[{'type':'text','content':_0x2931cd}],'prompt':_0x26e378,'model':_0x23e83c,'outputFormat':_0x3c2211},_0x5bef0b=this['_sendApiRequest']('/actions/custom/calls','POST',_0x417acf);return{'getStream':async()=>{const _0x74287a=(await _0x5bef0b['request'])['body'];return this['_getStreamReader'](_0x74287a);},'abortController':_0x5bef0b['abortController']};}['executeAction']({actionName:_0x428522,content:_0x26e37b,args:_0x21cdc5}){const _0x5e4f19={'content':[{'type':'text','content':_0x26e37b}],'args':_0x21cdc5},_0xb5d7c6=this['_sendApiRequest']('/actions/system/'+_0x428522+'/calls','POST',_0x5e4f19);return{'getStream':async()=>{const _0x5b06b0=(await _0xb5d7c6['request'])['body'];return this['_getStreamReader'](_0x5b06b0);},'abortController':_0xb5d7c6['abortController']};}['uploadFile'](_0x16adb6,_0x19f3f0,_0x10bb80){const _0x20ce86=new FormData();_0x20ce86['append']('file',_0x19f3f0,_0x19f3f0['name']),_0x10bb80&&_0x20ce86['append']('attributes',JSON['stringify'](_0x10bb80));const _0x3b1ef9=this['_sendApiRequest']('/conversations/'+_0x16adb6+'/files','POST',_0x20ce86);return{'getId':async()=>(await _0x3b1ef9['request'])['json'](),'abortController':_0x3b1ef9['abortController']};}['fetchDocument'](_0x272818,_0x16ade4){const _0x11ef34=this['_sendApiRequest']('/conversations/'+_0x272818+'/documents/'+_0x16ade4,'GET');return{'getDocument':async()=>(await _0x11ef34['request'])['json'](),'abortController':_0x11ef34['abortController']};}['uploadDocument'](_0x29e237,_0x3d569e,_0x547b11){const _0x38c426={'content':_0x3d569e};_0x547b11&&(_0x38c426['attributes']=_0x547b11);const _0x113307=this['_sendApiRequest']('/conversations/'+_0x29e237+'/documents','POST',_0x38c426);return{'getId':async()=>(await _0x113307['request'])['json'](),'abortController':_0x113307['abortController']};}['fetchConversations'](_0x11a773,_0x2f5c62={}){const _0xa903be=new URLSearchParams();_0xa903be['append']('group',_0x11a773),_0xa903be['append']('excludeEmpty',!0x1!==_0x2f5c62['excludeEmpty']?'true':'false'),_0xa903be['append']('limit',_0x2f5c62['limit']?_0x2f5c62['limit']['toString']():'100'),_0xa903be['append']('sortBy',_0x2f5c62['sortBy']?_0x2f5c62['sortBy']:'createdAt'),_0xa903be['append']('order',_0x2f5c62['order']?_0x2f5c62['order']:'desc');const _0xcbb458=this['_sendApiRequest']('/conversations?'+_0xa903be['toString'](),'GET');return{'getConversations':async()=>{const _0x183b3b=await _0xcbb458['request'];return(await _0x183b3b['json']())['items'];},'abortController':_0xcbb458['abortController']};}['deleteConversation'](_0x1abe0d){const _0x4ca0c9=this['_sendApiRequest']('/conversations/'+_0x1abe0d,'DELETE');return{'execute':async()=>{await _0x4ca0c9['request'];},'abortController':_0x4ca0c9['abortController']};}['updateConversation'](_0x10adb5,_0x4d461d){const _0x183354=this['_sendApiRequest']('/conversations/'+_0x10adb5,'PATCH',_0x4d461d);return{'getResult':async()=>(await _0x183354['request'],_0x4d461d),'abortController':_0x183354['abortController']};}['fetchConversation'](_0x58aa8c){const _0x5d4b8e=this['_sendApiRequest']('/conversations/'+_0x58aa8c,'GET');return{'getConversation':async()=>(await _0x5d4b8e['request'])['json'](),'abortController':_0x5d4b8e['abortController']};}['fetchConversationMessages'](_0x339809){const _0xe08f1e=this['_sendApiRequest']('/conversations/'+_0x339809+'/messages','GET');return{'getMessages':async()=>{const _0x245ef5=await _0xe08f1e['request'];return(await _0x245ef5['json']())['items'];},'abortController':_0xe08f1e['abortController']};}['uploadUrl'](_0xf9152f,_0x221f74,_0x515b7a){const _0x48baf8=this['_sendApiRequest']('/conversations/'+_0xf9152f+'/web-resources','POST',{'url':_0x221f74,'attributes':_0x515b7a});return{'getId':async()=>(await _0x48baf8['request'])['json'](),'abortController':_0x48baf8['abortController']};}['getModels'](_0x28b2f4='en'){const _0x44bd66=new URLSearchParams();_0x44bd66['append']('language',_0x28b2f4);const _0x3d2562='/models/1?'+_0x44bd66['toString'](),_0x256e7a=this['_sendApiRequest'](_0x3d2562,'GET',void 0x0,!0x0);return{'list':async()=>await(await _0x256e7a['request'])['json'](),'abortController':_0x256e7a['abortController']};}['deleteFile'](_0x4b0d9f,_0x5bdf13){const _0x6cdfce=this['_sendApiRequest']('/conversations/'+_0x4b0d9f+'/files/'+_0x5bdf13,'DELETE');return{'execute':async()=>{await _0x6cdfce['request'];},'abortController':_0x6cdfce['abortController']};}['deleteDocument'](_0x1e483a,_0x4a9d95){const _0x1477a5=this['_sendApiRequest']('/conversations/'+_0x1e483a+'/documents/'+_0x4a9d95,'DELETE');return{'execute':async()=>{await _0x1477a5['request'];},'abortController':_0x1477a5['abortController']};}['deleteWebResource'](_0x141bde,_0x2c1625){const _0x3b2788=this['_sendApiRequest']('/conversations/'+_0x141bde+'/web-resources/'+_0x2c1625,'DELETE');return{'execute':async()=>{await _0x3b2788['request'];},'abortController':_0x3b2788['abortController']};}['callSystemReview']({reviewName:_0x5daa25,content:_0x48fa89,args:_0x256d4f}){const _0xac406c=this['_sendApiRequest']('/reviews/system/'+_0x5daa25+'/calls','POST',{'content':[{'type':'text','content':_0x48fa89}],'args':_0x256d4f});return{'getStream':async()=>{const _0x225080=(await _0xac406c['request'])['body'];return this['_getStreamReader'](_0x225080);},'abortController':_0xac406c['abortController']};}['callCustomReview']({content:_0x1fbb90,prompt:_0x3a9faa,model:_0x40cd3a}){const _0x4d4392=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x1fbb90}],'prompt':_0x3a9faa,'model':_0x40cd3a});return{'getStream':async()=>{const _0x957c6e=(await _0x4d4392['request'])['body'];return this['_getStreamReader'](_0x957c6e);},'abortController':_0x4d4392['abortController']};}['upsertAIChatRating'](_0x575c0b,_0xcc823,_0x2e8931){const _0x433e5b=this['_sendApiRequest']('/conversations/'+_0x575c0b+'/messages/'+_0xcc823+'/ratings','PUT',{'positiveCount':_0x2e8931['positiveCount'],'totalCount':_0x2e8931['totalCount'],'modificationId':_0x2e8931['modificationId']});return{'execute':async()=>{await _0x433e5b['request'];},'abortController':_0x433e5b['abortController']};}['upsertAIActionRating'](_0x2af781,_0x14b9bc,_0x50e514){const _0x465b99=this['_sendApiRequest']('/actions/system/'+_0x2af781+'/calls/'+_0x14b9bc+'/ratings','PUT',{'positiveCount':_0x50e514['positiveCount'],'totalCount':_0x50e514['totalCount']});return{'execute':async()=>{await _0x465b99['request'];},'abortController':_0x465b99['abortController']};}['upsertCustomAIActionRating'](_0x4d6691,_0x45d29b){const _0x5281f0=this['_sendApiRequest']('/actions/custom/calls/'+_0x4d6691+'/ratings','PUT',{'positiveCount':_0x45d29b['positiveCount'],'totalCount':_0x45d29b['totalCount']});return{'execute':async()=>{await _0x5281f0['request'];},'abortController':_0x5281f0['abortController']};}['upsertAIReviewRating'](_0x36ae2e,_0x16c897,_0x5760c0,_0xa1b679){const _0x55266a=this['_sendApiRequest']('/reviews/system/'+_0x36ae2e+'/calls/'+_0x16c897+'/ratings','PUT',{'positiveCount':_0x5760c0['positiveCount'],'totalCount':_0x5760c0['totalCount'],'dataId':_0xa1b679});return{'execute':async()=>{await _0x55266a['request'];},'abortController':_0x55266a['abortController']};}['upsertCustomAIReviewRating'](_0x49e16f,_0xf27338,_0x7c7bd6){const _0x11862c=this['_sendApiRequest']('/reviews/custom/calls/'+_0x49e16f+'/ratings','PUT',{'positiveCount':_0xf27338['positiveCount'],'totalCount':_0xf27338['totalCount'],'dataId':_0x7c7bd6});return{'execute':async()=>{await _0x11862c['request'];},'abortController':_0x11862c['abortController']};}['_sendApiRequest'](_0x2319f9,_0xad176c,_0x3254e6,_0x2d16a0=!0x1){const _0x3d8c44=new AbortController(),_0x475d01=_0x2d16a0?_0xad176c+':'+_0x2319f9:null;if(_0x475d01){const _0x44f5f8=this['_responseCache']['get'](_0x475d01);if(_0x44f5f8)return{'request':_0x44f5f8['then'](_0x2e34cc=>_0x2e34cc['clone']()),'abortController':_0x3d8c44};}const _0x189243=_0x3254e6 instanceof FormData,_0x134a0b={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x3254e6&&!_0x189243&&(_0x134a0b['Content-Type']='application/json');const _0xded4b2={'method':_0xad176c,'headers':_0x134a0b,'signal':_0x3d8c44['signal']};_0x3254e6&&(_0xded4b2['body']=_0x189243?_0x3254e6:JSON['stringify'](_0x3254e6));const _0x188204=fetch(''+this['_apiUrl']+_0x2319f9,_0xded4b2)['catch'](_0x5c3f73=>{_0x475d01&&this['_responseCache']['delete'](_0x475d01),this['_handleError'](_0x5c3f73);})['then'](_0x2d347d=>_0x2d347d['ok']?_0x2d347d:_0x2d347d['json']()['then'](_0x1cbb05=>{throw _0x475d01&&this['_responseCache']['delete'](_0x475d01),{'url':this['_apiUrl'],'path':_0x2319f9,'method':_0xad176c,'body':_0x3254e6,'status':(_0x2d347d||{})['status'],'statusText':(_0x2d347d||{})['statusText'],'code':_0x1cbb05['code'],'message':_0x1cbb05['message'],'traceId':_0x1cbb05['traceId']};}));return _0x475d01&&this['_responseCache']['set'](_0x475d01,_0x188204['then'](_0x3d3842=>_0x3d3842['clone']())),{'request':_0x188204,'abortController':_0x3d8c44};}async*['_getStreamReader'](_0x33226c){const _0x20cd1e=[],_0x362d3a=_0x33226c['getReader'](),_0x5edbef=_0x2dd8b7({'onError':_0x90d3e=>{this['_handleError'](_0x90d3e);},'onEvent':_0x4a3815=>{_0x4a3815['data']=JSON['parse'](_0x4a3815['data']),_0x20cd1e['push'](_0x4a3815);}});try{let _0x4db0bf=!0x1;for(;!_0x4db0bf;){const {done:_0x3aca16,value:_0x59506e}=await _0x362d3a['read']();_0x3aca16&&(_0x4db0bf=!0x0),_0x5edbef['feed'](this['_decoder']['decode'](_0x59506e,{'stream':!0x0})),yield*_0x20cd1e,_0x20cd1e['length']=0x0;}}catch(_0x3f861d){this['_handleError'](_0x3f861d);}finally{_0x362d3a['releaseLock'](),_0x5edbef['reset']();}}['_handleError'](_0x5e88fa){if(_0x5e88fa instanceof ot)throw _0x5e88fa;if(_0x5e88fa instanceof Error&&'AbortError'===_0x5e88fa['name'])throw new ot('ai-request-aborted',this,{'originalError':_0x5e88fa});throw new ot('ai-request-failed',this,{'originalError':_0x5e88fa});}}function as(_0x5b4829,_0x59f8e1,_0x194c6f){const t=_0x5b4829['t'];switch(_0x59f8e1){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'},_0x194c6f);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.'},_0x194c6f);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.'},_0x194c6f);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.'},_0x194c6f);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'},_0x194c6f);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x194c6f);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'},_0x194c6f);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.'},_0x194c6f);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.'},_0x194c6f);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.'},_0x194c6f);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.'},_0x194c6f);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'},_0x194c6f);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.'},_0x194c6f);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 _0x59f8e1;}}const os='ck-ai-button-primary',hs='ck-ai-button-secondary',cs='ck-ai-button-tertiary';function ls(_0x38e845,_0x14086c){const _0x503865=new kt(_0x38e845),_0x1a3606=as(_0x38e845,'AI_TABS_LABEL_MINIMIZE'),_0x1c993b=as(_0x38e845,'AI_TABS_LABEL_MAXIMIZE');return _0x503865['set']({'withText':!0x1,'icon':_0x5bc3ee,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+cs}),_0x503865['bind']('label')['to'](_0x14086c,'isMaximized',_0xe0a821=>_0xe0a821?_0x1a3606:_0x1c993b),_0x503865['bind']('icon')['to'](_0x14086c,'isMaximized',_0x5ab3a5=>_0x5ab3a5?_0x1ca6da:_0x5bc3ee),_0x503865['bind']('isOn')['to'](_0x14086c,'isMaximized'),_0x503865['on']('execute',()=>{_0x14086c['fire']('resizeTabs');}),_0x503865;}function us(_0x23c10c){return _0x13062e(_0x23c10c);}function ds(_0x53ac44){return _0xaa1346(_0x53ac44);}function _s(_0xd4a84f,_0x5cbdf0,_0x21c30b){const _0x26874e=null!==_0x5cbdf0?_0x19bea8=>_0x19bea8['attribs'][_0xd4a84f]===_0x5cbdf0:_0x111eaf=>Boolean(_0x111eaf['attribs'][_0xd4a84f]);return _0x290822(_0x2f4be6=>_0x580299(_0x2f4be6)&&_0x26874e(_0x2f4be6),_0x21c30b);}function As(_0x39cc54,_0x4f736f,_0x59b6dd){const _0x3b6498=null!==_0x4f736f?_0x5a9037=>_0x5a9037['attribs'][_0x39cc54]===_0x4f736f:_0x3bc87a=>Boolean(_0x3bc87a['attribs'][_0x39cc54]);return _0x40b708(_0xed0561=>_0x580299(_0xed0561)&&_0x3b6498(_0xed0561),_0x59b6dd);}function gs(_0xa87494,_0xe816c4){return _0xa87494&&_0x580299(_0xa87494)?_0xa87494['attribs'][_0xe816c4]:null;}function Is(_0x5bd522,_0x54bdf4,_0x3ea4d2){_0x580299(_0x5bd522)&&(null===_0x3ea4d2?delete _0x5bd522['attribs'][_0x54bdf4]:_0x5bd522['attribs'][_0x54bdf4]=_0x3ea4d2);}function Es(_0x3671fb,_0x36a1d4,_0x3ae80f){const _0x41376a=_0x36a1d4['cloneNode'](!0x0);'beforebegin'===_0x3ae80f?_0x39adba(_0x3671fb,_0x41376a):'afterbegin'===_0x3ae80f?_0x4c35bf(_0x3671fb,_0x41376a):'beforeend'===_0x3ae80f?_0x2618a1(_0x3671fb,_0x41376a):'afterend'===_0x3ae80f&&_0x38ed53(_0x3671fb,_0x41376a);}function Ts(_0x37d605){const _0x486258=[];let _0x56eb49=_0x37d605;for(;_0x56eb49;)_0x56eb49=_0x5453a3(_0x56eb49),_0x56eb49&&_0x486258['push'](_0x56eb49);return _0x486258;}function ps(_0x11a75c){return _0x11a75c['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function ms(_0x55e546){let _0x270457=0x0;for(;_0x55e546['parentNode'];)_0x55e546=_0x55e546['parentNode'],_0x270457++;return _0x270457;}function Cs(_0x19b300){const _0x3c40b7=[];let _0x115a72=_0x19b300['nextSibling'];for(;_0x115a72;)_0x3c40b7['push'](_0x115a72),_0x115a72=_0x115a72['nextSibling'];_0x3c40b7['forEach'](_0x210660=>{_0x592694(_0x210660);});}class ws extends/* #__PURE__ -- @preserve */
25
+ ht(){['_m2html'];constructor(){super();const _0x509b04=Object['entries'](_0x6d33e3),_0xe067b8=_0x509b04['findIndex'](([_0x2a796a])=>'rehypeDomRaw'===_0x2a796a);if(-0x1===_0xe067b8)throw new ot('ai-response-parser-unable-to-set-up-parser');_0x509b04['splice'](_0xe067b8+0x1,0x0,['rehypeSanitize',_0x2c24e0]),this['_m2html']=new _0x3a73d2({'plugins':Object['fromEntries'](_0x509b04)});}['convertMarkdownToHTML'](_0x11ce3b){const _0x29e6da=this['_m2html']['parse'](_0x11ce3b);return this['parseAndNormalizeHTML'](_0x29e6da);}['parseAndNormalizeHTML'](_0x292003){return this['_parseHTML'](_0x292003);}['_parseHTML'](_0x1c754a){const _0x392387=us('<dummy>'+_0x1c754a['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x392387['children']=_0x392387['children'][0x0]['children'],_0x392387;}}class fs extends/* #__PURE__ -- @preserve */
26
+ ht(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x548b88){super(),this['_generateUid']=_0x548b88||at;}['merge'](_0x3e25dd,_0x284fce,_0x13d5a9){const _0x114440=_0x3e25dd['cloneNode'](!0x0);if(0x0===_0x284fce['childNodes']['length']){const _0x3720f3=[];return As('data-id','new-element',_0x114440)['forEach'](_0x5af306=>{const _0x1db24b=this['_generateUid']();Is(_0x5af306,'data-id',_0x1db24b),_0x3720f3['push'](_0x1db24b);}),this['_removeSpecialComments'](_0x114440),{'parsedContent':_0x114440,'newNodeIds':_0x3720f3,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x13d5a9&&_0x13d5a9['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x114440),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(As('data-id',null,_0x284fce)['map'](_0x3b3027=>gs(_0x3b3027,'data-id'))['filter'](_0xfc4d2c=>!!_0xfc4d2c));let _0x32d1d7=-0x1,_0x49e564=!0x1;const _0x91131e=_0x114440['childNodes'],_0x4ba637=Array['from'](_0x91131e)['filter'](_0x3357a7=>!(0x3===_0x3357a7['nodeType']&&''===ds(_0x3357a7)['trim']())),_0x19c8e3=_0x4ba637['length'];for(let _0x9c972c=0x0;_0x9c972c<_0x19c8e3;_0x9c972c++){const _0x497be9=_0x4ba637[_0x9c972c],_0x50604e=_0x4ba637[_0x9c972c+0x1];if(this['_isNewNode'](_0x497be9)){if(-0x1===_0x32d1d7&&(_0x32d1d7=_0x9c972c),this['_markWrappedElements'](_0x497be9),!this['_isNewNode'](_0x50604e)){const [_0x400719,_0x5911cf]=this['_findReferenceNode'](_0x497be9,_0x49e564,_0x284fce);if(_0x400719){const _0x33f146=Array['from'](_0x4ba637)['slice'](_0x32d1d7,_0x9c972c+0x1);this['_insertNodes'](_0x400719,_0x33f146,_0x5911cf),_0x32d1d7=-0x1;}}}else{if(this['_isExistingContentComment'](_0x497be9))_0x49e564=!0x0;else{if(this['_isExistingNode'](_0x497be9)){const _0xff0e5f=gs(_0x497be9,'data-id');if(_0xff0e5f&&this['_existingDataIds']['has'](_0xff0e5f)){const _0x38d4b8=_s('data-id',_0xff0e5f,_0x284fce);this['_replaceNode'](_0x38d4b8,_0x497be9);}if(this['_touchedNodesState']['removedIds']['includes'](_0xff0e5f)){const _0x3f9b47=this['_touchedNodesState']['removedIds']['indexOf'](_0xff0e5f);this['_touchedNodesState']['removedIds']['splice'](_0x3f9b47,0x1);}}else{if(this['_isDelNode'](_0x497be9)){const _0x4cbe3c=gs(_0x497be9,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x4cbe3c)||this['_storeDeletedElementIds'](_0x497be9);}}}}}for(const _0x645890 of this['_touchedNodesState']['removedIds']){const _0x4210f2=_s('data-id',_0x645890,_0x284fce);if(_0x4210f2){if(_0x13d5a9&&_0x13d5a9['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x645890;const _0x18d5cc=_0x13d5a9['replaceRemovedWith']['cloneNode'](!0x0);Is(_0x18d5cc,'data-id',_0x645890),Is(_0x18d5cc,'data-removed','true'),_0x41e91b(_0x4210f2,_0x18d5cc);}else _0x592694(_0x4210f2);}}if(As('data-wrapped-id',null,_0x284fce)['forEach'](_0x4ff0a2=>{const _0x5defd6=_s('data-id',gs(_0x4ff0a2,'data-wrapped-id'),_0x284fce);var _0xa894b0,_0x40798a;_0x5defd6&&(_0x40798a=_0x4ff0a2,_0x592694(_0xa894b0=_0x5defd6),_0x41e91b(_0x40798a,_0xa894b0));}),As('data-id','new-element',_0x284fce)['forEach'](_0x3dbcfe=>{const _0x3ce077=this['_getUid'](_0x3dbcfe);Is(_0x3dbcfe,'data-id',_0x3ce077),this['_touchedNodesState']['newIds']['push'](_0x3ce077);}),this['_removeSpecialComments'](_0x284fce),_0x13d5a9&&_0x13d5a9['markUnstableElements']&&this['_markUnstableElements'](_0x284fce,_0x13d5a9['markUnstableElementsDepth']||0x0),_0x13d5a9&&_0x13d5a9['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x5d00a0=_s('data-id',this['_touchedNodesState']['lastTouchedId'],_0x284fce);for(;_0x5d00a0;)Cs(_0x5d00a0),_0x5d00a0=_0x5d00a0['parentNode'];}return{'parsedContent':_0x284fce,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x34d8b3,_0x416313,_0x2af990){for(const _0x20c3a7 of _0x416313){const _0x37a719=this['_getUid'](_0x20c3a7);Is(_0x20c3a7,'data-id',_0x37a719),this['_touchedNodesState']['newIds']['push'](_0x37a719),this['_touchedNodesState']['lastTouchedId']=_0x37a719;}const _0x1c9ec0='afterbegin'===_0x2af990||'afterend'===_0x2af990?_0x416313['reverse']():_0x416313;for(const _0x4bb577 of _0x1c9ec0)Es(_0x34d8b3,_0x4bb577,_0x2af990);}['_replaceNode'](_0x4a7f5a,_0x4c67b0){if(!_0x4a7f5a)return;if(_0x4e2547=_0x4c67b0,ps(ds(_0x4a7f5a))===ps(ds(_0x4e2547)))return;var _0x4e2547;const _0x2018e2=this['_getUid'](_0x4a7f5a);Is(_0x4c67b0,'data-id',_0x2018e2),this['_touchedNodesState']['modifiedIds']['push'](_0x2018e2),this['_touchedNodesState']['lastTouchedId']=_0x2018e2,_0x41e91b(_0x4a7f5a,_0x4c67b0['cloneNode'](!0x0));}['_findReferenceNode'](_0x8afcdd,_0x17e434,_0x533b94){const _0x4f3bbf=this['_findPrevElementWithDataId'](_0x8afcdd,!0x1);if(_0x4f3bbf){const _0x54507e=this['_getNodeDataId'](_0x4f3bbf),_0x32ffb8=_s('data-id',_0x54507e,_0x533b94);if(_0x32ffb8)return[_0x32ffb8,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x54507e);}const _0x156e76=this['_findNextElementWithDataId'](_0x8afcdd,!0x1);if(_0x156e76){const _0x57fd41=this['_getNodeDataId'](_0x156e76),_0x5b27ff=_s('data-id',_0x57fd41,_0x533b94);if(_0x5b27ff)return[_0x5b27ff,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x57fd41);}return _0x17e434?_0x8afcdd['nextSibling']?this['_findFallbackReferenceNode'](_0x8afcdd,_0x533b94):[_0x533b94['childNodes'][_0x533b94['childNodes']['length']-0x1],'afterend']:[_0x533b94['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x255dbc,_0x55c388){const _0x37dfbd=[],_0x2598a5=this['_findPrevElementWithDataId'](_0x255dbc,!0x0);if(_0x2598a5){const _0x4c4424=_s('data-id',this['_getNodeDataId'](_0x2598a5),_0x55c388);_0x4c4424&&_0x37dfbd['push']([_0x4c4424,'afterend']);}const _0x397274=this['_findNextElementWithDataId'](_0x255dbc,!0x0);if(_0x397274){const _0x1c3be3=_s('data-id',this['_getNodeDataId'](_0x397274),_0x55c388);_0x1c3be3&&_0x37dfbd['push']([_0x1c3be3,'beforebegin']);}if(_0x37dfbd['length']>0x1)return ms(_0x37dfbd[0x0][0x0])<=ms(_0x37dfbd[0x1][0x0])?_0x37dfbd[0x0]:_0x37dfbd[0x1];return 0x1===_0x37dfbd['length']?_0x37dfbd[0x0]:[_0x55c388['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x20077c,_0x4eb547){let _0x1893e0=_0x20077c['nextSibling'],_0x115a66=null,_0x50d98f=!0x1;for(;_0x1893e0;){if(_0x10998d(_0x1893e0)){if(this['_isDelNode'](_0x1893e0)&&(_0x115a66=_0x1893e0),this['_isExistingContentComment'](_0x1893e0)&&_0x4eb547&&!_0x50d98f){_0x50d98f=!0x0,_0x1893e0=_0x1893e0['nextSibling'];continue;}break;}const _0x4f66c8=gs(_0x1893e0,'data-id');if(_0x4f66c8&&'new-element'!==_0x4f66c8&&this['_existingDataIds']['has'](_0x4f66c8)){_0x115a66=_0x1893e0;break;}_0x1893e0=_0x1893e0['nextSibling'];}return _0x115a66;}['_findPrevElementWithDataId'](_0x5e06b6,_0x8cce6e){let _0x2904e2=_0x5e06b6['previousSibling'],_0x5a0eba=null,_0x37fc4c=!0x1;for(;_0x2904e2;){if(_0x10998d(_0x2904e2)){if(this['_isDelNode'](_0x2904e2)&&(_0x5a0eba=_0x2904e2),this['_isExistingContentComment'](_0x2904e2)&&_0x8cce6e&&!_0x37fc4c){_0x37fc4c=!0x0,_0x2904e2=_0x2904e2['previousSibling'];continue;}break;}const _0x14e10f=gs(_0x2904e2,'data-id');if(_0x14e10f&&'new-element'!==_0x14e10f&&this['_existingDataIds']['has'](_0x14e10f)){_0x5a0eba=_0x2904e2;break;}_0x2904e2=_0x2904e2['previousSibling'];}return _0x5a0eba;}['_markWrappedElements'](_0x52b2aa){_0x580299(_0x52b2aa)&&As('data-id',null,_0x52b2aa)['forEach'](_0x298379=>{this['_isExistingNode'](_0x298379)&&!this['_hasWrappedParent'](_0x298379)&&(Is(_0x298379,'data-wrapped-id',gs(_0x298379,'data-id')),Is(_0x298379,'data-id',null));});}['_getNodeDataId'](_0x2ec592){if(!_0x2ec592)return null;if(_0x580299(_0x2ec592))return gs(_0x2ec592,'data-id');if(_0x10998d(_0x2ec592)){const _0x5d36d8=ds(_0x2ec592)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x5d36d8&&_0x5d36d8[0x1])return _0x5d36d8[0x1];}return null;}['_storeDeletedElementIds'](_0x1afb96){if(_0x10998d(_0x1afb96)){const _0x3871e7=ds(_0x1afb96)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x3871e7&&_0x3871e7[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x3871e7[0x1]);}}['_getUid'](_0x520ca3){return this['_isExistingNode'](_0x520ca3)?gs(_0x520ca3,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x49e190){(function(_0x596df6){return _0x3bdfea(_0x3a6f02=>_0x10998d(_0x3a6f02),_0x596df6,!0x0,0x1/0x0);}(_0x49e190)['filter'](_0x37d214=>this['_isDelNode'](_0x37d214)||this['_isExistingContentComment'](_0x37d214))['forEach'](_0x268911=>{_0x592694(_0x268911);}));}['_markLastTagElementUnstable'](_0x275465){const _0x116288=_0x275465['childNodes'],_0x5514e0=_0x116288[_0x116288['length']-0x1];_0x5514e0&&_0x580299(_0x5514e0)&&Is(_0x5514e0,'data-unstable','true');}['_markUnstableElements'](_0x4e08cd,_0x27ee80){const _0x36dd5b=_s('data-unstable','true',_0x4e08cd);if(!_0x36dd5b)return;const _0x255ac1=Ts(_0x36dd5b)['slice'](0x0,-0x1),_0x51a357=_0x255ac1['length'];let _0x37c883=_0x36dd5b;if(_0x51a357>_0x27ee80){let _0x46daf5=_0x51a357,_0x5575c1=null;for(;_0x46daf5>_0x27ee80&&_0x46daf5>=0x0;)_0x46daf5--,_0x5575c1=_0x255ac1[_0x46daf5];_0x5575c1&&(_0x37c883=_0x5575c1,Is(_0x36dd5b,'data-unstable',null),Is(_0x5575c1,'data-unstable','true'));}else{if(_0x51a357<_0x27ee80){let _0x362067=_0x51a357,_0x2c8fdd=_0x36dd5b;for(;_0x362067<_0x27ee80;){const _0x10c0d8=_0x2c8fdd['childNodes']['filter'](_0x32b352=>_0x580299(_0x32b352));if(0x0===_0x10c0d8['length'])break;_0x362067++,_0x2c8fdd=_0x10c0d8[_0x10c0d8['length']-0x1];}_0x2c8fdd&&(_0x37c883=_0x2c8fdd,Is(_0x36dd5b,'data-unstable',null),Is(_0x2c8fdd,'data-unstable','true'));}}let _0x3eb106=_0x37c883;for(;_0x3eb106;){for(;_0x3eb106['nextSibling'];)_0x3eb106=_0x3eb106['nextSibling'],_0x580299(_0x3eb106)&&Is(_0x3eb106,'data-unstable','true');_0x3eb106=_0x3eb106['parentNode'];}}['_isNewNode'](_0x17c8d9){return Boolean('new-element'===gs(_0x17c8d9,'data-id'));}['_isExistingNode'](_0x4297b2){return Boolean((gs(_0x4297b2,'data-id')||'')['length']>0x0&&'new-element'!==gs(_0x4297b2,'data-id'));}['_isDelNode'](_0x4d4533){return!!_0x4d4533&&Boolean(_0x10998d(_0x4d4533)&&ds(_0x4d4533)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x39d912){let _0x137287=_0x39d912['parentNode'];for(;_0x137287;){if(gs(_0x137287,'data-wrapped-id'))return!0x0;_0x137287=_0x137287['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x508683){return Boolean(_0x10998d(_0x508683)&&ds(_0x508683)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function Ss({editor:_0x18719e,changeGroups:_0x16f585,documentContextContent:_0x231c90,showDiff:_0x4e9f75,trimUnchanged:_0x310a3a=!0x0}){return _0x16f585['map'](_0x234352=>{const _0x20c1a5=new _0x4c3622([]),_0x47344f=new _0x4c3622([]);for(const _0x19f68b of _0x234352['changes'])if(_0x4e9f75&&'removed'==_0x19f68b['type']||_0x47344f['children']['push'](_0x19f68b['node']['cloneNode'](!0x0)),'new'!=_0x19f68b['type']&&(_0x4e9f75||'removed'!=_0x19f68b['type'])){const _0x46706b=_0x290822(_0x15ccc0=>gs(_0x15ccc0,'data-id')==_0x19f68b['id'],_0x231c90,!0x0);_0x46706b&&_0x20c1a5['children']['push'](_0x46706b['cloneNode'](!0x0));}const {content:_0x5a6804,hasChanges:_0x113d0d}=function(_0x2768a2,_0x5654bf,_0x1bf6df,_0x5e6ffc,_0x5d5981=!0x0){const _0x168b24=_0x2768a2['plugins']['get']('DocumentCompare'),_0x558d72=ds(_0x5654bf),_0x1775a4=ds(_0x1bf6df),_0x4ee715=_0x2768a2['data']['parse'](_0x558d72,'$root'),_0x2fb069=_0x2768a2['model']['createPositionAt'](_0x4ee715,0x0),_0x3e131f=_0x168b24['getDiff'](_0x558d72,_0x1775a4,{'anchor':_0x2fb069,'markDeletions':_0x5e6ffc}),_0x2eec2a=_0x3e131f['getOperations']();if(0x0==_0x2eec2a['length'])return{'content':_0x5654bf['cloneNode'](!0x0),'hasChanges':!0x1};_0x5e6ffc?function(_0x336616,_0x170ed6,_0x4d5ec3){if(0x0==_0x336616['length'])return;const _0x2c42b9=_0x4d5ec3['plugins']['get']('DocumentCompare'),_0x51b868=_0x4d5ec3['plugins']['get']('SuggestionsConversion');_0x4d5ec3['model']['change'](_0x7fa722=>{const _0xf2d00b=new Set();for(let _0x58b0da=0x0;_0x58b0da<_0x336616['length'];_0x58b0da++){const _0x5940b4=_0x336616[_0x58b0da];if(_0x5940b4['baseVersion']=null,_0x5940b4['isDocumentOperation']=!0x1,_0x2c42b9['isMarkedRemoveOperation'](_0x5940b4)){const _0xf27d71=_0x3ad3ef(_0x5940b4['newRange'],_0x4d5ec3['model']),_0x53a058='suggestion:deletion:'+at()+':$aiSuggestion';_0x170ed6['markers']['set'](_0x53a058,_0xf27d71);}else switch(_0x5940b4['type']){case'rename':{if(_0x5940b4['oldName']==_0x5940b4['newName'])break;_0x7fa722['batch']['addOperation'](_0x5940b4),_0x4d5ec3['model']['applyOperation'](_0x5940b4);const _0x5a1751='$elementName',_0x53cc2b=_0x5940b4['position'],_0x382b2b=_0x4d5ec3['model']['createRange'](_0x53cc2b,_0x4d5ec3['model']['createPositionAt'](_0x53cc2b['nodeAfter'],'end')),_0x589f86='suggestion:attribute:'+_0x5a1751+':'+at()+':$aiSuggestion';_0x170ed6['markers']['set'](_0x589f86,_0x382b2b);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x5940b4['oldValue']==_0x5940b4['newValue'])break;_0x7fa722['batch']['addOperation'](_0x5940b4),_0x4d5ec3['model']['applyOperation'](_0x5940b4);const _0x35f589=_0x5940b4['key'];if(!_0x51b868['isRegisteredAttribute'](_0x35f589))break;const _0x5afd78=_0x3ad3ef(_0x5940b4['range'],_0x4d5ec3['model']),_0x5ce8ee='suggestion:attribute:'+_0x35f589+':'+at()+':$aiSuggestion';_0x170ed6['markers']['set'](_0x5ce8ee,_0x5afd78);break;}case'insert':{_0x7fa722['batch']['addOperation'](_0x5940b4),_0x4d5ec3['model']['applyOperation'](_0x5940b4);if(_0x336616[_0x58b0da+0x1]&&'move'==_0x336616[_0x58b0da+0x1]['type']){bs(_0x170ed6,_0x5940b4);break;}const _0x2819cb=_0x5940b4['position'],_0x322838=_0x5940b4['howMany'],_0x16b3a4=_0x3ad3ef(_0x4d5ec3['model']['createRange'](_0x2819cb,_0x2819cb['getShiftedBy'](_0x322838)),_0x4d5ec3['model']),_0x4f86f0='suggestion:insertion:'+at()+':$aiSuggestion';_0x170ed6['markers']['set'](_0x4f86f0,_0x16b3a4);break;}case'split':{_0x7fa722['batch']['addOperation'](_0x5940b4),_0x4d5ec3['model']['applyOperation'](_0x5940b4);const _0x43c574=_0x5940b4['splitPosition'],_0xc156ff=_0x5940b4['moveTargetPosition'],_0x59cba0=_0x4d5ec3['model']['createRange'](_0x43c574,_0xc156ff),_0x557ef3='suggestion:insertion:'+at()+':$aiSuggestion';_0x170ed6['markers']['set'](_0x557ef3,_0x59cba0);break;}case'move':{_0x7fa722['batch']['addOperation'](_0x5940b4),_0x4d5ec3['model']['applyOperation'](_0x5940b4),_0x336616[_0x58b0da-0x1]&&'insert'==_0x336616[_0x58b0da-0x1]['type']&&bs(_0x170ed6,_0x5940b4);const _0x19c3ea=_0x5940b4['getMovedRangeStart'](),_0x37ae6d=_0x5940b4['howMany'];for(let _0x1d906a=0x0;_0x1d906a<_0x37ae6d;_0x1d906a++){const _0x12a144=_0x19c3ea['getShiftedBy'](_0x1d906a)['nodeAfter'];_0xf2d00b['add'](_0x12a144);}break;}case'remove':{const _0x183c85=_0x5940b4['sourcePosition'],_0x3ebd32=_0x5940b4['howMany'],_0x5989f1=new _0x4c0de8(_0x183c85,_0x3ebd32);_0x7fa722['batch']['addOperation'](_0x5989f1),_0x4d5ec3['model']['applyOperation'](_0x5989f1);break;}}}for(const _0x5e1a40 of _0xf2d00b){const _0x1214c2=_0x4d5ec3['model']['createRangeOn'](_0x5e1a40),_0x4e9ad3='suggestion:formatBlock:$fakeWrap:'+at()+':$aiSuggestion';_0x170ed6['markers']['set'](_0x4e9ad3,_0x3ad3ef(_0x1214c2,_0x4d5ec3['model']));}});}(_0x2eec2a,_0x4ee715,_0x2768a2):_0x2768a2['model']['change'](_0x5175e8=>{for(const _0x49690f of _0x2eec2a)if('remove'==_0x49690f['type']){const _0x2e46e9=_0x49690f['sourcePosition'],_0x4d9082=_0x49690f['howMany'],_0x389319=new _0x4c0de8(_0x2e46e9,_0x4d9082);_0x5175e8['batch']['addOperation'](_0x389319),_0x2768a2['model']['applyOperation'](_0x389319);}else{if('marker'==_0x49690f['type']){const _0x2e65a5=_0x49690f['name'],_0x4932a2=_0x49690f['newRange'];null!==_0x4932a2?_0x4ee715['markers']['set'](_0x2e65a5,_0x4932a2):_0x4ee715['markers']['delete'](_0x2e65a5);}else _0x49690f['baseVersion']=null,_0x49690f['isDocumentOperation']=!0x1,_0x5175e8['batch']['addOperation'](_0x49690f),_0x2768a2['model']['applyOperation'](_0x49690f);}});if(_0x5d5981){const _0x43ebe3=Rs(_0x2768a2,_0x2eec2a,_0x4ee715);Os(_0x2768a2['model'],_0x43ebe3),function(_0x284f3b,_0x845873){const _0x1e7c22=_0x845873['getFirstRange']()['start'];let _0x2852f6=_0x845873['getFirstRange']()['end'];const _0x24672a=_0x1e7c22['root'];(_0x2852f6['textNode']||_0x2852f6['nodeAfter']&&_0x2852f6['nodeAfter']['is']('$text'))&&(_0x278795(_0x2852f6,'...'),_0x2852f6=_0x2852f6['getShiftedBy'](0x3)),(_0x1e7c22['textNode']||_0x1e7c22['nodeBefore']&&_0x1e7c22['nodeBefore']['is']('$text'))&&(_0x278795(_0x1e7c22,'...'),function(_0xc5bc7a,_0x2f3199,_0x4be38a){for(let [_0x1227e9,_0x2d8107]of _0xc5bc7a['markers']){const _0xa80edb=_0x2d8107['_getTransformedByInsertion'](_0x2f3199,_0x4be38a,!0x1);_0x2d8107=_0xa80edb[0x0],_0xc5bc7a['markers']['set'](_0x1227e9,_0x2d8107);}}(_0x24672a,_0x1e7c22,0x3),_0x1e7c22['parent']==_0x2852f6['parent']&&(_0x2852f6=_0x2852f6['getShiftedBy'](0x3)));const _0x4c0622=_0x284f3b['createRange'](_0x284f3b['createPositionAt'](_0x24672a,0x0),_0x1e7c22),_0x943688=_0x284f3b['createRange'](_0x2852f6,_0x284f3b['createPositionAt'](_0x24672a,'end')),_0x53622e=[..._0x4c0622['getMinimalFlatRanges'](),..._0x943688['getMinimalFlatRanges']()];_0x53622e['reverse']();for(const _0x5ee832 of _0x53622e)_0x51dc35(_0x5ee832),Ns(_0x24672a,_0x5ee832);}(_0x2768a2['model'],_0x43ebe3);}const _0x37a5ce=_0x2768a2['data']['stringify'](_0x4ee715,{'showSuggestionHighlights':!0x0});return{'content':us(_0x37a5ce),'hasChanges':!0x0};}(_0x18719e,_0x20c1a5,_0x47344f,_0x4e9f75,_0x310a3a);return{'type':_0x234352['changes'][0x0]['type'],'index':_0x234352['index'],'content':_0x5a6804,'hasChanges':_0x113d0d};});}function bs(_0x509f40,_0x37ee56){for(const [_0x3e2e33,_0x47d28a]of _0x509f40['markers']){const _0x41686e=_0x25d743['_createFromRanges'](_0x47d28a['getTransformedByOperation'](_0x37ee56));_0x509f40['markers']['set'](_0x3e2e33,_0x41686e);}}function Rs(_0xeda3a9,_0x43ed23,_0x2782de){const _0x4948bd=_0xeda3a9['plugins']['get']('DocumentCompare');let _0x61a91c=_0xeda3a9['model']['createPositionAt'](_0x2782de,Number['POSITIVE_INFINITY']),_0x27c4ca=_0xeda3a9['model']['createPositionAt'](_0x2782de,0x0);for(const _0x5d3c26 of _0x43ed23){let _0x9778a0,_0x5ad998;if(_0x4948bd['isMarkedRemoveOperation'](_0x5d3c26))_0x9778a0=_0x5d3c26['newRange']['start'],_0x5ad998=_0x5d3c26['newRange']['end'];else switch(_0x61a91c=_0x61a91c['getTransformedByOperation'](_0x5d3c26),_0x27c4ca=_0x27c4ca['getTransformedByOperation'](_0x5d3c26),_0x5d3c26['type']){case'rename':_0x9778a0=_0x5d3c26['position'],_0x5ad998=_0x9778a0['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x9778a0=_0x5d3c26['range']['start'],_0x5ad998=_0x5d3c26['range']['end'];break;case'insert':_0x9778a0=_0x5d3c26['position'],_0x5ad998=_0x9778a0['getShiftedBy'](_0x5d3c26['howMany']);break;case'split':_0x9778a0=_0x5d3c26['splitPosition'],_0x5ad998=_0x5d3c26['moveTargetPosition'];break;case'merge':{const _0x12b4f2=_0x5d3c26['targetPosition']['path']['slice'](0x0,-0x1);_0x9778a0=_0xeda3a9['model']['createPositionFromPath'](_0x2782de,_0x12b4f2),_0x5ad998=_0x9778a0['getShiftedBy'](0x1);break;}case'remove':{const _0x2d15ee=_0x5d3c26['howMany'],_0x168f79=_0x5d3c26['sourcePosition']['_getTransformedByInsertion'](_0x5d3c26['targetPosition'],_0x2d15ee),_0x2d9d0b=_0x5d3c26['getMovedRangeStart']();'remove'==_0x5d3c26['type']?(_0x9778a0=_0x168f79,_0x5ad998=_0x168f79):(_0x9778a0=_0x2d9d0b,_0x5ad998=_0x2d9d0b['getShiftedBy'](_0x2d15ee));break;}}_0x9778a0&&_0x9778a0['isBefore'](_0x61a91c)&&(_0x61a91c=_0x9778a0['clone'](),_0x61a91c['stickiness']='toNone'),_0x5ad998&&_0x5ad998['isAfter'](_0x27c4ca)&&(_0x27c4ca=_0x5ad998['clone'](),_0x27c4ca['stickiness']='toNone');}return _0xeda3a9['model']['createSelection'](_0xeda3a9['model']['createRange'](_0x61a91c,_0x27c4ca));}function Os(_0xca97a1,_0x21d72e){ks(_0xca97a1,_0x21d72e,'forward');const _0x481b83=_0x21d72e['getFirstRange']();_0x21d72e['setTo']([]),_0x21d72e['setTo'](_0x481b83,{'backward':!0x0}),ks(_0xca97a1,_0x21d72e,'backward');}function ks(_0x3983aa,_0x5740f4,_0x2b1bb9){let _0x2d317c=0x14;for(;_0x2d317c;){_0x3983aa['modifySelection'](_0x5740f4,{'unit':'word','direction':_0x2b1bb9}),_0x2d317c--;const _0x14b318=_0x5740f4['focus']['forward'==_0x2b1bb9?'nodeBefore':'nodeAfter'];if(_0x14b318&&_0x14b318['is']('element')&&_0x3983aa['schema']['isBlock'](_0x14b318)&&_0x3983aa['schema']['isObject'](_0x14b318))break;}}function Ns(_0x242329,_0x7d3b56){for(const [_0x457ee6,_0x514fde]of _0x242329['markers']){const _0x24f764=_0x514fde['_getTransformedByDeletion'](_0x7d3b56['start'],_0x7d3b56['end']['offset']-_0x7d3b56['start']['offset']);null!=_0x24f764?_0x242329['markers']['set'](_0x457ee6,_0x24f764):_0x242329['markers']['delete'](_0x457ee6);}}class vs extends ht(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _0x4c3622([]);['parsedMergedContent']=new _0x4c3622([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x250570,content:_0x51d438='',isDone:_0xef2ed7=!0x1,interactionId:_0x3d2bfc,areActionsDisabled:_0x2d1488,documentContextContent:_0x33cba5,editor:_0x37c3df,id:_0xba735f}){super(),this['id']=_0xba735f||at(),this['interactionId']=_0x3d2bfc,this['type']=_0x250570,this['areActionsDisabled']=!!_0x2d1488,this['editor']=_0x37c3df,this['aiResponseParser']=new ws(),this['aiResponseApplier']=new fs(),this['documentContextContent']=us(_0x33cba5||''),this['set']('isDone',_0xef2ed7),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x51d438);}['appendContent'](_0x55b8c5){this['set']('content',this['content']+_0x55b8c5);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x2be713,_0x430b8f){this['changeGroups'][_0x2be713]['state']=_0x430b8f,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x2be713,'state':_0x430b8f});}['getContentParts']({showDiff:_0x35ef03,groupIndex:_0xf97e42}){if(!this['editor'])throw new ot('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x47533a=this['_getCachedContentParts'](_0x35ef03,_0xf97e42);if(_0x47533a)return _0x47533a;let _0x47c245=[];if(void 0x0===_0xf97e42)_0x47c245=this['changeGroups'];else{const _0x4c5942=this['changeGroups']['find'](({index:_0x541b8b})=>_0x541b8b===_0xf97e42);if(!_0x4c5942)throw new ot('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0xf97e42});_0x47c245=[_0x4c5942];}const _0x53464f=Ss({'editor':this['editor'],'showDiff':_0x35ef03,'changeGroups':_0x47c245,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x35ef03,_0x53464f),_0x53464f;}['_getCachedContentParts'](_0x4b9a4c,_0x484502){const _0x2d4956=_0x4b9a4c?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x2d4956]['length'])return null;const _0x4cf0a8=this['cachedSuggestionContentParts'][_0x2d4956];if(void 0x0===_0x484502)return _0x4cf0a8['length']>0x0&&_0x4cf0a8['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x4b9a4c,null),null):_0x8a7085(_0x4cf0a8);{const _0x4f507f=_0x4cf0a8['find'](({index:_0x418876})=>_0x418876===_0x484502);if(_0x4f507f)return[_0x8a7085(_0x4f507f)];}return null;}['_setCachedContentParts'](_0x9914ec,_0x23063b){const _0x3d2d02=_0x9914ec?'withDiff':'withoutDiff';_0x23063b?_0x23063b['forEach'](_0x465459=>{const _0x4ff514=this['cachedSuggestionContentParts'][_0x3d2d02],_0x5cd644=_0x4ff514['find'](({index:_0xa5c8b8})=>_0xa5c8b8===_0x465459['index']);if(_0x5cd644){const _0x14e06e=_0x4ff514['indexOf'](_0x5cd644);_0x4ff514['splice'](_0x14e06e,0x1,_0x465459);}else _0x4ff514['push'](_0x465459);}):this['cachedSuggestionContentParts'][_0x3d2d02]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x88acfd=this['changeGroups'];this['updateChangeGroups']();const _0x3f3684=this['_getDifferentChangeGroups'](_0x88acfd,this['changeGroups']);(_0x3f3684['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x3f3684),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x48a8f8,_0x35c126){const _0x38933c=[];for(const _0xec86ee of _0x35c126){const _0x4c133d=_0x48a8f8[_0xec86ee['index']];_0x4c133d?_0x4c133d['changes']['length']!==_0xec86ee['changes']['length']?_0x38933c['push'](_0xec86ee):_0x4c133d['changes']['forEach']((_0x573aa9,_0x4626b4)=>{const _0x19785c=_0xec86ee['changes'][_0x4626b4];_0x573aa9['id']!==_0x19785c['id']&&_0x38933c['push'](_0xec86ee);}):_0x38933c['push'](_0xec86ee);}return _0x38933c;}['updateChangeGroups'](){const _0x51e3a5=new ti('p',{},[new ti('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x230874(as(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x1ba2cf=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x51e3a5,'cutAfterLastChange':!this['isDone']});if(!_0x1ba2cf['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x1ba2cf['parsedContent'];let _0x26a45d=[];if(_0x40b708(_0x5b794a=>{const _0x3d59ab=gs(_0x5b794a,'data-id');if(!_0x3d59ab||!_0x4a5a20(_0x3d59ab))return!0x1;const _0x2ab286=[_0x5b794a,...Ts(_0x5b794a)]['at'](-0x2);if(_0x5b794a!=_0x2ab286){const _0x4a1a79=gs(_0x2ab286,'data-id');_0x4a5a20(_0x4a1a79)||(_0x26a45d['push']({'node':_0x2ab286,'id':_0x4a1a79,'type':'modified'}),_0x1ba2cf['modifiedNodeIds']['push'](_0x4a1a79));}else _0x1ba2cf['modifiedNodeIds']['includes'](_0x3d59ab)?_0x26a45d['push']({'node':_0x5b794a,'type':'modified','id':_0x3d59ab}):_0x1ba2cf['newNodeIds']['includes'](_0x3d59ab)?_0x26a45d['push']({'node':_0x5b794a,'type':'new','id':_0x3d59ab,'anchorId':gs(_0x5b794a['previousSibling'],'data-id')}):_0x26a45d['push']({'node':_0x5b794a,'type':'removed','id':_0x3d59ab});return!0x0;},this['parsedMergedContent']),_0x26a45d=_0x26a45d['filter'](({node:_0x248dc2})=>[...Ts(_0x248dc2),_0x248dc2]['every'](_0x25ef22=>!gs(_0x25ef22,'data-unstable'))),0x0==_0x26a45d['length'])return;const _0x47c87f=[[_0x26a45d[0x0]]];for(let _0x5f27bd=0x1;_0x5f27bd<_0x26a45d['length'];_0x5f27bd++){const _0x107da4=_0x47c87f[_0x47c87f['length']-0x1],_0x2c56af=_0x107da4[_0x107da4['length']-0x1];_0x26a45d[_0x5f27bd]['node']['previousSibling']==_0x2c56af['node']&&'modified'!=_0x26a45d[_0x5f27bd]['type']&&'modified'!=_0x2c56af['type']?_0x107da4['push'](_0x26a45d[_0x5f27bd]):_0x47c87f['push']([_0x26a45d[_0x5f27bd]]);}for(const _0x52f12c of _0x47c87f){const _0x5b7108=_0x52f12c[0x0],_0x11de1a=_0x52f12c[_0x52f12c['length']-0x1],_0x562bc3=_0xe6f858(_0x5b7108['node']['previousSibling']);_0x562bc3&&_0x52f12c['unshift'](_0x562bc3);const _0x1a2b77=_0xe6f858(_0x11de1a['node']['nextSibling']);_0x1a2b77&&_0x52f12c['push'](_0x1a2b77);}function _0x4a5a20(_0x23f426){return _0x1ba2cf['modifiedNodeIds']['includes'](_0x23f426)||_0x1ba2cf['newNodeIds']['includes'](_0x23f426)||_0x1ba2cf['removedNodeIds']['includes'](_0x23f426);}function _0xe6f858(_0x3d7d90){if(_0x3d7d90&&gs(_0x3d7d90,'data-id')&&!gs(_0x3d7d90,'data-unstable')){const _0x9fbfc1=gs(_0x3d7d90,'data-id');if(!_0x4a5a20(_0x9fbfc1))return{'node':_0x3d7d90,'type':'context','id':_0x9fbfc1};}return null;}this['changeGroups']=_0x47c87f['map']((_0x10ec2c,_0x3cc33d)=>({'changes':_0x10ec2c,'state':'pending','index':_0x3cc33d}));}}const ys=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class xs extends pt(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x5e566c,editor:_0x1b4713}){super(),this['id']=at(),this['connector']=_0x5e566c,this['isStopped']=!0x0,this['editor']=_0x1b4713;}async['start'](){const _0x1312c6=[];let _0xcff6ee,_0x37d3ae,_0xdade87;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x1caa2b=await this['currentRequest']['getStream']();for await(const _0x23f35f of _0x1caa2b){if(this['isStopped'])return;if('error'==_0x23f35f['event'])return void this['fire']('error',{'error':new ot('ai-chat-interaction-error',this)});switch(_0x23f35f['event']){case'message-metadata':this['messageId']=_0x23f35f['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x23f35f['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x23f35f['data']['conversationTitle'],!0x0);break;case'source':_0x1312c6['push'](_0x23f35f['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'](),_0xcff6ee='modification-delta'==_0x23f35f['event']?'modification':'text',_0x37d3ae='modification-delta'==_0x23f35f['event']?_0x23f35f['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0xcff6ee&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0xcff6ee,'interactionId':this['id'],'id':_0x37d3ae}),'modification'==_0xcff6ee&&(this['currentReply']['sources']=_0x1312c6['splice'](0x0))),this['currentReply']['appendContent'](_0x23f35f['data']['textDelta']);break;case'mcp-tool-result':_0xdade87=JSON['parse'](_0x23f35f['data']['result']),this['_handleToolResultData']({'toolName':_0x23f35f['data']['toolName'],'data':_0xdade87['data'],'attributes':_0xdade87['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x23f35f['data']['toolName'],'data':_0x23f35f['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0x1312c6['length']>0x0&&(this['currentReply']['sources']=_0x1312c6['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x114ba1){return this['replies']['find'](_0x39c409=>_0x39c409['id']===_0x114ba1);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x3a74d5=>_0x3a74d5['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x20c8ac){const _0x2b8fb4=new vs({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x20c8ac});return this['replies']['push'](_0x2b8fb4),_0x2b8fb4['delegate'](...ys)['to'](this),this['fire']('replyCreated',_0x2b8fb4),_0x2b8fb4;}['setConversationTitle'](_0x115ea1,_0x43446c=!0x1){this['fire']('setConversationTitle',_0x115ea1,_0x43446c);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x3246d4){this['fire']('toolDataReceived',{'type':'result','toolName':_0x3246d4['toolName'],'data':structuredClone(_0x3246d4['data']||{}),'attributes':structuredClone(_0x3246d4['attributes']||{})},this);}['_handleToolNotificationData'](_0x3781a1){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x3781a1['toolName'],'data':structuredClone(_0x3781a1['data'])},this);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}const Ls=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']]),Ds=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class Ps extends ht(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x3d8ece,config:_0x4404f6,ownerId:_0x2dbb72}){super(),this['_connector']=_0x3d8ece,this['_config']=_0x4404f6,this['_ownerId']=_0x2dbb72;}['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'](_0x42b82c){const _0x2b6e8e=await this['_createContextItemFromContent'](_0x42b82c);return this['_addToConversationContextItem'](_0x2b6e8e),'current-document'===_0x2b6e8e['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x2b6e8e;}async['_createContextItemFromContent'](_0x445a7e){if('document'===_0x445a7e['type']){const _0x46f5c6=await this['_connector']['fetchDocument'](this['_ownerId'],_0x445a7e['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x445a7e['type'],'content':_0x46f5c6['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x46f5c6['attributes']?.['version'],'sessionId':_0x46f5c6['attributes']?.['sessionId']};}if('mcp-tool-context'===_0x445a7e['type'])return{'id':_0x445a7e['id'],'uiId':_0x445a7e['id'],'label':_0x445a7e['data']?.['label']||_0x445a7e['id'],'type':'mcp-tool-context','mcpServerName':_0x445a7e['mcpServerName'],'toolName':_0x445a7e['toolName'],'data':_0x445a7e['data']||{}};return{'id':_0x445a7e['id'],'uiId':_0x445a7e['id'],'label':_0x445a7e['attributes']?.['label']||_0x445a7e['name']||_0x445a7e['url']||_0x445a7e['id'],'type':_0x445a7e['type'],..._0x445a7e?.['attributes']?.['resourceId']?{'resourceId':_0x445a7e['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0xaef910){const _0x108d8d=this['_pendingContextItems']['get'](_0xaef910);_0x108d8d?.['isReadOnly']||this['_removeContextItem'](_0xaef910);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x319c0e of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x319c0e['uiId']);const _0x510aed=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x510aed&&this['_addContextItem']({..._0x510aed,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x32b784){for(const _0x3e6899 of _0x32b784['values']())this['_addToConversationContextItem'](_0x3e6899);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'](_0x24b746){return Array['from'](_0x24b746['values']())['map'](_0x4fa1b0=>this['_mapContextItemToRequestData'](_0x4fa1b0))['filter'](_0x4bcaf6=>null!==_0x4bcaf6);}async['addFilesToContext'](_0x381f4a,_0x29ce79,_0x44c1b0='file'){const _0x1adf50='files-'+at();this['_startUploadOperation'](_0x1adf50);try{await Promise['all'](_0x381f4a['map'](async _0x4f7171=>{const _0x5cbd41='file-'+at(),_0x1e2bf5=_0x589baa(_0x4f7171['name']);try{this['_addContextItem']({'type':_0x44c1b0,'label':_0x29ce79?.['label']||_0x1e2bf5,'uiId':_0x5cbd41,'resourceId':_0x29ce79?.['resourceId']},!0x0);const _0x48e9ac=this['_connector']['uploadFile'](this['_ownerId'],_0x4f7171,_0x29ce79);this['_ongoingUploads']['set'](_0x5cbd41,_0x48e9ac['abortController']);const {id:_0x3eed9e}=await _0x48e9ac['getId']();this['_ongoingUploads']['delete'](_0x5cbd41),this['_finishContextItemLoading']({'type':_0x44c1b0,'id':_0x3eed9e,'label':_0x29ce79?.['label']||_0x1e2bf5,'uiId':_0x5cbd41,'resourceId':_0x29ce79?.['resourceId']},!0x1);}catch(_0x3546c4){this['_ongoingUploads']['delete'](_0x5cbd41);if(!(_0x3546c4 instanceof ot&&_0x3546c4['message']['startsWith']('ai-request-aborted'))){const _0x6873fd=Ls['get'](_0x3546c4['code'])||'ai-chat-file-upload-failed',_0x5e3fb2=new ot(_0x6873fd,null,{'fileName':_0x1e2bf5,..._0x3546c4});_0x5e3fb2['stack']=_0x3546c4['stack'],this['fire']('error',{'error':_0x5e3fb2});}this['_removeContextItem'](_0x5cbd41);}}));}finally{this['_finishUploadOperation'](_0x1adf50);}}['addCurrentDocumentToContext'](_0x423707){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x205888={'type':'document','uiId':'current-document','label':_0x423707,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x205888);}async['updateCurrentDocument'](_0x715eb8,_0x2c0124,_0x27dca7,_0x39ac39){const _0x43490f=this['_pendingContextItems']['get']('current-document');if(_0x43490f&&_0x715eb8){_0x43490f['selection']=_0x39ac39?_0x39ac39['map'](_0x4fd68a=>({'start':_0x4fd68a['start'],'end':_0x4fd68a['end']})):[];try{if(_0x43490f['version']===_0x2c0124)return;const {id:_0x59b42e}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x715eb8,{'version':_0x2c0124,'sessionId':_0x27dca7})['getId']();_0x43490f['id']=_0x59b42e,_0x43490f['content']=_0x715eb8,_0x43490f['version']=_0x2c0124,_0x43490f['sessionId']=_0x27dca7;}catch(_0xd66628){const _0x1f1dc7=new ot('ai-chat-document-upload-failed',null);_0x1f1dc7['stack']=_0xd66628['stack'],this['fire']('error',{'error':_0x1f1dc7});}}}['addSelectionToContext'](_0x5c83eb){this['_addContextItem']({'type':'selection','label':_0x5c83eb,'uiId':'selection','content':_0x5c83eb});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x2dfc0c,_0x1fbbdf){const _0x39b49e='url-'+at();this['_startUploadOperation'](_0x39b49e);const _0x4b9350='url-'+at();try{this['_addContextItem']({'type':'web-resource','label':_0x1fbbdf?.['label']||_0x2dfc0c,'uiId':_0x4b9350,'resourceId':_0x1fbbdf?.['resourceId']},!0x0);const _0x3cda11=this['_connector']['uploadUrl'](this['_ownerId'],_0x2dfc0c,_0x1fbbdf);this['_ongoingUploads']['set'](_0x4b9350,_0x3cda11['abortController']);const {id:_0x2405c9}=await _0x3cda11['getId']();this['_ongoingUploads']['delete'](_0x4b9350),this['_finishContextItemLoading']({'type':'web-resource','id':_0x2405c9,'label':_0x1fbbdf?.['label']||_0x2dfc0c,'uiId':_0x4b9350,'resourceId':_0x1fbbdf?.['resourceId']},!0x1);}catch(_0x6b380e){this['_ongoingUploads']['delete'](_0x4b9350),(_0x6b380e['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new ot('ai-chat-url-upload-failed',this,{'url':_0x2dfc0c,'originalError':_0x6b380e}),'url':_0x2dfc0c}),this['_removeContextItem'](_0x4b9350));}finally{this['_finishUploadOperation'](_0x39b49e);}}['addToolItemToContext'](_0x1958c4){_0x1958c4['id']=_0x1958c4['id']??at()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x1958c4['uiId'],_0x1958c4),this['fire']('contextItemAdded',{'contextItem':_0x1958c4,'isLoading':!0x1});}async['loadSourceResources'](_0xab2bef,_0x397207,_0x467968){const _0x30703e=this['_addContextOptionsState']['sources']['find'](_0x746e3a=>_0x746e3a['id']===_0xab2bef);if(!_0x30703e)return this['fire']('error',{'error':new ot('ai-chat-source-not-found',this,{'sourceId':_0xab2bef}),'sourceId':_0xab2bef}),[];try{const _0x4784ff=(await _0x30703e['getResources'](_0x397207))['map'](_0x51bdf0=>{const _0x52d8a7=this['_isResourceInContext'](_0x51bdf0['id']);return{..._0x51bdf0,'isInContext':_0x52d8a7};});return _0x30703e['resources']=_0x4784ff,this['fire']('sourceResourcesLoaded',{'sourceId':_0xab2bef,'source':_0x30703e,'resources':_0x4784ff,'uid':_0x467968}),_0x4784ff;}catch(_0x24bc9c){return this['fire']('error',{'error':new ot('ai-chat-source-resources-load-failed',this,{'sourceId':_0xab2bef,'originalError':_0x24bc9c}),'sourceId':_0xab2bef,'sourceLabel':_0x30703e['label']}),[];}}async['addResourceToContext'](_0xcf62ea,_0x598581){if(this['_isResourceInContext'](_0x598581['id']))return;let _0x2dc4fa=_0x598581['data'];if(!_0x2dc4fa&&_0xcf62ea['getData'])try{_0x2dc4fa=await _0xcf62ea['getData'](_0x598581['id']);}catch(_0xa6966a){return void this['fire']('error',{'error':new ot('ai-chat-resource-load-failed',this,{'resourceId':_0x598581['id'],'sourceId':_0xcf62ea['id'],'originalError':_0xa6966a}),'resourceId':_0x598581['id'],'sourceId':_0xcf62ea['id']});}if(_0x2dc4fa)switch(_0x598581['type']){case'web-resource':if('string'!=typeof _0x2dc4fa)return void this['fire']('error',{'error':new ot('ai-chat-context-invalid-data',this,{'resourceId':_0x598581['id'],'sourceId':_0xcf62ea['id'],'expectedType':'string','actualType':typeof _0x2dc4fa}),'resourceId':_0x598581['id'],'sourceId':_0xcf62ea['id']});await this['addUrlToContext'](_0x2dc4fa,{'label':_0x598581['label'],'resourceId':_0x598581['id']});break;case'file':if(!(_0x2dc4fa instanceof File))return void this['fire']('error',{'error':new ot('ai-chat-context-invalid-data',this,{'resourceId':_0x598581['id'],'sourceId':_0xcf62ea['id'],'expectedType':'File','actualType':typeof _0x2dc4fa}),'resourceId':_0x598581['id'],'sourceId':_0xcf62ea['id']});await this['addFilesToContext']([_0x2dc4fa],{'label':_0x598581['label'],'resourceId':_0x598581['id']});break;case'text':if('object'!=typeof _0x2dc4fa||!('content'in _0x2dc4fa)||!('type'in _0x2dc4fa))return void this['fire']('error',{'error':new ot('ai-chat-context-invalid-data',this,{'resourceId':_0x598581['id'],'sourceId':_0xcf62ea['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x2dc4fa}),'resourceId':_0x598581['id'],'sourceId':_0xcf62ea['id']});_0x2dc4fa=Ps['_convertTextResourceToFile'](_0x2dc4fa,_0x598581['label']),await this['addFilesToContext']([_0x2dc4fa],{'label':_0x598581['label'],'resourceId':_0x598581['id']},'text');break;case'mcp-tool-context':break;default:this['fire']('error',{'error':new ot('ai-chat-context-unsupported-type',this,{'resourceId':_0x598581['id'],'sourceId':_0xcf62ea['id'],'resourceType':_0x598581['type']}),'resourceId':_0x598581['id'],'sourceId':_0xcf62ea['id']});}else this['fire']('error',{'error':new ot('ai-chat-resource-no-data',this,{'resourceId':_0x598581['id'],'sourceId':_0xcf62ea['id']}),'resourceId':_0x598581['id'],'sourceId':_0xcf62ea['id']});}static['_convertTextResourceToFile'](_0x53f90a,_0x306e0e){switch(_0x53f90a['type']){case'markdown':return new File([_0x53f90a['content']],_0x306e0e,{'type':'text/markdown'});case'html':return new File([_0x53f90a['content']],_0x306e0e,{'type':'text/html'});default:return new File([_0x53f90a['content']],_0x306e0e,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0xae9d01){switch(_0xae9d01['type']){case'file':case'text':return{'type':'file','id':_0xae9d01['id']};case'web-resource':return{'type':'web-resource','id':_0xae9d01['id']};case'document':return{'type':'document','id':_0xae9d01['id'],..._0xae9d01['selection']?.['length']&&{'selection':_0xae9d01['selection']}};case'mcp-tool-context':{const _0x253a42=_0xae9d01;return{'type':'mcp-tool-context','mcpServerName':_0x253a42['mcpServerName'],'toolName':_0x253a42['toolName'],'data':_0x253a42['data'],'id':_0x253a42['id']};}default:return null;}}['_addContextItem'](_0x25430b,_0x152d83=!0x1){if(this['_pendingContextItems']['set'](_0x25430b['uiId'],_0x25430b),_0x25430b['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x25430b,'isLoading':_0x152d83}),'current-document'===_0x25430b['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x25430b['resourceId']){const _0x5e312d=this['_findSourceIdsByResourceId'](_0x25430b['resourceId']);_0x5e312d&&_0x5e312d['forEach'](_0x83c031=>{this['_updateResourceInContextState'](_0x83c031,_0x25430b['resourceId'],!0x0);});}}['_removeContextItem'](_0x5c16e3){const _0x1b2cfd=this['_pendingContextItems']['get'](_0x5c16e3),_0x4b6f16=this['_ongoingUploads']['get'](_0x5c16e3);if(_0x4b6f16&&(_0x4b6f16['abort'](),this['_ongoingUploads']['delete'](_0x5c16e3)),_0x1b2cfd?.['resourceId']){const _0x40be9c=this['_findSourceIdsByResourceId'](_0x1b2cfd['resourceId']);_0x40be9c&&_0x40be9c['forEach'](_0xd55f14=>{this['_updateResourceInContextState'](_0xd55f14,_0x1b2cfd['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x5c16e3),this['fire']('contextItemRemoved',{'uiId':_0x5c16e3,'type':_0x1b2cfd?.['type']}),'current-document'===_0x5c16e3&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x20ddd9,_0x481292){if(this['_pendingContextItems']['has'](_0x20ddd9['uiId'])&&(this['_pendingContextItems']['set'](_0x20ddd9['uiId'],_0x20ddd9),this['fire']('contextItemLoadingEnded',{'contextItem':_0x20ddd9,'isLoading':_0x481292}),_0x20ddd9['resourceId'])){const _0x37ea9a=this['_findSourceIdsByResourceId'](_0x20ddd9['resourceId']);_0x37ea9a&&_0x37ea9a['forEach'](_0x1c6373=>{this['_updateResourceInContextState'](_0x1c6373,_0x20ddd9['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x59b1fd){this['_conversationContextItems']['set'](_0x59b1fd['uiId'],_0x59b1fd);}['_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'](_0x2eeb33=>({..._0x2eeb33,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0xbaa5f2=>({..._0xbaa5f2,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x17efb3=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x17efb3,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x1f3ab4){for(const _0x463411 of this['_pendingContextItems']['values']())if(_0x463411['resourceId']===_0x1f3ab4)return!0x0;for(const _0x3d0b04 of this['_conversationContextItems']['values']())if(_0x3d0b04['resourceId']===_0x1f3ab4)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x542ed5){const _0x464b1d=[];for(const _0x49ea86 of this['_addContextOptionsState']['sources']){_0x49ea86['resources']['find'](_0x383ddf=>_0x383ddf['id']===_0x542ed5)&&_0x464b1d['push'](_0x49ea86['id']);}return 0x0===_0x464b1d['length']?null:_0x464b1d;}['_updateResourceInContextState'](_0x252926,_0x2e2062,_0x18aff2){const _0x965eb8=this['_addContextOptionsState']['sources']['find'](_0x49b3df=>_0x49b3df['id']===_0x252926);if(!_0x965eb8)return;const _0x2780a0=_0x965eb8['resources']['find'](_0x26d61e=>_0x26d61e['id']===_0x2e2062);_0x2780a0&&(_0x2780a0['isInContext']=_0x18aff2,this['fire']('resourceStateChanged',{'sourceId':_0x252926,'resourceId':_0x2e2062,'isInContext':_0x18aff2}));}['_startUploadOperation'](_0x1dac05){this['_ongoingUploadOperations']['set'](_0x1dac05,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x1754fb){this['_ongoingUploadOperations']['delete'](_0x1754fb),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Hs=['capabilitiesUpdated'];class Ms extends pt(){['_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'](_0x490bf5){const _0x143908={};return _0x490bf5&&_0x490bf5['isWebSearchEnabled']&&(_0x143908['webSearch']={}),_0x490bf5&&_0x490bf5['isReasoningEnabled']&&(_0x143908['reasoning']={}),_0x143908;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x2a27a0){_0x2a27a0!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x2a27a0,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x4fa3b2){_0x4fa3b2!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x4fa3b2,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Us extends xs{['userMessage'];['conversationId'];['contextItems']=new Map();['capabilities'];['model'];['attributes'];constructor(_0x4c651c){super(_0x4c651c),this['conversationId']=_0x4c651c['conversationId'],this['contextItems']=_0x4c651c['contextItems'],this['capabilities']=_0x4c651c['capabilities'],this['userMessage']=_0x4c651c['userMessage'],this['model']=_0x4c651c['model'],this['attributes']=_0x4c651c['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':Ps['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Ms['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class Vs extends pt(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x5be9c6){super(),this['options']=_0x5be9c6,this['connector']=_0x5be9c6['connector'],this['chatModels']=_0x5be9c6['chatModels'],this['id']=_0x5be9c6['conversationId'],this['isFromHistory']=_0x5be9c6['isFromHistory'];}async['init'](_0xcb5e21){try{this['chatContext']=new Ps({'connector':this['connector'],'config':_0xcb5e21,'ownerId':this['id']}),this['chatContext']['delegate'](...Ds)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Ms(),this['chatCapabilities']['delegate'](...Hs)['to'](this),this['chatCapabilities']['init']();const _0x23da15=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x23da15});const _0x1f6dca=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x1f6dca&&await this['setModel'](_0x1f6dca);}catch(_0xc013fb){const _0x39857c=new ot('ai-chat-conversation-init-failed',null,{'message':_0xc013fb['message']||_0xc013fb});_0x39857c['stack']=_0xc013fb['stack'],this['fire']('error',{'error':_0x39857c});}}async['start'](){if(this['isStarted'])throw new ot('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new ot('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x1b0063}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x1b0063,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x3b5ab1){const _0x2abc86=new ot('ai-chat-conversation-start-failed',null,{'message':_0x3b5ab1['message'],'conversationId':this['id']});throw _0x2abc86['stack']=_0x3b5ab1['stack'],this['fire']('error',{'error':_0x2abc86}),_0x2abc86;}}async['load'](_0x305ea8,_0x9d26b8){try{const _0x1f8f5f=await this['connector']['fetchConversation'](_0x305ea8)['getConversation'](),_0x29fd42=await this['connector']['fetchConversationMessages'](_0x305ea8)['getMessages'](),_0x387e72=_0x29fd42[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x1f8f5f['id'],'title'in _0x1f8f5f?this['fire']('setConversationTitle',_0x1f8f5f['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x4ee3df=(await this['chatModels']['getAll']())['find'](_0xd80e22=>_0xd80e22['id']['toLowerCase']()===_0x387e72['toLowerCase']());return this['selectedModel']=_0x4ee3df,this['fire']('modelSelected',{'selectedModel':_0x4ee3df,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x29fd42,_0x9d26b8,_0x387e72),this['currentInteraction']=void 0x0,this;}catch(_0x533caa){const _0xd5a077=new ot('ai-chat-conversation-init-from-id-failed',null,{'message':_0x533caa['message'],'conversationId':_0x305ea8});throw _0xd5a077['stack']=_0x533caa['stack'],this['fire']('error',{'error':_0xd5a077}),_0xd5a077;}}async['_processMessagesToInteractions'](_0x43c12b,_0x3f144f,_0x2237e7){let _0x404f23;for(const _0x48b860 of _0x43c12b)if('user'===_0x48b860['role']){const _0x29f38e=await this['_extractContextItems'](_0x48b860),_0x51baad={'isReasoningEnabled':Object['hasOwn'](_0x48b860['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x48b860['capabilities'],'webSearch')};_0x404f23=this['createInteraction']({'userMessage':_0x48b860['prompt'],'contextItems':_0x29f38e,'capabilities':_0x51baad,'modelId':_0x2237e7,'attributes':_0x48b860['attributes']}),this['currentInteraction']=_0x404f23,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x48b860['role']&&_0x404f23){const _0x3bbb63=[];for(const _0x57d342 of _0x48b860['content'])switch(_0x57d342['type']){case'text':case'modification':{const _0x5b7c30=_0x404f23['getDocumentContext']()?.['sessionId']!==_0x3f144f;_0x404f23['currentReply']=_0x404f23['createReply']({'type':_0x57d342['type'],'isDone':!0x0,'interactionId':_0x404f23['id'],'areActionsDisabled':_0x5b7c30}),_0x404f23['currentReply']['appendContent'](_0x57d342['content']),_0x3bbb63['length']>0x0&&(_0x404f23['currentReply']['sources']=_0x3bbb63['splice'](0x0));break;}case'url':_0x3bbb63['push'](_0x57d342);break;case'mcp-tool-result':{const {data:_0x24c95d,attributes:_0x1a21bb}=JSON['parse'](_0x57d342['content']);_0x404f23['_handleToolResultData']({'toolName':_0x57d342['toolName'],'data':_0x24c95d,'attributes':_0x1a21bb});break;}}}}}async['_extractContextItems'](_0xb7c342){const _0x43eb7e=new Map();if(!_0xb7c342['content'])return _0x43eb7e;for(const _0x43cf97 of _0xb7c342['content']){const _0x5357fe=await this['chatContext']['populateFromMessage'](_0x43cf97);_0x5357fe&&_0x43eb7e['set'](_0x5357fe['id'],_0x5357fe);}return _0x43eb7e;}async['handleUserInteraction']({userMessage:_0x27bfc4,attributes:_0x1c7bc4}){if(!this['isStarted'])throw new ot('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new ot('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x5d7469=this['chatContext']['getPendingContextItems'](),_0x1031b6=this['chatCapabilities']['getCapabilitiesConfig'](),_0x2b26d1=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x27bfc4,'contextItems':_0x5d7469,'capabilities':_0x1031b6,'modelId':_0x2b26d1,'attributes':_0x1c7bc4}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x43952d){if(_0x43952d instanceof ot)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x43952d});else{const _0x2fa1db=Ls['get'](_0x43952d['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new ot(_0x2fa1db,null,{'error':_0x43952d})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x478b7a,contextItems:_0x1ae7de,capabilities:_0x27406f,modelId:_0x3cff6e,attributes:_0x3c523b}){const _0x3616b9=new Us({'userMessage':_0x478b7a,'contextItems':_0x1ae7de,'capabilities':_0x27406f,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x3cff6e,'attributes':_0x3c523b});return _0x3616b9['delegate'](...ys)['to'](this),this['interactions']['push'](_0x3616b9),this['fire']('interactionCreated',_0x3616b9),_0x3616b9;}['getInteraction'](_0x51fbc2){return this['interactions']['find'](_0x12cd5=>_0x12cd5['id']===_0x51fbc2);}['removeInteraction'](_0x2721ea){const _0x2d40bc=this['getInteraction'](_0x2721ea);_0x2d40bc&&(_0x2d40bc['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x2d40bc),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x5cc680){this['chatContext']['addCurrentDocumentToContext'](_0x5cc680);}async['updateCurrentDocumentInContext']({content:_0x267261,version:_0x384aeb,sessionId:_0x5b565b,selections:_0xa9ae7e}){await this['chatContext']['updateCurrentDocument'](_0x267261,_0x384aeb,_0x5b565b,_0xa9ae7e);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0xb9234b){this['chatContext']['addSelectionToContext'](_0xb9234b);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x4b2708){this['chatContext']['addFilesToContext'](_0x4b2708);}['addUrlToContext'](_0x30febe){this['chatContext']['addUrlToContext'](_0x30febe);}['addToolItemToContext'](_0x4acd8d){this['chatContext']['addToolItemToContext'](_0x4acd8d);}['addResourceToContext'](_0x2c84fe,_0x3a3618){this['chatContext']['addResourceToContext'](_0x2c84fe,_0x3a3618);}['loadSourceResources'](_0x38edad,_0x59fce5,_0x3c9b9d){return this['chatContext']['loadSourceResources'](_0x38edad,_0x59fce5,_0x3c9b9d);}['removeFromContext'](_0x227584){this['chatContext']['removeFromContext'](_0x227584);}['setWebSearch'](_0x43e085){this['chatCapabilities']['setWebSearch'](_0x43e085);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x591ccc){this['chatCapabilities']['setReasoning'](_0x591ccc);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x231691){_0x231691?!0x1===await this['chatModels']['isAvailable'](_0x231691)&&(It('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x231691}),_0x231691=(await this['chatModels']['getAvailableModels']())[0x0]):(It('ai-chat-conversation-set-model-null',{'conversation':this}),_0x231691=(await this['chatModels']['getAvailableModels']())[0x0]),_0x231691['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x231691,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x231691}));}}class Bs extends pt(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x15d299,config:_0x2bf58a,locale:_0x17ad6f}){super(),this['_connector']=_0x15d299,this['_config']=_0x2bf58a,this['_locale']=_0x17ad6f;}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 _0x2aa914=await this['getAll']();let _0x285907;return _0x285907=this['_availableModels']?this['_filterModels'](_0x2aa914,this['_availableModels']):_0x2aa914['filter'](_0x295a2c=>_0x295a2c['recommended']),_0x285907;}async['getModel'](_0x217018){const _0x424d9e=await this['getAll']();if(!_0x424d9e['length'])return null;if(_0x217018){const _0xd3b5c6=this['_getModelById'](_0x424d9e,_0x217018);if(_0xd3b5c6)return _0xd3b5c6;It('ai-chat-model-id-unrecognized',{'modelId':_0x217018,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x38557b=await this['getAvailableModels']();if(!_0x38557b['length'])return null;if(this['_defaultModelId']){const _0x3a07cc=this['_getModelById'](_0x38557b,this['_defaultModelId']);if(_0x3a07cc)return _0x3a07cc;It('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x38557b[0x0]['id']});}return _0x38557b[0x0];}async['isAvailable'](_0x172263){return(await this['getAvailableModels']())['some'](_0x28a239=>_0x28a239['name']===_0x172263['name']&&_0x28a239['provider']===_0x172263['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x2749ae=this['_locale']['uiLanguage']||'en',_0x24d2e6=this['_connector']['getModels'](_0x2749ae),_0x11cfae=await _0x24d2e6['list']();this['_modelList']=_0x11cfae['items']['map'](_0x1b6515=>Gs(_0x1b6515)?{..._0x1b6515,'name':as(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x1b6515);}catch(_0x50f900){throw Et('ai-models-unable-to-retrieve',{'error':_0x50f900}),_0x50f900;}return[...this['_modelList']];}['_filterModels'](_0x32d006,_0x5ae827){let _0x3ef766;if(_0x5ae827){_0x3ef766=[];const _0x106093=new Set(),_0x55ae59='string'==typeof _0x5ae827?[_0x5ae827['toLocaleLowerCase']()]:_0x5ae827['map'](_0x3a0c8c=>_0x3a0c8c['toLocaleLowerCase']());for(const _0x3d3edf of _0x55ae59)for(const _0x196cb7 of _0x32d006)!_0x106093['has'](_0x196cb7['id'])&&this['_isMatchingFilter'](_0x196cb7,_0x3d3edf)&&(_0x3ef766['push'](_0x196cb7),_0x106093['add'](_0x196cb7['id']));}else _0x3ef766=_0x32d006;return _0x3ef766;}['_isMatchingFilter'](_0x596127,_0x4b7a00){const _0x400618=_0x596127['id']['toLocaleLowerCase'](),_0x1a6441=_0x596127['name']['toLocaleLowerCase'](),_0x45e5b0=_0x596127['provider']['toLocaleLowerCase']();return _0x400618===_0x4b7a00||_0x1a6441===_0x4b7a00||Gs(_0x596127)&&'auto'===_0x4b7a00||_0x45e5b0===_0x4b7a00||_0x400618['startsWith'](_0x4b7a00);}['_getModelById'](_0xc65bc1,_0x421d54){return _0xc65bc1['find'](_0x4eb281=>Gs(_0x4eb281)&&'auto'===_0x421d54?_0x4eb281:_0x4eb281['id']===_0x421d54)||null;}}function Gs(_0x318081){return _0x318081['id']['startsWith']('agent');}function Fs(_0xb953af){if(_0xb953af instanceof _0x384afe)return _0xb953af;if(_0xb953af?.['editors']&&_0xb953af['editors']['get'](0x0))return _0xb953af['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.'),_0xb953af['editors']['get'](0x0);throw new ot('ai-get-editor-from-context-no-editor');}function Ks({editor:_0x273cb9,interaction:_0x324627,reply:_0x11bc37,groups:_0x5cfc22,transform:_0x1f811e,documentCompare:_0x260380,documentCompareOptions:_0x457ab4}){const _0xece584=_0x324627['getDocumentContext']();if(!_0xece584)return[];const _0x5721b0=_0xece584['content'],_0x249dc4=_0xece584['version'],_0x28b5c2=_0x11bc37['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x5526a1}of _0x5cfc22){const _0x386ce3=_0x5526a1['filter'](_0x315e49=>'new'!=_0x315e49['type'])['map'](_0x3e37df=>_s('data-id',_0x3e37df['id'],_0x28b5c2)),_0x1c0410=_0x5526a1['filter'](_0x52a7e2=>'removed'!=_0x52a7e2['type'])['map'](_0x2c385c=>_0x2c385c['node']['cloneNode'](!0x0));let _0x26ed49=null;if(_0x386ce3['length']){_0x26ed49=_0x386ce3[0x0]['previousSibling'];for(let _0x1e556e=0x0;_0x1e556e<_0x386ce3['length'];_0x1e556e++)_0x592694(_0x386ce3[_0x1e556e]);}if(_0x1c0410['length']){_0x26ed49||(_0x5526a1[0x0]['anchorId']?_0x26ed49=_s('data-id',_0x5526a1[0x0]['anchorId'],_0x28b5c2):(_0x26ed49=_0x1c0410['shift'](),_0x4c35bf(_0x28b5c2,_0x26ed49)));for(let _0x4933ee=0x0;_0x4933ee<_0x1c0410['length'];_0x4933ee++)_0x38ed53(_0x26ed49,_0x1c0410[_0x4933ee]),_0x26ed49=_0x1c0410[_0x4933ee];}}const _0x176900=ds(_0x28b5c2),_0x4abc3b=_0x260380['getDiff'](_0x5721b0,_0x176900,_0x457ab4)['getOperations']();if(_0x1f811e){const _0x49d7d3=_0x273cb9['model']['document']['history']['getOperations'](_0x249dc4),_0x5ca43b={'document':_0x273cb9['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x510b2f(_0x4abc3b,_0x49d7d3,_0x5ca43b)['operationsA'];}return _0x4abc3b;}function Ws(_0x4d37f2,_0xf69d42){if('marker'!=_0xf69d42['type'])return;const _0x519a11=_0x4d37f2['model']['markers']['get'](_0xf69d42['name']);_0x519a11&&(_0xf69d42['oldRange']=_0x519a11['getRange']());}class Ys extends _0x3627a2{['activeConversation'];['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[rs,_0x45eadc];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new qt(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 Bs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x161180=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x496fef,_0x36c4ee)=>{this['_handleUIUserMessage']({'message':_0x36c4ee});}),this['listenTo'](_0x161180,'resizedTabs',(_0x5041cf,_0x388265)=>{this['_setIsMaximized'](_0x388265);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x161180['resize']();}),this['listenTo'](_0x161180['view'],'change:activeTab',(_0x46e72d,_0x1aa296,_0x3927bc)=>{'chat'!==_0x3927bc&&this['removeSelectionFromChatContext']();}),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',(_0x24fd7c,_0x2be32d)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x2be32d));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x389e91,_0x20df05)=>{this['activeConversation']?.['addUrlToContext'](_0x20df05);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x1d3e8c,_0x182f10)=>{_0x182f10['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x2badf8,_0xd3913f)=>{this['activeConversation']?.['addResourceToContext'](_0xd3913f['source'],_0xd3913f['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0xd8d0c2,_0x2df10b)=>{this['_removeFromContext'](_0x2df10b);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x27727f,_0x470862)=>{this['activeConversation']?.['loadSourceResources'](_0x470862['sourceId'],_0x470862['query'],_0x470862['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x50d535,_0x39ba1f)=>{this['activeConversation']?.['setModel'](_0x39ba1f);}),this['listenTo'](this['_aiChatUi'],'like',(_0x4e0fc6,{replyId:_0x3c6400})=>{console['log']('Liked\x20response',_0x3c6400);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x59b30b,{replyId:_0x2d5cee})=>{console['log']('Disliked\x20response',_0x2d5cee);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x2d7993,_0x1e3565)=>{this['_insertSuggestion'](_0x1e3565);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x169ef2,{replyId:_0x2d5bd3,partIndex:_0x31ef90})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x2d5bd3,_0x31ef90);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x4498d6,{replyId:_0x354f74,partIndex:_0x18c195})=>{const _0x44446b=this['_getDocumentRangeForReplyChanges'](_0x354f74,_0x18c195);_0x44446b&&'$graveyard'!=_0x44446b['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'ranges':[_0x44446b['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x5400c6,_0x5cf087)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x5cf087);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x5ad5ef,{replyId:_0x4cf003,showDiff:_0x42c760})=>{const {reply:_0x49d3c5}=this['getInteractionAndReplyById'](_0x4cf003),_0x5ac1c5=_0x49d3c5['getContentParts']({'showDiff':_0x42c760});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x49d3c5['id'],'parts':_0x5ac1c5,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x3ef538,{replyId:_0x5e47c8,partIndex:_0x374dfa})=>{this['_rejectSuggestion']({'replyId':_0x5e47c8,'partIndex':_0x374dfa}),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),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:_0xfb405e,partIndex:_0x4a1d48}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x36972a}=this['getInteractionAndReplyById'](_0xfb405e),_0x2040e7=_0x36972a['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x4a1d48});this['_aiChatBalloon']['updateContent']({'part':_0x2040e7[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0xf8c929,partIndex:_0x4822a0}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0xf8c929,'partIndex':_0x4822a0}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0xaa47fa,partIndex:_0xfaf5ba}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0xaa47fa,'partIndex':_0xfaf5ba}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0xbec0ac,partIndex:_0x24db79}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0xbec0ac,'partIndex':_0x24db79}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0x2639a7,partIndex:_0x538fca}=this['_currentPreviewedChangeGroup'],_0x784cbf=this['_getPresentableSiblingContentPartIndex'](_0x2639a7,_0x538fca,'next');null!==_0x784cbf&&this['_openBalloonFor'](_0x2639a7,_0x784cbf);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0xc99977,partIndex:_0x578c5b}=this['_currentPreviewedChangeGroup'],_0x54d4f5=this['_getPresentableSiblingContentPartIndex'](_0xc99977,_0x578c5b,'previous');null!==_0x54d4f5&&this['_openBalloonFor'](_0xc99977,_0x54d4f5);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x520dfc,{id:_0x2e4c8b})=>{if('aiChatBalloon'!==_0x2e4c8b)return;const {replyId:_0x1edfd4,partIndex:_0x4daae6}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x1edfd4,'index':_0x4daae6,'isActive':!0x1});})),this['on']('interactionCreated',(_0x19d39c,_0x1fedb5)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x1fedb5);}),this['on']('replyCreated',(_0x2941fe,_0x146abf)=>{this['_addFeedItemReply'](_0x146abf);});}async['afterInit'](){this['context']instanceof _0x384afe?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x375d70,_0xb75f0c)=>{_0xb75f0c['on']('ready',()=>{this['_integrateEditor'](_0xb75f0c);});});const _0x1c8fdf=this['context']['config']['get']('ai.chat.initialConversation');let _0x3d4147=_0x1c8fdf;if('lastCreated'!=_0x1c8fdf||(_0x3d4147=await this['_getLastCreatedConversationId'](),_0x3d4147))return'new'==_0x3d4147?this['_startConversationSafely']():this['loadConversation'](_0x3d4147);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async['loadConversation'](_0x492856){this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),(this['context']['plugins']['get'](ns)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x492856)['getConversation'](),await this['_startConversationSafely'](_0x492856),this['_updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x492856,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x240263){this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x492856}),this['_logError'](new ot('ai-chat-conversation-not-found',this,{'error':_0x240263}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['registerToolDataCallback'](_0x23dd7e){let _0x42f8a1=null,_0x1aa78d=null;this['on']('toolDataReceived',(_0x2fe183,_0x1e932b,_0x177ac6)=>{_0x177ac6['id']!==_0x42f8a1&&(_0x42f8a1=_0x177ac6['id'],_0x1aa78d=this['_getAIChatFeedAPI'](_0x177ac6)),_0x23dd7e(_0x1e932b,_0x1aa78d);});}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](as(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x6a9d80=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x6a9d80),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage'](_0x2a22a3){await this['_handleUIUserMessage'](_0x2a22a3);}['getGroupId'](){const _0x2410c3=this['context']['config']['get']('collaboration.channelId');if(!_0x2410c3)throw new ot('ai-chat-missing-channel-id',this);return _0x2410c3;}['_handleRemovedConversation'](_0x2e0c6d){this['activeConversation']['id']===_0x2e0c6d&&this['_startConversationSafely']();}['_insertSuggestion'](_0x6afbd1){const _0x4038c5=Fs(this['context']);if(!_0x4038c5['plugins']['has']('TrackChanges'))throw new ot('ai-no-track-changes',null);const _0x210cda=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x2e7d26,interaction:_0x6c0e7f}=this['getInteractionAndReplyById'](_0x6afbd1['replyId']),_0x2572f1=this['_getDocumentRangeForReplyChanges'](_0x6afbd1['replyId'],_0x6afbd1['partIndex']),_0x11da7a=void 0x0!==_0x6afbd1['partIndex']?[_0x2e7d26['changeGroups'][_0x6afbd1['partIndex']]]:_0x2e7d26['changeGroups']['filter'](_0x50eb5d=>'pending'==_0x50eb5d['state']),_0x2f7659=_0x11da7a['map'](_0x34724e=>_0x2e7d26['changeGroups']['indexOf'](_0x34724e));if(!_0x2572f1||'$graveyard'==_0x2572f1['range']['root']['rootName'])return void _0x2f7659['forEach'](_0x43a659=>_0x2e7d26['setChangeGroupState'](_0x43a659,'outdated'));_0x2f7659['forEach'](_0x2a6e0a=>_0x2e7d26['setChangeGroupState'](_0x2a6e0a,'accepted'));const _0x1b2cc6=Ks({'editor':_0x4038c5,'reply':_0x2e7d26,'interaction':_0x6c0e7f,'groups':_0x11da7a,'transform':!0x0,'documentCompare':_0x210cda,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x135657;_0x2572f1&&this['_scrollToSuggestionRange'](_0x2572f1['range']),_0x4038c5['model']['change'](_0x511730=>{_0x135657=_0x511730['batch'],_0x4038c5['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x1b2cc6),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x135657,{'interactionId':_0x6c0e7f['id'],'replyId':_0x2e7d26['id'],'indexes':_0x2f7659['slice']()}),this['_updateRatings'](_0x2e7d26);}['_applySuggestion'](_0x4c0454){const _0x516473=Fs(this['context']),_0x1ead79=this['context']['plugins']['get'](_0x45eadc),{reply:_0x1fc8d7,interaction:_0x129ae9}=this['getInteractionAndReplyById'](_0x4c0454['replyId']),_0x2ccf31=this['_getDocumentRangeForReplyChanges'](_0x4c0454['replyId'],_0x4c0454['partIndex']),_0x2357f7=void 0x0!==_0x4c0454['partIndex']?[_0x1fc8d7['changeGroups'][_0x4c0454['partIndex']]]:_0x1fc8d7['changeGroups']['filter'](_0x547e83=>'pending'==_0x547e83['state']),_0x4e6ae0=_0x2357f7['map'](_0xd873f9=>_0x1fc8d7['changeGroups']['indexOf'](_0xd873f9));if(!_0x2ccf31||'$graveyard'==_0x2ccf31['range']['root']['rootName'])return void _0x4e6ae0['forEach'](_0x331753=>_0x1fc8d7['setChangeGroupState'](_0x331753,'outdated'));_0x4e6ae0['forEach'](_0x5710a9=>_0x1fc8d7['setChangeGroupState'](_0x5710a9,'accepted'));const _0x1af419=Ks({'editor':_0x516473,'reply':_0x1fc8d7,'interaction':_0x129ae9,'groups':_0x2357f7,'transform':!0x0,'documentCompare':_0x1ead79,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x4bb3f3;_0x2ccf31&&this['_scrollToSuggestionRange'](_0x2ccf31['range']),_0x516473['model']['change'](_0x389644=>{_0x4bb3f3=_0x389644['batch'];for(const _0x531c8d of _0x1af419)_0x531c8d['baseVersion']=_0x516473['model']['document']['version'],Ws(_0x516473,_0x531c8d),_0x389644['batch']['addOperation'](_0x531c8d),_0x516473['model']['applyOperation'](_0x531c8d);}),this['_batchToChanges']['set'](_0x4bb3f3,{'interactionId':_0x129ae9['id'],'replyId':_0x1fc8d7['id'],'indexes':_0x4e6ae0['slice']()}),this['_updateRatings'](_0x1fc8d7);}['_rejectSuggestion'](_0x25e9b0){const {reply:_0x5c1d1e}=this['getInteractionAndReplyById'](_0x25e9b0['replyId']);_0x5c1d1e['setChangeGroupState'](_0x25e9b0['partIndex'],'rejected');}['_openBalloonFor'](_0x295227,_0x46b1a7){if(!this['_aiChatBalloon'])return;const {reply:_0x1ee219}=this['getInteractionAndReplyById'](_0x295227),_0x58bb6d=_0x1ee219['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0xc0831d,_0x58a517;if(void 0x0!==_0x46b1a7?(_0x58a517=_0x58bb6d['find'](_0x3c0c6e=>_0x3c0c6e['index']==_0x46b1a7),_0xc0831d=_0x58a517?.['index']):(_0x58a517=_0x58bb6d[0x0],_0xc0831d=_0x58a517['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x295227&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0xc0831d)return;const _0x1014a6=this['_getUserPresentableContentPartDocumentRange'](_0x295227,_0x1ee219,_0x58a517);if(!_0x1014a6)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x295227,'partIndex':_0xc0831d},this['_scrollToSuggestionRange'](_0x1014a6,!0x0);const _0x3d3195=this['_getPresentableSiblingContentPartIndex'](_0x295227,_0xc0831d,'next');this['_aiChatBalloon']['updateContent']({'part':_0x58a517,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0xc0831d,'title':as(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0xc0831d+0x1)['toString']()),'showRotator':null!==_0x3d3195,'ranges':[_0x1014a6],'areActionsDisabled':_0x1ee219['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x295227,_0xc0831d),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x295227,'index':_0xc0831d,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0xe71987,_0x4c569c,_0x1c073d){const {reply:_0x1710c9}=this['getInteractionAndReplyById'](_0xe71987),_0x49d7fa=_0x1710c9['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x49d7fa['length'])return null;const _0x2f267e=_0x49d7fa['findIndex'](_0x670010=>_0x670010['index']==_0x4c569c),_0x544851='next'==_0x1c073d?0x1:-0x1;let _0x511407=_0x49d7fa['at']((_0x2f267e+_0x544851)%_0x49d7fa['length'])['index'],_0x3af838=_0x49d7fa[_0x511407];for(;!this['_getUserPresentableContentPartDocumentRange'](_0xe71987,_0x1710c9,_0x3af838);){if(_0x511407=_0x49d7fa['at']((_0x511407+_0x544851)%_0x49d7fa['length'])['index'],_0x511407===_0x2f267e)return null;_0x3af838=_0x49d7fa[_0x511407];}return _0x511407;}['_getUserPresentableContentPartDocumentRange'](_0x51c6c0,_0x597c4c,_0x4328d8){const _0xb7a779=_0x597c4c['changeGroups'];if(!_0x4328d8['hasChanges'])return null;const _0x2296ca=_0xb7a779['find'](_0x351fe0=>_0x351fe0['index']==_0x4328d8['index']);if('pending'!==_0x2296ca?.['state'])return null;const _0x3f4aeb=this['_getDocumentRangeForReplyChanges'](_0x51c6c0,_0x4328d8['index']);if(!_0x3f4aeb)return null;const {range:_0x1e738f,currentIndex:_0x4a3726}=_0x3f4aeb;return'$graveyard'==_0x1e738f['root']['rootName']?(_0x597c4c['setChangeGroupState'](_0x4a3726,'outdated'),null):_0x3f4aeb['range'];}['_getDocumentRangeForReplyChanges'](_0x8958ef,_0x3fefad){const _0xdc31a2=Fs(this['context']),{reply:_0x5d0c6b,interaction:_0x145da5}=this['getInteractionAndReplyById'](_0x8958ef),_0x47e1cb=_0x5d0c6b['changeGroups']['filter'](_0x5af2e0=>'pending'==_0x5af2e0['state']),_0x15845d=_0x47e1cb['map'](_0x2cc320=>_0x5d0c6b['changeGroups']['indexOf'](_0x2cc320));void 0x0===_0x3fefad&&(_0x3fefad=_0x15845d[0x0]);const _0x350b5a=_0x15845d['indexOf'](_0x3fefad);if(-0x1==_0x350b5a)return null;const _0x36958d=_0x47e1cb[_0x350b5a],_0x4afb14=new _0x4c3622([]),_0x3ea509=new _0x4c3622([]);for(const _0x43c575 of _0x36958d['changes'])if('removed'!=_0x43c575['type']&&_0x3ea509['children']['push'](_0x43c575['node']['cloneNode'](!0x0)),'new'!=_0x43c575['type']){const _0x5411fb=_0x290822(_0x347396=>gs(_0x347396,'data-id')==_0x43c575['id'],_0x5d0c6b['documentContextContent'],!0x0);_0x4afb14['children']['push'](_0x5411fb['cloneNode'](!0x0));}if(0x0==_0x4afb14['children']['length']){if(_0x36958d['changes'][0x0]['anchorId']){const _0x5890f7=_s('data-id',_0x36958d['changes'][0x0]['anchorId'],_0x5d0c6b['documentContextContent']);_0x4afb14['children']['unshift'](_0x5890f7['cloneNode'](!0x0)),_0x3ea509['children']['unshift'](_0x5890f7['cloneNode'](!0x0)),_0x5890f7['nextSibling']&&(_0x4afb14['children']['push'](_0x5890f7['nextSibling']['cloneNode'](!0x0)),_0x3ea509['children']['push'](_0x5890f7['nextSibling']['cloneNode'](!0x0)));}else{const _0x40a7e2=_0x5d0c6b['documentContextContent']['children'][0x0];if(!_0x40a7e2)return null;_0x4afb14['children']['push'](_0x40a7e2['cloneNode'](!0x0)),_0x3ea509['children']['push'](_0x40a7e2['cloneNode'](!0x0));}}const _0x383a8d=_0x145da5['getDocumentContext'](),_0xf90dd4=_0xdc31a2['data']['parse'](_0x383a8d['content']),_0x339ae9=ds(_0x4afb14),_0xf0b74a=_0xdc31a2['data']['parse'](_0x339ae9),_0x211146=_0xdc31a2['data']['parse'](_0x339ae9),_0x48ed4f=_0xdc31a2['model']['createPositionAt'](_0xf0b74a,0x0),_0x2915aa=ds(_0x3ea509),_0x463021={'anchor':_0x48ed4f,'markDeletions':!0x1},_0x379154=_0xdc31a2['plugins']['get'](_0x45eadc)['getDiff'](_0x339ae9,_0x2915aa,_0x463021)['getOperations']();if(!_0x379154['length'])return null;_0xdc31a2['model']['change'](_0x3ef86b=>{for(const _0x43f509 of _0x379154)if('remove'==_0x43f509['type']){const _0x42275c=_0x43f509['sourcePosition'],_0x56e5df=_0x43f509['howMany'],_0x299d25=new _0x4c0de8(_0x42275c,_0x56e5df);_0x3ef86b['batch']['addOperation'](_0x299d25),_0xdc31a2['model']['applyOperation'](_0x299d25);}else'marker'!==_0x43f509['type']&&(_0x43f509['baseVersion']=null,_0x43f509['isDocumentOperation']=!0x1,_0x3ef86b['batch']['addOperation'](_0x43f509),_0xdc31a2['model']['applyOperation'](_0x43f509));});const _0x42e9ef=Rs(_0xdc31a2,_0x379154,_0xf0b74a);Os(_0xdc31a2['model'],_0x42e9ef);const _0x1cf7c=_0x42e9ef['getFirstRange']()['start']['path']['slice'](),_0x11503d=_0x42e9ef['getFirstRange']()['end']['path']['slice'](),_0x147b0d=[];let _0x2d37fb=_0xf0b74a,_0x3c394f=_0x211146;for(let _0x92a2a7=0x0;_0x92a2a7<_0x11503d['length'];_0x92a2a7++){const _0x5d32ad=_0x2d37fb['maxOffset']-_0x11503d[_0x92a2a7];_0x147b0d[_0x92a2a7]=_0x3c394f['maxOffset']-_0x5d32ad,_0x2d37fb=_0x2d37fb['getChildAtOffset'](_0x11503d[_0x92a2a7]),_0x3c394f=_0x3c394f['getChildAtOffset'](_0x147b0d[_0x92a2a7]);}const _0x1c4900=_0xdc31a2['model']['createRange'](_0xdc31a2['model']['createPositionFromPath'](_0x211146,_0x1cf7c),_0xdc31a2['model']['createPositionFromPath'](_0x211146,_0x147b0d)),_0x1f11dc=_0x211146['getChild'](0x0)['getAttribute'](_0x2332a9),_0x3bc675=Array['from'](_0xf90dd4['getChildren']())['find'](_0x277825=>_0x277825['getAttribute'](_0x2332a9)==_0x1f11dc)['getPath'](),_0x32e7f5=_0x1c4900['start']['path']['slice'](),_0x1a5204=_0x1c4900['end']['path']['slice']();_0x32e7f5[0x0]=_0x3bc675[0x0]+_0x32e7f5[0x0],_0x1a5204[0x0]=_0x3bc675[0x0]+_0x1a5204[0x0];let _0x1f362f=_0xdc31a2['model']['createRange'](_0xdc31a2['model']['createPositionFromPath'](_0xdc31a2['model']['document']['getRoot'](),_0x32e7f5),_0xdc31a2['model']['createPositionFromPath'](_0xdc31a2['model']['document']['getRoot'](),_0x1a5204));const _0xe71d0e=_0xdc31a2['model']['document']['history']['getOperations'](_0x383a8d['version']);for(const _0x6b71ef of _0xe71d0e)_0x1f362f=_0x25d743['_createFromRanges'](_0x1f362f['getTransformedByOperation'](_0x6b71ef));return{'range':_0x1f362f,'currentIndex':_0x3fefad};}['_integrateEditor'](_0xe56262){if(_0xe56262['plugins']['has']('Undo')){const _0x58e879=_0xe56262['commands']['get']('undo'),_0x2b30d5=_0xe56262['commands']['get']('redo');this['listenTo'](_0x58e879,'revert',(_0x4081d4,_0x397fec,_0x3c9732)=>{const _0x5145ff=this['_batchToChanges']['get'](_0x397fec);if(!_0x5145ff)return;const _0x31d489=this['activeConversation']['getInteraction'](_0x5145ff['interactionId'])['getReply'](_0x5145ff['replyId']);_0x5145ff['indexes']['forEach'](_0x5c1eb6=>_0x31d489['setChangeGroupState'](_0x5c1eb6,'pending')),this['_batchToChanges']['delete'](_0x397fec),this['_batchToChanges']['set'](_0x3c9732,_0x5145ff);}),this['listenTo'](_0x2b30d5,'revert',(_0x4985df,_0x3fc6ba,_0x3b5e94)=>{const _0x1dfdfb=this['_batchToChanges']['get'](_0x3fc6ba);if(!_0x1dfdfb)return;const _0x3b3e6a=this['activeConversation']['getInteraction'](_0x1dfdfb['interactionId'])['getReply'](_0x1dfdfb['replyId']);_0x1dfdfb['indexes']['forEach'](_0x3f18dd=>_0x3b3e6a['setChangeGroupState'](_0x3f18dd,'accepted')),this['_batchToChanges']['delete'](_0x3fc6ba),this['_batchToChanges']['set'](_0x3b5e94,_0x1dfdfb);});}const _0x309c4b=_0xe56262['config']['get']('ai.chat.context');_0x309c4b['alwaysAddSelection']&&_0x309c4b['document']['enabled']&&this['listenTo'](_0xe56262['model']['document']['selection'],'change:range',(_0x269c4a,_0x21dc5f)=>{if(!_0x21dc5f['directChange'])return;'chat'===_0xe56262['plugins']['get']('AITabs')['view']['activeTab']&&(_0xe56262['model']['hasContent'](_0xe56262['model']['document']['selection'])?this['addSelectionToChatContext']():this['removeSelectionFromChatContext']());});}async['_getLastCreatedConversationId'](){const _0x3bc311=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x30cf17=await _0x3bc311['getConversations']();return _0x30cf17['length']?_0x30cf17[0x0]['id']:'new';}catch(_0x23e92a){return this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':at()}),this['_logError'](new ot('ai-chat-conversation-init-failed',this,{'error':_0x23e92a})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async['_startConversationSafely'](_0x945712){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x945712);}catch(_0x36bebb){this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x945712||at()}),console['error'](_0x36bebb),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x2a8b68){let _0x154487;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0x2a8b68||!this['activeConversation']?_0x154487=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x154487=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x5b4f66=this['getGroupId'](),_0x3032ac=_0x2a8b68||at();this['activeConversation']=new Vs({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x154487,'conversationId':_0x3032ac,'group':_0x5b4f66,'getEditor':()=>Fs(this['context']),'isFromHistory':!!_0x2a8b68}),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','interactionStarted','replyCreated')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0xf1e8fe,_0xb38125)=>{this['_aiChatUi']['createConversation'](_0xb38125),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x2a8b68||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x5928e5,_0x49b76f)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x49b76f['isUploadInProgress']);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x2b38b7=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x2b38b7);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x16f153=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x16f153);}),this['activeConversation']['on']('webSearchFinished',(_0x1857fd,_0x40cb28)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x40cb28,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x2f00fb,_0x1ae711)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x1ae711,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x183802,_0x54c45f)=>{this['_aiChatUi']['removeFeedInteraction'](_0x54c45f['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x97b055,_0x42af7f,_0x3fcd76)=>{this['_updateConversationTitle'](_0x42af7f,_0x3fcd76);}),this['activeConversation']['on']('replyContentUpdated',async(_0x29abda,_0x32553f)=>{await this['_updateReplyContent']({'reply':_0x32553f});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x6e870a,{reply:_0x58585d,index:_0x35a2d8,state:_0x2fa8fe})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x58585d['id'],'index':_0x35a2d8,'state':_0x2fa8fe}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x58585d['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x35a2d8&&this['_aiChatBalloon']?.['setState'](_0x2fa8fe);}),this['activeConversation']['on']('contextItemAdded',(_0x2171f2,_0x342f15)=>{if(this['_aiChatUi']['addContextItem'](_0x342f15['contextItem'],_0x342f15['isLoading']),'selection'===_0x342f15['contextItem']['type']){const _0x3a57e4=[...Fs(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'ranges':_0x3a57e4,'id':'context','priority':0x1});}}),this['activeConversation']['on']('contextItemRemoved',(_0x36d933,_0x5e5a93)=>{this['_aiChatUi']['removeContextItem'](_0x5e5a93['uiId']),'current-document'==_0x5e5a93['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x5e5a93['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x577c0d,_0x2721c3)=>{this['_aiChatUi']['setContextItemLoading'](_0x2721c3['contextItem']['uiId'],_0x2721c3['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x1e613c,_0x563dad)=>{this['_aiChatUi']['setConversationContext'](_0x563dad['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x2c3c9,_0x5b0279)=>{this['_aiChatUi']['setAddContextOptions'](_0x5b0279['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x3c27fb,_0x2a9ed6)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x2a9ed6['sourceId'],_0x2a9ed6['source'],_0x2a9ed6['resources'],_0x2a9ed6['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x38a017,_0x9dd2f)=>{this['_aiChatUi']['updateResourceState'](_0x9dd2f['sourceId'],_0x9dd2f['resourceId'],_0x9dd2f['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x4b55b1,_0x3bdda2)=>{this['_aiChatUi']['updateCapabilities'](_0x3bdda2);}),this['activeConversation']['on']('modelSelected',async(_0xec67e9,_0x48521c)=>{const _0x6ac03d=(await this['_aiChatModels']['getAll']())['find'](_0x39d9e5=>_0x39d9e5['id']===_0x48521c['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x6ac03d,_0x48521c['isDisabled']);}),this['activeConversation']['on']('error',(_0x2ce1e5,{error:_0x172c02,interactionId:_0x5b0686,fileName:_0x106130,url:_0x34c448,sourceId:_0x34f94a,sourceLabel:_0x1cc13c})=>{const _0xc63422=_0x5b0686?_0x5b0686+':'+at():at();_0x172c02['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':as(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0xc63422}):_0x172c02['message']['startsWith']('ai-chat-conversation-init-failed')||_0x172c02['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0xc63422}),this['_logError'](_0x172c02)):_0x172c02['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x106130),'id':_0xc63422}):_0x172c02['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x34c448),'id':_0xc63422}):_0x172c02['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0xc63422}):_0x172c02['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0xc63422}):_0x172c02['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x34f94a&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x34f94a),this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x1cc13c||'source'),'id':_0xc63422}),this['_logError'](_0x172c02)):_0x172c02['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0xc63422}),this['_logError'](_0x172c02)):_0x172c02['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0xc63422}),this['_logError'](_0x172c02)):_0x172c02['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0xc63422}),this['_logError'](_0x172c02)):_0x172c02['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0xc63422}),this['_logError'](_0x172c02)):_0x172c02['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0xc63422}),this['_logError'](_0x172c02)):_0x172c02['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0xc63422}),this['_logError'](_0x172c02)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':as(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0xc63422}),this['_logError'](_0x172c02));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x2a8b68||await this['activeConversation']['start']();}async['_handleUIUserMessage']({message:_0x11df1b,attributes:_0x682ac0}){if(!this['activeConversation'])throw new ot('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x3b63ff=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x3b63ff);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x11df1b,'attributes':_0x682ac0});}['_setIsMaximized'](_0x299754){this['_aiChatUi']['setIsMaximized'](_0x299754);}['_logError'](_0x1ccba0){Et(_0x1ccba0['message']);}['_removeFromContext'](_0x2b6d32){this['activeConversation']?.['removeFromContext'](_0x2b6d32);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x305302){const [_0x396942,_0x4ead3b]=_0x305302['split'](':'),_0x2bfe07=this['activeConversation']['getInteraction'](_0x396942),_0x100bcc=_0x2bfe07['getReply'](_0x4ead3b);return{'interaction':_0x2bfe07,'reply':_0x100bcc};}['_scrollToSuggestionRange'](_0xba8e43,_0x2b3551=!0x1){const _0x299549=Fs(this['context']),_0x558358={'target':_0x299549['editing']['view']['domConverter']['viewRangeToDom'](_0x299549['editing']['mapper']['toViewRange'](_0xba8e43)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x2b3551};_0x2b3551&&(_0x558358['alignToTop']=!0x0),mt(_0x558358);}['_updateConversationTitle'](_0x77ea2e,_0xd723f7=!0x1){this['_aiChatUi']['setConversationTitle'](_0x77ea2e||as(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0xd723f7);}['_addFeedItemReply'](_0x886c87){'text'===_0x886c87['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x886c87):this['_aiChatUi']['addFeedItemAISuggestion'](_0x886c87);}async['_updateReplyContent']({reply:_0x194fe4,renderingStrategy:_0x2a5f84}){const {id:_0x292c17,interactionId:_0x3302c9,isDone:_0x54294f,type:_0x2460b0,parsedContent:_0x323ff1}=_0x194fe4,_0x30a906=_0x3302c9+':'+_0x292c17;if('modification'===_0x2460b0){const _0x4d0265=_0x194fe4['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x30a906,'parts':_0x4d0265,'renderingStrategy':_0x2a5f84,'isDone':_0x54294f});}else'text'===_0x2460b0&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x30a906,'parsedContent':_0x323ff1,'renderingStrategy':_0x2a5f84,'isDone':_0x54294f});_0x54294f&&_0x194fe4['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x30a906,_0x194fe4['sources']);}async['_stopLastInteraction'](){const _0x828410=this['activeConversation']?.['lastInteraction'];_0x828410&&(_0x828410['stop'](),this['_aiChatUi']['stopInteraction'](_0x828410));}async['_flushLastInteractionUI'](){const _0x1d216e=this['activeConversation']?.['lastInteraction'];if(_0x1d216e){for await(const _0x336991 of _0x1d216e['replies'])this['_aiChatUi']['hasFeedItem'](_0x336991['id'])||this['_addFeedItemReply'](_0x336991),await this['_updateReplyContent']({'reply':_0x336991,'renderingStrategy':'static'});}}['_updateRatings'](_0x1e8672){const _0xbf3492={'positiveCount':_0x1e8672['changeGroups']['filter'](_0x42c68c=>'accepted'===_0x42c68c['state'])['length'],'totalCount':_0x1e8672['changeGroups']['length'],'modificationId':_0x1e8672['id']},_0x1bb5a4=this['activeConversation']['getInteraction'](_0x1e8672['interactionId'])['messageId'];_0x1bb5a4&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x1bb5a4,_0xbf3492);}['_getAIChatFeedAPI'](_0x26ddbd){const _0x8a76d3=this['_aiChatUi'],_0x31d94e=()=>{_0x26ddbd['resetWebSearchState'](),_0x26ddbd['resetReasoningState'](),_0x8a76d3['clearLoadingMessage']();},_0x30db7f=()=>{_0x26ddbd['currentReply']&&(_0x26ddbd['currentReply']['done'](),_0x26ddbd['currentReply']=void 0x0);};return{'insertTextReply':(_0x5a1d50,_0x152c78)=>{_0x30db7f(),_0x31d94e();const _0xbbecfa=_0x26ddbd['currentReply']=_0x26ddbd['createReply']({'type':'text','interactionId':_0x26ddbd['id'],'content':_0x5a1d50,'id':_0x152c78||at()});return _0x30db7f(),_0xbbecfa;},'insertCustomElement':async(_0x5cb263,_0x5cb761)=>(_0x30db7f(),_0x31d94e(),_0x8a76d3['addFeedItemCustomElement'](_0x5cb263,_0x5cb761||at())),'setLoadingMessage':_0x2972a4=>{_0x8a76d3['setLoadingMessage'](_0x2972a4);},'clearLoadingMessage':()=>{_0x8a76d3['clearLoadingMessage']();}};}}const $s='ai-selection';class qs extends _0x3627a2{constructor(_0x1dfe10){super(_0x1dfe10),this['context']['config']['define']('ai.models.showModelSelector',!0x0);}['_outputDataProcessor'];['_fakeSelections']=[];['_sessionId'];static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['sessionId'](){if(!this['_sessionId']){const _0x2dd542=Fs(this['context']),_0x130e75=_0x2dd542['plugins']['has']('RealTimeCollaborationClient')&&_0x2dd542['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x130e75||at();}return this['_sessionId'];}async['getDocumentData'](){const _0x5bbaa5=Fs(this['context']),_0x199f68=_0x5bbaa5['model'],_0x550fe9=_0x5bbaa5['data']['toView'](_0x199f68['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x419db9=new _0x3290f9(_0x5bbaa5['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x550fe9,_0x419db9);let _0x2731d6=await this['_getDocumentDataStringFromView'](_0x550fe9);const _0x4c9abd=this['_getMarkersInDocumentOrder'](),_0x581b85=[];for(const _0x429a54 of _0x4c9abd){const _0x4002e5='<'+_0x429a54['name']+':start></'+_0x429a54['name']+':start>',_0x791971=_0x2731d6['indexOf'](_0x4002e5);_0x2731d6=_0x2731d6['substring'](0x0,_0x791971)+_0x2731d6['substring'](_0x791971+_0x4002e5['length']);const _0x4d0eb6='<'+_0x429a54['name']+':end></'+_0x429a54['name']+':end>',_0x288def=_0x2731d6['indexOf'](_0x4d0eb6);_0x2731d6=_0x2731d6['substring'](0x0,_0x288def)+_0x2731d6['substring'](_0x288def+_0x4d0eb6['length']),_0x581b85['push']({'markerName':_0x429a54['name'],'start':_0x791971,'end':_0x288def,'htmlFragment':_0x2731d6['substring'](_0x791971,_0x288def)});}return{'content':_0x2731d6,'version':_0x5bbaa5['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x581b85};}async['afterInit'](){this['context']instanceof _0x384afe?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x188843,_0x47f48b)=>{_0x47f48b['on']('ready',()=>{this['_integrateEditor'](_0x47f48b);});});}['_setOutputDataProcessor'](_0x34f69b){this['_outputDataProcessor']=_0x34f69b;}async['_getDocumentDataStringFromView'](_0x4b77c7){let _0xd975f9;const _0x17c522=Fs(this['context']);if(this['_outputDataProcessor']){const _0x1d82eb=_0x17c522['data']['processor']['domConverter']['viewToDom'](_0x4b77c7),_0x2e4493=await this['_outputDataProcessor'](_0x1d82eb);_0xd975f9=_0x17c522['data']['processor']['htmlWriter']['getHtml'](_0x2e4493);}else _0xd975f9=_0x17c522['data']['processor']['toData'](_0x4b77c7);return _0xd975f9;}['_integrateEditor'](_0x178f5b){_0x178f5b['conversion']['for']('editingDowncast')['markerToHighlight']({'model':$s,'view':({markerName:_0xf27593})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0xf27593['split'](':')[0x1]],'priority':0xc})}),_0x178f5b['conversion']['for']('dataDowncast')['markerToElement']({'model':$s,'view':(_0x477c0b,{writer:_0xf661e0,options:_0x308318})=>_0x308318['convertAiChatSelectionMarker']?_0xf661e0['createUIElement'](_0x477c0b['markerName']+':'+(_0x477c0b['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x354ae5){const _0x3c6ff7=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0x354ae5);const _0x52e309=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x3c6ff7,_0x52e309);}['hideFakeVisualSelection'](_0x2f6a5e){const _0x11762e=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x2f6a5e);const _0x88e138=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x11762e,_0x88e138);}async['modelToDataWithIds'](_0x10d79e){const _0x5931e4=Fs(this['context']),_0x430c12=_0x5931e4['data']['toView'](_0x10d79e),_0x4b7fa6=new _0x3290f9(_0x5931e4['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x430c12,_0x4b7fa6),this['_getDocumentDataStringFromView'](_0x430c12);}['_setDataIdsOnChildren'](_0x265a43,_0x54e2de){let _0x20e611=!0x1;const _0x4a8056=new Set();for(const _0x2f2518 of _0x265a43['getChildren']()){if(!_0x2f2518['is']('view:element'))continue;const _0x3ae991=_0x2f2518['is']('view:containerElement'),_0x2c3e40=_0x2f2518['is']('view:emptyElement'),_0x5091df=this['_setDataIdsOnChildren'](_0x2f2518,_0x54e2de);if(_0x2f2518['hasAttribute']('data-id')){_0x20e611=!0x0,_0x4a8056['add'](_0x2f2518['getAttribute']('data-id'));continue;}(_0x3ae991||_0x2c3e40||_0x5091df)&&(_0x54e2de['setAttribute']('data-id',this['_nextDataId'](_0x4a8056),_0x2f2518),_0x20e611=!0x0);}return _0x20e611;}['_nextDataId'](_0xc7a6b0){let _0x3b93c0;do{_0x3b93c0='';for(let _0x2f733d=0x0;_0x2f733d<0x4;_0x2f733d++)_0x3b93c0+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0xc7a6b0['has'](_0x3b93c0));return _0xc7a6b0['add'](_0x3b93c0),_0x3b93c0;}['getSelectionText'](){const {model:_0x56c7c3}=Fs(this['context']),_0x5f321f=_0x56c7c3['document']['selection'],_0x24436b=[],_0x489b18=Array['from'](_0x5f321f['getRanges']());_0x489b18['sort']((_0x52d150,_0xd9b14a)=>_0x52d150['start']['isBefore'](_0xd9b14a['start'])?-0x1:0x1);for(const _0x26334d of _0x489b18)for(const _0xaf4327 of _0x26334d['getItems']())_0xaf4327['is']('$textProxy')?_0x24436b['push'](_0xaf4327['data']):_0xaf4327['is']('element')&&_0x24436b['length']>0x0&&'\x20'!==_0x24436b[_0x24436b['length']-0x1]&&_0x24436b['push']('\x20');return _0x24436b['length']?'\x22'+_0x24436b['join']('')['trim']()+'\x22':as(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_removeFakeSelectionById'](_0x2e7fa9){for(let _0x1ad205=0x0;_0x1ad205<this['_fakeSelections']['length'];_0x1ad205++)if(this['_fakeSelections'][_0x1ad205]['id']==_0x2e7fa9)return void this['_fakeSelections']['splice'](_0x1ad205,0x1);}['_addFakeSelection'](_0x4ee16f){this['_removeFakeSelectionById'](_0x4ee16f['id']),Ct(this['_fakeSelections'],_0x4ee16f);}['_refreshFakeSelection'](_0x230c6f,_0xe0b1ca){if(_0x230c6f==_0xe0b1ca)return;const _0x107415=Fs(this['context']),_0x368eaa=_0x107415['model'];_0x368eaa['change'](_0x240a2c=>{if(_0x230c6f){const _0xe842cc=_0x107415['model']['markers']['getMarkersGroup']($s);for(const _0x544844 of _0xe842cc)_0x240a2c['removeMarker'](_0x544844);}if(_0xe0b1ca)for(let _0x29fd0f=0x0;_0x29fd0f<_0xe0b1ca['ranges']['length'];_0x29fd0f++){let _0x1bb379=_0xe0b1ca['ranges'][_0x29fd0f];const _0x195304=$s+':'+_0xe0b1ca['id']+':'+_0x29fd0f;if(_0x1bb379['start']['isAtEnd']){const _0x243a45=_0x1bb379['start']['getLastMatchingPosition'](({item:_0x18bfc8})=>!_0x368eaa['schema']['isContent'](_0x18bfc8),{'boundaries':_0x1bb379});_0x1bb379=_0x240a2c['createRange'](_0x243a45,_0x1bb379['end']);}_0x240a2c['addMarker'](_0x195304,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1bb379});}});}['_getMarkersInDocumentOrder'](){const _0x42f08b=Fs(this['context'])['model'];return Array['from'](_0x42f08b['markers']['getMarkersGroup']($s))['sort']((_0x3ddc78,_0x21d26e)=>_0x3ddc78['getStart']()['isBefore'](_0x21d26e['getStart']())?-0x1:_0x3ddc78['getStart']()['isAfter'](_0x21d26e['getStart']())?0x1:0x0);}}const Qs=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],Xs=[...Qs,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class zs{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x16b6cf){this['options']={'delay':_0x16b6cf['delay']??0x14,'textNodeStyle':_0x16b6cf['textNodeStyle'],'onStreamUpdate':_0x16b6cf['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x242ce6,targetElement:_0x231725,abortSignal:_0x5edc58}){this['isStreaming']&&this['stop'](),_0x5edc58?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x17fa10(_0x242ce6,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0xf3a5fa=0x0;_0xf3a5fa<this['currentIndex'];_0xf3a5fa++)this['nodesList'][_0xf3a5fa]['shouldBeStreamed']=!0x0;do{const _0x5efaf1=Date['now'](),_0x956a2b=this['nodesList'][this['currentIndex']],_0x27aa5c=_0x5efaf1-this['lastUpdateTime'];if(_0x956a2b){_0x956a2b['shouldBeStreamed']=!0x0;let _0x41f092=_0x956a2b['parent'];for(;_0x41f092;)_0x41f092['shouldBeStreamed']=!0x0,_0x41f092=_0x41f092['parent'];}if(_0x27aa5c<this['options']['delay'])try{const {promise:_0x428385,abortController:_0x117807}=tn(this['options']['delay']-_0x27aa5c);this['timeoutAbortController']=_0x117807,await _0x428385;}catch(_0x4ded0c){return;}_0x1d2c9c(_0x231725,'<'+_0x231725['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x231725['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:_0x4cbbb2}){Array['from'](_0x4cbbb2['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x5520f7=>{_0x5520f7['replaceWith'](_0x5520f7['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x496ad2){let _0x539dc3='';if(function(_0x71b61a){return _0x3cd231(_0x71b61a);}(_0x496ad2)){for(const _0x374ce8 of _0x496ad2['children'])_0x539dc3+=this['renderNode'](_0x374ce8);}else{if(Zs(_0x496ad2)){if(!_0x496ad2['shouldBeStreamed'])return'';const _0x42a704=_0x496ad2,_0x3cfa6d=Object['entries'](_0x42a704['attribs'])['map'](([_0x1df79b,_0x2cfc6e])=>_0x1df79b+'=\x22'+_0x2cfc6e+'\x22')['join']('\x20');_0x539dc3+='<'+_0x42a704['tagName']+(_0x3cfa6d?'\x20'+_0x3cfa6d:'')+'>';for(const _0x43b17a of _0x28867a(_0x42a704))_0x539dc3+=this['renderNode'](_0x43b17a);_0x539dc3+='</'+_0x42a704['tagName']+'>';}else{if(!Js(_0x496ad2))return'';if(!_0x496ad2['shouldBeStreamed'])return'';!function(_0xc55b69){if(!_0xc55b69['parent']||!Zs(_0xc55b69['parent']))return!0x1;if(!js['includes'](_0xc55b69['parent']['tagName']))return!0x1;return!_0x107521(_0xc55b69)['match'](/^\s*[<>]\s*$/);}(_0x496ad2)?_0x539dc3+=_0xaa1346(_0x496ad2):_0x539dc3+=_0xaa1346(new ti('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x496ad2]));}}return _0x539dc3;}['getParsedDocumentNodeList'](){const _0x3513d6=[];return function(_0x4ea700,_0x32da64){const _0xddeab1=_0x21e682=>{if(_0x32da64(_0x21e682),_0x21e682 instanceof _0x3d4e85)for(let _0x4a77ea=0x0;_0x4a77ea<_0x21e682['children']['length'];_0x4a77ea++){const _0x35d79b=_0x21e682['children'][_0x4a77ea];_0xddeab1(_0x35d79b);}};for(let _0x54d50a=0x0;_0x54d50a<_0x4ea700['children']['length'];_0x54d50a++)_0xddeab1(_0x4ea700['children'][_0x54d50a]);}(this['document'],_0x5f4f6d=>{if(Js(_0x5f4f6d)){const _0x34a502=this['splitTextNodeIntoWordNodes'](_0x5f4f6d);_0x34a502['length']&&_0x3513d6['push'](..._0x34a502);}_0x5f4f6d['isWordSplitSource']||_0x5f4f6d['isWordSplitResult']||_0x3513d6['push'](_0x5f4f6d);}),_0x3513d6;}['splitTextNodeIntoWordNodes'](_0x45d0e6){if(_0x45d0e6['isWordSplitSource']||_0x45d0e6['isWordSplitResult'])return[];const _0x30a9e9=_0x107521(_0x45d0e6)['match'](/(?:\s*\S+\s*)/g),_0x5af0a6=[];if(_0x30a9e9&&_0x30a9e9['length']>0x1){for(const _0xfa482a of _0x30a9e9){const _0xf35fe5=new _0x230874(_0xfa482a);_0xf35fe5['isWordSplitResult']=!0x0,_0x39adba(_0x45d0e6,_0xf35fe5),_0x5af0a6['push'](_0xf35fe5);}_0x45d0e6['isWordSplitSource']=!0x0,_0x592694(_0x45d0e6);}return _0x5af0a6;}}const js=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function Js(_0xbe401b){return _0xe5f4cc(_0xbe401b);}function Zs(_0x5accc8){return _0x580299(_0x5accc8);}function tn(_0x12bc3c){const _0x314445=new AbortController();return{'promise':new Promise((_0x555e83,_0x36fc80)=>{const _0x52e0b0=setTimeout(_0x555e83,_0x12bc3c);_0x314445['signal']['addEventListener']('abort',()=>{clearTimeout(_0x52e0b0),_0x36fc80();});}),'abortController':_0x314445};}class en extends Nt{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x102d47){super();const _0x12749b=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new zs({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0x102d47,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x12749b['if']('isDone','ck-ai-chat__feed__item_done'),_0x12749b['if']('isVisible','ck-hidden',_0x123233=>!_0x123233),'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'](_0x33c4d4=>{_0x33c4d4['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x32cfda,_0x1afe07,_0x530d17){await this['htmlStreamer']['stream']({'document':_0x32cfda,'targetElement':_0x1afe07,'abortSignal':_0x530d17});}}class sn extends Nt{['showChangesToggleView'];constructor(_0x33dd98,_0x47d79a){super(_0x33dd98),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new nn(_0x33dd98),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+cs,'label':as(_0x33dd98,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x47d79a['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x27d71c=>_0x27d71c?_0x2c7f0b:_0x375f54),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x2aae60=new yt();_0x2aae60['content']=_0x2e0dbc,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x47d79a['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x2aae60,{'tag':'span','children':[as(_0x33dd98,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class nn extends kt{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const rn={'accepted':_0x618867,'rejected':_0x28fe3a,'outdated':_0x28fe3a};class an extends Nt{['stateIconView'];constructor(_0x5abc8d){super(_0x5abc8d);const _0xc98df9=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new on(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0xc98df9['to']('state',_0x2ea6f5=>'ck-ai-suggestion__content-part-state_'+_0x2ea6f5),_0xc98df9['if']('isVisible','ck-hidden',_0x2a5520=>!_0x2a5520)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0xc98df9['to']('state',_0x3ff18f=>{switch(_0x3ff18f){case'accepted':return as(_0x5abc8d,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return as(_0x5abc8d,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return as(_0x5abc8d,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x141d37){this['state']=_0x141d37;}}class on extends yt{constructor(){super(),this['set']('state','accepted'),this['content']=rn[this['state']],this['on']('change:state',()=>{this['content']=rn[this['state']];});}}class hn extends Ot{['_applyButton'];['_suggestButton'];constructor(_0x5aeb54,_0x4b091f,_0x3dad24){super(_0x5aeb54);const _0x3af893=Boolean(_0x3dad24);this['set']('isEnabled',!_0x3af893),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x2ddc25=[];if(_0x3af893){const _0x497a05=new kt(_0x5aeb54);_0x497a05['set']({'label':as(_0x5aeb54,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x525c75}),_0x497a05['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}}),_0x2ddc25['push'](_0x497a05);}else{_0x4b091f['includes']('applySuggestion')&&(this['_applyButton']=new kt(_0x5aeb54),this['_applyButton']['set']({'label':as(_0x5aeb54,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x618867}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x2ddc25['push'](this['_applyButton'])),_0x4b091f['includes']('insertSuggestion')&&(this['_suggestButton']=new kt(_0x5aeb54),this['_suggestButton']['set']({'label':as(_0x5aeb54,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x5c141e}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x2ddc25['push'](this['_suggestButton']));const _0x420c91=new kt(_0x5aeb54);_0x420c91['set']({'label':as(_0x5aeb54,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x28fe3a}),_0x420c91['bind']('isEnabled')['to'](this),_0x420c91['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x2ddc25['push'](_0x420c91);}this['items']['addMany'](_0x2ddc25);const _0x3026f9=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x3026f9['if']('isVisible','ck-hidden',_0x336f23=>!_0x336f23)]}});}['setButtonsVisibility']({showApplyButton:_0x3909f9,showSuggestButton:_0x91bbf4}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x3909f9),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x91bbf4);}}class cn extends Nt{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x38d110,{part:_0x501637,uiIndex:_0x59b1c9,availableActions:_0x266114,areActionsDisabled:_0x361772}){super(_0x38d110),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new hn(_0x38d110,_0x266114,_0x361772),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x501637['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x501637['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x501637['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new an(_0x38d110),this['titleLabelView']=new ln(_0x38d110,_0x59b1c9),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',(_0x352741,_0x411fb8,_0x3fe7e3,_0x1d9c6f)=>{'pending'===_0x1d9c6f?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x3fe7e3?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x3fe7e3),this['children']['add'](this['stateView']));});}}class ln extends Nt{constructor(_0x437edf,_0x165938){super(_0x437edf),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[as(_0x437edf,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x165938['toString']())]});}}class un extends Nt{['htmlStreamer'];constructor(_0x23ef16){super(_0x23ef16),this['htmlStreamer']=new zs({'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:_0x549391,renderingStrategy:_0x568018,abortSignal:_0x2f8e23}){'streaming'===_0x568018?await this['htmlStreamer']['stream']({'document':_0x549391['content'],'targetElement':this['element'],'abortSignal':_0x2f8e23}):this['element']['innerHTML']=ds(_0x549391['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class dn extends Nt{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x2ef232,{part:_0x3cbc49,uiIndex:_0x36a271,areActionsDisabled:_0x6233f5,availableActions:_0x4d9327}){super(_0x2ef232);const _0x433d1b=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x43deb7=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x6233f5;};this['on']('change:state',_0x43deb7),this['on']('change:isDone',_0x43deb7),_0x43deb7(),this['_children']=this['createCollection'](),this['_headerView']=new cn(_0x2ef232,{'part':_0x3cbc49,'uiIndex':_0x36a271,'availableActions':_0x4d9327,'areActionsDisabled':_0x6233f5}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...Qs)['to'](this),this['_streamableContentView']=new un(_0x2ef232),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x433d1b['to']('state',_0x252868=>'ck-ai-suggestion__body__content-part_'+_0x252868),_0x433d1b['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x433d1b['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x433d1b['if']('isVisible','ck-hidden',_0x3d12df=>!_0x3d12df)]},'children':this['_children'],'on':{'mouseenter':_0x433d1b['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x3cbc49['index']});}),'mouseleave':_0x433d1b['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x3cbc49['index']});}),'click':_0x433d1b['to'](_0x1f5a32=>{const _0x2deb9a=_0x1f5a32['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x2deb9a)&&this['fire']('showChangeInText',{'index':_0x3cbc49['index']});})}});}async['updateContent']({part:_0x325f41,renderingStrategy:_0x174e6d,showUnchangedParts:_0x4ba38e=!0x1,abortSignal:_0x547275}){this['partDefinition']=_0x325f41,this['isVisible']=this['partDefinition']['hasChanges']||_0x4ba38e,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x325f41,'renderingStrategy':_0x174e6d,'abortSignal':_0x547275});}['markAsDone'](){this['isDone']=!0x0;}}class _n extends pt(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x1ffb2c){const _0x36b86a=this['createTask'](_0x1ffb2c);return this['queue']['push'](_0x36b86a),this['_processQueue'](),_0x36b86a['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(_0x1985a3=>{this['once']('_queueEmpty',()=>{_0x1985a3();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x196cef=this['queue']['shift']();try{await _0x196cef['callback'](this['_abortController']['signal']),_0x196cef['resolve']();}catch(_0x57b303){_0x196cef['reject'](_0x57b303);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x1d89fc){let _0x2c81ad,_0x12ec0a;const _0x20cbfc=new Promise((_0x2db4af,_0x262eab)=>{_0x2c81ad=_0x2db4af,_0x12ec0a=_0x262eab;});return{'callback':_0x1d89fc,'resolve':_0x2c81ad,'reject':_0x12ec0a,'completePromise':_0x20cbfc};}}class An extends en{constructor(_0x3435e6){super(_0x3435e6),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x3435e6['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x57b852){this['element']['innerHTML']=_0x57b852;}}const gn=['applySuggestion','insertSuggestion'];class In extends Nt{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x230e8a,_0x44e23e=[...gn],_0x583173){super(_0x230e8a);const _0x6d8667=this['bindTemplate'],_0x14387a=Boolean(_0x583173);if(this['set']('isEnabled',!_0x14387a),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x14387a){const _0x509ba3=new kt(_0x230e8a);_0x509ba3['set']({'label':as(_0x230e8a,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x525c75}),_0x509ba3['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}});const _0x246cac=new Nt(_0x230e8a);_0x246cac['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[as(_0x230e8a,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x509ba3]}]}),this['children']['add'](_0x246cac);}else this['_applyChangesButton']=new kt(_0x230e8a),this['_applyChangesButton']['set']({'label':as(_0x230e8a,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x44e23e['includes']('applySuggestion'),'class':os}),this['_insertSuggestionsButton']=new kt(_0x230e8a),this['_insertSuggestionsButton']['set']({'label':as(_0x230e8a,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x44e23e['includes']('insertSuggestion'),'class':hs}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0xcc2402=>{_0xcc2402['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',_0x6d8667['if']('isVisible','ck-hidden',_0x1e8cfd=>!_0x1e8cfd)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x2ab8b2){this['isVisible']=_0x2ab8b2;}['_switchButtonLabelsPlurality'](_0x475edf){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x475edf?(this['_applyChangesButton']['label']=as(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=as(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=as(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=as(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class En extends Nt{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x5b06f0,_0x1ffd2d){super(_0x5b06f0),this['bodyCollection']=_0x1ffd2d,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',_0x8c88ce=>!_0x8c88ce)]},'children':this['children']});const _0x467f05=new Nt(this['locale']),_0x291f08=new yt();_0x291f08['content']=_0x2744df,_0x467f05['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x291f08,{'tag':'span','children':[{'text':as(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x467f05),this['_setupBalloonPanel'](_0x5b06f0);}['addSource'](_0x330122){this['children']['add'](new Tn(this['locale'],_0x330122,this['balloonPanelView']));}['_setupBalloonPanel'](_0x4e6d7d){this['balloonPanelView']=new Qt(_0x4e6d7d),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class Tn extends kt{['balloonPanelView'];['source'];constructor(_0xf07f21,_0x1d69b1,_0x3dfb12){super(_0xf07f21),this['source']=_0x1d69b1,this['balloonPanelView']=_0x3dfb12,this['set']({'label':_0x1d69b1['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x5ac4d0=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x5ac4d0['to'](()=>{window['open'](_0x1d69b1['url'],'_blank');}),'mouseenter':_0x5ac4d0['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x5ac4d0['to'](()=>{this['_hideTooltip']();})}}),_0x1d69b1['favicon']){const _0x583834=new Nt(_0xf07f21);_0x583834['setTemplate']({'tag':'img','attributes':{'src':_0x1d69b1['favicon']||_0x2744df,'alt':_0x1d69b1['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x583834);}else this['set']('icon',_0x2744df);}['_createTooltipContentView'](_0x542af2,_0x5531b7){const _0x22dd70=new Nt(_0x542af2),_0x4b346b=[];let _0x5cefc4;_0x5531b7?.['favicon']?(_0x5cefc4=new Nt(_0x542af2),_0x5cefc4['setTemplate']({'tag':'img','attributes':{'src':_0x5531b7['favicon'],'alt':_0x5531b7['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x5cefc4=new yt(),_0x5cefc4['content']=_0x2744df,_0x5cefc4['extendTemplate']({'attributes':{'alt':_0x5531b7['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x4b346b['push'](_0x5cefc4);const _0x538eba=new Nt(_0x542af2);_0x538eba['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x5531b7['url']},'children':[{'text':new URL(_0x5531b7['url'])?.['hostname']}]}),_0x4b346b['push'](_0x538eba);const _0x4808fb=new Nt(_0x542af2);_0x4808fb['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x4b346b});const _0x3b94bf=new Nt(_0x542af2);return _0x3b94bf['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x5531b7['title']['length']>0x190?_0x5531b7['title']['substring'](0x0,0x190)+'...':_0x5531b7['title']}]}),_0x22dd70['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x4808fb,_0x3b94bf]}),_0x22dd70;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[Qt['defaultPositions']['northArrowSouth'],Qt['defaultPositions']['northArrowSouthWest'],Qt['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 _0x3d9da9=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x3d9da9);}}class pn extends Nt{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x2994d3,_0x505fbf){super(_0x2994d3);const {areActionsDisabled:_0xd74154,showUnchangedParts:_0x445db1,availableActions:_0x48d4b2}=_0x505fbf;this['_areActionsDisabled']=_0xd74154,this['_showUnchangedParts']=_0x445db1,this['_availableActions']=_0x48d4b2,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new _n(),this['_emptyPartsWarningView']=new An({'id':'empty-parts-warning','initialContent':as(_0x2994d3,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new In(_0x2994d3,_0x505fbf['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new En(this['locale'],_0x505fbf['bodyCollection']),_0x505fbf['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...Qs)['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:_0x5277ee,renderingStrategy:_0x274c8c,abortSignal:_0x1ee7ea}){this['_children']['length']?_0x5277ee['forEach'](_0x8aceb2=>{const _0x475aee=this['_cachedContentParts']['findIndex'](_0x4dd507=>_0x4dd507['index']==_0x8aceb2['index']);-0x1===_0x475aee?this['_cachedContentParts']['push'](_0x8aceb2):this['_cachedContentParts'][_0x475aee]=_0x8aceb2;}):this['_cachedContentParts']=_0x5277ee;const _0xd7efc4=this['_showUnchangedParts']?_0x5277ee:_0x5277ee['filter'](_0x519621=>_0x519621['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0xd7efc4['length']>0x1);for(const _0x5d768d of _0xd7efc4)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x2e54ea=>{let _0x3797b5=this['getPartView'](_0x5d768d['index']);_0x3797b5||(_0x3797b5=new dn(this['locale'],{'part':_0x5d768d,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x3797b5['delegate'](...Qs)['to'](this),this['_children']['add'](_0x3797b5),this['hasPendingParts']=!0x0),await _0x3797b5['updateContent']({'part':_0x5d768d,'renderingStrategy':_0x274c8c,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x2e54ea}),_0x3797b5['markAsDone']();});return _0x1ee7ea?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x1cc369,_0x21f30b){const _0x5c3a69=this['getPartView'](_0x1cc369);_0x5c3a69&&(_0x5c3a69['state']=_0x21f30b),this['hasPendingParts']='pending'==_0x21f30b||Array['from'](this['_children'])['some'](_0x1af6b0=>'pending'==_0x1af6b0['state']);}['setPartActive'](_0x4b1174,_0x47cde9){if(!0x1===_0x4b1174){for(const _0x1802d8 of this['_children'])_0x1802d8['isActive']=!0x1;}else{const _0x121709=this['getPartView'](_0x4b1174);_0x121709&&(_0x121709['isActive']=_0x47cde9);}}['updateSources'](_0x3ec28e){_0x3ec28e['forEach'](_0x4d1d3c=>this['_sourcesView']['addSource'](_0x4d1d3c)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x11f48e){return this['_children']['find'](_0x2a95f2=>_0x2a95f2['partDefinition']['index']==_0x11f48e)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x468bb6=!this['_cachedContentParts']['find'](({hasChanges:_0x5f361a})=>_0x5f361a),_0x3da7f1=!!this['_cachedContentParts']['find'](({hasChanges:_0x44fdd5})=>!_0x44fdd5);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x3da7f1,_0x468bb6?this['_emptyPartsWarningView']['setContent'](as(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](as(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_children']['forEach'](_0xdfdd86=>_0xdfdd86['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0x177d60=>_0x177d60['partDefinition']['hasChanges'])['length']>0x0;}}class mn extends Nt{['bodyView'];['children'];['headerView'];constructor(_0xb4a75b,_0xc31819,_0xeb98c0){super(_0xb4a75b);const {showDiff:_0x100448,areActionsDisabled:_0x24fb7d,showUnchangedParts:_0x4e2add,availableActions:_0x1cadb2}=_0xc31819;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new sn(_0xb4a75b,{'showDiff':_0x100448}),this['headerView']['on']('toggleShowChanges',(_0x4b8e10,_0x3f7e79)=>{this['areChangesVisible']=_0x3f7e79['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x3f7e79['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new pn(_0xb4a75b,{'areActionsDisabled':_0x24fb7d,'showUnchangedParts':!!_0x4e2add,'availableActions':_0x1cadb2,'bodyCollection':_0xeb98c0}),this['bodyView']['delegate'](...Qs)['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'](_0x6d4b0f){await this['bodyView']['updateContentParts'](_0x6d4b0f);}['updateSources'](_0x1866b4){this['bodyView']['updateSources'](_0x1866b4);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Cn extends en{['containerView'];constructor(_0x48ee0b,_0xc5fe7a,_0x5a2baa){super(_0xc5fe7a),this['set']('isTrackChangesOn',!0x1),this['containerView']=new mn(_0x48ee0b,{'showDiff':_0xc5fe7a['showDiff'],'areActionsDisabled':_0xc5fe7a['areActionsDisabled'],'availableActions':_0xc5fe7a['availableActions']},_0x5a2baa),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x16a8e6,_0x466871)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x466871['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',(_0x227263,{index:_0x1f2cdf})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x1f2cdf});}),this['containerView']['on']('applySuggestion',(_0x300c30,{index:_0x3855bf}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x3855bf});}),this['containerView']['on']('insertSuggestion',(_0x262c02,{index:_0x348632}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x348632});}),this['containerView']['on']('rejectSuggestion',(_0x53ffc1,{index:_0x3f0f7e})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3f0f7e});}),this['containerView']['on']('mouseOverSuggestion',(_0x2149ab,{index:_0xd23146})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0xd23146});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x471a60,{index:_0xdf6313})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0xdf6313});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x349e1c){await this['containerView']['updateContent'](_0x349e1c);}['updatePartState'](_0x3b8b65,_0x90c526){this['containerView']['bodyView']['updatePartState'](_0x3b8b65,_0x90c526);}['setPartActive'](_0x24595b,_0x2046c4){!0x1===_0x24595b?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x24595b,_0x2046c4);}['updateSources'](_0x1f33ff){this['containerView']['updateSources'](_0x1f33ff);}['getPartView'](_0x302630){return this['containerView']['bodyView']['getPartView'](_0x302630);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class wn extends en{['replyContainer'];['_bodyCollection'];constructor(_0x141e3b,_0x21c22d,_0x2e58f1){super(_0x21c22d),this['_bodyCollection']=_0x2e58f1,this['locale']=_0x141e3b,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new Nt(),this['replyContainer']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-chat__feed__ai-reply-container']}}),this['children']['add'](this['replyContainer']);}async['render'](){super['render'](),this['options']['initialContent']&&(await this['updateContent']({'parsedContent':us(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x423fd4,renderingStrategy:_0x33a44f,abortSignal:_0x2d8c75}){'streaming'===_0x33a44f?await this['streamIntoElement'](_0x423fd4,this['replyContainer']['element'],_0x2d8c75):this['replyContainer']['element']['innerHTML']=_0xaa1346(_0x423fd4);}['updateSources'](_0x2a931b){const _0x5a94e6=new En(this['locale'],this['_bodyCollection']);_0x5a94e6['children']['addMany'](_0x2a931b['map'](_0x132077=>new Tn(this['locale'],_0x132077,_0x5a94e6['balloonPanelView']))),_0x5a94e6['isVisible']=!0x0,this['children']['add'](_0x5a94e6);}}class fn extends vt{constructor(_0x3ab710=void 0x0){super();const _0xfde57c=_0x3ab710?'ck-ai-spinner_'+_0x3ab710:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0xfde57c]}});}}const Sn={'file':_0x193c98,'document':_0x2e0dbc,'web-resource':_0x3bb8f4,'text':_0x193c98,'selection':_0x585ec3,'mcp-tool-context':_0x2e0dbc},bn='ck-ai-chat-context-chip',Rn='ck-ai-chat-context-chip_wide',On='ck-ai-chat-context-chip_document',kn='ck-ai-chat-context-chip__label',Nn='ck-ai-chat-context-chip__type-icon',vn='ck-ai-chat-context-controls__chip-tooltip',yn='n';class xn extends kt{constructor(_0x5910a2,_0x139e61,_0xdcc4d1,_0x4b8c61,_0x9850f4=!0x1){super(_0x5910a2),this['_isAnimationOnEnterEnabled']=_0x4b8c61,this['_initializeProperties'](_0x139e61,_0xdcc4d1,_0x9850f4),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'](_0x42871c,_0x3a18fa,_0x4fbaf0){this['set']('label',_0x42871c['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x42871c['type']),this['set']('id',_0x42871c['uiId']),this['set']('readonly',_0x3a18fa),this['set']('isLoading',_0x4fbaf0);}['_setupTemplate'](){const _0x3a4b62=this['_createIconView'](),_0x2b499a=this['_createRemoveButton'](),_0x34279c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x34279c),'children':this['_createTemplateChildren'](_0x3a4b62,_0x2b499a,_0x34279c)});}['_createTemplateAttributes'](_0x912e0e){return{'class':[bn,_0x912e0e['if']('itemType',On,_0x3eafb7=>'document'==_0x3eafb7),_0x912e0e['if']('itemType',Rn,_0x135e4c=>'selection'==_0x135e4c)],'data-cke-tooltip-text':_0x912e0e['to']('label',Ln),'data-cke-tooltip-position':yn,'data-cke-tooltip-class':vn};}['_createTemplateChildren'](_0x2c64cb,_0x5a4af0,_0x48c491){const _0x44bd13=this['_createLabelElement'](_0x48c491),_0x248950=this['_createLoaderIcon']();return this['readonly']?[_0x2c64cb,_0x44bd13]:[_0x2c64cb,_0x248950,_0x44bd13,_0x5a4af0];}['_createLabelElement'](_0xe4d0d8){return{'tag':'span','attributes':{'class':kn},'children':[{'text':_0xe4d0d8['to']('label')}]};}['_createRemoveButton'](){const _0x5370c3=new kt(this['locale']);return _0x5370c3['set']({'label':as(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x15dd63}),this['_setupRemoveButtonEvent'](_0x5370c3),_0x5370c3;}['_setupRemoveButtonEvent'](_0x33c613){_0x33c613['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x5ed32d=this['bindTemplate'],_0x3b7daf=new yt();return _0x3b7daf['content']=Sn[this['itemType']],_0x3b7daf['extendTemplate']({'attributes':{'class':[Nn,_0x5ed32d['if']('isLoading','ck-hidden',_0x3ef534=>_0x3ef534)]}}),_0x3b7daf;}['_handleAnimationEndOnce'](_0x2be3e3,_0x331e77){if(!_0x2be3e3)return;const _0x3b5a1a=()=>{_0x331e77(),_0x2be3e3['removeEventListener']('animationend',_0x3b5a1a),_0x2be3e3['removeEventListener']('webkitAnimationEnd',_0x3b5a1a);};_0x2be3e3['addEventListener']('animationend',_0x3b5a1a),_0x2be3e3['addEventListener']('webkitAnimationEnd',_0x3b5a1a);}['_createLoaderIcon'](){const _0x59456b=new fn('small');return _0x59456b['bind']('isVisible')['to'](this,'isLoading',_0x258e4d=>_0x258e4d),_0x59456b;}}function Ln(_0x20121c){if(!_0x20121c)return _0x20121c;if(_0x20121c['length']<=0x78)return _0x20121c;const _0x4458e7=_0x20121c['slice'](0x0,0x78),_0xd42574=_0x4458e7['lastIndexOf']('\x20');return(_0xd42574>0x0?_0x4458e7['slice'](0x0,_0xd42574):_0x4458e7)+'…';}const Dn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},Pn='300px';class Hn{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x14b883,_0x4e3ed3,_0x44ea1f,_0x1c6430,_0x31e30f){this['_locale']=_0x14b883,this['_visibleChips']=_0x4e3ed3,this['_config']={...Dn,..._0x44ea1f,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x44ea1f['cssClasses']}},this['_overflowChips']=new dt(),this['_bodyCollection']=_0x1c6430,this['_parentView']=_0x31e30f||null;}['setContainerElement'](_0x20f65a){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x20f65a,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 _0x44f39e=[...this['_visibleChips'],...this['_overflowChips']],_0x5053c4=this['_createCalculationContainer'](),_0x3358a0=this['_calculateOverflowInContainer'](_0x5053c4,_0x44f39e),_0x43a940=_0x5053c4['_ancestorsToRestore'];_0x43a940&&this['_restoreAncestorVisibility'](_0x43a940),_0x5053c4['remove'](),this['_applyOverflowResults'](_0x44f39e,_0x3358a0);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),Xt({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x47c486=new kt(this['_locale']);_0x47c486['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x27f16d=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x27f16d['push'](this['_config']['cssClasses']['controlsButton']),_0x47c486['extendTemplate']({'attributes':{'class':_0x27f16d}}),_0x47c486;}['_createShowMoreBalloonPanelView'](){const _0x40d560=new Qt(this['_locale']);return _0x40d560['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x40d560),_0x40d560;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x3cf7db=>{_0x3cf7db['disableAnimationOnEnter']();});const _0x5b2e2a=new Nt(this['_locale']);_0x5b2e2a['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x5b2e2a);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0xe4f5f4=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0xe4f5f4?'':'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'](_0x904790){const _0x25df03=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0xb2416e=this['_containerElement']?.['classList'];if(_0xb2416e){const _0x5f2e5b=_0xb2416e[0x0]||'',_0x51ddec=_0x904790['querySelector']('.'+_0x5f2e5b),_0x50861b=_0x904790['querySelector'](_0x25df03);return _0x51ddec||_0x50861b||_0x904790;}return _0x904790['querySelector'](_0x25df03)||_0x904790;}['_calculateContainerWidth'](){const _0x210cdb=this['_parentView']?.['element']||this['_containerElement'];if(!_0x210cdb)return Pn;const _0x224bf9=window['getComputedStyle'](_0x210cdb)['width'];if('auto'===_0x224bf9||'0px'===_0x224bf9||!_0x224bf9){const _0x4bae98=_0x210cdb['parentElement'];if(_0x4bae98){const _0x3e8895=window['getComputedStyle'](_0x4bae98);return'auto'!==_0x3e8895['width']?_0x3e8895['width']:Pn;}return Pn;}return _0x224bf9;}['_applyCalculationStyles'](_0x406194,_0x1f1ee4){this['_config']['cssClasses']['calculationContainer']&&_0x406194['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x406194['style']['width']=_0x1f1ee4,_0x406194['style']['position']='absolute',_0x406194['style']['top']='-9999px',_0x406194['style']['left']='-9999px',_0x406194['style']['opacity']='0',_0x406194['style']['pointerEvents']='none',_0x406194['style']['zIndex']='-1',_0x406194['style']['visibility']='visible\x20!important',_0x406194['style']['display']='block\x20!important',_0x406194['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x46ec82){_0x46ec82['forEach'](({element:_0x57a8e0,originalDisplay:_0x171c8d,originalVisibility:_0x223d01})=>{_0x57a8e0['style']['display']=_0x171c8d,_0x57a8e0['style']['visibility']=_0x223d01;});}['_makeAncestorsVisible'](_0x56d0bf){const _0x393833=[];let _0x2e2bfe=_0x56d0bf;for(;_0x2e2bfe&&_0x2e2bfe!==document['body'];){const _0x403f5b=window['getComputedStyle'](_0x2e2bfe);'none'!==_0x403f5b['display']&&'hidden'!==_0x403f5b['visibility']||(_0x393833['push']({'element':_0x2e2bfe,'originalDisplay':_0x2e2bfe['style']['display'],'originalVisibility':_0x2e2bfe['style']['visibility']}),_0x2e2bfe['style']['display']='block',_0x2e2bfe['style']['visibility']='visible'),_0x2e2bfe=_0x2e2bfe['parentElement'];}return _0x393833;}['_createContainerElements'](){let _0x14f875,_0x2efc08;return this['_parentView']?.['element']?(_0x14f875=this['_parentView']['element']['cloneNode'](!0x0),_0x2efc08=this['_findTargetContainer'](_0x14f875)):(_0x14f875=document['createElement']('div'),_0x2efc08=_0x14f875),{'calculationContainer':_0x14f875,'targetContainer':_0x2efc08};}['_createCalculationContainer'](){const {calculationContainer:_0x4b9685,targetContainer:_0x4a35ea}=this['_createContainerElements'](),_0xfd5e63=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x4b9685,_0xfd5e63);const _0x2a7da4=this['_parentView']?.['element']||this['_containerElement'],_0x5c39f6=_0x2a7da4?.['parentElement'];_0x5c39f6?_0x5c39f6['appendChild'](_0x4b9685):document['body']['appendChild'](_0x4b9685),_0x4b9685['_targetContainer']=_0x4a35ea;const _0x444753=this['_makeAncestorsVisible'](_0x5c39f6||null);return _0x4b9685['offsetWidth'],_0x4b9685['_ancestorsToRestore']=_0x444753,_0x4b9685;}['_calculateOverflowInContainer'](_0x580a8d,_0x275ac7){const _0x3acc51=_0x580a8d['_targetContainer']||_0x580a8d,_0x2eb620=[],{rowCount:_0x112f95}=this['_renderChipsAndCountRows'](_0x3acc51,_0x275ac7);if(_0x112f95<=this['_config']['maxVisibleRows'])return _0x2eb620;const _0x1b7b2e=_0x275ac7['slice']();for(;_0x1b7b2e['length']>0x0;){if(this['_testButtonFit'](_0x580a8d,_0x3acc51,_0x1b7b2e)){const _0x4b0160=_0x275ac7['filter'](_0x25f49e=>!_0x1b7b2e['includes'](_0x25f49e));_0x2eb620['push'](..._0x4b0160);break;}if(!_0x1b7b2e['pop']())break;}return _0x2eb620;}['_renderChipsAndCountRows'](_0x93430,_0x3abd06){_0x93430['innerHTML']='',_0x3abd06['forEach'](_0x26e069=>{if(_0x26e069['element']){const _0x62d854=_0x26e069['element']['cloneNode'](!0x0);_0x93430['appendChild'](_0x62d854);}}),_0x93430['offsetWidth'];const _0x1cdff8=_0x93430['children'],_0x6b418b=[];return Array['from'](_0x1cdff8)['forEach'](_0x1a25e1=>{const _0x424e17=_0x1a25e1['getBoundingClientRect']()['top'];_0x6b418b['some'](_0x2d3aef=>Math['abs'](_0x2d3aef-_0x424e17)<this['_config']['rowDetectionTolerance'])||_0x6b418b['push'](_0x424e17);}),{'rowCount':_0x6b418b['length']};}['_createMockButton'](){const _0x1d0e3d=document['createElement']('button');return _0x1d0e3d['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x1d0e3d['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x1d0e3d['textContent']='+\x201',_0x1d0e3d;}['_testButtonFit'](_0x27517f,_0x221419,_0x26cf7a){this['_renderChipsAndCountRows'](_0x221419,_0x26cf7a);const _0x4d02e7=this['_createMockButton']();_0x27517f['appendChild'](_0x4d02e7),_0x27517f['offsetWidth'];const _0x42b75d=[..._0x221419['children'],_0x4d02e7],_0xd04d38=[];_0x42b75d['forEach'](_0x34e7df=>{const _0x49f24a=_0x34e7df['getBoundingClientRect']()['top'];_0xd04d38['some'](_0x17d087=>Math['abs'](_0x17d087-_0x49f24a)<this['_config']['rowDetectionTolerance'])||_0xd04d38['push'](_0x49f24a);});const _0x4f0cf1=_0xd04d38['length'];return _0x4d02e7['remove'](),_0x4f0cf1<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x20e8c0,_0x5e183d){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x20e8c0['forEach'](_0x3d23b1=>{_0x5e183d['includes'](_0x3d23b1)?this['_overflowChips']['add'](_0x3d23b1):this['_visibleChips']['add'](_0x3d23b1);});}['_updateOverflowUI'](_0x484a9b){if(_0x484a9b>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x484a9b>0x0&&this['_showMoreButtonView']){const _0x476476=''+this['_config']['showMoreLabelPrefix']+(_0x484a9b<0x63?_0x484a9b:'99');this['_showMoreButtonView']['label']=_0x476476;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x5d6264,_0xa22757){this['_distributeChips'](_0x5d6264,_0xa22757),this['_updateOverflowUI'](_0xa22757['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x2f55a3=>{_0x2f55a3[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 _0x1f46f1=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x1f46f1['width']||0x0===_0x1f46f1['height'])return!0x1;const _0x3bacd4=window['innerHeight']||document['documentElement']['clientHeight'],_0x2a616b=window['innerWidth']||document['documentElement']['clientWidth'],_0x290607=0xc8;return _0x1f46f1['bottom']>=-0xc8&&_0x1f46f1['top']<=_0x3bacd4+_0x290607&&_0x1f46f1['right']>=-0xc8&&_0x1f46f1['left']<=_0x2a616b+_0x290607;}}const Mn='ck-ai-chat__feed__context-chips',Un='ck-ai-chat-context-chips-wrapper',Vn='ck-ai-chat-context-chips-wrapper-balloon',Bn='ck-ai-chat-controls-button',Gn='ck-ai-chat-controls_context_show-more-button',Fn='ck-ai-chat-context-controls__show-more-balloon-panel';class Kn extends Nt{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0xfd021b,_0x422294,_0x5c9081){super(_0xfd021b),this['_bodyCollection']=_0x5c9081,this['_createContextChips'](_0x422294);const _0x2c9563={'cssClasses':{'showMoreButton':Gn+'\x20'+cs,'showMoreBalloon':Fn,'overflowContainer':Vn,'controlsButton':Bn}};this['_overflowManager']=new Hn(_0xfd021b,this['_contextChips'],_0x2c9563,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Mn,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Un},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x5587e4=this['element']['querySelector']('.'+Un);_0x5587e4&&(this['_overflowManager']['setContainerElement'](_0x5587e4),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x38ad29){for(const _0x358316 of _0x38ad29){const _0x54fe21=new xn(this['locale'],_0x358316,!0x0,!0x1);this['_contextChips']['add'](_0x54fe21);}}}class Wn extends en{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x1c02f7,_0x1bd3df,_0x217396){super(_0x1bd3df),this['_locale']=_0x1c02f7,this['_bodyCollection']=_0x217396,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 Kn(this['_locale'],this['options']['contextItems']['filter'](_0x2d639f=>!_0x2d639f['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new Nt(this['_locale']),this['_messageContentView']['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__message-content'}}),this['children']['add'](this['_messageContentView']);}['render'](){super['render'](),this['_messageContentView']['element']['innerHTML']=this['options']['initialContent'],this['markAsDone']();}}class Yn extends en{['capabilities'];constructor(_0x35429a,_0x34401c){super(_0x34401c);const {isWebSearchEnabled:_0x1bf64f,isReasoningEnabled:_0x57efa8}=_0x34401c['capabilities'],_0xfdcf5e=[];let _0x4d51d9='';_0x1bf64f&&_0x57efa8?(_0x4d51d9=as(_0x35429a,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0xfdcf5e['push']($n(_0x2744df)),_0xfdcf5e['push']($n(_0x21368f))):_0x1bf64f?(_0x4d51d9=as(_0x35429a,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0xfdcf5e['push']($n(_0x2744df))):_0x57efa8&&(_0x4d51d9=as(_0x35429a,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0xfdcf5e['push']($n(_0x21368f))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x4d51d9?'':'ck-hidden']}});const _0xa816c=new Nt();_0xa816c['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0xfdcf5e,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x4d51d9]}]}),this['children']['add'](_0xa816c),this['capabilities']=_0x34401c['capabilities'];}}function $n(_0x5b86b2){const _0x2c0d98=new yt();return _0x2c0d98['content']=_0x5b86b2,_0x2c0d98;}const qn=['wheel','touchstart','pointerdown','keydown'],Qn=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class Xn{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x79f300){this['element']=_0x79f300,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x3aeac0 of qn){const _0x267f4a='keydown'!==_0x3aeac0;this['element']['addEventListener'](_0x3aeac0,this['_onUserEvent']['bind'](this),{'passive':_0x267f4a,'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'](_0x4b6a64){if(this['isRunning']){if('keydown'===_0x4b6a64['type']){const _0x6b78a5=_0x4b6a64['key'];if(!Qn['includes'](_0x6b78a5))return;}_0x4b6a64 instanceof WheelEvent?_0x4b6a64['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x258d33,scrollHeight:_0x51d162,clientHeight:_0x5598a0}=this['element'];return _0x51d162-_0x258d33-_0x5598a0<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class zn extends Nt{constructor(_0x88e8a8,_0x399b57){super(_0x88e8a8),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x399b57)});}['_createSkeletonItems'](_0x124114){const _0x501d92=['ck','ck-ai-skeleton__item'];return _0x124114['map'](_0x352a86=>{let _0x58aa49='';switch(_0x352a86['attributes']['align']){case'right':_0x58aa49='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x58aa49='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x58aa49='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x352a86['tag'],'attributes':{'class':[..._0x501d92,_0x352a86['attributes']['class']?_0x352a86['attributes']['class']:''],'style':'width:\x20'+_0x352a86['attributes']['width']+';\x20height:\x20'+_0x352a86['attributes']['height']+';'+_0x58aa49}};});}}const jn={'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':Jn(0x5,'100%','44px','right'),'aiChatResources':Jn(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 Jn(_0x545e0b,_0x3c8e93,_0x4ddfa3,_0x55a7d4){return new Array(_0x545e0b)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x3c8e93,'height':_0x4ddfa3,'align':_0x55a7d4}}));}class Zn extends en{constructor(_0x56423a){super(_0x56423a),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 tr extends Nt{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x23db19,_0x4ae96b){super(_0x23db19),this['_bodyCollection']=_0x4ae96b,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Xs)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new Xn(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x2ad922,_0x17fde9){let _0x51a184;return'ai-reply'===_0x2ad922?_0x51a184=new wn(this['locale'],_0x17fde9,this['_bodyCollection']):'ai-suggestion-reply'===_0x2ad922?(_0x51a184=new Cn(this['locale'],_0x17fde9,this['_bodyCollection']),_0x51a184['bind']('isTrackChangesOn')['to'](this)):_0x51a184='user-message'===_0x2ad922?new Wn(this['locale'],_0x17fde9,this['_bodyCollection']):'interaction-header'===_0x2ad922?new Yn(this['locale'],_0x17fde9):'custom-element'===_0x2ad922?new Zn(_0x17fde9):new An(_0x17fde9),this['children']['add'](_0x51a184),_0x51a184;}async['updateReplyItem']({id:_0x492e13,parsedContent:_0x21c39e,renderingStrategy:_0x4442af,abortSignal:_0x1bcee4}){const _0x1d9337=this['getItemById'](_0x492e13);if(!(_0x1d9337 instanceof wn))throw new ot('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x1d9337,'id':_0x492e13,'parsedContent':_0x21c39e});await _0x1d9337['updateContent']({'parsedContent':_0x21c39e,'renderingStrategy':_0x4442af,'abortSignal':_0x1bcee4});}async['updateWebSources'](_0xe3bd65,_0x2ff36e){const _0x2f4c88=this['getItemById'](_0xe3bd65);if(_0x2f4c88 instanceof Cn)_0x2f4c88['updateSources'](_0x2ff36e);else{if(!(_0x2f4c88 instanceof wn))throw new ot('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x2f4c88,'id':_0xe3bd65,'sources':_0x2ff36e});_0x2f4c88['updateSources'](_0x2ff36e);}}async['updateSuggestionItem']({id:_0x4d5411,parts:_0xa54e16,renderingStrategy:_0x2adbc0,abortSignal:_0x532ac8}){const _0x4ca25d=this['getItemById'](_0x4d5411);if(!(_0x4ca25d instanceof Cn))throw new ot('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x4ca25d,'id':_0x4d5411,'parts':_0xa54e16});await _0x4ca25d['updateContent']({'parts':_0xa54e16,'renderingStrategy':_0x2adbc0,'abortSignal':_0x532ac8});}['updateSuggestionPartState']({id:_0x49e131,index:_0x9a48b9,state:_0x5a2bf9}){const _0x33163b=this['getItemById'](_0x49e131);if(!(_0x33163b instanceof Cn))throw new ot('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x49e131});_0x33163b['updatePartState'](_0x9a48b9,_0x5a2bf9);}['setSuggestionPartActive']({id:_0x3f24eb,index:_0xc9732f,isActive:_0x2430e7}){const _0x137557=this['getItemById'](_0x3f24eb);if(!(_0x137557 instanceof Cn))throw new ot('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x3f24eb});this['children']['filter'](_0x3195d4=>_0x3195d4 instanceof Cn)['forEach'](_0x332c10=>{_0x332c10['setPartActive'](!0x1);}),_0x137557['setPartActive'](_0xc9732f,_0x2430e7);}['markItemAsDone'](_0x4311a8){this['getItemById'](_0x4311a8)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x31020=>_0x31020['options']['id']);}['removeItem'](_0x1492c9){this['children']['remove'](this['getItemById'](_0x1492c9));}['hasItem'](_0x51ef71){return!!this['children']['find'](_0x20698c=>_0x20698c['options']['id']['includes'](_0x51ef71));}['scrollToSuggestion'](_0xaa5e39,_0x12c761){const _0x20201f=this['getItemById'](_0xaa5e39);if(!(_0x20201f instanceof Cn))return void It('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0xaa5e39,'partIndex':_0x12c761});const _0x389c97=_0x20201f['getPartView'](_0x12c761);_0x389c97?wt(_0x389c97['element'],0x14,this['element']['parentElement'],!0x0,!0x0):It('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0xaa5e39,'partIndex':_0x12c761});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x475ebd=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x475ebd,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x14eb89=new zn(this['locale'],jn['aiFeed']);return _0x14eb89['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x5b4e71=>!_0x5b4e71)]}}),_0x14eb89;}['_createFeedItems'](){const _0xf183f2=new Nt(this['locale']);return _0xf183f2['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0xf183f2;}['_createFeedLoader'](){const _0x5be006=new Nt(this['locale']);return _0x5be006['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x539fe0=>!_0x539fe0)]},'children':this['_createLoaderChildren']()}),_0x5be006;}['_createLoaderChildren'](){const _0x2d9900=new fn();return _0x2d9900['isVisible']=!0x0,[_0x2d9900,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x50f811){const _0x41f9b5=this['children']['find'](_0x3d7328=>_0x3d7328['options']['id']['includes'](_0x50f811));if(!_0x41f9b5)throw new ot('ai-chat-feed-view-item-not-found',this,{'id':_0x50f811});return _0x41f9b5;}['setLoadingMessage'](_0x225639){this['set']('loadingMessage',_0x225639);}['toggleLoadingSkeleton'](_0x3e3c76){this['set']('isLoadingSkeletonVisible',_0x3e3c76);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class er extends Lt{['filter'](){let _0xe38db8=0x0;for(const _0x2dfdc8 of this['items'])_0xe38db8+=_0x2dfdc8['items']['length'];return{'resultsCount':_0xe38db8,'totalItemsCount':_0xe38db8};}}const ir='ck-ai-chat__prompt-input_highlighted';class sr extends xt{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x3cec50,_0x2e598f){super(_0x3cec50,{'queryView':{'label':'','creator':Ut,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new er(_0x3cec50),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x2e598f,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=sr['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=sr['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',(_0x26f165,_0xf487a)=>!_0x26f165&&!_0xf487a),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x5c0c0a,_0x358182)=>{this['isUploadInProgress']||this['isEmpty']||_0x5c0c0a['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x358182());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x2ab6bc=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x2ab6bc)return this['queryView']['errorText']=as(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x20cf05=_0x589baa(_0x2ab6bc);this['fire']('sendUserMessage',_0x20cf05),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x1fb21a){this['queryView']['fieldView']['set']('placeholder',_0x1fb21a);}['focus'](_0x5a572d=!0x1){super['focus'](),_0x5a572d&&(this['element']['classList']['contains'](ir)||(this['element']['classList']['add'](ir),setTimeout(()=>{this['element']['classList']['remove'](ir);},0x320)));}['_createSubmitButton'](){const _0x6cbf4f=new kt(this['locale']);return _0x6cbf4f['set']({'icon':_0x4dc6e3,'label':as(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+os,'isEnabled':!0x1}),_0x6cbf4f['on']('execute',()=>{this['submit']();}),_0x6cbf4f;}['setIsUploadInProgress'](_0x3973ca){this['isUploadInProgress']=_0x3973ca;}['_setUpAddContextButtonPositioning'](){const _0x3b056c=this['locale'],_0x22968f=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x454006=new ut(this['queryView']['fieldView']['element']),_0x4a8188=new ut(this['_addContextButtonView']['element']),_0x48cca1=_0x454006['width'],_0x4f317f='rtl'===_0x3b056c['uiLanguageDirection']?'right':'left';_0x454006['excludeScrollbarsAndBorders']();const _0x4358ac=_0x48cca1-_0x454006['width']+0x1;this['_addContextButtonView']['element']['style'][_0x4f317f]='calc('+(_0x48cca1-_0x4a8188['width']-_0x4358ac)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x22968f),this['on']('render',()=>{_0x22968f(),this['_queryViewResizeObserver']=new ft(this['queryView']['fieldView']['element'],()=>{_0x22968f();});});}}const nr='ck-ai-chat__prompt-capabilities',rr='ck-ai-chat-controls-button',ar='ck-ai-chat-controls-button--commands',or='ck-ai-chat-controls__model-selection',hr='ck-ai-chat-controls__model-selection__item-name',cr='ck-ai-chat-controls__model-selection__item-description',lr='ck-ai-chat-controls__model-selection__item-capabilities',ur='n';class dr extends Nt{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0xab52df){super(_0xab52df),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',_0x1069d9=>'selector'===_0x1069d9),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x5ab7a6=>_0x5ab7a6?this['_modelSelectionDropdown']['buttonView']['label']:as(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x28058c=>_0x28058c),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x31ade7=>_0x31ade7),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x21bbc0=>as(this['locale'],_0x21bbc0?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0xacbd1a=>_0xacbd1a),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x14dba0=>as(this['locale'],_0x14dba0?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[nr]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new dt(),zt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x33b898,_0x3d3d0a){if(_0x3d3d0a)this['set']('modelDisplayMode','hidden');else{const _0x5cbd0a=0x1===_0x33b898['length'];this['set']('modelDisplayMode',_0x5cbd0a?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x33b898?.['length'])for(const _0x21dd1d of _0x33b898){const _0x7010d2=new jt({'label':_0x21dd1d['name'],'withText':!0x0,'role':'menuitemradio','id':_0x21dd1d['id'],'model':_0x21dd1d});_0x7010d2['bind']('isOn')['to'](this,'activeModelId',_0x4a24cf=>_0x4a24cf===_0x21dd1d['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x7010d2,'labelView':new _r(this['locale'],_0x21dd1d)});}}['setWebSearch'](_0x54881f){this['set']('webSearchActive',_0x54881f);}['setReasoning'](_0x3b8a96){this['set']('reasoningActive',_0x3b8a96);}['setModel'](_0x45d618){if(!_0x45d618)return;this['activeModelId']=_0x45d618['id'],this['activeModelName']=_0x45d618['name']||_0x45d618['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x45d618['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x45d618['name']);const _0xcd4a82=_0x45d618['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0xcd4a82),this['_webSearchButton']['set']('isVisible',_0xcd4a82);const _0x6577a5=_0x45d618['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x6577a5),this['_reasoningButton']['set']('isVisible',_0x6577a5);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x16d0f6){this['set']('modelSelectorEnabled',!0x1),_0x16d0f6&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x4575ed=new kt();return _0x4575ed['set']({'label':as(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x2744df,'class':rr+'\x20'+cs,'isToggleable':!0x0,'tooltipPosition':ur}),_0x4575ed['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x4575ed;}['_createReasoningButton'](){const _0x210196=new kt();return _0x210196['set']({'label':as(this['locale'],'AI_CHAT_REASONING'),'icon':_0x21368f,'class':rr+'\x20'+cs,'isToggleable':!0x0,'tooltipPosition':ur}),_0x210196['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x210196;}['_createCommandsButton'](){const _0x47c296=new kt();return _0x47c296['set']({'label':as(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x56a7dd,'withText':!0x0,'class':rr+'\x20'+cs,'isToggleable':!0x0,'tooltip':as(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':ur}),_0x47c296['extendTemplate']({'attributes':{'class':[ar]}}),_0x47c296['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x47c296;}['_createModelSelectionDropdown'](){const _0x3f9d86=Bt(this['locale']);return _0x3f9d86['set']({'panelPosition':'ne','class':[or]}),_0x3f9d86['buttonView']['set']({'label':as(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':ur,'class':cs}),this['listenTo'](_0x3f9d86,'execute',_0x63460c=>{this['fire']('selectModel',_0x63460c['source']['model']);}),_0x3f9d86;}['_createModelNameView'](){const _0x22efb8=new Ar(this['locale']);return _0x22efb8['bind']('text')['to'](this,'activeModelName',_0x6d28eb=>_0x6d28eb??''),_0x22efb8['bind']('isVisible')['to'](this,'modelDisplayMode',_0x5d78e3=>'name'===_0x5d78e3),_0x22efb8;}}let _r=class extends Ht{constructor(_0x3088dd,_0x10479c){super();const _0x5e67d1=this['bindTemplate'],_0x48ba08=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x5e67d1['to']('style'),'id':_0x5e67d1['to']('id')},'children':[{'tag':'div','attributes':{'class':[hr]},'children':[{'text':_0x5e67d1['to']('text')}]},{'tag':'div','attributes':{'class':[cr]},'children':[{'tag':'span','children':[{'text':_0x10479c['description']}]}]},{'tag':'div','attributes':{'class':[lr]},'children':_0x48ba08}]}),_0x48ba08['addMany'](this['_getCapabilityParts'](_0x3088dd,_0x2744df,'AI_CHAT_SEARCH_WEB',_0x10479c['capabilities']['webSearch']?.['enabled']??!0x1)),_0x48ba08['addMany'](this['_getCapabilityParts'](_0x3088dd,_0x21368f,'AI_CHAT_REASONING',_0x10479c['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x1e6ab2,_0x20044e,_0x117c12,_0x15ec0c){const _0x582238=new yt();_0x582238['content']=_0x20044e;const _0x85dcca=new Nt(_0x1e6ab2);_0x85dcca['setTemplate']({'tag':'span','children':[{'text':as(_0x1e6ab2,_0x117c12)+':\x20'}]});const _0x33e543=new Nt(_0x1e6ab2);return _0x33e543['setTemplate']({'tag':'span','children':[{'text':as(_0x1e6ab2,_0x15ec0c?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x582238,_0x85dcca,_0x33e543];}},Ar=class extends Nt{constructor(_0x428f91){super(_0x428f91),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x1050c1=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x1050c1['if']('isVisible','ck-hidden',_0x1789f9=>!_0x1789f9)]},'children':[{'text':_0x1050c1['to']('text')}]});}};const gr='ck-ai-chat-context-controls__url-form',Ir='ck-ai-chat-context-controls__url-input-section';class Er extends Nt{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x1e40e6){super(_0x1e40e6),this['focusTracker']=new _t(),this['keystrokes']=new At(),this['backButton']=this['_createBackButton'](),this['urlInputField']=this['_createUrlInputField'](),this['confirmButton']=this['_createConfirmButton'](),this['_focusables']=this['createCollection']([this['backButton'],this['urlInputField'],this['confirmButton']]),this['focusCycler']=new Mt({'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'](_0x178eeb=>{this['focusTracker']['add'](_0x178eeb['element']),this['keystrokes']['listenTo'](_0x178eeb['element']);}),Jt({'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'](_0x3a727a){this['urlInputField']['errorText']=_0x3a727a,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x3ec85a=new kt(this['locale']);return _0x3ec85a['set']({'icon':_0x4a9e46,'tooltip':as(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x37ca1c,_0x4af03e,_0x2975ed)=>{_0x3ec85a['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x2975ed?'':'\x20ck-hidden')]});}),_0x3ec85a;}['_createUrlInputField'](){const _0x45e0ae=new Zt(this['locale'],te);return _0x45e0ae['set']({'label':as(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x45e0ae['fieldView']['set']({'placeholder':as(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x45e0ae;}['_createConfirmButton'](){const _0x5dc7f6=new kt(this['locale']);return _0x5dc7f6['set']({'icon':_0x464c2a,'tooltip':as(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x5dc7f6;}['_setupTemplate'](){const _0x5bee5e=new _0x222d65(this['locale'],{'label':as(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x5bee5e['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':gr,'tabindex':'-1'},'children':[_0x5bee5e,{'tag':'div','attributes':{'class':Ir},'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',_0x48b6df=>{_0x48b6df['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x190154,_0x4dba57)=>{this['clear'](),this['fire']('cancel'),_0x4dba57();});}['_handleSubmit'](){const _0x5c4c95=this['getValue']()['trim']();_0x5c4c95?this['_isValidUrl'](_0x5c4c95)?(this['clearError'](),this['fire']('submitUrl',_0x5c4c95)):this['setError'](as(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](as(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x4f444b=this['getValue']()['trim'](),_0xd602c9=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x4f444b['length']>0x0&&!_0xd602c9;}['_isValidUrl'](_0x5283bf){try{return!!new URL(_0x5283bf);}catch{return!0x1;}}}const Tr='ck-ai-chat-resources__item',pr='ck-ai-chat-resources__item--in-context',mr='ck-ai-chat-resources__item-title',Cr='ck-ai-chat-resources__item__icon';class wr extends Pt{['resource'];['_titleView'];['_iconView'];constructor(_0x17bfb7,_0x30d902){super(_0x17bfb7),this['resource']=_0x30d902,this['set']('isInContext',!!_0x30d902['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x2bf30b){if(_0x2bf30b['isInContext'])return _0x464c2a;switch(_0x2bf30b['type']){case'document':return _0x2e0dbc;case'web-resource':return _0x3bb8f4;case'file':case'text':return _0x193c98;default:return _0x287bcc;}}['highlightText'](_0x27172e){if(!_0x27172e||''===_0x27172e['trim']())return void this['_titleView']['highlightText'](null);const _0x55f61d=new RegExp(_0x474e41(_0x27172e),'gi');this['_titleView']['highlightText'](_0x55f61d);}['updateResourceState'](_0x189f44){this['resource']['isInContext']=_0x189f44,this['isInContext']=_0x189f44,this['_updateIcon']();}['_createTitleView'](){const _0x572d39=new _0x387701();return _0x572d39['text']=this['resource']['label'],_0x572d39['extendTemplate']({'tag':'span','attributes':{'class':[mr]}}),_0x572d39;}['_createIconView'](){const _0x4177c2=new yt();return _0x4177c2['content']=this['getResourceIcon'](this['resource']),_0x4177c2;}['_setupTemplate'](){const _0x268296=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[Tr,_0x268296['if']('isVisible','ck-hidden',_0x2e1ac6=>!_0x2e1ac6),_0x268296['if']('isInContext',pr)]},'children':[{'tag':'div','attributes':{'class':[Cr]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x268296['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const fr='ck-ai-chat-resources__list';class Sr extends Lt{['_source'];constructor(_0x50acaf,_0x3a202b){super(_0x50acaf),this['_source']=_0x3a202b,this['extendTemplate']({'attributes':{'class':[fr]}});}['setResources'](_0x241b9f,_0x244003){this['items']['clear']();let _0xb659c7=_0x241b9f;if(this['_source']['useDefaultFiltering']&&_0x244003&&''!==_0x244003['trim']()){const _0x20ef82=new RegExp(_0x244003['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0xb659c7=_0x241b9f['filter'](_0xa577d1=>_0x20ef82['test'](_0xa577d1['label']));}for(const _0x428e4a of _0xb659c7){const _0xcbea86=new wr(this['locale'],_0x428e4a);_0xcbea86['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x428e4a);}),this['items']['add'](_0xcbea86);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x244003);}['highlightText'](_0x4ea707){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0xcd065a=>{_0xcd065a['highlightText'](_0x4ea707);});}['updateResourceState'](_0x574c52,_0x5e767){for(const _0x2b26e5 of this['items']){const _0x45c562=_0x2b26e5;_0x45c562['resource']['id']===_0x574c52&&_0x45c562['updateResourceState'](_0x5e767);}}['_handleResourceSelection'](_0x450d5f,_0x5cf14e){this['fire']('addResourceToContext',{'source':_0x450d5f,'resource':_0x5cf14e});}}class br extends Zt{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x2bf318){const t=_0x2bf318['t'],_0x16b57e={'showResetButton':!0x0,'showIcon':!0x0,'creator':te,'label':as(_0x2bf318,'AI_CHAT_SEARCH_RESOURCES')};super(_0x2bf318,_0x16b57e['creator']),this['label']=_0x16b57e['label'],this['_viewConfig']=_0x16b57e,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x2bf318,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x57c053){this['fire']('search',_0x57c053);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new yt(),this['iconView']['content']=_0x413c10,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x28368f,t){this['resetButtonView']=new kt(_0x28368f),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x15dd63,'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',_0x1fabc2=>!_0x1fabc2),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 Rr extends Nt{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x2b832d,_0x5c798d){super(_0x2b832d),this['_source']=_0x5c798d['source'],this['_searchInputVisibleFrom']=_0x5c798d['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 _0x192828([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new br(this['locale']);}['_createSearchSection'](){const _0xe66987=new Nt(this['locale']);return _0xe66987['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0xb56bb2,_0x2c8602)=>{this['loadResources'](_0x2c8602),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x2c8602);}),_0xe66987;}['_createResourcesListView'](){const _0x333a9e=new Sr(this['locale'],this['_source']);return _0x333a9e['delegate']('addResourceToContext')['to'](this),_0x333a9e['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x333a9e;}['_createSkeletonView'](){const _0x1b1d42=new zn(this['locale'],jn['aiChatResources']);return _0x1b1d42['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x505b1e=>!_0x505b1e)]}}),_0x1b1d42;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x2cd573){const _0x587fb1=at();this['_latestLoadResourcesUid']=_0x587fb1,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x2cd573,'uid':_0x587fb1}),this['isLoading']=!0x0;}['setResources'](_0x420e88,_0x54866b){if(_0x54866b&&_0x54866b!==this['_latestLoadResourcesUid'])return;const _0x5a9b69=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x420e88,_0x5a9b69),_0x420e88['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x365879,_0x9cfe31){this['_resourcesListView']['updateResourceState'](_0x365879,_0x9cfe31);}}const Or='ck-ai-chat-context-controls__source-balloon-panel',kr='ck-button-icon\x20ck-button-back',Nr='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class vr{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x4b6a9b,_0x150f35,_0x437fb0){this['_locale']=_0x4b6a9b,this['_bodyCollection']=_0x150f35,this['_config']=_0x437fb0;}['showSourceResourcesBalloon']({source:_0xbd3e6c,withBackButton:_0x1d9c70}){let _0x2f490b=this['_sourceResourceBalloons']['get'](_0xbd3e6c['id']);_0x2f490b||(_0x2f490b=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0xbd3e6c['id'],_0x2f490b),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x2f490b)),this['_addSourceResourceContent']({'balloonPanel':_0x2f490b,'source':_0xbd3e6c,'withBackButton':_0x1d9c70}),_0x2f490b['show']();const _0x15d4d1=this['_config']['getTargetElement']();_0x15d4d1&&_0x2f490b['pin']({'target':_0x15d4d1,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x3bf7a0,_0x51a7e7,_0x49cf89){const _0x815964=this['_sourceResourceBalloons']['get'](_0x3bf7a0);if(!_0x815964)return;const _0x3cd627=this['_getResourcesViewFromBalloon'](_0x815964);_0x3cd627&&(_0x3cd627['setResources'](_0x51a7e7,_0x49cf89),_0x3cd627['once']('change:isLoading',()=>{_0x815964['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x6d966e){const _0x511bf1=this['_sourceResourceBalloons']['get'](_0x6d966e);_0x511bf1&&requestAnimationFrame(()=>{_0x511bf1['hide'](),this['_sourceResourceBalloons']['delete'](_0x6d966e),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x232c9a of this['_sourceResourceBalloons']['values']())if(_0x232c9a['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x203de1,_0x316f48,_0x2992aa){const _0x1f663d=this['_sourceResourceBalloons']['get'](_0x203de1);if(!_0x1f663d||!_0x1f663d['isVisible'])return;const _0x5adbdc=this['_config']['getTargetElement']();if(!_0x5adbdc)return;_0x1f663d['pin']({'target':_0x5adbdc,'limiter':this['_config']['getLimiterElement']()});const _0x145ded=this['_getResourcesViewFromBalloon'](_0x1f663d);_0x145ded&&_0x145ded['updateResourceState'](_0x316f48,_0x2992aa);}['destroy'](){for(const _0x3cbdc3 of this['_sourceResourceBalloons']['values']())_0x3cbdc3['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x4542ff=new Qt(this['_locale']);return _0x4542ff['extendTemplate']({'attributes':{'class':Or}}),this['_bodyCollection']['add'](_0x4542ff),_0x4542ff;}['_addSourceResourceContent']({balloonPanel:_0x34f310,source:_0x53bd4e,withBackButton:_0x837d76}){_0x34f310['content']['clear']();const _0x2a52fc=this['_createBalloonHeader']({'balloonPanel':_0x34f310,'source':_0x53bd4e,'withBackButton':_0x837d76});_0x34f310['content']['add'](_0x2a52fc);const _0x40f892=this['_createBalloonResourcesView'](_0x53bd4e);_0x34f310['content']['add'](_0x40f892);}['_createBalloonHeader']({balloonPanel:_0xd734ba,source:_0x118033,withBackButton:_0xba15e}){const _0x202615=new _0x222d65(this['_locale'],{'label':_0x118033['label'],'class':Nr});return _0xba15e&&_0x202615['children']['add'](this['_createBackButton'](_0xd734ba),0x0),_0x202615;}['_createBackButton'](_0x3f869d){const _0x429007=new kt(this['_locale']);return _0x429007['set']({'icon':_0x4a9e46,'tooltip':as(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':kr}),_0x429007['on']('execute',()=>{_0x3f869d['hide'](),this['_config']['onBackToContext']();}),_0x429007;}['_createBalloonResourcesView'](_0x599f39){const _0x2ec408=new Rr(this['_locale'],{'source':_0x599f39,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x2ec408['on']('loadSourceResources',(_0x4030a5,_0x3e172c)=>{this['_config']['onLoadSourceResources'](_0x3e172c);}),_0x2ec408['on']('addResourceToContext',(_0x46f23e,_0x4c207d)=>{this['_config']['onResourceSelected'](_0x4c207d['source'],_0x4c207d['resource']),this['closeSourceResourceBalloon'](_0x599f39['id']);}),_0x2ec408;}['_getResourcesViewFromBalloon'](_0x3b6585){const _0x131dee=_0x3b6585['content']['get'](0x1);return _0x131dee instanceof Rr?_0x131dee:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x24cc5a){Xt({'emitter':_0x24cc5a,'contextElements':[_0x24cc5a['element']],'callback':()=>{_0x24cc5a['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x24cc5a['isVisible']});}}const yr=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],xr='ck-ai-chat-context-controls',Lr='ck-ai-chat-context-controls__pending-contexts',Dr='ck-ai-chat-context-controls__add-context-balloon-panel',Pr='ck-ai-chat-context-controls__add-context-button',Hr='ck-ai-chat-context-controls__url-balloon-panel',Mr='ck-ai-chat-context-controls__balloon-button',Ur='ck-ai-chat-context-controls__balloon-button-source',Vr='ck-ai-chat-controls-button',Br='ck-ai-chat-context-chips-wrapper-balloon',Gr='ck-ai-chat-controls_context_show-more-button',Fr='ck-ai-chat-context-controls__show-more-balloon-panel',Kr='ck-ai-chat',Wr=[Qt['defaultPositions']['northArrowSouthWest'],Qt['defaultPositions']['northArrowSouth'],Qt['defaultPositions']['northArrowSouthEast'],Qt['defaultPositions']['southArrowNorthWest'],Qt['defaultPositions']['southArrowNorth'],Qt['defaultPositions']['southArrowNorthEast']];class Yr extends Nt{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x423ae0,_0x3306bc){super(_0x423ae0),this['bodyCollection']=_0x3306bc['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x423ae0),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x423ae0),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x423ae0),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x423ae0,_0x3306bc);const _0x35e9e5={'cssClasses':{'showMoreButton':Gr+'\x20'+cs,'showMoreBalloon':Fr,'overflowContainer':Br,'controlsButton':Vr}};this['_overflowManager']=new Hn(_0x423ae0,this['_currentContextsChips'],_0x35e9e5,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'](_0x5baa6f,_0x3e0687){const _0x4313db=this['_createContextButton'](_0x5baa6f,'current',!0x0,_0x3e0687);this['_addContextToCollection'](_0x4313db,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x548e10){this['_removeContextFromCollection'](_0x548e10,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x548e10,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x305cae,_0x5e6966){let _0x3e1f4e=this['_currentContextsChips']['find'](_0x15b4f8=>_0x15b4f8['id']===_0x305cae);_0x3e1f4e||(_0x3e1f4e=this['_overflowManager']['overflowChips']['find'](_0x585ede=>_0x585ede['id']===_0x305cae)),_0x3e1f4e&&(_0x3e1f4e['isLoading']=_0x5e6966);}['setConversationContext'](_0x2dc470){this['_conversationContextsChips']['clear']();for(const _0x36e68e of _0x2dc470){const _0x18dbce=this['_createContextButton'](_0x36e68e,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x18dbce,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x5a4a55,_0x13db3c,_0x226388){this['_resourcesBalloonView']['updateResourceState'](_0x5a4a55,_0x13db3c,_0x226388);}['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:_0x1bb686,withBackButton:_0x5a6fa5}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x1bb686,'withBackButton':_0x5a6fa5}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x3a5b99,_0x12bc3f,_0x9557c6,_0x48a6f7){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x3a5b99,_0x9557c6,_0x48a6f7);}['closeSourceResourceBalloon'](_0x1fae55){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x1fae55),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x2404c9){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x2404c9),this['_setAddContextButtonEnabled'](_0x2404c9);}['_setAddContextButtonEnabled'](_0x3a9758){const _0x24b4c6=!_0x3a9758['document']['isHidden']&&_0x3a9758['document']['enabled'],_0x3e7477=_0x3a9758['urls']['enabled'],_0x404144=_0x3a9758['files']['enabled'],_0x1bc1e3=_0x3a9758['sources']['length']>0x0,_0x1746c0=_0x3a9758['customItems']&&_0x3a9758['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x24b4c6||_0x3e7477||_0x404144||_0x1bc1e3||_0x1746c0;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[xr,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Lr},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x5f454d){const _0x270104=new kt(_0x5f454d);return _0x270104['set']({'label':as(_0x5f454d,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Vr+'\x20'+Pr+'\x20'+cs,'icon':_0x279e8a,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x270104;}['_createAddContextBalloonPanelView'](_0x4d5879){return this['_createBaseBalloonPanel'](_0x4d5879,Dr);}['_createUrlBalloonPanelView'](_0x5a0e89){const _0x590406=this['_createBaseBalloonPanel'](_0x5a0e89,Hr);return this['_addUrlContent'](_0x590406,_0x5a0e89),_0x590406;}['_createResourcesBalloonView'](_0x463ee4,_0x1188a5){const _0x3fcf68={'searchInputVisibleFrom':_0x1188a5['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wr});},'onResourceSelected':(_0x1ec485,_0x3f3d38)=>{this['fire']('addResourceToContext',{'source':_0x1ec485,'resource':_0x3f3d38});},'onLoadSourceResources':_0x537179=>{this['fire']('loadSourceResources',_0x537179);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new vr(_0x463ee4,_0x1188a5['bodyCollection'],_0x3fcf68);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Kr)||document['body'];}['_createBaseBalloonPanel'](_0x510cde,_0x3e56c5){const _0x38634d=new Qt(_0x510cde);return _0x38634d['extendTemplate']({'attributes':{'class':_0x3e56c5}}),this['bodyCollection']['add'](_0x38634d),_0x38634d;}['_setBalloonPanelContent'](_0x47289d,_0x121344,_0x587bef){if(_0x47289d['content']['clear'](),!_0x587bef['document']['isHidden']&&_0x587bef['document']['enabled']){const _0x40cdaf=this['_createBalloonButton'](_0x121344,{'label':as(_0x121344,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x2e0dbc});_0x40cdaf['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x47289d['content']['add'](_0x40cdaf);}if(_0x587bef['urls']['enabled']){const _0x213d25=this['_createBalloonButton'](_0x121344,{'label':as(_0x121344,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x3bb8f4});_0x213d25['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wr}),this['_urlInputView']['focus']();}),_0x47289d['content']['add'](_0x213d25);}if(_0x587bef['files']['enabled']){const _0x920454=new _0x48643e(_0x121344);_0x920454['set']({'label':as(_0x121344,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x2f4323,'withText':!0x0,'tooltip':!0x0,'class':Mr,'allowMultipleFiles':!0x0}),_0x920454['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x920454['on']('done',(_0x3bc899,_0x3b274d)=>{this['fire']('addFileToContext',_0x3b274d);}),_0x920454['tooltip']=!0x0,_0x47289d['content']['add'](_0x920454);}for(const _0x70a668 of _0x587bef['sources']){const _0x43985a=this['_createBalloonButton'](_0x121344,{'label':_0x70a668['label'],'icon':_0x70a668['icon']||_0x287bcc,'type':'source'});_0x47289d['content']['add'](_0x43985a),_0x43985a['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x70a668,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x4890a9 of _0x587bef['customItems']||[]){const _0x11eab2=this['_createBalloonButton'](_0x121344,{'label':_0x4890a9['label'],'icon':_0x4890a9['icon']||_0x287bcc,'type':'customItem'});_0x47289d['content']['add'](_0x11eab2),_0x11eab2['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x4890a9);});}this['_hasExactlyOneSource']=0x1===_0x47289d['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x13fbe3,_0x22c57b){this['_urlInputView']=new Er(_0x22c57b),this['_urlInputView']['on']('submitUrl',(_0x4a8945,_0x3c36b7)=>{this['_handleUrlSubmit'](_0x3c36b7);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wr}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wr});}),_0x13fbe3['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x7653e1,_0x5b0d61){const _0x581786='source'===_0x5b0d61['type']?new $r(_0x7653e1):new kt(_0x7653e1);return _0x581786['set']({'label':_0x5b0d61['label'],'icon':_0x5b0d61['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Mr}),_0x581786;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){Xt({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x4b7503){const _0x1e8abc=this['_addContextBalloonConfig'];_0x1e8abc['buttonView']['isOn']=_0x4b7503,_0x4b7503?_0x1e8abc['balloonView']['show']():_0x1e8abc['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x1b305a,buttonView:_0x506447,hideMethod:_0x22e699}=this['_addContextBalloonConfig'];Xt({'emitter':_0x1b305a,'contextElements':[_0x1b305a['element'],_0x506447['element']],'callback':()=>{_0x22e699();},'activator':()=>_0x506447['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x325c64,_0x22330c,_0x11e6c6=!0x1,_0x47cab2=!0x1){const _0x148c59='conversation'===_0x22330c||!0x0===_0x325c64['isReadOnly'],_0x40970f=new xn(this['locale'],_0x325c64,_0x148c59,_0x11e6c6,_0x47cab2);return _0x148c59||_0x40970f['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x40970f['id']);}),_0x40970f;}['_addContextToCollection'](_0xa76db6,_0xed5a51){_0xed5a51['add'](_0xa76db6,0x0);}['_removeContextFromCollection'](_0x256080,_0x490428){const _0x5c5464=_0x490428['find'](_0x213310=>_0x213310['id']===_0x256080);_0x5c5464&&_0x490428['remove'](_0x5c5464);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wr}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x4d9c2e){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x4d9c2e);}}class $r extends kt{['arrowView'];constructor(_0x137db3){super(_0x137db3),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Ur]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0xfa63ee=new yt();return _0xfa63ee['content']=_0x38dbb6,_0xfa63ee['extendTemplate']({'attributes':{'class':Ur+'__arrow'}}),_0xfa63ee;}}class qr extends Nt{['_cancelButtonView'];['_loaderView'];constructor(_0xee25da){super(_0xee25da),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 _0x4ff152=new kt(this['locale']);return _0x4ff152['set']({'label':as(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':hs+'\x20ck-ai-button-stop-generating','icon':_0x7c8fb}),_0x4ff152['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x4ff152;}['_createLoaderView'](){const _0x5c712a=new Nt(this['locale']);return _0x5c712a['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':as(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x5c712a;}}class Qr extends Nt{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x56a87b,_0x3506ec){super(_0x56a87b),this['_contextPanelView']=this['_createContextPanelView'](_0x56a87b,{'bodyCollection':_0x3506ec['bodyCollection'],'searchInputVisibleFrom':_0x3506ec['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x56a87b),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x56a87b),this['_loaderView']=this['_createLoaderView'](_0x56a87b),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x56a87b),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'](...yr)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x209a1d=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x209a1d['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x209a1d['if']('isLoading','ck-hidden',_0x27b386=>_0x27b386||!this['isModelAvailable']),_0x209a1d['if']('isModelAvailable','ck-hidden',_0x54c874=>!_0x54c874||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x209a1d['if']('isLoading','ck-hidden',_0x5e95ea=>!_0x5e95ea)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x209a1d['if']('isModelAvailable','ck-hidden',_0x245c7d=>_0x245c7d)]},'children':[this['_modelUnavailableMessageView']]}]}),Xt({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x882e93,_0x224404){return new Yr(_0x882e93,_0x224404);}['_createPromptInputView'](_0x5575f2){return new sr(_0x5575f2,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x5d02bd){return new dr(_0x5d02bd);}['_createLoaderView'](_0x102ea3){return new qr(_0x102ea3);}['_createModelUnavailableMessageView'](_0x2f1591){const _0x4b3a92=new Xr(_0x2f1591);return _0x4b3a92['delegate']('startConversation')['to'](this),_0x4b3a92;}['_handlePromptInputFocus'](_0x10939e,_0x105b63,_0x593b47){_0x593b47?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x5832a8,_0x52cf36){this['_contextPanelView']['addContextItem'](_0x5832a8,_0x52cf36);}['removeContextItem'](_0x2fa9b0){this['_contextPanelView']['removeContextItem'](_0x2fa9b0);}['setContextItemLoading'](_0x57491f,_0x4d589a){this['_contextPanelView']['setContextItemLoading'](_0x57491f,_0x4d589a);}['setIsUploadInProgress'](_0x50cda8){this['_promptInputView']['setIsUploadInProgress'](_0x50cda8);}['setConversationContext'](_0x16cfa7){this['_contextPanelView']['setConversationContext'](_0x16cfa7);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x32bdaf,_0x88253b,_0x589672){this['_contextPanelView']['updateResourceState'](_0x32bdaf,_0x88253b,_0x589672);}['setWebSearch'](_0x5ef927){this['_promptCapabilitiesView']['setWebSearch'](_0x5ef927);}['setReasoning'](_0x3d1c32){this['_promptCapabilitiesView']['setReasoning'](_0x3d1c32);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x2ed28e){this['_contextPanelView']['setAddContextOptions'](_0x2ed28e);}['setInputPlaceholder'](_0x3f815e){this['_promptInputView']['setPlaceholderText'](_0x3f815e);}['setModelList'](_0x2c4275,_0xcf3c6c){this['_promptCapabilitiesView']['setModelList'](_0x2c4275,_0xcf3c6c);}['setModel'](_0x4a2bec){_0x4a2bec?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x4a2bec)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x1693c6){this['_promptCapabilitiesView']['disableModelSelector'](_0x1693c6);}['populateSourceResourceBalloon'](_0x39575e,_0xb71e4e,_0x124cfe,_0x139265){this['_contextPanelView']['populateSourceResourceBalloon'](_0x39575e,_0xb71e4e,_0x124cfe,_0x139265);}['closeSourceResourceBalloon'](_0x2d2fbf){this['_contextPanelView']['closeSourceResourceBalloon'](_0x2d2fbf);}['focusPromptInput'](_0x1d9c29=!0x1){this['_promptInputView']['focus'](_0x1d9c29);}['setPromptInputValue'](_0x317762){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x317762;}}class Xr extends Nt{constructor(_0x843f27){super(_0x843f27);const _0x179fff=new kt(_0x843f27);_0x179fff['set']({'label':as(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x179fff['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':as(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x179fff]}]});}}class zr extends _0x222d65{['conversationStartButton'];['resizeButton'];constructor(_0x43aeba,_0x4027ee){super(_0x43aeba,{'label':as(_0x43aeba,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':_0x5ac6f6}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x43aeba),this['children']['add'](this['conversationStartButton']),_0x4027ee&&(this['resizeButton']=ls(_0x43aeba,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x46df04){const _0x3e193c=new kt(_0x46df04);return _0x3e193c['set']({'label':as(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x1f8e2f,'class':'ck-ai-chat__start-conversation\x20'+hs}),_0x3e193c['on']('execute',()=>{this['fire']('startConversation');}),_0x3e193c;}}class jr extends Nt{constructor(_0x224695){super(_0x224695),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':as(_0x224695,'AI_DISCLAIMER_TEXT')}]}]});}}class Jr extends Nt{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x1fa155,_0x4bbbc7){super(_0x1fa155),this['_bodyCollection']=new qt(_0x1fa155),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new zr(_0x1fa155,_0x4bbbc7['showResizeButton']),this['chatHeader']['delegate'](...Xs)['to'](this),this['chatFeed']=new tr(_0x1fa155,this['_bodyCollection']),this['chatFeed']['delegate'](...Xs)['to'](this),this['chatControls']=new Qr(_0x1fa155,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x4bbbc7['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...Xs)['to'](this),this['chatDisclaimer']=new jr(_0x1fa155),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x1fa155['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x5c410b,_0x321e47,_0x9fc320,_0x562b05){this['chatControls']['populateSourceResourceBalloon'](_0x5c410b,_0x321e47,_0x9fc320,_0x562b05);}['closeSourceResourceBalloon'](_0x41acf0){this['chatControls']['closeSourceResourceBalloon'](_0x41acf0);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class Zr extends _0x3627a2{static get['requires'](){return[ns];}['_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(_0x4de5fb){super(_0x4de5fb);const _0x2fe11d=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new _n(),this['_view']=new Jr(this['context']['locale'],{'showResizeButton':_0x2fe11d['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...Xs)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x47fe7a,{showDiff:_0x4873a8})=>{this['showDiff']=_0x4873a8;}),_0x2fe11d['view']['addTab']({'id':'chat','buttonLabel':as(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x5ac6f6,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x3017ed=>_0x3017ed),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x9d54cd=>_0x9d54cd),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x5a68a0){const _0x431a1e=this['context']['config']['get']('ai.chat.welcomeMessage')??as(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x5a68a0['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x431a1e}),this['fire']('conversationCreated');}async['addFeedItemStaticMessage']({id:_0x3b772f,staticMessage:_0x43a0cc}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x3b772f,'initialContent':'<p>'+_0x43a0cc+'</p>'});});}async['addFeedItemUserMessage'](_0x13d450){const _0x4030e2=_0x13d450['attributes']?.['displayedPrompt']||_0x13d450['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x13d450['contextItems']['values']()),'initialContent':'<p>'+_0x4030e2+'</p>','id':_0x13d450['id']});});}async['addFeedItemError']({errorMessage:_0x1f24d1,id:_0x2dfb69}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x1f24d1+'</p>','id':_0x2dfb69});});}async['addFeedItemAIReply'](_0x55e4b6){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x55e4b6['interactionId']+':'+_0x55e4b6['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x392aa8){const _0x56ca69=Fs(this['context']);let _0x42adac=_0x56ca69['config']['get']('ai.availableReplyActions')||[...gn];if(_0x56ca69['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x2be318=_0x56ca69['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x2be318,'value');}}else _0x42adac=_0x42adac['filter'](_0x4721f5=>'insertSuggestion'!=_0x4721f5);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x392aa8['interactionId']+':'+_0x392aa8['id'],'areActionsDisabled':_0x392aa8['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x42adac}),this['clearLoadingMessage']();});}async['addFeedInteractionHeader'](_0x855ebb,_0x48cec9){return this['_promiseQueue']['enqueue'](async()=>{const _0x4d24d4=this['_view']['chatFeed']['children']['last'];if(_0x4d24d4 instanceof Yn)return this['_view']['chatFeed']['children']['remove'](_0x4d24d4),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x855ebb['id'],'capabilities':{'isWebSearchEnabled':_0x4d24d4['capabilities']['isWebSearchEnabled']||_0x48cec9['isWebSearchEnabled'],'isReasoningEnabled':_0x4d24d4['capabilities']['isReasoningEnabled']||_0x48cec9['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x855ebb['id'],'capabilities':_0x48cec9});});}async['addFeedItemCustomElement'](_0x3c0d43,_0x1c6f48){let _0x735ff3;return await this['_promiseQueue']['enqueue'](async()=>{_0x735ff3=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x3c0d43,'id':_0x1c6f48});}),_0x735ff3;}['removeFeedItem'](_0x41d3b7){this['_view']['chatFeed']['removeItem'](_0x41d3b7);}['hasFeedItem'](_0x203227){return this['_view']['chatFeed']['hasItem'](_0x203227);}['updateFeedInteractionHeader'](_0x22f51a){const _0x5d003f=this['_view']['chatFeed']['children']['find'](_0x530d97=>_0x530d97['options']['id']==_0x22f51a['id']&&_0x530d97 instanceof Yn);_0x5d003f&&_0x5d003f['set']('isVisible',_0x22f51a['isVisible']);}async['updateFeedItemAIReplyContent'](_0x1a5a81){const _0x40aa02=_0x1a5a81['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x53277a=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x1a5a81,'abortSignal':_0x53277a,'renderingStrategy':_0x40aa02}),_0x1a5a81['isDone']&&this['markFeedItemAsDone'](_0x1a5a81['id']);});}['updateFeedItemAIReplySources'](_0x37cda6,_0x13188e){this['_view']['chatFeed']['updateWebSources'](_0x37cda6,_0x13188e);}async['updateFeedItemAIReplySuggestionContent'](_0x258a81){const _0x555c99=_0x258a81['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0xc61250=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x258a81,'abortSignal':_0xc61250,'renderingStrategy':_0x555c99}),_0x258a81['isDone']&&this['markFeedItemAsDone'](_0x258a81['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x954707){this['_view']['chatFeed']['updateSuggestionPartState'](_0x954707);}['setFeedItemAIReplySuggestionPartActive'](_0x1983ff){this['_view']['chatFeed']['setSuggestionPartActive'](_0x1983ff);}['markFeedItemAsDone'](_0x5ad60f){this['_view']['chatFeed']['markItemAsDone'](_0x5ad60f);}['removeFeedInteraction'](_0x2def4e){this['_view']['chatFeed']['getItemIds']()['filter'](_0x5f2579=>_0x5f2579['startsWith'](_0x2def4e))['forEach'](_0x120760=>this['_view']['chatFeed']['removeItem'](_0x120760));}['startInteraction'](){const _0x4eb88f=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x4eb88f),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x156c25){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x2f0593=>_0x2f0593['startsWith'](_0x156c25['id']))['forEach'](_0x7edd79=>this['markFeedItemAsDone'](_0x7edd79)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0xa13720,_0x1069c3){this['_view']['chatControls']['addContextItem'](_0xa13720,_0x1069c3);}['removeContextItem'](_0x24a5db){this['_view']['chatControls']['removeContextItem'](_0x24a5db);}['setContextItemLoading'](_0x32e214,_0x4985c0){this['_view']['chatControls']['setContextItemLoading'](_0x32e214,_0x4985c0);}['setIsUploadInProgress'](_0x25aa13){this['_view']['chatControls']['setIsUploadInProgress'](_0x25aa13);}['setConversationContext'](_0x4c8d9a){this['_view']['chatControls']['setConversationContext'](_0x4c8d9a);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x17a8e9,_0x175ef6,_0x37020a){this['_view']['chatControls']['updateResourceState'](_0x17a8e9,_0x175ef6,_0x37020a);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x32ad96){this['_view']['chatControls']['setAddContextOptions'](_0x32ad96);}['updateCapabilities'](_0x493231){this['_view']['chatControls']['setWebSearch'](_0x493231['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x493231['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x493231));}['setSelectedModel'](_0x1f29ec,_0x2c78b0){this['_view']['chatControls']['setModel'](_0x1f29ec),_0x2c78b0&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0xe1cb20){this['feedItemRenderingStrategy']=_0xe1cb20;}['toggleLoadingSkeleton'](_0x10b1a2){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x10b1a2);}['resetConversationTitle'](){this['setConversationTitle'](as(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x5c31a1,_0xb5496=!0x1){if(_0xb5496&&!St()&&_0x5c31a1['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x5c31a1);this['_view']['chatHeader']['label']=_0x5c31a1;}['setLoadingMessage'](_0x57399a){this['_view']['chatFeed']['setLoadingMessage'](_0x57399a);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x4ca6ce){let _0xe58cfc=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x4ca6ce[_0xe58cfc],_0xe58cfc++,_0xe58cfc===_0x4ca6ce['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x4f4fcb){this['_view']['chatHeader']['isMaximized']=_0x4f4fcb;}['prepareLoadingMessage'](_0x2dd437){return _0x2dd437['isWebSearchEnabled']&&_0x2dd437['isReasoningEnabled']?as(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x2dd437['isWebSearchEnabled']?as(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x2dd437['isReasoningEnabled']?as(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):as(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x30cd6d){return _0x30cd6d?_0x30cd6d['isWebSearchEnabled']&&_0x30cd6d['isReasoningEnabled']?as(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x30cd6d['isWebSearchEnabled']?as(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x30cd6d['isReasoningEnabled']?as(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):as(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):as(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x1dd3ea,_0x24a038,_0x263b7c,_0x1928a1){this['_view']['populateSourceResourceBalloon'](_0x1dd3ea,_0x24a038,_0x263b7c,_0x1928a1);}['closeSourceResourceBalloon'](_0x49745a){this['_view']['closeSourceResourceBalloon'](_0x49745a);}['setPromptInputValue'](_0x446504){this['_view']['chatControls']['setPromptInputValue'](_0x446504);}['focusPromptInput'](_0x5c2064=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x5c2064);}['scrollFeedToSuggestion'](_0x5520a9,_0x178580){this['_view']['chatFeed']['scrollToSuggestion'](_0x5520a9,_0x178580);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class ta extends Lt{['sections'];constructor(_0x361992,_0x445a0b){super(_0x361992),this['sections']=_0x445a0b,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x5d9543){let _0x4d3df4=0x0,_0x1c1139=0x0;for(const _0x7658ff of this['sections']){const {resultsCount:_0x2f1864,totalItemsCount:_0x4ba3f5}=_0x7658ff['filter'](_0x5d9543);_0x4d3df4+=_0x2f1864,_0x1c1139+=_0x4ba3f5;}return{'resultsCount':_0x4d3df4,'totalItemsCount':_0x1c1139};}}class ea extends Pt{['title'];['itemsViews'];['_itemsListView'];constructor(_0x3fa4f9,{title:_0x382ee0,items:_0x4eb682}){super(_0x3fa4f9);const _0x33c86a=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x382ee0,this['itemsViews']=_0x4eb682;const _0x281cc1=new Nt(_0x3fa4f9);_0x281cc1['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new Lt(_0x3fa4f9),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x33c86a['if']('isVisible','ck-hidden',_0x5e3307=>!_0x5e3307)]},'children':[_0x281cc1,this['_itemsListView']]});}['filter'](_0x28623b){const _0x2b6d62=this['itemsViews']['length'];let _0x12de9d=0x0;for(const _0x1e4d7c of this['itemsViews']){if(_0x28623b){const _0xace727=_0x1e4d7c['isMatching'](_0x28623b);_0x1e4d7c['isVisible']=!!_0xace727,_0x1e4d7c['highlightText'](_0x28623b);}else _0x1e4d7c['isVisible']=!0x0,_0x1e4d7c['highlightText'](null);_0x1e4d7c['isVisible']&&_0x12de9d++;}return this['isVisible']=_0x12de9d>0x0,{'resultsCount':_0x12de9d,'totalItemsCount':_0x2b6d62};}['getItem'](_0x2c2916){return this['itemsViews']['find'](_0x38e2a2=>_0x38e2a2['id']===_0x2c2916);}['removeItem'](_0x194cc7){const _0x47281a=this['itemsViews']['indexOf'](_0x194cc7);-0x1!==_0x47281a&&(this['itemsViews']['splice'](_0x47281a,0x1),this['_itemsListView']['items']['remove'](_0x194cc7));}}class ia extends/* #__PURE__ -- @preserve */
27
+ _0x5ab1ce(Pt){['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(_0x131074,_0x14dd10){super(_0x131074);const _0x21c355=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x14dd10['pinned']),this['set']('loadingState',null),this['id']=_0x14dd10['id'];const {title:_0x376129,createdAt:_0x570b45,active:_0x4fbaf3=!0x1}=_0x14dd10;this['_titleView']=new _0x387701(),this['_titleView']['text']=_0x376129,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x193bcd=this['_createCheckView'](),_0x22f4f5=this['_createPinButtonView'](_0x131074),_0x5ac2e7=this['_createMenuDropdownView'](),_0x4879c0=this['_createEditInputView'](_0x131074,_0x376129),_0x1ff115=this['_createAcceptEditButtonView'](_0x131074,_0x4879c0),_0xa74af0=this['_createCancelEditButtonView'](_0x131074,_0x4879c0);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x22f4f5),this['actions']['add'](_0x5ac2e7),this['on']('change:isEdit',(_0x2fea59,_0x3e86a7,_0x30f5a9)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x30f5a9?(this['actions']['add'](_0x1ff115),this['actions']['add'](_0xa74af0),this['mainContent']['add'](_0x4879c0),_0x4879c0['element']['focus']()):(this['actions']['add'](_0x22f4f5),this['actions']['add'](_0x5ac2e7),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x4fbaf3?'ck-ai-chat-history__item--active':'',_0x21c355['if']('isVisible','ck-hidden',_0xa5cc53=>!_0xa5cc53),_0x21c355['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',_0x21c355['if']('loadingState','ck-hidden',_0x4cd0b1=>!!_0x4cd0b1)]},'children':_0x4fbaf3?[_0x193bcd]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x21c355['if']('loadingState','ck-hidden',_0x45ebd2=>!_0x45ebd2)]},'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',_0x21c355['if']('loadingState','ck-hidden',_0x5a720f=>!!_0x5a720f)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x21c355['if']('loadingState','ck-hidden',_0x2f03ae=>!_0x2f03ae)]},'children':[{'text':_0x21c355['to']('loadingState',_0x460f72=>_0x460f72?as(this['locale'],ia['LOADING_LABELS'][_0x460f72]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x570b45]}]},{'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'](_0x39b4cd){this['_titleView']['text']=_0x589baa(_0x39b4cd);}['updateLoadingState'](_0x4c7a7f,_0x2c04c4){this['set']('loadingState',_0x2c04c4?_0x4c7a7f:null);}['_createCheckView'](){const _0x5522a3=new yt();return _0x5522a3['set']({'content':_0x464c2a}),_0x5522a3;}['_createPinButtonView'](_0x628fec){const _0x1aa237=new kt(_0x628fec);return _0x1aa237['set']({'label':as(_0x628fec,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x1d3cb6,'withText':!0x1,'tooltip':!0x0}),_0x1aa237['bind']('isOn')['to'](this,'pinned'),_0x1aa237['on']('execute',()=>{const _0xeae799=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0xeae799});}),_0x1aa237;}['_createMenuDropdownView'](){const _0x240733=Bt(this['locale']),_0x1b8342=_0x240733['panelView']['children'];_0x240733['buttonView']['set']({'label':as(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x2a3090}),_0x240733['panelPosition']='sw';const _0x236966=new kt(this['locale']);_0x236966['label']=as(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x236966['withText']=!0x0,_0x236966['on']('execute',()=>{this['isEdit']=!0x0;});const _0x2543de=new kt(this['locale']);_0x2543de['label']=as(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x2543de['withText']=!0x0,_0x2543de['on']('execute',()=>{this['showConfirm'](as(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x16d1fd=new Lt(this['locale']),_0x3c63d4=new Pt(this['locale']);_0x3c63d4['children']['add'](_0x236966);const _0xa556ed=new Pt(this['locale']);return _0xa556ed['children']['add'](_0x2543de),_0x16d1fd['items']['addMany']([_0x3c63d4,_0xa556ed]),_0x1b8342['add'](_0x16d1fd),_0x240733;}['_createEditInputView'](_0x33ccc9,_0x5dfad6){const _0x4dce89=new _0x1ecad1(_0x33ccc9),_0x338d30=_0x4dce89['bindTemplate'];return _0x4dce89['value']=_0x5dfad6,_0x4dce89['extendTemplate']({'on':{'keydown':_0x338d30['to'](_0x5e3055=>{'Enter'==_0x5e3055['key']&&this['_commitEditInputValue'](_0x4dce89);})}}),_0x4dce89;}['_createAcceptEditButtonView'](_0x577c04,_0x523157){const _0x14a0cd=new kt(_0x577c04);return _0x14a0cd['set']({'icon':_0x464c2a,'withText':!0x1,'tooltip':as(_0x577c04,'AI_CHAT_HISTORY_ACCEPT')}),_0x14a0cd['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x14a0cd['on']('execute',()=>{this['_commitEditInputValue'](_0x523157);}),_0x14a0cd;}['_commitEditInputValue'](_0x66125d){const _0x5e6f44=_0x66125d['element']['value']||'';this['_titleView']['text']=_0x5e6f44,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x5e6f44});}['_createCancelEditButtonView'](_0x58270d,_0x298b90){const _0x3a4f4c=new kt(_0x58270d);return _0x3a4f4c['set']({'icon':_0x15dd63,'withText':!0x1,'tooltip':as(_0x58270d,'AI_CHAT_HISTORY_CANCEL')}),_0x3a4f4c['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x3a4f4c['on']('execute',()=>{this['isEdit']=!0x1,_0x298b90['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x3a4f4c;}['_createSpinnerView'](){const _0x58809c=new fn('tiny');return _0x58809c['isVisible']=!0x0,_0x58809c;}['isMatching'](_0x30cb13){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x30cb13)?{'title':!0x0}:null;}['highlightText'](_0x35ba48){this['_titleView']['highlightText'](_0x35ba48);}}class sa extends Nt{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x4d08cc,_0x453598){super(_0x4d08cc),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 _0x209a21=new _0x222d65(_0x4d08cc,{'label':as(_0x4d08cc,'AI_CHAT_HISTORY_HEADING'),'icon':_0x596529,'class':'ck-ai-header\x20ck-ai-header_history'});_0x453598&&(this['resizeButton']=ls(_0x4d08cc,this),_0x209a21['children']['add'](this['resizeButton'])),this['sectionsView']=new ta(_0x4d08cc,[]),this['sectionsView']['delegate'](...na)['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',_0xc94959=>!_0xc94959)]}}),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':[_0x209a21,{'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 _0x24f583=new _0x337eea(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':as(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0xee0022=>as(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0xee0022),'secondary':as(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x4690ae=this['_createErrorView']();return _0x4690ae['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x2543f8=>!_0x2543f8)]}}),_0x24f583['on']('render',()=>{_0x24f583['children']['add'](_0x4690ae,0x1);}),_0x24f583['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x315407=>!_0x315407)]}}),_0x24f583;}['_createSkeletonView'](){const _0x142579=new zn(this['locale'],jn['aiHistory']);return _0x142579['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x1f728f=>!_0x1f728f)]}}),_0x142579;}['_createErrorView'](){const _0x137e18=new Nt(this['locale']),_0x29cc3a=new kt(this['locale']);_0x29cc3a['set']({'withText':!0x1,'icon':_0x15dd63,'class':'ck-ai-notification_error__dismiss-button'}),_0x29cc3a['bind']('isVisible')['to'](this,'hasItems',_0x78e2a2=>!!_0x78e2a2),_0x29cc3a['on']('execute',()=>{this['errorMessage']='';});const _0x5da0ea=this['bindTemplate'];return _0x137e18['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x5da0ea['to']('errorMessage')}]},_0x29cc3a]}),_0x137e18;}['_createEmptyStateView'](){const _0x33dd32=new kt(this['locale']);_0x33dd32['set']({'label':as(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x1f8e2f,'class':'ck-ai-chat__start-conversation\x20'+hs}),_0x33dd32['on']('execute',()=>{this['fire']('openChat');});const _0x4bec69=new Nt(this['locale']);return _0x4bec69['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0xdf4a05=>!_0xdf4a05)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[as(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x33dd32]}),_0x4bec69;}['_createListItemViews'](_0x3ffca8,_0x25008e){const _0x4957ea=[];for(const _0x35fb66 of _0x3ffca8){const _0x313c27=new ia(_0x25008e,_0x35fb66);_0x313c27['delegate'](...na)['to'](this),_0x4957ea['push'](_0x313c27);}return _0x4957ea;}['updateHistoryItemsWithCategories'](_0x562cdb){const _0x5bd20d=this['locale']||'en',_0x59243c=[];for(const _0x5d6e39 of _0x562cdb){const _0x7d070e=this['_createListItemViews'](_0x5d6e39['items'],_0x5bd20d);_0x59243c['push'](new ea(_0x5bd20d,{'title':_0x5d6e39['title'],'items':_0x7d070e}));}this['sectionsView']['sections']=_0x59243c,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x59243c),this['hasItems']=_0x562cdb['some'](_0x3eeefe=>_0x3eeefe['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x4a3015){for(const _0x2a5945 of this['sectionsView']['sections']){const _0x510594=_0x2a5945['getItem'](_0x4a3015);if(_0x510594){if(_0x2a5945['removeItem'](_0x510594),0x0===_0x2a5945['itemsViews']['length']){const _0x12d644=this['sectionsView']['sections']['indexOf'](_0x2a5945);-0x1!==_0x12d644&&(this['sectionsView']['sections']['splice'](_0x12d644,0x1),this['sectionsView']['items']['remove'](_0x2a5945));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x54844a,_0x50ddc5){for(const _0x110479 of this['sectionsView']['sections']){const _0x4abc08=_0x110479['getItem'](_0x54844a);if(_0x4abc08){_0x4abc08['updateTitle'](_0x50ddc5);break;}}}['updateItemLoadingState'](_0x112ebd,_0x3a3c0e,_0x114949){for(const _0x101ffb of this['sectionsView']['sections']){const _0x2f7f54=_0x101ffb['getItem'](_0x112ebd);if(_0x2f7f54){_0x2f7f54['updateLoadingState'](_0x3a3c0e,_0x114949);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x3902e6=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x3902e6);}}}const na=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class ra extends _0x3627a2{static get['requires'](){return[ns];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x45a462){super(_0x45a462);const _0x3245ee=this['context']['plugins']['get']('AITabs');this['_historyView']=new sa(this['context']['locale'],_0x3245ee['showResizeButton']),this['_historyView']['delegate'](...na)['to'](this),_0x3245ee['view']['addTab']({'id':'history','buttonLabel':as(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x596529,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x3aecaa){this['_historyView']['removeHistoryItem'](_0x3aecaa);}['updateItems'](_0x289eab){this['_historyView']['updateHistoryItemsWithCategories'](_0x289eab);}['updateItemTitle'](_0x3b7f10,_0x1bba6f){this['_historyView']['updateItemTitle'](_0x3b7f10,_0x1bba6f);}['updateItemLoadingState'](_0x4f1998,_0x4cd62e,_0x2443f9){this['_historyView']['updateItemLoadingState'](_0x4f1998,_0x4cd62e,_0x2443f9);}['setLoadingSkeleton'](_0x3277cd){this['_historyView']['isLoading']=_0x3277cd;}['showError'](_0x187db5){this['_historyView']['errorMessage']=_0x187db5;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x50929c){this['_historyView']['isMaximized']=_0x50929c;}}class aa extends ht(){['id'];['createdAt'];constructor({id:_0x14cdfd,title:_0xd49b73,createdAt:_0x2a072c,updatedAt:_0x13deb0,pinned:_0x42d711}){super(),this['id']=_0x14cdfd,this['createdAt']=new Date(_0x2a072c),this['set']('title',_0xd49b73),this['set']('updatedAt',_0x13deb0?new Date(_0x13deb0):null),this['set']('pinned',_0x42d711||!0x1);}['updateTitle'](_0x1f7a36){this['set']('title',_0x589baa(_0x1f7a36)),this['updatedAt']=new Date();}['updatePinned'](_0x360d99){this['set']('pinned',_0x360d99),this['updatedAt']=new Date();}}class oa extends pt(){['items']=[];['connector'];['group'];constructor({connector:_0x2ceb32,group:_0x226e80}){super(),this['connector']=_0x2ceb32,this['group']=_0x226e80;}async['init'](){try{const _0x3a4b3e=this['connector']['fetchConversations'](this['group']),_0x1bdc2f=await _0x3a4b3e['getConversations']();this['loadItems'](_0x1bdc2f);}catch(_0x1345d4){this['fire']('error',{'error':_0x1345d4,'operation':'init'});}}['addItem'](_0x3e3a5c){this['items']['push'](_0x3e3a5c);}async['removeItem'](_0x1e1a10){const _0x33d3b6=this['items']['findIndex'](_0x45de40=>_0x45de40['id']===_0x1e1a10);if(-0x1===_0x33d3b6)return!0x1;try{return await this['connector']['deleteConversation'](_0x1e1a10)['execute'](),this['items']['splice'](_0x33d3b6,0x1),this['fire']('itemRemoved',{'itemId':_0x1e1a10}),!0x0;}catch(_0x46330b){return this['fire']('error',{'error':_0x46330b,'operation':'removeItem','itemId':_0x1e1a10}),!0x1;}}['getItem'](_0x411793){return this['items']['find'](_0x38545b=>_0x38545b['id']===_0x411793);}async['updateItemTitle'](_0x45028a,_0x362ea2){const _0x1723c0=this['getItem'](_0x45028a);if(!_0x1723c0)return!0x1;try{return await this['connector']['updateConversation'](_0x45028a,{'title':_0x362ea2})['getResult'](),_0x1723c0['updateTitle'](_0x362ea2),this['fire']('itemUpdated',{'itemId':_0x45028a,'updates':{'title':_0x362ea2}}),!0x0;}catch(_0x190ab6){return this['fire']('error',{'error':_0x190ab6,'operation':'updateItemTitle','itemId':_0x45028a}),!0x1;}}async['updateItemPinned'](_0x446aa9,_0x7716d9){const _0x5aa143=this['getItem'](_0x446aa9);if(!_0x5aa143)return!0x1;try{return await this['connector']['updateConversation'](_0x446aa9,{'pinned':_0x7716d9})['getResult'](),_0x5aa143['updatePinned'](_0x7716d9),this['fire']('itemUpdated',{'itemId':_0x446aa9,'updates':{'pinned':_0x7716d9}}),!0x0;}catch(_0x5185ef){return this['fire']('error',{'error':_0x5185ef,'operation':'updateItemPinned','itemId':_0x446aa9}),!0x1;}}['loadItems'](_0x52eade){try{this['items']=[],_0x52eade['map'](_0x2f794b=>{this['addItem'](new aa(_0x2f794b));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x4cc767){this['fire']('error',{'error':_0x4cc767,'operation':'loadItems'});}}['getItems'](_0x2877d5={}){const _0x42c6eb=void 0x0!==_0x2877d5['pinned']&&_0x2877d5['pinned'],_0x3b3db2=_0x2877d5['from']?new Date(_0x2877d5['from']['getFullYear'](),_0x2877d5['from']['getMonth'](),_0x2877d5['from']['getDate']()):null,_0x809fc6=_0x2877d5['to']?new Date(_0x2877d5['to']['getFullYear'](),_0x2877d5['to']['getMonth'](),_0x2877d5['to']['getDate']()):null;return this['items']['filter'](_0x1f9ce1=>{if(_0x1f9ce1['pinned']!==_0x42c6eb)return!0x1;if(_0x809fc6){const _0x420bfb=new Date(_0x1f9ce1['createdAt']['getFullYear'](),_0x1f9ce1['createdAt']['getMonth'](),_0x1f9ce1['createdAt']['getDate']());return _0x3b3db2?_0x3b3db2['getTime']()===_0x809fc6['getTime']()?_0x420bfb['getTime']()===_0x3b3db2['getTime']():_0x420bfb<_0x809fc6&&_0x420bfb>=_0x3b3db2:_0x420bfb<_0x809fc6;}return!0x0;});}}class ha extends _0x3627a2{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[rs,Ys,ra,ns];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](rs),this['_aiChatHistoryUi']=this['context']['plugins']['get'](ra),this['_aiChatController']=this['context']['plugins']['get'](Ys);const _0x4317b8=this['context']['plugins']['get'](ns);try{const _0x410d46=this['_aiChatController']['getGroupId']();this['history']=new oa({'connector':this['_aiConnector'],'group':_0x410d46}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x351c04,_0x336ca8)=>{this['_setItemLoading'](_0x336ca8['id'],'remove'),this['_handleRemove'](_0x336ca8['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x3e3d8e,_0x1bf986)=>{this['_setItemLoading'](_0x1bf986['id'],'rename'),this['_handleEditTitle'](_0x1bf986['id'],_0x1bf986['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x462efb,_0x4f04c2)=>{void 0x0!==_0x4f04c2['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x4f04c2['itemId'],_0x4f04c2['updates']['title']),void 0x0!==_0x4f04c2['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x4f04c2['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x392012,_0x193c3f)=>{this['_aiChatController']['_handleRemovedConversation'](_0x193c3f['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x193c3f['itemId']),this['_clearItemLoading'](_0x193c3f['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x1b7448,_0x1c4387)=>{this['_handleHistoryErrorUI'](_0x1c4387['error'],_0x1c4387['operation'],_0x1c4387['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x21dfdc,_0x39b002)=>{this['_handleSelectConversation'](_0x39b002['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x3b4c39,_0x45295c)=>{const _0x571cdd=_0x45295c['pinned']?'pin':'unpin';this['_setItemLoading'](_0x45295c['id'],_0x571cdd),this['_handleTogglePin'](_0x45295c['id'],_0x45295c['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x4317b8['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x4317b8['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x4317b8,'resizedTabs',(_0x2d06fd,_0x58dd3a)=>{this['_setIsMaximized'](_0x58dd3a);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x4317b8['resize']();});}catch(_0xfb8af3){this['_handleHistoryErrorUI'](_0xfb8af3,'init');}}async['_handleEditTitle'](_0x39de95,_0x50c50a){await this['history']['updateItemTitle'](_0x39de95,_0x50c50a);}async['_handleTogglePin'](_0x53ce23,_0x34c623){await this['history']['updateItemPinned'](_0x53ce23,_0x34c623);}async['_handleRemove'](_0x1e16fc){await this['history']['removeItem'](_0x1e16fc);}async['_handleSelectConversation'](_0x34b687){await this['_aiChatController']['loadConversation'](_0x34b687);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x3ae439=this['_aiChatController']['activeConversation']?.['id'],_0x510fdd=this['_getCategorizedItems']()['map'](_0x2739a5=>({'title':_0x2739a5['title'],'items':_0x2739a5['items']['map'](_0x512d93=>({'id':_0x512d93['id'],'title':_0x512d93['title']||as(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x512d93['createdAt'])['toLocaleDateString'](),'active':_0x512d93['id']===_0x3ae439,'pinned':_0x512d93['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x510fdd);}['_setItemLoading'](_0x23ae7a,_0x28e3ac){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x23ae7a,_0x28e3ac,!0x0);}['_clearItemLoading'](_0x1133b9){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x1133b9,null,!0x1);}['_handleHistoryErrorUI'](_0x454e55,_0x9b864,_0x4ce057){const _0x4fd010=this['_generateErrorMessage'](_0x9b864,_0x4ce057);this['_aiChatHistoryUi']['showError'](_0x4fd010),_0x4ce057&&this['_clearItemLoading'](_0x4ce057),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x2c48a6,_0x39344f){const _0x47b4b2=_0x39344f?this['history']['getItem'](_0x39344f):null,_0x3f49e4=_0x47b4b2?.['title']||as(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x2c48a6){case'updateItemTitle':return as(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x3f49e4);case'updateItemPinned':{const _0x565016=as(this['context']['locale'],_0x47b4b2?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return as(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x565016,_0x3f49e4]);}case'removeItem':return as(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x3f49e4);case'init':case'loadItems':return as(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return as(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x42ac99=new Date(),_0x53ad5f=new Date(_0x42ac99['getFullYear'](),_0x42ac99['getMonth'](),_0x42ac99['getDate']()),_0xedc27a=new Date(_0x53ad5f);_0xedc27a['setDate'](_0xedc27a['getDate']()-0x1);const _0x52c117=new Date(_0x53ad5f);_0x52c117['setDate'](_0x52c117['getDate']()-0xe);const _0x598fbc=this['history']['getItems']({'pinned':!0x0}),_0x49c956=this['history']['getItems']({'from':_0x53ad5f,'to':_0x53ad5f}),_0x2bf762=this['history']['getItems']({'from':_0xedc27a,'to':_0xedc27a}),_0x1a28e3=this['history']['getItems']({'from':_0x52c117,'to':_0xedc27a}),_0x101e4e=this['history']['getItems']({'to':_0x52c117}),_0x366f3e=[];return _0x598fbc['length']>0x0&&_0x366f3e['push']({'title':as(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x598fbc}),_0x49c956['length']>0x0&&_0x366f3e['push']({'title':as(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x49c956}),_0x2bf762['length']>0x0&&_0x366f3e['push']({'title':as(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x2bf762}),_0x1a28e3['length']>0x0&&_0x366f3e['push']({'title':as(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x1a28e3}),_0x101e4e['length']>0x0&&_0x366f3e['push']({'title':as(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x101e4e}),_0x366f3e;}['_setIsMaximized'](_0x4e48ce){this['_aiChatHistoryUi']['setIsMaximized'](_0x4e48ce);}}class ca extends _0x3627a2{static get['requires'](){return[ha,ra];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class la extends _0x3627a2{static get['requires'](){return[Ys,qs,Zr,ca];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5f3518){super(_0x5f3518),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[],'alwaysAddSelection':!0x1}),this['context']['config']['define']('ai.chat.initialConversation','new');}}class ua extends kt{['id'];constructor(_0xf302cc,_0x2f0966){super(_0xf302cc);const {id:_0x25b118,type:_0x12498f,icon:_0x198d36}=_0x2f0966;this['id']=_0x25b118,this['set']({'label':_0x2f0966['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x2f0966['id']}}),_0x198d36?this['icon']=_0x198d36:'chat'===_0x12498f?this['icon']=_0x5ac6f6:'review'===_0x12498f?this['icon']=_0x217aa1:'translate'===_0x12498f&&(this['icon']=_0x2c155e);}}class da extends Nt{['listView'];constructor(_0x7ca5de,_0x179923){super(_0x7ca5de);const _0x4633be=_0x179923['map'](_0x2c441e=>{const _0x37c4aa=new Pt(this['locale']),_0x2c1bf6=new ua(this['locale'],_0x2c441e);return _0x37c4aa['children']['add'](_0x2c1bf6),_0x2c1bf6['delegate']('execute')['to'](this),_0x37c4aa;});this['listView']=new Lt(this['locale']),this['listView']['items']['addMany'](_0x4633be),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const _a='chat-shortcuts';class Aa extends _0x3627a2{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[Zr];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](Zr),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x3501e=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x3501e['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x3501e,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x8a3f33=['chat','review','translate'];this['_shortcuts']['forEach'](_0x2b0479=>{let _0x280788=!0x0;if(_0x2b0479['id']&&_0x2b0479['label']&&_0x8a3f33['includes'](_0x2b0479['type'])?'chat'===_0x2b0479['type']&&(_0x280788='string'==typeof _0x2b0479['prompt']):_0x280788=!0x1,!_0x280788)throw new ot('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x2b0479});});}['_injectShortcuts'](){const _0x524641=this['context']['plugins']['get'](Zr);this['_shortcutsView']=new da(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x524641['addFeedItemCustomElement'](this['_shortcutsView']['element'],_a),this['_shortcutsView']['on']('execute',_0x54549b=>{const _0x78392=_0x54549b['source']['id'];this['_executeShortcut'](_0x78392);});}['_removeShortcuts'](){const _0x5f2940=this['context']['plugins']['get'](Zr);_0x5f2940['hasFeedItem'](_a)&&_0x5f2940['removeFeedItem'](_a),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x5ae7ff){const _0x37ec13=this['_shortcuts']['find'](_0xe10cfd=>_0xe10cfd['id']===_0x5ae7ff),_0xafa73a=_0x37ec13['type'];'chat'===_0xafa73a?this['_runChatShortcut'](_0x37ec13):'review'===_0xafa73a?_0x37ec13['commandId']?this['_runReviewShortcut'](_0x37ec13):this['_switchTab']('reviewMode'):'translate'===_0xafa73a&&(_0x37ec13['language']?this['_runTranslateShortcut'](_0x37ec13):this['_switchTab']('translate'));}['_switchTab'](_0x5a1c63){if(!this['context']['plugins']['has']('AITabs'))throw new ot('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x5a1c63});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x5a1c63);}async['_runChatShortcut']({prompt:_0x4d47ba,draftMode:_0x361c2c,useWebSearch:_0xaf3e5d=!0x1,useReasoning:_0x3b50c6=!0x1,model:_0x39a363}){const _0x41246c=this['context']['plugins']['get']('AIChatController'),_0x13abbe=_0x41246c['activeConversation'];let _0x1bd8cc;_0x1bd8cc=_0x39a363?await _0x13abbe['chatModels']['getModel'](_0x39a363):await _0x13abbe['chatModels']['getDefault'](),_0x1bd8cc&&await _0x13abbe['setModel'](_0x1bd8cc),_0x13abbe['setWebSearch'](_0xaf3e5d),_0x13abbe['setReasoning'](_0x3b50c6),_0x41246c['addCurrentDocumentToChatContext'](),_0x361c2c?(this['_aiChatUI']['setPromptInputValue'](_0x4d47ba),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x41246c['sendMessage']({'message':_0x4d47ba});}['_runReviewShortcut']({commandId:_0x282e3d,model:_0x22089b,prompt:_0x1442c5,params:_0x196a1e}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new ot('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x24fb63={'id':_0x282e3d,'isCustom':'custom'===_0x282e3d};_0x22089b&&_0x1442c5&&(_0x24fb63['args']={'model':_0x22089b,'prompt':_0x1442c5}),_0x196a1e&&(_0x24fb63['params']=_0x196a1e),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x24fb63);}['_runTranslateShortcut']({language:_0x44a214}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new ot('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x44a214,'args':{'language':_0x44a214}});}}class ga extends _0x2228a8{constructor(_0x144de0){super(_0x144de0);const _0x12af90=_0x144de0['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x12af90,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x7b7bc6=this['editor']['plugins']['get']('AITabs')['view'];_0x7b7bc6['isVisible']=!_0x7b7bc6['isVisible'];}}class Ia extends _0x43ff17{static get['requires'](){return[ns];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x189e22=this['editor'];_0x189e22['commands']['add']('toggleAi',new ga(_0x189e22)),_0x189e22['ui']['componentFactory']['add']('toggleAi',()=>{const _0x100f6e=this['_createAIUIButton'](kt);return _0x100f6e['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x100f6e;}),_0x189e22['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x427854=this['_createAIUIButton'](Kt);return _0x427854['set']({'role':'menuitemcheckbox'}),_0x427854;});}['_createAIUIButton'](_0x71f673){const _0x3fcd8a=this['editor'],_0x4ea48c=_0x3fcd8a['commands']['get']('toggleAi'),_0x40116c=new _0x71f673(_0x3fcd8a['locale']);return _0x40116c['set']({'label':as(_0x3fcd8a['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0xd0d6ef,'isToggleable':!0x0}),_0x40116c['bind']('isEnabled')['to'](_0x4ea48c),_0x40116c['bind']('isOn')['to'](_0x4ea48c,'value',_0x5b0f82=>!!_0x5b0f82),this['listenTo'](_0x40116c,'execute',()=>{_0x4ea48c['execute']();}),_0x40116c;}}const Ea=['applySuggestion','insertSuggestion','showNext','showPrevious'];class Ta extends Nt{['_errorView'];constructor(_0x422b14){super(_0x422b14),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x54c586){this['showError'](_0x54c586);}['showError'](_0x2f5a5c){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x2f5a5c,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x1e5b66=new Nt(this['locale']),_0x5ee10b=new Nt(this['locale']);return _0x5ee10b['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x1e5b66['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x5bee89=>!_0x5bee89)]},'children':[_0x5ee10b]}),_0x1e5b66;}}const pa=0xa;class ma extends _0x3627a2{static get['requires'](){return[qs];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_isUpdatingMarkers']=!0x1;['open'](_0x71f699){const {id:_0x3f6fd4}=this['_currentConfig']??{};this['_currentConfig']=_0x71f699;const {id:_0x521cb1}=this['_currentConfig'];this['isOpen']&&_0x3f6fd4===_0x521cb1?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x3f064d=Fs(this['context'])['plugins']['get']('Dialog');_0x3f064d['isOpen']&&this['_currentConfig']&&_0x3f064d['id']===this['_currentConfig']['id']&&_0x3f064d['hide']();}['_updateDialog'](){const _0x90f9d7=Fs(this['context'])['plugins']['get']('Dialog'),{icon:_0x26aadd,title:_0x4df278}=this['_currentConfig'];_0x90f9d7['view']?.['headerView']&&(_0x90f9d7['view']['headerView']['label']=_0x4df278,_0x90f9d7['view']['headerView']['iconView']&&_0x26aadd&&(_0x90f9d7['view']['headerView']['iconView']['content']=_0x26aadd)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x90f9d7['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](qs)['showFakeVisualSelection']({'ranges':this['_currentConfig']['ranges'],'id':'balloon','priority':0x64}),window['getSelection']()?.['removeAllRanges']();}['_hideFakeVisualSelection'](){this['context']['plugins']['get'](qs)['hideFakeVisualSelection']('balloon');}['_showDialog'](){const _0x2c9531=Fs(this['context'])['plugins']['get']('Dialog'),{id:_0x234056,title:_0x3dc047,icon:_0x520ed3,class:_0x39e828,mainView:_0x35d172}=this['_currentConfig'];_0x35d172['delegate'](...Ea)['to'](this),_0x2c9531['show']({'title':_0x3dc047,'icon':_0x520ed3,'hasCloseButton':!0x0,'id':_0x234056,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x39e828||''),'content':_0x35d172,'onShow':_0x131b27=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x15cd44=this['_getSelectionElements']();_0x15cd44&&_0x15cd44[0x0]&&mt({'target':_0x15cd44[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x131b27['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x234056});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x234056}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x5b2d85,_0x5268dd){if(!_0x5268dd)return null;const _0x429bdb=this['_getSelectionElements']();if(!_0x429bdb||0x0===_0x429bdb['length'])return{'left':Math['round'](_0x5268dd['left']+_0x5268dd['width']/0x2-_0x5b2d85['width']/0x2),'top':Math['round'](_0x5268dd['top']+_0x5268dd['height']/0x2-_0x5b2d85['height']/0x2)};const _0x1814fe=Math['round'](_0x5268dd['left']+_0x5268dd['width']/0x2-_0x5b2d85['width']/0x2),_0xb930f3=_0x429bdb['map'](_0xd6a26b=>new ut(_0xd6a26b)),_0x347c67=_0x5b2d85['height'];return{'left':_0x1814fe,'top':this['_calculateOptimalTopPosition'](_0xb930f3,_0x347c67,_0x5268dd)};}['_calculateOptimalTopPosition'](_0x3bbd85,_0x5af9f2,_0x1f009a){const _0x357f1e=new ut(ct['window']),_0x48cb5c=_0x3bbd85['map'](_0x35bddc=>_0x35bddc['getVisible']())['filter'](_0x1b414c=>_0x1b414c),_0x530ef6=ut['getBoundingRect'](_0x48cb5c);if(!_0x530ef6)return Math['round'](_0x1f009a['top']+_0x1f009a['height']/0x2);const _0xb2341f=_0x357f1e['getIntersection'](_0x530ef6);if(!_0xb2341f)return Math['round'](_0x1f009a['top']+_0x1f009a['height']/0x2);const _0x21b819=_0x1f009a['getVisible'](),_0x2dc1ac=_0x21b819&&_0x530ef6['height']>_0x21b819['height'],_0x5da818=_0xb2341f['top'],_0xf1f137=_0xb2341f['bottom'];if(_0x2dc1ac){const _0x37cf1e=(_0x21b819||_0x357f1e)['height']/0x2-_0x5af9f2/0x2,_0x1ec57a=_0x5da818-pa-_0x1f009a['top'],_0x394320=_0x1f009a['bottom']-_0xf1f137-pa;return _0x1ec57a>=_0x5af9f2?Math['max'](pa,_0x5da818-_0x5af9f2-pa):_0x394320>=_0x5af9f2?_0xf1f137+pa:Math['max'](pa,_0x37cf1e);}const _0x4b69b5=_0x5da818-_0x5af9f2,_0x1bb30b=_0x1f009a['bottom']-_0xf1f137-pa,_0xf581ee=_0x5da818-pa-_0x1f009a['top'];let _0x43aced;if(_0x1bb30b>=_0x5af9f2)_0x43aced=_0xf1f137+pa;else{if(_0xf581ee>=_0x5af9f2)_0x43aced=_0x4b69b5-pa;else _0x43aced=_0x5da818+_0x530ef6['height']/0x2-_0x5af9f2/0x2;}return _0x43aced;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x536822=Fs(this['context']);this['listenTo'](_0x536822['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0xe8bf59,data:{newRange:_0x3d649f}}of _0x536822['model']['document']['differ']['getChangedMarkers']())if(_0xe8bf59['startsWith']($s+':')&&(_0x3d649f&&(_0x3d649f['start']['isEqual'](_0x3d649f['end'])||'$graveyard'==_0x3d649f['root']['rootName'])||null==_0x3d649f)){const _0x39d275=as(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x39d275),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0xbb66f7=Fs(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0xbb66f7['model']['document']);}['_getSelectionElements'](){const _0x140f8c=Fs(this['context']);return _0xfa1faa(_0x140f8c['editing'],[..._0x140f8c['model']['markers']['getMarkersGroup']('ai-selection'),..._0x140f8c['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class Ca extends Ot{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x4507cf,_0x2dfc96={}){super(_0x4507cf),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x2dfc96};const _0x3e9084=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x3e9084?'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'](_0x251f86){this['showChangesButton']['isEnabled']=_0x251f86;}['_setupRatingButtons'](){this['likeButton']=new kt(this['locale']),this['likeButton']['set']({'icon':_0x3476bd,'label':as(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'class':cs,'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new kt(this['locale']),this['dislikeButton']['set']({'icon':_0x203942,'label':as(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'class':cs,'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new kt(this['locale']),this['copyButton']['set']({'icon':_0x59cf80,'label':as(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button\x20'+cs,'tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x3c78e8=new yt();_0x3c78e8['set']({'content':_0x464c2a}),_0x3c78e8['extendTemplate']({'attributes':{'class':['ck-ai-mini-toolbar-copy-button__check-mark']}}),this['copyButton']['on']('execute',()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20ck-ai-mini-toolbar-copy-button_copied\x20'+cs,setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20'+cs;},0x7d0);}),this['copyButton']['children']['add'](_0x3c78e8);}['_setupShowChangesButton'](){this['showChangesButton']=new kt(this['locale']),this['showChangesButton']['set']({'icon':_0x375f54,'label':as(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':cs}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x5ea8d4=>_0x5ea8d4?_0x2c7f0b:_0x375f54),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class wa extends Ta{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x4d01fc,_0x525139){super(_0x4d01fc);const _0x523e88=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new _t(),this['_keystrokes']=new At(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x525139,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new un(_0x4d01fc),this['_partToolbarView']=new hn(_0x4d01fc,_0x525139['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x525139),this['_stateView']=new an(_0x4d01fc),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new Ca(_0x4d01fc,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new fa(_0x4d01fc,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x1d08b9,_0xd097ff,_0x52f0d,_0x39c7e8)=>{let _0x3e2026,_0x442806;'pending'===_0x39c7e8?(_0x3e2026=this['_partToolbarView'],_0x442806=this['_stateView']):(_0x3e2026=this['_stateView'],_0x442806=this['_partToolbarView']),this['_stateView']['setState'](_0x52f0d),_0x3e2026['isVisible']=!0x1,_0x442806['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x523e88['to']('_state',_0x1f0c8c=>'ck-ai-chat-balloon-main_state_'+_0x1f0c8c)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x525139);});}['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'](_0x429a31){_0x429a31?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x429a31);}['setState'](_0x250593){this['_state']=_0x250593;}['showError'](_0x35d845){super['showError'](_0x35d845),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x3c0844){super['showBlockingError'](_0x3c0844),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x175653){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x175653;}['togglePartToolbarEnabled'](_0x19ca3f){this['_partToolbarView']['isEnabled']=_0x19ca3f;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x515563,showSuggestButton:_0xb09fd6}){_0x515563=_0x515563&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0xb09fd6=_0xb09fd6&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x515563,'showSuggestButton':_0xb09fd6});}['_createNextButtonView'](){const _0x31f3cb=new kt(this['locale']);return _0x31f3cb['set']({'icon':_0x320d1d,'label':as(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x31f3cb['on']('execute',()=>{this['fire']('showNext');}),_0x31f3cb;}['_createPreviousButtonView'](){const _0x2cdbc3=new kt(this['locale']);return _0x2cdbc3['set']({'icon':_0x12423b,'label':as(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x2cdbc3['on']('execute',()=>{this['fire']('showPrevious');}),_0x2cdbc3;}}class fa extends Nt{constructor(_0x5a0a97,_0x132782){super(_0x5a0a97),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x132782});}}class Sa extends _0x43ff17{static get['requires'](){return[Vt,ma];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x192700){super(_0x192700),this['set']('showDiff',!0x1);}['open'](_0x1ba9e4){const _0x2090cb=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x2090cb['plugins']['get']('AIBalloon')['open']({..._0x1ba9e4,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x1ba9e4['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x1ba9e4['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x39c08a){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x39c08a);}['setState'](_0x49b383){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x49b383);}['_createChatBalloonView'](){const _0x3823d4=this['editor'],_0x3c2ebf=_0x3823d4['plugins']['get']('AIBalloon'),_0x4e8412=_0x3823d4['commands']['get']('trackChanges');let _0x4997df=_0x3823d4['config']['get']('ai.availableReplyActions')||[...gn];_0x3823d4['plugins']['has']('TrackChanges')||(_0x4997df=_0x4997df['filter'](_0x3f3605=>'insertSuggestion'!=_0x3f3605));const _0x3dc509=new wa(_0x3823d4['locale'],{'availableActions':_0x4997df,'showApplyButton':!0x0,'showSuggestButton':!!_0x4e8412});return _0x3dc509['bind']('showDiff')['to'](this),_0x3dc509['delegate'](...Qs)['to'](this),_0x3dc509['delegate']('showPrevious','showNext')['to'](this),_0x3c2ebf['delegate']('dialogClosed')['to'](this),_0x3dc509['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x3dc509['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x3dc509['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x4e8412&&_0x3dc509['bind']('isTrackChangesOn')['to'](_0x4e8412,'value'),_0x3dc509['render'](),_0x3dc509;}['_toggleRotatorButtonsInDialogHeader'](_0x4584a1){const _0x42d046=this['editor'],_0x5bd296=_0x42d046['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x4584a1),_0x5bd296['has'](this['_chatBalloonView']['previousButtonView'])||(_0x5bd296['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x42d046['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x5bd296['remove'](this['_chatBalloonView']['previousButtonView']),_0x5bd296['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class ba extends _0x43ff17{static get['requires'](){return[Ia,Sa,_0x3d3d21];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Ra(_0x14a8eb){const {editor:_0x3948b0,action:_0x1fd4ee,withText:_0xc69e99=!0x1,withIcon:_0x49665b=!0x0,isInDropdown:_0x55afcb=!0x0,shouldPreventFocus:_0x178e1b=!0x1}=_0x14a8eb;return()=>{const _0x428bb2=_0x3948b0['locale'],_0x239df9=new kt(_0x428bb2),_0x4df4ee=_0x239df9['bindTemplate'];_0x55afcb&&_0x239df9['extendTemplate']({'on':{'mouseenter':_0x4df4ee['to'](()=>{_0x178e1b&&_0x178e1b()||_0x239df9['focus']();})}});const _0x4321ee=_0x1fd4ee['icon']??_0x1fd4ee['parent']?.['icon'];return _0x239df9['set']({'label':_0x1fd4ee['label'],'withText':_0xc69e99,'role':'menuitem','icon':_0x49665b?_0x4321ee??_0x1161ca:void 0x0,'tooltip':!_0xc69e99,'class':'ck-ai-quick-actions-button','isEnabled':_0x1fd4ee['isEnabled']}),_0x239df9['on']('execute',()=>{_0x3948b0['editing']['view']['focus'](),_0x3948b0['commands']['execute']('aiQuickAction',_0x1fd4ee);}),_0x239df9;};}class Oa extends _0x356921{['arrowView'];constructor(_0x1854ce,_0x5d37ca){super(_0x1854ce,_0x5d37ca);const _0x4cb1ef=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',_0x424450=>String(_0x424450)),'data-cke-tooltip-disabled':_0x4cb1ef['to']('isOn')},'on':{'mouseenter':_0x4cb1ef['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x4525c9=new yt();return _0x4525c9['content']=_0x38dbb6,_0x4525c9['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x4525c9;}}class ka extends Lt{['_allListItems'];['_allSearchableItems'];constructor(_0xde4319,_0xc23668,_0x23b523){super(_0xde4319),this['_allListItems']=_0xc23668,this['_allSearchableItems']=_0x23b523;}['filter'](_0x1aaae0){if(!_0x1aaae0)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x5573a0=_0x1aaae0['source']['toLowerCase']()['trim'](),_0x137702=this['_allSearchableItems']['filter'](_0x4169c7=>(_0x4169c7['groupLabel']?_0x4169c7['label']+'\x20('+_0x4169c7['groupLabel']+')':_0x4169c7['label'])['toLowerCase']()['includes'](_0x5573a0));return this['items']['clear'](),this['items']['addMany'](_0x137702['sort']((_0xf15d29,_0x1868f3)=>{const _0x12eb64=_0xf15d29['groupLabel'],_0xb8812f=_0x1868f3['groupLabel'];return _0x12eb64||_0xb8812f?_0x12eb64?0x1:-0x1:0x0;})['map'](_0x52c1e9=>_0x52c1e9['item'])),this['_highlightQuery'](_0x5573a0,_0x137702),{'resultsCount':_0x137702['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x5a9b3b,_0x2a2766){if(!_0x5a9b3b)return;const _0x3290fc=new RegExp(_0x474e41(_0x5a9b3b),'gi');_0x2a2766['forEach'](_0x2fd95b=>{_0x2fd95b['highlightViews']&&_0x2fd95b['highlightViews']['forEach'](_0x41569d=>{'function'==typeof _0x41569d['highlightText']&&_0x41569d['highlightText'](_0x3290fc);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x561df1=>{_0x561df1['highlightViews']&&_0x561df1['highlightViews']['forEach'](_0x264714=>{'function'==typeof _0x264714['highlightText']&&_0x264714['highlightText'](null);});});}}const Na='menu',va='menuitem';class ya extends Nt{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x153922,_0x41f2f6,_0x43a38e,_0x20f85e,_0x4afa01=!0x1){const _0x19efa3=_0x153922['locale'];super(_0x19efa3),this['_bodyCollection']=_0x20f85e,this['_hasSearch']=_0x4afa01;const _0x3e4f0a=this['_createListItems'](_0x153922,_0x41f2f6,_0x43a38e);this['optionsListView']=new ka(_0x19efa3,_0x3e4f0a,this['_allSearchableItems']),this['optionsListView']['role']=Na,this['optionsListView']['items']['addMany'](_0x3e4f0a),this['focusTracker']=new _t(),this['keystrokes']=new At(),_0x4afa01&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x3e4f0a,this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x4afa01&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x2b63c3=_0x4afa01&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x192828(_0x2b63c3),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x19efa3['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x337eea(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':as(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':as(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x4a98cc=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x4a98cc);}['_createListItems'](_0x697635,_0x480c12,_0x419fb0){const _0xeeef7=new _0x192828();return _0x480c12['forEach'](_0xee0aa4=>{if('actions'in _0xee0aa4){const {listItem:_0xa90331}=this['_createActionGroupButton'](_0x697635,_0xee0aa4,_0x419fb0);_0xeeef7['add'](_0xa90331),_0xee0aa4['actions']['forEach'](_0x2620fe=>{this['_createActionButton'](_0x697635,_0x2620fe,_0xee0aa4['label'],_0xee0aa4['icon']);const {listItem:_0x62276c,highlightViews:_0x50ecb9}=this['_createSearchResultActionButton'](_0x697635,_0x2620fe,_0xee0aa4['label'],_0xee0aa4['icon']);this['_allSearchableItems']['push']({'item':_0x62276c,'label':_0x2620fe['label'],'groupLabel':_0xee0aa4['label'],'highlightViews':_0x50ecb9});});}else{const {listItem:_0xd61823}=this['_createActionButton'](_0x697635,_0xee0aa4);_0xeeef7['add'](_0xd61823);const _0x43b1be=_0xd61823['children']['first'];if(_0x43b1be){const {listItem:_0x350dcb,highlightViews:_0x3c1c86}=this['_createSearchResultActionButton'](_0x697635,_0xee0aa4);this['_allSearchableItems']['push']({'item':_0x350dcb,'label':_0x43b1be['label']||'','highlightViews':_0x3c1c86});}}}),_0xeeef7;}['_createActionButton'](_0x410f96,_0x1fb986,_0x406668,_0xed04f2){const _0x46f5fb=new Pt(this['locale']);if(_0x406668&&_0xed04f2){const _0x4c868d=new kt(this['locale']),_0xb168ff=_0x4c868d['bindTemplate'],_0x41b061=new _0x387701();_0x41b061['text']=_0x1fb986['label'];const _0x5df38c=new _0x387701();_0x5df38c['text']=_0x406668;const _0x5159ec=new yt();_0x5159ec['content']=_0xed04f2,_0x5159ec['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x299adc=new Nt(this['locale']);_0x299adc['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x47c28f=new Nt(this['locale']);return _0x47c28f['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x4c868d['set']({'label':_0x1fb986['label']+'\x20('+_0x406668+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x4c868d['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':[_0x41b061,_0x299adc,_0x5159ec,_0x5df38c,_0x47c28f],'on':{'mouseenter':_0xb168ff['to'](()=>{this['_isSearchFocused']()||_0x4c868d['focus']();}),'click':_0xb168ff['to'](()=>{_0x4c868d['fire']('execute');})}}),_0x4c868d['on']('execute',()=>{_0x410f96['editing']['view']['focus'](),_0x410f96['commands']['execute']('aiQuickAction',_0x1fb986);}),_0x46f5fb['children']['add'](_0x4c868d),{'listItem':_0x46f5fb,'highlightViews':[_0x41b061,_0x5df38c]};}{const _0x34ac88=new _0x3a0961(),_0x1d6e7b=new kt(this['locale'],_0x34ac88),_0x1e4217=_0x1d6e7b['bindTemplate'],_0x3f9786=_0x1fb986['icon']??_0x1fb986['parent']?.['icon'],_0x5aa0b0=void 0x0!==_0x1fb986['icon'];return _0x1d6e7b['set']({'label':_0x1fb986['label'],'withText':!0x0,'role':'menuitem','icon':_0x5aa0b0?_0x3f9786??_0x1161ca:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x1d6e7b['extendTemplate']({'on':{'mouseenter':_0x1e4217['to'](()=>{this['_isSearchFocused']()||_0x1d6e7b['focus']();})}}),_0x1d6e7b['on']('execute',()=>{_0x410f96['editing']['view']['focus'](),_0x410f96['commands']['execute']('aiQuickAction',_0x1fb986);}),_0x46f5fb['children']['add'](_0x1d6e7b),{'listItem':_0x46f5fb,'highlightViews':[_0x34ac88]};}}['_createSearchResultActionButton'](_0x43a7f1,_0x345d0b,_0x19cc4b,_0x5d0add){return _0x19cc4b&&_0x5d0add?this['_createSearchResultGroupedActionButton'](_0x43a7f1,_0x345d0b,_0x19cc4b,_0x5d0add):this['_createSearchResultIndividualActionButton'](_0x43a7f1,_0x345d0b);}['_createSearchResultGroupedActionButton'](_0x58711c,_0x414aa8,_0x298ff8,_0x2631eb){const _0x57260b=new Pt(this['locale']),_0x3adc24=new kt(this['locale']),_0x57eac4=_0x3adc24['bindTemplate'],{view:_0x34ae7f,highlightView:_0x575cff}=this['_createSearchResultGroupRow'](_0x298ff8,_0x2631eb),{view:_0xf589ff,highlightView:_0x2a844f}=this['_createSearchResultActionRow'](_0x414aa8['label']),_0x281c7b=this['_createSearchResultContentView'](_0x34ae7f,_0xf589ff);return _0x3adc24['set']({'label':_0x414aa8['label'],'withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button\x20ck-ai-quick-actions-search-result-button_with-group','tooltip':!0x1}),_0x3adc24['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':[_0x281c7b],'on':{'mouseenter':_0x57eac4['to'](()=>{this['_isSearchFocused']()||_0x3adc24['focus']();}),'click':_0x57eac4['to'](()=>{this['_handleSearchResultButtonClick'](_0x3adc24);})}}),this['_setupActionButtonExecution'](_0x3adc24,_0x58711c,_0x414aa8),_0x57260b['children']['add'](_0x3adc24),{'listItem':_0x57260b,'highlightViews':[_0x575cff,_0x2a844f]};}['_createSearchResultIndividualActionButton'](_0xe0fa7d,_0x5e8575){const _0x21e7f4=new Pt(this['locale']),_0x1874fb=new _0x3a0961(),_0x20f2fb=new kt(this['locale'],_0x1874fb),_0xa8ccf2=_0x20f2fb['bindTemplate'];return _0x20f2fb['set']({'label':_0x5e8575['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x20f2fb['extendTemplate']({'on':{'mouseenter':_0xa8ccf2['to'](()=>{this['_isSearchFocused']()||_0x20f2fb['focus']();})}}),this['_setupActionButtonExecution'](_0x20f2fb,_0xe0fa7d,_0x5e8575),_0x21e7f4['children']['add'](_0x20f2fb),{'listItem':_0x21e7f4,'highlightViews':[_0x1874fb]};}['_createSearchResultGroupRow'](_0x375d83,_0x255af3){const _0x53a0cb=new Nt(this['locale']),_0xe540e3=new yt();_0xe540e3['content']=_0x255af3,_0xe540e3['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x172e19=new _0x387701();return _0x172e19['text']=_0x375d83,_0x53a0cb['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0xe540e3,_0x172e19]}),{'view':_0x53a0cb,'highlightView':_0x172e19};}['_createSearchResultActionRow'](_0x5b30ee){const _0x535f2b=new Nt(this['locale']),_0x520bb9=new _0x387701();return _0x520bb9['text']=_0x5b30ee,_0x535f2b['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x520bb9]}),{'view':_0x535f2b,'highlightView':_0x520bb9};}['_createSearchResultContentView'](_0x42d9db,_0x103f2f){const _0x2ac6e4=new Nt(this['locale']);return _0x2ac6e4['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x42d9db,_0x103f2f]}),_0x2ac6e4;}['_setupActionButtonExecution'](_0x2de669,_0x5a9fa4,_0x3138a2){_0x2de669['on']('execute',()=>{_0x5a9fa4['editing']['view']['focus'](),_0x5a9fa4['commands']['execute']('aiQuickAction',_0x3138a2);});}['_createActionGroupButton'](_0x14ab24,_0x575113,_0x136e18){const _0x53ef9d=new Pt(this['locale']),_0x67db63=new _0x3a0961(),_0x31563b=new Oa(this['locale'],_0x67db63),_0x2a4fca=_0x31563b['bindTemplate'],_0x102041=this['_getPanelKeystroke'](_0x136e18),_0x31183d=this['_createGroupActionsList'](_0x14ab24,_0x575113['actions'],_0x136e18);_0x31563b['set']({'label':_0x575113['label'],'withText':!0x0,'role':va,'icon':_0x575113['icon']??_0x1161ca,'isEnabled':_0x575113['actions']['some'](_0x15ef6e=>_0x15ef6e['isEnabled'])}),_0x31563b['extendTemplate']({'on':{'mouseenter':_0x2a4fca['to'](()=>{this['_isSearchFocused']()||_0x31563b['focus']();})}});const _0x513070=new Qt(this['locale']);return _0x513070['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x2a4fca['to'](_0x5c45b4=>{this['_handlePanelKeydown'](_0x5c45b4,_0x102041,_0x31563b,_0x513070);})}}),_0x31563b['bind']('isOn')['to'](_0x513070,'isVisible'),this['_bodyCollection']['add'](_0x513070),_0x513070['content']['add'](_0x31183d),this['_setupGroupMenuBehavior'](_0x31563b,_0x513070),_0x53ef9d['children']['add'](_0x31563b),{'listItem':_0x53ef9d,'highlightView':_0x67db63};}['_createGroupActionsList'](_0x4e66e4,_0x108a8a,_0x483728){const _0x519852=new Lt(this['locale']);return _0x519852['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x108a8a['forEach'](_0x262ec2=>{const _0x3a95f5=new Pt(this['locale']),_0x5046=Ra({'editor':_0x4e66e4,'action':_0x262ec2,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x3a95f5['children']['add'](_0x5046),_0x483728['focusTracker']['add'](_0x5046),_0x519852['items']['add'](_0x3a95f5);}),_0x519852;}['_setupGroupMenuBehavior'](_0x232fe3,_0x52dd16){const _0x1fef96=_0x232fe3['bindTemplate'],_0xbf49f1=this['_getButtonKeystroke'](_0x232fe3);_0x232fe3['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x1fef96['to'](()=>{this['_showNestedPanel'](_0x52dd16,_0x232fe3);}),'mouseleave':_0x1fef96['to'](_0x19ecc2=>{const _0x3e6a1e=_0x19ecc2['relatedTarget'];this['_isMovingToNestedMenu'](_0x3e6a1e,_0x52dd16)||this['_hideNestedPanel'](_0x52dd16);}),'keydown':_0x1fef96['to'](_0x786019=>{_0x786019['key']==_0xbf49f1&&(this['_showNestedPanel'](_0x52dd16,_0x232fe3),_0x52dd16['content']['get'](0x0)['focus']());})}}),_0x52dd16['on']('render',()=>{_0x52dd16['element']?.['addEventListener']('mouseleave',_0x2636ba=>{const _0x43826b=_0x2636ba['relatedTarget'];_0x232fe3['element']?.['contains'](_0x43826b)||this['_isMovingToNestedMenu'](_0x43826b,_0x52dd16)||this['_hideNestedPanel'](_0x52dd16);});});}['_showNestedPanel'](_0x2e3eec,_0x753724){this['_openNestedPanels']['forEach'](_0x4b528c=>{_0x4b528c!==_0x2e3eec&&_0x4b528c['isVisible']&&_0x4b528c['hide']();}),_0x2e3eec['show'](),_0x2e3eec['pin']({'positions':[_0x511df3['eastSouth']],'target':_0x753724['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x2e3eec);}['_hideNestedPanel'](_0x995b56){_0x995b56['hide'](),this['_openNestedPanels']['delete'](_0x995b56);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x1576d9=>_0x1576d9['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x599772,_0x503b1e){if(!_0x599772)return!0x1;if(_0x503b1e['element']?.['contains'](_0x599772))return!0x0;const _0x1f3b2c=_0x599772;return _0x1f3b2c['closest']&&(null!==_0x1f3b2c['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x1f3b2c['closest']('.ck-ai-quick-actions-group-list')||null!==_0x1f3b2c['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'](_0x4d056c){return'rtl'===_0x4d056c['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x5c89a5){return'rtl'===_0x5c89a5['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x76bd89,_0x44c8de,_0x3320ac,_0x4731eb){_0x76bd89['key']==_0x44c8de&&(_0x3320ac['focus'](),this['_hideNestedPanel'](_0x4731eb));}['_handleSearchResultButtonClick'](_0x5cc92d){_0x5cc92d['fire']('execute');}}function xa(_0x93c772){const {editor:_0x2a4d36,content:_0x297fb1,buttonDefinition:_0x582075,bodyCollection:_0x2655c7,hasSearch:_0x3d0cb8=!0x1}=_0x93c772;return()=>{const _0x23ecdc=_0x2a4d36['locale'],_0x2c98d7=Bt(_0x23ecdc);_0x2c98d7['buttonView']['set']({'icon':_0x582075['icon']??_0x1161ca,'label':_0x582075['label'],'tooltip':!0x0}),_0x2c98d7['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x12ce81=new ya(_0x2a4d36,_0x297fb1,_0x2c98d7,_0x2655c7,_0x3d0cb8);return _0x2c98d7['panelView']['children']['add'](_0x12ce81),_0x3d0cb8&&_0x2c98d7['on']('change:isOpen',(_0x4fbadb,_0x355561,_0x59721a)=>{if(_0x59721a){if(_0x2a4d36['plugins']['has']('AIEditing')){const _0x43a362=_0x2a4d36['plugins']['get'](qs),_0xdedfdd=_0x2a4d36['model']['document']['selection'],_0x120928=Array['from'](_0xdedfdd['getRanges']());_0x120928['length']>0x0&&_0x43a362['showFakeVisualSelection']({'ranges':_0x120928,'id':'quick-action','priority':0x14});}}else _0x2a4d36['plugins']['has']('AIEditing')&&_0x2a4d36['plugins']['get'](qs)['hideFakeVisualSelection']('quick-action'),_0x12ce81['resetSearch']();}),_0x2c98d7;};}const La='<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>',Da='<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>',Pa='<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>',Ha=/* #__PURE__ -- @preserve */
28
+ ((()=>({'chat':'AIChat','action':'AIActions'}))());class Ma extends _0x43ff17{static get['requires'](){return[_0x16d5e0,rs];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x10508d=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x10508d),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x47ec26){return function(_0x5a2368){const _0x2f352b=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x5a2368['uiLanguage']),_0xec598d=_0x2f352b||'English',_0x131bd0=[{'id':'ask-ai','label':as(_0x5a2368,'AI_QUICK_ACTIONS_ASK_AI'),'type':'chat','icon':_0x5e9b2c},{'id':'chat-commands','label':as(_0x5a2368,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0x5e9b2c,'actions':[{'id':'explain','label':as(_0x5a2368,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':as(_0x5a2368,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':La['replace']('%0',_0xec598d),'type':'chat'},{'id':'summarize','label':as(_0x5a2368,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':as(_0x5a2368,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Da['replace']('%0',_0xec598d),'type':'chat'},{'id':'highlight-key-points','label':as(_0x5a2368,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':as(_0x5a2368,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Pa['replace']('%0',_0xec598d),'type':'chat'}]},{'id':'improve-writing','label':as(_0x5a2368,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'action','icon':_0x398c1e},{'id':'continue','label':as(_0x5a2368,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'action','icon':_0x102de9},{'id':'fix-grammar','label':as(_0x5a2368,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'action','icon':_0x1c0d0e},{'id':'adjust-length','label':as(_0x5a2368,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x139570,'actions':[{'id':'make-shorter','label':as(_0x5a2368,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'action'},{'id':'make-longer','label':as(_0x5a2368,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'action'}]},{'id':'change-tone','label':as(_0x5a2368,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x51a8af,'actions':[{'id':'make-tone-casual','label':as(_0x5a2368,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'action'},{'id':'make-tone-direct','label':as(_0x5a2368,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'action'},{'id':'make-tone-friendly','label':as(_0x5a2368,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'action'},{'id':'make-tone-confident','label':as(_0x5a2368,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'action'},{'id':'make-tone-professional','label':as(_0x5a2368,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'action'}]},{'id':'translate','label':as(_0x5a2368,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x2c155e,'actions':[{'id':'translate-to-english','label':as(_0x5a2368,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'action','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':as(_0x5a2368,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'action','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':as(_0x5a2368,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'action','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':as(_0x5a2368,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'action','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':as(_0x5a2368,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'action','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':as(_0x5a2368,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'action','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':as(_0x5a2368,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'action','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':as(_0x5a2368,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'action','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':as(_0x5a2368,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'action','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':as(_0x5a2368,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'action','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':as(_0x5a2368,'AI_QUICK_ACTIONS_OTHER'),'icon':_0x405cab,'actions':[]}];return _0x131bd0;}(_0x47ec26);}async['_getDefaultAndCustomActions'](){const _0x4403d6=Ma['getDefaultQuickActions'](this['editor']['locale']),_0x2420de=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x43729d=[];try{_0x43729d=await new Bs({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0x3d5c6b){const _0xffc549=new ot('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x3d5c6b});Et(_0xffc549['message']);}finally{const _0x347317=_0x2420de['map'](_0x52b4ba=>({..._0x52b4ba,'type':'chat'===_0x52b4ba['type']?'chat':'action','icon':void 0x0}));_0x4403d6['find'](_0x1c4c04=>'other'===_0x1c4c04['id'])['actions']['push'](..._0x347317),_0x4403d6['forEach'](_0x2297c4=>{if('actions'in _0x2297c4)_0x2297c4['actions']['forEach'](_0x107c2e=>{if(_0x107c2e['isEnabled']=!!_0x43729d['find'](_0x302fa7=>_0x302fa7['id']===_0x107c2e['model'])||void 0x0===_0x107c2e['model'],!_0x107c2e['isEnabled']){const _0x15d34e=new ot('ai-quick-actions-unavailable-model',this,{'actionId':_0x107c2e['id'],'modelId':_0x107c2e['model']});Et(_0x15d34e['message']);}});else{if(_0x2297c4['isEnabled']=!!_0x43729d['find'](_0x3a7537=>_0x3a7537['id']===_0x2297c4['model'])||void 0x0===_0x2297c4['model'],!_0x2297c4['isEnabled']){const _0x14c2dd=new ot('ai-quick-actions-unavailable-model',this,{'actionId':_0x2297c4['id'],'modelId':_0x2297c4['model']});Et(_0x14c2dd['message']);}}});}return _0x4403d6;}['_initializeQuickActionsComponentsAndCommands'](){const _0x968510=new qt(this['editor']['locale']);_0x968510['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x968510),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x968510);}['_initializeQuickActionsDropdown'](_0x2aa0a0){const _0x56afd7=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',xa({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x1161ca,'label':as(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x2aa0a0,'hasSearch':_0x56afd7}));}['_prepareQuickActionsDefinition'](_0x3b207e){this['_quickActionsDefinition']=_0x3b207e['map'](_0x46382d=>{if('actions'in _0x46382d){const _0x20df7f=_0x46382d;return{..._0x20df7f,'actions':_0x20df7f['actions']['map'](_0x52c937=>{const {actions:_0x3fad09,..._0x3d6ad1}=_0x20df7f;return{..._0x52c937,'parent':_0x3d6ad1};})['filter'](_0x1961db=>this['_shouldIncludeAction'](_0x1961db))};}return _0x46382d;})['filter'](_0x9c892e=>'actions'in _0x9c892e?_0x9c892e['actions']['length']>0x0:this['_shouldIncludeAction'](_0x9c892e));}['_shouldIncludeAction'](_0x5661b5){const _0x54de46=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ha[_0x5661b5['type']])&&!_0x54de46['includes'](_0x5661b5['id'])&&!('chat'===_0x5661b5['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x50a5fd){this['_quickActionsDefinition']['forEach'](_0x5d71d5=>{if('actions'in _0x5d71d5){const _0x2d9488=xa({'editor':this['editor'],'content':_0x5d71d5['actions'],'buttonDefinition':_0x5d71d5,'bodyCollection':_0x50a5fd});this['editor']['ui']['componentFactory']['add'](_0x5d71d5['id'],_0x2d9488),_0x5d71d5['actions']['forEach'](_0x316569=>{const _0x3dbf49=Ra({'editor':this['editor'],'action':_0x316569});this['editor']['ui']['componentFactory']['add'](_0x316569['id'],_0x3dbf49);});}else{const _0x564a76=Ra({'editor':this['editor'],'action':_0x5d71d5,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x5d71d5['id'],_0x564a76);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x32247c=>{const _0x228c39=new Ft(_0x32247c),_0xe10d9b=as(_0x32247c,'AI_QUICK_ACTIONS_HEADING');_0x228c39['buttonView']['set']({'label':_0xe10d9b,'icon':_0x1161ca});const _0x23c099=new Yt(_0x32247c);_0x23c099['set']({'ariaLabel':_0xe10d9b,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x83eb92=>{if('actions'in _0x83eb92){const _0x200c18=_0x83eb92,_0x4efcae=new $t(_0x32247c,_0x228c39),_0x497787=new Ft(_0x32247c),_0x34af15=new Yt(_0x32247c);_0x497787['buttonView']['set']({'label':_0x200c18['label'],'icon':_0x200c18['icon']}),_0x200c18['actions']['forEach'](_0x361141=>{const _0x2ffa8a=new $t(_0x32247c,_0x497787),_0x2f96f6=new Kt(_0x32247c);_0x2f96f6['set']({'label':_0x361141['label'],'icon':_0x361141['icon'],'role':'menuitem','isEnabled':_0x361141['isEnabled']}),_0x2f96f6['on']('execute',()=>{this['_executeQuickAction'](_0x361141);}),_0x2f96f6['delegate']('execute')['to'](_0x497787),_0x2ffa8a['children']['add'](_0x2f96f6),_0x34af15['items']['add'](_0x2ffa8a);}),_0x497787['panelView']['children']['add'](_0x34af15),_0x4efcae['children']['add'](_0x497787),_0x23c099['items']['add'](_0x4efcae);}else{const _0x3d90b0=_0x83eb92,_0x263601=new $t(_0x32247c,_0x228c39),_0x38591b=new Kt(_0x32247c);_0x38591b['set']({'label':_0x3d90b0['label'],'icon':_0x3d90b0['icon'],'role':'menuitem','isEnabled':_0x3d90b0['isEnabled']}),_0x38591b['on']('execute',()=>{this['_executeQuickAction'](_0x3d90b0);}),_0x38591b['delegate']('execute')['to'](_0x228c39),_0x263601['children']['add'](_0x38591b),_0x23c099['items']['add'](_0x263601);}});const _0x560f4a=Object['values'](Ha)['some'](_0x263a20=>this['editor']['plugins']['has'](_0x263a20));return _0x228c39['set']({'isEnabled':_0x560f4a}),_0x228c39['panelView']['children']['add'](_0x23c099),_0x228c39;});}['_executeQuickAction'](_0x38e282){const _0x157eb3=this['editor'];_0x157eb3['editing']['view']['focus'](),_0x157eb3['commands']['execute']('aiQuickAction',_0x38e282);const _0x2497fe=_0x157eb3['ui']['view']['menuBarView'];_0x2497fe&&_0x2497fe['close']&&_0x2497fe['close']();}}class Ua extends _0x2228a8{['execute'](_0x294060){switch(this['_expandSelectionIfCollapsed'](),_0x294060['type']){case'chat':if(!this['editor']['plugins']['has']('AIChat')){const _0x886f68=as(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new ot('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x886f68});}this['_handleAIChatAction'](_0x294060);break;case'action':if(!this['editor']['plugins']['has']('AIActions')){const _0x5b6ada=as(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new ot('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5b6ada});}this['_handleAIActionsAction'](_0x294060);}}async['_handleAIChatAction'](_0xdc41d5){const _0x75b3a=this['editor']['plugins']['get']('AIChatController'),_0x25bfaf=this['editor']['plugins']['get']('AITabs')['view'];if(_0x25bfaf['isVisible']||(_0x25bfaf['isVisible']=!0x0),'chat'!==_0x25bfaf['activeTab']&&_0x25bfaf['activateTab']('chat'),'ask-ai'===_0xdc41d5['id'])_0x75b3a['removeSelectionFromChatContext'](),_0x75b3a['addSelectionToChatContext'](),_0x75b3a['focusPromptInput']();else await _0x75b3a['startConversation'](),_0x75b3a['removeSelectionFromChatContext'](),_0x75b3a['addSelectionToChatContext'](),_0x75b3a['focusPromptInput'](),await _0x75b3a['sendMessage']({'message':_0xdc41d5['prompt']||_0xdc41d5['displayedPrompt']||_0xdc41d5['label'],'attributes':{'quickActionData':{'id':_0xdc41d5['id']},'displayedPrompt':_0xdc41d5['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x3f5b00=this['editor'],_0x11ad69=_0x3f5b00['model']['document']['selection'];if(!_0x11ad69['isCollapsed'])return;const _0x49cf54=gt(_0x11ad69['getSelectedBlocks']())||_0x3f5b00['model']['schema']['getLimitElement'](_0x11ad69);_0x3f5b00['model']['change'](_0x33f8e1=>{_0x33f8e1['setSelection'](_0x49cf54,'in');});}['_handleAIActionsActionLabel'](_0x1941f1){return _0x1941f1['parent']?.['label']&&'other'!==_0x1941f1['parent']?.['id']?_0x1941f1['parent']['label']+':\x20'+_0x1941f1['label']:_0x1941f1['label'];}async['_handleAIActionsAction'](_0xadc4d1){const _0x47a000=this['editor']['plugins']['get']('AIActions'),_0x51f88c=_0xadc4d1['prompt']?{'userMessage':_0xadc4d1['prompt'],'model':_0xadc4d1['model']}:{'actionName':_0xadc4d1['actionName']||_0xadc4d1['id'],'args':_0xadc4d1['args']},_0x307676=this['_handleAIActionsActionLabel'](_0xadc4d1);await _0x47a000['executeAction'](_0x51f88c,_0x307676,_0xadc4d1['icon']);}}class Va extends _0x43ff17{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x4c26a5=this['editor'],_0x333d91=new Ua(this['editor']);if(_0x4c26a5['commands']['add']('aiQuickAction',_0x333d91),_0x4c26a5['plugins']['has']('AIChat')){const _0x5b5307=this['editor']['plugins']['get']('AIChatController');_0x4c26a5['model']['document']['selection']['on']('change:range',(_0x118d5d,_0x2ffecc)=>{_0x2ffecc['directChange']&&_0x5b5307['removeSelectionFromChatContext']();});}}}class Ba extends vs{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x2d213c=this['documentContextContent']['children']['map'](_0x16552f=>({'node':_0x16552f,'id':gs(_0x16552f,'data-id')})),_0x5bc10d=this['parsedMergedContent']['children']['map'](_0x698f65=>({'node':_0x698f65,'id':gs(_0x698f65,'data-id')||at()})),_0x544fc8=_0x53b741(_0x2d213c,_0x5bc10d,{'comparator':(_0x1491f8,_0x1b4352)=>_0x1491f8['id']==_0x1b4352['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x544fc8['length']&&_0x544fc8[_0x544fc8['length']-0x1]['removed'];)_0x544fc8['pop']();}const _0x59ea9e=_0x544fc8['map'](_0x2b1268=>{const _0x1e8541=_0x2b1268['added']?'new':_0x2b1268['removed']?'removed':'modified';return{'node':_0x2b1268['value'][0x0]['node'],'type':_0x1e8541,'id':_0x2b1268['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x59ea9e,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x53f6b6,_0x110175){return _0x110175;}}class Ga extends xs{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;['stoppedExplicitly']=!0x1;constructor(_0x49a390){super(_0x49a390),this['content']=_0x49a390['content'],this['version']=_0x49a390['version'],this['actionName']=_0x49a390['actionName'],this['args']=_0x49a390['args'],this['userMessage']=_0x49a390['userMessage'],this['model']=_0x49a390['model'],this['on']('interactionStopped',()=>{this['stoppedExplicitly']=!0x0;});}async['sendRequest'](){return this['actionName']?this['connector']['executeAction']({'content':this['content'],'actionName':this['actionName'],'args':this['args']}):this['connector']['executeCustomAction']({'content':this['content'],'message':this['userMessage'],'model':this['model'],'outputFormat':'html'});}['getDocumentContext'](){return{'type':'text','content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x167738){const _0x53e3d2=new Ba({'editor':this['editor'],'documentContextContent':this['content'],..._0x167738});return this['replies']['push'](_0x53e3d2),_0x53e3d2['delegate'](...ys)['to'](this),this['fire']('replyCreated',_0x53e3d2),_0x53e3d2;}}class Fa extends Ot{constructor(_0x337b85,_0x4b1c8c=!0x0,_0xa65904=!0x0){super(_0x337b85),this['set']('isEnabled',!0x1),_0x4b1c8c&&(this['applyButton']=this['_createButton'](as(_0x337b85,'AI_BALLOON_APPLY_BUTTON'),os),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0xa65904&&(this['suggestButton']=this['_createButton'](as(_0x337b85,'AI_BALLOON_SUGGEST_BUTTON'),_0x4b1c8c?hs:os),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x4b1c8c,'showSuggestButton':_0xa65904}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0xa31ea,showSuggestButton:_0x3ac450}){this['applyButton']&&(this['applyButton']['isVisible']=_0xa31ea),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x3ac450);}['_createButton'](_0x30f1b9,_0x5282bc){const _0x41ab07=new kt(this['locale']);return _0x41ab07['set']({'label':_0x30f1b9,'class':_0x5282bc,'isVisible':!0x0,'withText':!0x0}),_0x41ab07;}}class Ka extends Nt{constructor(_0x3c95b3){super(_0x3c95b3),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':as(_0x3c95b3,'AI_DISCLAIMER_TEXT')}]}]});}}class Wa extends Nt{constructor(_0x563d58){super(_0x563d58),this['set']('isVisible',!0x0);const _0x33d318=new fn('small');_0x33d318['isVisible']=!0x0;const _0x581b1e=new Nt(this['locale']);_0x581b1e['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[as(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x1a1af3=>!_0x1a1af3)]},'children':[_0x33d318,_0x581b1e]});}}class Ya extends Ta{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x1367d8,_0x14a734){super(_0x1367d8),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x14a734,this['_focusTracker']=new _t(),this['_keystrokes']=new At(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x192828(),this['_addContentWrapper'](_0x14a734),this['_addDisclaimerView'](),this['_addToolbar'](_0x14a734),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'](_0x14a734);});}['render'](){super['render']();for(const _0x5a1c18 of this['_focusables'])this['_focusTracker']['add'](_0x5a1c18['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x30fc76){-0x1===_0x30fc76?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x2dcabe){this['_isLoading']=_0x2dcabe;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x347049){super['showError'](_0x347049),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x493104){super['showBlockingError'](_0x493104),this['setErrorState']();}['addMiniToolbarItem'](_0x1cbf6d){this['_miniToolbarView']['items']['has'](_0x1cbf6d)||this['_miniToolbarView']['items']['add'](_0x1cbf6d);}['removeMiniToolbarItem'](_0x5241bf){this['_miniToolbarView']['items']['has'](_0x5241bf)&&this['_miniToolbarView']['items']['remove'](_0x5241bf);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x29dced,showSuggestButton:_0x5e0bda}){_0x29dced=_0x29dced&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x5e0bda=_0x5e0bda&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x29dced,'showSuggestButton':_0x5e0bda});}async['updateContent'](_0x1560e6){await this['_streamableContentView']['update'](_0x1560e6);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x390fa5){this['_contentWrapper']=new Nt(this['locale']),this['_contentWrapper']['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content-wrapper']},'children':[this['_createLoaderView'](),this['_createStreamableContentView']()]},this['_createMiniToolbar'](_0x390fa5['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new Ka(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x353292,showSuggestButton:_0x3fe0cf}){this['_toolbarView']=new Fa(this['locale'],_0x353292,_0x3fe0cf),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',(_0x422269,_0x133c97,_0x357504)=>!(_0x422269||_0x133c97||_0x357504)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x353292,'showSuggestButton':_0x3fe0cf}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x1942ed){return this['_miniToolbarView']=new Ca(this['locale'],_0x1942ed),this['_miniToolbarView']['delegate'](...Qs)['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',(_0x123803,_0x446182)=>!(_0x123803||_0x446182)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new Wa(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new un(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x43b072=new kt(this['locale']),_0x2ba8cb=new kt(this['locale']),_0x16fd09=new $a(this['locale']),_0x4cb861=new kt(this['locale']);_0x43b072['set']({'icon':tt,'label':as(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+cs}),_0x2ba8cb['set']({'icon':_0x4a9e46,'tooltip':as(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+cs}),_0x4cb861['set']({'icon':et,'tooltip':as(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+cs}),_0x43b072['bind']('isEnabled')['to'](this,'isBusy',_0x21c5ee=>!_0x21c5ee),_0x43b072['on']('execute',()=>{this['fire']('tryAgain');}),_0x2ba8cb['bind']('isEnabled')['to'](this,'isBusy',_0x45004f=>!_0x45004f),_0x2ba8cb['on']('execute',()=>{this['fire']('showPrevious');}),_0x4cb861['bind']('isEnabled')['to'](this,'isBusy',_0x139a3b=>!_0x139a3b),_0x4cb861['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x2ba8cb,this['_navigationCounter']=_0x16fd09,this['_navigationNextButton']=_0x4cb861,this['_navigationTryAgainButton']=_0x43b072;}['updateMiniToolbarButtons'](_0x1b8626,_0x18f000){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x33127c=_0x1b8626>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x33127c){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x57ca01=_0x1b8626-_0x18f000;this['_navigationCounter']['setInteractionCount'](_0x57ca01+'/'+_0x1b8626),this['_navigationPreviousButton']['isEnabled']=_0x18f000<_0x1b8626-0x1,this['_navigationNextButton']['isEnabled']=_0x18f000>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'](_0x4479fa){this['_isLoading']=_0x4479fa;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x52fdba=this['_getScrollableElement']();_0x52fdba&&!this['_scrollManager']&&(this['_scrollManager']=new Xn(_0x52fdba));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class $a extends Nt{constructor(_0x2f1602){super(_0x2f1602);const _0x1ad839=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x1ad839['to']('interactionCount')}]});}['setInteractionCount'](_0x2cb1ee){this['set']('interactionCount',_0x2cb1ee);}}class qa extends _0x43ff17{static get['requires'](){return[rs,Vt,qs,ma,_0x45eadc];}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(_0x3dd0f5){super(_0x3dd0f5),this['_bodyCollection']=new qt(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'](_0x155562,_0x12fb6f,_0x55fce2){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x4f8866,anchorData:_0x15e568}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x155562,_0x4f8866,_0x15e568,_0x12fb6f,_0x55fce2);}}const {modelFragment:_0xefbe49,anchorData:_0xec9a0e}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x155562,_0xefbe49,_0xec9a0e,_0x12fb6f,_0x55fce2);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x535718=this['editor']['plugins']['has']('TrackChanges');let _0x4e6fcd=this['editor']['config']['get']('ai.availableReplyActions')||[...gn];_0x535718||(_0x4e6fcd=_0x4e6fcd['filter'](_0x359d99=>'insertSuggestion'!=_0x359d99));const _0x244157=this['editor']['commands']['get']('trackChanges'),_0x525e4d=new Ya(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x535718,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x4e6fcd});return _0x525e4d['bind']('isBusy')['to'](this),_0x244157&&_0x525e4d['bind']('isTrackChangesOn')['to'](_0x244157,'value'),_0x525e4d['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x525e4d['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x525e4d['on']('showNext',()=>{this['_navigateToNext']();}),_0x525e4d;}['_getExecuteDataRegular'](){const _0x3672d4=this['editor']['model']['document']['selection'];if(_0x3672d4['isCollapsed']){const _0x4771fe=gt(_0x3672d4['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x3672d4);this['editor']['model']['change'](_0x224a71=>{_0x224a71['setSelection'](_0x4771fe,'in');});}const _0x441892=_0x3672d4['getFirstRange'](),_0x11f8c0=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x3672d4),_0x441892['start'],_0x441892['end']);this['_copyMarkersToFragment'](_0x11f8c0,_0x3672d4,{'isTableSelection':!0x1});const _0x38584b=_0x3672d4['getFirstRange']()['start'],_0x68e2df=new Map();let _0x222fea=_0x11f8c0;for(let _0x43b671=0x0;_0x43b671<_0x38584b['path']['length'];_0x43b671++)_0x68e2df['set'](_0x222fea,_0x38584b['path'][_0x43b671]),_0x222fea=_0x222fea['getChild'](0x0);return{'modelFragment':_0x11f8c0,'anchorData':_0x68e2df};}['_getExecuteDataInTable'](){const _0xe4c25b=this['editor']['model']['document']['selection'],_0x19555b=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x548c04=_0xe4c25b['getFirstRange']()['start']['parent']['parent'],_0xd55a5f=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x548c04),this['editor']['model']['createPositionAfter'](_0x548c04)),_0x262b78=this['_wrapWithCommonAncestors'](_0x19555b,_0xd55a5f['start'],_0xd55a5f['end']);this['_copyMarkersToFragment'](_0x262b78,_0xe4c25b,{'isTableSelection':!0x0});const _0x560141=_0xe4c25b['getFirstRange']()['start'],_0x4a3e29=new Map();let _0x3c86c4=_0x262b78;for(let _0x38e9f7=0x0;_0x38e9f7<_0x560141['path']['length'];_0x38e9f7++)if(_0x4a3e29['set'](_0x3c86c4,_0x560141['path'][_0x38e9f7]),_0x38e9f7<_0x560141['path']['length']-0x1)_0x3c86c4=_0x3c86c4['getChild'](0x0);else{let _0x3dc589=_0x3c86c4['nextSibling'];for(;_0x3dc589;)_0x4a3e29['set'](_0x3dc589,_0x560141['path'][_0x38e9f7]),_0x3dc589=_0x3dc589['nextSibling'];}return{'modelFragment':_0x262b78,'anchorData':_0x4a3e29};}async['_executeAction'](_0x23d9ef,_0x5c1230,_0x1aeb97,_0x2ccb9e,_0x571499){const _0x521804=this['editor']['plugins']['get'](qs),_0x497c9b=this['editor']['plugins']['get'](ma),_0x703596=this['editor']['model']['document']['selection'],_0xd1d3ab=await _0x521804['modelToDataWithIds'](_0x5c1230),_0x492ca7=this['editor']['model']['document']['version'],_0x27191a=[..._0x703596['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0x497c9b['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x2ccb9e,'icon':_0x571499||_0x1161ca,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x27191a,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x497c9b),this['_interactionParams']={'action':_0x23d9ef,'content':_0xd1d3ab,'version':_0x492ca7,'aiBalloon':_0x497c9b,'modelFragment':_0x5c1230,'anchorData':_0x1aeb97},this['_setupApplyListeners'](),this['listenTo'](_0x497c9b,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x497c9b,'dialogClosed',(_0x45eed6,{id:_0x34a2ca})=>{if('aiActionsBalloon'===_0x34a2ca){for(const _0x47ba8b of this['_interactions']){if(0x0===_0x47ba8b['replies']['length']||_0x47ba8b['stoppedExplicitly'])continue;const _0x55df8a=_0x47ba8b['replies'][_0x47ba8b['replies']['length']-0x1],_0x1c45b4=_0x55df8a['changeGroups'][0x0];_0x1c45b4&&'pending'===_0x1c45b4['state']&&_0x55df8a['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x497c9b);}}),this['_createInteraction'](_0xd1d3ab,_0x492ca7,_0x497c9b,_0x23d9ef);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x227c2c,anchorData:_0x4f7714}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x227c2c,_0x4f7714,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x227c2c,_0x4f7714,!0x0);});}['_wrapWithCommonAncestors'](_0x2e1742,_0x17f3bd,_0x4a3122){const _0x147def=this['editor']['model']['createRange'](_0x17f3bd,_0x4a3122)['getCommonAncestor'](),_0x3632e5=_0x147def['is']('documentFragment')?[]:_0x147def['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x3632e5['length']){const _0xdb0a1a=_0x3632e5['map'](_0x551d01=>_0x551d01['_clone'](!0x1));for(let _0x5e13c1=0x1;_0x5e13c1<_0xdb0a1a['length'];_0x5e13c1++)_0xdb0a1a[_0x5e13c1-0x1]['_appendChild'](_0xdb0a1a[_0x5e13c1]);return _0xdb0a1a[_0xdb0a1a['length']-0x1]['_appendChild'](_0x2e1742),new _0x15fa01(_0xdb0a1a[0x0]);}return _0x2e1742;}['_copyMarkersToFragment'](_0x4669d2,_0x5ac1e1,_0x41a5a9={'isTableSelection':!0x1}){const _0x133c21=this['editor']['model'],_0x4186e9=Array['from'](_0x5ac1e1['getRanges']()),_0x58f0c9=_0x5ac1e1['getFirstRange']()['start'];for(const _0xf91e6a of _0x133c21['markers']){if(_0xf91e6a['name']['startsWith']($s)||!_0xf91e6a['affectsData'])continue;const _0x3e5736=_0xf91e6a['getRange']();if(!_0x4186e9['some'](_0x46de19=>_0x46de19['containsRange'](_0x3e5736,!0x0)))continue;const _0xaddf7c=this['_regularCalculateMarkerPath'](_0x3e5736['start'],_0x58f0c9,_0x41a5a9['isTableSelection']),_0x517809=this['_regularCalculateMarkerPath'](_0x3e5736['end'],_0x58f0c9,_0x41a5a9['isTableSelection']),_0x28dc11=_0x133c21['createPositionFromPath'](_0x4669d2,_0xaddf7c),_0x58dd7a=_0x133c21['createPositionFromPath'](_0x4669d2,_0x517809);if(!_0x28dc11['isEqual'](_0x58dd7a)){const _0x4171fe=_0x133c21['createRange'](_0x28dc11,_0x58dd7a);_0x4669d2['markers']['set'](_0xf91e6a['name'],_0x4171fe);}}}['_regularCalculateMarkerPath'](_0x4ddf41,_0x4c27c8,_0x54c2e4=!0x1){const _0x5740a6=[..._0x4ddf41['path']['slice']()];for(let _0x4be70e=0x0;_0x4be70e<Math['max'](_0x4c27c8['path']['length'],_0x4ddf41['path']['length']);_0x4be70e++){const _0x1dee3b=_0x4c27c8['path'][_0x4be70e]||0x0,_0x104d2d=(_0x4ddf41['path'][_0x4be70e]||0x0)-_0x1dee3b;if(_0x5740a6[_0x4be70e]=_0x104d2d,0x0!==_0x104d2d&&!_0x54c2e4)break;}return _0x5740a6;}async['_createInteraction'](_0x32d93a,_0x41efeb,_0x40cfa7,_0x447d32){const _0x47af91=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x447d32,'content':_0x32d93a,'version':_0x41efeb,'aiBalloon':_0x40cfa7,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x47f02e=new Ga({'connector':this['_aiConnector'],'editor':_0x47af91,'content':_0x32d93a,'version':_0x41efeb,..._0x447d32});this['_interactions']['push'](_0x47f02e);const _0x37b2e6=(_0x4f92a2,_0x48523d=!0x1,_0x4a84ef='streaming')=>this['_promiseQueue']['enqueue'](async _0x5beaa8=>{try{const _0xa37f1b=Ss({'editor':_0x47af91,'changeGroups':_0x4f92a2['changeGroups'],'documentContextContent':_0x4f92a2['documentContextContent'],'showDiff':_0x48523d,'trimUnchanged':!0x1});_0xa37f1b['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0xa37f1b[0x0],'renderingStrategy':_0x4a84ef,'abortSignal':_0x5beaa8});}catch(_0x285156){if(this['_isAbortError'](_0x285156))return;throw _0x285156;}});_0x47f02e['on']('replyCreated',(_0x257e58,_0x434e6a)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x37b2e6(_0x434e6a)['catch'](_0x4d1274=>{this['_isAbortError'](_0x4d1274)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x4d1274),this['_setErrorState'](_0x47f02e));});}),_0x47f02e['on']('replyContentUpdated',(_0x2f2b30,_0x34698d)=>{_0x37b2e6(_0x34698d)['catch'](_0x3a04b9=>{this['_isAbortError'](_0x3a04b9)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x3a04b9),this['_setErrorState'](_0x47f02e));});}),_0x47f02e['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x5a97bb){this['_isAbortError'](_0x5a97bb)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x5a97bb),this['_setErrorState'](_0x47f02e));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x50155f,{showDiff:_0x2ed4b0})=>{try{this['_balloonShowDiff']=_0x2ed4b0;const _0x4a3262=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x4a3262&&await _0x37b2e6(_0x4a3262,_0x2ed4b0,'static');}catch(_0x4ecdbe){this['_isAbortError'](_0x4ecdbe)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x4ecdbe),this['_setErrorState'](_0x47f02e));}}),_0x47f02e['on']('replyChangeGroupStateUpdated',()=>{const _0x5e6ceb={'positiveCount':_0x47f02e['replies']['reduce']((_0x39c31a,_0x3ece37)=>_0x39c31a+_0x3ece37['changeGroups']['filter'](_0x1ebee9=>'accepted'===_0x1ebee9['state'])['length'],0x0),'totalCount':_0x47f02e['replies']['reduce']((_0x304b07,_0x4bc459)=>_0x304b07+_0x4bc459['changeGroups']['length'],0x0)},_0x480fe1=_0x47f02e['actionCallId'],_0x62357f=_0x47f02e['actionName'];_0x62357f?this['_aiConnector']['upsertAIActionRating'](_0x62357f,_0x480fe1,_0x5e6ceb):this['_aiConnector']['upsertCustomAIActionRating'](_0x480fe1,_0x5e6ceb);}),this['_setLoadingState']();try{const _0xb76543=await _0x47f02e['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0xb76543;}catch(_0x528bca){if(this['_isAbortError'](_0x528bca))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x47f02e);}}['_applyChanges'](_0x5225df,_0x3d69d1,_0x18d2a6){const _0x12345f=this['editor'];if(_0x18d2a6&&!_0x12345f['plugins']['has']('TrackChanges'))throw new ot('ai-no-track-changes',null);const _0x3f8640=this['editor']['plugins']['get'](_0x45eadc),_0x4fdf33=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x4fdf33||!_0x4fdf33['replies']['length'])return;const _0x31d3bf=_0x4fdf33['replies'][_0x4fdf33['replies']['length']-0x1],_0x17f45d=_0x31d3bf['changeGroups'];_0x31d3bf['setChangeGroupState'](0x0,'accepted');let _0x76ee09=Ks({'editor':_0x12345f,'reply':_0x31d3bf,'interaction':_0x4fdf33,'groups':_0x17f45d,'transform':!0x1,'documentCompare':_0x3f8640,'documentCompareOptions':{'anchor':_0x12345f['model']['createPositionAt'](_0x5225df,0x0),'markDeletions':_0x18d2a6}});_0x76ee09=this['_filterOperationsOutsideRange'](_0x76ee09,_0x3d69d1);for(const _0x51d265 of _0x76ee09)this['_anchorOperation'](_0x3d69d1,_0x51d265,_0x12345f['model']['document']['getRoot']());const _0x33b95d=_0x4fdf33['getDocumentContext']()['version'],_0x562376=_0x12345f['model']['document']['history']['getOperations'](_0x33b95d),_0x2b1b1f={'document':_0x12345f['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x269e65=_0x510b2f(_0x76ee09,_0x562376,_0x2b1b1f)['operationsA'];_0x12345f['model']['change'](_0xa1dfb1=>{if(_0xa1dfb1['setSelection'](_0x12345f['model']['document']['selection']['focus']),_0x18d2a6)_0x12345f['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x269e65);else{for(const _0x275bfd of _0x269e65)_0x275bfd['baseVersion']=_0x12345f['model']['document']['version'],Ws(_0x12345f,_0x275bfd),_0xa1dfb1['batch']['addOperation'](_0x275bfd),_0x12345f['model']['applyOperation'](_0x275bfd);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x2cae47,_0x2d8734){return _0x2cae47['filter'](_0x948039=>{if('rename'==_0x948039['type']){const _0x30e14d=_0x948039['position']['nodeAfter'];return!_0x2d8734['has'](_0x30e14d);}if(_0x948039['type']['indexOf']('Attribute')>-0x1){const _0x12aa65=_0x948039['range']['start']['nodeAfter'];return!_0x2d8734['has'](_0x12aa65);}return!0x0;});}['_anchorOperation'](_0x2cf0cb,_0x5c181d,_0x839a8b){const _0xff4cf6=_0x5c181d['clone']();for(const _0x2bbc40 in _0x5c181d){const _0x31d649=_0x5c181d[_0x2bbc40];_0x31d649 instanceof _0x25d743?_0x5c181d[_0x2bbc40]=new _0x25d743(_0x1871b1(_0x31d649['start']),_0x1871b1(_0x31d649['end'])):_0x31d649 instanceof _0x5f4486&&(_0x5c181d[_0x2bbc40]=_0x1871b1(_0x31d649));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0xff4cf6['type'])){if(_0xff4cf6['isDocumentOperation']=!0x1,_0xff4cf6['baseVersion']=null,'remove'==_0xff4cf6['type']){const _0x2a2ecf=_0xff4cf6['sourcePosition'],_0x2367bc=_0xff4cf6['howMany'];new _0x4c0de8(_0x2a2ecf,_0x2367bc)['_execute']();}else _0xff4cf6['_execute']();}function _0x1871b1(_0x202d61){if('$graveyard'==_0x202d61['root']['rootName'])return _0x202d61;const _0x730680=[];let _0x56e073=_0x202d61['root'];for(let _0x214843=0x0;_0x214843<_0x202d61['path']['length'];_0x214843++){const _0x11da74=_0x2cf0cb['get'](_0x56e073)||0x0;_0x730680[_0x214843]=_0x202d61['path'][_0x214843]+_0x11da74,_0x56e073=_0x56e073['getChildAtOffset'](_0x202d61['path'][_0x214843]);}return new _0x5f4486(_0x839a8b,_0x730680,_0x202d61['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x2c03c3,content:_0x2afb8f,version:_0x2ed98c,aiBalloon:_0x496a85}=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'](_0x2afb8f,_0x2ed98c,_0x496a85,_0x2c03c3)['catch'](_0x2a0c7e=>{this['_isAbortError'](_0x2a0c7e)||console['error']('Error\x20refreshing\x20interaction:',_0x2a0c7e);});}['_isAbortError'](_0x15bea4){return!!_0x15bea4['message']&&_0x15bea4['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 _0x1d2b69=this['_interactions']['length'];this['_currentInteractionIndex']<_0x1d2b69-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x6f43cc){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x6f43cc;const _0x3b5f93=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x3b5f93)return;if(_0x3b5f93['hasError'])return this['_setErrorState'](_0x3b5f93),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x3b5f93['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x4a6119=_0x3b5f93['replies'][_0x3b5f93['replies']['length']-0x1];if(_0x4a6119){const _0xf73f6e=this['editor'];try{const _0x48ede9=Ss({'editor':_0xf73f6e,'changeGroups':_0x4a6119['changeGroups'],'documentContextContent':_0x4a6119['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x37e820=>setTimeout(_0x37e820,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x48ede9[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x3a215f){this['_isAbortError'](_0x3a215f)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x3a215f);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x5f1489){const _0x17fd18=as(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x17fd18),_0x5f1489['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 Qa extends _0x43ff17{static get['requires'](){return[Ma,Va,qa];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4b95c6){super(_0x4b95c6),_0x4b95c6['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class Xa extends Nt{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x352929,_0x336f34){super(_0x352929),this['id']=_0x336f34,this['set']('status','pending'),this['set']('changeId',_0x336f34),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',(_0x34c27c,_0x287a1d)=>{_0x287a1d&&_0x287a1d['target']&&'A'===_0x287a1d['target']['tagName']&&_0x287a1d['preventDefault'](),this['fire']('activateChange',{'id':_0x336f34,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x336f34,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x336f34,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x1d3fb9=new Nt(this['locale']);return _0x1d3fb9['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',_0xa2dc1d=>!_0xa2dc1d)]}}),_0x1d3fb9;}['_createAcceptButtonView'](){const _0x298f45=new kt(this['locale']);return _0x298f45['set']({'label':as(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x298f45['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xde0607=>{this['fire']('acceptChange',{'id':this['changeId']}),_0xde0607['stopPropagation']();})},'attributes':{'class':[this['bindTemplate']['if']('status','ck-hidden',_0x55efd6=>'pending'!==_0x55efd6&&'accepted'!==_0x55efd6),this['bindTemplate']['if']('status',hs,_0x30d4f2=>'pending'===_0x30d4f2),this['bindTemplate']['if']('status',cs,_0x3ddb64=>'pending'!==_0x3ddb64),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x5451e7=>'accepted'===_0x5451e7)]}}),this['on']('change:status',(_0x237666,_0x1151bf,_0x387818)=>{_0x298f45['isEnabled']='pending'===_0x387818,'accepted'===_0x387818&&(_0x298f45['label']=as(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x298f45['icon']=_0x464c2a);}),_0x298f45;}['_createDismissButtonView'](){const _0xdd4323=new kt(this['locale']);return _0xdd4323['set']({'label':as(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0xdd4323['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x20be6b=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x20be6b['stopPropagation']();})},'attributes':{'class':[cs,this['bindTemplate']['if']('status','ck-hidden',_0x4704ec=>'pending'!==_0x4704ec&&'rejected'!==_0x4704ec),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x1566cb=>'pending'===_0x1566cb),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x38af86=>'rejected'===_0x38af86)]}}),this['on']('change:status',(_0x52167c,_0x2e38ec,_0x3b4fce)=>{_0xdd4323['isEnabled']='pending'===_0x3b4fce,'rejected'===_0x3b4fce&&(_0xdd4323['label']=as(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0xdd4323['icon']=_0x15dd63);}),_0xdd4323;}['_createInfoButtonView'](){const _0x48a17d=new kt(this['locale']);return _0x48a17d['set']({'label':as(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x525c75,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':cs+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x48a17d['bind']('isOn')['to'](this,'isInfoToggleOn',_0x3d8b3e=>_0x3d8b3e),_0x48a17d['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x48a17d;}['_createOutdatedButtonView'](){const _0x5db7b8=new kt(this['locale']);return _0x5db7b8['set']({'label':as(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':it,'withText':!0x0,'isEnabled':!0x1}),_0x5db7b8['extendTemplate']({'attributes':{'class':[cs,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x2da7ac=>'outdated'!==_0x2da7ac)],'disabled':'disabled'}}),_0x5db7b8;}}class za extends Qt{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x4836c1,_0x100a15){super(_0x4836c1),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']()),_0x100a15['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x41b5ac){this['resultItemView']['changeId']=_0x41b5ac['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x41b5ac['contentDiffed'];}['showBalloon'](_0x57038e,_0x95b854,_0x942f42,_0x10bb3b,_0x4cd105,_0x3cb112){const _0x2e5fe6=_0x95b854();if(!_0x2e5fe6)return;this['updateContent'](_0x57038e),this['show']();const _0x19b8d5=Array['from'](_0x2e5fe6['getClientRects']())['reverse'](),_0x2a79e4=this['_getPointedRectIndexFromEvent'](_0x942f42,_0x19b8d5),_0x27a80e=_0x19b8d5[_0x2a79e4??0x0];'click'===_0x10bb3b?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x95b854(),_0x2a79e4,_0x57038e['id'],_0x4cd105,_0x3cb112)||_0x27a80e})):'hover'===_0x10bb3b&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x95b854(),_0x2a79e4,_0x57038e['id'])||_0x27a80e}));}['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'](){Xt({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x18ac6e=[this['element']];return this['_pinnedTargetElement']&&_0x18ac6e['push'](this['_pinnedTargetElement']),_0x18ac6e;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x233145=new Nt();return this['resultItemView']=new Xa(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x233145['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']]}]}),_0x233145;}['_getBestRectPositionOnClick'](_0x44a355,_0x470d4d,_0x4f3093,_0x5aaa92,_0x1a0760){if(!_0x44a355)return null;const _0x58de5e=this['position']['replace']('arrow_',''),_0x1f33a2=Array['from'](_0x44a355['getClientRects']());let _0x137586,_0x919106=_0x1f33a2['reverse']();return void 0x0!==_0x470d4d&&this['_isPinnedRectVisible'](_0x919106[_0x470d4d],_0x5aaa92,_0x1a0760)?(_0x137586=_0x919106[_0x470d4d],this['_pinnedRectIndex']=_0x470d4d):this['_isPinnedRectVisible'](_0x919106[0x0],_0x5aaa92,_0x1a0760)&&void 0x0===_0x470d4d?_0x137586=_0x919106[0x0]:(_0x919106='s'==_0x58de5e[0x0]?[..._0x1f33a2]['reverse']():_0x1f33a2,_0x919106['forEach'](_0xef6afc=>{this['_isPinnedRectVisible'](_0xef6afc,_0x5aaa92,_0x1a0760)&&(_0x137586=_0xef6afc);})),this['_pinnedTargetChangeId']=_0x4f3093,this['_pinnedTargetElement']=_0x44a355,_0x137586||_0x44a355['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x6f27d5,_0x48d1ea,_0x3d3718){if(!_0x6f27d5)return null;const _0x54f7c7=Array['from'](_0x6f27d5['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x48d1ea&&this['_pinnedTargetChangeId']!==_0x3d3718)return this['_pinnedRectIndex']=_0x48d1ea,this['_pinnedTargetElement']=_0x6f27d5,this['_pinnedTargetChangeId']=_0x3d3718,_0x54f7c7[_0x48d1ea];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x3d3718){if(_0x6f27d5!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x54f7c7[this['_pinnedRectIndex']];}return void 0x0!==_0x48d1ea&&this['_pinnedTargetChangeId']!==_0x3d3718?(this['_pinnedRectIndex']=_0x48d1ea,this['_pinnedTargetElement']=_0x6f27d5,this['_pinnedTargetChangeId']=_0x3d3718,_0x54f7c7[_0x48d1ea]):_0x6f27d5['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x38011e,_0x197b64){if(_0x38011e)for(let _0x52f7a9=0x0;_0x52f7a9<_0x197b64['length'];_0x52f7a9++){const _0x44cb5a=_0x197b64[_0x52f7a9];if(_0x38011e['clientX']>=_0x44cb5a['left']-0x3&&_0x38011e['clientX']<=_0x44cb5a['right']+0x3&&_0x38011e['clientY']>=_0x44cb5a['top']-0x3&&_0x38011e['clientY']<=_0x44cb5a['bottom']+0x3)return _0x52f7a9;}}['_isPinnedRectVisible'](_0x53bd3d,_0x2d3129,_0x5eccb7){const _0xe81e25=new ut(_0x53bd3d),_0x429d6a=_0x2d3129||document['documentElement'],_0x88c733=_0xe81e25['getIntersection'](bt(_0x5eccb7)),_0x24d405=new ut(_0x429d6a)['getIntersection'](_0xe81e25);return!!(_0x88c733&&_0x24d405&&_0xe81e25['width']>0x0);}}const ja=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class Ja extends _0x3627a2{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[ns];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x50d16c){super(_0x50d16c),this['_bodyCollection']=new qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...ja)['to'](this),this['_balloonSuggestionView']=new za(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x57f96b=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x57f96b);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x53b540){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x17eb23=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x53b540,_0x17eb23);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x290710){_0x290710&&('error-general'!==_0x290710['status']?'error-chunk'!==_0x290710['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x3b2f45){this['_mainView']['addCheckRunResult'](_0x3b2f45);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x592c71){this['_mainView']['showGeneralReviewCoreErrorView'](_0x592c71??as(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x12feed,_0x554141){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x12feed,_0x554141);}['setActiveStateInResults'](_0xc8bcf3){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x8e5c05=>{_0x8e5c05['id']===_0xc8bcf3&&_0x8e5c05['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x489bb6=>_0x489bb6['setItemAsInactive']());}['updateChangeState'](_0xa07763,_0x581529){'accepted'===_0x581529||'rejected'===_0x581529||'outdated'===_0x581529?this['_mainView']['reviewCheckResultsView']['hideResult'](_0xa07763,_0x581529):this['_mainView']['reviewCheckResultsView']['showResult'](_0xa07763,_0x581529);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x7bf8da,_0x1b423a,_0x3e5465,_0x8806a7,_0x3fa08b,_0x436e71){this['_balloonSuggestionView']['showBalloon'](_0x7bf8da,_0x1b423a,_0x3e5465,_0x8806a7,_0x3fa08b,_0x436e71);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x2a0d54){const _0x501f8c=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x5380f1=>_0x5380f1['id']===_0x2a0d54);return _0x501f8c?_0x501f8c['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class Za extends Nt{constructor(_0xdd180e){super(_0xdd180e),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x4350b2=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x4350b2['if']('isVisible','ck-hidden',_0x261295=>!_0x261295)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x4350b2['to']('errorMessage')}]}]});}}class to extends Nt{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x5d9278,_0x502337){super(_0x5d9278),this['reviewCoreHeader']=_0x502337['header'],this['generalErrorView']=new Za(_0x5d9278),this['reviewCheckListView']=_0x502337['list'],this['reviewCheckListView']['delegate'](...ja)['to'](this),this['reviewCheckResultsView']=_0x502337['results'],this['reviewCheckResultsView']['delegate'](...ja)['to'](this),this['reviewCompletedView']=_0x502337['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'](_0x51e4b9){this['reviewCheckResultsView']['addResult'](_0x51e4b9),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'](_0xd3746){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0xd3746;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class eo extends kt{constructor(_0x305b5c,_0x4d39ce){super(_0x4d39ce),this['set']({'label':_0x305b5c,'withText':!0x0,'class':os}),this['on']('execute',()=>{this['fire']('finishReview');});}}class io extends Pt{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x27668b,_0x4f8e85){super(_0x27668b),this['_contents']=_0x4f8e85,this['_resultViews']=new _0x192828(),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 jr(_0x27668b),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 _0x1e14ce=this['_createCombinedSkeletonLoader'](),_0x5a98c4=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x5a98c4['if']('isLoading','ck-ai_review__check-run_loading',_0x648171=>_0x648171),_0x5a98c4['if']('isResultReady','ck-ai_review__check-run_ready',_0x131bcc=>_0x131bcc),_0x5a98c4['if']('isVisible','ck-hidden',_0x10f5fe=>!_0x10f5fe)]},'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',_0xb59134=>_0xb59134)]},'children':this['_resultViews']},_0x1e14ce]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x51de9c){const _0x16da20=new Xa(this['locale'],_0x51de9c['id']);_0x16da20['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x16da20),_0x16da20['resultResponseView']['element']['innerHTML']=_0x51de9c['contentDiffed'];}['hideResult'](_0xa866cf,_0x11c9a6){if('pending'===_0x11c9a6)return;const _0x108ba0=this['_resultViews']['find'](_0x1e6d55=>_0x1e6d55['id']===_0xa866cf);_0x108ba0&&(_0x108ba0['status']=_0x11c9a6,_0x108ba0['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x2f5b05,_0x275613){if('pending'!==_0x275613)return;const _0x42cf6e=this['_resultViews']['find'](_0x20929a=>_0x20929a['id']===_0x2f5b05);_0x42cf6e&&(_0x42cf6e['status']=_0x275613,_0x42cf6e['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x35c6d5,_0x42eab4){this['headerTitle']=_0x35c6d5,this['headerSubtitle']=_0x42eab4||'';}['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 zn(this['locale'],jn['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x1794db=new Nt(this['locale']),_0x562a87=[];for(let _0x52b2d3=0x0;_0x52b2d3<0x10;_0x52b2d3++){const _0x1cb5a8=this['_createSkeletonLoader']();_0x1cb5a8['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x562a87['push'](_0x1cb5a8);}return _0x1794db['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x2fb8de=>!_0x2fb8de)]},'children':_0x562a87}),_0x1794db;}['_createErrorView'](){const _0x27901f=new Nt(this['locale']),_0x47e517=new kt(this['locale']),t=this['locale']['t'];return _0x27901f['delegate']('retryReview')['to'](this),_0x47e517['set']({'label':t('Try\x20again'),'withText':!0x0,'class':hs+'\x20ck-ai_review__check-run-error-retry-button'}),_0x47e517['on']('execute',()=>{this['fire']('retryReview');}),_0x27901f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x429087=>!_0x429087),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x17e6f7=>'chunk'===_0x17e6f7)]},'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',_0x28a904=>'chunk'===_0x28a904)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x5bd91f=>'general'!==_0x5bd91f)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x363f75=>'chunk'!==_0x363f75)]},'children':[{'text':as(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x47e517]}),_0x27901f;}['_createCancelButtonView'](){const _0x2a9a0=new kt(this['locale']);return _0x2a9a0['set']({'label':as(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[hs+'\x20ck-ai-button-stop-generating'],'icon':_0x7c8fb}),_0x2a9a0['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x49124f=>_0x49124f),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x28bdc7=>_0x28bdc7)]}}),_0x2a9a0['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x2a9a0;}['_createToggleDiffButtonView'](){const _0x1cfbae=new kt(this['locale']);_0x1cfbae['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x1cfbae['bind']('isEnabled')['to'](this,'isError',_0x951a38=>!_0x951a38),_0x1cfbae['extendTemplate']({'attributes':{'class':[hs,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0xb9842c=>!_0xb9842c),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x59c5e8=>_0x59c5e8)]}});const _0x874fa7=as(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x46a21c=as(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x1cfbae['bind']('isOn')['to'](this,'isToggleDiffOn',_0x8c3488=>_0x8c3488),_0x1cfbae['bind']('icon')['to'](this,'isToggleDiffOn',_0x55ea0f=>_0x55ea0f?st:nt),_0x1cfbae['bind']('label')['to'](this,'isToggleDiffOn',_0x305cd4=>_0x305cd4?_0x874fa7:_0x46a21c),_0x1cfbae['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x1cfbae;}['_createAcceptAllButtonView'](){const _0x26eea6=new kt(this['locale']);return _0x26eea6['set']({'label':as(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x26eea6['bind']('isEnabled')['to'](this,'isError',_0x337644=>!_0x337644),_0x26eea6['extendTemplate']({'attributes':{'class':[os,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x148f97=>!_0x148f97),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x7b5091=>_0x7b5091)]}}),_0x26eea6['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x26eea6;}['_createExitReviewButtonView'](){const _0x3cc62a=new kt(this['locale']);return _0x3cc62a['set']({'label':as(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x3cc62a['extendTemplate']({'attributes':{'class':[cs,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x16b564=>!_0x16b564),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x298a0b=>_0x298a0b)]}}),_0x3cc62a['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x3cc62a;}['_createResultHeaderView'](){const _0x2d0e58=new Nt(this['locale']),_0x3fd8ce=this['_createTitleView']();return _0x2d0e58['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x2f6e57=>_0x2f6e57)]},'children':[_0x3fd8ce,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x2d0e58;}['_createTitleView'](){const _0x5ad9d7=new Nt(this['locale']),_0x4b8465=new fn();return _0x4b8465['bind']('isVisible')['to'](this,'isResultReady',_0x8c4480=>!_0x8c4480),_0x5ad9d7['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x4b8465,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1c802c=>_0x1c802c)]},'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',_0x25b96a=>!_0x25b96a)]},'children':[{'text':as(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x5ad9d7;}['_createFinishReviewButtonView'](){const _0x445266=new eo(as(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x445266['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x40bb1a=>!_0x40bb1a)]}}),_0x445266['delegate']('finishReview')['to'](this),_0x445266;}}class so extends Pt{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x4ebf79,_0x48c4e3){super(_0x4ebf79),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x48c4e3['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x48c4e3['headerText']);const _0x319388=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x319388['if']('isVisible','ck-hidden',_0x30a3aa=>!_0x30a3aa)]},'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':_0x48c4e3['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x52f231){const _0x12c868=new eo(_0x52f231,this['locale']);return _0x12c868['delegate']('finishReview')['to'](this),_0x12c868;}['_createResultHeaderView'](_0x41a1a0){const _0x2da577=new Nt(this['locale']);return _0x2da577['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':_0x41a1a0}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x2da577;}}class no extends Nt{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x1d6567,_0x37eaff){super(_0x1d6567),this['_defaultValue']=_0x37eaff['default']||(_0x37eaff['data']['length']>0x0?_0x37eaff['data'][0x0]['id']:''),this['_defaultLabel']=_0x37eaff['data']['find'](_0x139f5a=>_0x139f5a['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=Bt(this['locale']);const _0x253d5d=this['_prepareListOptions'](_0x37eaff['data']);zt(this['_dropdownView'],_0x253d5d,{'role':'menu','ariaLabel':_0x37eaff['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x48f8ed=>{_0x48f8ed['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x4816e2=>{this['formValue']=_0x4816e2['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x4816e2['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'](_0x3059e1=[]){const _0x2b47bf=new dt();this['resetToDefault']();for(const _0xb89f9f of _0x3059e1){const _0x3bd49c=new jt({'label':_0xb89f9f['label'],'withText':!0x0,'role':'menuitemradio','id':_0xb89f9f['id'],'model':_0xb89f9f});_0x3bd49c['bind']('isOn')['to'](this,'formValue',_0x212972=>_0x212972===_0x3bd49c['id']);const _0x3a3b4e={'type':'button','model':_0x3bd49c};_0x2b47bf['add'](_0x3a3b4e);}return _0x2b47bf;}}class ro extends Pt{['_formItem']=null;constructor(_0x1275a3,_0x4f26f4,_0x2d9df8){super(_0x1275a3),this['argsKey']=_0x4f26f4?.['argsKey'];if('dropdown'===_0x4f26f4['formType'])this['_formItem']=new no(this['locale'],_0x4f26f4);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x3521b8=new _0x8ed428(this['locale'],{'children':[this['_formItem']],'class':[_0x2d9df8?'ck-form__row_with-submit':'']});_0x2d9df8&&_0x3521b8['children']['add'](_0x2d9df8),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x3521b8]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class ao extends _0x4d4702{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x17f858){super(_0x17f858),this['set']('isEmpty',!0x0),this['keystrokes']=new At(),this['minRows']=ao['MIN_ROWS'],this['maxRows']=ao['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 oo extends Nt{['focusTracker']=new _t();['keystrokes']=new At();['focusCycler'];['_focusables']=new _0x192828();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x50db06,_0x459eea,_0x331513=!0x1){super(_0x50db06),this['_check']=_0x459eea,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x459eea['defaultModel']?_0x459eea['defaultModel']['id']:'',this['_defaultLabel']=_0x459eea['defaultModel']?_0x459eea['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new Zt(this['locale'],()=>new ao(_0x50db06)),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 dt(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x331513),zt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x8ed428(this['locale'],{'children':[this['promptInputView']]}),new _0x8ed428(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x5e206a,_0x5ad5e7)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x5ad5e7()):_0x5ad5e7();}),this['focusCycler']=new Mt({'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'](_0xaf9344=>{this['_focusables']['add'](_0xaf9344),this['focusTracker']['add'](_0xaf9344['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 _0x144b0c of this['_getFormValidators']()){const _0x1560b8=_0x144b0c();if(_0x1560b8)return this['promptInputView']['errorText']=_0x1560b8,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return as(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x41f377=new kt(this['locale']),t=this['locale']['t'];return _0x41f377['set']({'label':t('Submit'),'withText':!0x0,'class':os}),_0x41f377['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x41f377;}['_createCancelButtonView'](){const _0x1c31f8=new kt(this['locale']),t=this['locale']['t'];return _0x1c31f8['set']({'label':t('Cancel'),'withText':!0x0,'class':cs}),_0x1c31f8['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x19403b=>{_0x19403b['stopPropagation']();})}}),_0x1c31f8['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x1c31f8;}['_setModelList'](_0x33b6d6){this['_modelSelectionDropdownItems']['clear']();const _0x2644bb=this['_check']['models'];if(_0x33b6d6)this['set']('modelDisplayMode','hidden');else{const _0x47e6fb=0x1===_0x2644bb['length'];this['set']('modelDisplayMode',_0x47e6fb?'name':'selector');}if(this['resetToDefault'](),_0x2644bb?.['length']){0x1===_0x2644bb['length']&&this['set']('activeModelName',_0x2644bb[0x0]['name']||_0x2644bb[0x0]['id']);for(const _0x4d7762 of _0x2644bb){const _0x619d84=new jt({'label':_0x4d7762['name'],'withText':!0x0,'role':'menuitemradio','id':_0x4d7762['id'],'model':_0x4d7762});_0x619d84['bind']('isOn')['to'](this,'modelId',_0x364a3e=>_0x364a3e===_0x4d7762['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x619d84,'labelView':new co(this['locale'],_0x4d7762)});}}}['_createModelSelectionDropdown'](){const _0x44edcc=Bt(this['locale']);return _0x44edcc['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x44edcc['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0,'class':cs}),_0x44edcc['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x40b35f=>'selector'===_0x40b35f),this['listenTo'](_0x44edcc,'execute',_0x282955=>{this['modelId']=_0x282955['source']['model']['id'],_0x44edcc['buttonView']['label']=_0x282955['source']['label'];}),_0x44edcc;}['_createModelNameView'](){const _0x3d8004=new ho(this['locale']);return _0x3d8004['bind']('text')['to'](this,'activeModelName',_0x56d3ae=>_0x56d3ae??''),_0x3d8004['bind']('isVisible')['to'](this,'modelDisplayMode',_0x3f1ab3=>'name'===_0x3f1ab3),_0x3d8004;}['_createActionsFooterView'](){const _0x4f07f1=new Nt(this['locale']);return _0x4f07f1['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']]}]}),_0x4f07f1;}}class ho extends Nt{constructor(_0x5948bc){super(_0x5948bc),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x20fde2=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x20fde2['if']('isVisible','ck-hidden',_0x4840f2=>!_0x4840f2)]},'children':[{'text':_0x20fde2['to']('text')}]});}}class co extends Ht{constructor(_0x3c4189,_0x6d4aac){super();const _0x453403=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x453403['to']('style'),'id':_0x453403['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x453403['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x6d4aac['description']||'']}]}]});}}class lo extends Pt{['_formItemsCollection']=new _0x192828();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x24b43c,_0x1552e8,_0x59159f,_0x2a7e78=!0x1){super(_0x24b43c),this['_hideModels']=_0x2a7e78,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x1552e8['isParameterized']);const _0xacc23e=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',_0x277d82=>_0x277d82),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x609090=>_0x609090)],'style':{'--ck-ai-review-check-list-item-index':_0x59159f}},'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':_0x1552e8['title']}]},_0xacc23e]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x1552e8['description']?[{'text':_0x1552e8['description']}]:[]}]}]},..._0x1552e8['isParameterized']?[this['_createParameterizedView'](_0x1552e8)]:[],...'custom'===_0x1552e8['id']?[this['_createCustomView'](_0x1552e8,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x1552e8['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x1552e8['id'],'args':_0x1552e8['useArgs']?_0x1552e8['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&Xt({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x30b209=>{_0x30b209['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x84d68=new yt();return _0x84d68['content']=rt,_0x84d68['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x84d68;}['_createParameterizedView'](_0x3e423f){const _0x3b3a85=new Nt(),_0x55b42d=this['_createFormView'](_0x3e423f);return _0x3b3a85['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x2844b1=>!_0x2844b1)]},'children':[_0x55b42d]}),_0x3b3a85;}['_createFormView'](_0x50db03){const _0x22b063=new Nt(),_0x262f28=Array['isArray'](_0x50db03['options'])?_0x50db03['options']:[],_0x45610d=new kt(this['locale']),t=this['locale']['t'];_0x45610d['set']({'label':t('Submit'),'withText':!0x0,'class':os}),_0x45610d['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x3f93f7=>{_0x3f93f7['stopPropagation']();})}}),_0x45610d['on']('execute',()=>{const _0x1f5fa2=[],_0x4b8372={};this['_formItemsCollection']['forEach'](_0x48562f=>{_0x1f5fa2['push'](_0x48562f['value']),_0x50db03['useArgs']&&_0x50db03['options']&&(_0x4b8372[_0x48562f['argsKey']]=_0x48562f['value']);}),this['fire']('runReviewCheck',{'id':_0x50db03['id'],'params':_0x1f5fa2['length']?_0x1f5fa2:void 0x0,'args':Object['keys'](_0x4b8372)['length']?_0x4b8372:void 0x0});});const _0x540a5d=_0x262f28['length'];return _0x262f28['forEach']((_0x5021c6,_0x458ae8)=>{const _0xc7bf95=_0x458ae8===_0x540a5d-0x1;this['_formItemsCollection']['add'](new ro(this['locale'],_0x5021c6,_0xc7bf95?_0x45610d:null));}),_0x22b063['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x22b063;}['_createCustomView'](_0x3da7b1,_0x18ea3d=!0x1){return this['_customCheckView']=new oo(this['locale'],_0x3da7b1,_0x18ea3d),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',_0x3cf3a0=>!_0x3cf3a0)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x166e06,_0x1dcebd,_0x2e2755)=>{_0x2e2755||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class uo extends Pt{['_checkViews'];constructor(_0x1797ab){super(_0x1797ab),this['_checkViews']=new _0x192828(),this['_setupTemplate']();}['setChecks'](_0x39e6cb,_0x5177a4=!0x1){this['_checkViews']['clear']();for(const [_0x92879b,_0x1bde7f]of _0x39e6cb['entries']()){const _0x8f0f58=new lo(this['locale'],_0x1bde7f,_0x92879b,_0x5177a4);_0x8f0f58['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x8f0f58);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x254ab9 of this['_checkViews'])_0x254ab9 instanceof lo&&_0x254ab9['resetToDefault']();}['_setupTemplate'](){const _0x9fe727=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x9fe727['if']('isVisible','ck-hidden',_0x4f37e2=>!_0x4f37e2)]},'children':this['_checkViews']});}}class _o extends Ja{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x3b8cbd=this['context']['locale'],_0x507323=new _0x222d65(_0x3b8cbd,{'label':as(_0x3b8cbd,'AI_REVIEW_MODE'),'icon':_0x217aa1,'class':'ck-ai-header\x20ck-ai-header_review'});return new to(this['context']['locale'],{'header':_0x507323,'list':new uo(_0x3b8cbd),'results':new io(_0x3b8cbd,{'generalErrorText':as(_0x3b8cbd,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new so(_0x3b8cbd,{'headerText':as(_0x3b8cbd,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':as(_0x3b8cbd,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':as(_0x3b8cbd,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x412434=this['context']['plugins']['get']('AITabs');_0x412434['view']['on']('activateTab',(_0x5ae476,_0x2efeca)=>{'reviewMode'===_0x2efeca?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x412434['view']['addTab']({'id':'reviewMode','buttonLabel':as(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x217aa1,'order':0x0,'content':this['_mainView']});}}const Ao='review-';class go extends _0x3627a2{static get['requires'](){return[_0x45eadc,qs];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];constructor(_0x16bc94){super(_0x16bc94),this['_domEmitter']=new(Rt())(),this['_eventEmitter']=new(pt())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x1fca03=Fs(this['context']);_0x1fca03['conversion']['for']('editingDowncast')['markerToElement']({'model':Ao+'insert','view':(_0x2c2f08,{writer:_0x240bf8})=>{const _0x2a9cbc=this['_markers']['get'](_0x2c2f08['markerName']),_0x336055={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x2a9cbc?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x2c2f08['markerName']};return _0x240bf8['createUIElement']('span',_0x336055,function(_0x8dc2a2){const _0x4be141=this['toDomElement'](_0x8dc2a2);return _0x4be141['innerHTML']=_0x2a9cbc?.['content']?.['asString']||'',_0x4be141;});}}),_0x1fca03['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ao+'remove-only','view':_0x2df883=>{const _0x1caa60=this['_markers']['get'](_0x2df883['markerName']),_0x31c8f5=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x1caa60?.['id']||'')&&_0x31c8f5['push']('ck-ai_review__change_active'),{'classes':_0x31c8f5,'attributes':{'data-marker-id':_0x2df883['markerName']}};}}),_0x1fca03['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ao+'remove-context','view':_0x28f912=>{const _0x4085c7=this['_markers']['get'](_0x28f912['markerName']),_0x298dc5=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x4085c7?.['id']||'')&&_0x298dc5['push']('ck-ai_review__change_active'),{'classes':_0x298dc5,'attributes':{'data-marker-id':_0x28f912['markerName']}};}}),_0x1fca03['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ao+'remove-text','view':_0x3972b5=>{const _0x3b49f7=this['_markers']['get'](_0x3972b5['markerName']),_0x3cd695=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x3b49f7?.['id']||'')&&_0x3cd695['push']('ck-ai_review__change_active'),{'classes':_0x3cd695,'attributes':{'data-marker-id':_0x3972b5['markerName']}};}}),_0x1fca03['conversion']['for']('dataDowncast')['markerToElement']({'model':Ao+'suggestion-context','view':(_0x44012b,{writer:_0x103e57})=>_0x103e57['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x44012b['isOpening']?'start':'end')})}),_0x1fca03['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x2332a9,'view':_0x289a09});const _0x544044=_0x1fca03['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x544044,'mouseup',(_0x20590e,_0x4304f2)=>{const _0x3cf301=_0x4304f2['target'],_0x47b131=this['_findMarkerElement'](_0x3cf301);if(!_0x47b131)return;const _0x59112e=_0x47b131['getAttribute']('data-marker-id'),_0x192b8f=_0x59112e['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x59112e,'changeId':_0x192b8f,'markerElement':()=>this['_findMarkerElementById'](_0x59112e),'domEvent':_0x4304f2});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x544044,'mouseover',(_0x23be7f,_0x278676)=>{const _0x2db50e=_0x278676['target'],_0x5cb1ab=_0x278676['relatedTarget'];let _0x5a3b6e=this['_findMarkerElement'](_0x2db50e);if(!_0x5a3b6e&&_0x5cb1ab&&(_0x5a3b6e=this['_findMarkerElement'](_0x5cb1ab)),!_0x5a3b6e)return;const _0x14e12d=_0x5a3b6e['getAttribute']('data-marker-id'),_0xfc4e56=_0x14e12d['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0xfc4e56,'markerElement':()=>this['_findMarkerElementById'](_0x14e12d),'domEvent':_0x278676});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x17bcb8((_0x533f79,_0x421493)=>{const _0x4470e1=_0x421493['target'];if(this['_findMarkerElement'](_0x4470e1))return;_0x4470e1['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x1fca03['model']['document']['registerPostFixer'](_0x4bd2e5=>this['_validateMarkers'](_0x1fca03,_0x4bd2e5)),_0x1fca03['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x1fca03));}['getDocumentData'](){const _0x3305da=this['context']['plugins']['get']('AIEditing'),_0x490932=Fs(this['context']),_0x3539d3=_0x490932['model'],_0x319a3a=new _0x15fa01();for(const _0x3db6a4 of _0x3539d3['document']['getRoot']()['getChildren']()){const _0x2b6568=_0x3db6a4['_clone'](!0x0);_0x319a3a['_appendChild'](_0x2b6568);}for(const _0x3a1f0c of _0x3539d3['markers'])_0x319a3a['markers']['set'](_0x3a1f0c['name'],this['_changeRangeOwnerDocument'](_0x3a1f0c['getRange']()['clone'](),_0x319a3a));const _0x2958a4=new _0x451881({'ignoreElementEnd':!0x0,'startPosition':_0x3539d3['createPositionAt'](_0x319a3a,0x0)}),_0x29b4c7=new Set(),_0xb75959=new Map();for(const {item:_0x23f2df}of _0x2958a4){if(!_0x23f2df['is']('$textProxy'))continue;const _0x51b30e=_0x23f2df['parent'];if(_0x51b30e&&_0x51b30e['is']('element')){const _0x318294=this['_upsertDataId'](_0x51b30e,()=>_0x3305da['_nextDataId'](_0x29b4c7));_0x29b4c7['add'](_0x318294);for(const _0x4396bf of _0x51b30e['getChildren']())_0x4396bf['is']('element')&&_0x29b4c7['add'](this['_upsertDataId'](_0x4396bf,()=>_0x3305da['_nextDataId'](_0x29b4c7)));let _0x7b4edc=_0x51b30e;for(;_0x7b4edc['parent']&&!_0x7b4edc['parent']['is']('documentFragment');)_0x7b4edc=_0x7b4edc['parent'],_0x7b4edc['hasAttribute'](_0x2332a9)&&_0x7b4edc['_removeAttribute'](_0x2332a9);_0xb75959['set'](_0x318294,{'path':_0x51b30e['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x7b4edc['_clone'](!0x0),_0x318294,_0x490932['data'])}),_0x2958a4['jumpTo'](_0x3539d3['createPositionAfter'](_0x51b30e));}}return{'content':_0x490932['data']['processor']['toData'](_0x490932['data']['toView'](_0x319a3a)),'version':_0x490932['model']['document']['version'],'elements':_0xb75959};}['diffContent'](_0xfd80b3,_0x2ff586,_0xbbe905=!0x1){const _0x5bc1d4=[],_0x185d05=Fs(this['context']),_0x316c4e=_0x185d05['data']['parse'](_0x2ff586,'$documentFragment'),_0x53dedf=_0x185d05['data']['parse'](_0xfd80b3,'$documentFragment'),_0x3132f6=_0x185d05['model']['createPositionAt'](_0x53dedf,0x0);if(this['_haveSingleTopLevelElement'](_0x316c4e)){if(!this['_hasSameTopLevelElement'](_0x53dedf,_0x316c4e))return _0x5bc1d4;}else{const _0x22694e=_0x185d05['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x53dedf,_0x22694e)||!this['_haveOnlyInlineContent'](_0x316c4e,_0x22694e))return _0x5bc1d4;}const _0x50fb39=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0xfd80b3,_0x2ff586,{'anchor':_0x3132f6,'markDeletions':!0x0})['getOperations']()['filter'](_0x3b5340=>'insert'===_0x3b5340['type']||'marker'===_0x3b5340['type']&&_0x3b5340['name']['startsWith']('$markedRemove')),_0x40b660=this['_groupAdjacentOperations'](_0x50fb39),_0x37e5fa=[];if(_0xbbe905){if(_0x40b660['length']){const _0x2e1ad0=_0x40b660[0x0]['operations'][0x0],_0x333bb6='insert'===_0x2e1ad0['type']?_0x2e1ad0['position']:_0x2e1ad0['newRange']['start'],_0x2dbf56=this['_getPositionLimitingRange'](_0x333bb6,_0x185d05,'inside'),_0x39743b=_0x2dbf56?_0x316c4e['getChild'](0x0)['getChildren']():_0x316c4e['getChildren'](),_0x2e0442=_0x2dbf56||_0x185d05['model']['createRangeIn'](_0x53dedf),_0x4e7ce0=[new _0x46b1c0('$markedRemove:synthetic'+at(),null,_0x2e0442,_0x185d05['model']['document']['model']['markers'],!0x0,_0x185d05['model']['document']['version']+0x1),new _0x2274ec(_0x2e0442['end'],_0x39743b,_0x185d05['model']['document']['version']+0x2)];_0x37e5fa['push']({'operations':_0x4e7ce0,'operationsIsolated':_0x4e7ce0,'groupOffset':0x0});}}else _0x37e5fa['push'](..._0x40b660);let _0x2a7705=0x0;return _0x185d05['model']['change'](_0x4c009a=>{for(let _0x203272=0x0;_0x203272<_0x37e5fa['length'];_0x203272++){const _0x226431=_0x37e5fa[_0x203272],_0x17b15b=_0x4c009a['createDocumentFragment']();for(const _0x56268e of _0x53dedf['getChildren']())_0x4c009a['append'](_0x56268e['_clone'](!0x0),_0x17b15b);for(const _0x50f385 of _0x226431['operationsIsolated'])if('insert'===_0x50f385['type']){const _0x3b55e8=_0x50f385;_0x3b55e8['baseVersion']=null,_0x3b55e8['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x3b55e8,_0x17b15b),_0x4c009a['batch']['addOperation'](_0x50f385),_0x185d05['model']['applyOperation'](_0x50f385);const _0x5f4685='suggestion:insertion:id:authorId:'+_0x2a7705++,_0x2379f2=_0x185d05['model']['createRange'](_0x3b55e8['position'],_0x3b55e8['position']['getShiftedBy'](_0x3b55e8['howMany']));_0x17b15b['markers']['set'](_0x5f4685,_0x2379f2);}else{if('marker'===_0x50f385['type']&&_0x50f385['name']['startsWith']('$markedRemove')){const _0x3a2ec7=_0x50f385,_0x372ee5='suggestion:deletion:id:authorId:'+_0x2a7705++;this['_changeOperationOwnerDocument'](_0x3a2ec7,_0x17b15b),_0x17b15b['markers']['set'](_0x372ee5,_0x3a2ec7['newRange']);}}if(_0xbbe905)_0x5bc1d4['push']({..._0x226431,'context':this['_createGetContentFn'](_0x53dedf,_0x185d05['data']),'content':this['_createGetContentFn'](_0x53dedf,_0x185d05['data'])});else{const _0xade4e3=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x226431['operationsIsolated'][0x0]),_0x17b15b),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x226431['operationsIsolated'][_0x226431['operationsIsolated']['length']-0x1]),_0x17b15b));_0x17b15b['markers']['set'](Ao+'suggestion-context',new _0x25d743(_0xade4e3['start'],_0xade4e3['end'])),_0x5bc1d4['push']({..._0x226431,'context':this['_createGetContextFn'](_0x17b15b,_0x185d05['data'],{'ellipsisBefore':_0xade4e3['hasContentBefore'],'ellipsisAfter':_0xade4e3['hasContentAfter']}),'content':this['_createGetContentFn'](_0x17b15b,_0x185d05['data'])});}}}),_0x5bc1d4;}['markChangePositionInEditorContent'](_0x2e2d48,_0x476593){if(!_0x2e2d48['length'])return;const _0x37c878=_0x2e2d48[0x0]['parent']['id'],_0x4abbba=_0x476593['elements']['get'](_0x37c878);if(!_0x4abbba)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x37c878);const _0x5a91f0=_0x4abbba['path'],_0x3b7a64=Fs(this['context']),_0x3a8baf=_0x3b7a64['model']['document']['history']['getOperations'](_0x476593['version']),_0x1e6764=[];for(const _0xe555b8 of _0x2e2d48){const _0x2ba3be=_0xe555b8['operationsIsolated']['map'](_0x1de999=>this['_translateOperationToEditorContent'](_0x1de999,_0x5a91f0,_0x3b7a64['model']['document']['getRoots']()[0x0]));if(!_0x2ba3be||!_0x2ba3be['length'])continue;const _0x2f948e=_0x2ba3be['every'](_0x63406a=>'marker'===_0x63406a['type']&&_0x63406a['name']['startsWith']('$markedRemove')),_0x6b1fdd={'document':_0x3b7a64['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x6d0e8e=_0x510b2f(_0x2ba3be,_0x3a8baf,_0x6b1fdd)['operationsA'];for(const _0x29b162 of _0x6d0e8e)if('insert'===_0x29b162['type']){const _0x423fd6=_0x29b162,_0x5fa617=_0x423fd6['nodes'];_0x3b7a64['model']['change'](_0x361a20=>{const _0x3b78f4=_0x361a20['createDocumentFragment']();for(const _0x4164c4 of _0x5fa617)_0x361a20['append'](_0x4164c4['_clone'](!0x0),_0x3b78f4);_0x1e6764['push']({'start':_0x423fd6['position'],'end':_0x423fd6['position'],'type':'insert','groupId':_0xe555b8['id'],'content':{'asString':this['_createGetContentFn'](_0x3b78f4,_0x3b7a64['data'])(),'asFragment':_0x3b78f4}});});}else{if('marker'===_0x29b162['type']&&_0x29b162['name']['startsWith']('$markedRemove')){const _0xee7fb8=_0x29b162;let _0x2455fa='remove-text';if(_0x2f948e){const _0xc173f7=this['_findAdjacentContextDistance'](_0xee7fb8['newRange']['start'],'backward',_0x3b7a64['model']['schema']),_0x55104f=this['_findAdjacentContextDistance'](_0xee7fb8['newRange']['end'],'forward',_0x3b7a64['model']['schema']);if(_0xc173f7||_0x55104f){const _0x402db3=_0xee7fb8['newRange']['start']['getShiftedBy'](-_0xc173f7),_0x2508af=_0xee7fb8['newRange']['end']['getShiftedBy'](_0x55104f);_0x1e6764['push']({'start':_0x402db3,'end':_0x2508af,'groupId':_0xe555b8['id'],'type':'remove-context'});}else _0x2455fa='remove-only';}_0x1e6764['push']({'start':_0xee7fb8['newRange']['start'],'end':_0xee7fb8['newRange']['end'],'groupId':_0xe555b8['id'],'type':_0x2455fa});}}}this['_insertMarkers'](_0x1e6764);}['clearAllMarkers'](){const _0x3ea4de=Fs(this['context']);_0x3ea4de['model']['change'](_0x2fd529=>{for(const _0x312a48 of this['_markers']['keys']())_0x3ea4de['model']['markers']['get'](_0x312a48)&&_0x2fd529['removeMarker'](_0x312a48);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){Fs(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){Fs(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0xc09e51){const _0x5c446f=Fs(this['context']),_0x2dc932=_0x5c446f['model'],_0x56eda0=_0xc09e51['map'](_0x512c5d=>this['_getMarkersDataForGroup'](_0x512c5d))['flat']();_0x2dc932['change'](_0x2c5a36=>{for(const _0x27920a of _0x56eda0){const _0x16f964=_0x5c446f['model']['markers']['get'](_0x27920a['id']);if(_0x16f964){if('insert'===_0x27920a['type']){if(!_0x27920a['content'])continue;_0x2dc932['insertContent'](_0x27920a['content']['asFragment']||null,_0x16f964['getRange']()['start']);}else'remove-text'!==_0x27920a['type']&&'remove-only'!==_0x27920a['type']||_0x2dc932['deleteContent'](_0x2dc932['createSelection'](_0x16f964['getRange']()));_0x2c5a36['removeMarker'](_0x27920a['id']),this['_markers']['delete'](_0x27920a['id']);}}});}['rejectChange'](_0xcd4ca7){const _0x1f67c7=Fs(this['context']),_0x3af7cb=this['_getMarkersDataForGroup'](_0xcd4ca7);_0x1f67c7['model']['change'](_0x4b57ee=>{for(const _0x5de41b of _0x3af7cb)_0x4b57ee['removeMarker'](_0x5de41b['id']),this['_markers']['delete'](_0x5de41b['id']);});}['getEditor'](){return Fs(this['context']);}['getMarkerElementForChange'](_0x2611ed){const _0x5ca2d1=Array['from'](this['_markers']['values']())['filter'](_0x33b9db=>_0x33b9db['groupId']===_0x2611ed);if(!_0x5ca2d1['length'])return null;const _0x4139e9=0x1===_0x5ca2d1['length']?_0x5ca2d1[0x0]:this['_sortMarkers'](_0x5ca2d1)[0x0],_0x2a5254=Fs(this['context'])['model']['markers']['get'](_0x4139e9['id']);if(!_0x2a5254)return null;return{'modelRange':_0x2a5254['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x4139e9['id'])};}['getContentElementForChange'](_0x8c517d){const _0xe011f9=Array['from'](this['_markers']['values']())['filter'](_0x32ba18=>_0x32ba18['groupId']===_0x8c517d);if(!_0xe011f9['length'])return null;const _0x3a4b47=0x1===_0xe011f9['length']?_0xe011f9[0x0]:this['_sortMarkers'](_0xe011f9)[0x0],_0x51984c=Fs(this['context']),_0x22c4dd=_0x51984c['model']['markers']['get'](_0x3a4b47['id']);if(!_0x22c4dd)return null;const _0x4b70ea=_0x22c4dd['getRange'](),_0x1c2952=_0x51984c['editing']['view']['getDomRoot']();if(!_0x1c2952||!_0x4b70ea)return null;let _0x17daa9=_0x4b70ea['start']['parent'];for(;_0x17daa9['parent']&&'$root'!==_0x17daa9['parent']['name'];)_0x17daa9=_0x17daa9['parent'];if(!_0x17daa9||!_0x17daa9['name'])return null;const _0x126020=_0x1c2952['querySelector']('[data-marker-id=\x22'+_0x3a4b47['id']+'\x22]');if(!_0x126020)return null;let _0x5e0279=null;_0x51984c['model']['change'](_0x485253=>{_0x5e0279=_0x485253['createDocumentFragment'](),_0x485253['append'](_0x17daa9['_clone'](!0x0),_0x5e0279);});const _0x2b2fe9=_0x51984c['data']['toView'](_0x5e0279)['getChild'](0x0);return _0x126020['closest'](_0x2b2fe9['name']);}['reactivateMarkers'](_0x49295e){const _0x306236=this['_getMarkersDataForGroup'](_0x49295e);if(!_0x306236['length'])return;const _0x19abd2=Array['from'](this['_activeMarkers'])['sort'](),_0x7cbac0=Array['from'](new Set(_0x306236['map'](_0x29086e=>_0x29086e['id'])))['sort']();_0x19abd2['join']('|')!==_0x7cbac0['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x49295e));}['setMarkersInElementAsActive'](_0x2a4b81){const _0x38d060=this['_getMarkersDataForGroup'](_0x2a4b81);if(!_0x38d060['length'])return;const _0x4ec40b=Fs(this['context']),_0xd82490=new Set(_0x38d060['map'](_0x3a90eb=>_0x3a90eb['id'])),_0x52e55a=Array['from'](_0xd82490['values']())['map'](_0x399311=>_0x4ec40b['model']['markers']['get'](_0x399311))['filter'](_0x17f841=>!!_0x17f841);_0xd82490['forEach'](_0x52a63a=>{this['_activeMarkers']['add'](_0x52a63a);}),_0x4ec40b['model']['change'](()=>{_0x52e55a['forEach'](_0x2e171e=>{_0x4ec40b['editing']['reconvertMarker'](_0x2e171e);});});}['setAllMarkersAsInactive'](){const _0x2746d6=Array['from'](this['_activeMarkers']);if(!_0x2746d6['length'])return;this['_activeMarkers']['clear']();const _0x1048a8=Fs(this['context']),_0x47bb95=_0x2746d6['map'](_0xc2385a=>_0x1048a8['model']['markers']['get'](_0xc2385a))['filter'](_0x42d05a=>!!_0x42d05a);_0x1048a8['model']['change'](()=>{_0x47bb95['forEach'](_0x20f58a=>{_0x1048a8['editing']['reconvertMarker'](_0x20f58a);});});}['_getPositionLimitingRange'](_0x231e05,_0x4db785,_0xe1c2ca='outside'){if(!_0x231e05)return null;let _0x5def0a=_0x231e05['parent'];for(;_0x5def0a&&_0x5def0a['parent']&&'$root'!==_0x5def0a['parent']['name']&&!_0x4db785['model']['schema']['isLimit'](_0x5def0a)&&!_0x4db785['model']['schema']['isBlock'](_0x5def0a);)_0x5def0a=_0x5def0a['parent'];if(!_0x5def0a||!_0x5def0a['name']||'$root'===_0x5def0a['name'])return null;let _0x21e246=null;return _0x4db785['model']['change'](_0x1cc647=>{_0x21e246='inside'===_0xe1c2ca?_0x1cc647['createRangeIn'](_0x5def0a):_0x1cc647['createRangeOn'](_0x5def0a);}),_0x21e246;}['_validateMarkers'](_0x357220,_0x564cea){const _0x33d980=Array['from'](this['_markers']['keys']()),_0x20e47a=new Map();for(const _0x4dbf54 of _0x33d980){const _0x55be55=_0x357220['model']['markers']['get'](_0x4dbf54);if(!_0x55be55)continue;const _0x53cbb7=_0x55be55['getStart']()['path'][0x0];_0x20e47a['has'](_0x53cbb7)||_0x20e47a['set'](_0x53cbb7,[]),_0x20e47a['get'](_0x53cbb7)['push'](_0x55be55);}const _0x3aa88c=new Set();for(const _0x50f27e of _0x357220['model']['document']['differ']['getChanges']()){let _0x2c951a=-0x1,_0x6e4a14=null;if('insert'===_0x50f27e['type'])_0x6e4a14=new _0x25d743(_0x50f27e['position'],_0x50f27e['position']['getShiftedBy'](_0x50f27e['length'])),_0x2c951a=_0x50f27e['position']['path'][0x0];else{if('remove'!==_0x50f27e['type'])continue;_0x6e4a14=new _0x25d743(_0x50f27e['position']),_0x2c951a=_0x50f27e['position']['path'][0x0];}const _0x2395b5=_0x20e47a['get'](_0x2c951a)||[];if(_0x2395b5['length']){for(const _0x2a0b2b of _0x2395b5)if(_0x6e4a14['root']['rootName']===_0x2a0b2b['getRange']()['root']['rootName']&&('insert'!==_0x50f27e['type']||!_0x6e4a14['containsRange'](_0x2a0b2b['getRange']()))&&(_0x6e4a14['isIntersecting'](_0x2a0b2b['getRange']())||_0x6e4a14['start']['isTouching'](_0x2a0b2b['getRange']()['end'])||_0x6e4a14['end']['isTouching'](_0x2a0b2b['getRange']()['start']))){const _0x7f54a0=this['_parseMarkerName'](_0x2a0b2b['name']);Array['from'](this['_markers']['values']())['filter'](_0x2cf61a=>_0x2cf61a['groupId']===_0x7f54a0['groupId'])['forEach'](_0x374872=>_0x3aa88c['add'](_0x374872['id']));}}}if(_0x3aa88c['size']){for(const _0x2e4e87 of _0x3aa88c)_0x564cea['removeMarker'](_0x2e4e87);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x4b9d42){for(const {name:_0x2d8351,data:_0xb31489}of _0x4b9d42['model']['document']['differ']['getChangedMarkers']()){if(!_0x2d8351['startsWith'](Ao))continue;const _0x22c09d=_0xb31489['oldRange'],_0x37438a=_0xb31489['newRange'],_0x54db5b=_0x22c09d&&'$graveyard'===_0x22c09d['root']['rootName'],_0x41499f=_0x37438a&&'$graveyard'===_0x37438a['root']['rootName'];if(_0x54db5b&&_0x41499f)continue;const _0x1ca8fb=this['_parseMarkerName'](_0x2d8351);this['_markers']['get'](_0x2d8351)&&(_0x41499f||!_0x37438a?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x2d8351,'changeId':_0x1ca8fb['groupId']}):_0x54db5b&&_0x37438a&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x2d8351,'changeId':_0x1ca8fb['groupId']}));}}['_parseMarkerName'](_0x2e006f){const _0x81efe3=_0x2e006f['split'](':'),_0x5a07ad=(_0x81efe3[0x1]||'')['split']('_');return{'prefix':_0x81efe3[0x0],'groupId':_0x5a07ad[0x0],'suffix':_0x5a07ad[0x1]};}['_translateOperationToEditorContent'](_0x2f91e3,_0x56a49a,_0x48c1db){if('insert'===_0x2f91e3['type']){const _0x49c8eb=_0x2f91e3;return new _0x2274ec(this['_changePosition'](_0x56a49a['concat'](_0x49c8eb['position']['offset']),_0x48c1db),_0x49c8eb['nodes'],_0x49c8eb['baseVersion']);}if('marker'===_0x2f91e3['type']&&_0x2f91e3['name']['startsWith']('$markedRemove')){const _0x4cf2ff=_0x2f91e3;return new _0x46b1c0(_0x4cf2ff['name'],_0x4cf2ff['oldRange'],this['_changeRange'](_0x4cf2ff['newRange'],_0x56a49a['concat'](_0x4cf2ff['newRange']['start']['offset']),_0x56a49a['concat'](_0x4cf2ff['newRange']['end']['offset']),_0x48c1db),_0x4cf2ff['_markers'],_0x4cf2ff['affectsData'],_0x4cf2ff['baseVersion']);}return _0x2f91e3;}['_groupAdjacentOperations'](_0x4b66cc){if(!_0x4b66cc['length'])return[];const _0x2eb41f=[];let _0x1a408c=0x0,_0x1583b8=0x0,_0x10db35=[];for(let _0x381408=0x0;_0x381408<=_0x4b66cc['length'];_0x381408++){const _0x267d40=_0x4b66cc[_0x381408],_0x324290=_0x4b66cc[_0x381408-0x1];!_0x267d40||_0x324290&&!this['_getOperationEnd'](_0x324290)['isTouching'](this['_getOperationStart'](_0x267d40))?(_0x2eb41f['push']({'operations':_0x10db35,'operationsIsolated':_0x10db35['map'](_0x5cfde0=>this['_shiftOperation'](_0x5cfde0['clone'](),-_0x1583b8)),'groupOffset':_0x1a408c}),_0x10db35=_0x267d40?[_0x267d40]:[],_0x1583b8+=_0x1a408c,_0x1a408c=0x0):_0x10db35['push'](_0x267d40),_0x267d40&&'insert'===_0x267d40['type']&&(_0x1a408c+=_0x267d40['howMany']);}return _0x2eb41f;}['_findAdjacentContextDistance'](_0x5493ba,_0x2f08d5,_0x502366,_0x24d50c=0x1){const _0x10458d=new _0x451881({'startPosition':_0x5493ba,'direction':_0x2f08d5});let _0x3531bc=0x0;for(let _0x5aabcb=0x0;_0x5aabcb<_0x24d50c;_0x5aabcb++){let _0x54a0fb=0x0,_0x47e097=!0x1,_0x23f2dd='forward'===_0x2f08d5?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x48b0cd}of _0x10458d)if(_0x48b0cd['is']('$textProxy')){const _0x17c09f=_0x23f2dd['exec'](_0x48b0cd['data']);if(_0x17c09f&&_0x17c09f['length']){if(_0x54a0fb+='forward'===_0x2f08d5?_0x17c09f['index']+_0x17c09f[0x0]['length']:_0x48b0cd['data']['length']-_0x17c09f['index'],_0x17c09f[0x0]['length']!==_0x48b0cd['data']['length'])break;_0x47e097=!0x0,_0x23f2dd='forward'===_0x2f08d5?/^\w+/:/\w+$/;}else{if(_0x47e097)break;_0x54a0fb+=_0x48b0cd['offsetSize'];}}else{if(_0x48b0cd['is']('element')){_0x502366['isInline'](_0x48b0cd)&&!_0x47e097&&(_0x54a0fb+=0x1);break;}}_0x3531bc+=_0x54a0fb,_0x10458d['jumpTo'](_0x5493ba['getShiftedBy']('forward'===_0x2f08d5?_0x3531bc:-_0x3531bc));}return _0x3531bc;}['_getChangeContext'](_0x6d3790,_0x2f0900){const _0x161982=Fs(this['context'])['model']['schema'],_0x417a86=this['_findAdjacentContextDistance'](_0x6d3790,'backward',_0x161982,0x6),_0x42354e=this['_findAdjacentContextDistance'](_0x2f0900,'forward',_0x161982,0x6),_0x36b845=_0x6d3790['getShiftedBy'](-_0x417a86),_0x34ec59=_0x2f0900['getShiftedBy'](_0x42354e);return{'start':_0x36b845,'end':_0x34ec59,'hasContentBefore':!_0x36b845['isAtStart'],'hasContentAfter':!_0x34ec59['isAtEnd']};}['_insertMarkers'](_0x13091b){const _0x1856fc=this['context']['plugins']['get']('AIEditing'),_0x37067b=new Set();Fs(this['context'])['model']['change'](_0x2ca5a8=>{for(const _0x17624f of _0x13091b){const _0x6585c2=''+Ao+_0x17624f['type']+':'+_0x17624f['groupId']+'_'+_0x1856fc['_nextDataId'](_0x37067b);this['_markers']['set'](_0x6585c2,{'id':_0x6585c2,'groupId':_0x17624f['groupId'],'type':_0x17624f['type'],'content':_0x17624f['content']}),_0x2ca5a8['addMarker'](_0x6585c2,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2ca5a8['createRange'](_0x17624f['start'],_0x17624f['end'])});}});}['_createGetContextFn'](_0x9f0616,_0x35a3d5,_0x294c13){let _0x334053='';return()=>{if(!_0x334053){const _0x478c68=_0x35a3d5['toView'](_0x9f0616,{'showSuggestionHighlights':!0x0});let _0x43f8bd=_0x478c68['getChild'](0x0);if(_0x43f8bd['is']('containerElement')||(_0x43f8bd=_0x478c68),!_0x43f8bd)return'';let _0x57ec17=!0x1;const _0x6cb945=[];for(const _0x7c1701 of _0x43f8bd['getChildren']())_0x7c1701['is']('element','span')&&_0x7c1701['hasClass']('ck-ai_review-marker_context-end')&&(_0x57ec17=!0x1),_0x57ec17&&_0x6cb945['push'](_0x7c1701),_0x7c1701['is']('element','span')&&_0x7c1701['hasClass']('ck-ai_review-marker_context-start')&&(_0x57ec17=!0x0);_0x43f8bd['_removeChildren'](0x0,_0x43f8bd['childCount']),_0x294c13?.['ellipsisBefore']&&_0x43f8bd['_appendChild']('…'),_0x43f8bd['_appendChild'](_0x6cb945),_0x294c13?.['ellipsisAfter']&&_0x43f8bd['_appendChild']('…');const _0x2492a4=_0x35a3d5['htmlProcessor']['domConverter']['viewToDom'](_0x478c68),_0x4a703b=_0x35a3d5['htmlProcessor']['htmlWriter']['getHtml'](_0x2492a4);_0x334053=_0x4a703b;}return _0x334053;};}['_createGetContentFn'](_0x1a70e9,_0x42e04e){let _0x5c4e5e='';return()=>(_0x5c4e5e||(_0x5c4e5e=_0x42e04e['stringify'](_0x1a70e9,{'showSuggestionHighlights':!0x0})),_0x5c4e5e);}['_createGetContentUsingDataIdFn'](_0xee29ef,_0x8657eb,_0x1654c7){let _0xe3c8e9='';return()=>{if(!_0xe3c8e9){const _0x4863ad=_0x1654c7['toView'](new _0x15fa01(_0xee29ef)),_0x4a0189=_0x1654c7['htmlProcessor']['domConverter']['viewToDom'](_0x4863ad)['querySelector']('[data-id=\x22'+_0x8657eb+'\x22]');_0xe3c8e9=_0x4a0189?.['outerHTML']||'';}return _0xe3c8e9;};}['_findMarkerElement'](_0x4db77c,_0x3c4d83=0x5){let _0x20d763=_0x4db77c,_0x27e32f=null;for(let _0x4bd20c=0x0;_0x4bd20c<_0x3c4d83&&_0x20d763;_0x4bd20c++){if(!_0x20d763['className']){_0x20d763=_0x20d763['parentElement'];continue;}if(!(''+_0x20d763['className'])['includes']('ck-ai_review-marker_')){_0x20d763=_0x20d763['parentElement'];continue;}if(!_0x20d763['getAttribute']('data-marker-id'))break;_0x27e32f=_0x20d763;break;}return _0x27e32f;}['_findMarkerElementById'](_0x1d6437){const _0x11205e=Fs(this['context']),_0x515534=_0x11205e['model']['markers']['get'](_0x1d6437);return _0x515534?_0x5686b2(_0x11205e['editing'],_0x515534):null;}['_getMarkersDataForGroup'](_0x28d41c){return Array['from'](this['_markers']['values']())['filter'](_0x42a8b5=>_0x42a8b5['groupId']===_0x28d41c);}['_getOperationStart'](_0x1f693e){return'insert'===_0x1f693e['type']?_0x1f693e['position']:_0x1f693e['newRange']['start'];}['_getOperationEnd'](_0x3fcd2f,_0x18bf01=!0x1){return'insert'===_0x3fcd2f['type']?_0x18bf01?_0x3fcd2f['position']:_0x3fcd2f['position']['getShiftedBy'](_0x3fcd2f['howMany']):_0x3fcd2f['newRange']['end'];}['_shiftOperation'](_0x4a54de,_0x3e628e){return'insert'===_0x4a54de['type']?_0x4a54de['position']=_0x4a54de['position']['getShiftedBy'](_0x3e628e):'marker'===_0x4a54de['type']&&_0x4a54de['newRange']&&(_0x4a54de['newRange']=new _0x25d743(_0x4a54de['newRange']['start']['getShiftedBy'](_0x3e628e),_0x4a54de['newRange']['end']['getShiftedBy'](_0x3e628e))),_0x4a54de;}['_changeOperationOwnerDocument'](_0x4379e1,_0x308c7a){'insert'===_0x4379e1['type']?_0x4379e1['position']=this['_changePositionOwnerDocument'](_0x4379e1['position'],_0x308c7a):'marker'===_0x4379e1['type']&&_0x4379e1['newRange']&&(_0x4379e1['newRange']=this['_changeRangeOwnerDocument'](_0x4379e1['newRange'],_0x308c7a));}['_changePositionOwnerDocument'](_0x16a574,_0x4942bb){return new _0x5f4486(_0x4942bb,_0x16a574['path']);}['_changeRangeOwnerDocument'](_0x3d805d,_0x2f79c6){return new _0x25d743(this['_changePositionOwnerDocument'](_0x3d805d['start'],_0x2f79c6),this['_changePositionOwnerDocument'](_0x3d805d['end'],_0x2f79c6));}['_changePosition'](_0x1cfe68,_0x71578c){return new _0x5f4486(_0x71578c,[..._0x1cfe68]);}['_changeRange'](_0x14c876,_0x214bcd,_0x44972a,_0x2326b0){return new _0x25d743(this['_changePosition'](_0x214bcd,_0x2326b0),this['_changePosition'](_0x44972a,_0x2326b0));}['_sortMarkers'](_0x5a0311){const _0x21f1c9=_0xaa33b8=>{switch(_0xaa33b8){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x5a0311['sort']((_0x2e830f,_0x142220)=>_0x21f1c9(_0x2e830f['type'])-_0x21f1c9(_0x142220['type']));}['_hasSameTopLevelElement'](_0x109d70,_0x33cc63){const _0x37ceef=_0x109d70['getChild'](0x0),_0x45dc2d=_0x33cc63['getChild'](0x0);return!(!_0x37ceef||!_0x45dc2d)&&((!_0x37ceef['is']('element')||!_0x45dc2d['is']('element')||_0x37ceef['name']===_0x45dc2d['name'])&&!(_0x37ceef['is']('element')&&!_0x45dc2d['is']('element')||!_0x37ceef['is']('element')&&_0x45dc2d['is']('element')));}['_haveSingleTopLevelElement'](_0x470f35){return 0x1===_0x470f35['childCount'];}['_haveOnlyInlineContent'](_0x1507d2,_0x2423eb){for(const _0x9cb310 of _0x1507d2['getChildren']())if(_0x9cb310['is']('element')&&!_0x2423eb['isInline'](_0x9cb310))return!0x1;return!0x0;}['_upsertDataId'](_0x8e95c3,_0x5732df){let _0x1e24d7=_0x8e95c3['getAttribute'](_0x2332a9);return _0x1e24d7||(_0x1e24d7=_0x5732df(),_0x8e95c3['_setAttribute'](_0x2332a9,_0x1e24d7)),_0x1e24d7;}}class Io extends pt(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0xa42051,contentNew:_0x2316ff,contentInitial:_0x28e90e,documentVersion:_0x3c77ee}){super(),this['id']=_0xa42051,this['contentNew']=_0x2316ff,this['contentInitial']=_0x28e90e,this['documentVersion']=_0x3c77ee;}}class Eo extends ht(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x2dab11,_0x4b2928,_0x2d89ad){super(),this['id']=_0x2dab11,this['parent']=_0x2d89ad,this['_data']=_0x4b2928,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 To extends ht(){['id']=at();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x1220e6,_0x147064,_0x70912d,_0x36f587,_0x229a1e){super(),this['_sourceCheck']=_0x147064,this['_documentData']=_0x1220e6,this['_aiConnector']=_0x70912d,this['_reviewParams']=_0x36f587,this['_reviewArgs']=_0x229a1e,this['on']('change:status',(_0x52f220,_0x4fd07a,_0x1647c9)=>{'aborted'==_0x1647c9&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x1647c9,'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'](_0x3952a=>'pending'===_0x3952a['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x2204f6){this['_documentData']=_0x2204f6;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x2d4c1f=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x20dc38 of _0x2d4c1f)'unmodified'!==_0x20dc38['data']['operation']&&('error'!==_0x20dc38['data']['operation']?'review-metadata'!==_0x20dc38['event']?this['_addReviewCheckResult'](_0x20dc38['data']['dataId'],_0x20dc38['data']['textDelta']):this['callId']=_0x20dc38['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(_0x31c7df){this['_currentError']=_0x31c7df,_0x31c7df instanceof Error&&_0x31c7df['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'](_0x53b412,_0x3fbdf4){const _0x202a05=this['_results']['get'](_0x53b412);if(!_0x202a05)return;if(0x0===_0x3fbdf4['length'])return;const _0x3d9042=[];_0x3fbdf4['forEach']((_0x5b2d01,_0x98c49e)=>{const _0x5fb60a=new Eo(_0x202a05['id']+'-'+_0x98c49e,_0x5b2d01,_0x202a05);_0x5fb60a['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x5fb60a,'status':_0x5fb60a['status']});}),_0x5fb60a['on']('change:isActivated',()=>{_0x5fb60a['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x5fb60a}):this['fire']('reviewCheckResultDeactivated',{'change':_0x5fb60a});}),this['_changes']['push'](_0x5fb60a),_0x3d9042['push'](_0x5fb60a);}),this['fire']('reviewCheckResultReady',{'changes':_0x3d9042,'result':_0x202a05,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x48470c){const _0xd0874d=this['_changes']['find'](_0xaa176=>_0xaa176['id']===_0x48470c);return!(!_0xd0874d||'pending'!==_0xd0874d['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x554ece=>!0x0===_0x554ece['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x7ec6ec=>'pending'===_0x7ec6ec['status']);}['getChangeById'](_0x5e8aec){return this['_changes']['find'](_0x2927e7=>_0x2927e7['id']===_0x5e8aec);}['markAllChangesAsAccepted'](){for(const _0x490c9a of this['_changes'])'pending'===_0x490c9a['status']&&(_0x490c9a['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x4e99bd){const _0x5e5e89=this['_changes']['find'](_0x565e2f=>_0x565e2f['id']===_0x4e99bd);_0x5e5e89&&'pending'===_0x5e5e89['status']&&(_0x5e5e89['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x4d83a7){const _0x498ec4=this['_changes']['find'](_0x40ab14=>_0x40ab14['id']===_0x4d83a7);_0x498ec4&&'pending'===_0x498ec4['status']&&(_0x498ec4['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x58e86b){const _0x7421fe=this['_changes']['find'](_0x55206e=>_0x55206e['id']===_0x58e86b);_0x7421fe&&'pending'===_0x7421fe['status']&&(_0x7421fe['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x51eceb){const _0x3d424a=this['_changes']['find'](_0x3f25e2=>_0x3f25e2['id']===_0x51eceb);_0x3d424a&&'outdated'===_0x3d424a['status']&&(_0x3d424a['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x1f7870){this['_changes']['filter'](_0x6ee7e7=>_0x6ee7e7['isActivated']&&_0x6ee7e7['id']!==_0x1f7870)['forEach'](_0x4f65f8=>{_0x4f65f8['isActivated']=!0x1;});const _0x415914=this['_changes']['find'](_0x59194e=>_0x59194e['id']===_0x1f7870);_0x415914&&'pending'===_0x415914['status']&&(_0x415914['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x1fa923=>_0x1fa923['isActivated'])['forEach'](_0x4dafb7=>{_0x4dafb7['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x386c8a){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x3ef721;if(_0x386c8a){const _0x397599=this['_changes']['find'](_0x23755d=>_0x23755d['id']===_0x386c8a);if(_0x397599&&_0x397599['isRated'])return;_0x397599&&(_0x3ef721=_0x397599['parent']['id'],_0x397599['isRated']=!0x0);}const _0x50fcdb={'positiveCount':this['_changes']['filter'](_0x51b8b3=>'accepted'===_0x51b8b3['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x50fcdb,this['callId'],_0x3ef721);}['_addReviewCheckResult'](_0x26eb14,_0x573ece){const _0x54c7d5=this['_documentData']['elements']['get'](_0x26eb14);if(!_0x54c7d5)return;const _0x5f5313=_0x54c7d5['getContent']();if(_0x5f5313===_0x573ece)return;const _0x693abb=new Io({'id':_0x26eb14,'contentInitial':_0x5f5313,'contentNew':_0x573ece,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x693abb['id'],_0x693abb),this['fire']('reviewCheckResultAdded',{'result':_0x693abb,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0xa1a377=>'pending'===_0xa1a377['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x54c9d3=>'pending'===_0x54c9d3['status'])['length']&&(this['status']='finished'));}}class po extends To{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0xe26dda=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0xa49047=0x0;_0xa49047<this['_reviewParams']['length'];_0xa49047++){if(!this['_reviewParams'][_0xa49047]||!this['_sourceCheck']['options'][_0xa49047])continue;const _0x505195=this['_sourceCheck']['options'][_0xa49047],_0xef7c8=_0x505195['data']?.['find'](_0x50e4f0=>_0x50e4f0['id']===this['_reviewParams'][_0xa49047]);_0xef7c8&&_0xe26dda['push'](_0xef7c8['label']);}return _0xe26dda['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x7e5b7f,_0x43d08c,_0x1e7f6a){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x43d08c,_0x7e5b7f,_0x1e7f6a);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class mo extends _0x3627a2{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[rs];}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(_0x4d5490,_0x3b3a40)=>{const _0x4d41f5=this['_aiReviewCheckList']['getCheckById'](_0x3b3a40['id']);if(_0x4d41f5){this['_onReviewCheckRun'](_0x3b3a40),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x3b3a40,_0x4d41f5),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x53355f,_0x3738c5)=>{switch(_0x3738c5['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x3738c5);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 ot('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new ot('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'!==_0x3738c5['status']&&'error-chunk'!==_0x3738c5['status']&&'error-general'!==_0x3738c5['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x4d65ff,_0x232ac8)=>{if(!this['_currentReviewCheckRun'])throw new ot('ai-review-mode-no-current-check-run',this);const _0x39bd05=this['_diffContent'](_0x232ac8['result']['contentInitial'],_0x232ac8['result']['contentNew']);_0x232ac8['source']['addResultChanges'](_0x232ac8['result']['id'],_0x39bd05);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x500432,_0x23f9f4)=>{for(const _0x2401e6 of _0x23f9f4['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x2401e6);this['_markChangePositionInEditorContent'](_0x23f9f4['changes'],_0x23f9f4['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x42ab97,_0xb0780a)=>{this['_aiReviewCoreUi']['updateChangeState'](_0xb0780a['change']['id'],_0xb0780a['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x58404c,_0xcf670a)=>{this['_onReviewCheckResultActivated'](_0xcf670a);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x4c3921){_0x4c3921 instanceof Error&&_0x4c3921['message']['includes']('ai-request-aborted')||(_0x4c3921 instanceof ot?this['_logError'](_0x4c3921):this['_logError'](new ot('ai-review-mode-check-run-failed',this,void 0x0,_0x4c3921)));}}else this['_logError'](new ot('ai-review-mode-source-check-not-found',this,{'checkId':_0x3b3a40['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 _0x2cd676=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x2cd676['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x2cd676['map'](_0x11aacd=>_0x11aacd['id']));const _0x1b37b7=this['_currentReviewCheckRun'];_0x1b37b7['markAllChangesAsAccepted'](),_0x1b37b7['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x6a2a,_0x39fb9a)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x39fb9a['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x39fb9a['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x39fb9a['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x39fb9a['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x3db8a7,_0x1f0502)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x1f0502['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x1f0502['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x1f0502['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x1f0502['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',(_0x50d085,_0x59dfbc)=>{this['_onActivateChange'](_0x59dfbc);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x10ab83,_0x406173)=>{this['_onDeactivateChange'](_0x406173);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x15784c,_0x31475d)=>{this['_onChangeMarkerClicked'](_0x15784c,_0x31475d);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x3dc691,_0x1dd72d)=>{this['_onChangeMarkerHovered'](_0x3dc691,_0x1dd72d);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x2f909a,_0x31f5db)=>{this['_onChangeMarkerRemoved'](_0x2f909a,_0x31f5db);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x4b2d55,_0x47dc0f)=>{this['_onChangeMarkerRestored'](_0x4b2d55,_0x47dc0f);});}['_createReviewCheckRun'](_0x56cfd8,_0xe9f3a1){return new po(this['_aiReviewCoreEditing']['getDocumentData'](),_0xe9f3a1,this['_aiConnector'],_0x56cfd8['params'],_0x56cfd8['args']);}['_onChangeMarkerRemoved'](_0x1025c2,_0x2069de){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x2069de['changeId']);}['_onChangeMarkerRestored'](_0xabf8f3,_0x2885e8){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x2885e8['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x5cb5ae=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x5cb5ae&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x48efa9=this['_aiReviewCoreEditing']['getEditor']();_0x48efa9&&_0x48efa9['editing']['view']['change'](_0xfeeff5=>{const _0xdf3c85=_0x48efa9['editing']['view']['document']['getRoot']();_0xfeeff5['removeClass']('ck-ai_review-diff',_0xdf3c85),_0xfeeff5['removeClass']('ck-ai_review-highlights',_0xdf3c85),_0xfeeff5['removeClass']('ck-ai-translate-mode-content',_0xdf3c85);});}['_getTranslationWithDefault'](_0x44acdd,_0xc21f58){const _0x1b9871=as(this['context']['locale'],_0x44acdd);return _0x1b9871===_0x44acdd?_0xc21f58:_0x1b9871;}['_logError'](_0x858840,_0x4e0185=!0x1){Et(_0x858840['message']),_0x4e0185||(_0x858840['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x374dd6){if('content'===this['_changeActivationSource']){const _0x3e3278=this['_aiReviewCoreUi']['getChangeElement'](_0x374dd6);_0x3e3278&&wt(_0x3e3278['closest']('.ck-ai_review__check-run-result')||_0x3e3278);}else{if('panel'===this['_changeActivationSource']){const _0x51f25f=this['_getChangeContentElement'](_0x374dd6);if(!_0x51f25f)return;mt({'target':_0x51f25f,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}const Co=[{'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 wo{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x3a8ae6){this['id']=_0x3a8ae6['id'],this['commandId']=_0x3a8ae6['commandId'],this['title']=_0x3a8ae6['title'],this['description']=_0x3a8ae6['description'],this['isParameterized']=_0x3a8ae6['isParameterized'],this['useArgs']=_0x3a8ae6['useArgs'],this['options']=_0x3a8ae6['options'],this['args']=_0x3a8ae6['args'];}}class fo extends ht(){['_checks']=[];['setupChecks'](_0xe3aa96){this['_checks']=_0xe3aa96['map'](_0x584e22=>new wo(_0x584e22));}get['checks'](){return this['_checks'];}['getCheckById'](_0x3e6351){return this['checks']['find'](_0x7bb0e1=>_0x7bb0e1['id']===_0x3e6351);}['removeCheckById'](_0x49c128){this['_checks']=this['_checks']['filter'](_0x1f6bef=>_0x1f6bef['id']!==_0x49c128);}}class So extends wo{['_models']=[];['_defaultModel']=null;constructor(_0x20f6e4,_0x3863c5,_0x219ce1){super(_0x20f6e4),this['_models']=_0x3863c5,this['_defaultModel']=_0x219ce1;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class bo extends wo{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x5c27a2,_0xe4cf5f,_0x29e5ea){super(_0x5c27a2),this['prompt']=_0x5c27a2['prompt'],this['model']=_0x5c27a2['model'],this['model']?this['_defaultModel']=_0xe4cf5f['find'](_0x389e28=>_0x389e28['id']===this['model'])||null:this['_defaultModel']=_0x29e5ea;}get['defaultModel'](){return this['_defaultModel'];}}class Ro extends fo{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x5843f6,_0x9d7929,_0x3cc445){super(),this['_allModels']=_0x5843f6,this['_recommendedModels']=_0x9d7929,this['_defaultModel']=_0x3cc445;}['setupChecks'](_0x1dd1ec){this['_checks']=_0x1dd1ec['map'](_0x3994c4=>!0x0===_0x3994c4['isExtra']?new bo(_0x3994c4,this['_allModels'],this['_defaultModel']):'custom'===_0x3994c4['id']?new So(_0x3994c4,this['_recommendedModels'],this['_defaultModel']):new wo(_0x3994c4));}}class Oo extends To{['_prompt'];['_model'];constructor(_0x323bba,_0x3352f7,_0x21305d,_0x14d741,_0x1d9e22){super(_0x21305d,_0x14d741,_0x1d9e22),this['_prompt']=_0x323bba,this['_model']=_0x3352f7;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0xc9e1b1,_0x199a36,_0x18d67d){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x199a36,_0xc9e1b1,_0x18d67d);}}class ko extends Oo{get['subTitle'](){return'';}set['prompt'](_0x557de5){this['_prompt']=_0x557de5;}set['model'](_0x90fdfe){this['_model']=_0x90fdfe;}}class No extends mo{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x5c22dc){super(_0x5c22dc),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',Co['map'](_0x266cba=>_0x266cba['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x2bd80f,_0x5f2494)=>{this['_isDiffOn']=_0x5f2494['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x5cb794,_0x7543a3){return _0x5cb794['isCustom']?new Oo(_0x5cb794['args']['prompt'],_0x5cb794['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x7543a3,this['_aiConnector']):_0x7543a3['isExtra']?new ko(_0x7543a3['prompt'],_0x7543a3['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x7543a3,this['_aiConnector']):new po(this['_aiReviewCoreEditing']['getDocumentData'](),_0x7543a3,this['_aiConnector'],_0x5cb794['params'],_0x5cb794['args']);}['_onReviewCheckResultActivated'](_0x1c1950){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x1c1950['change']['id']),this['_scrollToChange'](_0x1c1950['change']['id']);const _0x3b260a=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x1c1950['change']['id']);if(!_0x3b260a)return;const _0x132151=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x1c1950['change'],()=>_0x3b260a['getElement'](),void 0x0,'click',_0x132151?.['editing']?.['view']?.['getDomRoot'](),_0x132151?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x1c1950['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x407a60){this['_currentReviewCheckRun']&&'click'===_0x407a60['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x407a60['id']));}['_onDeactivateChange'](_0x101f48){this['_currentReviewCheckRun']&&'balloon'===_0x101f48['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x4c9ac5,_0x3965e8){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x3965e8['changeId']);const _0x2daf3b=this['_currentReviewCheckRun']['getChangeById'](_0x3965e8['changeId']);if(!_0x2daf3b)return;const _0x7a5ccc=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x2daf3b,_0x3965e8['markerElement'],_0x3965e8['domEvent'],'click',_0x7a5ccc?.['editing']?.['view']?.['getDomRoot'](),_0x7a5ccc?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0xc8fc5a,_0x13f643){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x327a96=this['_currentReviewCheckRun']['getChangeById'](_0x13f643['changeId']);if(!_0x327a96)return;const _0x5a4589=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x327a96,_0x13f643['markerElement'],_0x13f643['domEvent'],'hover',_0x5a4589?.['editing']?.['view']?.['getDomRoot'](),_0x5a4589?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x1a66ee){const _0x4ab270=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x1a66ee);return _0x4ab270?_0x4ab270['getElement']():null;}['_markChangePositionInEditorContent'](_0x4270b9,_0x5ec8de){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x4270b9,_0x5ec8de);}['_diffContent'](_0x1e3bc9,_0x1d834e){return this['_aiReviewCoreEditing']['diffContent'](_0x1e3bc9,_0x1d834e);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x21b76d){const _0x37257a=this['_aiReviewCoreEditing']['getEditor']();_0x21b76d?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x37257a&&_0x37257a['editing']['view']['change'](_0x4de58a=>{const _0x2c70ac=_0x37257a['editing']['view']['document']['getRoot']();for(const _0x111765 of _0x2c70ac['getClassNames']())_0x111765['startsWith']('ck-ai_review-')&&_0x4de58a['removeClass'](_0x111765,_0x2c70ac);_0x4de58a['addClass'](_0x21b76d?'ck-ai_review-diff':'ck-ai_review-highlights',_0x2c70ac);});}async['_getChecksList'](){const _0x28cfcd=[...Co,...this['_getExtraChecks']()],_0x35a489=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x35a489,_0x28cfcd);let _0x3a917b=_0x28cfcd;this['_hasDefaultAvailableCommands']||(_0x3a917b=_0x35a489['map'](_0x2acfdc=>_0x28cfcd['find'](_0x561b19=>_0x561b19['id']===_0x2acfdc))['filter'](_0x126000=>!!_0x126000)),_0x3a917b=_0x3a917b['map'](_0x4563c7=>_0x4563c7['isExtra']?_0x4563c7:this['_translateReviewCheck'](_0x4563c7));const _0x1d9f6b=_0x3a917b['some'](_0x105071=>_0x105071['isExtra']||'custom'===_0x105071['id']);let _0x31e450=[],_0x2d35df=[],_0x26b92d=null;if(_0x1d9f6b){const _0x401d94=await this['_getModels']();_0x31e450=_0x401d94['all'],_0x2d35df=_0x401d94['recommended'],_0x26b92d=_0x401d94['default'];}const _0x458f3e=new Ro(_0x31e450,_0x2d35df,_0x26b92d);return _0x458f3e['setupChecks'](_0x3a917b),_0x1d9f6b&&this['_filterChecksWithMissingModel'](_0x458f3e),_0x458f3e;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x561450=>({'id':_0x561450['id'],'commandId':_0x561450['id'],'title':_0x561450['label'],'description':_0x561450['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x561450['prompt'],'model':_0x561450['model']}));}['_logErrorForNonExistentChecks'](_0x3ccdb5,_0x2443a2){const _0x5a9eab=_0x3ccdb5['filter'](_0xe5d143=>!_0x2443a2['some'](_0x157cce=>_0x157cce['id']===_0xe5d143));_0x5a9eab['length']&&this['_logError'](new ot('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x5a9eab['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x9d23df=new Bs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x9d23df['getAll'](),'recommended':await _0x9d23df['getAvailableModels'](),'default':await _0x9d23df['getDefault']()};}catch(_0x1766b9){return this['_logError'](new ot('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x1766b9)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x593b20){const _0x198ee6='AI_REVIEW_CHECK_'+_0x593b20['id']['toUpperCase']()['replaceAll']('-','_'),_0x3a8ea3={..._0x593b20,'title':this['_getTranslationWithDefault'](_0x198ee6+'_TITLE',_0x593b20['title']),'description':this['_getTranslationWithDefault'](_0x198ee6+'_DESCRIPTION',_0x593b20['description'])};return _0x593b20['options']&&(_0x3a8ea3['options']=_0x593b20['options']['map'](_0xceadd6=>({..._0xceadd6,'label':this['_getTranslationWithDefault'](_0x198ee6+'_OPTIONS_LABEL',_0xceadd6['label']||''),'data':_0xceadd6['data']?_0xceadd6['data']['map'](_0x731340=>({..._0x731340,'label':this['_getTranslationWithDefault'](_0x198ee6+'_OPTIONS_DATA_'+_0x731340['id']['toUpperCase'](),_0x731340['label'])})):void 0x0}))),_0x3a8ea3;}['_filterChecksWithMissingModel'](_0x269353){const _0x49db3a=[];_0x269353['checks']['forEach'](_0x4b5579=>{(_0x4b5579 instanceof bo&&!_0x4b5579['defaultModel']||_0x4b5579 instanceof So&&!_0x4b5579['models']['length'])&&_0x49db3a['push'](_0x4b5579['id']);}),_0x49db3a['length']&&_0x49db3a['forEach'](_0x177344=>{_0x269353['removeCheckById'](_0x177344),this['_logError'](new ot('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x177344}),!0x0);});}}class vo extends _0x3627a2{static get['requires'](){return[No,_o,go];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class yo extends wo{get['apiId'](){return'translate';}}class xo extends fo{['setupChecks'](_0x25d70b){this['_checks']=_0x25d70b['map'](_0x56bd59=>new yo(_0x56bd59));}}class Lo extends po{['_title'];constructor(_0x1908eb,_0x29d87e,_0x5cb362,_0x629239,_0x27843c,_0xa5938d){super(_0x1908eb,_0x29d87e,_0x5cb362,_0x27843c,_0xa5938d),this['_title']=_0x629239;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class Do extends mo{static get['pluginName'](){return'AITranslateController';}constructor(_0x2b908d){super(_0x2b908d),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'](_0x2a30ce,_0x1f92c2){return new Lo(this['_aiReviewCoreEditing']['getDocumentData'](),_0x1f92c2,this['_aiConnector'],as(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x2a30ce['params'],_0x2a30ce['args']);}['_onReviewCheckResultActivated'](_0x59dd73){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x59dd73['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x59dd73['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x52bb25){this['_currentReviewCheckRun']&&('hover'===_0x52bb25['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x52bb25['id'])),'click'===_0x52bb25['uiInteraction']&&this['_scrollToChange'](_0x52bb25['id']));}['_onDeactivateChange'](_0x397ba5){this['_currentReviewCheckRun']&&'panel'===_0x397ba5['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x30386f,_0x1c063c){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x1c063c['changeId']),this['_scrollToChange'](_0x1c063c['changeId']));}['_onChangeMarkerHovered'](_0x384e13,_0x5368e6){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x5368e6['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x5368e6['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x268894){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x268894);}['_markChangePositionInEditorContent'](_0x2b8df7,_0xa9b686){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x2b8df7,_0xa9b686);}['_diffContent'](_0x540cde,_0x5cb2e5){return this['_aiReviewCoreEditing']['diffContent'](_0x540cde,_0x5cb2e5,!0x0);}['_onReviewCheckRun'](){const _0x4752f8=this['_aiReviewCoreEditing']['getEditor']();_0x4752f8&&_0x4752f8['editing']['view']['change'](_0x67d6f5=>{const _0x1619d4=_0x4752f8['editing']['view']['document']['getRoot']();for(const _0x4eca55 of _0x1619d4['getClassNames']())(_0x4eca55['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0x4eca55)&&_0x67d6f5['removeClass'](_0x4eca55,_0x1619d4);_0x67d6f5['addClass']('ck-ai-translate-mode-content',_0x1619d4);});}async['_getChecksList'](){const _0x13c5a6=[],_0x300a62=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x1971a3 of _0x300a62)_0x13c5a6['push']({'title':_0x1971a3['label'],'id':_0x1971a3['id'],'commandId':_0x1971a3['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x1971a3['id']}});const _0x4281b7=new xo();return _0x4281b7['setupChecks'](this['_translateChecks'](_0x13c5a6)),_0x4281b7;}['_translateChecks'](_0x186dc1){return _0x186dc1['map'](_0xfb15b6=>{const _0x5be938='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0xfb15b6['title']['toUpperCase']()['replaceAll']('-','_');return{..._0xfb15b6,'title':this['_getTranslationWithDefault'](_0x5be938,_0xfb15b6['title'])};});}}class Po extends io{constructor(_0xb86dd6,_0x59d424){super(_0xb86dd6,_0x59d424),this['on']('set:isLoading',(_0x35acdf,_0x3d0ef7,_0x5452e7)=>{_0x5452e7&&(this['headerTitle']=as(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x4e7480,_0x26b026,_0x248169)=>{_0x248169&&(this['headerTitle']=as(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x384a93=super['_createAcceptAllButtonView']();return _0x384a93['set']('label',as(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x384a93;}['_createExitReviewButtonView'](){const _0x2580c0=super['_createExitReviewButtonView']();return _0x2580c0['set']('label',as(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x2580c0;}}class Ho extends uo{['_setupTemplate'](){const _0x56894d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x56894d['if']('isVisible','ck-hidden',_0x2a5fdf=>!_0x2a5fdf)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':as(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':as(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x56894d['if']('isVisible','ck-hidden',_0x4f4d84=>!_0x4f4d84)]},'children':this['_checkViews']}]});}}class Mo extends Ja{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0xcb9b71=this['context']['locale'],_0x33b561=new _0x222d65(_0xcb9b71,{'label':as(_0xcb9b71,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x2c155e,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x216f2e=new to(_0xcb9b71,{'header':_0x33b561,'list':new Ho(_0xcb9b71),'results':new Po(_0xcb9b71,{'generalErrorText':as(_0xcb9b71,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new so(_0xcb9b71,{'headerText':as(_0xcb9b71,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':as(_0xcb9b71,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':as(_0xcb9b71,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x216f2e['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x216f2e;}['registerTab'](){const _0x33c1fd=this['context']['plugins']['get']('AITabs');_0x33c1fd['view']['on']('activateTab',(_0x333bbf,_0x26e1d2)=>{'translate'===_0x26e1d2?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x33c1fd['view']['addTab']({'id':'translate','buttonLabel':as(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x2c155e,'order':0x0,'content':this['_mainView']});}}class Uo extends _0x3627a2{static get['requires'](){return[Do,Mo,go];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{qa as AIActions,Si as AIAdapter,qi as AIAssistant,Wi as AIAssistantUI,ma as AIBalloon,la as AIChat,Ys as AIChatController,ca as AIChatHistory,ha as AIChatHistoryController,ra as AIChatHistoryUI,Aa as AIChatShortcuts,Zr as AIChatUI,rs as AIConnector,qs as AIEditing,ba as AIEditorIntegration,Qa as AIQuickActions,Ma as AIQuickActionsUI,bi as AIRequestError,wo as AIReviewCheck,Io as AIReviewCheckResult,To as AIReviewCheckRun,vo as AIReviewMode,mo as AIReviewModeController,go as AIReviewModeEditing,_o as AIReviewModeUI,ns as AITabs,Xi as AITextAdapter,Ia as AIToggleButtonUI,Uo as AITranslate,Do as AITranslateController,Mo as AITranslateUI,ji as AWSTextAdapter,zi as OpenAITextAdapter,Oi as ShowAIAssistantCommand,ga as ToggleAICommand,ls as createResizeButton,Qi as getDefaultAICommands};