@ckeditor/ckeditor5-ai 47.4.0-alpha.1 → 47.4.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (292) hide show
  1. package/build/ai.js +1 -1
  2. package/dist/index.js +5 -5
  3. package/dist/translations/af.js +1 -1
  4. package/dist/translations/af.umd.js +1 -1
  5. package/dist/translations/ar.js +1 -1
  6. package/dist/translations/ar.umd.js +1 -1
  7. package/dist/translations/ast.js +1 -1
  8. package/dist/translations/ast.umd.js +1 -1
  9. package/dist/translations/az.js +1 -1
  10. package/dist/translations/az.umd.js +1 -1
  11. package/dist/translations/be.js +1 -1
  12. package/dist/translations/be.umd.js +1 -1
  13. package/dist/translations/bg.js +1 -1
  14. package/dist/translations/bg.umd.js +1 -1
  15. package/dist/translations/bn.js +1 -1
  16. package/dist/translations/bn.umd.js +1 -1
  17. package/dist/translations/bs.js +1 -1
  18. package/dist/translations/bs.umd.js +1 -1
  19. package/dist/translations/ca.js +1 -1
  20. package/dist/translations/ca.umd.js +1 -1
  21. package/dist/translations/cs.js +1 -1
  22. package/dist/translations/cs.umd.js +1 -1
  23. package/dist/translations/da.js +1 -1
  24. package/dist/translations/da.umd.js +1 -1
  25. package/dist/translations/de-ch.js +1 -1
  26. package/dist/translations/de-ch.umd.js +1 -1
  27. package/dist/translations/de.js +1 -1
  28. package/dist/translations/de.umd.js +1 -1
  29. package/dist/translations/el.js +1 -1
  30. package/dist/translations/el.umd.js +1 -1
  31. package/dist/translations/en-au.js +1 -1
  32. package/dist/translations/en-au.umd.js +1 -1
  33. package/dist/translations/en-gb.js +1 -1
  34. package/dist/translations/en-gb.umd.js +1 -1
  35. package/dist/translations/en.js +1 -1
  36. package/dist/translations/en.umd.js +1 -1
  37. package/dist/translations/eo.js +1 -1
  38. package/dist/translations/eo.umd.js +1 -1
  39. package/dist/translations/es-co.js +1 -1
  40. package/dist/translations/es-co.umd.js +1 -1
  41. package/dist/translations/es.js +1 -1
  42. package/dist/translations/es.umd.js +1 -1
  43. package/dist/translations/et.js +1 -1
  44. package/dist/translations/et.umd.js +1 -1
  45. package/dist/translations/eu.js +1 -1
  46. package/dist/translations/eu.umd.js +1 -1
  47. package/dist/translations/fa.js +1 -1
  48. package/dist/translations/fa.umd.js +1 -1
  49. package/dist/translations/fi.js +1 -1
  50. package/dist/translations/fi.umd.js +1 -1
  51. package/dist/translations/fr.js +1 -1
  52. package/dist/translations/fr.umd.js +1 -1
  53. package/dist/translations/gl.js +1 -1
  54. package/dist/translations/gl.umd.js +1 -1
  55. package/dist/translations/gu.js +1 -1
  56. package/dist/translations/gu.umd.js +1 -1
  57. package/dist/translations/he.js +1 -1
  58. package/dist/translations/he.umd.js +1 -1
  59. package/dist/translations/hi.js +1 -1
  60. package/dist/translations/hi.umd.js +1 -1
  61. package/dist/translations/hr.js +1 -1
  62. package/dist/translations/hr.umd.js +1 -1
  63. package/dist/translations/hu.js +1 -1
  64. package/dist/translations/hu.umd.js +1 -1
  65. package/dist/translations/hy.js +1 -1
  66. package/dist/translations/hy.umd.js +1 -1
  67. package/dist/translations/id.js +1 -1
  68. package/dist/translations/id.umd.js +1 -1
  69. package/dist/translations/it.js +1 -1
  70. package/dist/translations/it.umd.js +1 -1
  71. package/dist/translations/ja.js +1 -1
  72. package/dist/translations/ja.umd.js +1 -1
  73. package/dist/translations/jv.js +1 -1
  74. package/dist/translations/jv.umd.js +1 -1
  75. package/dist/translations/kk.js +1 -1
  76. package/dist/translations/kk.umd.js +1 -1
  77. package/dist/translations/km.js +1 -1
  78. package/dist/translations/km.umd.js +1 -1
  79. package/dist/translations/kn.js +1 -1
  80. package/dist/translations/kn.umd.js +1 -1
  81. package/dist/translations/ko.js +1 -1
  82. package/dist/translations/ko.umd.js +1 -1
  83. package/dist/translations/ku.js +1 -1
  84. package/dist/translations/ku.umd.js +1 -1
  85. package/dist/translations/lt.js +1 -1
  86. package/dist/translations/lt.umd.js +1 -1
  87. package/dist/translations/lv.js +1 -1
  88. package/dist/translations/lv.umd.js +1 -1
  89. package/dist/translations/ms.js +1 -1
  90. package/dist/translations/ms.umd.js +1 -1
  91. package/dist/translations/nb.js +1 -1
  92. package/dist/translations/nb.umd.js +1 -1
  93. package/dist/translations/ne.js +1 -1
  94. package/dist/translations/ne.umd.js +1 -1
  95. package/dist/translations/nl.js +1 -1
  96. package/dist/translations/nl.umd.js +1 -1
  97. package/dist/translations/no.js +1 -1
  98. package/dist/translations/no.umd.js +1 -1
  99. package/dist/translations/oc.js +1 -1
  100. package/dist/translations/oc.umd.js +1 -1
  101. package/dist/translations/pl.js +1 -1
  102. package/dist/translations/pl.umd.js +1 -1
  103. package/dist/translations/pt-br.js +1 -1
  104. package/dist/translations/pt-br.umd.js +1 -1
  105. package/dist/translations/pt.js +1 -1
  106. package/dist/translations/pt.umd.js +1 -1
  107. package/dist/translations/ro.js +1 -1
  108. package/dist/translations/ro.umd.js +1 -1
  109. package/dist/translations/ru.js +1 -1
  110. package/dist/translations/ru.umd.js +1 -1
  111. package/dist/translations/si.js +1 -1
  112. package/dist/translations/si.umd.js +1 -1
  113. package/dist/translations/sk.js +1 -1
  114. package/dist/translations/sk.umd.js +1 -1
  115. package/dist/translations/sl.js +1 -1
  116. package/dist/translations/sl.umd.js +1 -1
  117. package/dist/translations/sq.js +1 -1
  118. package/dist/translations/sq.umd.js +1 -1
  119. package/dist/translations/sr-latn.js +1 -1
  120. package/dist/translations/sr-latn.umd.js +1 -1
  121. package/dist/translations/sr.js +1 -1
  122. package/dist/translations/sr.umd.js +1 -1
  123. package/dist/translations/sv.js +1 -1
  124. package/dist/translations/sv.umd.js +1 -1
  125. package/dist/translations/th.js +1 -1
  126. package/dist/translations/th.umd.js +1 -1
  127. package/dist/translations/ti.js +1 -1
  128. package/dist/translations/ti.umd.js +1 -1
  129. package/dist/translations/tk.js +1 -1
  130. package/dist/translations/tk.umd.js +1 -1
  131. package/dist/translations/tr.js +1 -1
  132. package/dist/translations/tr.umd.js +1 -1
  133. package/dist/translations/tt.js +1 -1
  134. package/dist/translations/tt.umd.js +1 -1
  135. package/dist/translations/ug.js +1 -1
  136. package/dist/translations/ug.umd.js +1 -1
  137. package/dist/translations/uk.js +1 -1
  138. package/dist/translations/uk.umd.js +1 -1
  139. package/dist/translations/ur.js +1 -1
  140. package/dist/translations/ur.umd.js +1 -1
  141. package/dist/translations/uz.js +1 -1
  142. package/dist/translations/uz.umd.js +1 -1
  143. package/dist/translations/vi.js +1 -1
  144. package/dist/translations/vi.umd.js +1 -1
  145. package/dist/translations/zh-cn.js +1 -1
  146. package/dist/translations/zh-cn.umd.js +1 -1
  147. package/dist/translations/zh.js +1 -1
  148. package/dist/translations/zh.umd.js +1 -1
  149. package/package.json +15 -15
  150. package/src/aiactions/aiactions.js +1 -1
  151. package/src/aiactions/model/aiactionsinteraction.js +1 -1
  152. package/src/aiactions/model/aiactionsreply.js +1 -1
  153. package/src/aiassistant/adapters/aiadapter.js +1 -1
  154. package/src/aiassistant/adapters/aitextadapter.js +1 -1
  155. package/src/aiassistant/adapters/awstextadapter.js +1 -1
  156. package/src/aiassistant/adapters/openaitextadapter.js +1 -1
  157. package/src/aiassistant/aiassistant.js +1 -1
  158. package/src/aiassistant/aiassistantediting.js +1 -1
  159. package/src/aiassistant/aiassistantui.js +1 -1
  160. package/src/aiassistant/legacyerrors.js +1 -1
  161. package/src/aiassistant/ui/aiassistantcontroller.js +2 -2
  162. package/src/aiassistant/ui/form/aiformcontentarea.js +1 -1
  163. package/src/aiassistant/ui/form/aiformerrorview.js +1 -1
  164. package/src/aiassistant/ui/form/aiformpromptview.js +1 -1
  165. package/src/aiassistant/ui/form/aiformtoolbarview.js +1 -1
  166. package/src/aiassistant/ui/form/aiformview.js +1 -1
  167. package/src/aiassistant/ui/form/aihistorylistitemview.js +1 -1
  168. package/src/aiassistant/ui/form/aihistorylistview.js +1 -1
  169. package/src/aiassistant/ui/form/prompthistory.js +1 -1
  170. package/src/aiassistant/ui/showaiassistantcommand.js +1 -1
  171. package/src/aiassistant/utils/common-translations.js +1 -1
  172. package/src/aiassistant/utils/normalizecommandsconfig.js +1 -1
  173. package/src/aiballoon/aiballoon.js +1 -1
  174. package/src/aiballoon/ui/aiballoondisclaimerview.js +1 -1
  175. package/src/aiballoon/ui/aiballoontoolbarview.js +1 -1
  176. package/src/aiballoon/ui/aiballoonview.js +1 -1
  177. package/src/aichat/aichat.js +1 -1
  178. package/src/aichat/aichatcontroller.js +1 -1
  179. package/src/aichat/aichatui.js +1 -1
  180. package/src/aichat/model/aichatcontext.js +1 -1
  181. package/src/aichat/model/aichatconversation.js +1 -1
  182. package/src/aichat/model/aichatinteraction.js +1 -1
  183. package/src/aichat/ui/aichatcontrolsview.js +1 -1
  184. package/src/aichat/ui/aichatfeedview.js +1 -1
  185. package/src/aichat/ui/aichatheaderview.js +1 -1
  186. package/src/aichat/ui/aichatview.js +1 -1
  187. package/src/aichat/ui/controls/aichatchipsoverflowmanager.js +1 -1
  188. package/src/aichat/ui/controls/aichatcontextitembuttonview.js +1 -1
  189. package/src/aichat/ui/controls/aichatcontextpanelurlinputview.js +1 -1
  190. package/src/aichat/ui/controls/aichatcontextpanelview.js +1 -1
  191. package/src/aichat/ui/controls/aichatcontrolsloaderview.js +1 -1
  192. package/src/aichat/ui/controls/aichatpromptcapabilitiesview.js +1 -1
  193. package/src/aichat/ui/controls/aichatpromptinputview.js +1 -1
  194. package/src/aichat/ui/controls/aichatpromptsuggestionslistview.js +1 -1
  195. package/src/aichat/ui/controls/resources/aichatcontextresourceslistview.js +1 -1
  196. package/src/aichat/ui/controls/resources/aichatcontextresourcesview.js +1 -1
  197. package/src/aichat/ui/controls/resources/aichatresourcelistitemview.js +1 -1
  198. package/src/aichat/ui/controls/resources/aichatresourcesballoonview.js +1 -1
  199. package/src/aichat/ui/controls/resources/aichatresourcessearchinputview.js +1 -1
  200. package/src/aichat/ui/feed/aichatfeedcontextchipsview.js +1 -1
  201. package/src/aichat/ui/feed/aichatfeederroritemview.js +1 -1
  202. package/src/aichat/ui/feed/aichatfeedinteractionheaderview.js +1 -1
  203. package/src/aichat/ui/feed/aichatfeeditemview.js +1 -1
  204. package/src/aichat/ui/feed/aichatfeedreplyitemview.js +1 -1
  205. package/src/aichat/ui/feed/aichatfeedsuggestionitemactionsview.js +1 -1
  206. package/src/aichat/ui/feed/aichatfeedsuggestionitemview.js +1 -1
  207. package/src/aichat/ui/feed/aichatfeedusermessageitem.js +1 -1
  208. package/src/aichat/utils/eventnames.js +1 -1
  209. package/src/aichat/utils/promisequeue.js +1 -1
  210. package/src/aichathistory/aichathistory.js +1 -1
  211. package/src/aichathistory/aichathistorycontroller.js +1 -1
  212. package/src/aichathistory/aichathistoryui.js +1 -1
  213. package/src/aichathistory/model/aichathistoryconversations.js +1 -1
  214. package/src/aichathistory/model/aichathistoryitem.js +1 -1
  215. package/src/aichathistory/ui/aichathistorylistitemview.js +2 -2
  216. package/src/aichathistory/ui/aichathistorylistview.js +1 -1
  217. package/src/aichathistory/ui/aichathistorysectionlistview.js +1 -1
  218. package/src/aichathistory/ui/aichathistoryview.js +1 -1
  219. package/src/aicore/aiconnector.js +1 -1
  220. package/src/aicore/aiediting.js +1 -1
  221. package/src/aicore/model/aicapabilities.js +1 -1
  222. package/src/aicore/model/aicontext.js +1 -1
  223. package/src/aicore/model/aiinteraction.js +1 -1
  224. package/src/aicore/model/aimodels.js +1 -1
  225. package/src/aicore/model/aireply.js +1 -1
  226. package/src/aicore/pipeline/airesponseapplier.js +2 -2
  227. package/src/aicore/pipeline/airesponseparser.js +2 -2
  228. package/src/aicore/ui/aidisclaimerview.js +1 -1
  229. package/src/aicore/ui/aiskeleton.js +1 -1
  230. package/src/aicore/ui/aispinner.js +1 -1
  231. package/src/aicore/ui/suggestioncontainer/aiminitoolbarview.js +1 -1
  232. package/src/aicore/ui/suggestioncontainer/aisuggestionbodyview.js +1 -1
  233. package/src/aicore/ui/suggestioncontainer/aisuggestioncontainerview.js +1 -1
  234. package/src/aicore/ui/suggestioncontainer/aisuggestioncontentpartview.js +1 -1
  235. package/src/aicore/ui/suggestioncontainer/aisuggestionheaderview.js +1 -1
  236. package/src/aicore/utils/common-translations.js +1 -1
  237. package/src/aicore/utils/createresizebutton.js +1 -1
  238. package/src/aicore/utils/documentposition.js +1 -1
  239. package/src/aicore/utils/documentrange.js +1 -1
  240. package/src/aicore/utils/eventnames.js +1 -1
  241. package/src/aicore/utils/geteditorfromcontext.js +1 -1
  242. package/src/aicore/utils/getoperationsfromreply.js +1 -1
  243. package/src/aicore/utils/getsuggestionpartsfromreply.js +1 -1
  244. package/src/aicore/utils/htmlparser.js +1 -1
  245. package/src/aicore/utils/htmlstreamer.js +1 -1
  246. package/src/aicore/utils/scrollmanager.js +1 -1
  247. package/src/aieditorintegration/aieditorintegration.js +1 -1
  248. package/src/aieditorintegration/aitogglebutton/aitogglebuttonui.js +1 -1
  249. package/src/aieditorintegration/aitogglebutton/toggleaicommand.js +1 -1
  250. package/src/aiquickactions/aiquickactions.js +1 -1
  251. package/src/aiquickactions/aiquickactionscommand.js +1 -1
  252. package/src/aiquickactions/aiquickactionsediting.js +1 -1
  253. package/src/aiquickactions/aiquickactionsui.js +1 -1
  254. package/src/aiquickactions/ui/aiquickactionsbuttoncreator.js +1 -1
  255. package/src/aiquickactions/ui/aiquickactionsdropdowncontentview.js +1 -1
  256. package/src/aiquickactions/ui/aiquickactionsdropdowncreator.js +1 -1
  257. package/src/aiquickactions/ui/aiquickactionsfilteredlistview.js +1 -1
  258. package/src/aiquickactions/ui/dropdownmenubuttonwithhighlightview.js +1 -1
  259. package/src/aireviewmode/aireviewcheckdefinitions.js +1 -1
  260. package/src/aireviewmode/aireviewmode.js +1 -1
  261. package/src/aireviewmode/aireviewmodecontroller.js +1 -1
  262. package/src/aireviewmode/aireviewmodeediting.js +1 -1
  263. package/src/aireviewmode/aireviewmodeui.js +1 -1
  264. package/src/aireviewmode/model/aireviewcheck.js +1 -1
  265. package/src/aireviewmode/model/aireviewcheckcustom.js +1 -1
  266. package/src/aireviewmode/model/aireviewchecklist.js +1 -1
  267. package/src/aireviewmode/model/aireviewcheckresult.js +1 -1
  268. package/src/aireviewmode/model/aireviewcheckresultchange.js +1 -1
  269. package/src/aireviewmode/model/aireviewcheckrun.js +1 -1
  270. package/src/aireviewmode/model/aireviewcustomcheckrun.js +1 -1
  271. package/src/aireviewmode/model/aireviewsystemcheckrun.js +1 -1
  272. package/src/aireviewmode/ui/aireviemodepromptinputview.js +1 -1
  273. package/src/aireviewmode/ui/aireviewmodeballoonsuggestionview.js +1 -1
  274. package/src/aireviewmode/ui/aireviewmodechecklistitemresultview.js +1 -1
  275. package/src/aireviewmode/ui/aireviewmodecustomcheckview.js +1 -1
  276. package/src/aireviewmode/ui/aireviewmodefinishreviewbuttonview.js +1 -1
  277. package/src/aireviewmode/ui/aireviewmodegeneralerrorview.js +1 -1
  278. package/src/aireviewmode/ui/aireviewmodereviewchecklistview.js +1 -1
  279. package/src/aireviewmode/ui/aireviewmodereviewcheckresultsview.js +1 -1
  280. package/src/aireviewmode/ui/aireviewmodereviewcommandlistitemview.js +1 -1
  281. package/src/aireviewmode/ui/aireviewmodereviewcompletedview.js +1 -1
  282. package/src/aireviewmode/ui/aireviewmodeview.js +1 -1
  283. package/src/aireviewmode/ui/form/aireviewmodeformdropdown.js +1 -1
  284. package/src/aireviewmode/ui/form/aireviewmodeformmanager.js +1 -1
  285. package/src/aitabs/aitabs.js +1 -1
  286. package/src/aitabs/aitabsmainview.js +1 -1
  287. package/src/aitabs/tabs/aitabsview.js +1 -1
  288. package/src/aitabs/tabs/tabbuttonview.js +1 -1
  289. package/src/aitabs/tabs/tabpanelview.js +1 -1
  290. package/src/errors.js +1 -1
  291. package/src/errorsmap.js +1 -1
  292. package/src/index.js +1 -1
package/dist/index.js CHANGED
@@ -20,8 +20,8 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x35c0a2,Command as Mt,ContextPlugin as tt,Editor as ht}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x477338,IconCheck as _0x354c14,IconError as _0xb737a1,IconSubmit as _0x9a394f,IconAIHistory as Nt,IconMagicWand as _0x18d2bf,IconRobotPencil as _0x5a4f43,IconMaximize as _0x3fb3ac,IconMinimize as to,IconDocumentWithLoupe as _0x38357c,IconAddComment as _0x52bb8d,IconShowChangesOn as _0x40330d,IconShowChangesOff as _0xeaa4dc,IconDocument as _0x393547,IconThreeStars as _0xe0f938,IconRemove as _0xf22a17,IconDocumentWithCheckmark as _0x3a9eea,IconDocumentWithCross as _0x1ef364,IconLoupe as _0x428daf,IconCancel as _0x199223,IconStop as _0x4b519f,IconAIChat as bt,IconPlus as _0x24ea72,IconPin as _0x2eb4b9,IconThreeHorizontalDots as _0x351fae,IconChevronRight as _0x39814a,IconInfo as _0xadb1db,IconOutdated as _0x33a81d,IconEye as _0x3aa20e,IconEyeCrossedOut as _0x4f3e4b,IconAIReview as _0x413f91}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x53b360,CKEditorError as _0x15f966,ObservableMixin as ts,global as et,isVisible as _0x551023,Rect as nt,Collection as _0x39615e,FocusTracker as _0x5364ba,KeystrokeHandler as _0x5593a8,first as _0x37a4b7,toArray as _0x53a4f2,EmitterMixin as _0x554e67,logWarning as _0xc522eb,logError as gt,scrollViewportToShowTarget as at,ResizeObserver as _0x20b565,_isMotionReduced as Rt,scrollAncestorsToShowTarget as _0x44bea0,getConstrainedViewportRect as _0x5271b3,DomEmitterMixin as _0x4fb3ec}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x42835a,ButtonView as _0x5ee277,View as _0x3b9d21,SpinnerView as _0x2a835f,IconView as _0x53ac42,AutocompleteView as _0x281705,ListView as _0x40233d,ListItemGroupView as _0x28cebf,ListItemView as _0x8173b9,ButtonLabelView as _0x5a5387,FocusCycler as _0x1cce22,createLabeledTextarea as _0x9b759,Dialog as _0x416bba,createDropdown as _0x36aac4,addMenuToDropdown as _0x4ba9f7,MenuBarMenuView as _0x2c511b,MenuBarMenuListItemButtonView as _0x2cc372,DialogViewPosition as _0x56475d,MenuBarMenuListView as _0x1f7c03,MenuBarMenuListItemView as _0x44c9e0,UIModel as _0x2ab623,SplitButtonView as _0x329998,BalloonPanelView as _0x509620,BodyCollection as _0x57ac2d,clickOutsideHandler as _0x3685ee,ListItemButtonView as _0x79b3f5,ViewCollection as _0x49e6be,addListToDropdown as _0x3c9480,submitHandler as _0x58138f,LabeledFieldView as _0x425b6a,createLabeledInputText as _0x313550,FormHeaderView as _0x37a3e8,HighlightedTextView as _0x29efef,FileDialogButtonView as _0xf82cf6,InputTextView as _0x67befa,SearchTextView as _0x3cb991,ButtonLabelWithHighlightView as _0x3ee38b,DropdownMenuPanelPositioningFunctions as _0x253906,BalloonToolbar as Zt,FormRowView as _0x80e4dd,TextareaView as _0x459523}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x50ea20,ClipboardMarkersUtils as ti}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x46f450,ViewDataTransfer as _0x3af268,ViewUpcastWriter as _0x218c70,Matcher as _0x452374,_DetachOperation as _0x19ceb4,_insertIntoModelNodeList as _0x40b4bd,_removeFromModelNodeList as _0x4af85f,ModelRange as _0x4a8fb1,ViewDowncastWriter as kt,transformOperationSets as _0x47c5f7,ModelDocumentFragment as _0xce7080,ModelPosition as _0x1e8cb7,ModelTreeWalker as _0x306492,InsertOperation as _0x22f4fa,MarkerOperation as _0x169d8c}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x149f56,escape as _0x438ca2,escapeRegExp as _0x44cebd,debounce as _0x2a7aa9}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x362bce,InvokeModelWithResponseStreamCommand as _0x535cea,InvokeModelCommand as _0x479662}from'@aws-sdk/client-bedrock-runtime';import{createParser as $t}from'eventsource-parser';import{parseDocument as _0xd8a65b}from'htmlparser2';import{isTag as _0x383f31,findOne as At,getParent as _0x55fcbe,findAll as _0x1fcd3c,removeElement as _0x546a65,replaceElement as _0xdfba39,prepend as _0x6cef5,prependChild as _0x302586,appendChild as _0x527fff,append as tr,find as _0x4224fc,isComment as _0x2e8456,getChildren as _0x12f4b6,textContent as _0x154b5d}from'domutils';import _0x946802 from'dom-serializer';import{Document as wt,Element as _0x489563,Text as _0x2b59b9,cloneNode as _0x44b2b3,isDocument as _0x58235a,isText as _0x5a17d3,NodeWithChildren as _0x37b932}from'domhandler';import{MarkdownGfmMdToHtml as _0x5f270e}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x28fabe,getAllMarkersDomElementsSorted as st,DocumentCompare as _0x16a419,DATA_ID_MODEL_ATTRIBUTE as Ct,ConfirmMixin as _0x172cdb,LateFocusDropdownButtonView as _0x1b4426,DATA_ID_VIEW_ATTRIBUTE as _0x59ae46}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x326380}from'es-toolkit';import{IconThumbUp as _0x1f975f,IconThumbDown as _0x3b2414,IconCopy as _0x53ac03,IconCheck as _0x4661c5,IconShowChangesOff as _0x8d0f12,IconShowChangesOn as _0x2ca6d5,IconWeb as _0x51773c,IconNextArrow as _0x38fee0,IconPreviousArrow as _0x94bcdd,IconAI as vt,IconClose as _0xfae8d0,IconSelection as _0x27c312,IconFileUpload as _0x27ae23,IconLink as _0x5414da,IconDocument as _0x1fedc8,IconBulb as _0x2ab706,IconDocumentOutline as _0x325b8e,IconPaperClip as _0x166bb5,IconBrowseFiles as _0x29a086,IconDropdownArrow as _0xab2de0,IconAIAskAI as _0x29fd96,IconAIQuickActions as _0x1cd5bc,IconAIChatCommands as Yt,IconAIImproveWriting as Wt,IconAIContinueWriting as Gt,IconAIGrammarCheck as Ft,IconAIAdjustLength as Qt,IconAIChangeTone as Kt,IconAITranslate as Jt,IconAIOther as Bt,IconRefresh as _0x959f82}from'@ckeditor/ckeditor5-icons/dist/index.js';import _0x1d40e0 from'morphdom';import{SuggestionsConversion as zt}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import{diffArrays as _0x16e846}from'diff';const Q='_ungrouppedCommands';function j(_0x15b539,_0x179c5f){const _0x21bebd=(0x0,_0x179c5f['t'])('Other');return _0x15b539['length']?'groupId'in _0x15b539[0x0]?_0x15b539:[{'groupId':Q,'groupLabel':_0x21bebd,'order':0x1/0x0,'commands':_0x15b539}]:[{'groupId':Q,'groupLabel':_0x21bebd,'order':0x1/0x0,'commands':[]}];}const Wn=globalThis['DataTransfer'],R='ai-ui';class P extends _0x35c0a2{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x2525b6}=this,_0x8b3837=['ck-fake-ai-selection'];_0x2525b6['config']['get']('ai.assistant.useTheme')&&_0x8b3837['push']('ck-ai-assistant-ui_theme'),_0x2525b6['conversion']['for']('editingDowncast')['markerToHighlight']({'model':R,'view':{'classes':_0x8b3837,'priority':0xc}}),_0x2525b6['conversion']['for']('editingDowncast')['markerToElement']({'model':R,'view':(_0x503cae,{writer:_0x277268})=>{if(!_0x503cae['markerRange']['isCollapsed'])return null;const _0x34579a=_0x277268['createUIElement']('span');return _0x277268['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x34579a),_0x34579a;}});}['afterInit'](){!async function(_0x14b96f){const _0x2bdae8=_0xe4375d([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]),_0x392c47=0x3dffc4e1,_0x5eba58=0x3df8bab1^_0x392c47,_0x255d8e=window[_0xe4375d([0x44,0x61,0x74,0x65])][_0xe4375d([0x6e,0x6f,0x77])](),_0x2b95a3=_0x14b96f[_0xe4375d([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x3e1e64=new window[(_0xe4375d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x36e083=>{_0x2b95a3[_0xe4375d([0x6f,0x6e,0x63,0x65])](_0xe4375d([0x72,0x65,0x61,0x64,0x79]),_0x36e083);}),_0x1fdc4a={[_0xe4375d([0x6b,0x74,0x79])]:_0xe4375d([0x45,0x43]),[_0xe4375d([0x75,0x73,0x65])]:_0xe4375d([0x73,0x69,0x67]),[_0xe4375d([0x63,0x72,0x76])]:_0xe4375d([0x50,0x2d,0x32,0x35,0x36]),[_0xe4375d([0x78])]:_0xe4375d([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]),[_0xe4375d([0x79])]:_0xe4375d([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]),[_0xe4375d([0x61,0x6c,0x67])]:_0xe4375d([0x45,0x53,0x32,0x35,0x36])},_0x4baf6f=_0x2b95a3[_0xe4375d([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0xe4375d([0x67,0x65,0x74])](_0xe4375d([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x158272(){let _0x151834,_0x189e11=null,_0x46b326=null;try{if(_0x4baf6f==_0xe4375d([0x47,0x50,0x4c]))return _0xe4375d([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x151834=_0x797bf8(),!_0x151834)return _0xe4375d([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x151834[_0xe4375d([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x46b326=_0x529c8b(_0x151834[_0xe4375d([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x151834[_0xe4375d([0x6a,0x74,0x69])])),await _0x4c0b7f()?_0x27df6c()?_0x3a14ec()?_0xe4375d([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x1fac80()?(_0x151834[_0xe4375d([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0xe4375d([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x189e11=_0x122b87(_0xe4375d([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x51b9cd()):_0xe4375d([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0xe4375d([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0xe4375d([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0xe4375d([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x3a14ec(){const _0x308e5e=[_0xe4375d([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0xe4375d([0x74,0x72,0x69,0x61,0x6c])][_0xe4375d([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x151834[_0xe4375d([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x255d8e/0x3e8:0xe10*_0x5eba58;return _0x151834[_0xe4375d([0x65,0x78,0x70])]<_0x308e5e;}function _0x27df6c(){const _0x1931f5=_0x151834[_0xe4375d([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x1931f5&&(!!_0x1931f5[_0xe4375d([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xe4375d([0x2a]))||!!_0x1931f5[_0xe4375d([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xe4375d([0x41,0x49])));}function _0x1fac80(){const _0x39baed=_0x151834[_0xe4375d([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x39baed||0x0==_0x39baed[_0xe4375d([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x4a61d5}=new URL(window[_0xe4375d([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x39baed[_0xe4375d([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4a61d5))return!0x0;const _0x5b5b54=_0x4a61d5[_0xe4375d([0x73,0x70,0x6c,0x69,0x74])](_0xe4375d([0x2e]));return _0x39baed[_0xe4375d([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x2d19b9=>_0x2d19b9[_0xe4375d([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xe4375d([0x2a])))[_0xe4375d([0x6d,0x61,0x70])](_0x55e35=>_0x55e35[_0xe4375d([0x73,0x70,0x6c,0x69,0x74])](_0xe4375d([0x2e])))[_0xe4375d([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x1dadb0=>_0x1dadb0[_0xe4375d([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x5b5b54[_0xe4375d([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0xe4375d([0x6d,0x61,0x70])](_0x574e6b=>Array(_0x5b5b54[_0xe4375d([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x574e6b[_0xe4375d([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0xe4375d([0x66,0x69,0x6c,0x6c])](_0x574e6b[0x0]===_0xe4375d([0x2a])?_0xe4375d([0x2a]):'')[_0xe4375d([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x574e6b))[_0xe4375d([0x73,0x6f,0x6d,0x65])](_0x508f42=>_0x5b5b54[_0xe4375d([0x65,0x76,0x65,0x72,0x79])]((_0xf53d6e,_0x126275)=>_0x508f42[_0x126275]===_0xf53d6e||_0x508f42[_0x126275]===_0xe4375d([0x2a])));}function _0x51b9cd(){return _0x189e11&&_0x46b326?new window[(_0xe4375d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4fdb8e,_0x2b6b4b)=>{_0x189e11[_0xe4375d([0x74,0x68,0x65,0x6e])](_0x4fdb8e,_0x2b6b4b),_0x46b326[_0xe4375d([0x74,0x68,0x65,0x6e])](_0x410755=>{_0x410755!=_0xe4375d([0x56,0x61,0x6c,0x69,0x64])&&_0x4fdb8e(_0x410755);},_0x2b6b4b);}):_0x189e11||_0x46b326||_0xe4375d([0x56,0x61,0x6c,0x69,0x64]);}}function _0x529c8b(_0x1497e4,_0x29d7fc){return new window[(_0xe4375d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2810dc=>{if(_0x813253())return _0x2810dc(_0xe4375d([0x56,0x61,0x6c,0x69,0x64]));_0x1f464c(),_0x2b95a3[_0xe4375d([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0xe4375d([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x4237ba=!0x1;const _0x3251f0=_0x53b360();function _0x36f0d3(_0x1d9037){return!!_0x1d9037&&(typeof _0x1d9037===_0xe4375d([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x1d9037===_0xe4375d([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x1d9037[_0xe4375d([0x74,0x68,0x65,0x6e])]===_0xe4375d([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x1d9037[_0xe4375d([0x63,0x61,0x74,0x63,0x68])]===_0xe4375d([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x5915b0(_0xd7382f){_0x42f929(_0xd7382f)[_0xe4375d([0x74,0x68,0x65,0x6e])](_0x45969d=>{if(!_0x45969d||_0x45969d[_0xe4375d([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0xe4375d([0x6f,0x6b]))return _0xe4375d([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0xffaa6d(_0x128656(_0x3251f0+_0x29d7fc))!=_0x45969d[_0xe4375d([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0xe4375d([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0xe4375d([0x56,0x61,0x6c,0x69,0x64]);})[_0xe4375d([0x74,0x68,0x65,0x6e])](_0x180b3a=>(_0x2453b1(),_0x180b3a),()=>{const _0x5e7ade=_0x2c2c26();return null==_0x5e7ade?(_0x2453b1(),_0xe4375d([0x56,0x61,0x6c,0x69,0x64])):_0xe4375d(_0x255d8e-_0x5e7ade>(0x19f340e1^_0x392c47)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0xe4375d([0x74,0x68,0x65,0x6e])](_0x2810dc)[_0xe4375d([0x63,0x61,0x74,0x63,0x68])](()=>{_0x2810dc(_0xe4375d([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x86c130=0x3dc92a61^_0x392c47;function _0x2453b1(){const _0x3323b7=_0xe4375d([0x6c,0x6c,0x63,0x74,0x2d])+_0xffaa6d(_0x128656(_0x1497e4)),_0x381a97=_0x3bd039(_0xffaa6d(window[_0xe4375d([0x4d,0x61,0x74,0x68])][_0xe4375d([0x63,0x65,0x69,0x6c])](_0x255d8e/_0x86c130)));window[_0xe4375d([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0xe4375d([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3323b7,_0x381a97);}function _0x2c2c26(){const _0x51d761=_0xe4375d([0x6c,0x6c,0x63,0x74,0x2d])+_0xffaa6d(_0x128656(_0x1497e4)),_0x268f83=window[_0xe4375d([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0xe4375d([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x51d761);return _0x268f83?window[_0xe4375d([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3bd039(_0x268f83),0x10)*_0x86c130:null;}function _0x42f929(_0x138f3e){return new window[(_0xe4375d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x343ae0,_0x391c29)=>{_0x138f3e[_0xe4375d([0x74,0x68,0x65,0x6e])](_0x343ae0,_0x391c29),window[_0xe4375d([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x391c29,0x3dfe1021^_0x392c47);});}}_0x2b95a3[_0xe4375d([0x6f,0x6e])](_0xe4375d([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x2b8d8f,_0x555834)=>{if(_0x555834[0x0]!=_0x1497e4)return _0x2810dc(_0xe4375d([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x555834[0x1]={..._0x555834[0x1],[_0xe4375d([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x3251f0};},{[_0xe4375d([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0xe4375d([0x68,0x69,0x67,0x68])}),_0x2b95a3[_0xe4375d([0x6f,0x6e])](_0xe4375d([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x244bea=>{_0x36f0d3(_0x244bea[_0xe4375d([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x4237ba=!0x0,_0x5915b0(_0x244bea[_0xe4375d([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0xe4375d([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0xe4375d([0x6c,0x6f,0x77])}),_0x3e1e64[_0xe4375d([0x74,0x68,0x65,0x6e])](()=>{_0x4237ba||_0x2810dc(_0xe4375d([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x813253(){return _0x2b95a3[_0xe4375d([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0xe4375d([0x76,0x69,0x65,0x77])][_0xe4375d([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0xe4375d([0x61,0x75,0x74,0x6f]);}function _0x1f464c(){_0x2b95a3[_0xe4375d([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0xe4375d([0x76,0x69,0x65,0x77])][_0xe4375d([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0xe4375d([0x61,0x75,0x74,0x6f]);}}function _0x122b87(_0x4ed994){const _0x5da14d=[new window[(_0xe4375d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5d1e0b=>setTimeout(_0x5d1e0b,0x3df6fa2d^_0x392c47)),_0x3e1e64[_0xe4375d([0x74,0x68,0x65,0x6e])](()=>new window[(_0xe4375d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x166c84=>{let _0x187f68=0x0;_0x2b95a3[_0xe4375d([0x6d,0x6f,0x64,0x65,0x6c])][_0xe4375d([0x6f,0x6e])](_0xe4375d([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x5455bf,_0x514e34)=>{_0x514e34[0x0][_0xe4375d([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x187f68++,_0x187f68==(0x3dffc109^_0x392c47)&&(_0x166c84(),_0x5455bf[_0xe4375d([0x6f,0x66,0x66])]());});}))];return window[_0xe4375d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0xe4375d([0x72,0x61,0x63,0x65])](_0x5da14d)[_0xe4375d([0x74,0x68,0x65,0x6e])](()=>_0x4ed994);}async function _0x40e418(){await _0x3e1e64,_0x2b95a3[_0xe4375d([0x6d,0x6f,0x64,0x65,0x6c])][_0xe4375d([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x1ca3ac,_0x2b95a3[_0xe4375d([0x6d,0x6f,0x64,0x65,0x6c])][_0xe4375d([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x1ca3ac,_0x2b95a3[_0xe4375d([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0xe4375d([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x576ff0(_0x3af9d7){const _0x2e8389=_0x416fe4();_0x2b95a3[_0x2e8389]=_0xe4375d([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x3af9d7,_0x3af9d7!=_0xe4375d([0x56,0x61,0x6c,0x69,0x64])&&_0x40e418();}function _0x416fe4(){const _0x3525db=window[_0xe4375d([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0xe4375d([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0xe4375d([0x6e,0x6f,0x77])]())[_0xe4375d([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0xe4375d([0x2e]),'');let _0x12669f=_0xe4375d([0x6e]);for(let _0x1a1839=0x0;_0x1a1839<_0x3525db[_0xe4375d([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1a1839+=0x2){let _0x52d16b=window[_0xe4375d([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3525db[_0xe4375d([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x1a1839,_0x1a1839+0x2));_0x52d16b>=_0x2bdae8[_0xe4375d([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x52d16b-=_0x2bdae8[_0xe4375d([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x12669f+=_0x2bdae8[_0x52d16b];}return _0x12669f;}function _0x797bf8(){const _0x5ae00e=_0x4baf6f[_0xe4375d([0x73,0x70,0x6c,0x69,0x74])](_0xe4375d([0x2e]));if(0x3!=_0x5ae00e[_0xe4375d([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x320cbc(_0x5ae00e[0x1]);function _0x320cbc(_0x5574a5){const _0x868933=_0x592fb5(_0x5574a5);return _0x868933&&_0x448810()?_0x868933:null;function _0x448810(){const _0x69b892=_0x868933[_0xe4375d([0x6a,0x74,0x69])],_0x230d0a=window[_0xe4375d([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x69b892[_0xe4375d([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x69b892[_0xe4375d([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x2fe635={..._0x868933,[_0xe4375d([0x6a,0x74,0x69])]:_0x69b892[_0xe4375d([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x69b892[_0xe4375d([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x2fe635[_0xe4375d([0x76,0x63])],_0x128656(_0x2fe635)==_0x230d0a;}}}async function _0x4c0b7f(){let _0x193182=!0x0;try{const _0x48da1d=_0x4baf6f[_0xe4375d([0x73,0x70,0x6c,0x69,0x74])](_0xe4375d([0x2e])),[_0x4d8d14,_0x127766,_0x3e3733]=_0x48da1d;return _0x47889a(_0x4d8d14),await _0x1e0678(_0x4d8d14,_0x127766,_0x3e3733),_0x193182;}catch{return!0x1;}function _0x47889a(_0x4f1d08){const _0x5570fc=_0x592fb5(_0x4f1d08);_0x5570fc&&_0x5570fc[_0xe4375d([0x61,0x6c,0x67])]==_0xe4375d([0x45,0x53,0x32,0x35,0x36])||(_0x193182=!0x1);}async function _0x1e0678(_0x5d5531,_0x102baf,_0x4aecdf){const _0x8fc3f5=window[_0xe4375d([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0xe4375d([0x66,0x72,0x6f,0x6d])](_0x159117(_0x4aecdf),_0x5d4911=>_0x5d4911[_0xe4375d([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x2c9c1c=new window[(_0xe4375d([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0xe4375d([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x5d5531+_0xe4375d([0x2e])+_0x102baf),_0x405692=window[_0xe4375d([0x63,0x72,0x79,0x70,0x74,0x6f])][_0xe4375d([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x405692)return;const _0x24b2ce=await _0x405692[_0xe4375d([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0xe4375d([0x6a,0x77,0x6b]),_0x1fdc4a,{[_0xe4375d([0x6e,0x61,0x6d,0x65])]:_0xe4375d([0x45,0x43,0x44,0x53,0x41]),[_0xe4375d([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0xe4375d([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0xe4375d([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x405692[_0xe4375d([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0xe4375d([0x6e,0x61,0x6d,0x65])]:_0xe4375d([0x45,0x43,0x44,0x53,0x41]),[_0xe4375d([0x68,0x61,0x73,0x68])]:{[_0xe4375d([0x6e,0x61,0x6d,0x65])]:_0xe4375d([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x24b2ce,_0x8fc3f5,_0x2c9c1c)||(_0x193182=!0x1);}}function _0x592fb5(_0x5665a8){return _0x5665a8[_0xe4375d([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0xe4375d([0x65,0x79]))?JSON[_0xe4375d([0x70,0x61,0x72,0x73,0x65])](_0x159117(_0x5665a8)):null;}function _0x159117(_0x392921){return window[_0xe4375d([0x61,0x74,0x6f,0x62])](_0x392921[_0xe4375d([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0xe4375d([0x2b]))[_0xe4375d([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0xe4375d([0x2f])));}function _0x128656(_0x3b6f12){let _0x126220=0x1505;function _0x34d272(_0x512e71){for(let _0x18c2de=0x0;_0x18c2de<_0x512e71[_0xe4375d([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x18c2de++){const _0x32e8b5=_0x512e71[_0xe4375d([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x18c2de);_0x126220=(_0x126220<<0x5)+_0x126220+_0x32e8b5,_0x126220&=_0x126220;}}function _0x29c04b(_0x56418d){Array[_0xe4375d([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x56418d)?_0x56418d[_0xe4375d([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x29c04b):_0x56418d&&typeof _0x56418d==_0xe4375d([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0xe4375d([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x56418d)[_0xe4375d([0x73,0x6f,0x72,0x74])]()[_0xe4375d([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x3360a2,_0x512a79])=>{_0x34d272(_0x3360a2),_0x29c04b(_0x512a79);}):_0x34d272(window[_0xe4375d([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x56418d));}return _0x29c04b(_0x3b6f12),_0x126220>>>0x0;}function _0xffaa6d(_0xda2dc1){return _0xda2dc1[_0xe4375d([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0xe4375d([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0xe4375d([0x30]));}function _0x3bd039(_0x19dc39){return _0x19dc39[_0xe4375d([0x73,0x70,0x6c,0x69,0x74])]('')[_0xe4375d([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0xe4375d([0x6a,0x6f,0x69,0x6e])]('');}function _0x1ca3ac(){}function _0xe4375d(_0x5d29b4){return _0x5d29b4['map'](_0x136721=>String['fromCharCode'](_0x136721))['join']('');}_0x576ff0(await _0x158272());}(this);}['showFakeVisualSelection'](){const _0x23c74a=this['editor']['model'];_0x23c74a['change'](_0x5aa94e=>{const _0x2d531a=_0x23c74a['document']['selection']['getRanges']();let _0x4846c0=0x0;for(const _0x26c8dc of _0x2d531a){const _0x71fbd3=R+':'+_0x4846c0;if(_0x23c74a['markers']['has'](_0x71fbd3))_0x5aa94e['updateMarker'](_0x71fbd3,{'range':_0x26c8dc});else{if(_0x26c8dc['start']['isAtEnd']){const _0x48eae6=_0x26c8dc['start']['getLastMatchingPosition'](({item:_0x49773a})=>!_0x23c74a['schema']['isContent'](_0x49773a),{'boundaries':_0x26c8dc});_0x5aa94e['addMarker'](_0x71fbd3,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5aa94e['createRange'](_0x48eae6,_0x26c8dc['end'])});}else _0x5aa94e['addMarker'](_0x71fbd3,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x26c8dc});}_0x4846c0++;}});}['hideFakeVisualSelection'](){const _0x5823ab=this['editor']['model'],_0xd979bb=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](R));_0xd979bb['length']&&_0x5823ab['change'](_0x312a87=>{_0xd979bb['forEach'](_0x5e19dc=>{_0x312a87['removeMarker'](_0x5e19dc);});});}['insertContent'](_0xfbc8cd,_0x35778c){const _0x27e5ac=this['_getAISelection'](),_0x49690f=_0x35778c||_0x27e5ac['getFirstRange']();this['editor']['model']['canEditAt'](_0x49690f)&&this['editor']['model']['change'](_0x3975db=>{this['hideFakeVisualSelection'](),_0x35778c||this['_resetContentOfSelectedTableCells'](_0x3975db,_0x27e5ac),this['_pasteHTMLUsingClipboard']({'insertAt':_0x49690f,'writer':_0x3975db,'html':_0xfbc8cd});});}['insertContentBelow'](_0x5c10d8){const {model:_0x564d20}=this['editor'],_0x51ba97=this['_getAISelection']();_0x564d20['change'](()=>{const _0xf38d59=this['_prepareTableInsertBelowPosition'](_0x5c10d8,_0x51ba97)||this['_getDefaultInsertBelowPosition'](_0x51ba97);this['insertContent'](_0x5c10d8,_0xf38d59);});}['_getAISelection'](){const _0x4504af=this['editor']['model'],_0x8fc28b=Array['from'](_0x4504af['markers']['getMarkersGroup'](R))['map'](_0x49ac2d=>_0x49ac2d['getRange']());return _0x4504af['createSelection'](_0x8fc28b);}['_pasteHTMLUsingClipboard']({writer:_0x3ec41b,html:_0x3edf0b,insertAt:_0x24ede2}){const {view:_0x59e261}=this['editor']['editing'],_0x41ab63=this['editor']['plugins']['get'](_0x50ea20),_0x4682ac=new Wn();_0x4682ac['setData']('text/html',_0x3edf0b);const _0x11cfb5=new ClipboardEvent('paste',{'clipboardData':_0x4682ac}),_0x31eb04=new _0x46f450(_0x59e261,_0x11cfb5,{'dataTransfer':new _0x3af268(_0x4682ac)});_0x3ec41b['setSelection'](_0x24ede2);const _0xa0d10=(_0x410f2a,_0x2568d9)=>{_0x2568d9['resultRange']&&_0x3ec41b['setSelection'](_0x2568d9['resultRange']);};_0x41ab63['once']('contentInsertion',_0xa0d10,{'priority':'lowest'}),_0x59e261['document']['fire']('paste',_0x31eb04),_0x41ab63['off']('contentInsertion',_0xa0d10);}['_getDefaultInsertBelowPosition'](_0x1c0623){const {model:_0x2d09a3}=this['editor'],_0x10e1c7=Array['from'](_0x1c0623['getSelectedBlocks']());return _0x10e1c7['length']?_0x2d09a3['createPositionAfter'](_0x10e1c7['pop']()):_0x1c0623['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x2e25ee,_0x25a885){const {model:_0x23ade0,plugins:_0x3ee05a}=this['editor'];if(_0x3ee05a['has']('TableUtils')){const _0x141deb=_0x3ee05a['get']('TableUtils')['getSelectedTableCells'](_0x25a885);if(_0x141deb['length']){const _0xb3033a=this['_getTableRowCountFromContent'](_0x2e25ee),_0x4516c2=this['_createEmptyTableRows'](_0x141deb,_0xb3033a);return _0x23ade0['createPositionAt'](_0x4516c2,0x0);}}return null;}['_getTableRowCountFromContent'](_0x20a1e4){const _0x2b6c2a=this['editor']['plugins']['get']('TableUtils'),_0x4fdafb=this['editor']['data']['parse'](_0x20a1e4),_0x16a22a=Array['from'](_0x4fdafb['getChildren']())['filter'](_0x3fb6f1=>_0x3fb6f1['is']('element','table'));let _0x1a5ab5=0x0;return _0x16a22a['forEach'](_0xb7596=>{_0x1a5ab5+=_0x2b6c2a['getRows'](_0xb7596);}),_0x1a5ab5;}['_createEmptyTableRows'](_0x96f540,_0x2c6a66){const _0x57d178=this['editor']['plugins']['get']('TableUtils'),_0x1c188b=_0x57d178['getRowIndexes'](_0x96f540),_0x280231=_0x57d178['getColumnIndexes'](_0x96f540),_0x1e8f66=_0x1c188b['last']+0x1,_0x268bf8=_0x280231['first'],_0x2f8746=_0x96f540[0x0]['findAncestor']('table');for(let _0x5d298f=0x0;_0x5d298f<_0x2c6a66;_0x5d298f++)_0x57d178['insertRows'](_0x2f8746,{'at':_0x1e8f66});return _0x2f8746['getChild'](_0x1e8f66)['getChild'](_0x268bf8);}['_resetContentOfSelectedTableCells'](_0x36eb9f,_0x2c231e){const {plugins:_0x489c8f}=this['editor'],{model:_0x194527}=_0x36eb9f;if(!_0x489c8f['has']('TableUtils'))return;_0x489c8f['get']('TableUtils')['getSelectedTableCells'](_0x2c231e)['length']&&_0x194527['deleteContent'](_0x2c231e);}}class W extends _0x35c0a2{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x15f966('aiadapter-text-adapter-not-set',null);}}class is extends Error{constructor(_0x4c4fe3){super(_0x4c4fe3),this['name']='AIRequestError';}}function Fn(_0x41c45c,_0x1e804a,_0x4c8765){const t=_0x41c45c['t'];switch(_0x1e804a){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',_0x4c8765);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x4c8765);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'},_0x4c8765);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 _0x1e804a;}}class X extends Mt{['_commandDefinitions'];constructor(_0x2dbc29,_0x5da654){super(_0x2dbc29),this['_commandDefinitions']=_0x5da654,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x382405,_0x2c4deb,_0xade493)=>{this['isEnabled']&&(this['enabledCommandsIds']=os(this['_commandDefinitions'],_0xade493));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0xf5d70,_0x1628fa,_0x42553e)=>{this['enabledCommandsIds']=_0x42553e?os(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x39f8ae=this['editor']['model'];this['_hasContext']=function(_0x56bbda){const _0x21bd19=_0x56bbda['document']['selection'];return _0x21bd19['isCollapsed']?0x0!==[..._0x21bd19['getSelectedBlocks']()]['length']&&![..._0x21bd19['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x56bbda['hasContent'](_0x21bd19['getFirstRange']());}(_0x39f8ae);const _0x5df1bf=_0x39f8ae['document']['selection'],_0x3b814a=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x47024a of _0x5df1bf['getRanges']())for(const _0x2964bf of _0x47024a['getItems']())if(_0x2964bf['is']('element')&&_0x3b814a['includes'](_0x2964bf['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x35a90b='',_0x1ecf17='',_0x4a3b0f='custom'){this['editor']['plugins']['get'](L)['showUI'](_0x35a90b,_0x1ecf17,_0x4a3b0f);}}function os(_0x478ca7,_0x4d6419){const _0x249e21=new Set();for(const _0x4493fb of _0x478ca7['values']())(_0x4d6419||!0x1===_0x4493fb['requiresContent'])&&_0x249e21['add'](_0x4493fb['id']);return Array['from'](_0x249e21);}const ns=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class Y extends/* #__PURE__ -- @preserve */
24
- ts(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x44d60a,_0x176f45,_0x228a9d){super(),this['editor']=_0x44d60a,this['textAdapter']=_0x176f45,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x228a9d,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x4f065f,_0x1f9e76,_0x26d527)=>{this['view']['value']=this['_sanitizeHTML'](_0x26d527);}),this['listenTo'](this['view'],'submitPrompt',(_0x53a2b0,_0x2393aa)=>{const _0x24913c=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x2393aa,_0x24913c,'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:_0xb4cb6,query:_0x3d266e,htmlContent:_0x3a89a8,label:_0xd4192d,mainActionLabel:_0x2775c5}){this['view']['prompt']=_0xd4192d,this['view']['mainAction']=_0x2775c5,this['initialContext']=_0x3a89a8,_0x3d266e&&(this['view']['isRendered']?this['_handleQuery'](_0x3d266e,_0x3a89a8,_0xb4cb6,_0xd4192d):this['view']['once']('render',()=>{this['_handleQuery'](_0x3d266e,_0x3a89a8,_0xb4cb6,_0xd4192d);}));}['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'](_0x16f353,_0x37c0f1,_0x54dd1a,_0x1608fa){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x37c0f1,this['previousQuery']=_0x16f353,this['previousLabel']=_0x1608fa||_0x16f353,this['previousActionId']=_0x54dd1a,new Promise(_0xf694ec=>{this['textAdapter']['makeRequest']({'query':_0x16f353,'context':_0x37c0f1,'onData':_0x3084e8=>{this['currentResponse']=_0x3084e8,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x54dd1a})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x45110b=>{_0x45110b instanceof is?this['view']['handleError'](_0x45110b['message']):this['view']['handleError'](),_0xf694ec();})['finally'](()=>{this['stopProcessing'](),_0xf694ec();});});}['_parseAndNormalizeContent'](_0x4ebf5a,_0x5dd50c=!0x1){const _0x2cee10=ns['exec'](_0x4ebf5a);_0x4ebf5a=_0x2cee10?_0x4ebf5a['substring'](_0x2cee10[0x1]['length']):_0x4ebf5a['length']<0x64&&!_0x5dd50c?'':this['_stripMarkdownSyntax'](_0x4ebf5a);const _0x470883=this['_domParser']['parseFromString'](_0x4ebf5a,'text/html');if(_0x2cee10){const _0x1be073=Array['from'](_0x470883['body']['childNodes']);_0x1be073['reverse']();for(const _0xeb72ac of _0x1be073){if(_0xeb72ac['nodeType']==Node['ELEMENT_NODE'])break;_0xeb72ac['remove']();}}const _0x15a9d2=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x470883['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x15a9d2);const _0x44a861=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x5ba0b6=this['editor']['data']['toModel'](_0x15a9d2);return _0x44a861||_0x5ba0b6['markers']['clear'](),this['editor']['data']['stringify'](_0x5ba0b6);}['_normalizeResponseHeadings'](_0xe7154b){const _0x59769d=new _0x218c70(this['editor']['editing']['view']['document']),_0x3e655a=new _0x452374({'name':/^h[1-5]$/}),_0x4c46ff=[];let _0x2056ea=!0x1;for(const _0x5365dc of _0xe7154b)_0x5365dc['is']('element')&&_0x3e655a['match'](_0x5365dc)&&(_0x4c46ff['push'](_0x5365dc),'h1'==_0x5365dc['name']&&(_0x2056ea=!0x0));if(_0x2056ea){for(const _0x194125 of _0x4c46ff)_0x59769d['rename']('h'+(parseInt(_0x194125['name'][0x1])+0x1),_0x194125);}}['_isH1TagSupportEnabled'](){const {data:_0x4c8d1d,editing:_0x54b9c6}=this['editor'],_0x223565=_0x4c8d1d['htmlProcessor']['toView']('<h1></h1>'),_0x47b0f5=_0x4c8d1d['toView'](_0x4c8d1d['toModel'](_0x223565));return!!_0x54b9c6['view']['domConverter']['viewToDom'](_0x47b0f5)['querySelector']('h1');}['_sanitizeHTML'](_0xf46216){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0xf46216),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x5bb0b9){const _0x19de6f=_0x5bb0b9['trim']();return _0x19de6f['startsWith']('```html')?_0x19de6f['endsWith']('```')?_0x19de6f['substring'](0x7,_0x19de6f['length']-0x3):_0x19de6f['substring'](0x7):_0x5bb0b9;}}const ii={'REPLACE':'replace','INSERT':'insert'};class yr extends _0x42835a{constructor(_0x5a1c60){super(_0x5a1c60),this['set']('isVisible',!0x1),this['set']('mainAction',ii['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x40f776=>Fn(_0x5a1c60,'AI_'+_0x40f776['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Fn(_0x5a1c60,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Fn(_0x5a1c60,'Try\x20again')),this['stopButton']=this['_createButton'](Fn(_0x5a1c60,'Stop'));const _0x478ccb=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x478ccb['if']('isVisible','ck-hidden',_0x1c605b=>!_0x1c605b)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x426e69,_0x1d4bc4){const _0xac5144=new _0x5ee277(this['locale']);return _0xac5144['set']({'label':_0x426e69,'class':_0x1d4bc4||'','isVisible':!0x0,'withText':!0x0}),_0xac5144;}}class Er extends _0x3b9d21{['contentFieldView'];['copyButtonView'];constructor(_0x3657a0,_0x38a528=''){super(_0x3657a0),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x31b6ac=this['bindTemplate'];this['contentFieldView']=new Yn(_0x3657a0,_0x38a528),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x31b6ac['if']('isVisible','ck-hidden',_0x2576f2=>!_0x2576f2)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x31b6ac['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 _0x17404b=!0x1;this['on']('change:value',(_0x2c3c5c,_0x541b15,_0x3371f5)=>{const _0x41d342=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x3371f5),this['isProcessing']&&_0x41d342&&!_0x17404b&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x18d150,_0x4f4c40,_0x3e6620)=>{_0x17404b=!0x1,_0x3e6620?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x17404b=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x17404b=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x526524=this['locale'],_0x4c3f4c=new _0x5ee277(this['locale']),_0x129eeb='ck-ai-form__copy-button';return _0x4c3f4c['set']({'label':Fn(_0x526524,'Copy'),'icon':_0x477338,'class':_0x129eeb,'tooltip':!0x0}),_0x4c3f4c['bind']('isVisible')['to'](this,'value',_0x222c86=>!!_0x222c86),_0x4c3f4c['bind']('isEnabled')['to'](this,'isProcessing',_0x4f08a0=>!_0x4f08a0),_0x4c3f4c['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x4c3f4c['icon']=_0x354c14,_0x4c3f4c['class']=_0x129eeb+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x4c3f4c['icon']=_0x477338,_0x4c3f4c['class']=_0x129eeb;},0x3e8);}),_0x4c3f4c;}['_copyHTMLToClipboard'](_0x32b30f){const {window:_0x2f4eb6,document:_0x50f3e3}=et;if(_0x2f4eb6['ClipboardItem']){const {Blob:_0x5ec682,ClipboardItem:_0x2694c0}=_0x2f4eb6,_0x489afb=[new _0x2694c0({'text/html':new _0x5ec682([_0x32b30f['innerHTML']],{'type':'text/html'}),'text/plain':new _0x5ec682([_0x32b30f['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x489afb);}else{const _0xa3dfcb=_0x50f3e3['createElement']('div');_0xa3dfcb['style']['position']='absolute',_0xa3dfcb['style']['left']='-9999px',_0xa3dfcb['innerHTML']='<span>[</span>'+_0x32b30f['innerHTML']+'<span>]</span>',_0x50f3e3['body']['appendChild'](_0xa3dfcb);const _0x46df86=_0x50f3e3['createRange']();_0x46df86['setStartAfter'](_0xa3dfcb['firstElementChild']),_0x46df86['setEndBefore'](_0xa3dfcb['lastElementChild']);const _0x40aa72=_0x2f4eb6['getSelection']();_0x40aa72['removeAllRanges'](),_0x40aa72['addRange'](_0x46df86),_0x50f3e3['execCommand']('copy'),_0xa3dfcb['remove']();}}}class Yn extends _0x3b9d21{constructor(_0x47c633,_0x2241d9=''){super(_0x47c633),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x2241d9,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x24d4d7){this['element']['innerHTML']=_0x24d4d7;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x292086=new _0x3b9d21(),_0x47c453=this['locale'],_0x2284ea=new _0x2a835f();return _0x2284ea['isVisible']=!0x0,_0x292086['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x2284ea,{'text':Fn(_0x47c453,'AI\x20is\x20writing...')}]}),_0x292086['render'](),_0x292086;}}class vr extends _0x3b9d21{constructor(_0xd978e8,_0x3ea848=''){super(_0xd978e8);const _0x28892f=new _0x53ac42(),_0x51276e=this['bindTemplate'];this['set']('text',_0x3ea848),_0x28892f['content']=_0xb737a1,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x28892f,{'text':_0x51276e['to']('text')}]});}}class Ar extends _0x281705{['submitButtonView'];['showHistoryButtonView'];constructor(_0x4ccfcf,_0x51d7c4){super(_0x4ccfcf,_0x51d7c4),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',(_0x52294e,_0x24c786)=>{_0x52294e['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x24c786());});}['_createSubmitButton'](){const _0xbbef5e=new _0x5ee277(this['locale']),_0x335ad5=this['locale'];return _0xbbef5e['set']({'icon':_0x9a394f,'label':Fn(_0x335ad5,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0xbbef5e['on']('execute',()=>{this['submit']();}),_0xbbef5e['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x514dc0,_0x42b03f)=>!_0x514dc0&&_0x42b03f),_0xbbef5e;}['_createShowHistoryButton'](){const _0x30346d=new _0x5ee277(this['locale']),_0x3f96e6=this['resultsView'],_0x16654b=this['locale'];_0x30346d['set']({'label':Fn(_0x16654b,'History'),'withText':!0x1,'icon':Nt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x30346d['bind']('isOn')['to'](_0x3f96e6,'isVisible'),_0x30346d['bind']('isEnabled')['to'](this,'isEnabled'),_0x30346d['on']('execute',()=>{_0x3f96e6['isVisible']=!_0x3f96e6['isVisible'],_0x3f96e6['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x15ef63=()=>{et['window']['requestAnimationFrame'](()=>{if(_0x551023(this['element'])){const _0x4e32c0=new nt(this['queryView']['fieldView']['element']),_0xe4821c=_0x4e32c0['width'],_0x56f208='rtl'===_0x16654b['uiLanguageDirection']?'left':'right';_0x4e32c0['excludeScrollbarsAndBorders'](),_0x30346d['element']['style'][_0x56f208]=_0xe4821c-_0x4e32c0['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x15ef63),this['on']('render',_0x15ef63),_0x30346d;}['submit'](){const _0x34fa13=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x34fa13);}['focus'](_0x4805b6){-0x1===_0x4805b6?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Pr extends _0x40233d{['historyGroupView'];['clearHistoryButton'];constructor(_0x112850){super(_0x112850),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x28cebf(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Fn(_0x112850,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x508579=0x0;for(const _0x1832c5 of this['items'])_0x508579+=_0x1832c5['items']['length'];return{'resultsCount':_0x508579,'totalItemsCount':_0x508579};}['_createClearHistoryButton'](){const _0x3791ce=this['locale'],_0x17cfbb=new _0x5ee277(this['locale']);return _0x17cfbb['set']({'label':'('+Fn(_0x3791ce,'Clear')+')','withText':!0x0}),_0x17cfbb['on']('execute',()=>this['fire']('clearHistory')),_0x17cfbb;}}class jr extends _0x8173b9{constructor(_0x374593){super();const _0xe7ae2d=new _0x5a5387(),_0x503d01=new _0x5ee277(this['locale'],_0xe7ae2d);this['children']['add'](_0x503d01),_0x503d01['set']({'label':_0x374593['prompt'],'withText':!0x0}),_0x503d01['on']('execute',()=>{this['fire']('execute',{'value':_0x149f56(_0x374593['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class Ir extends _0x39615e{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x550cc9,_0x2d56d8)=>{const _0x417a1b=fo(_0x2d56d8['prompt']);for(const _0x15e0c9 of this)if(_0x15e0c9!=_0x2d56d8&&fo(_0x15e0c9['prompt'])===_0x417a1b){this['remove'](_0x15e0c9);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x2ccc45=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0x2ccc45));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0xb0fa93=>_0xb0fa93)));}}function fo(_0x44a148){return _0x44a148['toLowerCase']()['trim']();}class Z extends _0x3b9d21{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x324fa5,_0x26ec17,_0xc3fd0b=''){super(_0x324fa5),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',ii['REPLACE']),this['_promptHistory']=new Ir(),this['errorView']=new vr(_0x324fa5),this['contentArea']=new Er(_0x324fa5,_0xc3fd0b),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 _0x5364ba(),this['keystrokes']=new _0x5593a8(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x1cce22({'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 _0x3bf8d1=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x26ec17],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x3bf8d1['if']('isError','ck-hidden',_0xc83283=>!_0xc83283)]},'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'](_0x593846=0x1){-0x1===_0x593846?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 _0x416d8f=this['locale'],_0x211649=new Ar(_0x416d8f,{'queryView':{'label':Fn(_0x416d8f,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x9b759,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Fn(_0x416d8f,'Empty\x20history'),'secondary':Fn(_0x416d8f,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x211649['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x28b5af,_0x2dd385)=>_0x28b5af&&!_0x2dd385),this['listenTo'](_0x211649,'submit',(_0x38c2da,_0x4ebaee)=>{this['prompt']=_0x4ebaee;const _0x20a61f=_0x438ca2(_0x4ebaee);this['fire']('submitPrompt',_0x20a61f),_0x4ebaee['trim']()&&this['_promptHistory']['add']({'prompt':_0x20a61f},0x0);},{'priority':'high'}),_0x211649;}['_createHistoryView'](){const _0x596092=new Pr(this['locale']);return _0x596092['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](jr),_0x596092['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x596092;}['_createToolbar'](){const _0x2737f8=new yr(this['locale']);return _0x2737f8['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x20053a,_0x2136aa,_0x3136aa)=>_0x20053a&&!_0x2136aa&&!!_0x3136aa),_0x2737f8['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x2737f8['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x73602e,_0x387ef3,_0x50fbd9)=>_0x73602e&&!_0x387ef3&&!!_0x50fbd9),_0x2737f8['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x2737f8['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x581b76,_0xc0156c)=>_0x581b76&&!_0xc0156c),_0x2737f8['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x2737f8['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x2737f8['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x2737f8;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x39b4ac=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Fn(_0x39b4ac,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x1f79c1){const _0x494252=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x1f79c1||Fn(_0x494252,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const F=globalThis['DataTransfer'];class L extends _0x35c0a2{['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[ti,P,W,_0x416bba];}constructor(_0x382550){super(_0x382550),_0x382550['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x382550['config']['define']('ai.assistant.contentAreaCssClass',''),_0x382550['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x382550['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0xf0801d}=this;this['_aiAdapter']=_0xf0801d['plugins']['get'](W),this['_dialog']=_0xf0801d['plugins']['get'](_0x416bba),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x31caff=new X(_0xf0801d,Array['from'](this['_commandDefinitions']['values']()));_0xf0801d['commands']['add']('showAIAssistant',_0x31caff),_0xf0801d['ui']['componentFactory']['add']('aiCommands',_0xca8118=>{const _0xacb449=_0x36aac4(_0xca8118);return _0xacb449['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0xacb449['buttonView']['set']({'label':Fn(_0xca8118,'AI\x20Commands'),'icon':_0x18d2bf,'tooltip':!0x0}),_0xacb449['on']('execute',_0x3e2695=>this['_onExecute'](_0x3e2695['source']['id'])),_0x4ba9f7(_0xacb449,_0xf0801d['ui']['view']['body'],function(_0x265a48){const _0x4bcbd0=j(_0x265a48['config']['get']('ai.assistant.commands'),_0x265a48['locale']),_0x24baf3=ei(_0x265a48,_0x4bcbd0)['filter'](_0x22f656=>_0x22f656['commands']['length']);if(0x1===_0x24baf3['length'])return ei(_0x265a48,_0x24baf3[0x0]['commands'])['map'](_0x5e8096=>({'id':_0x5e8096['id'],'label':_0x5e8096['label']}));return _0x24baf3['map'](_0xadde9=>{const {groupId:_0x517343,groupLabel:_0xc4aa12,commands:_0x5a4036}=_0xadde9,_0x22ade8=ei(_0x265a48,_0x5a4036)['map'](_0x4b5249=>({'id':_0x4b5249['id'],'label':_0x4b5249['label']}));return{'id':_0x517343,'menu':_0xc4aa12||_0x517343,'children':_0x22ade8};});}(_0xf0801d),{'ariaLabel':Fn(_0xca8118,'AI\x20Commands')}),_0xacb449['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x31caff['on']('change:enabledCommandsIds',_0x34e64b),_0xacb449['menuView']['once']('render',_0x34e64b),_0xacb449;function _0x34e64b(){_0xacb449['isEnabled']=_0x31caff['enabledCommandsIds']['length']>0x0;for(const _0x1ba99c of _0xacb449['menuView']['buttons'])_0x1ba99c['isEnabled']=_0x31caff['enabledCommandsIds']['includes'](_0x1ba99c['id']);}}),_0xf0801d['ui']['componentFactory']['add']('menuBar:aiCommands',_0x51571d=>{const _0x49af2e=new _0x2c511b(_0x51571d);_0x49af2e['buttonView']['set']({'label':Fn(_0x51571d,'AI\x20Commands'),'icon':_0x18d2bf}),_0x49af2e['bind']('isEnabled')['to'](_0x31caff,'enabledCommandsIds',_0x2f55a1=>_0x2f55a1['length']>0x0);const _0x5f4d79=j(_0xf0801d['config']['get']('ai.assistant.commands'),_0x51571d);return this['_populateMenuBarMenu'](_0x31caff,_0x49af2e,_0x5f4d79,_0x4a51d8=>this['_onExecute'](_0x4a51d8)),_0x49af2e;}),_0xf0801d['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x381727=this['_createAIAssistantUIButton'](_0x5ee277);return _0x381727['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x381727;}),_0xf0801d['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x2a3834=this['_createAIAssistantUIButton'](_0x2cc372);return _0x2a3834['set']({'role':'menuitemcheckbox'}),_0x2a3834;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x17aabc=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x5af503;for(const _0x2ccb8d in _0x17aabc){const _0x4bfbd9=_0x2ccb8d,_0xff1bda=_0x17aabc[_0x4bfbd9];if('aiLicenseKeyValid'==_0xff1bda||'aiLicenseKeyInvalid'==_0xff1bda||'aiLicenseKeyExpired'==_0xff1bda||'aiLicenseKeyDomainLimit'==_0xff1bda||'aiLicenseKeyNotAllowed'==_0xff1bda||'aiLicenseKeyEvaluationLimit'==_0xff1bda||'aiLicenseKeyUsageLimit'==_0xff1bda){delete _0x17aabc[_0x4bfbd9],_0x5af503=_0xff1bda,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x5af503&&_0x17aabc['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x5af503&&_0x17aabc['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x5af503&&_0x17aabc['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x5af503&&_0x17aabc['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x5af503&&_0x17aabc['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x5af503&&_0x17aabc['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x560814='',_0x444253='',_0x43a8e9='custom'){const _0x101616=this['editor'],_0x267804=_0x101616['editing']['view'],_0x27bece=_0x101616['plugins']['get'](P),_0x447f55=_0x101616['plugins']['get'](ti);_0x27bece['showFakeVisualSelection']();const _0x1b4cc4=new F(),_0x3dc6c6=new ClipboardEvent('copy',{'clipboardData':_0x1b4cc4}),_0x1bb4be=new _0x3af268(_0x1b4cc4),_0xdb68a=new _0x46f450(_0x267804,_0x3dc6c6,{'dataTransfer':_0x1bb4be});_0x447f55['_forceMarkersCopy']('comment',()=>{_0x267804['document']['fire']('copy',_0xdb68a);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new Y(_0x101616,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x390431=_0x1bb4be['getData']('text/html');const _0x5d62e6=_0x101616['model']['document']['selection'],_0x4fe3ff=Array['from'](_0x5d62e6['getRanges']());0x1===_0x4fe3ff['length']&&_0x4fe3ff[0x0]['isFlat']&&!_0x5d62e6['getSelectedElement']()&&''!==_0x390431['replace'](/&nbsp;/g,'')['trim']()&&(_0x390431='<p>'+_0x390431+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x43a8e9,'query':_0x560814,'htmlContent':_0x390431,'label':_0x444253,'mainActionLabel':ii[_0x101616['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x5a4f43,'title':Fn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x56475d['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x27bece['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x1beadc=new Map(),_0x19e819=j(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x607e56 of _0x19e819)for(const _0x232ee3 of _0x607e56['commands'])_0x1beadc['set'](_0x232ee3['id'],{..._0x232ee3,'groupId':_0x607e56['groupId'],'groupLabel':_0x607e56['groupLabel']||_0x607e56['groupId']});return _0x1beadc;}['_createAIAssistantUIButton'](_0x487273){const _0x193ee6=this['editor'],_0x346234=_0x193ee6['commands']['get']('showAIAssistant'),_0x37b0ab=new _0x487273(_0x193ee6['locale']);return _0x37b0ab['set']({'label':Fn(_0x193ee6['locale'],'AI\x20Assistant'),'icon':_0x5a4f43,'isToggleable':!0x0}),_0x37b0ab['bind']('isEnabled')['to'](_0x346234),_0x37b0ab['bind']('isOn')['to'](this['_dialog'],'id',_0x17eb56=>'aiAssistant'===_0x17eb56),this['listenTo'](_0x37b0ab,'execute',()=>{_0x37b0ab['isOn']?this['hideUI']():_0x346234['execute']();}),_0x37b0ab;}['_initView'](){const _0x31fad2=this['editor']['plugins']['get'](P);this['_formView']=new Z(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',()=>{_0x31fad2['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x31fad2['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x823aea,ui:{ariaLiveAnnouncer:_0x33fd1b}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x29f7db,_0x33f0b9,_0x5eb916)=>{const _0x4d3c79=this['_aiAssistantController']['currentContext'];_0x5eb916?_0x33fd1b['announce'](Fn(_0x823aea,'AI\x20is\x20writing')):_0x4d3c79&&_0x33fd1b['announce'](Fn(_0x823aea,'Generated\x20content:\x20%0',_0x4d3c79),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x58b532,_0x327a83,_0x2163d7)=>{if(_0x2163d7){const _0x94d295=this['_formView']['errorView']['text'];_0x33fd1b['announce'](Fn(_0x823aea,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x94d295));}});}['_onExecute'](_0x4a652c){const _0x78d423=this['_commandDefinitions']['get'](_0x4a652c),_0x54f04e=this['editor'],_0x56b24d=_0x54f04e['model']['document']['selection'],_0x4d76fd=_0x54f04e['commands']['get']('showAIAssistant'),_0x543d7f=_0x54f04e['plugins']['get'](P),_0x323e56=''+(_0x78d423['groupId']!==Q?_0x78d423['groupLabel']+':\x20':'')+_0x78d423['label'];if(!0x1!==_0x78d423['requiresContent']&&_0x56b24d['isCollapsed']){const _0x3217cd=_0x37a4b7(_0x56b24d['getSelectedBlocks']())||_0x54f04e['model']['schema']['getLimitElement'](_0x56b24d);_0x54f04e['model']['change'](_0x1655ef=>{_0x1655ef['setSelection'](_0x3217cd,'in');});}_0x543d7f['showFakeVisualSelection'](),_0x4d76fd['execute'](_0x78d423['prompt'],_0x323e56,'command:'+_0x4a652c);}['_populateMenuBarMenu'](_0x56d6b8,_0x2bf692,_0x5ec588,_0xf7cd61){const _0x16947b=this['editor'],_0x229400=_0x16947b['locale'],_0x21ca7d=new _0x1f7c03(_0x229400),_0x4f49f4=ei(_0x16947b,_0x5ec588)['filter'](_0x34079b=>_0x34079b['commands']['length']);0x1===_0x4f49f4['length']?this['_getMenuBarGroupButtons']({'command':_0x56d6b8,'commands':_0x4f49f4[0x0]['commands'],'parentMenuView':_0x2bf692,'onExecute':_0xf7cd61})['forEach'](_0x3971e5=>_0x21ca7d['items']['add'](_0x3971e5)):_0x4f49f4['forEach'](({groupId:_0x4e748c,groupLabel:_0x58a416,commands:_0x11ef7})=>{const _0x2634d6=new _0x44c9e0(_0x229400,_0x2bf692),_0x523ef8=new _0x2c511b(_0x229400),_0x6858b5=new _0x1f7c03(_0x229400),_0x4096d9=this['_getMenuBarGroupButtons']({'command':_0x56d6b8,'commands':_0x11ef7,'parentMenuView':_0x523ef8,'onExecute':_0xf7cd61});_0x523ef8['buttonView']['set']({'label':_0x58a416||_0x4e748c}),_0x523ef8['delegate']('execute')['to'](_0x2bf692),_0x6858b5['items']['addMany'](_0x4096d9),_0x523ef8['panelView']['children']['add'](_0x6858b5),_0x2634d6['children']['add'](_0x523ef8),_0x21ca7d['items']['add'](_0x2634d6);}),_0x2bf692['panelView']['children']['add'](_0x21ca7d);}['_getMenuBarGroupButtons']({command:_0x51c635,commands:_0x1cd70c,parentMenuView:_0x391012,onExecute:_0x368782}){const _0x59c8ca=this['editor'],_0x3bd0a6=_0x59c8ca['locale'];return ei(_0x59c8ca,_0x1cd70c)['map'](_0xb4e317=>{const _0x48213a=new _0x44c9e0(_0x3bd0a6,_0x391012),_0x2b36b4=new _0x2cc372(_0x3bd0a6);return _0x2b36b4['set']({'label':_0xb4e317['label']}),_0x2b36b4['delegate']('execute')['to'](_0x391012),_0x2b36b4['on']('execute',()=>_0x368782(_0xb4e317['id'])),_0x2b36b4['bind']('isEnabled')['to'](_0x51c635,'enabledCommandsIds',_0x55d115=>_0x55d115['includes'](_0xb4e317['id'])),_0x48213a['children']['add'](_0x2b36b4),_0x48213a;});}}function si(_0x5897fb,_0x424a61){return void 0x0!==_0x5897fb['order']&&void 0x0===_0x424a61['order']?0x1:void 0x0===_0x5897fb['order']&&void 0x0!==_0x424a61['order']?-0x1:void 0x0!==_0x5897fb['order']&&void 0x0!==_0x424a61['order']?_0x5897fb['order']-_0x424a61['order']:0x0;}function ei(_0x23d469,_0x459870){_0x459870['sort'](si);const _0x417bae={},_0x4c63e2=[];for(const _0x4f9da5 of _0x459870)if(void 0x0!==_0x4f9da5['order']){if(_0x4f9da5['order']in _0x417bae)throw new _0x15f966('ai-commands-config-order-collision',_0x23d469,{'conflictingDefinitions':[_0x4f9da5,_0x417bae[_0x4f9da5['order']]]});_0x417bae[_0x4f9da5['order']]=_0x4f9da5,_0x4c63e2['splice'](_0x4f9da5['order'],0x0,_0x4f9da5);}else _0x4c63e2['push'](_0x4f9da5);return _0x4c63e2;}class $n extends _0x35c0a2{static get['requires'](){return[L,P];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4a898a){super(_0x4a898a);const _0x551927=_0x4a898a['config'],_0x562798=_0x4a898a['locale'];_0x551927['define']('ai.assistant.preserveComments',!0x0),_0x551927['define']('ai.assistant.commands',qn(_0x562798)),_0x551927['define']('ai.assistant.extraCommandGroups',[]),_0x551927['define']('ai.assistant.removeCommands',[]);let _0x181cfc=j(_0x551927['get']('ai.assistant.commands'),_0x562798);const _0x3d729a=_0x551927['get']('ai.assistant.extraCommandGroups'),_0x2b16e4=_0x551927['get']('ai.assistant.removeCommands');_0x3d729a['forEach'](_0x392d6e=>{const _0x8ce67d=_0x181cfc['find'](_0x544f79=>_0x544f79['groupId']===_0x392d6e['groupId']);_0x8ce67d?_0x8ce67d['commands']=_0x8ce67d['commands']['concat'](_0x392d6e['commands']):_0x181cfc['push'](_0x392d6e);}),_0x181cfc=_0x181cfc['filter'](_0x19932c=>!_0x2b16e4['includes'](_0x19932c['groupId'])),_0x181cfc['forEach'](_0x204662=>{_0x204662['commands']=_0x204662['commands']['filter'](_0x5863ad=>!_0x2b16e4['includes'](_0x5863ad['id']));}),_0x551927['set']('ai.assistant.commands',_0x181cfc);}}function qn(_0x66757c){return[{'groupId':'editOrReview','groupLabel':Fn(_0x66757c,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Fn(_0x66757c,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Fn(_0x66757c,'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':Fn(_0x66757c,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Fn(_0x66757c,'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':Fn(_0x66757c,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Fn(_0x66757c,'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':Fn(_0x66757c,'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':Fn(_0x66757c,'Change\x20tone'),'commands':[{'id':'professional','label':Fn(_0x66757c,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Fn(_0x66757c,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Fn(_0x66757c,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Fn(_0x66757c,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Fn(_0x66757c,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Fn(_0x66757c,'Change\x20style'),'commands':[{'id':'business','label':Fn(_0x66757c,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Fn(_0x66757c,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Fn(_0x66757c,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Fn(_0x66757c,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Fn(_0x66757c,'Translate'),'commands':[{'id':'translateEnglish','label':Fn(_0x66757c,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Fn(_0x66757c,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Fn(_0x66757c,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Fn(_0x66757c,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Fn(_0x66757c,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Fn(_0x66757c,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Fn(_0x66757c,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Fn(_0x66757c,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class Se extends _0x35c0a2{['abortController'];static get['requires'](){return[W];}constructor(_0x465b4f){super(_0x465b4f),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](W)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x5b271e){return this['sendRequest'](_0x5b271e)['catch'](_0x531578=>{if(_0x531578 instanceof is)return Promise['reject'](_0x531578);if('AbortError'==_0x531578['name'])return Promise['resolve']();throw console['error'](_0x531578),new _0x15f966('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x87ed08,_0x184deb){const _0x5ac73b=this['editor']['locale'],_0x82ae22={'Content-Type':'application/json'};if('object'==typeof _0x87ed08)Object['assign'](_0x82ae22,_0x87ed08);else{if(_0x87ed08)try{const _0xfbe9a=await _0x87ed08(_0x184deb);Object['assign'](_0x82ae22,_0xfbe9a);}catch{return Promise['reject'](new is(Fn(_0x5ac73b,'AI_ERROR_GET_HEADERS')));}}return _0x82ae22;}async['_prepareRequestParameters'](_0x5ce8fd,_0x59e3ab){const _0x8d7ad6=this['editor']['locale'];if('object'==typeof _0x5ce8fd)return _0x5ce8fd;try{return await _0x5ce8fd(_0x59e3ab);}catch{return Promise['reject'](new is(Fn(_0x8d7ad6,'AI_ERROR_GET_PARAMETERS')));}}}class Qn extends Se{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x5523f6){super(_0x5523f6),_0x5523f6['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x5523f6['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x5523f6['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x5523f6['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x5523f6['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x5523f6['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x24d1a4,context:_0xe3fa22,onData:_0x2fb2b1,actionId:_0x36eb36}){const _0x2c6886=this['editor']['locale'],_0x1f9ca5=await this['prepareMessages'](_0x24d1a4,_0xe3fa22,_0x36eb36),_0x35b915=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x36eb36),_0x116dbf=await this['_prepareRequestParameters'](this['_requestParameters'],_0x36eb36),_0x2d1d28={'messages':_0x1f9ca5,..._0x116dbf},_0x2e5529={'method':'POST','headers':_0x35b915,'body':JSON['stringify'](_0x2d1d28),'signal':this['abortController']['signal']},_0x4065e2=await fetch(this['_apiUrl'],_0x2e5529);if(_0x4065e2['ok'])return _0x116dbf['stream']?await this['_readStreamableResponse'](_0x4065e2,_0x2fb2b1):await this['_readStaticResponse'](_0x4065e2,_0x2fb2b1),Promise['resolve']();{const _0x30738f=await _0x4065e2['text']();return _0x30738f['includes']('context_length_exceeded')?Promise['reject'](new is(Fn(_0x2c6886,'AI_ERROR_CONTEXT_LENGTH'))):_0x30738f['includes']('Moderation')?Promise['reject'](new is(Fn(_0x2c6886,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x30738f));}}async['prepareMessages'](_0x2d73c8,_0x44e15d,_0x5353a5){let _0x1ba8f0,_0x53a4d2;return _0x44e15d?(_0x1ba8f0='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.',_0x53a4d2='Instruction:\x0a'+_0x2d73c8+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x44e15d):(_0x1ba8f0='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.',_0x53a4d2=_0x2d73c8),[{'role':'system','content':_0x1ba8f0},{'role':'user','content':_0x53a4d2}];}async['_readStreamableResponse'](_0x389183,_0x5733e2){const _0x356f23=_0x389183['body']['getReader'](),_0x5d9904=new TextDecoder();let _0x1b78b4='',_0x219ad9='',_0x35400e='',_0x43cc7c=!0x1;for(;!_0x43cc7c;){const {done:_0x31f3d8,value:_0x149726}=await _0x356f23['read'](),_0x417f81=_0x1b78b4+_0x5d9904['decode'](_0x149726);let _0x4610e8='';_0x43cc7c=_0x31f3d8;try{_0x4610e8=this['_cleanUpData'](_0x417f81),_0x1b78b4='';}catch{_0x1b78b4=_0x417f81;continue;}_0x219ad9+=_0x4610e8,!_0x43cc7c&&this['_isBufferIncomplete'](_0x219ad9)||_0x219ad9&&(_0x35400e+=_0x219ad9,_0x219ad9='',_0x5733e2(_0x35400e));}return Promise['resolve']();}async['_readStaticResponse'](_0x4fbda1,_0x1b8420){return _0x1b8420((await _0x4fbda1['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x52526d){const _0x2019cb=_0x52526d['split']('<')['length']!==_0x52526d['split']('>')['length'],_0x42fb53=_0x52526d['length']<0x1e;return _0x2019cb&&_0x42fb53;}['_cleanUpData'](_0xcb286e){return _0xcb286e['split'](/\n(?![^{]*\})/g)['map'](_0x349e36=>_0x349e36['replace']('data:\x20',''))['filter'](_0x3f71c4=>_0x3f71c4&&_0x3f71c4['length']>0x0&&'[DONE]'!==_0x3f71c4)['map'](_0x3b05f0=>{const {choices:_0x120d74}=JSON['parse'](_0x3b05f0);if(_0x120d74[0x0]?.['delta']?.['content'])return _0x120d74[0x0]['delta']['content'];})['filter'](_0x1480a0=>_0x1480a0)['join']('');}}class Xn extends Se{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x2dd915){super(_0x2dd915),_0x2dd915['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x2dd915['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']=_0x2dd915['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x2dd915['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x2dd915['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x2dd915['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x2d0937,context:_0x3ee1dc,onData:_0x3bc558,actionId:_0x30a835}){const {model:_0x315e5c,stream:_0x845542,..._0xcdc735}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x30a835),_0x49b2c5={'prompt':await this['preparePrompt'](_0x2d0937,_0x3ee1dc,_0x315e5c,_0x30a835),..._0xcdc735};this['_apiUrl']?await this['_processProxyRequest'](_0x49b2c5,_0x315e5c,_0x845542,_0x3bc558,_0x30a835):await this['_processAWSRequest'](_0x49b2c5,_0x315e5c,_0x845542,_0x3bc558);}async['preparePrompt'](_0x54c7fe,_0xb6b79d,_0x403142,_0x993ae2){let _0x2508df,_0x506ca3;return _0xb6b79d?(_0x2508df='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.',_0x506ca3='Instruction:\x0a'+_0x54c7fe+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0xb6b79d):(_0x2508df='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.',_0x506ca3=_0x54c7fe),'meta.llama'==this['getModelFamily'](_0x403142)?'<<SYS>>\x0a'+_0x2508df+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x506ca3+'\x0a[/INST]':'Human:\x0a'+_0x2508df+'\x0a'+_0x506ca3+'\x0a\x0aAssistant:';}['getModelFamily'](_0x96c031){if(/^anthropic\.claude/['test'](_0x96c031))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x96c031))return'ai21.j2';if(/^cohere\.command/['test'](_0x96c031))return'cohere.command';if(/^meta\.llama/['test'](_0x96c031))return'meta.llama';throw new is(Fn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x96c031));}async['_processProxyRequest'](_0x167879,_0x5e628e,_0x60da47,_0x4f020f,_0x494dcf){const _0x1f34e3={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x494dcf),'body':JSON['stringify']({..._0x167879,'model':_0x5e628e,'stream':_0x60da47}),'signal':this['abortController']['signal']},_0x15fe65=await fetch(this['_apiUrl'],_0x1f34e3);_0x60da47?await this['_readStreamableResponse'](_0x15fe65,_0x5e628e,_0x4f020f):await this['_readStaticResponse'](_0x15fe65,_0x5e628e,_0x4f020f);}async['_processAWSRequest'](_0x4d993a,_0x3804f5,_0x32a617,_0x113f97){const _0x2ff1f2=new _0x362bce(this['_bedrockClientConfig']),_0x47d8c8={'body':JSON['stringify'](_0x4d993a),'contentType':'application/json','accept':'application/json','modelId':_0x3804f5};let _0x27ed24;if(_0x32a617){const _0xfc0b12=new _0x535cea(_0x47d8c8);_0x27ed24=await _0x2ff1f2['send'](_0xfc0b12,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x27ed24,_0x3804f5,_0x113f97);}else{const _0x2998cc=new _0x479662(_0x47d8c8);_0x27ed24=await _0x2ff1f2['send'](_0x2998cc,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x27ed24,_0x3804f5,_0x113f97);}}async['_readAsyncIterableResponse'](_0x4ea92b,_0x28cba7,_0x476406){const _0x29cd01=_0x4ea92b['body'],_0x1f5d02=new TextDecoder('utf-8');let _0x5a4f7a='';for await(const _0xfec0ce of _0x29cd01)if(_0xfec0ce['chunk']){const _0x29c0b0=_0x1f5d02['decode'](_0xfec0ce['chunk']['bytes']),_0x15952a=JSON['parse'](_0x29c0b0);_0x5a4f7a+=this['_getGeneratedText'](_0x15952a,_0x28cba7),_0x476406(_0x5a4f7a);}return Promise['resolve']();}async['_readStreamableResponse'](_0x47430e,_0x7e35e2,_0x467681){const _0x5c68e9=_0x47430e['body'],_0x3a719d=new TextDecoder('utf-8'),_0x2902d1=_0x5c68e9['getReader']();let _0x3142d7='',_0x119568='',_0x33be8e=!0x1;for(;!_0x33be8e;){const {done:_0x1f895e,value:_0x5a6ad6}=await _0x2902d1['read']();if(_0x33be8e=_0x1f895e,_0x33be8e)break;const _0xc3ca5e=(_0x3142d7+_0x3a719d['decode'](_0x5a6ad6))['split']('\x0a')['map'](_0x40704c=>{try{return _0x3142d7='',JSON['parse'](_0x40704c);}catch{return _0x3142d7=_0x40704c,null;}})['filter'](_0x1acca0=>null!==_0x1acca0);_0xc3ca5e['length']&&(_0x119568+=_0xc3ca5e['map'](_0x2fb95f=>this['_getGeneratedText'](_0x2fb95f,_0x7e35e2))['join'](''),_0x467681(_0x119568));}return Promise['resolve']();}async['_readStaticResponse'](_0x5a39ef,_0x6a990e,_0xdad6bb){let _0x5ec2fc;return _0x5ec2fc=_0x5a39ef instanceof Response?await _0x5a39ef['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x5a39ef['body'])),(_0xdad6bb(this['_getGeneratedText'](_0x5ec2fc,_0x6a990e)),Promise['resolve']());}['_getGeneratedText'](_0x339beb,_0x179263){switch(this['getModelFamily'](_0x179263)){case'anthropic.claude':return _0x339beb['completion'];case'ai21.j2':return _0x339beb['completions'][0x0]['data']['text'];case'cohere.command':return _0x339beb['generations'][0x0]['text'];case'meta.llama':return _0x339beb['generation'];}}}class ia extends _0x5ee277{constructor(_0x506a39,_0x2e922d={}){super(_0x506a39),this['isToggleable']=!0x0,this['set']('side',_0x2e922d['side']||'top');const _0x484046=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x53a4f2(_0x2e922d['class']||[]),_0x484046['to']('side',_0x28f8a3=>'ck-tab-button_'+_0x28f8a3),_0x484046['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x3b9d21{['children'];constructor(_0x5d37b1,_0xe2c0e2={}){super(_0x5d37b1);const _0x18a3db=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x53a4f2(_0xe2c0e2['class']||[]),_0x18a3db['to']('class'),_0x18a3db['if']('isVisible','ck-hidden',_0x3816e8=>!_0x3816e8)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x3b9d21{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x5e641e,_0x4f9f0e={}){super(_0x5e641e),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x4f9f0e['side']||'top'),this['set']('isMaximized',!0x1);const _0x526afa=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x53a4f2(_0x4f9f0e['class']||[]),_0x526afa['to']('side',_0x4b1d22=>'ck-tabs_'+_0x4b1d22),_0x526afa['to']('class'),_0x526afa['to']('isMaximized',_0x5be89c=>_0x5be89c?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x526afa['to']('side',_0x4abcf1=>'ck-tabs__buttons-container_'+_0x4abcf1)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x526afa['to']('side',_0x8a6138=>'ck-tabs__panels-container_'+_0x8a6138)]},'children':this['panelViews']},..._0x53a4f2(_0x4f9f0e['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x133fe8){const _0xc6bf3c=this['_tabs']['get'](_0x133fe8);return _0xc6bf3c||null;}['addTab'](_0xb5771d){const _0x4ddb97=this['_setupButton']({'id':_0xb5771d['id'],'label':_0xb5771d['buttonLabel'],'icon':_0xb5771d['buttonIcon'],'order':_0xb5771d['order']}),_0x1f8416=new ea(this['locale']);return _0x1f8416['render'](),_0xb5771d['content']&&_0x1f8416['children']['add'](_0xb5771d['content']),this['panelViews']['add'](_0x1f8416),this['_tabs']['set'](_0xb5771d['id'],{'button':_0x4ddb97,'panel':_0x1f8416,'order':void 0x0!==_0xb5771d['order']?_0xb5771d['order']:null}),this['fire']('addTab:'+_0xb5771d['id'],{'id':_0xb5771d['id'],'button':_0x4ddb97,'panel':_0x1f8416}),null===this['activeTab']?this['activateTab'](_0xb5771d['id']):this['_hidePanel'](_0xb5771d['id']),{'button':_0x4ddb97,'panel':_0x1f8416};}['activateTab'](_0x45fccb){if(null!==_0x45fccb&&!this['getTab'](_0x45fccb))throw new _0x15f966('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x45fccb});this['activeTab']!==_0x45fccb&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x45fccb,_0x45fccb&&this['_showPanel'](_0x45fccb),this['fire']('activateTab:'+_0x45fccb,_0x45fccb));}['showTab'](_0x115ac9){if(!this['getTab'](_0x115ac9))throw new _0x15f966('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x115ac9});this['_showPanel'](_0x115ac9),this['_showButton'](_0x115ac9),this['fire']('show:'+_0x115ac9,_0x115ac9);}['hideTab'](_0x5b4fa7){if(!this['getTab'](_0x5b4fa7))throw new _0x15f966('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x5b4fa7});const _0x34d0b9=this['activeTab'];this['_hidePanel'](_0x5b4fa7),this['_hideButton'](_0x5b4fa7);const _0xddbe39=this['getTabIds']();_0x34d0b9===_0x5b4fa7&&_0xddbe39['length']>0x1&&this['activateTab'](_0xddbe39['find'](_0x2bb0aa=>_0x2bb0aa!==_0x5b4fa7)),this['fire']('hide:'+_0x5b4fa7,_0x5b4fa7);}['_getPanel'](_0x1cc043){const _0x1805b9=this['_tabs']['get'](_0x1cc043);return _0x1805b9?_0x1805b9['panel']:null;}['_showPanel'](_0x2650e2){null!==this['activeTab']&&this['activeTab']!==_0x2650e2||this['_getPanel'](_0x2650e2)['show']();}['_hidePanel'](_0x30c43f){const _0x3733be=this['_getPanel'](_0x30c43f);_0x3733be['isVisible']&&(this['activeTab']===_0x30c43f&&(this['activeTab']=null),_0x3733be['hide']());}['_getButton'](_0x36b479){const _0xd0f064=this['_tabs']['get'](_0x36b479);return _0xd0f064?_0xd0f064['button']:null;}['_showButton'](_0x5d0e17){this['_getButton'](_0x5d0e17)['show']();}['_hideButton'](_0x477a15){this['_getButton'](_0x477a15)['hide']();}['_setupButton'](_0x12321e){const _0xf35264=new ia(this['locale'],{'side':this['side']}),_0xba381a=this['buttonViews'];if(_0xf35264['set']({'label':_0x12321e['label'],'icon':_0x12321e['icon'],'tooltip':!0x0,'withText':!0x0}),_0xf35264['bind']('isOn')['to'](this,'activeTab',_0x2247b3=>_0x2247b3===_0x12321e['id']),_0xf35264['bind']('side')['to'](this,'side'),_0x12321e['order']){const _0x56b527=[...this['_tabs']]['reduce']((_0x29935f,_0x10bb9c)=>{const _0x5ce67f=_0x10bb9c[0x0],{order:_0x33dae5}=_0x10bb9c[0x1];return!_0x33dae5||_0x33dae5>_0x12321e['order']?_0x29935f:_0x33dae5>=_0x29935f['order']?{'id':_0x5ce67f,'order':_0x33dae5}:_0x29935f;},{'id':'','order':0x0}),_0x2a9969=_0xba381a['getIndex'](this['_getButton'](_0x56b527['id']));_0xba381a['add'](_0xf35264,_0x2a9969+0x1);}else _0xba381a['add'](_0xf35264);return _0xf35264['on']('execute',()=>{this['activateTab'](_0x12321e['id']);}),_0xf35264;}}const wi=['overlay','sidebar','custom'],fi=['left','right'];class pi extends ss{constructor(_0x2ba05c,_0x1de607={}){super(_0x2ba05c,_0x1de607),this['set']('type',_0x1de607['type']||'sidebar'),this['set']('side',_0x1de607['side']||'right'),this['set']('isVisible',_0x1de607['visibleByDefault']??!0x0);const _0x2f066a=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x2f066a['if']('type','ck-ai-tabs__overlay',_0x39da2e=>'overlay'===_0x39da2e),_0x2f066a['if']('type','ck-ai-tabs__sidebar',_0x1be2da=>'sidebar'===_0x1be2da),_0x2f066a['if']('isVisible','ck-hidden',_0x3dd225=>!_0x3dd225)]}}),this['buttonViews']['on']('add',(_0x2dd2a4,_0x179c2e)=>{_0x179c2e['set']('withText',!0x1);});}}class pt extends tt{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x413b76){super(_0x413b76);const _0x44c94d=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x44c94d)throw new _0x15f966('ai-tabs-configuration-not-found');if(void 0x0!==_0x44c94d['showResizeButton']&&(this['showResizeButton']=_0x44c94d['showResizeButton']),'sidebar'!==_0x44c94d['type']&&'overlay'!==_0x44c94d['type']||_0x44c94d['side']&&(this['side']=_0x44c94d['side']),'sidebar'===_0x44c94d['type']){if(this['container']=_0x44c94d['element'],this['set']('type','sidebar'),!this['container'])throw new _0x15f966('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x44c94d['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new pi(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x44c94d['visibleByDefault']||_0x44c94d['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 ht&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x472a5a){if(_0x472a5a&&this['type']!==_0x472a5a){if(!wi['includes'](_0x472a5a))throw new _0x15f966('ai-tabs-unsupported-ui-type');this['type']=_0x472a5a;}}['switchSide'](_0x34931d){if(_0x34931d&&this['side']!==_0x34931d){if(!fi['includes'](_0x34931d))throw new _0x15f966('ai-tabs-unsupported-ui-side');this['side']=_0x34931d;}}['resize'](){this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class s extends tt{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4de6e4){super(_0x4de6e4),this['context']['config']['define']('ai.serviceUrl','https://ai.cke-cs.com/v1'),this['_apiUrl']=this['context']['config']['get']('ai.serviceUrl'),this['_token']=null,this['_decoder']=new TextDecoder();}['init'](){const _0x17d9fa=this['context']['plugins']['get']('CloudServices');if(!_0x17d9fa['token'])throw new _0x15f966('ai-missing-token',this);this['_token']=_0x17d9fa['token'];}['startConversation'](_0x86ce96,_0x54b83a){const _0xc4be70=this['_sendApiRequest']('/conversations','POST',{'id':_0x86ce96,'group':_0x54b83a});return{'getConversation':async()=>(await _0xc4be70['request'])['json'](),'abortController':_0xc4be70['abortController']};}['queryAssistant']({message:_0x1e3e4f,conversationId:_0x76abfd,parts:_0x31f317,capabilities:_0x46719a,model:_0x4fe25f,quickActionData:_0x52eaf8}){const _0x3a7f99={..._0x52eaf8&&{'quickActionData':_0x52eaf8}},_0x2ed247={'prompt':_0x1e3e4f,'content':_0x31f317,'model':_0x4fe25f,..._0x46719a&&{'capabilities':_0x46719a},...Object['keys'](_0x3a7f99)['length']>0x0&&{'attributes':_0x3a7f99}},_0x57bde3=this['_sendApiRequest']('/conversations/'+_0x76abfd+'/messages','POST',_0x2ed247);return{'getStream':async()=>{const _0x4adb05=(await _0x57bde3['request'])['body'];return this['_getStreamReader'](_0x4adb05);},'abortController':_0x57bde3['abortController']};}['executeCustomAction']({content:_0x505f86,message:_0x19da7a,model:_0x57399d,outputFormat:_0x241e28}){const _0x4c0d7d={'content':[{'type':'text','content':_0x505f86}],'prompt':_0x19da7a,'model':_0x57399d,'outputFormat':_0x241e28},_0x16ff44=this['_sendApiRequest']('/actions/custom/calls','POST',_0x4c0d7d);return{'getStream':async()=>{const _0x3231d0=(await _0x16ff44['request'])['body'];return this['_getStreamReader'](_0x3231d0);},'abortController':_0x16ff44['abortController']};}['executeAction']({actionName:_0x865cbf,content:_0x4d4b16,args:_0xd7fef}){const _0x17a8d9={'content':[{'type':'text','content':_0x4d4b16}],'args':_0xd7fef},_0x29ab1c=this['_sendApiRequest']('/actions/system/'+_0x865cbf+'/calls','POST',_0x17a8d9);return{'getStream':async()=>{const _0x41e0ab=(await _0x29ab1c['request'])['body'];return this['_getStreamReader'](_0x41e0ab);},'abortController':_0x29ab1c['abortController']};}['uploadFile'](_0x580451,_0x333666,_0x34c0e2){const _0x26cd37=new FormData();_0x26cd37['append']('file',_0x333666,_0x333666['name']),_0x34c0e2&&_0x26cd37['append']('attributes',JSON['stringify'](_0x34c0e2));const _0x581a4f=this['_sendApiRequest']('/conversations/'+_0x580451+'/files','POST',_0x26cd37);return{'getId':async()=>(await _0x581a4f['request'])['json'](),'abortController':_0x581a4f['abortController']};}['fetchDocument'](_0x20ca6d,_0x3b5f9e){const _0x208706=this['_sendApiRequest']('/conversations/'+_0x20ca6d+'/documents/'+_0x3b5f9e,'GET');return{'getDocument':async()=>(await _0x208706['request'])['json'](),'abortController':_0x208706['abortController']};}['uploadDocument'](_0x102e94,_0x41d074,_0x1ba1ed){const _0x19d90b={'content':_0x41d074};_0x1ba1ed&&(_0x19d90b['attributes']=_0x1ba1ed);const _0x44e4d6=this['_sendApiRequest']('/conversations/'+_0x102e94+'/documents','POST',_0x19d90b);return{'getId':async()=>(await _0x44e4d6['request'])['json'](),'abortController':_0x44e4d6['abortController']};}['fetchConversations'](_0x48ef47,_0x56c83b){const _0x2dd071=new URLSearchParams();_0x2dd071['append']('excludeEmpty','true'),_0x2dd071['append']('limit','100'),_0x2dd071['append']('group',_0x48ef47),_0x56c83b&&_0x2dd071['append']('search',_0x56c83b);const _0x1bdacf=this['_sendApiRequest']('/conversations?'+_0x2dd071['toString'](),'GET');return{'getConversations':async()=>{const _0x1521d4=await _0x1bdacf['request'];return(await _0x1521d4['json']())['items'];},'abortController':_0x1bdacf['abortController']};}['deleteConversation'](_0x3202fe){const _0xe5e53=this['_sendApiRequest']('/conversations/'+_0x3202fe,'DELETE');return{'execute':async()=>{await _0xe5e53['request'];},'abortController':_0xe5e53['abortController']};}['updateConversation'](_0x122ce7,_0x320c95){const _0x33ea62=this['_sendApiRequest']('/conversations/'+_0x122ce7,'PATCH',_0x320c95);return{'getResult':async()=>(await _0x33ea62['request'],_0x320c95),'abortController':_0x33ea62['abortController']};}['fetchConversation'](_0x4017c4){const _0x203539=this['_sendApiRequest']('/conversations/'+_0x4017c4,'GET');return{'getConversation':async()=>(await _0x203539['request'])['json'](),'abortController':_0x203539['abortController']};}['fetchConversationMessages'](_0xbda697){const _0x301f9a=this['_sendApiRequest']('/conversations/'+_0xbda697+'/messages','GET');return{'getMessages':async()=>{const _0x397851=await _0x301f9a['request'];return(await _0x397851['json']())['items'];},'abortController':_0x301f9a['abortController']};}['uploadUrl'](_0x177a5e,_0x57a3b4,_0x1f86d2){const _0x2af820=this['_sendApiRequest']('/conversations/'+_0x177a5e+'/web-resources','POST',{'url':_0x57a3b4,'attributes':_0x1f86d2});return{'getId':async()=>(await _0x2af820['request'])['json'](),'abortController':_0x2af820['abortController']};}['getModels'](_0x415755='en'){const _0x70c454=new URLSearchParams();_0x70c454['append']('language',_0x415755);const _0x15a85e='/models/1?'+_0x70c454['toString'](),_0x2b2608=this['_sendApiRequest'](_0x15a85e,'GET');return{'list':async()=>await(await _0x2b2608['request'])['json'](),'abortController':_0x2b2608['abortController']};}['deleteFile'](_0x3ea468,_0x95ecea){const _0x27a282=this['_sendApiRequest']('/conversations/'+_0x3ea468+'/files/'+_0x95ecea,'DELETE');return{'execute':async()=>{await _0x27a282['request'];},'abortController':_0x27a282['abortController']};}['deleteDocument'](_0xd4d047,_0x49d4d8){const _0x167961=this['_sendApiRequest']('/conversations/'+_0xd4d047+'/documents/'+_0x49d4d8,'DELETE');return{'execute':async()=>{await _0x167961['request'];},'abortController':_0x167961['abortController']};}['deleteWebResource'](_0x59ad45,_0x59d452){const _0x45526a=this['_sendApiRequest']('/conversations/'+_0x59ad45+'/web-resources/'+_0x59d452,'DELETE');return{'execute':async()=>{await _0x45526a['request'];},'abortController':_0x45526a['abortController']};}['callSystemReview']({reviewName:_0x25fbe1,content:_0x2513a4,args:_0xde4d19}){const _0x6dc392=this['_sendApiRequest']('/reviews/system/'+_0x25fbe1+'/calls','POST',{'content':[{'type':'text','content':_0x2513a4}],'args':_0xde4d19});return{'getStream':async()=>{const _0x4b078f=(await _0x6dc392['request'])['body'];return this['_getStreamReader'](_0x4b078f);},'abortController':_0x6dc392['abortController']};}['callCustomReview']({content:_0x2c49bd,prompt:_0x5941c8,model:_0x1ac90d}){const _0x1f5f38=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x2c49bd}],'prompt':_0x5941c8,'model':_0x1ac90d});return{'getStream':async()=>{const _0x415fd7=(await _0x1f5f38['request'])['body'];return this['_getStreamReader'](_0x415fd7);},'abortController':_0x1f5f38['abortController']};}['upsertAIChatRating'](_0x2881c0,_0x59a165,_0x2a18b5){const _0x3a871c=this['_sendApiRequest']('/conversations/'+_0x2881c0+'/messages/'+_0x59a165+'/ratings','PUT',{'positiveCount':_0x2a18b5['positiveCount'],'totalCount':_0x2a18b5['totalCount'],'modificationId':_0x2a18b5['modificationId']});return{'execute':async()=>{await _0x3a871c['request'];},'abortController':_0x3a871c['abortController']};}['upsertAIActionRating'](_0x2bdc5f,_0x4b9138,_0x24f3f7){const _0x291aba=this['_sendApiRequest']('/actions/system/'+_0x2bdc5f+'/calls/'+_0x4b9138+'/ratings','PUT',{'positiveCount':_0x24f3f7['positiveCount'],'totalCount':_0x24f3f7['totalCount']});return{'execute':async()=>{await _0x291aba['request'];},'abortController':_0x291aba['abortController']};}['upsertCustomAIActionRating'](_0x3f4638,_0x233815){const _0x49f8bc=this['_sendApiRequest']('/actions/custom/calls/'+_0x3f4638+'/ratings','PUT',{'positiveCount':_0x233815['positiveCount'],'totalCount':_0x233815['totalCount']});return{'execute':async()=>{await _0x49f8bc['request'];},'abortController':_0x49f8bc['abortController']};}['upsertAIReviewRating'](_0x4dd094,_0x48b0fc,_0x10099f,_0x358e83){const _0x199129=this['_sendApiRequest']('/reviews/system/'+_0x4dd094+'/calls/'+_0x48b0fc+'/ratings','PUT',{'positiveCount':_0x10099f['positiveCount'],'totalCount':_0x10099f['totalCount'],'dataId':_0x358e83});return{'execute':async()=>{await _0x199129['request'];},'abortController':_0x199129['abortController']};}['upsertCustomAIReviewRating'](_0x46c961,_0x606563,_0x2c205f){const _0x22d99f=this['_sendApiRequest']('/reviews/custom/calls/'+_0x46c961+'/ratings','PUT',{'positiveCount':_0x606563['positiveCount'],'totalCount':_0x606563['totalCount'],'dataId':_0x2c205f});return{'execute':async()=>{await _0x22d99f['request'];},'abortController':_0x22d99f['abortController']};}['_sendApiRequest'](_0x5e5fa3,_0x57204a,_0x555f8b){const _0xc2cf68=new AbortController(),_0x2eea62=_0x555f8b instanceof FormData,_0x3970a6={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x555f8b&&!_0x2eea62&&(_0x3970a6['Content-Type']='application/json');const _0xdc82ed={'method':_0x57204a,'headers':_0x3970a6,'signal':_0xc2cf68['signal']};return _0x555f8b&&(_0xdc82ed['body']=_0x2eea62?_0x555f8b:JSON['stringify'](_0x555f8b)),{'request':fetch(''+this['_apiUrl']+_0x5e5fa3,_0xdc82ed)['catch'](_0x1a0415=>{this['_handleError'](_0x1a0415);})['then'](_0x5a2543=>_0x5a2543['ok']?_0x5a2543:_0x5a2543['json']()['then'](_0x12ccee=>{throw{'url':this['_apiUrl'],'path':_0x5e5fa3,'method':_0x57204a,'body':_0x555f8b,'status':(_0x5a2543||{})['status'],'statusText':(_0x5a2543||{})['statusText'],'code':_0x12ccee['code'],'message':_0x12ccee['message'],'traceId':_0x12ccee['traceId']};})),'abortController':_0xc2cf68};}async*['_getStreamReader'](_0x40638e){const _0x1e8723=[],_0x15fd62=_0x40638e['getReader'](),_0x2318ec=$t({'onError':_0x47cdb5=>{this['_handleError'](_0x47cdb5);},'onEvent':_0x31eb3c=>{_0x31eb3c['data']=JSON['parse'](_0x31eb3c['data']),_0x1e8723['push'](_0x31eb3c);}});try{let _0x5aef47=!0x1;for(;!_0x5aef47;){const {done:_0x364dcf,value:_0x5591e3}=await _0x15fd62['read']();_0x364dcf&&(_0x5aef47=!0x0),_0x2318ec['feed'](this['_decoder']['decode'](_0x5591e3,{'stream':!0x0})),yield*_0x1e8723,_0x1e8723['length']=0x0;}}catch(_0x25b10b){this['_handleError'](_0x25b10b);}finally{_0x15fd62['releaseLock'](),_0x2318ec['reset']();}}['_handleError'](_0x5e83bc){if(_0x5e83bc instanceof _0x15f966)throw _0x5e83bc;if(_0x5e83bc instanceof Error&&'AbortError'===_0x5e83bc['name'])throw new _0x15f966('ai-request-aborted',this,{'originalError':_0x5e83bc});throw new _0x15f966('ai-request-failed',this,{'originalError':_0x5e83bc});}}function C(_0x49a143,_0x2d8c22,_0x19b3c1){const t=_0x49a143['t'];switch(_0x2d8c22){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'},_0x19b3c1);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});case'AI_SUGGESTION_CONTENT_PART_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_OUTDATED','string':'Change\x20is\x20outdated'});case'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED':return t({'id':'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED','string':'Change\x20is\x20already\x20applied'});case'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT':return t({'id':'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT','string':'Preview'});case'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION','string':'Insert\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_DELETE':return t({'id':'AI_SUGGESTION_CONTENT_PART_DELETE','string':'Reject'});case'AI_SUGGESTION_CONTENT_PART_REMOVED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REMOVED','string':'Removed\x20content.\x20Use\x20\x22Show\x20details\x22\x20to\x20learn\x20more.'});case'AI_DISCLAIMER_TEXT':return t({'id':'AI_DISCLAIMER_TEXT','string':'AI\x20can\x20make\x20mistakes.\x20Please\x20double-check\x20responses.'});case'AI_TABS_LABEL_MAXIMIZE':return t({'id':'AI_TABS_LABEL_MAXIMIZE','string':'Maximize'});case'AI_TABS_LABEL_MINIMIZE':return t({'id':'AI_TABS_LABEL_MINIMIZE','string':'Minimize'});case'AI_CHAT_HEADING':return t({'id':'AI_CHAT_HEADING','string':'Chat'});case'AI_CHAT_SOURCES_HEADER':return t({'id':'AI_CHAT_SOURCES_HEADER','string':'Sources'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi,\x20I\x27m\x20your\x20AI\x20assistant.\x20Think\x20of\x20me\x20as\x20your\x20writing\x20buddy,\x20reviewer,\x20or\x20research\x20partner.\x20I\x20can\x20suggest\x20changes\x20to\x20your\x20document,\x20help\x20generate\x20ideas,\x20offer\x20feedback,\x20discuss\x20attached\x20files,\x20and\x20much\x20more!'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'The\x20request\x20was\x20aborted.'});case'AI_CHAT_GENERIC_ERROR':return t({'id':'AI_CHAT_GENERIC_ERROR','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_START_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_START_CONVERSATION','string':'Unable\x20to\x20start\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_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.'},_0x19b3c1);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.'},_0x19b3c1);case'AI_CHAT_RESOURCE_LOAD_FAILED':return t({'id':'AI_CHAT_RESOURCE_LOAD_FAILED','string':'Failed\x20to\x20load\x20resource.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_CURRENT_DOCUMENT':return t({'id':'AI_CHAT_CONTEXT_CURRENT_DOCUMENT','string':'Current\x20document'});case'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT','string':'Remove\x20from\x20context'});case'AI_CHAT_CONTEXT_ADD_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_ADD_CONTEXT','string':'Add\x20context'});case'AI_CHAT_CONTEXT_URL_LABEL':return t({'id':'AI_CHAT_CONTEXT_URL_LABEL','string':'URL'});case'AI_CHAT_CONTEXT_FILE_LABEL':return t({'id':'AI_CHAT_CONTEXT_FILE_LABEL','string':'File'});case'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL':return t({'id':'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL','string':'Current\x20context'});case'AI_CHAT_SEARCH_WEB':return t({'id':'AI_CHAT_SEARCH_WEB','string':'Web\x20search'});case'AI_CHAT_ENABLE_WEB_SEARCH':return t({'id':'AI_CHAT_ENABLE_WEB_SEARCH','string':'Enable\x20web\x20search'});case'AI_CHAT_DISABLE_WEB_SEARCH':return t({'id':'AI_CHAT_DISABLE_WEB_SEARCH','string':'Disable\x20web\x20search'});case'AI_CHAT_REASONING':return t({'id':'AI_CHAT_REASONING','string':'Reasoning'});case'AI_CHAT_ENABLE_REASONING':return t({'id':'AI_CHAT_ENABLE_REASONING','string':'Enable\x20reasoning'});case'AI_CHAT_DISABLE_REASONING':return t({'id':'AI_CHAT_DISABLE_REASONING','string':'Disable\x20reasoning'});case'AI_CHAT_COMMANDS':return t({'id':'AI_CHAT_COMMANDS','string':'Commands'});case'AI_CHAT_SEARCH_RESOURCES':return t({'id':'AI_CHAT_SEARCH_RESOURCES','string':'Search\x20resources'});case'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT','string':'Back\x20to\x20context\x20options'});case'AI_CHAT_CONTEXT_URL_ADD_URL':return t({'id':'AI_CHAT_CONTEXT_URL_ADD_URL','string':'Add\x20URL'});case'AI_CHAT_CONTEXT_URL_PLACEHOLDER':return t({'id':'AI_CHAT_CONTEXT_URL_PLACEHOLDER','string':'Add\x20URL...'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL','string':'Failed\x20to\x20upload\x20URL:\x20%0.\x20Please\x20try\x20again.'},_0x19b3c1);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_SHOW_CHANGE_IN_TEXT':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT','string':'Preview','plural':'Preview'},_0x19b3c1);case'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP','string':'Show\x20change\x20in\x20the\x20document','plural':'Show\x20changes\x20in\x20the\x20document'},_0x19b3c1);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION','string':'Suggest','plural':'Suggest'},_0x19b3c1);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP','string':'Insert\x20change\x20as\x20suggestion','plural':'Insert\x20changes\x20as\x20suggestions'},_0x19b3c1);case'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL','string':'Apply','plural':'Apply\x20all'},_0x19b3c1);case'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP','string':'Apply\x20changes\x20immediately','plural':'Apply\x20all\x20changes\x20immediately'},_0x19b3c1);case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x19b3c1);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.'},_0x19b3c1);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.'},_0x19b3c1);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.'},_0x19b3c1);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.'},_0x19b3c1);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'},_0x19b3c1);case'AI_BALLOON_APPLY_BUTTON':return t({'id':'AI_BALLOON_APPLY_BUTTON','string':'Apply'});case'AI_BALLOON_SUGGEST_BUTTON':return t({'id':'AI_BALLOON_SUGGEST_BUTTON','string':'Suggest'});case'AI_BALLOON_NEXT_TOOLTIP':return t({'id':'AI_BALLOON_NEXT_TOOLTIP','string':'Next'});case'AI_BALLOON_PREVIOUS_TOOLTIP':return t({'id':'AI_BALLOON_PREVIOUS_TOOLTIP','string':'Previous'});case'AI_SUGGESTION_NO_PARTS_WARNING':return t({'id':'AI_SUGGESTION_NO_PARTS_WARNING','string':'This\x20change\x20is\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20of\x20the\x20changes\x20are\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Retry'});case'AI_ACTIONS_PREVIOUS_INTERACTION':return t({'id':'AI_ACTIONS_PREVIOUS_INTERACTION','string':'Previous'});case'AI_ACTIONS_NEXT_INTERACTION':return t({'id':'AI_ACTIONS_NEXT_INTERACTION','string':'Next'});case'AI_MODEL_NAME_AUTO':return t({'id':'AI_MODEL_NAME_AUTO','string':'Auto'});case'AI_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.'},_0x19b3c1);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});case'AI_ACTIONS_GENERIC_ERROR':return t({'id':'AI_ACTIONS_GENERIC_ERROR','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20response.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_ACTIONS_SELECTION_REMOVED_ERROR':return t({'id':'AI_ACTIONS_SELECTION_REMOVED_ERROR','string':'Changes\x20cannot\x20be\x20applied.\x20The\x20original\x20content\x20no\x20longer\x20exists.'});case'AI_REVIEW_MODE_STOP_GENERATING':return t({'id':'AI_REVIEW_MODE_STOP_GENERATING','string':'Stop\x20generating'});case'AI_REVIEW_MODE_HIDE_CHANGES':return t({'id':'AI_REVIEW_MODE_HIDE_CHANGES','string':'Hide\x20changes'});case'AI_REVIEW_MODE_SHOW_CHANGES':return t({'id':'AI_REVIEW_MODE_SHOW_CHANGES','string':'Show\x20changes'});case'AI_REVIEW_MODE_ACCEPT_ALL':return t({'id':'AI_REVIEW_MODE_ACCEPT_ALL','string':'Accept\x20all'});case'AI_REVIEW_MODE_EXIT_REVIEW':return t({'id':'AI_REVIEW_MODE_EXIT_REVIEW','string':'Exit\x20review'});case'AI_REVIEW_MODE_ACCEPT_CHANGE':return t({'id':'AI_REVIEW_MODE_ACCEPT_CHANGE','string':'Accept'});case'AI_REVIEW_MODE_DISMISS_CHANGE':return t({'id':'AI_REVIEW_MODE_DISMISS_CHANGE','string':'Dismiss'});case'AI_REVIEW_MODE_LEARN_MORE':return t({'id':'AI_REVIEW_MODE_LEARN_MORE','string':'Learn\x20more'});case'AI_REVIEW_MODE_COMPLETED_TEXT':return t({'id':'AI_REVIEW_MODE_COMPLETED_TEXT','string':'There\x27s\x20nothing\x20left\x20to\x20review.'});case'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT':return t({'id':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20changes\x20to\x20suggest.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_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'});default:return _0x2d8c22;}}function ks(_0x325267,_0x3e30fc){const _0x4f909a=new _0x5ee277(_0x325267),_0x31db03=C(_0x325267,'AI_TABS_LABEL_MINIMIZE'),_0x594df5=C(_0x325267,'AI_TABS_LABEL_MAXIMIZE');return _0x4f909a['set']({'withText':!0x1,'icon':_0x3fb3ac,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary-text'}),_0x4f909a['bind']('label')['to'](_0x3e30fc,'isMaximized',_0x15ca5b=>_0x15ca5b?_0x31db03:_0x594df5),_0x4f909a['bind']('icon')['to'](_0x3e30fc,'isMaximized',_0x42cb88=>_0x42cb88?to:_0x3fb3ac),_0x4f909a['bind']('isOn')['to'](_0x3e30fc,'isMaximized'),_0x4f909a['on']('execute',()=>{_0x3e30fc['fire']('resizeTabs');}),_0x4f909a;}function Ue(_0x3bfde2){return _0xd8a65b(_0x3bfde2);}function Et(_0x49fc56){return _0x946802(_0x49fc56);}function St(_0x1188e3,_0x28406a,_0x43c0e7){const _0x3d26dd=null!==_0x28406a?_0x105f85=>_0x105f85['attribs'][_0x1188e3]===_0x28406a:_0x68fc88=>Boolean(_0x68fc88['attribs'][_0x1188e3]);return At(_0x3b72f8=>_0x383f31(_0x3b72f8)&&_0x3d26dd(_0x3b72f8),_0x43c0e7);}function Je(_0x3b0106,_0x6db5a8,_0xc20f6a){const _0x1fd44e=null!==_0x6db5a8?_0x12bdd0=>_0x12bdd0['attribs'][_0x3b0106]===_0x6db5a8:_0x2ad7a4=>Boolean(_0x2ad7a4['attribs'][_0x3b0106]);return _0x1fcd3c(_0x26f67d=>_0x383f31(_0x26f67d)&&_0x1fd44e(_0x26f67d),_0xc20f6a);}function yt(_0x1e90fe,_0x6a3166){return _0x1e90fe&&_0x383f31(_0x1e90fe)?_0x1e90fe['attribs'][_0x6a3166]:null;}function Ji(_0x2d06d6,_0x40f08e,_0x196070){_0x383f31(_0x2d06d6)&&(null===_0x196070?delete _0x2d06d6['attribs'][_0x40f08e]:_0x2d06d6['attribs'][_0x40f08e]=_0x196070);}function Xe(_0xebce3b,_0x2afae5,_0x5835f4){const _0x47930c=_0x2afae5['cloneNode'](!0x0);'beforebegin'===_0x5835f4?_0x6cef5(_0xebce3b,_0x47930c):'afterbegin'===_0x5835f4?_0x302586(_0xebce3b,_0x47930c):'beforeend'===_0x5835f4?_0x527fff(_0xebce3b,_0x47930c):'afterend'===_0x5835f4&&tr(_0xebce3b,_0x47930c);}function Ne(_0x5c83f1){const _0x6ef264=[];let _0x12b614=_0x5c83f1;for(;_0x12b614;)_0x12b614=_0x55fcbe(_0x12b614),_0x12b614&&_0x6ef264['push'](_0x12b614);return _0x6ef264;}function zn(_0x5d6a48){return _0x5d6a48['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Xi(_0x718167){let _0x534867=0x0;for(;_0x718167['parentNode'];)_0x718167=_0x718167['parentNode'],_0x534867++;return _0x534867;}function $i(_0xc6a4e9){const _0x59af50=[];let _0xa17127=_0xc6a4e9['nextSibling'];for(;_0xa17127;)_0x59af50['push'](_0xa17127),_0xa17127=_0xa17127['nextSibling'];_0x59af50['forEach'](_0x5cbe82=>{_0x546a65(_0x5cbe82);});}class qe extends/* #__PURE__ -- @preserve */
25
- ts(){['_m2html'];constructor(){super(),this['_m2html']=new _0x5f270e();}['convertMarkdownToHTML'](_0x1e1c35){const _0xeeeff8=this['_m2html']['parse'](_0x1e1c35);return this['parseAndNormalizeHTML'](_0xeeeff8);}['parseAndNormalizeHTML'](_0x4d569d){return this['_parseHTML'](_0x4d569d);}['_parseHTML'](_0x27db2b){const _0x41ce13=Ue('<dummy>'+_0x27db2b['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x41ce13['children']=_0x41ce13['children'][0x0]['children'],_0x41ce13;}}class ze extends/* #__PURE__ -- @preserve */
26
- ts(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x42472d){super(),this['_generateUid']=_0x42472d||_0x53b360;}['merge'](_0x3a8337,_0xdd632b,_0x328e22){const _0x5a06c9=_0x3a8337['cloneNode'](!0x0);if(0x0===_0xdd632b['childNodes']['length']){const _0x3ab980=[];return Je('data-id','new-element',_0x5a06c9)['forEach'](_0x236d7d=>{const _0x535794=this['_generateUid']();Ji(_0x236d7d,'data-id',_0x535794),_0x3ab980['push'](_0x535794);}),this['_removeSpecialComments'](_0x5a06c9),{'parsedContent':_0x5a06c9,'newNodeIds':_0x3ab980,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x328e22&&_0x328e22['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x5a06c9),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Je('data-id',null,_0xdd632b)['map'](_0x192f56=>yt(_0x192f56,'data-id'))['filter'](_0x189773=>!!_0x189773));let _0x1bc72c=-0x1,_0x1b39fd=!0x1;const _0x141022=_0x5a06c9['childNodes'],_0x5205c8=Array['from'](_0x141022)['filter'](_0x476426=>!(0x3===_0x476426['nodeType']&&''===Et(_0x476426)['trim']())),_0x2cfc8d=_0x5205c8['length'];for(let _0x57a86a=0x0;_0x57a86a<_0x2cfc8d;_0x57a86a++){const _0x2a3c64=_0x5205c8[_0x57a86a],_0x47d43e=_0x5205c8[_0x57a86a+0x1];if(this['_isNewNode'](_0x2a3c64)){if(-0x1===_0x1bc72c&&(_0x1bc72c=_0x57a86a),this['_markWrappedElements'](_0x2a3c64),!this['_isNewNode'](_0x47d43e)){const [_0x1008da,_0x4bc39a]=this['_findReferenceNode'](_0x2a3c64,_0x1b39fd,_0xdd632b);if(_0x1008da){const _0x2bf39e=Array['from'](_0x5205c8)['slice'](_0x1bc72c,_0x57a86a+0x1);this['_insertNodes'](_0x1008da,_0x2bf39e,_0x4bc39a),_0x1bc72c=-0x1;}}}else{if(this['_isExistingContentComment'](_0x2a3c64))_0x1b39fd=!0x0;else{if(this['_isExistingNode'](_0x2a3c64)){const _0x1bf703=yt(_0x2a3c64,'data-id');if(_0x1bf703&&this['_existingDataIds']['has'](_0x1bf703)){const _0x4997d4=St('data-id',_0x1bf703,_0xdd632b);this['_replaceNode'](_0x4997d4,_0x2a3c64);}if(this['_touchedNodesState']['removedIds']['includes'](_0x1bf703)){const _0x50a76f=this['_touchedNodesState']['removedIds']['indexOf'](_0x1bf703);this['_touchedNodesState']['removedIds']['splice'](_0x50a76f,0x1);}}else{if(this['_isDelNode'](_0x2a3c64)){const _0x5b18db=yt(_0x2a3c64,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x5b18db)||this['_storeDeletedElementIds'](_0x2a3c64);}}}}}for(const _0x81c0d of this['_touchedNodesState']['removedIds']){const _0x462f89=St('data-id',_0x81c0d,_0xdd632b);if(_0x462f89){if(_0x328e22&&_0x328e22['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x81c0d;const _0x2b4d59=_0x328e22['replaceRemovedWith']['cloneNode'](!0x0);Ji(_0x2b4d59,'data-id',_0x81c0d),Ji(_0x2b4d59,'data-removed','true'),_0xdfba39(_0x462f89,_0x2b4d59);}else _0x546a65(_0x462f89);}}if(Je('data-wrapped-id',null,_0xdd632b)['forEach'](_0x5b02f7=>{const _0x42c062=St('data-id',yt(_0x5b02f7,'data-wrapped-id'),_0xdd632b);var _0x301ac,_0x4a1834;_0x42c062&&(_0x4a1834=_0x5b02f7,_0x546a65(_0x301ac=_0x42c062),_0xdfba39(_0x4a1834,_0x301ac));}),Je('data-id','new-element',_0xdd632b)['forEach'](_0x22dfc1=>{const _0x3d8e90=this['_getUid'](_0x22dfc1);Ji(_0x22dfc1,'data-id',_0x3d8e90),this['_touchedNodesState']['newIds']['push'](_0x3d8e90);}),this['_removeSpecialComments'](_0xdd632b),_0x328e22&&_0x328e22['markUnstableElements']&&this['_markUnstableElements'](_0xdd632b,_0x328e22['markUnstableElementsDepth']||0x0),_0x328e22&&_0x328e22['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x433bab=St('data-id',this['_touchedNodesState']['lastTouchedId'],_0xdd632b);for(;_0x433bab;)$i(_0x433bab),_0x433bab=_0x433bab['parentNode'];}return{'parsedContent':_0xdd632b,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x31e88e,_0x5cf422,_0x54608d){for(const _0x4a703e of _0x5cf422){const _0x5b19bd=this['_getUid'](_0x4a703e);Ji(_0x4a703e,'data-id',_0x5b19bd),this['_touchedNodesState']['newIds']['push'](_0x5b19bd),this['_touchedNodesState']['lastTouchedId']=_0x5b19bd;}const _0x5e10f7='afterbegin'===_0x54608d||'afterend'===_0x54608d?_0x5cf422['reverse']():_0x5cf422;for(const _0x480ba0 of _0x5e10f7)Xe(_0x31e88e,_0x480ba0,_0x54608d);}['_replaceNode'](_0x569428,_0x6c858){if(!_0x569428)return;if(_0x4fbe07=_0x6c858,zn(Et(_0x569428))===zn(Et(_0x4fbe07)))return;var _0x4fbe07;const _0x5ca046=this['_getUid'](_0x569428);Ji(_0x6c858,'data-id',_0x5ca046),this['_touchedNodesState']['modifiedIds']['push'](_0x5ca046),this['_touchedNodesState']['lastTouchedId']=_0x5ca046,_0xdfba39(_0x569428,_0x6c858['cloneNode'](!0x0));}['_findReferenceNode'](_0xd7522a,_0x3b6058,_0x176602){const _0x5bc0d0=this['_findPrevElementWithDataId'](_0xd7522a,!0x1);if(_0x5bc0d0){const _0x35d32f=this['_getNodeDataId'](_0x5bc0d0),_0x512842=St('data-id',_0x35d32f,_0x176602);if(_0x512842)return[_0x512842,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x35d32f);}const _0x3e67fe=this['_findNextElementWithDataId'](_0xd7522a,!0x1);if(_0x3e67fe){const _0x3103a2=this['_getNodeDataId'](_0x3e67fe),_0x1f32da=St('data-id',_0x3103a2,_0x176602);if(_0x1f32da)return[_0x1f32da,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x3103a2);}return _0x3b6058?_0xd7522a['nextSibling']?this['_findFallbackReferenceNode'](_0xd7522a,_0x176602):[_0x176602['childNodes'][_0x176602['childNodes']['length']-0x1],'afterend']:[_0x176602['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x407f97,_0x3f2c05){const _0x5a312c=[],_0x8b199a=this['_findPrevElementWithDataId'](_0x407f97,!0x0);if(_0x8b199a){const _0x44ad57=St('data-id',this['_getNodeDataId'](_0x8b199a),_0x3f2c05);_0x44ad57&&_0x5a312c['push']([_0x44ad57,'afterend']);}const _0x5b8f75=this['_findNextElementWithDataId'](_0x407f97,!0x0);if(_0x5b8f75){const _0x263819=St('data-id',this['_getNodeDataId'](_0x5b8f75),_0x3f2c05);_0x263819&&_0x5a312c['push']([_0x263819,'beforebegin']);}if(_0x5a312c['length']>0x1)return Xi(_0x5a312c[0x0][0x0])<=Xi(_0x5a312c[0x1][0x0])?_0x5a312c[0x0]:_0x5a312c[0x1];return 0x1===_0x5a312c['length']?_0x5a312c[0x0]:[_0x3f2c05['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x673a7e,_0x55003e){let _0x1e744a=_0x673a7e['nextSibling'],_0x21ab63=null,_0x5bd98d=!0x1;for(;_0x1e744a;){if(_0x2e8456(_0x1e744a)){if(this['_isDelNode'](_0x1e744a)&&(_0x21ab63=_0x1e744a),this['_isExistingContentComment'](_0x1e744a)&&_0x55003e&&!_0x5bd98d){_0x5bd98d=!0x0,_0x1e744a=_0x1e744a['nextSibling'];continue;}break;}const _0xc63c64=yt(_0x1e744a,'data-id');if(_0xc63c64&&'new-element'!==_0xc63c64&&this['_existingDataIds']['has'](_0xc63c64)){_0x21ab63=_0x1e744a;break;}_0x1e744a=_0x1e744a['nextSibling'];}return _0x21ab63;}['_findPrevElementWithDataId'](_0x11b2ad,_0x1bcd15){let _0x33c625=_0x11b2ad['previousSibling'],_0x33900f=null,_0x48501d=!0x1;for(;_0x33c625;){if(_0x2e8456(_0x33c625)){if(this['_isDelNode'](_0x33c625)&&(_0x33900f=_0x33c625),this['_isExistingContentComment'](_0x33c625)&&_0x1bcd15&&!_0x48501d){_0x48501d=!0x0,_0x33c625=_0x33c625['previousSibling'];continue;}break;}const _0x3b97a1=yt(_0x33c625,'data-id');if(_0x3b97a1&&'new-element'!==_0x3b97a1&&this['_existingDataIds']['has'](_0x3b97a1)){_0x33900f=_0x33c625;break;}_0x33c625=_0x33c625['previousSibling'];}return _0x33900f;}['_markWrappedElements'](_0x312cae){_0x383f31(_0x312cae)&&Je('data-id',null,_0x312cae)['forEach'](_0x302363=>{this['_isExistingNode'](_0x302363)&&!this['_hasWrappedParent'](_0x302363)&&(Ji(_0x302363,'data-wrapped-id',yt(_0x302363,'data-id')),Ji(_0x302363,'data-id',null));});}['_getNodeDataId'](_0x1acf38){if(!_0x1acf38)return null;if(_0x383f31(_0x1acf38))return yt(_0x1acf38,'data-id');if(_0x2e8456(_0x1acf38)){const _0x447abd=Et(_0x1acf38)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x447abd&&_0x447abd[0x1])return _0x447abd[0x1];}return null;}['_storeDeletedElementIds'](_0x659f50){if(_0x2e8456(_0x659f50)){const _0xf91ef7=Et(_0x659f50)['match'](/removed[\s*-]data-id="([^"]+)"/);_0xf91ef7&&_0xf91ef7[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0xf91ef7[0x1]);}}['_getUid'](_0x59da42){return this['_isExistingNode'](_0x59da42)?yt(_0x59da42,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x1b0126){(function(_0x51bcca){return _0x4224fc(_0x3bd596=>_0x2e8456(_0x3bd596),_0x51bcca,!0x0,0x1/0x0);}(_0x1b0126)['filter'](_0x39ef29=>this['_isDelNode'](_0x39ef29)||this['_isExistingContentComment'](_0x39ef29))['forEach'](_0x3100b4=>{_0x546a65(_0x3100b4);}));}['_markLastTagElementUnstable'](_0x5e92f5){const _0x299748=_0x5e92f5['childNodes'],_0x327f5d=_0x299748[_0x299748['length']-0x1];_0x327f5d&&_0x383f31(_0x327f5d)&&Ji(_0x327f5d,'data-unstable','true');}['_markUnstableElements'](_0x15cdc0,_0x176c02){const _0x137a7b=St('data-unstable','true',_0x15cdc0);if(!_0x137a7b)return;const _0x5135f9=Ne(_0x137a7b)['slice'](0x0,-0x1),_0x3e47e6=_0x5135f9['length'];let _0x271159=_0x137a7b;if(_0x3e47e6>_0x176c02){let _0x591d37=_0x3e47e6,_0x5b25d=null;for(;_0x591d37>_0x176c02&&_0x591d37>=0x0;)_0x591d37--,_0x5b25d=_0x5135f9[_0x591d37];_0x5b25d&&(_0x271159=_0x5b25d,Ji(_0x137a7b,'data-unstable',null),Ji(_0x5b25d,'data-unstable','true'));}else{if(_0x3e47e6<_0x176c02){let _0x1cbfdd=_0x3e47e6,_0x1527e2=_0x137a7b;for(;_0x1cbfdd<_0x176c02;){const _0x5e857b=_0x1527e2['childNodes']['filter'](_0x2386e3=>_0x383f31(_0x2386e3));if(0x0===_0x5e857b['length'])break;_0x1cbfdd++,_0x1527e2=_0x5e857b[_0x5e857b['length']-0x1];}_0x1527e2&&(_0x271159=_0x1527e2,Ji(_0x137a7b,'data-unstable',null),Ji(_0x1527e2,'data-unstable','true'));}}let _0x4cfcb8=_0x271159;for(;_0x4cfcb8;){for(;_0x4cfcb8['nextSibling'];)_0x4cfcb8=_0x4cfcb8['nextSibling'],_0x383f31(_0x4cfcb8)&&Ji(_0x4cfcb8,'data-unstable','true');_0x4cfcb8=_0x4cfcb8['parentNode'];}}['_isNewNode'](_0x1dcd0e){return Boolean('new-element'===yt(_0x1dcd0e,'data-id'));}['_isExistingNode'](_0x4df865){return Boolean((yt(_0x4df865,'data-id')||'')['length']>0x0&&'new-element'!==yt(_0x4df865,'data-id'));}['_isDelNode'](_0x2cc4b6){return!!_0x2cc4b6&&Boolean(_0x2e8456(_0x2cc4b6)&&Et(_0x2cc4b6)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x33082a){let _0x6c2438=_0x33082a['parentNode'];for(;_0x6c2438;){if(yt(_0x6c2438,'data-wrapped-id'))return!0x0;_0x6c2438=_0x6c2438['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x40db9d){return Boolean(_0x2e8456(_0x40db9d)&&Et(_0x40db9d)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function I({editor:_0x1d668e,changeGroups:_0x215b4e,documentContextContent:_0x4bd33f,showDiff:_0x78b169,trimUnchanged:_0x247e1d=!0x0}){return _0x215b4e['map'](_0x335ae7=>{const _0x44f1c0=new wt([]),_0x2c6fa8=new wt([]);for(const _0x3165bb of _0x335ae7['changes'])if(_0x78b169&&'removed'==_0x3165bb['type']||_0x2c6fa8['children']['push'](_0x3165bb['node']['cloneNode'](!0x0)),'new'!=_0x3165bb['type']&&(_0x78b169||'removed'!=_0x3165bb['type'])){const _0x43658d=At(_0x4b888f=>yt(_0x4b888f,'data-id')==_0x3165bb['id'],_0x4bd33f,!0x0);_0x43658d&&_0x44f1c0['children']['push'](_0x43658d['cloneNode'](!0x0));}const {content:_0x589a2e,hasChanges:_0x3125bb}=function(_0x4844ee,_0x36f273,_0x19e3bb,_0x281b38,_0x3ba978=!0x0){const _0x32e364=_0x4844ee['plugins']['get']('DocumentCompare'),_0x5377cb=Et(_0x36f273),_0xe9f3b=Et(_0x19e3bb),_0x31a17f=_0x4844ee['data']['parse'](_0x5377cb,'$root'),_0x4e40c7=_0x4844ee['model']['createPositionAt'](_0x31a17f,0x0),_0x363f42=_0x32e364['getDiff'](_0x5377cb,_0xe9f3b,{'anchor':_0x4e40c7,'markDeletions':_0x281b38,'context':'$root'}),_0x4ad715=_0x363f42['getOperations']();if(0x0==_0x4ad715['length'])return{'content':_0x36f273['cloneNode'](!0x0),'hasChanges':!0x1};_0x281b38?function(_0x23360c,_0x2fa714,_0x512d30){if(0x0==_0x23360c['length'])return;const _0x45c31c=_0x512d30['plugins']['get']('DocumentCompare'),_0x33583=_0x512d30['plugins']['get']('SuggestionsConversion');_0x512d30['model']['change'](_0x26c17d=>{const _0x39404b=new Set();for(let _0x46d98e=0x0;_0x46d98e<_0x23360c['length'];_0x46d98e++){const _0x2f0937=_0x23360c[_0x46d98e];if(_0x2f0937['baseVersion']=null,_0x2f0937['isDocumentOperation']=!0x1,_0x45c31c['isMarkedRemoveOperation'](_0x2f0937)){const _0x249c62=_0x28fabe(_0x2f0937['newRange'],_0x512d30['model']),_0x3f9da7='suggestion:deletion:'+_0x53b360()+':$aiSuggestion';_0x2fa714['markers']['set'](_0x3f9da7,_0x249c62);}else switch(_0x2f0937['type']){case'rename':{if(_0x2f0937['oldName']==_0x2f0937['newName'])break;_0x26c17d['batch']['addOperation'](_0x2f0937),_0x512d30['model']['applyOperation'](_0x2f0937);const _0x28a8f6='$elementName',_0x500f76=_0x2f0937['position'],_0x5181c0=_0x512d30['model']['createRange'](_0x500f76,_0x512d30['model']['createPositionAt'](_0x500f76['nodeAfter'],'end')),_0x4d27fb='suggestion:attribute:'+_0x28a8f6+':'+_0x53b360()+':$aiSuggestion';_0x2fa714['markers']['set'](_0x4d27fb,_0x5181c0);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x2f0937['oldValue']==_0x2f0937['newValue'])break;_0x26c17d['batch']['addOperation'](_0x2f0937),_0x512d30['model']['applyOperation'](_0x2f0937);const _0x21194a=_0x2f0937['key'];if(!_0x33583['isRegisteredAttribute'](_0x21194a))break;const _0x4093de=_0x28fabe(_0x2f0937['range'],_0x512d30['model']),_0x199948='suggestion:attribute:'+_0x21194a+':'+_0x53b360()+':$aiSuggestion';_0x2fa714['markers']['set'](_0x199948,_0x4093de);break;}case'insert':{_0x26c17d['batch']['addOperation'](_0x2f0937),_0x512d30['model']['applyOperation'](_0x2f0937);if(_0x23360c[_0x46d98e+0x1]&&'move'==_0x23360c[_0x46d98e+0x1]['type']){ro(_0x2fa714,_0x2f0937);break;}const _0x1c222b=_0x2f0937['position'],_0x2bb2b3=_0x2f0937['howMany'],_0x292fa0=_0x28fabe(_0x512d30['model']['createRange'](_0x1c222b,_0x1c222b['getShiftedBy'](_0x2bb2b3)),_0x512d30['model']),_0x1d3198='suggestion:insertion:'+_0x53b360()+':$aiSuggestion';_0x2fa714['markers']['set'](_0x1d3198,_0x292fa0);break;}case'split':{_0x26c17d['batch']['addOperation'](_0x2f0937),_0x512d30['model']['applyOperation'](_0x2f0937);const _0x24cf27=_0x2f0937['splitPosition'],_0x3c326d=_0x2f0937['moveTargetPosition'],_0x188105=_0x512d30['model']['createRange'](_0x24cf27,_0x3c326d),_0x4583d1='suggestion:insertion:'+_0x53b360()+':$aiSuggestion';_0x2fa714['markers']['set'](_0x4583d1,_0x188105);break;}case'move':{_0x26c17d['batch']['addOperation'](_0x2f0937),_0x512d30['model']['applyOperation'](_0x2f0937),_0x23360c[_0x46d98e-0x1]&&'insert'==_0x23360c[_0x46d98e-0x1]['type']&&ro(_0x2fa714,_0x2f0937);const _0x3b5ea9=_0x2f0937['getMovedRangeStart'](),_0x24ac4f=_0x2f0937['howMany'];for(let _0x1f4f06=0x0;_0x1f4f06<_0x24ac4f;_0x1f4f06++){const _0x6e61ad=_0x3b5ea9['getShiftedBy'](_0x1f4f06)['nodeAfter'];_0x39404b['add'](_0x6e61ad);}break;}case'remove':{const _0x21646d=_0x2f0937['sourcePosition'],_0xdf8f7e=_0x2f0937['howMany'],_0x5411c2=new _0x19ceb4(_0x21646d,_0xdf8f7e);_0x26c17d['batch']['addOperation'](_0x5411c2),_0x512d30['model']['applyOperation'](_0x5411c2);break;}}}for(const _0x151ced of _0x39404b){const _0x216df9=_0x512d30['model']['createRangeOn'](_0x151ced),_0xe63aae='suggestion:formatBlock:$fakeWrap:'+_0x53b360()+':$aiSuggestion';_0x2fa714['markers']['set'](_0xe63aae,_0x28fabe(_0x216df9,_0x512d30['model']));}});}(_0x4ad715,_0x31a17f,_0x4844ee):_0x4844ee['model']['change'](_0x56be3b=>{for(const _0x3b5232 of _0x4ad715)if('remove'==_0x3b5232['type']){const _0x563f50=_0x3b5232['sourcePosition'],_0x48119e=_0x3b5232['howMany'],_0x1ed8f9=new _0x19ceb4(_0x563f50,_0x48119e);_0x56be3b['batch']['addOperation'](_0x1ed8f9),_0x4844ee['model']['applyOperation'](_0x1ed8f9);}else{if('marker'==_0x3b5232['type']){const _0x21ce2f=_0x3b5232['name'],_0x1bfc78=_0x3b5232['newRange'];_0x31a17f['markers']['set'](_0x21ce2f,_0x1bfc78);}else _0x3b5232['baseVersion']=null,_0x3b5232['isDocumentOperation']=!0x1,_0x56be3b['batch']['addOperation'](_0x3b5232),_0x4844ee['model']['applyOperation'](_0x3b5232);}});if(_0x3ba978){const _0x3c6100=It(_0x4844ee,_0x4ad715,_0x31a17f);Tt(_0x4844ee['model'],_0x3c6100),function(_0xc05f75,_0x90c2c5){const _0x190b63=_0x90c2c5['getFirstRange']()['start'];let _0x469f4a=_0x90c2c5['getFirstRange']()['end'];const _0x3f7017=_0x190b63['root'];(_0x469f4a['textNode']||_0x469f4a['nodeAfter']&&_0x469f4a['nodeAfter']['is']('$text'))&&(_0x40b4bd(_0x469f4a,'...'),_0x469f4a=_0x469f4a['getShiftedBy'](0x3)),(_0x190b63['textNode']||_0x190b63['nodeBefore']&&_0x190b63['nodeBefore']['is']('$text'))&&(_0x40b4bd(_0x190b63,'...'),function(_0x529702,_0x2d2da9,_0xcf7c62){for(let [_0x3e2200,_0x4f0aad]of _0x529702['markers']){const _0x3476a3=_0x4f0aad['_getTransformedByInsertion'](_0x2d2da9,_0xcf7c62,!0x1);_0x4f0aad=_0x3476a3[0x0],_0x529702['markers']['set'](_0x3e2200,_0x4f0aad);}}(_0x3f7017,_0x190b63,0x3),_0x190b63['parent']==_0x469f4a['parent']&&(_0x469f4a=_0x469f4a['getShiftedBy'](0x3)));const _0x82e828=_0xc05f75['createRange'](_0xc05f75['createPositionAt'](_0x3f7017,0x0),_0x190b63),_0x27b971=_0xc05f75['createRange'](_0x469f4a,_0xc05f75['createPositionAt'](_0x3f7017,'end')),_0x471756=[..._0x82e828['getMinimalFlatRanges'](),..._0x27b971['getMinimalFlatRanges']()];_0x471756['reverse']();for(const _0x383fc6 of _0x471756)_0x4af85f(_0x383fc6),Jn(_0x3f7017,_0x383fc6);}(_0x4844ee['model'],_0x3c6100);}const _0x18c95c=_0x4844ee['data']['stringify'](_0x31a17f,{'showSuggestionHighlights':!0x0});return{'content':Ue(_0x18c95c),'hasChanges':!0x0};}(_0x1d668e,_0x44f1c0,_0x2c6fa8,_0x78b169,_0x247e1d);return{'type':_0x335ae7['changes'][0x0]['type'],'index':_0x335ae7['index'],'content':_0x589a2e,'hasChanges':_0x3125bb};});}function ro(_0x4db5e0,_0x311b79){for(const [_0x538001,_0x1bc142]of _0x4db5e0['markers']){const _0x2b2fdd=_0x4a8fb1['_createFromRanges'](_0x1bc142['getTransformedByOperation'](_0x311b79));_0x4db5e0['markers']['set'](_0x538001,_0x2b2fdd);}}function It(_0x7f43d8,_0x39f546,_0x26ef2d){const _0x5bd11b=_0x7f43d8['plugins']['get']('DocumentCompare');let _0x2dca95=_0x7f43d8['model']['createPositionAt'](_0x26ef2d,Number['POSITIVE_INFINITY']),_0x49f85f=_0x7f43d8['model']['createPositionAt'](_0x26ef2d,0x0);for(const _0xf0e93e of _0x39f546){let _0x2ac2e1,_0x1d30e7;if(_0x5bd11b['isMarkedRemoveOperation'](_0xf0e93e))_0x2ac2e1=_0xf0e93e['newRange']['start'],_0x1d30e7=_0xf0e93e['newRange']['end'];else switch(_0x2dca95=_0x2dca95['getTransformedByOperation'](_0xf0e93e),_0x49f85f=_0x49f85f['getTransformedByOperation'](_0xf0e93e),_0xf0e93e['type']){case'rename':_0x2ac2e1=_0xf0e93e['position'],_0x1d30e7=_0x2ac2e1['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x2ac2e1=_0xf0e93e['range']['start'],_0x1d30e7=_0xf0e93e['range']['end'];break;case'insert':_0x2ac2e1=_0xf0e93e['position'],_0x1d30e7=_0x2ac2e1['getShiftedBy'](_0xf0e93e['howMany']);break;case'split':_0x2ac2e1=_0xf0e93e['splitPosition'],_0x1d30e7=_0xf0e93e['moveTargetPosition'];break;case'merge':{const _0x169dff=_0xf0e93e['targetPosition']['path']['slice'](0x0,-0x1);_0x2ac2e1=_0x7f43d8['model']['createPositionFromPath'](_0x26ef2d,_0x169dff),_0x1d30e7=_0x2ac2e1['getShiftedBy'](0x1);break;}case'remove':{const _0x88b49e=_0xf0e93e['howMany'],_0x572b83=_0xf0e93e['sourcePosition']['_getTransformedByInsertion'](_0xf0e93e['targetPosition'],_0x88b49e),_0x3406e7=_0xf0e93e['getMovedRangeStart']();'remove'==_0xf0e93e['type']?(_0x2ac2e1=_0x572b83,_0x1d30e7=_0x572b83):(_0x2ac2e1=_0x3406e7,_0x1d30e7=_0x3406e7['getShiftedBy'](_0x88b49e));break;}}_0x2ac2e1&&_0x2ac2e1['isBefore'](_0x2dca95)&&(_0x2dca95=_0x2ac2e1['clone'](),_0x2dca95['stickiness']='toNone'),_0x1d30e7&&_0x1d30e7['isAfter'](_0x49f85f)&&(_0x49f85f=_0x1d30e7['clone'](),_0x49f85f['stickiness']='toNone');}return _0x7f43d8['model']['createSelection'](_0x7f43d8['model']['createRange'](_0x2dca95,_0x49f85f));}function Tt(_0xdc6c7,_0x313d03){so(_0xdc6c7,_0x313d03,'forward');const _0x306b97=_0x313d03['getFirstRange']();_0x313d03['setTo']([]),_0x313d03['setTo'](_0x306b97,{'backward':!0x0}),so(_0xdc6c7,_0x313d03,'backward');}function so(_0x495c35,_0x265f2b,_0x40da68){let _0x4338b8=0x14;for(;_0x4338b8;){_0x495c35['modifySelection'](_0x265f2b,{'unit':'word','direction':_0x40da68}),_0x4338b8--;const _0x32825d=_0x265f2b['focus']['forward'==_0x40da68?'nodeBefore':'nodeAfter'];if(_0x32825d&&_0x32825d['is']('element')&&_0x495c35['schema']['isBlock'](_0x32825d)&&_0x495c35['schema']['isObject'](_0x32825d))break;}}function Jn(_0x48244a,_0x1369b2){for(const [_0x1fa1e4,_0x2f7665]of _0x48244a['markers']){const _0x173614=_0x2f7665['_getTransformedByDeletion'](_0x1369b2['start'],_0x1369b2['end']['offset']-_0x1369b2['start']['offset']);null!=_0x173614?_0x48244a['markers']['set'](_0x1fa1e4,_0x173614):_0x48244a['markers']['delete'](_0x1fa1e4);}}const Zn=['modification-delta','text-delta','web-search','reasoning'],Wr=['conversation-title'];class je extends ts(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new wt([]);['parsedMergedContent']=new wt([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x343997,content:_0x397340='',isDone:_0x23a7ee=!0x1,interactionId:_0x4114c8,areActionsDisabled:_0x485b79,documentContextContent:_0x4f0370,editor:_0xaa997,id:_0x3f8764}){super(),this['id']=_0x3f8764||_0x53b360(),this['interactionId']=_0x4114c8,this['type']=_0x343997,this['areActionsDisabled']=!!_0x485b79,this['editor']=_0xaa997,this['aiResponseParser']=new qe(),this['aiResponseApplier']=new ze(),this['documentContextContent']=Ue(_0x4f0370||''),this['set']('isDone',_0x23a7ee),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x397340);}['appendContent'](_0x440947){this['set']('content',this['content']+_0x440947);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x49ef26,_0x3a26e5){this['changeGroups'][_0x49ef26]['state']=_0x3a26e5,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x49ef26,'state':_0x3a26e5});}['getContentParts']({showDiff:_0x21dba8,groupIndex:_0x30097e}){if(!this['editor'])throw new _0x15f966('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x13a10a=this['_getCachedContentParts'](_0x21dba8,_0x30097e);if(_0x13a10a)return _0x13a10a;let _0x8c3f4b=[];if(void 0x0===_0x30097e)_0x8c3f4b=this['changeGroups'];else{const _0x4051d7=this['changeGroups']['find'](({index:_0x2184f6})=>_0x2184f6===_0x30097e);if(!_0x4051d7)throw new _0x15f966('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x30097e});_0x8c3f4b=[_0x4051d7];}const _0xd2214b=I({'editor':this['editor'],'showDiff':_0x21dba8,'changeGroups':_0x8c3f4b,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x21dba8,_0xd2214b),_0xd2214b;}['_getCachedContentParts'](_0x472918,_0x2052bf){const _0x20ced3=_0x472918?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x20ced3]['length'])return null;const _0xb70dfe=this['cachedSuggestionContentParts'][_0x20ced3];if(void 0x0===_0x2052bf)return _0x326380(_0xb70dfe);{const _0x49ddb9=_0xb70dfe['find'](({index:_0x3c5ea1})=>_0x3c5ea1===_0x2052bf);if(_0x49ddb9)return[_0x326380(_0x49ddb9)];}return null;}['_setCachedContentParts'](_0x1bd20b,_0x5f31e4){const _0x4d0708=_0x1bd20b?'withDiff':'withoutDiff';_0x5f31e4['forEach'](_0x432100=>{const _0x13870e=this['cachedSuggestionContentParts'][_0x4d0708],_0x1d15df=_0x13870e['find'](({index:_0x45d83f})=>_0x45d83f===_0x432100['index']);if(_0x1d15df){const _0x24d54a=_0x13870e['indexOf'](_0x1d15df);_0x13870e['splice'](_0x24d54a,0x1,_0x432100);}else _0x13870e['push'](_0x432100);});}['onContentChange'](){if('modification-delta'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x31c2fd=this['changeGroups'];this['updateChangeGroups']();const _0x45d66b=this['_getDifferentChangeGroups'](_0x31c2fd,this['changeGroups']);(_0x45d66b['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x45d66b),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x26b033,_0x320026){const _0x581874=[];for(const _0x41f3c4 of _0x320026){const _0x2be81e=_0x26b033[_0x41f3c4['index']];_0x2be81e?_0x2be81e['changes']['length']!==_0x41f3c4['changes']['length']?_0x581874['push'](_0x41f3c4):_0x2be81e['changes']['forEach']((_0x5d69e1,_0x293713)=>{const _0x3d0a49=_0x41f3c4['changes'][_0x293713];_0x5d69e1['id']!==_0x3d0a49['id']&&_0x581874['push'](_0x41f3c4);}):_0x581874['push'](_0x41f3c4);}return _0x581874;}['updateChangeGroups'](){const _0x5d48d4=new _0x489563('p',{},[new _0x489563('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x2b59b9(C(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0xf13c8b=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x5d48d4,'cutAfterLastChange':!this['isDone']});if(!_0xf13c8b['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0xf13c8b['parsedContent'];let _0x375dd5=[];if(_0x1fcd3c(_0xbf9925=>{const _0x54ff84=yt(_0xbf9925,'data-id');if(!_0x54ff84||!_0x100cfc(_0x54ff84))return!0x1;const _0x179969=[_0xbf9925,...Ne(_0xbf9925)]['at'](-0x2);if(_0xbf9925!=_0x179969){const _0x2821bd=yt(_0x179969,'data-id');_0x100cfc(_0x2821bd)||(_0x375dd5['push']({'node':_0x179969,'id':_0x2821bd,'type':'modified'}),_0xf13c8b['modifiedNodeIds']['push'](_0x2821bd));}else _0xf13c8b['modifiedNodeIds']['includes'](_0x54ff84)?_0x375dd5['push']({'node':_0xbf9925,'type':'modified','id':_0x54ff84}):_0xf13c8b['newNodeIds']['includes'](_0x54ff84)?_0x375dd5['push']({'node':_0xbf9925,'type':'new','id':_0x54ff84,'anchorId':yt(_0xbf9925['previousSibling'],'data-id')}):_0x375dd5['push']({'node':_0xbf9925,'type':'removed','id':_0x54ff84});return!0x0;},this['parsedMergedContent']),_0x375dd5=_0x375dd5['filter'](({node:_0x1502a8})=>[...Ne(_0x1502a8),_0x1502a8]['every'](_0x5a5224=>!yt(_0x5a5224,'data-unstable'))),0x0==_0x375dd5['length'])return;const _0x58a97e=[[_0x375dd5[0x0]]];for(let _0x42f635=0x1;_0x42f635<_0x375dd5['length'];_0x42f635++){const _0x26a867=_0x58a97e[_0x58a97e['length']-0x1],_0x504140=_0x26a867[_0x26a867['length']-0x1];_0x375dd5[_0x42f635]['node']['previousSibling']==_0x504140['node']&&'modified'!=_0x375dd5[_0x42f635]['type']&&'modified'!=_0x504140['type']?_0x26a867['push'](_0x375dd5[_0x42f635]):_0x58a97e['push']([_0x375dd5[_0x42f635]]);}for(const _0x10a813 of _0x58a97e){const _0xcea839=_0x10a813[0x0],_0xffe01b=_0x10a813[_0x10a813['length']-0x1],_0x16ccbf=_0x12a013(_0xcea839['node']['previousSibling']);_0x16ccbf&&_0x10a813['unshift'](_0x16ccbf);const _0x520b5c=_0x12a013(_0xffe01b['node']['nextSibling']);_0x520b5c&&_0x10a813['push'](_0x520b5c);}function _0x100cfc(_0xc1c6e4){return _0xf13c8b['modifiedNodeIds']['includes'](_0xc1c6e4)||_0xf13c8b['newNodeIds']['includes'](_0xc1c6e4)||_0xf13c8b['removedNodeIds']['includes'](_0xc1c6e4);}function _0x12a013(_0x11d9b5){if(_0x11d9b5&&yt(_0x11d9b5,'data-id')&&!yt(_0x11d9b5,'data-unstable')){const _0x5a9e35=yt(_0x11d9b5,'data-id');if(!_0x100cfc(_0x5a9e35))return{'node':_0x11d9b5,'type':'context','id':_0x5a9e35};}return null;}this['changeGroups']=_0x58a97e['map']((_0x57fda3,_0x45dda8)=>({'changes':_0x57fda3,'state':'pending','index':_0x45dda8}));}}function qi(_0x5f000b){return Object['values'](Zn)['includes'](_0x5f000b);}function Ui(_0x1e5dd9){return Wr['includes'](_0x1e5dd9);}function Gi(_0x41b7aa){return'conversation-title'===_0x41b7aa;}function Wi(_0x5ab8f4){return'source'===_0x5ab8f4;}const ge=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','error'];class pe extends _0x554e67(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0xeeb265,editor:_0x1d0f7c}){super(),this['id']=_0x53b360(),this['connector']=_0xeeb265,this['isStopped']=!0x0,this['editor']=_0x1d0f7c;}async['start'](){let _0x2954af;const _0x3d551e=[];this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x51c5b0=await this['currentRequest']['getStream']();for await(const _0x49736c of _0x51c5b0){if(this['isStopped'])return;if('error'===_0x49736c['event'])return void this['fire']('error',{'error':new _0x15f966('ai-chat-interaction-error',this)});if('message-metadata'!==_0x49736c['event']){if('action-metadata'!==_0x49736c['event']){if(Gi(_0x49736c['event'])&&this['setConversationTitle'](_0x49736c['data']['conversationTitle'],!0x0),Wi(_0x49736c['event']))_0x3d551e['push'](_0x49736c['data']['source']);else{if(qi(_0x49736c['event'])){if(_0x49736c['event']!==_0x2954af){if(_0x2954af=_0x49736c['event'],'web-search'===_0x49736c['event']){this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));continue;}if('reasoning'===_0x49736c['event']){this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));continue;}this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this)),this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this)),this['currentReply']&&this['currentReply']['done'](),this['currentReply']=this['createReply']({'type':_0x49736c['event'],'interactionId':this['id'],'id':_0x49736c['data']?.['id']}),_0x3d551e['length']>0x0&&'modification-delta'===_0x49736c['event']&&(this['currentReply']['sources']=_0x3d551e['splice'](0x0));}_0x49736c['data']['textDelta']&&this['currentReply']['appendContent'](_0x49736c['data']['textDelta']);}else Ui(_0x49736c['event']);}}else this['actionCallId']=_0x49736c['data']['callId'];}else this['messageId']=_0x49736c['data']['messageId'];}}finally{this['isStopped']||(_0x3d551e['length']>0x0&&(this['currentReply']['sources']=_0x3d551e['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x756f3d){return this['replies']['find'](_0x2fe855=>_0x2fe855['id']===_0x756f3d);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x40f90a=>_0x40f90a['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x21f1d9){const _0x2d6ced=new je({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x21f1d9});return this['replies']['push'](_0x2d6ced),_0x2d6ced['delegate'](...ge)['to'](this),this['fire']('replyCreated',_0x2d6ced),_0x2d6ced;}['setConversationTitle'](_0x3885b4,_0x1ea584=!0x1){this['fire']('setConversationTitle',_0x3885b4,_0x1ea584);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var xe=function(_0x287b2e){return _0x287b2e['FILE']='file',_0x287b2e['DOCUMENT']='document',_0x287b2e['URL']='web-resource',_0x287b2e['TEXT']='text',_0x287b2e['SELECTION']='selection',_0x287b2e;}({}),Ie=function(_0x1899c6){return _0x1899c6['TEXT']='text',_0x1899c6['MARKDOWN']='markdown',_0x1899c6['HTML']='html',_0x1899c6;}({});const ve=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']]),Ii=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class vi extends ts(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x5e8450,config:_0x14a643,ownerId:_0x40ae7d}){super(),this['_connector']=_0x5e8450,this['_config']=_0x14a643,this['_ownerId']=_0x40ae7d;}['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'](_0x469282){const _0x6bcd18=await this['_createContextItemFromContent'](_0x469282);return this['_addToConversationContextItem'](_0x6bcd18),'current-document'===_0x6bcd18['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x6bcd18;}async['_createContextItemFromContent'](_0x2e07bd){if(_0x2e07bd['type']===xe['DOCUMENT']){const _0x2ee5d2=await this['_connector']['fetchDocument'](this['_ownerId'],_0x2e07bd['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x2e07bd['type'],'content':_0x2ee5d2['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x2ee5d2['attributes']?.['version'],'sessionId':_0x2ee5d2['attributes']?.['sessionId']};}return{'id':_0x2e07bd['id'],'uiId':_0x2e07bd['id'],'label':_0x2e07bd['attributes']?.['label']||_0x2e07bd['name']||_0x2e07bd['url']||_0x2e07bd['id'],'type':_0x2e07bd['type'],..._0x2e07bd?.['attributes']?.['resourceId']?{'resourceId':_0x2e07bd['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x468679){const _0x46b665=this['_pendingContextItems']['get'](_0x468679);_0x46b665?.['isReadOnly']||this['_removeContextItem'](_0x468679);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x4f64ff of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x4f64ff['uiId']);const _0xd3b1c0=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0xd3b1c0&&this['_addContextItem']({..._0xd3b1c0,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x3e96cf){for(const _0x324692 of _0x3e96cf['values']())this['_addToConversationContextItem'](_0x324692);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'](_0x2696ef){return Array['from'](_0x2696ef['values']())['map'](_0x37a9f9=>this['_mapContextItemToRequestData'](_0x37a9f9))['filter'](_0x3f251e=>null!==_0x3f251e);}async['addFilesToContext'](_0x26486a,_0x4d9958,_0x13dd7f=xe['FILE']){const _0x2d1849='files-'+_0x53b360();this['_startUploadOperation'](_0x2d1849);try{await Promise['all'](_0x26486a['map'](async _0x4ee49e=>{const _0xa43933='file-'+_0x53b360(),_0x544d5e=_0x438ca2(_0x4ee49e['name']);try{this['_addContextItem']({'type':_0x13dd7f,'label':_0x4d9958?.['label']||_0x544d5e,'uiId':_0xa43933,'resourceId':_0x4d9958?.['resourceId']},!0x0);const _0x54d221=this['_connector']['uploadFile'](this['_ownerId'],_0x4ee49e,_0x4d9958);this['_ongoingUploads']['set'](_0xa43933,_0x54d221['abortController']);const {id:_0x399282}=await _0x54d221['getId']();this['_ongoingUploads']['delete'](_0xa43933),this['_finishContextItemLoading']({'type':_0x13dd7f,'id':_0x399282,'label':_0x4d9958?.['label']||_0x544d5e,'uiId':_0xa43933,'resourceId':_0x4d9958?.['resourceId']},!0x1);}catch(_0xb33b3a){this['_ongoingUploads']['delete'](_0xa43933);if(!(_0xb33b3a instanceof _0x15f966&&_0xb33b3a['message']['startsWith']('ai-request-aborted'))){const _0x3e91bd=ve['get'](_0xb33b3a['code'])||'ai-chat-file-upload-failed',_0x283efb=new _0x15f966(_0x3e91bd,null,{'fileName':_0x544d5e,..._0xb33b3a});_0x283efb['stack']=_0xb33b3a['stack'],this['fire']('error',{'error':_0x283efb});}this['_removeContextItem'](_0xa43933);}}));}finally{this['_finishUploadOperation'](_0x2d1849);}}['addCurrentDocumentToContext'](_0x298dad){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0xf52ab8={'type':xe['DOCUMENT'],'uiId':'current-document','label':_0x298dad,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0xf52ab8);}async['updateCurrentDocument'](_0x4b4013,_0x310e1b,_0x407cea,_0x5521dd){const _0x19467c=this['_pendingContextItems']['get']('current-document');if(_0x19467c&&_0x4b4013){_0x19467c['selection']=_0x5521dd?_0x5521dd['map'](_0xf598e6=>({'start':_0xf598e6['start'],'end':_0xf598e6['end']})):[];try{if(_0x19467c['version']===_0x310e1b)return;const {id:_0x37786f}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x4b4013,{'version':_0x310e1b,'sessionId':_0x407cea})['getId']();_0x19467c['id']=_0x37786f,_0x19467c['content']=_0x4b4013,_0x19467c['version']=_0x310e1b,_0x19467c['sessionId']=_0x407cea;}catch(_0x750c99){const _0x3ef480=new _0x15f966('ai-chat-document-upload-failed',null);_0x3ef480['stack']=_0x750c99['stack'],this['fire']('error',{'error':_0x3ef480});}}}['addSelectionToContext'](_0x2b5133){this['_addContextItem']({'type':xe['SELECTION'],'label':_0x2b5133,'uiId':'selection','content':_0x2b5133});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x25e848,_0x2e0de3){const _0xe54972='url-'+_0x53b360();this['_startUploadOperation'](_0xe54972);const _0xc098c1='url-'+_0x53b360();try{this['_addContextItem']({'type':xe['URL'],'label':_0x2e0de3?.['label']||_0x25e848,'uiId':_0xc098c1,'resourceId':_0x2e0de3?.['resourceId']},!0x0);const _0x1aa5c1=this['_connector']['uploadUrl'](this['_ownerId'],_0x25e848,_0x2e0de3);this['_ongoingUploads']['set'](_0xc098c1,_0x1aa5c1['abortController']);const {id:_0x174263}=await _0x1aa5c1['getId']();this['_ongoingUploads']['delete'](_0xc098c1),this['_finishContextItemLoading']({'type':xe['URL'],'id':_0x174263,'label':_0x2e0de3?.['label']||_0x25e848,'uiId':_0xc098c1,'resourceId':_0x2e0de3?.['resourceId']},!0x1);}catch(_0x27f8c6){this['_ongoingUploads']['delete'](_0xc098c1),(_0x27f8c6['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x15f966('ai-chat-url-upload-failed',this,{'url':_0x25e848,'originalError':_0x27f8c6}),'url':_0x25e848}),this['_removeContextItem'](_0xc098c1));}finally{this['_finishUploadOperation'](_0xe54972);}}async['loadSourceResources'](_0x2851e7,_0x46ec1e,_0x3ee13a){const _0x348611=this['_addContextOptionsState']['sources']['find'](_0x5c157e=>_0x5c157e['id']===_0x2851e7);if(!_0x348611)return this['fire']('error',{'error':new _0x15f966('ai-chat-source-not-found',this,{'sourceId':_0x2851e7}),'sourceId':_0x2851e7}),[];try{const _0x409f3a=(await _0x348611['getResources'](_0x46ec1e))['map'](_0x162385=>{const _0x11500e=this['_isResourceInContext'](_0x162385['id']);return{..._0x162385,'isInContext':_0x11500e};});return _0x348611['resources']=_0x409f3a,this['fire']('sourceResourcesLoaded',{'sourceId':_0x2851e7,'source':_0x348611,'resources':_0x409f3a,'uid':_0x3ee13a}),_0x409f3a;}catch(_0x58fefd){return this['fire']('error',{'error':new _0x15f966('ai-chat-source-resources-load-failed',this,{'sourceId':_0x2851e7,'originalError':_0x58fefd}),'sourceId':_0x2851e7,'sourceLabel':_0x348611['label']}),[];}}async['addResourceToContext'](_0x5a1428,_0x489fac){if(this['_isResourceInContext'](_0x489fac['id']))return;let _0x3d6d70=_0x489fac['data'];if(!_0x3d6d70&&_0x5a1428['getData'])try{_0x3d6d70=await _0x5a1428['getData'](_0x489fac['id']);}catch(_0x51ce37){return void this['fire']('error',{'error':new _0x15f966('ai-chat-resource-load-failed',this,{'resourceId':_0x489fac['id'],'sourceId':_0x5a1428['id'],'originalError':_0x51ce37}),'resourceId':_0x489fac['id'],'sourceId':_0x5a1428['id']});}if(_0x3d6d70)switch(_0x489fac['type']){case xe['URL']:if('string'!=typeof _0x3d6d70)return void this['fire']('error',{'error':new _0x15f966('ai-chat-context-invalid-data',this,{'resourceId':_0x489fac['id'],'sourceId':_0x5a1428['id'],'expectedType':'string','actualType':typeof _0x3d6d70}),'resourceId':_0x489fac['id'],'sourceId':_0x5a1428['id']});await this['addUrlToContext'](_0x3d6d70,{'label':_0x489fac['label'],'resourceId':_0x489fac['id']});break;case xe['FILE']:if(!(_0x3d6d70 instanceof File))return void this['fire']('error',{'error':new _0x15f966('ai-chat-context-invalid-data',this,{'resourceId':_0x489fac['id'],'sourceId':_0x5a1428['id'],'expectedType':'File','actualType':typeof _0x3d6d70}),'resourceId':_0x489fac['id'],'sourceId':_0x5a1428['id']});await this['addFilesToContext']([_0x3d6d70],{'label':_0x489fac['label'],'resourceId':_0x489fac['id']});break;case xe['TEXT']:if('object'!=typeof _0x3d6d70||!('content'in _0x3d6d70)||!('type'in _0x3d6d70))return void this['fire']('error',{'error':new _0x15f966('ai-chat-context-invalid-data',this,{'resourceId':_0x489fac['id'],'sourceId':_0x5a1428['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x3d6d70}),'resourceId':_0x489fac['id'],'sourceId':_0x5a1428['id']});_0x3d6d70=vi['_convertTextResourceToFile'](_0x3d6d70,_0x489fac['label']),await this['addFilesToContext']([_0x3d6d70],{'label':_0x489fac['label'],'resourceId':_0x489fac['id']},xe['TEXT']);break;default:this['fire']('error',{'error':new _0x15f966('ai-chat-context-unsupported-type',this,{'resourceId':_0x489fac['id'],'sourceId':_0x5a1428['id'],'resourceType':_0x489fac['type']}),'resourceId':_0x489fac['id'],'sourceId':_0x5a1428['id']});}else this['fire']('error',{'error':new _0x15f966('ai-chat-resource-no-data',this,{'resourceId':_0x489fac['id'],'sourceId':_0x5a1428['id']}),'resourceId':_0x489fac['id'],'sourceId':_0x5a1428['id']});}static['_convertTextResourceToFile'](_0x36efe2,_0x30d19a){switch(_0x36efe2['type']){case Ie['MARKDOWN']:return new File([_0x36efe2['content']],_0x30d19a,{'type':'text/markdown'});case Ie['HTML']:return new File([_0x36efe2['content']],_0x30d19a,{'type':'text/html'});default:return new File([_0x36efe2['content']],_0x30d19a,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x5c223a){switch(_0x5c223a['type']){case xe['FILE']:return{'type':xe['FILE'],'id':_0x5c223a['id']};case xe['URL']:return{'type':xe['URL'],'id':_0x5c223a['id']};case xe['DOCUMENT']:return{'type':xe['DOCUMENT'],'id':_0x5c223a['id'],..._0x5c223a['selection']?.['length']&&{'selection':_0x5c223a['selection']}};case xe['TEXT']:return{'type':xe['FILE'],'id':_0x5c223a['id']};default:return null;}}['_addContextItem'](_0x3346fd,_0x2de3bb=!0x1){if(this['_pendingContextItems']['set'](_0x3346fd['uiId'],_0x3346fd),_0x3346fd['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x3346fd,'isLoading':_0x2de3bb}),'current-document'===_0x3346fd['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x3346fd['resourceId']){const _0x5d58cf=this['_findSourceIdsByResourceId'](_0x3346fd['resourceId']);_0x5d58cf&&_0x5d58cf['forEach'](_0x859e70=>{this['_updateResourceInContextState'](_0x859e70,_0x3346fd['resourceId'],!0x0);});}}['_removeContextItem'](_0x343e94){const _0x5c2bdb=this['_pendingContextItems']['get'](_0x343e94),_0x313d17=this['_ongoingUploads']['get'](_0x343e94);if(_0x313d17&&(_0x313d17['abort'](),this['_ongoingUploads']['delete'](_0x343e94)),_0x5c2bdb?.['resourceId']){const _0x1c300b=this['_findSourceIdsByResourceId'](_0x5c2bdb['resourceId']);_0x1c300b&&_0x1c300b['forEach'](_0x102413=>{this['_updateResourceInContextState'](_0x102413,_0x5c2bdb['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x343e94),this['fire']('contextItemRemoved',{'uiId':_0x343e94,'type':_0x5c2bdb?.['type']}),'current-document'===_0x343e94&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x306718,_0x290052){if(this['_pendingContextItems']['has'](_0x306718['uiId'])&&(this['_pendingContextItems']['set'](_0x306718['uiId'],_0x306718),this['fire']('contextItemLoadingEnded',{'contextItem':_0x306718,'isLoading':_0x290052}),_0x306718['resourceId'])){const _0xc0c227=this['_findSourceIdsByResourceId'](_0x306718['resourceId']);_0xc0c227&&_0xc0c227['forEach'](_0x5f0e1e=>{this['_updateResourceInContextState'](_0x5f0e1e,_0x306718['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x2c9d38){this['_conversationContextItems']['set'](_0x2c9d38['uiId'],_0x2c9d38);}['_setAddContextOptionsDefaultState'](){this['_addContextOptionsState']={'document':{'enabled':!0x1!==this['_config']?.['document']?.['enabled'],'isHidden':!0x1},'urls':{'enabled':!0x1!==this['_config']?.['urls']?.['enabled']},'files':{'enabled':!0x1!==this['_config']?.['files']?.['enabled']},'sources':this['_getCustomSourcesInitialState']()},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x70ac47=>({..._0x70ac47,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x560c48=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x560c48,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x5e1ebc){for(const _0x4a132b of this['_pendingContextItems']['values']())if(_0x4a132b['resourceId']===_0x5e1ebc)return!0x0;for(const _0x4305b2 of this['_conversationContextItems']['values']())if(_0x4305b2['resourceId']===_0x5e1ebc)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x3fda5d){const _0x4c4851=[];for(const _0x30a501 of this['_addContextOptionsState']['sources']){_0x30a501['resources']['find'](_0x1372bb=>_0x1372bb['id']===_0x3fda5d)&&_0x4c4851['push'](_0x30a501['id']);}return 0x0===_0x4c4851['length']?null:_0x4c4851;}['_updateResourceInContextState'](_0x3d3f5a,_0x21097f,_0x3d1f8b){const _0x45c755=this['_addContextOptionsState']['sources']['find'](_0xa35d8e=>_0xa35d8e['id']===_0x3d3f5a);if(!_0x45c755)return;const _0x262493=_0x45c755['resources']['find'](_0x20879d=>_0x20879d['id']===_0x21097f);_0x262493&&(_0x262493['isInContext']=_0x3d1f8b,this['fire']('resourceStateChanged',{'sourceId':_0x3d3f5a,'resourceId':_0x21097f,'isInContext':_0x3d1f8b}));}['_startUploadOperation'](_0x22df67){this['_ongoingUploadOperations']['set'](_0x22df67,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x8f5aa7){this['_ongoingUploadOperations']['delete'](_0x8f5aa7),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const xi=['capabilitiesUpdated'];class Ci extends _0x554e67(){['_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'](_0x5a5b3b){const _0x4fa1ab={};return _0x5a5b3b&&_0x5a5b3b['isWebSearchEnabled']&&(_0x4fa1ab['webSearch']={}),_0x5a5b3b&&_0x5a5b3b['isReasoningEnabled']&&(_0x4fa1ab['reasoning']={}),_0x4fa1ab;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x1aad2e){_0x1aad2e!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x1aad2e,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x391063){_0x391063!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x391063,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class gi extends pe{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['quickActionData'];constructor(_0x1af34b){super(_0x1af34b),this['conversationId']=_0x1af34b['conversationId'],this['contextItems']=_0x1af34b['contextItems'],this['capabilities']=_0x1af34b['capabilities'],this['userMessage']=_0x1af34b['userMessage'],this['model']=_0x1af34b['model'],this['quickActionData']=_0x1af34b['quickActionData'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':vi['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Ci['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'quickActionData':this['quickActionData']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class ut extends _0x554e67(){['id'];['isStarted']=!0x1;['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x355a69){super(),this['options']=_0x355a69,this['connector']=_0x355a69['connector'],this['chatModels']=_0x355a69['chatModels'],this['id']=_0x355a69['conversationId'];}async['init'](_0x1b1856){try{this['chatContext']=new vi({'connector':this['connector'],'config':_0x1b1856,'ownerId':this['id']}),this['chatContext']['delegate'](...Ii)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Ci(),this['chatCapabilities']['delegate'](...xi)['to'](this),this['chatCapabilities']['init']();const _0x420bc4=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x420bc4});const _0x45fb85=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x45fb85&&await this['setModel'](_0x45fb85);}catch(_0x56edc5){const _0xa0fbb=new _0x15f966('ai-chat-conversation-init-failed',null,{'message':_0x56edc5['message']||_0x56edc5});_0xa0fbb['stack']=_0x56edc5['stack'],this['fire']('error',{'error':_0xa0fbb});}}async['start'](){if(this['isStarted'])throw new _0x15f966('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x15f966('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x279ad0}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x279ad0,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x1dbefe){const _0x543989=new _0x15f966('ai-chat-conversation-start-failed',null,{'message':_0x1dbefe['message'],'conversationId':this['id']});throw _0x543989['stack']=_0x1dbefe['stack'],this['fire']('error',{'error':_0x543989}),_0x543989;}}async['load'](_0x506101,_0x14a4fa){try{const _0x52438c=await this['connector']['fetchConversation'](_0x506101)['getConversation'](),_0xaa5eb9=await this['connector']['fetchConversationMessages'](_0x506101)['getMessages'](),_0x591576=_0xaa5eb9[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x52438c['id'],'title'in _0x52438c?this['fire']('setConversationTitle',_0x52438c['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x9436fb=(await this['chatModels']['getAll']())['find'](_0x4acf5f=>_0x4acf5f['id']['toLowerCase']()===_0x591576['toLowerCase']());return this['selectedModel']=_0x9436fb,this['fire']('modelSelected',{'selectedModel':_0x9436fb,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0xaa5eb9,_0x14a4fa,_0x591576),this['currentInteraction']=void 0x0,this;}catch(_0x526fec){const _0x3b6bd4=new _0x15f966('ai-chat-conversation-init-from-id-failed',null,{'message':_0x526fec['message'],'conversationId':_0x506101});throw _0x3b6bd4['stack']=_0x526fec['stack'],this['fire']('error',{'error':_0x3b6bd4}),_0x3b6bd4;}}async['_processMessagesToInteractions'](_0x119ed5,_0x273545,_0x591c1f){let _0x3b5870;for(const _0x2fa613 of _0x119ed5)if('user'===_0x2fa613['role']){const _0x50c85f=await this['_extractContextItems'](_0x2fa613),_0x226d21={'isReasoningEnabled':Object['hasOwn'](_0x2fa613['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x2fa613['capabilities'],'webSearch')};_0x3b5870=this['createInteraction']({'userMessage':_0x2fa613['prompt'],'contextItems':_0x50c85f,'capabilities':_0x226d21,'modelId':_0x591c1f,'quickActionData':_0x2fa613['attributes']?.['quickActionData']}),this['currentInteraction']=_0x3b5870,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x2fa613['role']&&_0x3b5870)for(const _0x365078 of _0x2fa613['content']){const _0x472113='text'===_0x365078['type']?'text-delta':'modification-delta',_0x34daac=_0x3b5870['getDocumentContext']()?.['sessionId']!==_0x273545;_0x3b5870['currentReply']=_0x3b5870['createReply']({'type':_0x472113,'isDone':!0x0,'interactionId':_0x3b5870['id'],'areActionsDisabled':_0x34daac}),_0x3b5870['currentReply']['appendContent'](_0x365078['content']);}}}async['_extractContextItems'](_0x2e2dca){const _0x4ca212=new Map();if(!_0x2e2dca['content'])return _0x4ca212;for(const _0x32e79d of _0x2e2dca['content']){const _0x3e68a1=await this['chatContext']['populateFromMessage'](_0x32e79d);_0x3e68a1&&_0x4ca212['set'](_0x3e68a1['id'],_0x3e68a1);}return _0x4ca212;}async['handleUserInteraction']({userMessage:_0x185ca9,quickActionData:_0x335a68}){if(!this['isStarted'])throw new _0x15f966('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x15f966('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x747490=this['chatContext']['getPendingContextItems'](),_0x481600=this['chatCapabilities']['getCapabilitiesConfig'](),_0x230116=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x185ca9,'contextItems':_0x747490,'capabilities':_0x481600,'modelId':_0x230116,'quickActionData':_0x335a68}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x57983b){if(_0x57983b instanceof _0x15f966)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x57983b});else{const _0x50f559=ve['get'](_0x57983b['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new _0x15f966(_0x50f559,null,{'error':_0x57983b})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x327001,contextItems:_0x284469,capabilities:_0x2f5d83,modelId:_0x594e48,quickActionData:_0x145556}){const _0x3f7643=new gi({'userMessage':_0x327001,'contextItems':_0x284469,'capabilities':_0x2f5d83,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x594e48,'quickActionData':_0x145556});return _0x3f7643['delegate'](...ge)['to'](this),this['interactions']['push'](_0x3f7643),this['fire']('interactionCreated',_0x3f7643),_0x3f7643;}['getInteraction'](_0x17417c){return this['interactions']['find'](_0x14549b=>_0x14549b['id']===_0x17417c);}['removeInteraction'](_0x5769d8){const _0x289f7e=this['getInteraction'](_0x5769d8);_0x289f7e&&(_0x289f7e['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x289f7e),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x57d5d7){this['chatContext']['addCurrentDocumentToContext'](_0x57d5d7);}async['updateCurrentDocumentInContext']({content:_0xad81bf,version:_0x550c2b,sessionId:_0x2b355b,selections:_0x4e2b0e}){await this['chatContext']['updateCurrentDocument'](_0xad81bf,_0x550c2b,_0x2b355b,_0x4e2b0e);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x4ef1a2){this['chatContext']['addSelectionToContext'](_0x4ef1a2);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x59ae3f){this['chatContext']['addFilesToContext'](_0x59ae3f);}['addUrlToContext'](_0x5e62d0){this['chatContext']['addUrlToContext'](_0x5e62d0);}['addResourceToContext'](_0x5acb28,_0x4af14f){this['chatContext']['addResourceToContext'](_0x5acb28,_0x4af14f);}['loadSourceResources'](_0x3514ef,_0x25fdac,_0x520908){return this['chatContext']['loadSourceResources'](_0x3514ef,_0x25fdac,_0x520908);}['removeFromContext'](_0x25ac6a){this['chatContext']['removeFromContext'](_0x25ac6a);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x599e85){_0x599e85?!0x1===await this['chatModels']['isAvailable'](_0x599e85)&&(_0xc522eb('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x599e85}),_0x599e85=(await this['chatModels']['getAvailableModels']())[0x0]):(_0xc522eb('ai-chat-conversation-set-model-null',{'conversation':this}),_0x599e85=(await this['chatModels']['getAvailableModels']())[0x0]),_0x599e85['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x599e85,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x599e85}));}}function rt(_0x293e72){if(_0x293e72 instanceof ht)return _0x293e72;if(_0x293e72?.['editors']&&_0x293e72['editors']['get'](0x0))return _0x293e72['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.'),_0x293e72['editors']['get'](0x0);throw new _0x15f966('ai-get-editor-from-context-no-editor');}const _t='ai-selection';class l extends tt{['_displayedFakeSelectionId']=null;['_displayedFakeSelectionLocked']=!0x1;['_sessionId'];static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['sessionId'](){if(!this['_sessionId']){const _0x58a66c=rt(this['context']),_0x378c6a=_0x58a66c['plugins']['has']('RealTimeCollaborationClient')&&_0x58a66c['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x378c6a||_0x53b360();}return this['_sessionId'];}['getDocumentData'](){const _0x904a49=rt(this['context']),_0xcfffd8=_0x904a49['model'],_0x54d586=_0x904a49['data']['toView'](_0xcfffd8['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x5151e8=new kt(_0x904a49['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x54d586,_0x5151e8);let _0x4ce5d7=_0x904a49['data']['processor']['toData'](_0x54d586);const _0x29b3ca=this['_getMarkersInDocumentOrder'](),_0x50a9c2=[];for(const _0x1586ab of _0x29b3ca){const _0xbe10ba='<'+_0x1586ab['name']+':start></'+_0x1586ab['name']+':start>',_0x4470f4=_0x4ce5d7['indexOf'](_0xbe10ba);_0x4ce5d7=_0x4ce5d7['substring'](0x0,_0x4470f4)+_0x4ce5d7['substring'](_0x4470f4+_0xbe10ba['length']);const _0x5a419f='<'+_0x1586ab['name']+':end></'+_0x1586ab['name']+':end>',_0x28d650=_0x4ce5d7['indexOf'](_0x5a419f);_0x4ce5d7=_0x4ce5d7['substring'](0x0,_0x28d650)+_0x4ce5d7['substring'](_0x28d650+_0x5a419f['length']),_0x50a9c2['push']({'markerName':_0x1586ab['name'],'start':_0x4470f4,'end':_0x28d650,'htmlFragment':_0x4ce5d7['substring'](_0x4470f4,_0x28d650)});}return{'content':_0x4ce5d7,'version':_0x904a49['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x50a9c2};}async['afterInit'](){this['context']instanceof ht?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0xffe8d4,_0x3f817c)=>{_0x3f817c['on']('ready',()=>{this['_integrateEditor'](_0x3f817c);});});}['_integrateEditor'](_0x15f6a1){_0x15f6a1['conversion']['for']('editingDowncast')['markerToHighlight']({'model':_t,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x15f6a1['conversion']['for']('dataDowncast')['markerToElement']({'model':_t,'view':(_0x19081d,{writer:_0x2f2ed2,options:_0x35f566})=>_0x35f566['convertAiChatSelectionMarker']?_0x2f2ed2['createUIElement'](_0x19081d['markerName']+':'+(_0x19081d['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x24e5ea,_0x2ce6ed,_0x569026=!0x1,_0x4173fc=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x4173fc)return!0x1;const _0x201c75=rt(this['context'])['model'];return _0x201c75['change'](_0x219144=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x2ce6ed,this['_displayedFakeSelectionLocked']=_0x569026;let _0x316f81=0x0;for(let _0x41ff0a of _0x24e5ea){const _0xd85c6e=_t+':'+_0x316f81;if(_0x41ff0a['start']['isAtEnd']){const _0xe7d1b5=_0x41ff0a['start']['getLastMatchingPosition'](({item:_0x3bc8b4})=>!_0x201c75['schema']['isContent'](_0x3bc8b4),{'boundaries':_0x41ff0a});_0x41ff0a=_0x219144['createRange'](_0xe7d1b5,_0x41ff0a['end']);}_0x219144['addMarker'](_0xd85c6e,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x41ff0a}),_0x316f81++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x515f29){if(this['_displayedFakeSelectionId']!=_0x515f29)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x499a86=rt(this['context']),_0x3584e0=_0x499a86['model']['markers']['getMarkersGroup'](_t);return _0x499a86['model']['change'](_0x445a13=>{for(const _0x1d4711 of _0x3584e0)_0x445a13['removeMarker'](_0x1d4711);}),!0x0;}['modelToViewWithIds'](_0x1e10e7){const _0x50f250=rt(this['context']),_0xfdeb3d=_0x50f250['data']['toView'](_0x1e10e7),_0x3ead5b=new kt(_0x50f250['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0xfdeb3d,_0x3ead5b),_0xfdeb3d;}['_setDataIdsOnChildren'](_0x46db45,_0x4d14e0){let _0x379207=!0x1;const _0x425f33=new Set();for(const _0x33232d of _0x46db45['getChildren']()){const _0x42023a=_0x33232d['is']('emptyElement')||_0x33232d['is']('containerElement');if(!_0x33232d['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x33232d,_0x4d14e0)||_0x42023a)&&(_0x4d14e0['setAttribute']('data-id',this['_nextDataId'](_0x425f33),_0x33232d),_0x379207=!0x0);}return _0x379207;}['_nextDataId'](_0x45bbb0){let _0x4ea216;do{_0x4ea216='';for(let _0x403add=0x0;_0x403add<0x4;_0x403add++)_0x4ea216+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x45bbb0['has'](_0x4ea216));return _0x45bbb0['add'](_0x4ea216),_0x4ea216;}['getSelectionText'](){const {model:_0xd69a77}=rt(this['context']),_0x4aaea3=_0xd69a77['document']['selection'],_0x145249=_0xd69a77['getSelectedContent'](_0x4aaea3),_0x789e43=[],_0x1aa382=_0xd69a77['createRangeIn'](_0x145249)['getWalker']();for(const {item:_0x48a498}of _0x1aa382)_0x48a498['is']('$textProxy')?_0x789e43['push'](_0x48a498['data']):_0x48a498['is']('element')&&_0x789e43['length']>0x0&&'\x20'!==_0x789e43[_0x789e43['length']-0x1]&&_0x789e43['push']('\x20');return'\x22'+_0x789e43['join']('')['trim']()+'\x22';}['_getMarkersInDocumentOrder'](){const _0x352a68=rt(this['context'])['model'];return Array['from'](_0x352a68['markers']['getMarkersGroup'](_t))['sort']((_0x57d782,_0x27dc52)=>_0x57d782['getStart']()['isBefore'](_0x27dc52['getStart']())?-0x1:_0x57d782['getStart']()['isAfter'](_0x27dc52['getStart']())?0x1:0x0);}}const x=['applySuggestion','insertSuggestion','showChangeInText'];class ah extends _0x3b9d21{['actionsButton'];['children'];['applySuggestionModel'];['showChangeInTextModel'];['insertSuggestionModel'];['_partsCount']=0x1;['_dropdownOriginalConfig'];['_dropdownCurrentConfig'];['_firstRender']=!0x0;constructor(_0x3a2b22,_0x412a08){super(_0x3a2b22),this['_dropdownOriginalConfig']=_0x412a08||[...x],this['_dropdownCurrentConfig']=[...this['_dropdownOriginalConfig']];const _0x5a35fb=this['bindTemplate'];this['set']('isEnabled',!0x0),this['set']('isVisible',!0x0),this['set']('isTrackChangesOn',!0x1),this['applySuggestionModel']=new _0x2ab623({'label':Pn('applySuggestion',_0x3a2b22,this['_partsCount']),'icon':_0x354c14,'withText':!0x0,'type':'button','actionName':'applySuggestion'}),this['showChangeInTextModel']=new _0x2ab623({'label':Pn('showChangeInText',_0x3a2b22,this['_partsCount']),'icon':_0x38357c,'withText':!0x0,'type':'button','actionName':'showChangeInText'}),this['insertSuggestionModel']=new _0x2ab623({'label':Pn('insertSuggestion',_0x3a2b22,this['_partsCount']),'icon':_0x52bb8d,'withText':!0x0,'type':'button','actionName':'insertSuggestion'}),this['actionsButton']=this['_createActionsDropdownOrButton'](_0x3a2b22),this['children']=this['createCollection'](),this['actionsButton']&&this['children']['add'](this['actionsButton']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x5a35fb['if']('isVisible','ck-hidden',_0x59b489=>!_0x59b489)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_dropdownCurrentConfig']=this['isTrackChangesOn']?this['_dropdownOriginalConfig']['filter'](_0x34b009=>'applySuggestion'!==_0x34b009):[...this['_dropdownOriginalConfig']],this['_updateDropdownActions'](_0x3a2b22);});}['_updateDropdownActions'](_0x18d915){this['actionsButton']&&this['children']['has'](this['actionsButton'])&&(this['children']['remove'](this['actionsButton']),this['actionsButton']['destroy']()),this['actionsButton']=this['_createActionsDropdownOrButton'](_0x18d915),this['actionsButton']&&this['children']['add'](this['actionsButton']);}['_createActionsDropdownOrButton'](_0x471c62){if(0x0==this['_dropdownCurrentConfig']['length'])return null;const _0x2d923a=0x1===this['_dropdownCurrentConfig']['length']?this['_createActionsButton'](_0x471c62):this['_createActionsDropdown'](_0x471c62),_0x4b784a=this['_firstRender']?'':'ck-ai-chat__feed__ai-suggestion__actions--no-animation';_0x2d923a['set']({'label':Pn(this['_dropdownCurrentConfig'][0x0],_0x471c62,this['_partsCount']),'tooltip':Hn(this['_dropdownCurrentConfig'][0x0],_0x471c62,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions\x20'+_0x4b784a});for(const _0x9edc9d of this['_dropdownCurrentConfig'])_0x2d923a['on'](_0x9edc9d,()=>{this['fire'](_0x9edc9d);});return this['_firstRender']=!0x1,_0x2d923a;}['_createActionsButton'](_0x1850e1){const _0x55e875=new _0x5ee277(_0x1850e1);return _0x55e875['set']({'class':'ck-ai-button-primary','withText':!0x0}),_0x55e875['on']('execute',()=>{_0x55e875['fire'](this['_dropdownCurrentConfig'][0x0]);}),_0x55e875;}['_createActionsDropdown'](_0x19e291){const _0x500237=new Nn(_0x19e291,{'listItemModels':this['_dropdownCurrentConfig']['map'](_0x52c2a7=>{switch(_0x52c2a7){case'applySuggestion':return this['applySuggestionModel'];case'showChangeInText':return this['showChangeInTextModel'];case'insertSuggestion':return this['insertSuggestionModel'];}})});return _0x500237['set']({'label':Pn(this['_dropdownCurrentConfig'][0x0],_0x19e291,this['_partsCount']),'tooltip':Hn(this['_dropdownCurrentConfig'][0x0],_0x19e291,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions','balloonPanelClass':'ck-ai-chat__feed__ai-suggestion__actions__balloon'}),_0x500237['bind']('isEnabled')['to'](this),_0x500237;}['updateLabels'](_0xc73446){const _0x3d3980=this['locale'];this['_partsCount']=_0xc73446||this['_partsCount'],this['actionsButton']['set']({'label':Pn(this['_dropdownCurrentConfig'][0x0],_0x3d3980,this['_partsCount']),'tooltip':Hn(this['_dropdownCurrentConfig'][0x0],_0x3d3980,this['_partsCount'])}),this['applySuggestionModel']['label']=Pn('applySuggestion',_0x3d3980,this['_partsCount']),this['showChangeInTextModel']['label']=Pn('showChangeInText',_0x3d3980,this['_partsCount']),this['insertSuggestionModel']['label']=Pn('insertSuggestion',_0x3d3980,this['_partsCount']);}}class Nn extends _0x329998{['bodyCollection'];['balloonPanelView'];['listView'];['keystrokeHandler'];constructor(_0x103cdf,_0x2218f8){super(_0x103cdf),this['balloonPanelView']=new _0x509620(this['locale']),this['bodyCollection']=new _0x57ac2d(this['locale']),this['bodyCollection']['attachToDom'](),this['set']('balloonPanelClass',''),this['balloonPanelView']['bind']('class')['to'](this,'balloonPanelClass'),this['listView']=this['_setUpList'](_0x2218f8['listItemModels']['slice'](0x1)),this['bodyCollection']['add'](this['balloonPanelView']),this['balloonPanelView']['content']['add'](this['listView']),this['arrowView']['unbind']('tooltip'),this['arrowView']['set']('tooltip',C(this['locale'],'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP')),this['_setUpKeystrokes'](),this['on']('execute',()=>{const _0x4088c5=_0x2218f8['listItemModels'][0x0]['actionName'];this['fire'](_0x4088c5),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),this['on']('open',()=>{this['balloonPanelView']['isVisible']?(this['balloonPanelView']['hide'](),this['arrowView']['focus']()):(this['balloonPanelView']['pin']({'target':this['element'],'positions':['ltr'===this['locale']['uiLanguageDirection']?Gn:yn]}),this['listView']['focus']());}),_0x3685ee({'emitter':this['balloonPanelView'],'callback':()=>{this['balloonPanelView']['hide']();},'activator':()=>this['balloonPanelView']['isVisible'],'contextElements':()=>[this['element'],this['balloonPanelView']['element']]});}['_setUpList'](_0x2e53fc){const _0x5c259b=this['locale'],_0x36885d=new _0x40233d(_0x5c259b);for(const _0x315da1 of _0x2e53fc){const _0x8cdf6a=new _0x8173b9(_0x5c259b),_0x457c5c=new _0x79b3f5(_0x5c259b);_0x457c5c['bind'](...Object['keys'](_0x315da1))['to'](_0x315da1),_0x457c5c['delegate']('execute')['to'](_0x36885d),_0x8cdf6a['children']['add'](_0x457c5c),_0x36885d['items']['add'](_0x8cdf6a);}return _0x36885d['items']['delegate']('execute')['to'](this),_0x36885d['on']('execute',_0x15e164=>{const _0x1da586=_0x15e164['source'];this['fire'](_0x1da586['actionName']),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),_0x36885d;}['_setUpKeystrokes'](){this['keystrokeHandler']=new _0x5593a8(),this['keystrokeHandler']['listenTo'](this['balloonPanelView']['element']),this['keystrokeHandler']['set']('esc',(_0x1cb373,_0x397a2b)=>{this['balloonPanelView']['hide'](),this['arrowView']['focus'](),_0x397a2b();});}['destroy'](){super['destroy'](),this['keystrokeHandler']['destroy'](),this['balloonPanelView']['destroy'](),this['bodyCollection']['detachFromDom']();}}function Gn(_0x453151){return{'top':_0x453151['bottom'],'left':_0x453151['left'],'name':'arrowless','config':{'withArrow':!0x1}};}function yn(_0x467f45,_0x37d110){return{'top':_0x467f45['bottom'],'left':_0x467f45['left']-(_0x37d110['width']-_0x467f45['width']),'name':'arrowless','config':{'withArrow':!0x1}};}function Pn(_0x18b6b,_0x26a2ec,_0x262cc1){switch(_0x18b6b){case'applySuggestion':return C(_0x26a2ec,'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL',_0x262cc1);case'showChangeInText':return C(_0x26a2ec,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT',_0x262cc1);case'insertSuggestion':return C(_0x26a2ec,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION',_0x262cc1);}}function Hn(_0x3c06d5,_0x1561fb,_0x16395d){switch(_0x3c06d5){case'applySuggestion':return C(_0x1561fb,'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP',_0x16395d);case'showChangeInText':return C(_0x1561fb,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP',_0x16395d);case'insertSuggestion':return C(_0x1561fb,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP',_0x16395d);}}class ft extends _0x554e67(){['_connector'];['_availableModels'];['_defaultModelId'];['_locale'];['_modelList']=[];constructor({connector:_0x6b06a0,availableModels:_0x570222,defaultModelId:_0x523633,locale:_0x31b9a2}){super(),this['_connector']=_0x6b06a0,this['_availableModels']=_0x570222,this['_defaultModelId']=_0x523633,this['_locale']=_0x31b9a2;}async['getAll'](){if(!this['_modelList']['length'])try{const _0x5eb723=this['_locale']['uiLanguage']||'en',_0x250af2=this['_connector']['getModels'](_0x5eb723),_0x490f71=await _0x250af2['list']();this['_modelList']=_0x490f71['items']['map'](_0x231c82=>Be(_0x231c82)?{..._0x231c82,'name':C(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x231c82);}catch(_0x1559a2){throw gt('ai-models-unable-to-retrieve',{'error':_0x1559a2}),_0x1559a2;}return[...this['_modelList']];}async['getAvailableModels'](){const _0xc57af0=await this['getAll']();return this['_filterModels'](_0xc57af0,this['_availableModels']);}async['getModel'](_0x127d6c){const _0xc313e6=await this['getAll']();if(!_0xc313e6['length'])return null;if(_0x127d6c){const _0x34448a=this['_getModelById'](_0xc313e6,_0x127d6c);if(_0x34448a)return _0x34448a;_0xc522eb('ai-chat-model-id-unrecognized',{'modelId':_0x127d6c,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0xd0fff6=await this['getAvailableModels']();if(!_0xd0fff6['length'])return null;if(this['_defaultModelId']){const _0x344f45=this['_getModelById'](_0xd0fff6,this['_defaultModelId']);if(_0x344f45)return _0x344f45;_0xc522eb('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0xd0fff6[0x0]['id']});}return _0xd0fff6[0x0];}async['isAvailable'](_0x28731c){return(await this['getAvailableModels']())['some'](_0x22fb83=>_0x22fb83['name']===_0x28731c['name']&&_0x22fb83['provider']===_0x28731c['provider']);}['_filterModels'](_0x11ba39,_0x34bb50){let _0x4cb677;if(_0x34bb50){_0x4cb677=[];const _0x59ed57='string'==typeof _0x34bb50?[_0x34bb50['toLocaleLowerCase']()]:_0x34bb50['map'](_0x557fbe=>_0x557fbe['toLocaleLowerCase']());for(const _0x47aa9c of _0x59ed57)for(const _0x1fb5bb of _0x11ba39)(_0x1fb5bb['id']['toLocaleLowerCase']()===_0x47aa9c||_0x1fb5bb['name']['toLocaleLowerCase']()===_0x47aa9c||Be(_0x1fb5bb)&&'auto'===_0x47aa9c||_0x1fb5bb['provider']['toLocaleLowerCase']()===_0x47aa9c||_0x1fb5bb['id']['toLocaleLowerCase']()['startsWith'](_0x47aa9c))&&_0x4cb677['push'](_0x1fb5bb);}else _0x4cb677=_0x11ba39;return _0x4cb677;}['_getModelById'](_0x26c56d,_0x110673){return _0x26c56d['find'](_0x2b143e=>Be(_0x2b143e)&&'auto'===_0x110673?_0x2b143e:_0x2b143e['id']===_0x110673)||null;}}function Be(_0x3f0469){return _0x3f0469['id']['startsWith']('agent');}function A({editor:_0x5e4a16,interaction:_0x472658,reply:_0x4cc4f4,groups:_0xb47c1c,transform:_0x45530b,documentCompare:_0x24e849,documentCompareOptions:_0x3b6c4e}){const _0x2726ec=_0x472658['getDocumentContext']();if(!_0x2726ec)return[];const _0x49fe4b=_0x2726ec['content'],_0x477c13=_0x2726ec['version'],_0x2a32d5=_0x4cc4f4['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x4da9e2}of _0xb47c1c){const _0x4b6242=_0x4da9e2['filter'](_0x2d023a=>'new'!=_0x2d023a['type'])['map'](_0x118843=>St('data-id',_0x118843['id'],_0x2a32d5)),_0xc87f1f=_0x4da9e2['filter'](_0x4c8ae5=>'removed'!=_0x4c8ae5['type'])['map'](_0x3ba0c6=>_0x3ba0c6['node']['cloneNode'](!0x0));let _0x2903b8=null;if(_0x4b6242['length']){_0x2903b8=_0x4b6242[0x0]['previousSibling'];for(let _0x1d9e04=0x0;_0x1d9e04<_0x4b6242['length'];_0x1d9e04++)_0x546a65(_0x4b6242[_0x1d9e04]);}if(_0xc87f1f['length']){_0x2903b8||(_0x4da9e2[0x0]['anchorId']?_0x2903b8=St('data-id',_0x4da9e2[0x0]['anchorId'],_0x2a32d5):(_0x2903b8=_0xc87f1f['shift'](),_0x302586(_0x2a32d5,_0x2903b8)));for(let _0x3eaa26=0x0;_0x3eaa26<_0xc87f1f['length'];_0x3eaa26++)tr(_0x2903b8,_0xc87f1f[_0x3eaa26]),_0x2903b8=_0xc87f1f[_0x3eaa26];}}const _0x3e47bb=Et(_0x2a32d5),_0x270c04=_0x24e849['getDiff'](_0x49fe4b,_0x3e47bb,_0x3b6c4e)['getOperations']();if(_0x45530b){const _0x2a89c=_0x5e4a16['model']['document']['history']['getOperations'](_0x477c13),_0x34cbaf={'document':_0x5e4a16['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x47c5f7(_0x270c04,_0x2a89c,_0x34cbaf)['operationsA'];}return _0x270c04;}function v(_0x5d02b7,_0x3d74c7){if('marker'!=_0x3d74c7['type'])return;const _0x28c204=_0x5d02b7['model']['markers']['get'](_0x3d74c7['name']);_0x28c204&&(_0x3d74c7['oldRange']=_0x28c204['getRange']());}class Lr extends _0x42835a{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0xb71349,_0x1f9540={},_0x42ebf9){super(_0xb71349),this['set']('isLoading',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x1f9540};const _0x3d5204=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x3d5204?'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'](_0x42ebf9),this['items']['add'](this['showChangesButton'])),this['_setupRatingButtons'](),this['_config']['showLike']&&this['items']['add'](this['likeButton']),this['_config']['showDislike']&&this['items']['add'](this['dislikeButton']),this['_config']['customView']&&this['items']['addMany'](this['_config']['customView']);}['_setupRatingButtons'](){this['likeButton']=new _0x5ee277(this['locale']),this['likeButton']['set']({'icon':_0x1f975f,'label':C(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x3e9c4e=>!_0x3e9c4e),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x5ee277(this['locale']),this['dislikeButton']['set']({'icon':_0x3b2414,'label':C(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x5d4dbe=>!_0x5d4dbe),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x5ee277(this['locale']),this['copyButton']['set']({'icon':_0x53ac03,'label':C(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this,'isLoading',_0xb59ba4=>!_0xb59ba4);const _0x568f0a=new _0x53ac42();_0x568f0a['set']({'content':_0x4661c5}),_0x568f0a['extendTemplate']({'attributes':{'class':['ck-ai-mini-toolbar-copy-button__check-mark']}}),this['copyButton']['on']('execute',()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20ck-ai-mini-toolbar-copy-button_copied',setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button';},0x7d0);}),this['copyButton']['children']['add'](_0x568f0a);}['_setupShowChangesButton'](_0x329dec){this['showChangesButton']=new _0x5ee277(this['locale']),this['showChangesButton']['set']({'icon':_0x8d0f12,'label':C(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'isOn':_0x329dec}),this['showChangesButton']['bind']('isEnabled')['to'](this,'isLoading',_0x42c539=>!_0x42c539),this['showChangesButton']['on']('execute',()=>{const _0x1c8c69=!this['showChangesButton']['isOn'];this['showChangesButton']['set']({'isOn':_0x1c8c69,'icon':_0x1c8c69?_0x2ca6d5:_0x8d0f12}),this['fire']('toggleShowChanges',_0x1c8c69);});}}class Tr extends _0x3b9d21{['showChangesToggleView'];constructor(_0x52cded,_0x43b56b){super(_0x52cded),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Yr(_0x52cded),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':C(_0x52cded,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x43b56b['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x575e1d=>_0x575e1d?_0x40330d:_0xeaa4dc),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x2872b0=new _0x53ac42();_0x2872b0['content']=_0x393547,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x43b56b['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x2872b0,{'tag':'span','children':[C(_0x52cded,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Yr extends _0x5ee277{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}class ha{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;constructor(_0x1fd20d){this['options']={'delay':_0x1fd20d['delay']??0x14,'textNodeStyle':_0x1fd20d['textNodeStyle'],'onStreamUpdate':_0x1fd20d['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x263b7c,targetElement:_0x2d7f43,abortSignal:_0x55aedf}){this['isStreaming']&&this['stop'](),_0x55aedf?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x44b2b3(_0x263b7c,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(_0xc522eb('ai-html-streamer-current-index-out-of-bounds',{'currentIndex':this['currentIndex'],'nodeList':this['nodesList']}),this['currentIndex']=this['nodesList']['length']);for(let _0x369f64=0x0;_0x369f64<this['currentIndex'];_0x369f64++)this['nodesList'][_0x369f64]['shouldBeStreamed']=!0x0;let _0x479504=0x0;for(let _0x5d9833=this['currentIndex'];_0x5d9833<this['nodesList']['length'];_0x5d9833++){const _0x4d67e0=Date['now'](),_0x6d4945=this['nodesList'][_0x5d9833],_0x100134=_0x4d67e0-_0x479504;_0x6d4945['shouldBeStreamed']=!0x0;let _0x26110b=_0x6d4945['parent'];for(;_0x26110b;)_0x26110b['shouldBeStreamed']=!0x0,_0x26110b=_0x26110b['parent'];if(_0x100134<this['options']['delay'])try{const {promise:_0x41f969,abortController:_0x1f6b26}=dr(this['options']['delay']-_0x100134);this['timeoutAbortController']=_0x1f6b26,await _0x41f969;}catch(_0x4dc819){return;}_0x1d40e0(_0x2d7f43,'<'+_0x2d7f43['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x2d7f43['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']=_0x5d9833,_0x479504=Date['now']();}this['isStreaming']=!0x1;}['cleanUpAnimations']({targetElement:_0x344d1b}){Array['from'](_0x344d1b['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x47c43b=>{_0x47c43b['replaceWith'](_0x47c43b['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x15daf5){let _0x23723e='';if(function(_0x40a7ed){return _0x58235a(_0x40a7ed);}(_0x15daf5)){for(const _0x21ebbe of _0x15daf5['children'])_0x23723e+=this['renderNode'](_0x21ebbe);}else{if(ar(_0x15daf5)){if(!_0x15daf5['shouldBeStreamed'])return'';const _0x12709a=_0x15daf5,_0x172e80=Object['entries'](_0x12709a['attribs'])['map'](([_0xbcfb4b,_0x443618])=>_0xbcfb4b+'=\x22'+_0x443618+'\x22')['join']('\x20');_0x23723e+='<'+_0x12709a['tagName']+(_0x172e80?'\x20'+_0x172e80:'')+'>';for(const _0x38dd72 of _0x12f4b6(_0x12709a))_0x23723e+=this['renderNode'](_0x38dd72);_0x23723e+='</'+_0x12709a['tagName']+'>';}else{if(!cr(_0x15daf5))return'';if(!_0x15daf5['shouldBeStreamed'])return'';!function(_0x1721b6){if(!_0x1721b6['parent']||!ar(_0x1721b6['parent']))return!0x1;if(!hr['includes'](_0x1721b6['parent']['tagName']))return!0x1;return!_0x154b5d(_0x1721b6)['match'](/^\s*[<>]\s*$/);}(_0x15daf5)?_0x23723e+=_0x946802(_0x15daf5):_0x23723e+=_0x946802(new _0x489563('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x15daf5]));}}return _0x23723e;}['getParsedDocumentNodeList'](){const _0x3ac622=[];return function(_0x1bca3b,_0x1bda77){const _0x5a96e6=_0x3a1194=>{if(_0x1bda77(_0x3a1194),_0x3a1194 instanceof _0x37b932)for(let _0xdbd190=0x0;_0xdbd190<_0x3a1194['children']['length'];_0xdbd190++){const _0x121ce8=_0x3a1194['children'][_0xdbd190];_0x5a96e6(_0x121ce8);}};for(let _0x53363a=0x0;_0x53363a<_0x1bca3b['children']['length'];_0x53363a++)_0x5a96e6(_0x1bca3b['children'][_0x53363a]);}(this['document'],_0x44fa94=>{if(cr(_0x44fa94)){const _0x55a639=this['splitTextNodeIntoWordNodes'](_0x44fa94);_0x55a639['length']&&_0x3ac622['push'](..._0x55a639);}_0x44fa94['isWordSplitSource']||_0x44fa94['isWordSplitResult']||_0x3ac622['push'](_0x44fa94);}),_0x3ac622;}['splitTextNodeIntoWordNodes'](_0xa9d264){if(_0xa9d264['isWordSplitSource']||_0xa9d264['isWordSplitResult'])return[];const _0x1763e7=_0x154b5d(_0xa9d264)['match'](/(?:\s*\S+\s*)/g),_0x50ea40=[];if(_0x1763e7&&_0x1763e7['length']>0x1){for(const _0x3b90f0 of _0x1763e7){const _0x379769=new _0x2b59b9(_0x3b90f0);_0x379769['isWordSplitResult']=!0x0,_0x6cef5(_0xa9d264,_0x379769),_0x50ea40['push'](_0x379769);}_0xa9d264['isWordSplitSource']=!0x0,_0x546a65(_0xa9d264);}return _0x50ea40;}}const hr=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function cr(_0x64e172){return _0x5a17d3(_0x64e172);}function ar(_0x3da46f){return _0x383f31(_0x3da46f);}function dr(_0x3d564e){const _0x126cf0=new AbortController();return{'promise':new Promise((_0x460a38,_0x235e08)=>{const _0x4b69e8=setTimeout(_0x460a38,_0x3d564e);_0x126cf0['signal']['addEventListener']('abort',()=>{clearTimeout(_0x4b69e8),_0x235e08();});}),'abortController':_0x126cf0};}const Ee=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'];class na extends _0x3b9d21{['htmlStreamer'];['children'];['headerView'];['contentView'];constructor(_0x13d220,{part:_0x5e484e,uiIndex:_0x4ded1a,areActionsDisabled:_0x2effc9,availableActions:_0x434d8b}){super(_0x13d220),this['set']('partDefinition',_0x5e484e),this['set']('state','pending'),this['set']('isVisible',!0x1),this['bind']('isEnabled')['to'](this,'state',_0x118041=>'pending'==_0x118041&&!_0x2effc9),this['children']=this['createCollection'](),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['headerView']=new Un(_0x13d220,{'part':_0x5e484e,'uiIndex':_0x4ded1a,'availableActions':_0x434d8b}),this['headerView']['bind']('partDefinition')['to'](this),this['headerView']['bind']('isEnabled')['to'](this),this['headerView']['bind']('state')['to'](this),this['headerView']['delegate'](...Ee)['to'](this);const _0xd4b115=this['bindTemplate'];this['contentView']=new _0x3b9d21(),this['contentView']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__content']}}),this['children']['addMany']([this['contentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0xd4b115['to']('state',_0x303f07=>'ck-ai-suggestion__body__content-part_'+_0x303f07),_0xd4b115['to']('isEnabled',_0x50b9ef=>_0x50b9ef?'ck-ai-suggestion__body__content-part_active':void 0x0),_0xd4b115['if']('isVisible','ck-hidden',_0x2afea5=>!_0x2afea5)]},'children':this['children'],'on':{'mouseenter':_0xd4b115['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x5e484e['index']});}),'mouseleave':_0xd4b115['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x5e484e['index']});})}});}async['updateContent']({part:_0x5130b6,renderingStrategy:_0x58dddd,showUnchangedParts:_0x3afd5a=!0x1,abortSignal:_0x50954f}){this['partDefinition']=_0x5130b6,this['isVisible']=this['partDefinition']['hasChanges']||_0x3afd5a,this['isVisible']&&('streaming'===_0x58dddd?await this['htmlStreamer']['stream']({'document':this['partDefinition']['content'],'targetElement':this['contentView']['element'],'abortSignal':_0x50954f}):this['contentView']['element']['innerHTML']=Et(this['partDefinition']['content']));}['toggleHeader'](_0x1a231d){_0x1a231d?this['children']['has'](this['headerView'])||this['children']['add'](this['headerView'],0x0):this['children']['has'](this['headerView'])&&this['children']['remove'](this['headerView']);}}class Un extends _0x3b9d21{['children'];['_toolbarView'];['_iconStateAccepted'];['_iconStateRejected'];['_iconStateOutdated'];constructor(_0x1aa261,{part:_0x53221c,uiIndex:_0x532a09,availableActions:_0x32c8ee}){super(_0x1aa261),this['set']('partDefinition',_0x53221c),this['set']('isEnabled',!0x0),this['set']('state','pending');const _0xf8f4b6=new _0x53ac42();_0xf8f4b6['content']=_0xe0f938,_0xf8f4b6['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-title']}});const _0x44e5fe=[];if(_0x32c8ee['includes']('showChangeInText')){const _0x184cd6=new _0x5ee277(_0x1aa261);_0x184cd6['set']({'label':C(_0x1aa261,'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT'),'tooltip':!0x0,'withText':!0x1,'icon':_0x38357c}),_0x184cd6['bind']('isEnabled')['to'](this),_0x184cd6['on']('execute',()=>{this['fire']('showChangeInText',{'index':_0x53221c['index']});}),_0x44e5fe['push'](_0x184cd6);}if(_0x32c8ee['includes']('insertSuggestion')){const _0x7fc506=new _0x5ee277(_0x1aa261);_0x7fc506['set']({'label':C(_0x1aa261,'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION'),'tooltip':!0x0,'withText':!0x1,'icon':_0x52bb8d}),_0x7fc506['bind']('isEnabled')['to'](this),_0x7fc506['on']('execute',()=>{this['fire']('insertSuggestion',{'index':_0x53221c['index']});}),_0x44e5fe['push'](_0x7fc506);}const _0x57b119=new _0x5ee277(_0x1aa261);_0x57b119['set']({'label':C(_0x1aa261,'AI_SUGGESTION_CONTENT_PART_DELETE'),'tooltip':!0x0,'withText':!0x1,'icon':_0xf22a17}),_0x57b119['bind']('isEnabled')['to'](this),_0x57b119['on']('execute',()=>{this['fire']('rejectSuggestion',{'index':_0x53221c['index']});}),_0x44e5fe['push'](_0x57b119),this['_toolbarView']=new _0x42835a(_0x1aa261),this['_toolbarView']['items']['addMany'](_0x44e5fe),this['_iconStateAccepted']=new _0x53ac42(),this['_iconStateAccepted']['content']=_0x3a9eea,this['_iconStateAccepted']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-accepted'],'data-cke-tooltip-text':C(_0x1aa261,'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED'),'data-cke-tooltip-position':'n'}}),this['_iconStateRejected']=new _0x53ac42(),this['_iconStateRejected']['content']=_0x1ef364,this['_iconStateRejected']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-rejected'],'data-cke-tooltip-text':C(_0x1aa261,'AI_SUGGESTION_CONTENT_PART_REJECTED'),'data-cke-tooltip-position':'n'}}),this['_iconStateOutdated']=new _0x53ac42(),this['_iconStateOutdated']['content']=_0x1ef364,this['_iconStateOutdated']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-outdated'],'data-cke-tooltip-text':C(_0x1aa261,'AI_SUGGESTION_CONTENT_PART_OUTDATED'),'data-cke-tooltip-position':'n'}});const _0x126e0c=new _0x3b9d21(_0x1aa261);_0x126e0c['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[C(_0x1aa261,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x532a09['toString']())]}),this['children']=this['createCollection'](),this['children']['addMany']([_0xf8f4b6,_0x126e0c,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',(_0x291508,_0x4d3beb,_0xb04e26,_0x33942f)=>{switch(_0x33942f){case'pending':this['children']['remove'](this['_toolbarView']);break;case'accepted':this['children']['remove'](this['_iconStateAccepted']);break;case'rejected':this['children']['remove'](this['_iconStateRejected']);break;case'outdated':this['children']['remove'](this['_iconStateOutdated']);}switch(_0xb04e26){case'pending':this['children']['add'](this['_toolbarView']);break;case'accepted':this['children']['add'](this['_iconStateAccepted']);break;case'rejected':this['children']['add'](this['_iconStateRejected']);break;case'outdated':this['children']['add'](this['_iconStateOutdated']);}});}}class y extends _0x554e67(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x2e4196){const _0x2fef7a=this['createTask'](_0x2e4196);return this['queue']['push'](_0x2fef7a),this['_processQueue'](),_0x2fef7a['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(_0x1cefdf=>{this['once']('_queueEmpty',()=>{_0x1cefdf();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x51877f=this['queue']['shift']();try{await _0x51877f['callback'](this['_abortController']['signal']),_0x51877f['resolve']();}catch(_0x3a369b){_0x51877f['reject'](_0x3a369b);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x49524c){let _0x16989e,_0x3aaa02;const _0x334940=new Promise((_0x45754b,_0x47c6c0)=>{_0x16989e=_0x45754b,_0x3aaa02=_0x47c6c0;});return{'callback':_0x49524c,'resolve':_0x16989e,'reject':_0x3aaa02,'completePromise':_0x334940};}}class Fr extends _0x3b9d21{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x1ba907){super();const _0x5c12a1=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0x1ba907,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x5c12a1['if']('isDone','ck-ai-chat__feed__item_done'),_0x5c12a1['if']('isVisible','ck-hidden',_0x394f72=>!_0x394f72),'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'](_0x5e45d3=>{_0x5e45d3['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x141f84,_0xecaae2,_0x1dc4d3){await this['htmlStreamer']['stream']({'document':_0x141f84,'targetElement':_0xecaae2,'abortSignal':_0x1dc4d3});}}class Ae extends Fr{constructor(_0xaf1f5a){super(_0xaf1f5a),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0xaf1f5a['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x21aa92){this['element']['innerHTML']=_0x21aa92;}}class Dr extends _0x3b9d21{['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x5086f7,_0x583334){super(_0x5086f7);const {areActionsDisabled:_0x4b0089,showUnchangedParts:_0x497e8e,availableActions:_0x156f85}=_0x583334;this['_areActionsDisabled']=_0x4b0089,this['_showUnchangedParts']=_0x497e8e,this['_availableActions']=_0x156f85,this['set']('hasPendingParts',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new y(),this['_emptyPartsWarningView']=new Ae({'id':'empty-parts-warning','initialContent':C(_0x5086f7,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0x5db1bd,renderingStrategy:_0x4c9512,abortSignal:_0x6c296}){this['_children']['length']?_0x5db1bd['forEach'](_0x8b2550=>{const _0xbbde72=this['_cachedContentParts']['findIndex'](_0xdae891=>_0xdae891['index']==_0x8b2550['index']);-0x1===_0xbbde72?this['_cachedContentParts']['push'](_0x8b2550):this['_cachedContentParts'][_0xbbde72]=_0x8b2550;}):this['_cachedContentParts']=_0x5db1bd;for(const _0x18c320 of _0x5db1bd['filter'](_0x278fd8=>_0x278fd8['hasChanges']))this['_updateContentPartsPromiseQueue']['enqueue'](async _0x4844e4=>{let _0x444fc7=this['getPartView'](_0x18c320['index']);_0x444fc7||(_0x444fc7=new na(this['locale'],{'part':_0x18c320,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x444fc7['delegate'](...Ee)['to'](this),this['_children']['add'](_0x444fc7),this['hasPendingParts']=!0x0),0x2===this['_children']['length']&&this['_children']['first']['toggleHeader'](!0x0),_0x444fc7['toggleHeader'](this['_children']['length']>0x1),await _0x444fc7['updateContent']({'part':_0x18c320,'renderingStrategy':_0x4c9512,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x4844e4});});return _0x6c296?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x541677,_0x52ba7d){const _0x5af780=this['getPartView'](_0x541677);_0x5af780&&(_0x5af780['state']=_0x52ba7d),this['hasPendingParts']='pending'==_0x52ba7d||Array['from'](this['_children'])['some'](_0x1f9009=>'pending'==_0x1f9009['state']);}['getPartView'](_0x508479){return this['_children']['find'](_0x178b7d=>_0x178b7d['partDefinition']['index']==_0x508479)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x67d5d7=!this['_cachedContentParts']['find'](({hasChanges:_0x3dec90})=>_0x3dec90),_0x544220=!!this['_cachedContentParts']['find'](({hasChanges:_0x4cbbdf})=>!_0x4cbbdf);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x544220,_0x67d5d7?this['_emptyPartsWarningView']['setContent'](C(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](C(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}}get['hasNonEmptyParts'](){return!!this['_children']['find'](_0x2b3a5b=>_0x2b3a5b['partDefinition']['hasChanges']);}}class Pe extends _0x2a835f{constructor(_0x1a2a05=void 0x0){super();const _0x231928=_0x1a2a05?'ck-ai-spinner_'+_0x1a2a05:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x231928]}});}}class e extends _0x3b9d21{['bodyView'];['miniToolbarView'];['children'];['headerView'];['loaderView'];['errorView'];['sourcesView'];['_bodyCollection'];constructor(_0x45d4bb,_0x542035,_0x56b9a6){super(_0x45d4bb),this['_bodyCollection']=_0x56b9a6;const {showDiff:_0x53f1e2,areActionsDisabled:_0x3e71ce,miniToolbarConfig:_0x4a7fbc,hideHeader:_0x142e06,showLoader:_0x178562,showUnchangedParts:_0x48340f,availableActions:_0x141e0e}=_0x542035;this['set']('areChangesVisible',!0x1),this['set']('isLoaderVisible',!!_0x178562),this['set']('isErrorVisible',!0x1),this['set']('isLoading',!0x1),this['children']=this['createCollection'](),_0x142e06||(this['headerView']=new Tr(_0x45d4bb,{'showDiff':_0x53f1e2}),this['headerView']['on']('toggleShowChanges',(_0x13105b,_0x200c1a)=>{this['areChangesVisible']=_0x200c1a['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x200c1a['isOn']});}),this['children']['add'](this['headerView'])),this['bodyView']=new Dr(_0x45d4bb,{'areActionsDisabled':_0x3e71ce,'showUnchangedParts':!!_0x48340f,'availableActions':_0x141e0e}),this['bodyView']['delegate'](...Ee)['to'](this),this['bodyView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoaderVisible','ck-hidden'),this['bindTemplate']['if']('isErrorVisible','ck-hidden')]}}),this['miniToolbarView']=new Lr(_0x45d4bb,_0x4a7fbc,_0x53f1e2),this['miniToolbarView']['delegate'](...Ee)['to'](this),this['miniToolbarView']['on']('toggleShowChanges',(_0x49aeac,_0x48ee4b)=>{this['areChangesVisible']=_0x48ee4b,this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x48ee4b});}),this['miniToolbarView']['bind']('isLoading')['to'](this),this['children']['add'](this['bodyView']),this['children']['add'](this['miniToolbarView']),this['sourcesView']=new Sr(this['locale'],this['_bodyCollection']),this['children']['add'](this['sourcesView']),_0x178562&&(this['loaderView']=this['_createLoaderView'](),this['children']['add'](this['loaderView'])),this['errorView']=this['_createErrorView'](),this['children']['add'](this['errorView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x163d87){await this['bodyView']['updateContentParts'](_0x163d87);}['updateSources'](_0x28a558){const _0xc6a589=this['sourcesView'],_0x77fbda=_0xc6a589['balloonPanelView'];_0xc6a589['children']['addMany'](_0x28a558['map'](_0x4053fb=>new Rr(this['locale'],_0x4053fb,_0x77fbda))),_0xc6a589['isVisible']=!0x0;}['showLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x0);}['hideLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x1);}['showError'](_0x5d30a3){if(this['errorView']){const _0x32dc19=this['errorView']['element']?.['querySelector']('.ck-ai-suggestion__error-text');_0x32dc19&&(_0x32dc19['textContent']=_0x5d30a3),this['isErrorVisible']=!0x0;}}['hideError'](){this['errorView']&&(this['isErrorVisible']=!0x1);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['setErrorState'](){this['miniToolbarView']&&(this['miniToolbarView']['isLoading']=!0x0),this['headerView']?.['showChangesToggleView']&&(this['headerView']['showChangesToggleView']['isEnabled']=!0x1);}['clearErrorState'](){this['miniToolbarView']&&(this['miniToolbarView']['isLoading']=!0x1),this['headerView']?.['showChangesToggleView']&&(this['headerView']['showChangesToggleView']['isEnabled']=!0x0);}['addNavigationItem'](_0x5877ab){this['miniToolbarView']['items']['add'](_0x5877ab);}['removeNavigationItem'](_0x4a42f7){this['miniToolbarView']['items']['remove'](_0x4a42f7);}['_createLoaderView'](){const _0x10c3f7=new _0x3b9d21(this['locale']),_0x1ce397=new Pe('small');_0x1ce397['isVisible']=!0x0;const _0x48637a=new _0x3b9d21(this['locale']);return _0x48637a['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[C(this['locale'],'AI_CHAT_IS_WRITING')]}),_0x10c3f7['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isLoaderVisible','ck-hidden',_0x4e8248=>!_0x4e8248)]},'children':[_0x1ce397,_0x48637a]}),_0x10c3f7;}['_createErrorView'](){const _0x160be9=new _0x3b9d21(this['locale']),_0x4a97cf=new _0x3b9d21(this['locale']);return _0x4a97cf['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[C(this['locale'],'AI_CHAT_GENERIC_ERROR')]}),_0x160be9['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0xba1e42=>!_0xba1e42)]},'children':[_0x4a97cf]}),_0x160be9;}}class Sr extends _0x3b9d21{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x416728,_0x551de6){super(_0x416728),this['bodyCollection']=_0x551de6,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',_0x58db46=>!_0x58db46)]},'children':this['children']});const _0x5bc0f1=new _0x3b9d21(this['locale']),_0x224d77=new _0x53ac42();_0x224d77['content']=_0x51773c,_0x5bc0f1['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x224d77,{'tag':'span','children':[{'text':C(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x5bc0f1),this['_setupBalloonPanel'](_0x416728);}['_setupBalloonPanel'](_0x337179){this['balloonPanelView']=new _0x509620(_0x337179),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class Rr extends _0x5ee277{['balloonPanelView'];['source'];constructor(_0x66c397,_0x1dab49,_0x3a64c1){super(_0x66c397),this['source']=_0x1dab49,this['balloonPanelView']=_0x3a64c1,this['set']({'label':_0x1dab49['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0xc914e=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0xc914e['to'](()=>{window['open'](_0x1dab49['url'],'_blank');}),'mouseenter':_0xc914e['to'](()=>{this['_showTooltip']();}),'mouseleave':_0xc914e['to'](()=>{this['_hideTooltip']();})}}),_0x1dab49['favicon']){const _0x170c62=new _0x3b9d21(_0x66c397);_0x170c62['setTemplate']({'tag':'img','attributes':{'src':_0x1dab49['favicon']||_0x51773c,'alt':_0x1dab49['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x170c62);}else this['set']('icon',_0x51773c);}['_createTooltipContentView'](_0x4671a7,_0x403847){const _0x5e43fd=new _0x3b9d21(_0x4671a7),_0x22f3dd=[];let _0x508c8c;_0x403847?.['favicon']?(_0x508c8c=new _0x3b9d21(_0x4671a7),_0x508c8c['setTemplate']({'tag':'img','attributes':{'src':_0x403847['favicon'],'alt':_0x403847['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x508c8c=new _0x53ac42(),_0x508c8c['content']=_0x51773c,_0x508c8c['extendTemplate']({'attributes':{'alt':_0x403847['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x22f3dd['push'](_0x508c8c);const _0x10de42=new _0x3b9d21(_0x4671a7);_0x10de42['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x403847['url']},'children':[{'text':new URL(_0x403847['url'])?.['hostname']}]}),_0x22f3dd['push'](_0x10de42);const _0x45c6ce=new _0x3b9d21(_0x4671a7);_0x45c6ce['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x22f3dd});const _0x3c6ec0=new _0x3b9d21(_0x4671a7);return _0x3c6ec0['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x403847['title']['length']>0x190?_0x403847['title']['substring'](0x0,0x190)+'...':_0x403847['title']}]}),_0x5e43fd['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x45c6ce,_0x3c6ec0]}),_0x5e43fd;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[_0x509620['defaultPositions']['northArrowSouth'],_0x509620['defaultPositions']['northArrowSouthWest'],_0x509620['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 _0x235ae8=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x235ae8);}}class ls extends _0x42835a{constructor(_0x25fc1e,_0x55e93a=!0x0,_0x56e1a4=!0x0){super(_0x25fc1e),this['set']('isLoading',!0x1),_0x55e93a&&(this['applyButton']=this['_createButton'](C(_0x25fc1e,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x57806f=>!_0x57806f),this['items']['add'](this['applyButton'])),_0x56e1a4&&(this['suggestButton']=this['_createButton'](C(_0x25fc1e,'AI_BALLOON_SUGGEST_BUTTON'),_0x55e93a?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this,'isLoading',_0x2be879=>!_0x2be879),this['items']['add'](this['suggestButton'])),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['_createButton'](_0x3e0b3f,_0xe3c93){const _0x2d9f46=new _0x5ee277(this['locale']);return _0x2d9f46['set']({'label':_0x3e0b3f,'class':_0xe3c93||'','isVisible':!0x0,'withText':!0x0}),_0x2d9f46;}}class us extends _0x3b9d21{constructor(_0x22bebe){super(_0x22bebe),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':C(_0x22bebe,'AI_DISCLAIMER_TEXT')}]}]});}}const fs=['wheel','touchstart','pointerdown','keydown'],Fs=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class gs{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x4f5656){this['element']=_0x4f5656,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x49322e of fs){const _0x4f2134='keydown'!==_0x49322e;this['element']['addEventListener'](_0x49322e,this['_onUserEvent']['bind'](this),{'passive':_0x4f2134,'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'](_0x15df56){if(this['isRunning']){if('keydown'===_0x15df56['type']){const _0x5cd841=_0x15df56['key'];if(!Fs['includes'](_0x5cd841))return;}_0x15df56 instanceof WheelEvent?_0x15df56['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x20d3d5,scrollHeight:_0x13ccd3,clientHeight:_0x4c7762}=this['element'];return _0x13ccd3-_0x20d3d5-_0x4c7762<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}const it=['applySuggestion','insertSuggestion','showNext','showPrevious'];class ot extends _0x3b9d21{['focusTracker'];['keystrokes'];['focusCycler'];['_availableActions'];['_focusables'];['_errorView'];['scrollManager'];constructor(_0x3c33ed,_0x3db140,_0x59df6e,_0x31228a){super(_0x3c33ed),this['_availableActions']=_0x59df6e,this['set']('isLoading',!0x1),this['set']('isTrackChangesOn',_0x31228a),this['set']('isErrorVisible',!0x1),this['set']('errorMessage',''),this['focusTracker']=new _0x5364ba(),this['keystrokes']=new _0x5593a8(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x1cce22({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x49e6be(),this['_addContentView'](_0x3db140['mainView']),this['_addDisclaimerView'](),this['_addToolbar'](_0x3db140['showApplyButton'],_0x3db140['showSuggestButton']),this['toolbar']['bind']('isLoading')['to'](this),this['_focusables']['clear'](),this['_focusables']['addMany']([this['toolbar']]),this['setTemplate']({'tag':'div','attributes':{'class':'ai-balloon-content'},'children':this['_dialogContent']}),this['on']('change:isTrackChangesOn',()=>{this['_dialogContent']['remove'](this['toolbar']),this['_addToolbar'](_0x3db140['showApplyButton'],_0x3db140['showSuggestButton']);});}['render'](){super['render']();for(const _0x47d6d6 of this['_focusables'])this['focusTracker']['add'](_0x47d6d6['element']);this['keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['scrollManager']&&this['scrollManager']['destroy']();}['focus'](_0x5c77f4){-0x1===_0x5c77f4?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['showError'](_0x24301f){this['_errorView']||(this['_errorView']=this['_createErrorView'](),this['_dialogContent']['addMany']([this['_errorView']],0x0)),this['errorMessage']=_0x24301f,this['isErrorVisible']=!0x0;}['hideError'](){this['isErrorVisible']=!0x1;}['showRecoverableError'](_0xd89f5d){this['showError'](_0xd89f5d);}['showBlockingError'](_0x284d62){this['showError'](_0x284d62),this['toolbar']&&(this['toolbar']['applyButton']&&(this['toolbar']['applyButton']['isEnabled']=!0x1),this['toolbar']['suggestButton']&&(this['toolbar']['suggestButton']['isEnabled']=!0x1));}['setupRotator'](_0x319380){const _0x137d12=this['_createNextButtonView'](),_0x236394=this['_createPreviousButtonView']();_0x319380['view']['headerView']['children']['add'](_0x137d12,0x2),_0x319380['view']['headerView']['children']['add'](_0x236394,0x0),this['_focusables']['addMany']([_0x137d12,_0x236394]),this['focusTracker']['add'](_0x137d12['element']),this['focusTracker']['add'](_0x236394['element']);}['_addContentView'](_0x4e6089){this['_mainView']=_0x4e6089,this['_dialogContent']['add'](this['_mainView']);}['updateContent'](_0x949513){const _0x105ce1=this['_dialogContent']['getIndex'](this['_mainView']);this['_dialogContent']['remove'](this['_mainView']),this['_mainView']=_0x949513,this['_dialogContent']['add'](this['_mainView'],_0x105ce1),this['hideError'](),this['scrollManager']&&this['scrollManager']['destroy'](),this['_initializeScrollManager']();}['_addDisclaimerView'](){this['disclaimerView']=new us(this['locale']),this['_dialogContent']['add'](this['disclaimerView']);}['_addToolbar'](_0x5c04c4=!0x0,_0x176468=!0x0){_0x5c04c4=_0x5c04c4&&!this['isTrackChangesOn']&&this['_availableActions']['includes']('applySuggestion'),_0x176468=_0x176468&&this['_availableActions']['includes']('insertSuggestion'),this['toolbar']=new ls(this['locale'],_0x5c04c4,_0x176468),this['toolbar']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['toolbar']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_dialogContent']['add'](this['toolbar']);}['_createNextButtonView'](){const _0x595d4f=new _0x5ee277(this['locale']);return _0x595d4f['set']({'icon':_0x38fee0,'tooltip':C(this['locale'],'AI_BALLOON_NEXT_TOOLTIP')}),_0x595d4f['on']('execute',()=>{this['fire']('showNext');}),_0x595d4f;}['_createPreviousButtonView'](){const _0x30f830=new _0x5ee277(this['locale']);return _0x30f830['set']({'icon':_0x94bcdd,'tooltip':C(this['locale'],'AI_BALLOON_PREVIOUS_TOOLTIP')}),_0x30f830['on']('execute',()=>{this['fire']('showPrevious');}),_0x30f830;}['_createErrorView'](){const _0x290587=new _0x3b9d21(this['locale']),_0x29fb5d=new _0x3b9d21(this['locale']);return _0x29fb5d['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('errorMessage')}]}),_0x290587['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ai-balloon-error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0x403b8d=>!_0x403b8d)]},'children':[_0x29fb5d]}),_0x290587;}['startAutoScroll'](){this['_initializeScrollManager'](),this['scrollManager']&&this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']&&this['scrollManager']['stop']();}['_initializeScrollManager'](){const _0xdce5d6=this['_getScrollableElement']();_0xdce5d6&&!this['scrollManager']&&(this['scrollManager']=new gs(_0xdce5d6));}['_getScrollableElement'](){return this['_mainView']instanceof e&&this['_mainView']['bodyView']['element']?this['_mainView']['bodyView']['element']:null;}}const lt=0xa;class _ extends tt{static get['requires'](){return[s,l];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_config'];['_isUpdatingMarkers']=!0x1;['_pendingRenderCallback']=null;['open'](_0x7c33cb){const _0x25ba91=rt(this['context']);if(this['_config']=_0x7c33cb,this['isOpen'])return void this['_updateBalloon'](_0x7c33cb);const _0x3f14ce=this['context']['config']['get']('ai.availableReplyActions')||[...x],_0x5d6a27=_0x25ba91?.['commands']['get']('trackChanges'),_0x5b1272=_0x5d6a27?.['value'];this['balloonView']=new ot(_0x25ba91['locale'],_0x7c33cb,_0x3f14ce,!!_0x5b1272),this['balloonView']['delegate'](...it)['to'](this),_0x5d6a27&&this['balloonView']['bind']('isTrackChangesOn')['to'](_0x5d6a27,'value'),this['_showDialog'](_0x7c33cb);}['close'](){rt(this['context'])['plugins']['get']('Dialog')['hide']();}['startAutoScroll'](){this['balloonView']&&this['balloonView']['startAutoScroll']();}['stopAutoScroll'](){this['balloonView']&&this['balloonView']['stopAutoScroll']();}['_updateBalloon'](_0x1cdf66){const _0x445b32=rt(this['context']),_0x430fe2=_0x445b32['plugins']['get']('Dialog');this['_pendingRenderCallback']&&(_0x445b32['editing']['view']['off']('render',this['_pendingRenderCallback']),this['_pendingRenderCallback']=null),this['_isUpdatingMarkers']=!0x0,_0x430fe2['view']?.['headerView']&&(_0x430fe2['view']['headerView']['label']=_0x1cdf66['title'],_0x430fe2['view']['headerView']['iconView']&&_0x1cdf66['icon']&&(_0x430fe2['view']['headerView']['iconView']['content']=_0x1cdf66['icon'])),this['balloonView']['updateContent'](_0x1cdf66['mainView']),this['_setupVisualSelection'](_0x1cdf66['ranges'],_0x1cdf66['index']),this['_pendingRenderCallback']=()=>{this['_isUpdatingMarkers']=!0x1,this['_pendingRenderCallback']=null,_0x430fe2['view']&&_0x430fe2['view']['updatePosition']();},_0x445b32['editing']['view']['once']('render',this['_pendingRenderCallback']);}['_setupVisualSelection'](_0x2e3dfd,_0x5c6d05){this['context']['plugins']['get'](l)['showFakeVisualSelection'](_0x2e3dfd,'ai-balloon-'+_0x5c6d05,!0x0,!0x0);}['_showDialog'](_0x223a3a){const _0x2c8dca=rt(this['context']);this['_setupVisualSelection'](_0x223a3a['ranges'],_0x223a3a['index']);const _0xc7bc44=this['_getSelectionElements']();_0xc7bc44&&_0xc7bc44[0x0]&&at({'target':_0xc7bc44[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),_0x2c8dca['plugins']['get']('Dialog')['show']({'title':_0x223a3a['title'],'icon':_0x223a3a['icon'],'hasCloseButton':!0x0,'id':'aiBalloon','position':this['_calculateDialogPosition']['bind'](this),'className':'ai-balloon'+(_0x223a3a['showRotator']?'\x20ai-balloon-rotator':''),'content':this['balloonView'],'onShow':_0x1dce2b=>{_0x223a3a['showRotator']&&this['balloonView']['setupRotator'](_0x1dce2b),this['_setupMarkerRemovalListener'](),this['isOpen']=!0x0;},'onHide':()=>{this['context']['plugins']['get']('AIEditing')['hideFakeVisualSelection']('ai-balloon-'+this['_config']['index']),this['_cleanupMarkerRemovalListener'](),this['fire']('dialogClosed'),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x111a81,_0x6047da){if(!_0x6047da)return null;const _0x430333=this['_getSelectionElements']();if(!_0x430333||0x0===_0x430333['length'])return{'left':Math['round'](_0x6047da['left']+_0x6047da['width']/0x2-_0x111a81['width']/0x2),'top':Math['round'](_0x6047da['top']+_0x6047da['height']/0x2-_0x111a81['height']/0x2)};const _0x148a0c=Math['round'](_0x6047da['left']+_0x6047da['width']/0x2-_0x111a81['width']/0x2),_0x438d2f=new nt(_0x430333[0x0]),_0x5c96be=new nt(_0x430333[_0x430333['length']-0x1]),_0x528056=_0x111a81['height'],_0x4f5e7a=this['_config']['showRotator']?0x8:0x0;return{'left':_0x148a0c,'top':this['_calculateOptimalTopPosition'](_0x438d2f,_0x5c96be,_0x528056,_0x4f5e7a,_0x6047da)};}['_calculateOptimalTopPosition'](_0x561ad4,_0x3603ac,_0x3c6f2f,_0x551d75=0x0,_0x7d20ab){const _0x4711d3=_0x3c6f2f+_0x551d75,_0x100a11=new nt(et['window']),_0x1992f4=[_0x561ad4['getVisible'](),_0x3603ac['getVisible']()]['filter'](_0x557e42=>_0x557e42),_0x19872a=nt['getBoundingRect'](_0x1992f4);if(!_0x19872a)return Math['round'](_0x7d20ab['top']+_0x7d20ab['height']/0x2);const _0x398f4f=_0x100a11['getIntersection'](_0x19872a);if(!_0x398f4f)return Math['round'](_0x7d20ab['top']+_0x7d20ab['height']/0x2);const _0x10adf6=_0x7d20ab['getVisible'](),_0xd9ad68=_0x10adf6&&_0x19872a['height']>_0x10adf6['height'],_0x50ce19=_0x398f4f['top'],_0x5aabc1=_0x398f4f['bottom'];if(_0xd9ad68){const _0x1cd9ca=(_0x10adf6||_0x100a11)['height']/0x2-_0x4711d3/0x2,_0xad16cf=_0x50ce19-lt-_0x7d20ab['top'],_0x12246d=_0x7d20ab['bottom']-_0x5aabc1-lt;return _0xad16cf>=_0x4711d3?Math['max'](lt,_0x50ce19-_0x4711d3-lt):_0x12246d>=_0x4711d3?_0x5aabc1+lt:Math['max'](lt,_0x1cd9ca);}const _0xb2fb5=_0x50ce19-_0x4711d3,_0x3465ef=_0x7d20ab['bottom']-_0x5aabc1-lt,_0x4ac4c9=_0x50ce19-lt-_0x7d20ab['top'];let _0x4b9eee;if(_0x3465ef>=_0x4711d3)_0x4b9eee=_0x5aabc1+lt;else{if(_0x4ac4c9>=_0x4711d3)_0x4b9eee=_0xb2fb5-lt;else _0x4b9eee=_0x50ce19+_0x19872a['height']/0x2-_0x4711d3/0x2;}return _0x4b9eee;}['_setupMarkerRemovalListener'](){const _0x260ee6=rt(this['context']);this['listenTo'](_0x260ee6['model']['document'],'change',()=>{if(this['_isUpdatingMarkers'])return;for(const {name:_0x115e43,data:{newRange:_0x54a7e9}}of _0x260ee6['model']['document']['differ']['getChangedMarkers']())if(_0x115e43['startsWith']('ai-selection:')&&(_0x54a7e9&&(_0x54a7e9['start']['isEqual'](_0x54a7e9['end'])||'$graveyard'==_0x54a7e9['root']['rootName'])||null==_0x54a7e9)){const _0x1d0ae3=C(this['context']['locale'],'AI_ACTIONS_SELECTION_REMOVED_ERROR');this['balloonView']['showBlockingError'](_0x1d0ae3),this['fire']('selectionRemoved');}});}['_cleanupMarkerRemovalListener'](){const _0x37563a=rt(this['context']);this['stopListening'](_0x37563a['model']['document']);}['_getSelectionElements'](){const _0x29d5e0=rt(this['context']);return st(_0x29d5e0['editing'],[..._0x29d5e0['model']['markers']['getMarkersGroup']('ai-selection'),..._0x29d5e0['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class ct extends tt{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_batchToChanges']=new Map();['_previewedChangeGroup']=null;['_balloonShowDiff']=!0x1;['_bodyCollection'];static get['requires'](){return[s,_,_0x16a419];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new _0x57ac2d(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 ft({'connector':this['_aiConnector'],'availableModels':this['context']['config']['get']('ai.chat.models.displayedModels'),'defaultModelId':this['context']['config']['get']('ai.chat.models.defaultModelId'),'locale':this['context']['locale']});const _0x704b80=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x129a8b,_0x21d023)=>{this['_handleUIUserMessage']({'userMessage':_0x21d023});}),this['listenTo'](_0x704b80,'resizedTabs',(_0x235760,_0x586c3a)=>{this['_setIsMaximized'](_0x586c3a);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x704b80['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['activeConversation']?.['addCurrentDocumentToContext'](C(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x2515f3,_0x22bd41)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x22bd41));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x328898,_0x5dbcb0)=>{this['activeConversation']?.['addUrlToContext'](_0x5dbcb0);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x41d7c5,_0x310114)=>{this['activeConversation']?.['addResourceToContext'](_0x310114['source'],_0x310114['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x38b8bd,_0x2eaaab)=>{this['_removeFromContext'](_0x2eaaab);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x15cbeb,_0x3895f0)=>{this['activeConversation']?.['loadSourceResources'](_0x3895f0['sourceId'],_0x3895f0['query'],_0x3895f0['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x55a650,_0x151566)=>{this['activeConversation']?.['setModel'](_0x151566);}),this['listenTo'](this['_aiChatUi'],'like',(_0x15ba40,{replyId:_0x39b89c})=>{console['log']('Liked\x20response',_0x39b89c);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x4767dd,{replyId:_0x37c700})=>{console['log']('Disliked\x20response',_0x37c700);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0xb8990d,_0x431329)=>{this['context']['plugins']['get'](_)['close'](),this['_insertSuggestion'](_0x431329);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x388f14,{replyId:_0x47e8c8,partIndex:_0x1f0b3c})=>{this['_balloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x47e8c8,_0x1f0b3c);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x30912c,{replyId:_0x283d8b,partIndex:_0x3272b2})=>{const _0x59d096=this['_getDocumentRangeForReplyChanges'](_0x283d8b,_0x3272b2);_0x59d096&&'$graveyard'!=_0x59d096['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x59d096['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x1db220,_0x3ebcfa)=>{this['context']['plugins']['get'](_)['close'](),this['_applySuggestion'](_0x3ebcfa);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x4817b2,{replyId:_0xcee80,showDiff:_0x4fdf63})=>{const {reply:_0x426e46}=this['getInteractionAndReplyById'](_0xcee80),_0x59d616=_0x426e46['getContentParts']({'showDiff':_0x4fdf63});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x426e46['id'],'parts':_0x59d616,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x5d776c,{replyId:_0x3c3604,partIndex:_0x14ba0e})=>{this['_previewedChangeGroup']?.['replyId']==_0x3c3604&&this['_previewedChangeGroup']?.['partIndex']==_0x14ba0e&&this['context']['plugins']['get'](_)['close']();const {reply:_0x5df224}=this['getInteractionAndReplyById'](_0x3c3604);_0x5df224['setChangeGroupState'](_0x14ba0e,'rejected'),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');});}async['afterInit'](){this['context']instanceof ht?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x42fccb,_0xc5ed64)=>{_0xc5ed64['on']('ready',()=>{this['_integrateEditor'](_0xc5ed64);});}),await this['_startConversationSafely']();}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_insertSuggestion'](_0x183375){const _0x106b82=rt(this['context']);if(!_0x106b82['plugins']['has']('TrackChanges'))throw new _0x15f966('ai-no-track-changes',null);const _0x61efa7=this['context']['plugins']['get']('DocumentCompare'),{reply:_0xad7206,interaction:_0xe16257}=this['getInteractionAndReplyById'](_0x183375['replyId']),_0x34467c=this['_getDocumentRangeForReplyChanges'](_0x183375['replyId'],_0x183375['partIndex']),_0x55b3fb=void 0x0!==_0x183375['partIndex']?[_0xad7206['changeGroups'][_0x183375['partIndex']]]:_0xad7206['changeGroups']['filter'](_0x1c0323=>'pending'==_0x1c0323['state']),_0x26145c=_0x55b3fb['map'](_0x43784f=>_0xad7206['changeGroups']['indexOf'](_0x43784f));if(!_0x34467c||'$graveyard'==_0x34467c['range']['root']['rootName'])return void _0x26145c['forEach'](_0x1a1dad=>_0xad7206['setChangeGroupState'](_0x1a1dad,'outdated'));_0x26145c['forEach'](_0x2ba3aa=>_0xad7206['setChangeGroupState'](_0x2ba3aa,'accepted'));const _0x6efae=A({'editor':_0x106b82,'reply':_0xad7206,'interaction':_0xe16257,'groups':_0x55b3fb,'transform':!0x0,'documentCompare':_0x61efa7,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x3f6533;_0x34467c&&this['_scrollToSuggestionRange'](_0x34467c['range']),_0x106b82['model']['change'](_0x2ec902=>{_0x3f6533=_0x2ec902['batch'],_0x106b82['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x6efae),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x3f6533,{'interactionId':_0xe16257['id'],'replyId':_0xad7206['id'],'indexes':_0x26145c['slice']()}),this['_updateRatings'](_0xad7206);}['_applySuggestion'](_0x4e8a9c){const _0x1f35a7=rt(this['context']),_0x2c2f13=this['context']['plugins']['get'](_0x16a419),{reply:_0x1c199c,interaction:_0x29c3d7}=this['getInteractionAndReplyById'](_0x4e8a9c['replyId']),_0x2af0a=this['_getDocumentRangeForReplyChanges'](_0x4e8a9c['replyId'],_0x4e8a9c['partIndex']),_0x44df04=void 0x0!==_0x4e8a9c['partIndex']?[_0x1c199c['changeGroups'][_0x4e8a9c['partIndex']]]:_0x1c199c['changeGroups']['filter'](_0x4c1c58=>'pending'==_0x4c1c58['state']),_0x26b111=_0x44df04['map'](_0x261636=>_0x1c199c['changeGroups']['indexOf'](_0x261636));if(!_0x2af0a||'$graveyard'==_0x2af0a['range']['root']['rootName'])return void _0x26b111['forEach'](_0x4d61a3=>_0x1c199c['setChangeGroupState'](_0x4d61a3,'outdated'));_0x26b111['forEach'](_0x2b5233=>_0x1c199c['setChangeGroupState'](_0x2b5233,'accepted'));const _0x51a59d=A({'editor':_0x1f35a7,'reply':_0x1c199c,'interaction':_0x29c3d7,'groups':_0x44df04,'transform':!0x0,'documentCompare':_0x2c2f13,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x263c41;_0x2af0a&&this['_scrollToSuggestionRange'](_0x2af0a['range']),_0x1f35a7['model']['change'](_0xbc9325=>{_0x263c41=_0xbc9325['batch'];for(const _0x78ed57 of _0x51a59d)_0x78ed57['baseVersion']=_0x1f35a7['model']['document']['version'],v(_0x1f35a7,_0x78ed57),_0xbc9325['batch']['addOperation'](_0x78ed57),_0x1f35a7['model']['applyOperation'](_0x78ed57);}),this['_batchToChanges']['set'](_0x263c41,{'interactionId':_0x29c3d7['id'],'replyId':_0x1c199c['id'],'indexes':_0x26b111['slice']()}),this['_updateRatings'](_0x1c199c);}['_openBalloonFor'](_0x2ce2a2,_0x3b2dd5){const _0x5cd6cc=rt(this['context']),_0x1fec5b=this['_getDocumentRangeForReplyChanges'](_0x2ce2a2,_0x3b2dd5),_0x20e573=this['context']['plugins']['get'](_);if(!_0x1fec5b)return void _0x20e573['close']();const {range:_0x3a4cd0,currentIndex:_0x484e4e}=_0x1fec5b;if('$graveyard'==_0x3a4cd0['root']['rootName']){const {reply:_0x323868}=this['getInteractionAndReplyById'](_0x2ce2a2);return _0x323868['setChangeGroupState'](_0x484e4e,'outdated'),void _0x20e573['close']();}if(this['_previewedChangeGroup']?.['replyId']==_0x2ce2a2&&this['_previewedChangeGroup']?.['partIndex']==_0x484e4e)return;this['stopListening'](_0x20e573),this['_previewedChangeGroup']={'replyId':_0x2ce2a2,'partIndex':_0x484e4e};let _0x37122d=_0x5cd6cc['config']['get']('ai.availableReplyActions')||[...x];_0x5cd6cc['plugins']['has']('TrackChanges')||(_0x37122d=_0x37122d['filter'](_0xd23522=>'insertSuggestion'!=_0xd23522));const _0x36a9d3=new e(_0x5cd6cc['locale'],{'showDiff':this['_balloonShowDiff'],'areActionsDisabled':!0x1,'miniToolbarConfig':{'showChanges':'full'},'hideHeader':!0x0,'availableActions':_0x37122d},this['_bodyCollection']);this['stopListening'](_0x36a9d3);const {reply:_0x1bcbb6}=this['getInteractionAndReplyById'](_0x2ce2a2),_0x57e269=_0x1bcbb6['getContentParts']({'showDiff':this['_balloonShowDiff']})['filter'](_0xc5fe32=>_0xc5fe32['hasChanges']),_0x48cdf2=_0x57e269['findIndex'](_0x486939=>_0x486939['index']==_0x484e4e);if(-0x1==_0x48cdf2)return;const _0x216ce0=_0x57e269[_0x48cdf2],_0x830b8e=_0x57e269['at']((_0x48cdf2-0x1)%_0x57e269['length'])?.['index'],_0x2f648a=_0x57e269['at']((_0x48cdf2+0x1)%_0x57e269['length'])?.['index'];_0x36a9d3['updateContent']({'parts':[_0x216ce0],'renderingStrategy':'static'});const _0x1bbd37=_0x484e4e!==_0x830b8e;this['_scrollToSuggestionRange'](_0x3a4cd0,!0x0),_0x20e573['open']({'index':_0x484e4e,'title':C(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x48cdf2+0x1)['toString']()),'icon':vt,'mainView':_0x36a9d3,'showRotator':_0x1bbd37,'showApplyButton':!0x0,'showSuggestButton':_0x5cd6cc['plugins']['has']('TrackChanges'),'ranges':[_0x3a4cd0]}),this['_aiChatUi']['scrollFeedToSuggestion'](_0x2ce2a2,_0x484e4e),this['listenTo'](_0x36a9d3,'toggleSuggestionDisplayMode',(_0x3ddae3,{showDiff:_0x2be492})=>{this['_balloonShowDiff']=_0x2be492;const {reply:_0x61ab87}=this['getInteractionAndReplyById'](_0x2ce2a2),_0x87fe02=_0x61ab87['getContentParts']({'showDiff':_0x2be492,'groupIndex':_0x484e4e});_0x36a9d3['updateContent']({'parts':_0x87fe02,'renderingStrategy':'static'});}),this['listenTo'](_0x20e573,'applySuggestion',()=>{this['_applySuggestion']({'replyId':_0x2ce2a2,'partIndex':_0x484e4e}),_0x1bbd37?this['_openBalloonFor'](_0x2ce2a2,_0x2f648a):_0x20e573['close']();}),this['listenTo'](_0x20e573,'insertSuggestion',()=>{this['_insertSuggestion']({'replyId':_0x2ce2a2,'partIndex':_0x484e4e}),_0x1bbd37?this['_openBalloonFor'](_0x2ce2a2,_0x2f648a):_0x20e573['close']();}),_0x1bbd37&&(this['listenTo'](_0x20e573,'showNext',()=>{this['_openBalloonFor'](_0x2ce2a2,_0x2f648a);}),this['listenTo'](_0x20e573,'showPrevious',()=>{this['_openBalloonFor'](_0x2ce2a2,_0x830b8e);})),this['listenTo'](_0x20e573,'dialogClosed',()=>{this['stopListening'](_0x20e573),this['stopListening'](_0x36a9d3),this['_previewedChangeGroup']=null;});}['_getDocumentRangeForReplyChanges'](_0x4daf63,_0x3631d9){const _0x2ecb39=rt(this['context']),{reply:_0x32490f,interaction:_0x3df690}=this['getInteractionAndReplyById'](_0x4daf63),_0x92a5dd=_0x32490f['changeGroups']['filter'](_0x58ae8e=>'pending'==_0x58ae8e['state']),_0x1d12c7=_0x92a5dd['map'](_0x4834a8=>_0x32490f['changeGroups']['indexOf'](_0x4834a8));void 0x0===_0x3631d9&&(_0x3631d9=_0x1d12c7[0x0]);const _0x2680eb=_0x1d12c7['indexOf'](_0x3631d9);if(-0x1==_0x2680eb)return null;const _0x1a75b2=_0x92a5dd[_0x2680eb],_0x253b1e=new wt([]),_0x3c6e12=new wt([]);for(const _0x55a5e7 of _0x1a75b2['changes'])if('removed'!=_0x55a5e7['type']&&_0x3c6e12['children']['push'](_0x55a5e7['node']['cloneNode'](!0x0)),'new'!=_0x55a5e7['type']){const _0x3de3e6=At(_0x57338c=>yt(_0x57338c,'data-id')==_0x55a5e7['id'],_0x32490f['documentContextContent'],!0x0);_0x253b1e['children']['push'](_0x3de3e6['cloneNode'](!0x0));}if(0x0==_0x253b1e['children']['length']){if(_0x1a75b2['changes'][0x0]['anchorId']){const _0x2f4857=St('data-id',_0x1a75b2['changes'][0x0]['anchorId'],_0x32490f['documentContextContent']);_0x253b1e['children']['unshift'](_0x2f4857['cloneNode'](!0x0)),_0x3c6e12['children']['unshift'](_0x2f4857['cloneNode'](!0x0)),_0x2f4857['nextSibling']&&(_0x253b1e['children']['push'](_0x2f4857['nextSibling']['cloneNode'](!0x0)),_0x3c6e12['children']['push'](_0x2f4857['nextSibling']['cloneNode'](!0x0)));}else{const _0x298ca1=_0x32490f['documentContextContent']['children'][0x0];if(!_0x298ca1)return null;_0x253b1e['children']['push'](_0x298ca1['cloneNode'](!0x0)),_0x3c6e12['children']['push'](_0x298ca1['cloneNode'](!0x0));}}const _0x2fa916=_0x3df690['getDocumentContext'](),_0x477b8c=_0x2ecb39['data']['parse'](_0x2fa916['content'],'$root'),_0x3063de=Et(_0x253b1e),_0x348802=_0x2ecb39['data']['parse'](_0x3063de),_0x3aa432=_0x2ecb39['data']['parse'](_0x3063de),_0x38ceac=_0x2ecb39['model']['createPositionAt'](_0x348802,0x0),_0x626ea1=Et(_0x3c6e12),_0x1e51a1={'anchor':_0x38ceac,'markDeletions':!0x1,'context':'$root'},_0xb401ce=_0x2ecb39['plugins']['get'](_0x16a419)['getDiff'](_0x3063de,_0x626ea1,_0x1e51a1)['getOperations']();if(!_0xb401ce['length'])return null;_0x2ecb39['model']['change'](_0x250373=>{for(const _0x221be1 of _0xb401ce)if('remove'==_0x221be1['type']){const _0x9deed=_0x221be1['sourcePosition'],_0x5028da=_0x221be1['howMany'],_0x252320=new _0x19ceb4(_0x9deed,_0x5028da);_0x250373['batch']['addOperation'](_0x252320),_0x2ecb39['model']['applyOperation'](_0x252320);}else'marker'!==_0x221be1['type']&&(_0x221be1['baseVersion']=null,_0x221be1['isDocumentOperation']=!0x1,_0x250373['batch']['addOperation'](_0x221be1),_0x2ecb39['model']['applyOperation'](_0x221be1));});const _0x293963=It(_0x2ecb39,_0xb401ce,_0x348802);Tt(_0x2ecb39['model'],_0x293963);const _0xadbd33=_0x293963['getFirstRange']()['start']['path']['slice'](),_0x9ff17d=_0x293963['getFirstRange']()['end']['path']['slice'](),_0x3321e5=[];let _0x10bc1c=_0x348802,_0x3af32a=_0x3aa432;for(let _0x1dc5c0=0x0;_0x1dc5c0<_0x9ff17d['length'];_0x1dc5c0++){const _0x3eb41d=_0x10bc1c['maxOffset']-_0x9ff17d[_0x1dc5c0];_0x3321e5[_0x1dc5c0]=_0x3af32a['maxOffset']-_0x3eb41d,_0x10bc1c=_0x10bc1c['getChildAtOffset'](_0x9ff17d[_0x1dc5c0]),_0x3af32a=_0x3af32a['getChildAtOffset'](_0x3321e5[_0x1dc5c0]);}const _0x367a5f=_0x2ecb39['model']['createRange'](_0x2ecb39['model']['createPositionFromPath'](_0x3aa432,_0xadbd33),_0x2ecb39['model']['createPositionFromPath'](_0x3aa432,_0x3321e5)),_0x2ea0fe=_0x3aa432['getChild'](0x0)['getAttribute'](Ct),_0x1c63ce=Array['from'](_0x477b8c['getChildren']())['find'](_0x1fcf1f=>_0x1fcf1f['getAttribute'](Ct)==_0x2ea0fe)['getPath'](),_0x305878=_0x367a5f['start']['path']['slice'](),_0x570383=_0x367a5f['end']['path']['slice']();_0x305878[0x0]=_0x1c63ce[0x0]+_0x305878[0x0],_0x570383[0x0]=_0x1c63ce[0x0]+_0x570383[0x0];let _0x3b50bb=_0x2ecb39['model']['createRange'](_0x2ecb39['model']['createPositionFromPath'](_0x2ecb39['model']['document']['getRoot'](),_0x305878),_0x2ecb39['model']['createPositionFromPath'](_0x2ecb39['model']['document']['getRoot'](),_0x570383));const _0x44d03d=_0x2ecb39['model']['document']['history']['getOperations'](_0x2fa916['version']);for(const _0x4a435a of _0x44d03d)_0x3b50bb=_0x4a8fb1['_createFromRanges'](_0x3b50bb['getTransformedByOperation'](_0x4a435a));return{'range':_0x3b50bb,'currentIndex':_0x3631d9};}['_integrateEditor'](_0x2b07bf){if(!_0x2b07bf['plugins']['has']('Undo'))return;const _0x21a37a=_0x2b07bf['commands']['get']('undo'),_0x49660a=_0x2b07bf['commands']['get']('redo');this['listenTo'](_0x21a37a,'revert',(_0x4ec343,_0x48ebff,_0x205945)=>{const _0x4eed6a=this['_batchToChanges']['get'](_0x48ebff);if(!_0x4eed6a)return;const _0x9ef62d=this['activeConversation']['getInteraction'](_0x4eed6a['interactionId'])['getReply'](_0x4eed6a['replyId']);_0x4eed6a['indexes']['forEach'](_0x211d9e=>_0x9ef62d['setChangeGroupState'](_0x211d9e,'pending')),this['_batchToChanges']['delete'](_0x48ebff),this['_batchToChanges']['set'](_0x205945,_0x4eed6a);}),this['listenTo'](_0x49660a,'revert',(_0x305f34,_0x1bf223,_0x38d897)=>{const _0x2567a8=this['_batchToChanges']['get'](_0x1bf223);if(!_0x2567a8)return;const _0x2f81ca=this['activeConversation']['getInteraction'](_0x2567a8['interactionId'])['getReply'](_0x2567a8['replyId']);_0x2567a8['indexes']['forEach'](_0x34c2b0=>_0x2f81ca['setChangeGroupState'](_0x34c2b0,'accepted')),this['_batchToChanges']['delete'](_0x1bf223),this['_batchToChanges']['set'](_0x38d897,_0x2567a8);});}async['loadConversation'](_0x15b087){this['context']['plugins']['get'](_)['close'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']();try{await this['_aiConnector']['fetchConversation'](_0x15b087)['getConversation'](),await this['_startConversationSafely'](_0x15b087),this['updateConversationTitle']('\x20');const {sessionId:_0x278e8b}=this['_aiEditing']['getDocumentData']();await this['activeConversation']['load'](_0x15b087,_0x278e8b),this['activeConversation']['isCurrentDocumentInConversation']()&&this['activeConversation']['addCurrentDocumentToContext'](C(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}catch(_0x16b2e7){this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x15b087}),this['_logError'](new _0x15f966('ai-chat-conversation-not-found',this,{'error':_0x16b2e7}));}finally{this['context']['plugins']['get'](pt)['view']['activateTab']('chat'),this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['handleRemovedConversation'](_0x2fc912){this['activeConversation']['id']===_0x2fc912&&this['_startConversationSafely']();}async['addSelectionToChatContext'](){const _0x1528fb=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x1528fb),this['activeConversation']?.['addCurrentDocumentToContext'](C(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x59f2f3,quickActionData:_0x4e4a05}){await this['_handleUIUserMessage']({'userMessage':_0x59f2f3,'quickActionData':_0x4e4a05});}['getGroupId'](){const _0x40b4f5=this['context']['config']['get']('collaboration.channelId');if(!_0x40b4f5)throw new _0x15f966('ai-chat-missing-channel-id',this);return _0x40b4f5;}async['_startConversationSafely'](_0x13aba3){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x13aba3);}catch(_0x1ce8db){this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x13aba3||_0x53b360()}),console['error'](_0x1ce8db),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x2bf1dd){const _0x30321a=this['context']['plugins']['get'](_);let _0x396716;_0x30321a['isOpen']&&_0x30321a['close'](),_0x2bf1dd||!this['activeConversation']?_0x396716=this['context']['config']['get']('ai.chat.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x396716=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x5bf359=this['getGroupId'](),_0x2e8bfc=_0x2bf1dd||_0x53b360();this['activeConversation']=new ut({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x396716,'conversationId':_0x2e8bfc,'group':_0x5bf359,'getEditor':()=>rt(this['context'])}),this['activeConversation']['on']('conversationInitialized',(_0x38c765,_0x43916e)=>{this['_aiChatUi']['createConversation'](_0x43916e),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x2bf1dd||(this['_aiChatUi']['resetConversationTitle'](),this['activeConversation']?.['addCurrentDocumentToContext'](C(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT')));}),this['activeConversation']['on']('uploadProgressChanged',(_0x5e917a,_0x5541e7)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x5541e7['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x30c177,_0x2175d7)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x2175d7);}),this['activeConversation']['on']('webSearchStarted',()=>{this['_aiChatUi']['setLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningStarted',()=>{this['_aiChatUi']['setLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('webSearchFinished',(_0x2177d6,_0x34fd22)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x34fd22,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x4cc322,_0x4534bf)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x4534bf,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x50c0b1,_0x80627b)=>{this['_aiChatUi']['removeFeedInteraction'](_0x80627b['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x4a00c4,_0x37b4d9,_0x1e391a)=>{this['updateConversationTitle'](_0x37b4d9,_0x1e391a);}),this['activeConversation']['on']('replyCreated',(_0x4cb8d0,_0x303fdf)=>{'text-delta'===_0x303fdf['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x303fdf):this['_aiChatUi']['addFeedItemAISuggestion'](_0x303fdf);}),this['activeConversation']['on']('replyContentUpdated',async(_0x37e5b2,_0x548e77)=>{await this['_updateReplyContent']({'reply':_0x548e77});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x22b7eb,{reply:_0x2a1859,index:_0xb37b3e,state:_0x1c629a})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x2a1859['id'],'index':_0xb37b3e,'state':_0x1c629a});}),this['activeConversation']['on']('contextItemAdded',(_0x1a395c,_0x472cfd)=>{if(this['_aiChatUi']['addContextItem'](_0x472cfd['contextItem'],_0x472cfd['isLoading']),'selection'===_0x472cfd['contextItem']['type']){const _0x4ee29c=[...rt(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x4ee29c,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x17be6c,_0x479671)=>{this['_aiChatUi']['removeContextItem'](_0x479671['uiId']),'current-document'==_0x479671['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x479671['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x1f09e7,_0x5c8474)=>{this['_aiChatUi']['setContextItemLoading'](_0x5c8474['contextItem']['uiId'],_0x5c8474['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x4cfa44,_0x1f863f)=>{this['_aiChatUi']['setConversationContext'](_0x1f863f['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x910c5a,_0x2cd354)=>{this['_aiChatUi']['setAddContextOptions'](_0x2cd354['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x28ba76,_0x25f279)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x25f279['sourceId'],_0x25f279['source'],_0x25f279['resources'],_0x25f279['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0xf7c5f5,_0x27d727)=>{this['_aiChatUi']['updateResourceState'](_0x27d727['sourceId'],_0x27d727['resourceId'],_0x27d727['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x35c60e,_0x4b9ff5)=>{this['_aiChatUi']['updateCapabilities'](_0x4b9ff5);}),this['activeConversation']['on']('modelSelected',(_0x3a80d5,_0x2a34ae)=>{this['_aiChatUi']['setSelectedModel'](_0x2a34ae['selectedModel'],_0x2a34ae['isDisabled']);}),this['activeConversation']['on']('error',(_0x4caa81,{error:_0x1f1466,interactionId:_0x1496da,fileName:_0x5ef1cc,url:_0x36c91a,sourceId:_0x33d44e,sourceLabel:_0x2a78b6})=>{const _0x47897a=_0x1496da?_0x1496da+':'+_0x53b360():_0x53b360();_0x1f1466['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':C(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x47897a}):_0x1f1466['message']['startsWith']('ai-chat-conversation-init-failed')||_0x1f1466['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x47897a}),this['_logError'](_0x1f1466)):_0x1f1466['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x5ef1cc),'id':_0x47897a}):_0x1f1466['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x36c91a),'id':_0x47897a}):_0x1f1466['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x47897a}):_0x1f1466['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x47897a}):_0x1f1466['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x33d44e&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x33d44e),this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x2a78b6||'source'),'id':_0x47897a}),this['_logError'](_0x1f1466)):_0x1f1466['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x47897a}),this['_logError'](_0x1f1466)):_0x1f1466['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x47897a}),this['_logError'](_0x1f1466)):_0x1f1466['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x47897a}),this['_logError'](_0x1f1466)):_0x1f1466['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x47897a}),this['_logError'](_0x1f1466)):_0x1f1466['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x47897a}),this['_logError'](_0x1f1466)):_0x1f1466['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x47897a}),this['_logError'](_0x1f1466)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x47897a}),this['_logError'](_0x1f1466));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x2bf1dd||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x481e47,quickActionData:_0x327dd9}){if(!this['activeConversation'])throw new _0x15f966('ai-chat-controller-no-active-conversation');this['activeConversation']['isCurrentDocumentInContext']()&&await this['activeConversation']['updateCurrentDocumentInContext'](this['_aiEditing']['getDocumentData']()),this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x481e47,'quickActionData':_0x327dd9}),this['_removeAISelectionMarkers']();}['_removeAISelectionMarkers'](){const _0x4dee1b=rt(this['context'])['model'],_0x2943e7=Array['from'](_0x4dee1b['markers']['getMarkersGroup'](_t));_0x4dee1b['change'](_0x4d3b1e=>{_0x2943e7['forEach'](_0x3f56f0=>_0x4d3b1e['removeMarker'](_0x3f56f0));});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0xaaa2d7){this['_aiChatUi']['setIsMaximized'](_0xaaa2d7);}['_logError'](_0x1e3330){gt(_0x1e3330['message']);}['_removeFromContext'](_0x53bca9){this['activeConversation']?.['removeFromContext'](_0x53bca9);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x56fa02){const [_0x1b5f8d,_0x591624]=_0x56fa02['split'](':'),_0x3e9870=this['activeConversation']['getInteraction'](_0x1b5f8d),_0x14a2b0=_0x3e9870['getReply'](_0x591624);return{'interaction':_0x3e9870,'reply':_0x14a2b0};}['_scrollToSuggestionRange'](_0x418854,_0x1de161=!0x1){const _0x7e13da=rt(this['context']),_0x2321cd={'target':_0x7e13da['editing']['view']['domConverter']['viewRangeToDom'](_0x7e13da['editing']['mapper']['toViewRange'](_0x418854)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x1de161};_0x1de161&&(_0x2321cd['alignToTop']=!0x0),at(_0x2321cd);}['updateConversationTitle'](_0x17455b,_0x4d1e17=!0x1){this['_aiChatUi']['setConversationTitle'](_0x17455b||C(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x4d1e17);}async['_updateReplyContent']({reply:_0x4d1e33,renderingStrategy:_0x55f6bd}){const {id:_0x4152f0,isDone:_0x3bb2b8,type:_0x2aa937,parsedContent:_0xe8f1f6}=_0x4d1e33;if('modification-delta'===_0x2aa937){const _0x2d64af=_0x4d1e33['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x4152f0,'parts':_0x2d64af,'renderingStrategy':_0x55f6bd,'isDone':_0x3bb2b8});}else'text-delta'===_0x2aa937&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x4152f0,'parsedContent':_0xe8f1f6,'renderingStrategy':_0x55f6bd,'isDone':_0x3bb2b8});_0x3bb2b8&&_0x4d1e33['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x4152f0,_0x4d1e33['sources']);}async['_stopLastInteraction'](){const _0x582b62=this['activeConversation']?.['lastInteraction'];_0x582b62&&(_0x582b62['stop'](),this['_aiChatUi']['stopInteraction'](_0x582b62));}async['_flushLastInteractionUI'](){const _0x5431fa=this['activeConversation']?.['lastInteraction'];if(_0x5431fa){for await(const _0x22ae4e of _0x5431fa['replies'])await this['_updateReplyContent']({'reply':_0x22ae4e,'renderingStrategy':'static'});}}['_updateRatings'](_0x74b710){const _0x9eedd4={'positiveCount':_0x74b710['changeGroups']['filter'](_0x338697=>'accepted'===_0x338697['state'])['length'],'totalCount':_0x74b710['changeGroups']['length'],'modificationId':_0x74b710['id']},_0x136551=this['activeConversation']['getInteraction'](_0x74b710['interactionId'])['messageId'];this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x136551,_0x9eedd4);}}const Lt=[...Ee,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class Le extends Fr{['containerView'];['actionsView'];constructor(_0x4cb0d8,_0x540703,_0x43e782){super(_0x540703),this['set']('isTrackChangesOn',!0x1),this['containerView']=new e(_0x4cb0d8,{'showDiff':_0x540703['showDiff'],'areActionsDisabled':_0x540703['areActionsDisabled'],'availableActions':_0x540703['availableActions']},_0x43e782),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x113b91,_0x4dd117)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x4dd117['showDiff']});}),this['containerView']['on']('like',()=>{this['fire']('like',{'replyId':this['options']['id']});}),this['containerView']['on']('dislike',()=>{this['fire']('dislike',{'replyId':this['options']['id']});}),this['containerView']['on']('showChangeInText',(_0x3dc46f,{index:_0x69c025})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x69c025});}),this['containerView']['on']('insertSuggestion',(_0x3c97b2,{index:_0x403828})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x403828});}),this['containerView']['on']('rejectSuggestion',(_0x5d807c,{index:_0xc83dbc})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0xc83dbc});}),this['containerView']['on']('mouseOverSuggestion',(_0x3cadf8,{index:_0x1237ee})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x1237ee});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x7f226f,{index:_0x983fb5})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x983fb5});}),this['actionsView']=new ah(_0x4cb0d8,this['options']['availableActions']),this['actionsView']['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn'),this['actionsView']['on']('showChangeInText',()=>{this['fire']('showChangeInText',{'replyId':this['options']['id']});}),this['actionsView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'replyId':this['options']['id']});}),this['actionsView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'replyId':this['options']['id']});}),_0x540703['areActionsDisabled']?this['actionsView']['isEnabled']=!0x1:this['actionsView']['bind']('isEnabled')['to'](this['containerView']['bodyView'],'hasPendingParts'),this['children']['addMany']([this['containerView'],this['actionsView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x58b5f0){await this['containerView']['updateContent'](_0x58b5f0),this['actionsView']['updateLabels'](this['containerView']['bodyView']['partsCount']);}['updatePartState'](_0x535947,_0x5e6405){this['containerView']['bodyView']['updatePartState'](_0x535947,_0x5e6405);}['updateSources'](_0x191fb4){this['containerView']['updateSources'](_0x191fb4);}['getPartView'](_0x2323a2){return this['containerView']['bodyView']['getPartView'](_0x2323a2);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone'](),this['actionsView']['isVisible']=this['containerView']['bodyView']['hasNonEmptyParts'];}}class Ve extends Fr{['replyContainer'];['_bodyCollection'];constructor(_0x15e510,_0x53a968,_0x901da3){super(_0x53a968),this['_bodyCollection']=_0x901da3,this['locale']=_0x15e510,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x3b9d21(),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':Ue(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x301960,renderingStrategy:_0x534302,abortSignal:_0x4b52d9}){'streaming'===_0x534302?await this['streamIntoElement'](_0x301960,this['replyContainer']['element'],_0x4b52d9):this['replyContainer']['element']['innerHTML']=_0x946802(_0x301960);}['updateSources'](_0x8181e8){const _0x510893=new Sr(this['locale'],this['_bodyCollection']);_0x510893['children']['addMany'](_0x8181e8['map'](_0x216e59=>new Rr(this['locale'],_0x216e59,_0x510893['balloonPanelView']))),_0x510893['isVisible']=!0x0,this['children']['add'](_0x510893);}}const xn={'file':_0x27ae23,'document':_0x1fedc8,'web-resource':_0x5414da,'text':_0x27ae23,'selection':_0x27c312},$r='ck-ai-chat-context-chip',Qr='ck-ai-chat-context-chip_wide',Zr='ck-ai-chat-context-chip_document',ra='ck-ai-chat-context-chip__label',oa='ck-ai-chat-context-chip__type-icon',ca='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class Bo extends _0x5ee277{constructor(_0x4ff01e,_0x2f2afc,_0x5a1f69,_0x5ded42,_0x3ee910=!0x1){super(_0x4ff01e),this['_isAnimationOnEnterEnabled']=_0x5ded42,this['_initializeProperties'](_0x2f2afc,_0x5a1f69,_0x3ee910),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'](_0x3830d2,_0x87070f,_0x2bcae2){this['set']('label',_0x3830d2['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x3830d2['type']),this['set']('id',_0x3830d2['uiId']),this['set']('readonly',_0x87070f),this['set']('isLoading',_0x2bcae2);}['_setupTemplate'](){const _0xf25bf7=this['_createIconView'](),_0x55e290=this['_createRemoveButton'](),_0x1bc592=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x1bc592),'children':this['_createTemplateChildren'](_0xf25bf7,_0x55e290,_0x1bc592)});}['_createTemplateAttributes'](_0x180a1d){return{'class':[$r,_0x180a1d['if']('itemType',Zr,_0x4e9255=>'document'==_0x4e9255),_0x180a1d['if']('itemType',Qr,_0x1d363b=>'selection'==_0x1d363b)],'data-cke-tooltip-text':_0x180a1d['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':ca};}['_createTemplateChildren'](_0x77285,_0x9a9b21,_0x9b4c31){const _0x5a350e=this['_createLabelElement'](_0x9b4c31),_0x3ae948=this['_createLoaderIcon']();return this['readonly']?[_0x77285,_0x5a350e]:[_0x77285,_0x3ae948,_0x5a350e,_0x9a9b21];}['_createLabelElement'](_0x1354fe){return{'tag':'span','attributes':{'class':ra},'children':[{'text':_0x1354fe['to']('label')}]};}['_createRemoveButton'](){const _0x29e904=new _0x5ee277(this['locale']);return _0x29e904['set']({'label':C(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0xfae8d0}),this['_setupRemoveButtonEvent'](_0x29e904),_0x29e904;}['_setupRemoveButtonEvent'](_0x2b9fd6){_0x2b9fd6['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x1d6ee7=this['bindTemplate'],_0x1fc413=new _0x53ac42();return _0x1fc413['content']=xn[this['itemType']],_0x1fc413['extendTemplate']({'attributes':{'class':[oa,_0x1d6ee7['if']('isLoading','ck-hidden',_0x79e75=>_0x79e75)]}}),_0x1fc413;}['_handleAnimationEndOnce'](_0x152118,_0x3448c5){if(!_0x152118)return;const _0x31d23e=()=>{_0x3448c5(),_0x152118['removeEventListener']('animationend',_0x31d23e),_0x152118['removeEventListener']('webkitAnimationEnd',_0x31d23e);};_0x152118['addEventListener']('animationend',_0x31d23e),_0x152118['addEventListener']('webkitAnimationEnd',_0x31d23e);}['_createLoaderIcon'](){const _0x870e9c=new Pe('small');return _0x870e9c['bind']('isVisible')['to'](this,'isLoading',_0x53e3c5=>_0x53e3c5),_0x870e9c;}}function In(_0x84630){if(!_0x84630)return _0x84630;if(_0x84630['length']<=0x78)return _0x84630;const _0x288e19=_0x84630['slice'](0x0,0x78),_0x73c39e=_0x288e19['lastIndexOf']('\x20');return(_0x73c39e>0x0?_0x288e19['slice'](0x0,_0x73c39e):_0x288e19)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},an='300px';class To{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x42d180,_0x4083d4,_0x5254fd,_0x56559f,_0x58c534){this['_locale']=_0x42d180,this['_visibleChips']=_0x4083d4,this['_config']={...hn,..._0x5254fd,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x5254fd['cssClasses']}},this['_overflowChips']=new _0x39615e(),this['_bodyCollection']=_0x56559f,this['_parentView']=_0x58c534||null;}['setContainerElement'](_0x14b08e){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x14b08e,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 _0x1673f6=[...this['_visibleChips'],...this['_overflowChips']],_0x18cbc3=this['_createCalculationContainer'](),_0x56a3c2=this['_calculateOverflowInContainer'](_0x18cbc3,_0x1673f6),_0x4a3a27=_0x18cbc3['_ancestorsToRestore'];_0x4a3a27&&this['_restoreAncestorVisibility'](_0x4a3a27),_0x18cbc3['remove'](),this['_applyOverflowResults'](_0x1673f6,_0x56a3c2);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x3685ee({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x2c7f1e=new _0x5ee277(this['_locale']);_0x2c7f1e['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x38a687=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x38a687['push'](this['_config']['cssClasses']['controlsButton']),_0x2c7f1e['extendTemplate']({'attributes':{'class':_0x38a687}}),_0x2c7f1e;}['_createShowMoreBalloonPanelView'](){const _0x424dc8=new _0x509620(this['_locale']);return _0x424dc8['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x424dc8),_0x424dc8;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x26e614=>{_0x26e614['disableAnimationOnEnter']();});const _0x4b84ff=new _0x3b9d21(this['_locale']);_0x4b84ff['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x4b84ff);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x2e3fc2=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x2e3fc2?'':'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'](_0x5d84c0){const _0x183498=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x3c76e2=this['_containerElement']?.['classList'];if(_0x3c76e2){const _0x42d7ff=_0x3c76e2[0x0]||'',_0x2de63b=_0x5d84c0['querySelector']('.'+_0x42d7ff),_0x53405a=_0x5d84c0['querySelector'](_0x183498);return _0x2de63b||_0x53405a||_0x5d84c0;}return _0x5d84c0['querySelector'](_0x183498)||_0x5d84c0;}['_calculateContainerWidth'](){const _0x30ce05=this['_parentView']?.['element']||this['_containerElement'];if(!_0x30ce05)return an;const _0x254ad3=window['getComputedStyle'](_0x30ce05)['width'];if('auto'===_0x254ad3||'0px'===_0x254ad3||!_0x254ad3){const _0x756870=_0x30ce05['parentElement'];if(_0x756870){const _0x377f60=window['getComputedStyle'](_0x756870);return'auto'!==_0x377f60['width']?_0x377f60['width']:an;}return an;}return _0x254ad3;}['_applyCalculationStyles'](_0x2f2c2e,_0x5cd292){this['_config']['cssClasses']['calculationContainer']&&_0x2f2c2e['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x2f2c2e['style']['width']=_0x5cd292,_0x2f2c2e['style']['position']='absolute',_0x2f2c2e['style']['top']='-9999px',_0x2f2c2e['style']['left']='-9999px',_0x2f2c2e['style']['opacity']='0',_0x2f2c2e['style']['pointerEvents']='none',_0x2f2c2e['style']['zIndex']='-1',_0x2f2c2e['style']['visibility']='visible\x20!important',_0x2f2c2e['style']['display']='block\x20!important',_0x2f2c2e['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x44b406){_0x44b406['forEach'](({element:_0x4c3ffb,originalDisplay:_0x42b043,originalVisibility:_0x15f12e})=>{_0x4c3ffb['style']['display']=_0x42b043,_0x4c3ffb['style']['visibility']=_0x15f12e;});}['_makeAncestorsVisible'](_0x51cf42){const _0xea64f9=[];let _0xc63a09=_0x51cf42;for(;_0xc63a09&&_0xc63a09!==document['body'];){const _0x485489=window['getComputedStyle'](_0xc63a09);'none'!==_0x485489['display']&&'hidden'!==_0x485489['visibility']||(_0xea64f9['push']({'element':_0xc63a09,'originalDisplay':_0xc63a09['style']['display'],'originalVisibility':_0xc63a09['style']['visibility']}),_0xc63a09['style']['display']='block',_0xc63a09['style']['visibility']='visible'),_0xc63a09=_0xc63a09['parentElement'];}return _0xea64f9;}['_createContainerElements'](){let _0xae6c05,_0xb28059;return this['_parentView']?.['element']?(_0xae6c05=this['_parentView']['element']['cloneNode'](!0x0),_0xb28059=this['_findTargetContainer'](_0xae6c05)):(_0xae6c05=document['createElement']('div'),_0xb28059=_0xae6c05),{'calculationContainer':_0xae6c05,'targetContainer':_0xb28059};}['_createCalculationContainer'](){const {calculationContainer:_0x20c9e4,targetContainer:_0x431f41}=this['_createContainerElements'](),_0x5a76c0=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x20c9e4,_0x5a76c0);const _0x2fd8b3=this['_parentView']?.['element']||this['_containerElement'],_0x535956=_0x2fd8b3?.['parentElement'];_0x535956?_0x535956['appendChild'](_0x20c9e4):document['body']['appendChild'](_0x20c9e4),_0x20c9e4['_targetContainer']=_0x431f41;const _0x5f317e=this['_makeAncestorsVisible'](_0x535956||null);return _0x20c9e4['offsetWidth'],_0x20c9e4['_ancestorsToRestore']=_0x5f317e,_0x20c9e4;}['_calculateOverflowInContainer'](_0x1fa58d,_0x521d8c){const _0x16c698=_0x1fa58d['_targetContainer']||_0x1fa58d,_0x5864fd=[],{rowCount:_0x18dbe7}=this['_renderChipsAndCountRows'](_0x16c698,_0x521d8c);if(_0x18dbe7<=this['_config']['maxVisibleRows'])return _0x5864fd;const _0x54ccf4=_0x521d8c['slice']();for(;_0x54ccf4['length']>0x0;){if(this['_testButtonFit'](_0x1fa58d,_0x16c698,_0x54ccf4)){const _0x59c584=_0x521d8c['filter'](_0x577ac8=>!_0x54ccf4['includes'](_0x577ac8));_0x5864fd['push'](..._0x59c584);break;}if(!_0x54ccf4['pop']())break;}return _0x5864fd;}['_renderChipsAndCountRows'](_0x1e7f97,_0x361a03){_0x1e7f97['innerHTML']='',_0x361a03['forEach'](_0x55554e=>{if(_0x55554e['element']){const _0x3b06ea=_0x55554e['element']['cloneNode'](!0x0);_0x1e7f97['appendChild'](_0x3b06ea);}}),_0x1e7f97['offsetWidth'];const _0x48f404=_0x1e7f97['children'],_0x5e64e5=[];return Array['from'](_0x48f404)['forEach'](_0x156220=>{const _0x9bac0=_0x156220['getBoundingClientRect']()['top'];_0x5e64e5['some'](_0x143887=>Math['abs'](_0x143887-_0x9bac0)<this['_config']['rowDetectionTolerance'])||_0x5e64e5['push'](_0x9bac0);}),{'rowCount':_0x5e64e5['length']};}['_createMockButton'](){const _0x2fa72f=document['createElement']('button');return _0x2fa72f['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x2fa72f['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x2fa72f['textContent']='+\x201',_0x2fa72f;}['_testButtonFit'](_0x124d1e,_0x4e5e0d,_0x14e183){this['_renderChipsAndCountRows'](_0x4e5e0d,_0x14e183);const _0x368887=this['_createMockButton']();_0x124d1e['appendChild'](_0x368887),_0x124d1e['offsetWidth'];const _0xfb72c=[..._0x4e5e0d['children'],_0x368887],_0x26218e=[];_0xfb72c['forEach'](_0x2aff12=>{const _0x444b93=_0x2aff12['getBoundingClientRect']()['top'];_0x26218e['some'](_0x379f14=>Math['abs'](_0x379f14-_0x444b93)<this['_config']['rowDetectionTolerance'])||_0x26218e['push'](_0x444b93);});const _0x5bd7ba=_0x26218e['length'];return _0x368887['remove'](),_0x5bd7ba<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x5af48a,_0x520b6e){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x5af48a['forEach'](_0x5d8afc=>{_0x520b6e['includes'](_0x5d8afc)?this['_overflowChips']['add'](_0x5d8afc):this['_visibleChips']['add'](_0x5d8afc);});}['_updateOverflowUI'](_0x382e37){if(_0x382e37>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x382e37>0x0&&this['_showMoreButtonView']){const _0x1e9183=''+this['_config']['showMoreLabelPrefix']+(_0x382e37<0x63?_0x382e37:'99');this['_showMoreButtonView']['label']=_0x1e9183;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x9c7af4,_0xc49d44){this['_distributeChips'](_0x9c7af4,_0xc49d44),this['_updateOverflowUI'](_0xc49d44['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x23457b=>{_0x23457b[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 _0xc20e8a=this['_containerElement']['getBoundingClientRect']();if(0x0===_0xc20e8a['width']||0x0===_0xc20e8a['height'])return!0x1;const _0xc4c254=window['innerHeight']||document['documentElement']['clientHeight'],_0x3d0a78=window['innerWidth']||document['documentElement']['clientWidth'],_0x55ed58=0xc8;return _0xc20e8a['bottom']>=-0xc8&&_0xc20e8a['top']<=_0xc4c254+_0x55ed58&&_0xc20e8a['right']>=-0xc8&&_0xc20e8a['left']<=_0x3d0a78+_0x55ed58;}}const la='ck-ai-chat__feed__context-chips',da='ck-ai-chat-context-chips-wrapper',ua='ck-ai-chat-context-chips-wrapper-balloon',_a='ck-ai-chat-controls-button',Ia='ck-ai-chat-controls_context_show-more-button',Aa='ck-ai-chat-context-controls__show-more-balloon-panel';class _h extends _0x3b9d21{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x1e9856,_0x432e11,_0x258f81){super(_0x1e9856),this['_bodyCollection']=_0x258f81,this['_createContextChips'](_0x432e11);const _0x47a6a1={'cssClasses':{'showMoreButton':Ia,'showMoreBalloon':Aa,'overflowContainer':ua,'controlsButton':_a}};this['_overflowManager']=new To(_0x1e9856,this['_contextChips'],_0x47a6a1,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[la,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':da},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x1e3e78=this['element']['querySelector']('.'+da);_0x1e3e78&&(this['_overflowManager']['setContainerElement'](_0x1e3e78),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x31d68c){for(const _0x5b3e46 of _0x31d68c){const _0xfd4d6a=new Bo(this['locale'],_0x5b3e46,!0x0,!0x1);this['_contextChips']['add'](_0xfd4d6a);}}}class Me extends Fr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x52999a,_0x1eb22e,_0x99f227){super(_0x1eb22e),this['_locale']=_0x52999a,this['_bodyCollection']=_0x99f227,this['_createContextChipsView'](),this['_createMessageContentView'](),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__user-message']}});}['_createContextChipsView'](){this['options']['contextItems']&&this['options']['contextItems']['length']>0x0&&(this['_contextChipsView']=new _h(this['_locale'],this['options']['contextItems']['filter'](_0x1d6dd4=>!_0x1d6dd4['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x3b9d21(this['_locale']),this['_messageContentView']['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__message-content'}}),this['children']['add'](this['_messageContentView']);}['render'](){super['render'](),this['_messageContentView']['element']['innerHTML']=this['options']['initialContent'],this['markAsDone']();}}class Ht extends Fr{['capabilities'];constructor(_0x47e87d,_0x354492){super(_0x354492);const {isWebSearchEnabled:_0xab6f85,isReasoningEnabled:_0xbf97e5}=_0x354492['capabilities'],_0x27512a=[];let _0x4cd707='';_0xab6f85&&_0xbf97e5?(_0x4cd707=C(_0x47e87d,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x27512a['push'](aa(_0x51773c)),_0x27512a['push'](aa(_0x2ab706))):_0xab6f85?(_0x4cd707=C(_0x47e87d,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x27512a['push'](aa(_0x51773c))):_0xbf97e5&&(_0x4cd707=C(_0x47e87d,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x27512a['push'](aa(_0x2ab706))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x4cd707?'':'ck-hidden']}});const _0x56195b=new _0x3b9d21();_0x56195b['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x27512a,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x4cd707]}]}),this['children']['add'](_0x56195b),this['capabilities']=_0x354492['capabilities'];}}function aa(_0x98c450){const _0x3ead7b=new _0x53ac42();return _0x3ead7b['content']=_0x98c450,_0x3ead7b;}class Oe extends _0x3b9d21{constructor(_0x51b60a,_0x1275be){super(_0x51b60a),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x1275be)});}['_createSkeletonItems'](_0x298be9){const _0x9293cc=['ck','ck-ai-skeleton__item'];return _0x298be9['map'](_0x31da56=>{let _0xcea0fb='';switch(_0x31da56['attributes']['align']){case'right':_0xcea0fb='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0xcea0fb='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0xcea0fb='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x31da56['tag'],'attributes':{'class':[..._0x9293cc,_0x31da56['attributes']['class']?_0x31da56['attributes']['class']:''],'style':'width:\x20'+_0x31da56['attributes']['width']+';\x20height:\x20'+_0x31da56['attributes']['height']+';'+_0xcea0fb}};});}}const Fe={'aiFeed':[{'tag':'div','attributes':{'width':'100%','height':'72px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}},{'tag':'div','attributes':{'width':'150px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'140px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}}],'aiHistory':ta(0x5,'100%','44px','right'),'aiChatResources':ta(0x8,'100%','24px','right'),'aiReviewChecks':[{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}}]};function ta(_0x1c6041,_0x129fd3,_0x15d0ea,_0xa62283){return new Array(_0x1c6041)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x129fd3,'height':_0x15d0ea,'align':_0xa62283}}));}class ji extends _0x3b9d21{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x38e72c,_0x1d18a6){super(_0x38e72c),this['_bodyCollection']=_0x1d18a6,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Lt)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new gs(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x340a0e,_0x4652fe){let _0x23d75d;'ai-reply'===_0x340a0e?_0x23d75d=new Ve(this['locale'],_0x4652fe,this['_bodyCollection']):'ai-suggestion-reply'===_0x340a0e?(_0x23d75d=new Le(this['locale'],_0x4652fe,this['_bodyCollection']),_0x23d75d['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn')):_0x23d75d='user-message'===_0x340a0e?new Me(this['locale'],_0x4652fe,this['_bodyCollection']):'interaction-header'===_0x340a0e?new Ht(this['locale'],_0x4652fe):new Ae(_0x4652fe),this['children']['add'](_0x23d75d);}async['updateReplyItem']({id:_0x9e04b9,parsedContent:_0x3647a3,renderingStrategy:_0x47f334,abortSignal:_0x11118d}){const _0x4a639a=this['getItemById'](_0x9e04b9);if(!(_0x4a639a instanceof Ve))throw new _0x15f966('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x4a639a,'id':_0x9e04b9,'parsedContent':_0x3647a3});await _0x4a639a['updateContent']({'parsedContent':_0x3647a3,'renderingStrategy':_0x47f334,'abortSignal':_0x11118d});}async['updateWebSources'](_0x157674,_0x318e0f){const _0x15ad72=this['getItemById'](_0x157674);if(_0x15ad72 instanceof Le)_0x15ad72['updateSources'](_0x318e0f);else{if(!(_0x15ad72 instanceof Ve))throw new _0x15f966('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x15ad72,'id':_0x157674,'sources':_0x318e0f});_0x15ad72['updateSources'](_0x318e0f);}}async['updateSuggestionItem']({id:_0x35b67b,parts:_0x188639,renderingStrategy:_0x389b0e,abortSignal:_0x4ae843}){const _0x4d306f=this['getItemById'](_0x35b67b);if(!(_0x4d306f instanceof Le))throw new _0x15f966('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x4d306f,'id':_0x35b67b,'parts':_0x188639});await _0x4d306f['updateContent']({'parts':_0x188639,'renderingStrategy':_0x389b0e,'abortSignal':_0x4ae843});}['updateSuggestionPartState']({id:_0x15ebc6,index:_0x3c633b,state:_0x5523eb}){const _0x71b8ad=this['getItemById'](_0x15ebc6);if(!(_0x71b8ad instanceof Le))throw new _0x15f966('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x15ebc6});_0x71b8ad['updatePartState'](_0x3c633b,_0x5523eb);}['markItemAsDone'](_0x58d501){this['getItemById'](_0x58d501)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x11bf8d=>_0x11bf8d['options']['id']);}['removeItem'](_0x42594f){this['children']['remove'](this['getItemById'](_0x42594f));}['scrollToSuggestion'](_0x126247,_0xdd94eb){const _0x3ca5fc=this['getItemById'](_0x126247);if(!(_0x3ca5fc instanceof Le))return void _0xc522eb('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x126247,'partIndex':_0xdd94eb});const _0x5eb877=_0x3ca5fc['getPartView'](_0xdd94eb);_0x5eb877?at({'target':_0x5eb877['element'],'ancestorOffset':0x14,'alignToTop':!0x0,'forceScroll':!0x0}):_0xc522eb('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x126247,'partIndex':_0xdd94eb});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x7f05e9=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x7f05e9,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x36ade8=new Oe(this['locale'],Fe['aiFeed']);return _0x36ade8['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x2b5338=>!_0x2b5338)]}}),_0x36ade8;}['_createFeedItems'](){const _0x34fc38=new _0x3b9d21(this['locale']);return _0x34fc38['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x34fc38;}['_createFeedLoader'](){const _0x56cdcb=new _0x3b9d21(this['locale']);return _0x56cdcb['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x124bda=>!_0x124bda)]},'children':this['_createLoaderChildren']()}),_0x56cdcb;}['_createLoaderChildren'](){const _0x52b263=new Pe();return _0x52b263['isVisible']=!0x0,[_0x52b263,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x212328){const _0x45de3f=this['children']['find'](_0x4791c9=>_0x4791c9['options']['id']['includes'](_0x212328));if(!_0x45de3f)throw new _0x15f966('ai-chat-feed-view-item-not-found',this,{'id':_0x212328});return _0x45de3f;}['setLoadingMessage'](_0x53ae77){this['set']('loadingMessage',_0x53ae77);}['toggleLoadingSkeleton'](_0x39a465){this['set']('isLoadingSkeletonVisible',_0x39a465);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class Br extends _0x40233d{['filter'](){let _0x33f7c3=0x0;for(const _0x575b76 of this['items'])_0x33f7c3+=_0x575b76['items']['length'];return{'resultsCount':_0x33f7c3,'totalItemsCount':_0x33f7c3};}}class ps extends _0x281705{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x3e4676,_0x5a0c43){super(_0x3e4676,{'queryView':{'label':'','creator':_0x9b759,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new Br(_0x3e4676),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x5a0c43,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=ps['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=ps['MAX_ROWS'],this['queryView']['fieldWrapperChildren']['add'](this['_addContextButtonView']),this['_setUpAddContextButtonPositioning'](),this['extendTemplate']({'attributes':{'class':['ck','ck-ai-chat__prompt-input']}}),this['submitButtonView']=this['_createSubmitButton'](),this['submitButtonView']['bind']('isEnabled')['to'](this,'isEmpty',this,'isUploadInProgress',(_0x3be0e8,_0x2d3609)=>!_0x3be0e8&&!_0x2d3609),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x5dbe8d,_0x51497c)=>{this['isUploadInProgress']||this['isEmpty']||_0x5dbe8d['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x51497c());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x3b1fe0=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x3b1fe0)return this['queryView']['errorText']=C(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x205c0e=_0x438ca2(_0x3b1fe0);this['fire']('sendUserMessage',_0x205c0e),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x2e4375){this['queryView']['fieldView']['set']('placeholder',_0x2e4375);}['_createSubmitButton'](){const _0x218855=new _0x5ee277(this['locale']);return _0x218855['set']({'icon':_0x9a394f,'label':C(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x218855['on']('execute',()=>{this['submit']();}),_0x218855;}['setIsUploadInProgress'](_0x39f8a1){this['isUploadInProgress']=_0x39f8a1;}['_setUpAddContextButtonPositioning'](){const _0x3cc98f=this['locale'],_0x5edc8e=()=>{et['window']['requestAnimationFrame'](()=>{if(_0x551023(this['element'])){const _0x256dc2=new nt(this['queryView']['fieldView']['element']),_0x4b44c3=new nt(this['_addContextButtonView']['element']),_0x350727=_0x256dc2['width'],_0x585f49='rtl'===_0x3cc98f['uiLanguageDirection']?'right':'left';_0x256dc2['excludeScrollbarsAndBorders']();const _0x54d36c=_0x350727-_0x256dc2['width']+0x1;this['_addContextButtonView']['element']['style'][_0x585f49]='calc('+(_0x350727-_0x4b44c3['width']-_0x54d36c)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x5edc8e),this['on']('render',()=>{_0x5edc8e(),this['_queryViewResizeObserver']=new _0x20b565(this['queryView']['fieldView']['element'],()=>{_0x5edc8e();});});}}const ga='ck-ai-chat__prompt-capabilities',ma='ck-ai-chat-controls-button',pa='ck-ai-chat-controls-button--commands',Ea='ck-ai-chat-controls__model-selection',Ta='ck-ai-chat-controls__model-selection__item-name',Ca='ck-ai-chat-controls__model-selection__item-description',wa='ck-ai-chat-controls__model-selection__item-capabilities',fa='n';class ms extends _0x3b9d21{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x305de4){super(_0x305de4),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelSelectorVisible',!0x0),this['set']('modelSelectorEnabled',!0x0),this['set']('activeModelId',null),this['set']('activeModelName',null),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelNameView']=this['_createModelNameView'](),this['_webSearchButton']=this['_createWebSearchButton'](),this['_reasoningButton']=this['_createReasoningButton'](),this['_commandsButton']=this['_createCommandsButton'](),this['_modelSelectionDropdown']['buttonView']['bind']('isVisible')['to'](this,'modelSelectorVisible',_0x57ac9b=>_0x57ac9b),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x341860=>_0x341860?this['_modelSelectionDropdown']['buttonView']['label']:C(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x5bfc26=>_0x5bfc26),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x5701aa=>_0x5701aa),this['_webSearchButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x486f5f=>!_0x486f5f),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x5d3edc=>C(this['locale'],_0x5d3edc?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x3a154d=>_0x3a154d),this['_reasoningButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x18e430=>!_0x18e430),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x3a9cdf=>C(this['locale'],_0x3a9cdf?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[ga]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x39615e(),_0x3c9480(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x1ff22f,_0x16138e){if(this['set']('modelSelectorVisible',!(_0x16138e&&_0x1ff22f['length']<=0x1)),this['_modelSelectionDropdownItems']['clear'](),_0x1ff22f?.['length'])for(const _0x3169d5 of _0x1ff22f){const _0x4d36a3=new _0x2ab623({'label':_0x3169d5['name'],'withText':!0x0,'role':'menuitemradio','id':_0x3169d5['id'],'model':_0x3169d5});_0x4d36a3['bind']('isOn')['to'](this,'activeModelId',_0x31035d=>_0x31035d===_0x3169d5['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x4d36a3,'labelView':new ba(this['locale'],_0x3169d5)});}}['setWebSearch'](_0x141c86){this['set']('webSearchActive',_0x141c86);}['setReasoning'](_0x367ed3){this['set']('reasoningActive',_0x367ed3);}['setModel'](_0x54921a){if(!_0x54921a)return;this['activeModelId']=_0x54921a['id'],this['activeModelName']=_0x54921a['name']||_0x54921a['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x54921a['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x54921a['name']);const _0xc4182a=_0x54921a['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0xc4182a),this['_webSearchButton']['set']('isVisible',_0xc4182a);const _0x1bbd9a=_0x54921a['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x1bbd9a),this['_reasoningButton']['set']('isVisible',_0x1bbd9a);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0),this['set']('modelSelectorVisible',!0x0);}['disableModelSelector'](_0x5e5420){this['set']('modelSelectorEnabled',!0x1),_0x5e5420&&this['set']('modelSelectorVisible',!0x1);}['_createWebSearchButton'](){const _0x3d4b6c=new _0x5ee277();return _0x3d4b6c['set']({'label':C(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x51773c,'class':ma,'isToggleable':!0x0,'tooltipPosition':fa}),_0x3d4b6c['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x3d4b6c;}['_createReasoningButton'](){const _0x4c82fc=new _0x5ee277();return _0x4c82fc['set']({'label':C(this['locale'],'AI_CHAT_REASONING'),'icon':_0x2ab706,'class':ma,'isToggleable':!0x0,'tooltipPosition':fa}),_0x4c82fc['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x4c82fc;}['_createCommandsButton'](){const _0x381fed=new _0x5ee277();return _0x381fed['set']({'label':C(this['locale'],'AI_CHAT_COMMANDS'),'icon':vt,'withText':!0x0,'class':ma,'isToggleable':!0x0,'tooltip':C(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':fa}),_0x381fed['extendTemplate']({'attributes':{'class':[pa]}}),_0x381fed['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x381fed;}['_createModelSelectionDropdown'](){const _0x3a798a=_0x36aac4(this['locale']);return _0x3a798a['set']({'panelPosition':'ne','class':[Ea]}),_0x3a798a['buttonView']['set']({'label':C(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':fa}),this['listenTo'](_0x3a798a,'execute',_0xfbe5ad=>{this['fire']('selectModel',_0xfbe5ad['source']['model']);}),_0x3a798a;}['_createModelNameView'](){const _0x111bfe=new Jo(this['locale']);return _0x111bfe['bind']('text')['to'](this,'activeModelName',_0x338fcb=>_0x338fcb??''),_0x111bfe['bind']('isVisible')['to'](this,'modelSelectorVisible',this,'activeModelName',(_0x323002,_0x4179a3)=>!_0x323002&&!_0x4179a3?.['toLowerCase']()['startsWith']('agent')),_0x111bfe;}}let ba=class extends _0x5a5387{constructor(_0x3100f8,_0x2ac3b4){super();const _0x2f8b8d=this['bindTemplate'],_0x542225=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x2f8b8d['to']('style'),'id':_0x2f8b8d['to']('id')},'children':[{'tag':'div','attributes':{'class':[Ta]},'children':[{'text':_0x2f8b8d['to']('text')}]},{'tag':'div','attributes':{'class':[Ca]},'children':[{'tag':'span','children':[{'text':_0x2ac3b4['description']}]}]},{'tag':'div','attributes':{'class':[wa]},'children':_0x542225}]}),_0x542225['addMany'](this['_getCapabilityParts'](_0x3100f8,_0x51773c,'AI_CHAT_SEARCH_WEB',_0x2ac3b4['capabilities']['webSearch']?.['enabled']??!0x1)),_0x542225['addMany'](this['_getCapabilityParts'](_0x3100f8,_0x2ab706,'AI_CHAT_REASONING',_0x2ac3b4['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x402c6d,_0x31b952,_0x5c65ce,_0x53b8c7){const _0x2a85d5=new _0x53ac42();_0x2a85d5['content']=_0x31b952;const _0x31e0cd=new _0x3b9d21(_0x402c6d);_0x31e0cd['setTemplate']({'tag':'span','children':[{'text':C(_0x402c6d,_0x5c65ce)+':\x20'}]});const _0x441da8=new _0x3b9d21(_0x402c6d);return _0x441da8['setTemplate']({'tag':'span','children':[{'text':C(_0x402c6d,_0x53b8c7?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x2a85d5,_0x31e0cd,_0x441da8];}};class Jo extends _0x3b9d21{constructor(_0x4afe8a){super(_0x4afe8a),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x2ac811=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x2ac811['if']('isVisible','ck-hidden',_0x2efe99=>!_0x2efe99)]},'children':[{'text':_0x2ac811['to']('text')}]});}}const Sa='ck-ai-chat-context-controls__url-form',Oa='ck-ai-chat-context-controls__url-input-section';class bo extends _0x3b9d21{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x4189cc){super(_0x4189cc),this['focusTracker']=new _0x5364ba(),this['keystrokes']=new _0x5593a8(),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 _0x1cce22({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x5d9f34=>{this['focusTracker']['add'](_0x5d9f34['element']),this['keystrokes']['listenTo'](_0x5d9f34['element']);}),_0x58138f({'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'](_0x32e615){this['urlInputField']['errorText']=_0x32e615,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x489fd0=new _0x5ee277(this['locale']);return _0x489fd0['set']({'icon':_0x94bcdd,'tooltip':C(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':'ck-button-icon\x20ck-button-back'}),_0x489fd0;}['_createUrlInputField'](){const _0x1bd6a2=new _0x425b6a(this['locale'],_0x313550);return _0x1bd6a2['set']({'label':C(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x1bd6a2['fieldView']['set']({'placeholder':C(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x1bd6a2;}['_createConfirmButton'](){const _0x2b46d6=new _0x5ee277(this['locale']);return _0x2b46d6['set']({'icon':_0x4661c5,'tooltip':C(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x2b46d6;}['_setupTemplate'](){const _0x179b60=new _0x37a3e8(this['locale'],{'label':C(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x179b60['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Sa,'tabindex':'-1'},'children':[_0x179b60,{'tag':'div','attributes':{'class':Oa},'children':[this['urlInputField'],this['confirmButton']]}]});}['_setupEventHandlers'](){this['backButton']['on']('execute',()=>{this['clear'](),this['fire']('cancel');}),this['urlInputField']['fieldView']['on']('input',()=>{this['clearError'](),this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}),this['on']('submit',_0x3c197c=>{_0x3c197c['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x431c78,_0x454828)=>{this['clear'](),this['fire']('cancel'),_0x454828();});}['_handleSubmit'](){const _0xacc974=this['getValue']()['trim']();_0xacc974?this['_isValidUrl'](_0xacc974)?(this['clearError'](),this['fire']('submitUrl',_0xacc974)):this['setError'](C(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](C(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x211e6b=this['getValue']()['trim'](),_0x5c6b69=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x211e6b['length']>0x0&&!_0x5c6b69;}['_isValidUrl'](_0x41f7a1){try{return!!new URL(_0x41f7a1);}catch{return!0x1;}}}const Ra='ck-ai-chat-resources__item',Na='ck-ai-chat-resources__item--in-context',ka='ck-ai-chat-resources__item-title',ya='ck-ai-chat-resources__item__icon';class sc extends _0x8173b9{['resource'];['_titleView'];['_iconView'];constructor(_0x3fca73,_0x4961b0){super(_0x3fca73),this['resource']=_0x4961b0,this['set']('isInContext',!!_0x4961b0['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x4b1681){if(_0x4b1681['isInContext'])return _0x4661c5;switch(_0x4b1681['type']){case xe['DOCUMENT']:return _0x1fedc8;case xe['URL']:return _0x5414da;case xe['FILE']:case xe['TEXT']:return _0x27ae23;default:return _0x325b8e;}}['highlightText'](_0x181dc7){if(!_0x181dc7||''===_0x181dc7['trim']())return void this['_titleView']['highlightText'](null);const _0x9e3e04=new RegExp(_0x44cebd(_0x181dc7),'gi');this['_titleView']['highlightText'](_0x9e3e04);}['updateResourceState'](_0x4734fe){this['resource']['isInContext']=_0x4734fe,this['isInContext']=_0x4734fe,this['_updateIcon']();}['_createTitleView'](){const _0x12552c=new _0x29efef();return _0x12552c['text']=this['resource']['label'],_0x12552c['extendTemplate']({'tag':'span','attributes':{'class':[ka]}}),_0x12552c;}['_createIconView'](){const _0x3247ce=new _0x53ac42();return _0x3247ce['content']=this['getResourceIcon'](this['resource']),_0x3247ce;}['_setupTemplate'](){const _0x9585=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[Ra,_0x9585['if']('isVisible','ck-hidden',_0x1d3987=>!_0x1d3987),_0x9585['if']('isInContext',Na)]},'children':[{'tag':'div','attributes':{'class':[ya]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x9585['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const va='ck-ai-chat-resources__list';class qr extends _0x40233d{['_source'];constructor(_0x1974a9,_0x1f20cc){super(_0x1974a9),this['_source']=_0x1f20cc,this['extendTemplate']({'attributes':{'class':[va]}});}['setResources'](_0x43b7f4,_0x2ecd6e){this['items']['clear']();let _0x37119d=_0x43b7f4;if(this['_source']['useDefaultFiltering']&&_0x2ecd6e&&''!==_0x2ecd6e['trim']()){const _0x562f87=new RegExp(_0x2ecd6e['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x37119d=_0x43b7f4['filter'](_0x1d4175=>_0x562f87['test'](_0x1d4175['label']));}for(const _0x18ba3f of _0x37119d){const _0x4d16a7=new sc(this['locale'],_0x18ba3f);_0x4d16a7['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x18ba3f);}),this['items']['add'](_0x4d16a7);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x2ecd6e);}['highlightText'](_0x3da7f6){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x34a1de=>{_0x34a1de['highlightText'](_0x3da7f6);});}['updateResourceState'](_0x3d794f,_0x144e0d){for(const _0x2e40e9 of this['items']){const _0xb5dceb=_0x2e40e9;_0xb5dceb['resource']['id']===_0x3d794f&&_0xb5dceb['updateResourceState'](_0x144e0d);}}['_handleResourceSelection'](_0x36dcbc,_0xf27ee9){this['fire']('addResourceToContext',{'source':_0x36dcbc,'resource':_0xf27ee9});}}class Ur extends _0x425b6a{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x5a114c){const t=_0x5a114c['t'],_0x50df8a={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x313550,'label':C(_0x5a114c,'AI_CHAT_SEARCH_RESOURCES')};super(_0x5a114c,_0x50df8a['creator']),this['label']=_0x50df8a['label'],this['_viewConfig']=_0x50df8a,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x5a114c,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x4f4a08){this['fire']('search',_0x4f4a08);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x53ac42(),this['iconView']['content']=_0x428daf,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x36e52e,t){this['resetButtonView']=new _0x5ee277(_0x36e52e),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x199223,'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',_0x480aa0=>!_0x480aa0),this['fieldWrapperChildren']['add'](this['resetButtonView']),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-reset'}});}['_setupEventListeners'](){this['listenTo'](this['fieldView'],'input',()=>{this['search'](this['fieldView']['element']['value']);}),this['bind']('isEnabled')['to'](this);}}class Or extends _0x3b9d21{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x3217dd,_0x173b81){super(_0x3217dd),this['_source']=_0x173b81['source'],this['_searchInputVisibleFrom']=_0x173b81['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 _0x49e6be([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new Ur(this['locale']);}['_createSearchSection'](){const _0x477305=new _0x3b9d21(this['locale']);return _0x477305['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x51e3fc,_0x53b2cb)=>{this['loadResources'](_0x53b2cb),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x53b2cb);}),_0x477305;}['_createResourcesListView'](){const _0x537c97=new qr(this['locale'],this['_source']);return _0x537c97['delegate']('addResourceToContext')['to'](this),_0x537c97['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x537c97;}['_createSkeletonView'](){const _0xbca5c6=new Oe(this['locale'],Fe['aiChatResources']);return _0xbca5c6['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x4000da=>!_0x4000da)]}}),_0xbca5c6;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x20b0c7){const _0x488e53=_0x53b360();this['_latestLoadResourcesUid']=_0x488e53,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x20b0c7,'uid':_0x488e53}),this['isLoading']=!0x0;}['setResources'](_0x2280f7,_0x582ef2){if(_0x582ef2&&_0x582ef2!==this['_latestLoadResourcesUid'])return;const _0x599ab0=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x2280f7,_0x599ab0),_0x2280f7['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x44d085,_0x535c73){this['_resourcesListView']['updateResourceState'](_0x44d085,_0x535c73);}}const xa='ck-ai-chat-context-controls__source-balloon-panel',La='ck-button-icon\x20ck-button-back',Ha='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Ao{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x61b361,_0x5db739,_0x1ae194){this['_locale']=_0x61b361,this['_bodyCollection']=_0x5db739,this['_config']=_0x1ae194;}['showSourceResourcesBalloon'](_0x219c6e){let _0x135702=this['_sourceResourceBalloons']['get'](_0x219c6e['id']);_0x135702||(_0x135702=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x219c6e['id'],_0x135702),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x135702)),this['_addSourceResourceContent'](_0x135702,_0x219c6e),_0x135702['show']();const _0x1568f7=this['_config']['getTargetElement']();_0x1568f7&&_0x135702['pin']({'target':_0x1568f7,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x570734,_0x56aa7d,_0x40bc3d){const _0x571732=this['_sourceResourceBalloons']['get'](_0x570734);if(!_0x571732)return;const _0xa313fa=this['_getResourcesViewFromBalloon'](_0x571732);_0xa313fa&&(_0xa313fa['setResources'](_0x56aa7d,_0x40bc3d),_0xa313fa['once']('change:isLoading',()=>{_0x571732['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x11f101){const _0x3bf988=this['_sourceResourceBalloons']['get'](_0x11f101);_0x3bf988&&requestAnimationFrame(()=>{_0x3bf988['hide'](),this['_sourceResourceBalloons']['delete'](_0x11f101),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x3df217 of this['_sourceResourceBalloons']['values']())if(_0x3df217['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x600997,_0x5d490e,_0x429127){const _0x36f875=this['_sourceResourceBalloons']['get'](_0x600997);if(!_0x36f875||!_0x36f875['isVisible'])return;const _0x1042cc=this['_config']['getTargetElement']();if(!_0x1042cc)return;_0x36f875['pin']({'target':_0x1042cc,'limiter':this['_config']['getLimiterElement']()});const _0xb655c1=this['_getResourcesViewFromBalloon'](_0x36f875);_0xb655c1&&_0xb655c1['updateResourceState'](_0x5d490e,_0x429127);}['destroy'](){for(const _0x5186fd of this['_sourceResourceBalloons']['values']())_0x5186fd['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x2a9aa0=new _0x509620(this['_locale']);return _0x2a9aa0['extendTemplate']({'attributes':{'class':xa}}),this['_bodyCollection']['add'](_0x2a9aa0),_0x2a9aa0;}['_addSourceResourceContent'](_0x13d228,_0x1c1c16){_0x13d228['content']['clear']();const _0x3cf7da=this['_createBalloonHeader'](_0x13d228,_0x1c1c16);_0x13d228['content']['add'](_0x3cf7da);const _0xfba8b2=this['_createBalloonResourcesView'](_0x1c1c16);_0x13d228['content']['add'](_0xfba8b2);}['_createBalloonHeader'](_0x10c6a2,_0x52f4){const _0x4f8997=this['_createBackButton'](_0x10c6a2),_0x201e00=new _0x37a3e8(this['_locale'],{'label':_0x52f4['label'],'class':Ha});return _0x201e00['children']['add'](_0x4f8997,0x0),_0x201e00;}['_createBackButton'](_0x5a9025){const _0x132a49=new _0x5ee277(this['_locale']);return _0x132a49['set']({'icon':_0x94bcdd,'tooltip':C(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':La}),_0x132a49['on']('execute',()=>{_0x5a9025['hide'](),this['_config']['onBackToContext']();}),_0x132a49;}['_createBalloonResourcesView'](_0x4a9814){const _0x8d463c=new Or(this['_locale'],{'source':_0x4a9814,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x8d463c['on']('loadSourceResources',(_0x23f7b4,_0x2564bb)=>{this['_config']['onLoadSourceResources'](_0x2564bb);}),_0x8d463c['on']('addResourceToContext',(_0x5dcca7,_0x331115)=>{this['_config']['onResourceSelected'](_0x331115['source'],_0x331115['resource']),this['closeSourceResourceBalloon'](_0x4a9814['id']);}),_0x8d463c;}['_getResourcesViewFromBalloon'](_0x237cef){const _0xbda1a3=_0x237cef['content']['get'](0x1);return _0xbda1a3 instanceof Or?_0xbda1a3:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x5f28db){_0x3685ee({'emitter':_0x5f28db,'contextElements':[_0x5f28db['element']],'callback':()=>{_0x5f28db['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x5f28db['isVisible']});}}const _s=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources'],ko='ck-ai-chat-context-controls',Eo='ck-ai-chat-context-controls__pending-contexts',vo='ck-ai-chat-context-controls__add-context-balloon-panel',Vo='ck-ai-chat-context-controls__add-context-button',Io='ck-ai-chat-context-controls__url-balloon-panel',Po='ck-ai-chat-context-controls__balloon-button',Ro='ck-ai-chat-context-controls__balloon-button-source',Uo='ck-ai-chat-controls-button',Lo='ck-ai-chat-context-chips-wrapper-balloon',No='ck-ai-chat-controls_context_show-more-button',Oo='ck-ai-chat-context-controls__show-more-balloon-panel',Mo='ck-ai-chat',Ho=[_0x509620['defaultPositions']['northArrowSouthWest'],_0x509620['defaultPositions']['northArrowSouth'],_0x509620['defaultPositions']['northArrowSouthEast'],_0x509620['defaultPositions']['southArrowNorthWest'],_0x509620['defaultPositions']['southArrowNorth'],_0x509620['defaultPositions']['southArrowNorthEast']];class bs extends _0x3b9d21{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['bodyCollection'];constructor(_0x2bf2df,_0x299850){super(_0x2bf2df),this['bodyCollection']=_0x299850['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x2bf2df),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x2bf2df),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x2bf2df),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x2bf2df,_0x299850);const _0x475e04={'cssClasses':{'showMoreButton':No,'showMoreBalloon':Oo,'overflowContainer':Lo,'controlsButton':Uo}};this['_overflowManager']=new To(_0x2bf2df,this['_currentContextsChips'],_0x475e04,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'](_0x566d54,_0x394cf7){const _0x34ac88=this['_createContextButton'](_0x566d54,'current',!0x0,_0x394cf7);this['_addContextToCollection'](_0x34ac88,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x1a12cf){this['_removeContextFromCollection'](_0x1a12cf,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x1a12cf,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x414556,_0x2af476){let _0x4c8bd0=this['_currentContextsChips']['find'](_0x47c7fa=>_0x47c7fa['id']===_0x414556);_0x4c8bd0||(_0x4c8bd0=this['_overflowManager']['overflowChips']['find'](_0x80e0d3=>_0x80e0d3['id']===_0x414556)),_0x4c8bd0&&(_0x4c8bd0['isLoading']=_0x2af476);}['setConversationContext'](_0x58895f){this['_conversationContextsChips']['clear']();for(const _0x272b66 of _0x58895f){const _0x44cdd1=this['_createContextButton'](_0x272b66,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x44cdd1,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x324bf6,_0x2576aa,_0x508927){this['_resourcesBalloonView']['updateResourceState'](_0x324bf6,_0x2576aa,_0x508927);}['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'](_0x4acf9b){this['_resourcesBalloonView']['showSourceResourcesBalloon'](_0x4acf9b),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x2aa5f7,_0x4775bd,_0x4ba834,_0x57b566){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x2aa5f7,_0x4ba834,_0x57b566);}['closeSourceResourceBalloon'](_0x4b9a5f){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x4b9a5f),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x100981){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x100981),this['_setAddContextButtonEnabled'](_0x100981);}['_setAddContextButtonEnabled'](_0x365757){const _0x233f05=!_0x365757['document']['isHidden']&&_0x365757['document']['enabled'],_0x34d64d=_0x365757['urls']['enabled'],_0x3d5bff=_0x365757['files']['enabled'];this['addContextButtonView']['isEnabled']=_0x233f05||_0x34d64d||_0x3d5bff;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[ko,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Eo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x5e417a){const _0x3788a4=new _0x5ee277(_0x5e417a);return _0x3788a4['set']({'label':C(_0x5e417a,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Uo+'\x20'+Vo,'icon':_0x166bb5,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x3788a4;}['_createAddContextBalloonPanelView'](_0x1de07f){return this['_createBaseBalloonPanel'](_0x1de07f,vo);}['_createUrlBalloonPanelView'](_0x256f5d){const _0x5bcbd3=this['_createBaseBalloonPanel'](_0x256f5d,Io);return this['_addUrlContent'](_0x5bcbd3,_0x256f5d),_0x5bcbd3;}['_createResourcesBalloonView'](_0x1a06b0,_0x5d6dd0){const _0x4bfa0f={'searchInputVisibleFrom':_0x5d6dd0['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ho});},'onResourceSelected':(_0x32698c,_0x2ed049)=>{this['fire']('addResourceToContext',{'source':_0x32698c,'resource':_0x2ed049});},'onLoadSourceResources':_0x504751=>{this['fire']('loadSourceResources',_0x504751);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Ao(_0x1a06b0,_0x5d6dd0['bodyCollection'],_0x4bfa0f);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Mo)||document['body'];}['_createBaseBalloonPanel'](_0xd5115d,_0xbdc4cb){const _0xce2b9a=new _0x509620(_0xd5115d);return _0xce2b9a['extendTemplate']({'attributes':{'class':_0xbdc4cb}}),this['bodyCollection']['add'](_0xce2b9a),_0xce2b9a;}['_setBalloonPanelContent'](_0x39067d,_0x5d0d32,_0x2b1292){if(_0x39067d['content']['clear'](),!_0x2b1292['document']['isHidden']&&_0x2b1292['document']['enabled']){const _0x5910b7=this['_createBalloonButton'](_0x5d0d32,{'label':C(_0x5d0d32,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x1fedc8});_0x5910b7['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x39067d['content']['add'](_0x5910b7);}if(_0x2b1292['urls']['enabled']){const _0x1bf839=this['_createBalloonButton'](_0x5d0d32,{'label':C(_0x5d0d32,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x5414da});_0x1bf839['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ho}),this['_urlInputView']['focus']();}),_0x39067d['content']['add'](_0x1bf839);}if(_0x2b1292['files']['enabled']){const _0x54a6d0=new _0xf82cf6(_0x5d0d32);_0x54a6d0['set']({'label':C(_0x5d0d32,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x29a086,'withText':!0x0,'tooltip':!0x0,'class':Po,'allowMultipleFiles':!0x0}),_0x54a6d0['on']('done',(_0x55aa83,_0x548757)=>{this['fire']('addFileToContext',_0x548757),this['hideAddContextBalloonPanel']();}),_0x54a6d0['tooltip']=!0x0,_0x39067d['content']['add'](_0x54a6d0);}for(const _0x3d8792 of _0x2b1292['sources']){const _0x21eb39=this['_createBalloonButton'](_0x5d0d32,{'label':_0x3d8792['label'],'icon':_0x3d8792['icon']||_0x325b8e,'type':'source'});_0x39067d['content']['add'](_0x21eb39),_0x21eb39['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon'](_0x3d8792);});}}['_addUrlContent'](_0x40ef0f,_0x1d9957){this['_urlInputView']=new bo(_0x1d9957),this['_urlInputView']['on']('submitUrl',(_0x79dd68,_0x45538a)=>{this['_handleUrlSubmit'](_0x45538a);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ho});}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ho});}),_0x40ef0f['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x42fe7b,_0x57d2dd){const _0x3bf26f='source'===_0x57d2dd['type']?new Pa(_0x42fe7b):new _0x5ee277(_0x42fe7b);return _0x3bf26f['set']({'label':_0x57d2dd['label'],'icon':_0x57d2dd['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Po}),_0x3bf26f;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x3685ee({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0xa4c5b5){const _0x5c8b82=this['_addContextBalloonConfig'];_0x5c8b82['buttonView']['isOn']=_0xa4c5b5,_0xa4c5b5?_0x5c8b82['balloonView']['show']():_0x5c8b82['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x1e277d,buttonView:_0x20e7ae,hideMethod:_0x3981b1}=this['_addContextBalloonConfig'];_0x3685ee({'emitter':_0x1e277d,'contextElements':[_0x1e277d['element'],_0x20e7ae['element']],'callback':()=>{_0x3981b1();},'activator':()=>_0x20e7ae['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x53e631,_0x1a6b35,_0x4b8384=!0x1,_0x262122=!0x1){const _0x378a52='conversation'===_0x1a6b35||!0x0===_0x53e631['isReadOnly'],_0x213277=new Bo(this['locale'],_0x53e631,_0x378a52,_0x4b8384,_0x262122);return _0x378a52||_0x213277['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x213277['id']);}),_0x213277;}['_addContextToCollection'](_0x5b9f12,_0x42d744){_0x42d744['add'](_0x5b9f12,0x0);}['_removeContextFromCollection'](_0x39d398,_0x4d0b9f){const _0x5dd1ec=_0x4d0b9f['find'](_0x3538e4=>_0x3538e4['id']===_0x39d398);_0x5dd1ec&&_0x4d0b9f['remove'](_0x5dd1ec);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ho}));}['_handleUrlSubmit'](_0x29a6c4){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x29a6c4);}}class Pa extends _0x5ee277{['arrowView'];constructor(_0x3265c5){super(_0x3265c5),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Ro]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x296a19=new _0x53ac42();return _0x296a19['content']=_0xab2de0,_0x296a19['extendTemplate']({'attributes':{'class':Ro+'__arrow'}}),_0x296a19;}}class ws extends _0x3b9d21{['_cancelButtonView'];['_loaderView'];constructor(_0x411e90){super(_0x411e90),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 _0x347fd2=new _0x5ee277(this['locale']);return _0x347fd2['set']({'label':C(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x4b519f}),_0x347fd2['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x347fd2;}['_createLoaderView'](){const _0x4a092b=new _0x3b9d21(this['locale']);return _0x4a092b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}}]},{'text':C(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x4a092b;}}class ki extends _0x3b9d21{['_displayedModels']=[];['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x13da73,_0x2e484d){super(_0x13da73),this['_contextPanelView']=this['_createContextPanelView'](_0x13da73,{'bodyCollection':_0x2e484d['bodyCollection'],'searchInputVisibleFrom':_0x2e484d['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x13da73),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x13da73),this['_loaderView']=this['_createLoaderView'](_0x13da73),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x13da73),this['_shouldRestorePromptInputFocus']=!0x1,this['_promptInputView']['delegate']('sendUserMessage')['to'](this),this['_loaderView']['delegate']('abortPromptStream')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleWebSearch')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleReasoning')['to'](this),this['_promptCapabilitiesView']['delegate']('selectModel')['to'](this),this['_contextPanelView']['delegate'](..._s)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x3f0d4e=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x3f0d4e['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x3f0d4e['if']('isLoading','ck-hidden',_0x45f99e=>_0x45f99e||!this['isModelAvailable']),_0x3f0d4e['if']('isModelAvailable','ck-hidden',_0x4aa9f3=>!_0x4aa9f3||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x3f0d4e['if']('isLoading','ck-hidden',_0x5f0379=>!_0x5f0379)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x3f0d4e['if']('isModelAvailable','ck-hidden',_0x4ea076=>_0x4ea076)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x3685ee({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x19a609,_0x156e03){return new bs(_0x19a609,_0x156e03);}['_createPromptInputView'](_0x4fafd4){return new ps(_0x4fafd4,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0xcf5dcb){return new ms(_0xcf5dcb);}['_createLoaderView'](_0x43d390){return new ws(_0x43d390);}['_createModelUnavailableMessageView'](_0x5b1601){const _0x5d7836=new vs(_0x5b1601);return _0x5d7836['delegate']('startConversation')['to'](this),_0x5d7836;}['_handlePromptInputFocus'](_0x4fc16e,_0x2bc3e9,_0x221b8a){_0x221b8a?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x3b8ef3,_0x1f813c){this['_contextPanelView']['addContextItem'](_0x3b8ef3,_0x1f813c);}['removeContextItem'](_0x30cd31){this['_contextPanelView']['removeContextItem'](_0x30cd31);}['setContextItemLoading'](_0x452410,_0x3a81e6){this['_contextPanelView']['setContextItemLoading'](_0x452410,_0x3a81e6);}['setIsUploadInProgress'](_0x45fc26){this['_promptInputView']['setIsUploadInProgress'](_0x45fc26);}['setConversationContext'](_0x1bf6c9){this['_contextPanelView']['setConversationContext'](_0x1bf6c9);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x1d6a46,_0x465957,_0x15df97){this['_contextPanelView']['updateResourceState'](_0x1d6a46,_0x465957,_0x15df97);}['setWebSearch'](_0x47cf0b){this['_promptCapabilitiesView']['setWebSearch'](_0x47cf0b);}['setReasoning'](_0x1fb152){this['_promptCapabilitiesView']['setReasoning'](_0x1fb152);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x4b7dba){this['_contextPanelView']['setAddContextOptions'](_0x4b7dba);}['setInputPlaceholder'](_0x585323){this['_promptInputView']['setPlaceholderText'](_0x585323);}['setModelList'](_0x146e57,_0x4ce4a2){this['_displayedModels']=_0x146e57,this['_promptCapabilitiesView']['setModelList'](_0x146e57,_0x4ce4a2);}['setModel'](_0x3b79b4){(_0x3b79b4?this['_displayedModels']['find'](_0x4f9128=>_0x4f9128['id']===_0x3b79b4['id']):null)?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x3b79b4)):_0x3b79b4?.['id']['startsWith']('agent')?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](this['_displayedModels'][0x0])):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x5c97d6){this['_promptCapabilitiesView']['disableModelSelector'](_0x5c97d6);}['populateSourceResourceBalloon'](_0x5037cd,_0x44caf9,_0x30d936,_0x1f230f){this['_contextPanelView']['populateSourceResourceBalloon'](_0x5037cd,_0x44caf9,_0x30d936,_0x1f230f);}['closeSourceResourceBalloon'](_0x207527){this['_contextPanelView']['closeSourceResourceBalloon'](_0x207527);}['focusPromptInput'](){this['_promptInputView']['focus']();}}class vs extends _0x3b9d21{constructor(_0x4fa6e0){super(_0x4fa6e0);const _0x4320ce=new _0x5ee277(_0x4fa6e0);_0x4320ce['set']({'label':C(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x4320ce['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':C(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x4320ce]}]});}}class yi extends _0x37a3e8{['conversationStartButton'];['resizeButton'];constructor(_0x5233aa,_0x487a80){super(_0x5233aa,{'label':C(_0x5233aa,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':bt}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x5233aa),this['children']['add'](this['conversationStartButton']),_0x487a80&&(this['resizeButton']=ks(_0x5233aa,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x3f43bb){const _0x198a88=new _0x5ee277(_0x3f43bb);return _0x198a88['set']({'label':C(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x24ea72,'class':'ck-ai-chat__start-conversation'}),_0x198a88['on']('execute',()=>{this['fire']('startConversation');}),_0x198a88;}}class Ri extends _0x3b9d21{constructor(_0x11e5aa){super(_0x11e5aa),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':C(_0x11e5aa,'AI_DISCLAIMER_TEXT')}]}]});}}class Pt extends _0x3b9d21{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x1697a5,_0x28c4b5){super(_0x1697a5),this['_bodyCollection']=new _0x57ac2d(_0x1697a5),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new yi(_0x1697a5,_0x28c4b5['showResizeButton']),this['chatHeader']['delegate'](...Lt)['to'](this),this['chatFeed']=new ji(_0x1697a5,this['_bodyCollection']),this['chatFeed']['delegate'](...Lt)['to'](this),this['chatControls']=new ki(_0x1697a5,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x28c4b5['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...Lt)['to'](this),this['chatDisclaimer']=new Ri(_0x1697a5),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x1697a5['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x1f31cc,_0x52d6d5,_0x1abfe4,_0x906f7a){this['chatControls']['populateSourceResourceBalloon'](_0x1f31cc,_0x52d6d5,_0x1abfe4,_0x906f7a);}['closeSourceResourceBalloon'](_0x3c2bd5){this['chatControls']['closeSourceResourceBalloon'](_0x3c2bd5);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class mt extends tt{static get['requires'](){return[pt];}['_view'];static get['pluginName'](){return'AIChatUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['feedItemRenderingStrategy']='streaming';['showDiff']=!0x0;['_promiseQueue'];['_interactionPromiseResolver'];['_titleAnimationInterval']=void 0x0;['_isTrackChangesCommandValueBound']=!0x1;constructor(_0x26b365){super(_0x26b365);const _0x137170=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new y(),this['_view']=new Pt(this['context']['locale'],{'showResizeButton':_0x137170['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...Lt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x2597db,{showDiff:_0x43bf9c})=>{this['showDiff']=_0x43bf9c;}),_0x137170['view']['addTab']({'id':'chat','buttonLabel':C(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':bt,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x537811=>_0x537811),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x24a3d2=>_0x24a3d2),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x53d31d){this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x53d31d['availableModels'],!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':C(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE')});}['addFeedItemStaticMessage']({id:_0x1ad872,staticMessage:_0x3ddba5}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x1ad872,'initialContent':'<p>'+_0x3ddba5+'</p>'});}['addFeedItemUserMessage'](_0x144f76){const _0x58b3fb=_0x144f76['quickActionData']?.['displayedPrompt']||_0x144f76['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x144f76['contextItems']['values']()),'initialContent':'<p>'+_0x58b3fb+'</p>','id':_0x144f76['id']});}['addFeedItemError']({errorMessage:_0x54c175,id:_0x426f50}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x54c175+'</p>','id':_0x426f50});}['addFeedItemAIReply'](_0x2cc302){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x2cc302['interactionId']+':'+_0x2cc302['id']}),this['setLoadingMessage'](null);});}async['addFeedItemAISuggestion'](_0x4eca91){const _0x49e8c7=rt(this['context']);let _0x5ddacf=_0x49e8c7['config']['get']('ai.availableReplyActions')||[...x];if(_0x49e8c7['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x12e36e=_0x49e8c7['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x12e36e,'value');}}else _0x5ddacf=_0x5ddacf['filter'](_0x50b1df=>'insertSuggestion'!=_0x50b1df);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x4eca91['interactionId']+':'+_0x4eca91['id'],'areActionsDisabled':_0x4eca91['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x5ddacf}),this['setLoadingMessage'](null);});}['addFeedInteractionHeader'](_0x1a8b41,_0x56d9a6){const _0x3f4600=this['_view']['chatFeed']['children']['last'];if(_0x3f4600 instanceof Ht)return this['_view']['chatFeed']['children']['remove'](_0x3f4600),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x1a8b41['id'],'capabilities':{'isWebSearchEnabled':_0x3f4600['capabilities']['isWebSearchEnabled']||_0x56d9a6['isWebSearchEnabled'],'isReasoningEnabled':_0x3f4600['capabilities']['isReasoningEnabled']||_0x56d9a6['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x1a8b41['id'],'capabilities':_0x56d9a6});}['updateFeedInteractionHeader'](_0x533dcf){const _0x5d4809=this['_view']['chatFeed']['children']['find'](_0x39b9ad=>_0x39b9ad['options']['id']==_0x533dcf['id']&&_0x39b9ad instanceof Ht);_0x5d4809&&_0x5d4809['set']('isVisible',_0x533dcf['isVisible']);}async['updateFeedItemAIReplyContent'](_0x13ff73){const _0x4bd5e6=_0x13ff73['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x90cd71=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x13ff73,'abortSignal':_0x90cd71,'renderingStrategy':_0x4bd5e6}),_0x13ff73['isDone']&&this['markFeedItemAsDone'](_0x13ff73['id']);});}['updateFeedItemAIReplySources'](_0x200144,_0x1543bb){this['_view']['chatFeed']['updateWebSources'](_0x200144,_0x1543bb);}async['updateFeedItemAIReplySuggestionContent'](_0x3ecb43){const _0x25b6e4=_0x3ecb43['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x581823=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x3ecb43,'abortSignal':_0x581823,'renderingStrategy':_0x25b6e4}),_0x3ecb43['isDone']&&this['markFeedItemAsDone'](_0x3ecb43['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0xb2c12){this['_view']['chatFeed']['updateSuggestionPartState'](_0xb2c12);}['markFeedItemAsDone'](_0x1d54af){this['_view']['chatFeed']['markItemAsDone'](_0x1d54af);}['removeFeedInteraction'](_0x310b32){this['_view']['chatFeed']['getItemIds']()['filter'](_0x461f73=>_0x461f73['startsWith'](_0x310b32))['forEach'](_0x46f38c=>this['_view']['chatFeed']['removeItem'](_0x46f38c));}['startInteraction'](){this['setLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1}),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x327dd3){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x1ff7ed=>_0x1ff7ed['startsWith'](_0x327dd3['id']))['forEach'](_0x4e104b=>this['markFeedItemAsDone'](_0x4e104b)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x939d06,_0x583981){this['_view']['chatControls']['addContextItem'](_0x939d06,_0x583981);}['removeContextItem'](_0xfe3243){this['_view']['chatControls']['removeContextItem'](_0xfe3243);}['setContextItemLoading'](_0x518571,_0x3c0d99){this['_view']['chatControls']['setContextItemLoading'](_0x518571,_0x3c0d99);}['setIsUploadInProgress'](_0x305aae){this['_view']['chatControls']['setIsUploadInProgress'](_0x305aae);}['setConversationContext'](_0x5b0432){this['_view']['chatControls']['setConversationContext'](_0x5b0432);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x4e0674,_0x3ee4a4,_0x4f9c5b){this['_view']['chatControls']['updateResourceState'](_0x4e0674,_0x3ee4a4,_0x4f9c5b);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x3e293a){this['_view']['chatControls']['setAddContextOptions'](_0x3e293a);}['updateCapabilities'](_0x50575f){this['_view']['chatControls']['setWebSearch'](_0x50575f['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x50575f['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x50575f));}['setSelectedModel'](_0xdff90f,_0x2882e1){this['_view']['chatControls']['setModel'](_0xdff90f),_0x2882e1&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x40fada){this['feedItemRenderingStrategy']=_0x40fada;}['toggleLoadingSkeleton'](_0x464506){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x464506);}['resetConversationTitle'](){this['setConversationTitle'](C(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x2eee50,_0x1180d1=!0x1){if(_0x1180d1&&!Rt()&&_0x2eee50['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x2eee50);this['_view']['chatHeader']['label']=_0x2eee50;}['setLoadingMessage'](_0x590d74){const _0x136dbf=this['_getLoadingMessage'](_0x590d74);this['_view']['chatFeed']['setLoadingMessage'](_0x136dbf);}['_animateConversationTitle'](_0x2f986a){let _0x2341a2=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x2f986a[_0x2341a2],_0x2341a2++,_0x2341a2===_0x2f986a['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x5242e4){this['_view']['chatHeader']['isMaximized']=_0x5242e4;}['_getLoadingMessage'](_0x41a18b){return _0x41a18b?_0x41a18b['isWebSearchEnabled']&&_0x41a18b['isReasoningEnabled']?C(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x41a18b['isWebSearchEnabled']?C(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x41a18b['isReasoningEnabled']?C(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):C(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR'):'';}['_getInputPlaceholder'](_0x1dcdc6){return _0x1dcdc6?_0x1dcdc6['isWebSearchEnabled']&&_0x1dcdc6['isReasoningEnabled']?C(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x1dcdc6['isWebSearchEnabled']?C(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x1dcdc6['isReasoningEnabled']?C(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):C(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):C(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x4bf04a,_0x411932,_0x5eb93e,_0x2a7566){this['_view']['populateSourceResourceBalloon'](_0x4bf04a,_0x411932,_0x5eb93e,_0x2a7566);}['closeSourceResourceBalloon'](_0x26bcf4){this['_view']['closeSourceResourceBalloon'](_0x26bcf4);}['focusPromptInput'](){this['_view']['chatControls']['focusPromptInput']();}['scrollFeedToSuggestion'](_0x4761f6,_0x527d3d){this['_view']['chatFeed']['scrollToSuggestion'](_0x4761f6,_0x527d3d);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class Di extends _0x40233d{['sections'];constructor(_0x781ca6,_0x39c608){super(_0x781ca6),this['sections']=_0x39c608,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x7fcccc){let _0x22c504=0x0,_0xfe0bc=0x0;for(const _0x1800a8 of this['sections']){const {resultsCount:_0x29885b,totalItemsCount:_0xb4eb08}=_0x1800a8['filter'](_0x7fcccc);_0x22c504+=_0x29885b,_0xfe0bc+=_0xb4eb08;}return{'resultsCount':_0x22c504,'totalItemsCount':_0xfe0bc};}}class zi extends _0x8173b9{['title'];['itemsViews'];['_itemsListView'];constructor(_0x3b237c,{title:_0x5c6d9a,items:_0x3c21ef}){super(_0x3b237c);const _0x522bd9=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x5c6d9a,this['itemsViews']=_0x3c21ef;const _0x5d45a2=new _0x3b9d21(_0x3b237c);_0x5d45a2['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x40233d(_0x3b237c),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x522bd9['if']('isVisible','ck-hidden',_0x203858=>!_0x203858)]},'children':[_0x5d45a2,this['_itemsListView']]});}['filter'](_0x45b418){const _0x40e24c=this['itemsViews']['length'];let _0x171f72=0x0;for(const _0x39d8a9 of this['itemsViews']){if(_0x45b418){const _0x4b8895=_0x39d8a9['isMatching'](_0x45b418);_0x39d8a9['isVisible']=!!_0x4b8895,_0x39d8a9['highlightText'](_0x45b418);}else _0x39d8a9['isVisible']=!0x0,_0x39d8a9['highlightText'](null);_0x39d8a9['isVisible']&&_0x171f72++;}return this['isVisible']=_0x171f72>0x0,{'resultsCount':_0x171f72,'totalItemsCount':_0x40e24c};}['getItem'](_0x36d5db){return this['itemsViews']['find'](_0x2d0afe=>_0x2d0afe['id']===_0x36d5db);}['removeItem'](_0x54d21b){const _0x2e396b=this['itemsViews']['indexOf'](_0x54d21b);-0x1!==_0x2e396b&&(this['itemsViews']['splice'](_0x2e396b,0x1),this['_itemsListView']['items']['remove'](_0x54d21b));}}class Bi extends/* #__PURE__ -- @preserve */
27
- _0x172cdb(_0x8173b9){['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(_0xedb4ae,_0x5de726){super(_0xedb4ae);const _0x4f5266=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x5de726['pinned']),this['set']('loadingState',null),this['id']=_0x5de726['id'];const {title:_0x1c6248,createdAt:_0x180585,active:_0xa70979=!0x1}=_0x5de726;this['_titleView']=new _0x29efef(),this['_titleView']['text']=_0x1c6248,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x3a2502=this['_createCheckView'](),_0x49b18b=this['_createPinButtonView'](_0xedb4ae),_0x5a236b=this['_createMenuDropdownView'](),_0x13a8d9=this['_createEditInputView'](_0xedb4ae,_0x1c6248),_0x323afb=this['_createAcceptEditButtonView'](_0xedb4ae,_0x13a8d9),_0x543e86=this['_createCancelEditButtonView'](_0xedb4ae,_0x13a8d9);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x49b18b),this['actions']['add'](_0x5a236b),this['on']('change:isEdit',(_0x4b2867,_0x2827b1,_0x3f49a7)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x3f49a7?(this['actions']['add'](_0x323afb),this['actions']['add'](_0x543e86),this['mainContent']['add'](_0x13a8d9),_0x13a8d9['element']['focus']()):(this['actions']['add'](_0x49b18b),this['actions']['add'](_0x5a236b),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0xa70979?'ck-ai-chat-history__item--active':'',_0x4f5266['if']('isVisible','ck-hidden',_0x501ff3=>!_0x501ff3),_0x4f5266['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',_0x4f5266['if']('loadingState','ck-hidden',_0x189ae9=>!!_0x189ae9)]},'children':_0xa70979?[_0x3a2502]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x4f5266['if']('loadingState','ck-hidden',_0x383734=>!_0x383734)]},'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',_0x4f5266['if']('loadingState','ck-hidden',_0x4ebdc9=>!!_0x4ebdc9)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x4f5266['if']('loadingState','ck-hidden',_0x25b49f=>!_0x25b49f)]},'children':[{'text':_0x4f5266['to']('loadingState',_0x4c65f0=>_0x4c65f0?C(this['locale'],Bi['LOADING_LABELS'][_0x4c65f0]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x180585]}]},{'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'](_0x51695a){this['_titleView']['text']=_0x438ca2(_0x51695a);}['updateLoadingState'](_0x40d524,_0x93dc1f){this['set']('loadingState',_0x93dc1f?_0x40d524:null);}['_createCheckView'](){const _0x136d4c=new _0x53ac42();return _0x136d4c['set']({'content':_0x354c14}),_0x136d4c;}['_createPinButtonView'](_0x2000f7){const _0x1c6c49=new _0x5ee277(_0x2000f7);return _0x1c6c49['set']({'label':C(_0x2000f7,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x2eb4b9,'withText':!0x1,'tooltip':!0x0}),_0x1c6c49['bind']('isOn')['to'](this,'pinned'),_0x1c6c49['on']('execute',()=>{const _0x3e8b7f=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x3e8b7f});}),_0x1c6c49;}['_createMenuDropdownView'](){const _0x1746c5=_0x36aac4(this['locale'],_0x1b4426),_0x42abde=_0x1746c5['panelView']['children'];_0x1746c5['buttonView']['set']({'label':C(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x351fae}),_0x1746c5['panelPosition']='sw';const _0x5071e2=new _0x5ee277(this['locale']);_0x5071e2['label']=C(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x5071e2['withText']=!0x0,_0x5071e2['on']('execute',()=>{this['isEdit']=!0x0;});const _0x359622=new _0x5ee277(this['locale']);_0x359622['label']=C(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x359622['withText']=!0x0,_0x359622['on']('execute',()=>{this['showConfirm'](C(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x4910ab=new _0x40233d(this['locale']),_0x58326c=new _0x8173b9(this['locale']);_0x58326c['children']['add'](_0x5071e2);const _0x2a56d4=new _0x8173b9(this['locale']);return _0x2a56d4['children']['add'](_0x359622),_0x4910ab['items']['addMany']([_0x58326c,_0x2a56d4]),_0x42abde['add'](_0x4910ab),_0x1746c5;}['_createEditInputView'](_0x4fb5f6,_0x12ab92){const _0x180677=new _0x67befa(_0x4fb5f6),_0x562aff=_0x180677['bindTemplate'];return _0x180677['value']=_0x12ab92,_0x180677['extendTemplate']({'on':{'keydown':_0x562aff['to'](_0x1ad2c6=>{'Enter'==_0x1ad2c6['key']&&this['_commitEditInputValue'](_0x180677);})}}),_0x180677;}['_createAcceptEditButtonView'](_0xd1e488,_0x3f3236){const _0xfb8076=new _0x5ee277(_0xd1e488);return _0xfb8076['set']({'icon':_0x354c14,'withText':!0x1,'tooltip':C(_0xd1e488,'AI_CHAT_HISTORY_ACCEPT')}),_0xfb8076['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0xfb8076['on']('execute',()=>{this['_commitEditInputValue'](_0x3f3236);}),_0xfb8076;}['_commitEditInputValue'](_0x10280d){const _0x329a0f=_0x10280d['element']['value']||'';this['_titleView']['text']=_0x329a0f,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x329a0f});}['_createCancelEditButtonView'](_0x2091b8,_0x3306dd){const _0x1f82e2=new _0x5ee277(_0x2091b8);return _0x1f82e2['set']({'icon':_0x199223,'withText':!0x1,'tooltip':C(_0x2091b8,'AI_CHAT_HISTORY_CANCEL')}),_0x1f82e2['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x1f82e2['on']('execute',()=>{this['isEdit']=!0x1,_0x3306dd['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x1f82e2;}['_createSpinnerView'](){const _0x5288e0=new Pe('tiny');return _0x5288e0['isVisible']=!0x0,_0x5288e0;}['isMatching'](_0x26dd03){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x26dd03)?{'title':!0x0}:null;}['highlightText'](_0x3b0403){this['_titleView']['highlightText'](_0x3b0403);}}class Ut extends _0x3b9d21{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x27f679,_0x5c55ed){super(_0x27f679),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 _0x12168c=new _0x37a3e8(_0x27f679,{'label':C(_0x27f679,'AI_CHAT_HISTORY_HEADING'),'icon':Nt,'class':'ck-ai-header\x20ck-ai-header_history'});_0x5c55ed&&(this['resizeButton']=ks(_0x27f679,this),_0x12168c['children']['add'](this['resizeButton'])),this['sectionsView']=new Di(_0x27f679,[]),this['sectionsView']['delegate'](...Fi)['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',_0x1962df=>!_0x1962df)]}}),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':[_0x12168c,{'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 _0x1b0ff0=new _0x3cb991(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':C(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x273a6a=>C(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x273a6a),'secondary':C(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x5c238e=this['_createErrorView']();return _0x5c238e['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x424865=>!_0x424865)]}}),_0x1b0ff0['on']('render',()=>{_0x1b0ff0['children']['add'](_0x5c238e,0x1);}),_0x1b0ff0['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x3135ab=>!_0x3135ab)]}}),_0x1b0ff0;}['_createSkeletonView'](){const _0x122c38=new Oe(this['locale'],Fe['aiHistory']);return _0x122c38['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x2265b9=>!_0x2265b9)]}}),_0x122c38;}['_createErrorView'](){const _0x470fbd=new _0x3b9d21(this['locale']),_0x16ce69=new _0x5ee277(this['locale']);_0x16ce69['set']({'withText':!0x1,'icon':_0x199223,'class':'ck-ai-notification_error__dismiss-button'}),_0x16ce69['bind']('isVisible')['to'](this,'hasItems',_0x4c20c2=>!!_0x4c20c2),_0x16ce69['on']('execute',()=>{this['errorMessage']='';});const _0x881566=this['bindTemplate'];return _0x470fbd['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x881566['to']('errorMessage')}]},_0x16ce69]}),_0x470fbd;}['_createEmptyStateView'](){const _0x5a26c2=new _0x5ee277(this['locale']);_0x5a26c2['set']({'label':C(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x24ea72,'class':'ck-ai-chat__start-conversation'}),_0x5a26c2['on']('execute',()=>{this['fire']('openChat');});const _0x33ba62=new _0x3b9d21(this['locale']);return _0x33ba62['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x5a4bc7=>!_0x5a4bc7)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[C(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x5a26c2]}),_0x33ba62;}['_createListItemViews'](_0x3012de,_0x1da39b){const _0x280d3f=[];for(const _0x299d40 of _0x3012de){const _0x5baaff=new Bi(_0x1da39b,_0x299d40);_0x5baaff['delegate'](...Fi)['to'](this),_0x280d3f['push'](_0x5baaff);}return _0x280d3f;}['updateHistoryItemsWithCategories'](_0x2c5972){const _0x4ca84d=this['locale']||'en',_0xe578a6=[];for(const _0x16eb0e of _0x2c5972){const _0x2d752e=this['_createListItemViews'](_0x16eb0e['items'],_0x4ca84d);_0xe578a6['push'](new zi(_0x4ca84d,{'title':_0x16eb0e['title'],'items':_0x2d752e}));}this['sectionsView']['sections']=_0xe578a6,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0xe578a6),this['hasItems']=_0x2c5972['some'](_0x3a1f27=>_0x3a1f27['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x4d46ac){for(const _0x15df34 of this['sectionsView']['sections']){const _0x43e261=_0x15df34['getItem'](_0x4d46ac);if(_0x43e261){if(_0x15df34['removeItem'](_0x43e261),0x0===_0x15df34['itemsViews']['length']){const _0x100611=this['sectionsView']['sections']['indexOf'](_0x15df34);-0x1!==_0x100611&&(this['sectionsView']['sections']['splice'](_0x100611,0x1),this['sectionsView']['items']['remove'](_0x15df34));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x41a168,_0x5e57f7){for(const _0x131451 of this['sectionsView']['sections']){const _0x5d182f=_0x131451['getItem'](_0x41a168);if(_0x5d182f){_0x5d182f['updateTitle'](_0x5e57f7);break;}}}['updateItemLoadingState'](_0x3e4640,_0x213d85,_0x4060ca){for(const _0x1d658e of this['sectionsView']['sections']){const _0x47b156=_0x1d658e['getItem'](_0x3e4640);if(_0x47b156){_0x47b156['updateLoadingState'](_0x213d85,_0x4060ca);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x1ea99f=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x1ea99f);}}}const Fi=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class xt extends tt{static get['requires'](){return[pt];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1880db){super(_0x1880db);const _0x3fa40c=this['context']['plugins']['get']('AITabs');this['_historyView']=new Ut(this['context']['locale'],_0x3fa40c['showResizeButton']),this['_historyView']['delegate'](...Fi)['to'](this),_0x3fa40c['view']['addTab']({'id':'history','buttonLabel':C(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Nt,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x2e69d1){this['_historyView']['removeHistoryItem'](_0x2e69d1);}['updateItems'](_0x24c254){this['_historyView']['updateHistoryItemsWithCategories'](_0x24c254);}['updateItemTitle'](_0x164a72,_0x2dbe1c){this['_historyView']['updateItemTitle'](_0x164a72,_0x2dbe1c);}['updateItemLoadingState'](_0x430784,_0x27d88a,_0x22fea4){this['_historyView']['updateItemLoadingState'](_0x430784,_0x27d88a,_0x22fea4);}['setLoadingSkeleton'](_0x110ff3){this['_historyView']['isLoading']=_0x110ff3;}['showError'](_0x154eae){this['_historyView']['errorMessage']=_0x154eae;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x5379fd){this['_historyView']['isMaximized']=_0x5379fd;}}class De extends ts(){['id'];['createdAt'];constructor({id:_0x347a85,title:_0x32bbbc,createdAt:_0x24887f,updatedAt:_0x24de77,pinned:_0xa2e07d}){super(),this['id']=_0x347a85,this['createdAt']=new Date(_0x24887f),this['set']('title',_0x32bbbc),this['set']('updatedAt',_0x24de77?new Date(_0x24de77):null),this['set']('pinned',_0xa2e07d||!0x1);}['updateTitle'](_0x3043da){this['set']('title',_0x438ca2(_0x3043da)),this['updatedAt']=new Date();}['updatePinned'](_0x293ab4){this['set']('pinned',_0x293ab4),this['updatedAt']=new Date();}}class Ot extends _0x554e67(){['items']=[];['connector'];['group'];constructor({connector:_0x3f28b7,group:_0x10f90e}){super(),this['connector']=_0x3f28b7,this['group']=_0x10f90e;}async['init'](){try{const _0x1b7e89=this['connector']['fetchConversations'](this['group']),_0x12e59b=await _0x1b7e89['getConversations']();this['loadItems'](_0x12e59b);}catch(_0x359ec1){this['fire']('error',{'error':_0x359ec1,'operation':'init'});}}['addItem'](_0x295717){this['items']['push'](_0x295717);}async['removeItem'](_0x380842){const _0x41e171=this['items']['findIndex'](_0x1080bd=>_0x1080bd['id']===_0x380842);if(-0x1===_0x41e171)return!0x1;try{return await this['connector']['deleteConversation'](_0x380842)['execute'](),this['items']['splice'](_0x41e171,0x1),this['fire']('itemRemoved',{'itemId':_0x380842}),!0x0;}catch(_0x23e81a){return this['fire']('error',{'error':_0x23e81a,'operation':'removeItem','itemId':_0x380842}),!0x1;}}['getItem'](_0x48894d){return this['items']['find'](_0x3ef3be=>_0x3ef3be['id']===_0x48894d);}async['updateItemTitle'](_0x38b811,_0x16adb1){const _0xc908ee=this['getItem'](_0x38b811);if(!_0xc908ee)return!0x1;try{return await this['connector']['updateConversation'](_0x38b811,{'title':_0x16adb1})['getResult'](),_0xc908ee['updateTitle'](_0x16adb1),this['fire']('itemUpdated',{'itemId':_0x38b811,'updates':{'title':_0x16adb1}}),!0x0;}catch(_0x30dbda){return this['fire']('error',{'error':_0x30dbda,'operation':'updateItemTitle','itemId':_0x38b811}),!0x1;}}async['updateItemPinned'](_0x7358b8,_0x270538){const _0x3b173b=this['getItem'](_0x7358b8);if(!_0x3b173b)return!0x1;try{return await this['connector']['updateConversation'](_0x7358b8,{'pinned':_0x270538})['getResult'](),_0x3b173b['updatePinned'](_0x270538),this['fire']('itemUpdated',{'itemId':_0x7358b8,'updates':{'pinned':_0x270538}}),!0x0;}catch(_0x667bc8){return this['fire']('error',{'error':_0x667bc8,'operation':'updateItemPinned','itemId':_0x7358b8}),!0x1;}}['loadItems'](_0x48195e){try{this['items']=[],_0x48195e['map'](_0x4a57dc=>{this['addItem'](new De(_0x4a57dc));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x259cf4){this['fire']('error',{'error':_0x259cf4,'operation':'loadItems'});}}['getItems'](_0x488450={}){const _0x4daa1a=void 0x0!==_0x488450['pinned']&&_0x488450['pinned'],_0x5504ba=_0x488450['from']?new Date(_0x488450['from']['getFullYear'](),_0x488450['from']['getMonth'](),_0x488450['from']['getDate']()):null,_0x4d351a=_0x488450['to']?new Date(_0x488450['to']['getFullYear'](),_0x488450['to']['getMonth'](),_0x488450['to']['getDate']()):null;return this['items']['filter'](_0x5e731a=>{if(_0x5e731a['pinned']!==_0x4daa1a)return!0x1;if(_0x4d351a){const _0xa14c7a=new Date(_0x5e731a['createdAt']['getFullYear'](),_0x5e731a['createdAt']['getMonth'](),_0x5e731a['createdAt']['getDate']());return _0x5504ba?_0x5504ba['getTime']()===_0x4d351a['getTime']()?_0xa14c7a['getTime']()===_0x5504ba['getTime']():_0xa14c7a<_0x4d351a&&_0xa14c7a>=_0x5504ba:_0xa14c7a<_0x4d351a;}return!0x0;});}}class jt extends tt{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[s,ct,xt,pt];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](s),this['_aiChatHistoryUi']=this['context']['plugins']['get'](xt),this['_aiChatController']=this['context']['plugins']['get'](ct);const _0x22ce4b=this['context']['plugins']['get'](pt);try{const _0x22f6a8=this['_aiChatController']['getGroupId']();this['history']=new Ot({'connector':this['_aiConnector'],'group':_0x22f6a8}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0xbcf3d7,_0x32aee9)=>{this['_setItemLoading'](_0x32aee9['id'],'remove'),this['_handleRemove'](_0x32aee9['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x34e376,_0xba0b3c)=>{this['_setItemLoading'](_0xba0b3c['id'],'rename'),this['_handleEditTitle'](_0xba0b3c['id'],_0xba0b3c['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x32333d,_0x49f142)=>{void 0x0!==_0x49f142['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x49f142['itemId'],_0x49f142['updates']['title']),void 0x0!==_0x49f142['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x49f142['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x401b20,_0x4cbc4a)=>{this['_aiChatController']['handleRemovedConversation'](_0x4cbc4a['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x4cbc4a['itemId']),this['_clearItemLoading'](_0x4cbc4a['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x2167d1,_0x72e780)=>{this['_handleHistoryErrorUI'](_0x72e780['error'],_0x72e780['operation'],_0x72e780['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x2df680,_0x403e74)=>{this['_handleSelectConversation'](_0x403e74['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x4c8401,_0x94f688)=>{const _0x2482ea=_0x94f688['pinned']?'pin':'unpin';this['_setItemLoading'](_0x94f688['id'],_0x2482ea),this['_handleTogglePin'](_0x94f688['id'],_0x94f688['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x22ce4b['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x22ce4b['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x22ce4b,'resizedTabs',(_0x124025,_0x4eda15)=>{this['_setIsMaximized'](_0x4eda15);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x22ce4b['resize']();});}catch(_0x4d9a23){this['_handleHistoryErrorUI'](_0x4d9a23,'init');}}async['_handleEditTitle'](_0x3e59af,_0x37d761){await this['history']['updateItemTitle'](_0x3e59af,_0x37d761);}async['_handleTogglePin'](_0x2c5f21,_0xc5ab22){await this['history']['updateItemPinned'](_0x2c5f21,_0xc5ab22);}async['_handleRemove'](_0x25062a){await this['history']['removeItem'](_0x25062a);}async['_handleSelectConversation'](_0x5e5255){await this['_aiChatController']['loadConversation'](_0x5e5255);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x21b7ba=this['_aiChatController']['activeConversation']?.['id'],_0x2da5c1=this['_getCategorizedItems']()['map'](_0x20d414=>({'title':_0x20d414['title'],'items':_0x20d414['items']['map'](_0x1a30fe=>({'id':_0x1a30fe['id'],'title':_0x1a30fe['title']||C(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x1a30fe['createdAt'])['toLocaleDateString'](),'active':_0x1a30fe['id']===_0x21b7ba,'pinned':_0x1a30fe['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x2da5c1);}['_setItemLoading'](_0x59d6db,_0x4db150){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x59d6db,_0x4db150,!0x0);}['_clearItemLoading'](_0xb11d93){this['_aiChatHistoryUi']['updateItemLoadingState'](_0xb11d93,null,!0x1);}['_handleHistoryErrorUI'](_0x8da709,_0x370c3c,_0x5ab71b){const _0x368f69=this['_generateErrorMessage'](_0x370c3c,_0x5ab71b);this['_aiChatHistoryUi']['showError'](_0x368f69),_0x5ab71b&&this['_clearItemLoading'](_0x5ab71b),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x4d4bd6,_0x20c0a0){const _0x20c42b=_0x20c0a0?this['history']['getItem'](_0x20c0a0):null,_0xb73e5d=_0x20c42b?.['title']||C(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x4d4bd6){case'updateItemTitle':return C(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0xb73e5d);case'updateItemPinned':{const _0x57a2b4=C(this['context']['locale'],_0x20c42b?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return C(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x57a2b4,_0xb73e5d]);}case'removeItem':return C(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0xb73e5d);case'init':case'loadItems':return C(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return C(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x1be4c2=new Date(),_0x4e4faa=new Date(_0x1be4c2['getFullYear'](),_0x1be4c2['getMonth'](),_0x1be4c2['getDate']()),_0x29ccee=new Date(_0x4e4faa);_0x29ccee['setDate'](_0x29ccee['getDate']()-0x1);const _0x4873b9=new Date(_0x4e4faa);_0x4873b9['setDate'](_0x4873b9['getDate']()-0xe);const _0xc8d002=this['history']['getItems']({'pinned':!0x0}),_0xba1cac=this['history']['getItems']({'from':_0x4e4faa,'to':_0x4e4faa}),_0x4b5ed5=this['history']['getItems']({'from':_0x29ccee,'to':_0x29ccee}),_0x2fd764=this['history']['getItems']({'from':_0x4873b9,'to':_0x29ccee}),_0x93a6e6=this['history']['getItems']({'to':_0x4873b9}),_0x303f8a=[];return _0xc8d002['length']>0x0&&_0x303f8a['push']({'title':C(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0xc8d002}),_0xba1cac['length']>0x0&&_0x303f8a['push']({'title':C(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0xba1cac}),_0x4b5ed5['length']>0x0&&_0x303f8a['push']({'title':C(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x4b5ed5}),_0x2fd764['length']>0x0&&_0x303f8a['push']({'title':C(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x2fd764}),_0x93a6e6['length']>0x0&&_0x303f8a['push']({'title':C(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x93a6e6}),_0x303f8a;}['_setIsMaximized'](_0x10721f){this['_aiChatHistoryUi']['setIsMaximized'](_0x10721f);}}class dt extends tt{static get['requires'](){return[jt,xt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Da extends tt{static get['requires'](){return[ct,l,mt,dt];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xe414dc){super(_0xe414dc),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),this['context']['config']['define']('ai.chat.models',{'defaultModelId':void 0x0,'modelSelectorAlwaysVisible':!0x0,'displayedModels':void 0x0});}async['addSelectionToChatContext'](){await this['context']['plugins']['get'](ct)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](ct)['startConversation']();}async['sendMessage']({message:_0x409e19,quickActionData:_0x58f5e2}){await this['context']['plugins']['get'](ct)['sendMessage']({'message':_0x409e19,'quickActionData':_0x58f5e2});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](ct)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](ct)['focusPromptInput']();}}class co extends Mt{constructor(_0xb5037f){super(_0xb5037f);const _0x5cc65a=_0xb5037f['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x5cc65a,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x59a40b=this['editor']['plugins']['get']('AITabs')['view'];_0x59a40b['isVisible']=!_0x59a40b['isVisible'];}}class qt extends _0x35c0a2{static get['requires'](){return[pt];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x486d0e=this['editor'];_0x486d0e['commands']['add']('toggleAi',new co(_0x486d0e)),_0x486d0e['ui']['componentFactory']['add']('toggleAi',()=>{const _0x11be86=this['_createAIUIButton'](_0x5ee277);return _0x11be86['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x11be86;}),_0x486d0e['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x3cdc7d=this['_createAIUIButton'](_0x2cc372);return _0x3cdc7d['set']({'role':'menuitemcheckbox'}),_0x3cdc7d;});}['_createAIUIButton'](_0x3cdb85){const _0x633075=this['editor'],_0x5b0af6=_0x633075['commands']['get']('toggleAi'),_0x1e85b0=new _0x3cdb85(_0x633075['locale']);return _0x1e85b0['set']({'label':C(_0x633075['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x29fd96,'isToggleable':!0x0}),_0x1e85b0['bind']('isEnabled')['to'](_0x5b0af6),_0x1e85b0['bind']('isOn')['to'](_0x5b0af6,'value',_0x3c59e5=>!!_0x3c59e5),this['listenTo'](_0x1e85b0,'execute',()=>{_0x5b0af6['execute']();}),_0x1e85b0;}}class Ma extends _0x35c0a2{static get['requires'](){return[qt,zt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Xt(_0x4dd3a4){const {editor:_0x31902e,action:_0x39a019,withText:_0x4c1395=!0x1,withIcon:_0x23e47b=!0x0,isInDropdown:_0x30aedf=!0x0,shouldPreventFocus:_0x3eeda2=!0x1}=_0x4dd3a4;return()=>{const _0xc34923=_0x31902e['locale'],_0x4daee3=new _0x5ee277(_0xc34923),_0x2b94e5=_0x4daee3['bindTemplate'];_0x30aedf&&_0x4daee3['extendTemplate']({'on':{'mouseenter':_0x2b94e5['to'](()=>{_0x3eeda2&&_0x3eeda2()||_0x4daee3['focus']();})}});const _0x28ae1f=_0x39a019['icon']??_0x39a019['parent']?.['icon'];return _0x4daee3['set']({'label':_0x39a019['displayedPrompt'],'withText':_0x4c1395,'role':'menuitem','icon':_0x23e47b?_0x28ae1f??_0x1cd5bc:void 0x0,'tooltip':!_0x4c1395,'class':'ck-ai-quick-actions-button','isEnabled':_0x39a019['isEnabled']}),_0x4daee3['on']('execute',()=>{_0x31902e['editing']['view']['focus'](),_0x31902e['commands']['execute']('aiQuickAction',_0x39a019);}),_0x4daee3;};}class Ss extends _0x79b3f5{['arrowView'];constructor(_0x5961dc,_0x76e64e){super(_0x5961dc,_0x76e64e);const _0x493d13=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',_0x3e4c52=>String(_0x3e4c52)),'data-cke-tooltip-disabled':_0x493d13['to']('isOn')},'on':{'mouseenter':_0x493d13['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x6fcfd7=new _0x53ac42();return _0x6fcfd7['content']=_0xab2de0,_0x6fcfd7['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x6fcfd7;}}class ys extends _0x40233d{['_allListItems'];['_allSearchableItems'];constructor(_0x4b4b6c,_0x2abc3d,_0x24cab6){super(_0x4b4b6c),this['_allListItems']=_0x2abc3d,this['_allSearchableItems']=_0x24cab6;}['filter'](_0x2aa6fc){if(!_0x2aa6fc)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x294f04=_0x2aa6fc['source']['toLowerCase']()['trim'](),_0x23e506=this['_allSearchableItems']['filter'](_0x94114e=>(_0x94114e['groupLabel']?_0x94114e['label']+'\x20('+_0x94114e['groupLabel']+')':_0x94114e['label'])['toLowerCase']()['includes'](_0x294f04));return this['items']['clear'](),this['items']['addMany'](_0x23e506['sort']((_0x12aa26,_0x394065)=>{const _0xb4d691=_0x12aa26['groupLabel'],_0x383ad0=_0x394065['groupLabel'];return _0xb4d691||_0x383ad0?_0xb4d691?0x1:-0x1:0x0;})['map'](_0x52d7fe=>_0x52d7fe['item'])),this['_highlightQuery'](_0x294f04,_0x23e506),{'resultsCount':_0x23e506['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x2d1ec3,_0x16f37b){if(!_0x2d1ec3)return;const _0x56491a=new RegExp(_0x44cebd(_0x2d1ec3),'gi');_0x16f37b['forEach'](_0x3e1635=>{_0x3e1635['highlightViews']&&_0x3e1635['highlightViews']['forEach'](_0xa1da3b=>{'function'==typeof _0xa1da3b['highlightText']&&_0xa1da3b['highlightText'](_0x56491a);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x4d24b0=>{_0x4d24b0['highlightViews']&&_0x4d24b0['highlightViews']['forEach'](_0x3acf7f=>{'function'==typeof _0x3acf7f['highlightText']&&_0x3acf7f['highlightText'](null);});});}}const Ts='menu',Rs='menuitem';class ao extends _0x3b9d21{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0xc616ac,_0x8abb26,_0x45b7e0,_0x1d330c,_0x7fd55d=!0x1){const _0x5d6387=_0xc616ac['locale'];super(_0x5d6387),this['_bodyCollection']=_0x1d330c,this['_hasSearch']=_0x7fd55d;const _0x434403=this['_createListItems'](_0xc616ac,_0x8abb26,_0x45b7e0);this['optionsListView']=new ys(_0x5d6387,_0x434403,this['_allSearchableItems']),this['optionsListView']['role']=Ts,this['optionsListView']['items']['addMany'](_0x434403),this['focusTracker']=new _0x5364ba(),this['keystrokes']=new _0x5593a8(),_0x7fd55d&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x434403,this['focusCycler']=new _0x1cce22({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x7fd55d&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x3dc309=_0x7fd55d&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x49e6be(_0x3dc309),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x5d6387['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x3cb991(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':C(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':C(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x1ec79f=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x1ec79f);}['_createListItems'](_0x21cb2e,_0x58e1f4,_0x3319f8){const _0x308afa=new _0x49e6be();return _0x58e1f4['forEach'](_0x5decc5=>{if('actions'in _0x5decc5){const {listItem:_0x2c6e4f}=this['_createActionGroupButton'](_0x21cb2e,_0x5decc5,_0x3319f8);_0x308afa['add'](_0x2c6e4f),_0x5decc5['actions']['forEach'](_0x35958d=>{this['_createActionButton'](_0x21cb2e,_0x35958d,_0x5decc5['label'],_0x5decc5['icon']);const {listItem:_0x1d1c7c,highlightViews:_0x546af3}=this['_createSearchResultActionButton'](_0x21cb2e,_0x35958d,_0x5decc5['label'],_0x5decc5['icon']);this['_allSearchableItems']['push']({'item':_0x1d1c7c,'label':_0x35958d['displayedPrompt'],'groupLabel':_0x5decc5['label'],'highlightViews':_0x546af3});});}else{const {listItem:_0x146343}=this['_createActionButton'](_0x21cb2e,_0x5decc5);_0x308afa['add'](_0x146343);const _0x1086d6=_0x146343['children']['first'];if(_0x1086d6){const {listItem:_0x4744f4,highlightViews:_0x41d55a}=this['_createSearchResultActionButton'](_0x21cb2e,_0x5decc5);this['_allSearchableItems']['push']({'item':_0x4744f4,'label':_0x1086d6['label']||'','highlightViews':_0x41d55a});}}}),_0x308afa;}['_createActionButton'](_0x2fef80,_0x52d5c9,_0x3f2ba7,_0x57648b){const _0x31122a=new _0x8173b9(this['locale']);if(_0x3f2ba7&&_0x57648b){const _0x145129=new _0x5ee277(this['locale']),_0x9fa7fc=_0x145129['bindTemplate'],_0x55c8f3=new _0x29efef();_0x55c8f3['text']=_0x52d5c9['displayedPrompt'];const _0x49c552=new _0x29efef();_0x49c552['text']=_0x3f2ba7;const _0x559e8f=new _0x53ac42();_0x559e8f['content']=_0x57648b,_0x559e8f['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x5098a3=new _0x3b9d21(this['locale']);_0x5098a3['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x485ed8=new _0x3b9d21(this['locale']);return _0x485ed8['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x145129['set']({'label':_0x52d5c9['displayedPrompt']+'\x20('+_0x3f2ba7+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x145129['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':[_0x55c8f3,_0x5098a3,_0x559e8f,_0x49c552,_0x485ed8],'on':{'mouseenter':_0x9fa7fc['to'](()=>{this['_isSearchFocused']()||_0x145129['focus']();}),'click':_0x9fa7fc['to'](()=>{_0x145129['fire']('execute');})}}),_0x145129['on']('execute',()=>{_0x2fef80['editing']['view']['focus'](),_0x2fef80['commands']['execute']('aiQuickAction',_0x52d5c9);}),_0x31122a['children']['add'](_0x145129),{'listItem':_0x31122a,'highlightViews':[_0x55c8f3,_0x49c552]};}{const _0x1a95cf=new _0x3ee38b(),_0x4c7778=new _0x5ee277(this['locale'],_0x1a95cf),_0x3e564c=_0x4c7778['bindTemplate'],_0x364f34=_0x52d5c9['icon']??_0x52d5c9['parent']?.['icon'],_0x16d462=void 0x0!==_0x52d5c9['icon'];return _0x4c7778['set']({'label':_0x52d5c9['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':_0x16d462?_0x364f34??_0x1cd5bc:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x4c7778['extendTemplate']({'on':{'mouseenter':_0x3e564c['to'](()=>{this['_isSearchFocused']()||_0x4c7778['focus']();})}}),_0x4c7778['on']('execute',()=>{_0x2fef80['editing']['view']['focus'](),_0x2fef80['commands']['execute']('aiQuickAction',_0x52d5c9);}),_0x31122a['children']['add'](_0x4c7778),{'listItem':_0x31122a,'highlightViews':[_0x1a95cf]};}}['_createSearchResultActionButton'](_0x319f7d,_0x13f662,_0x12b710,_0x579681){return _0x12b710&&_0x579681?this['_createSearchResultGroupedActionButton'](_0x319f7d,_0x13f662,_0x12b710,_0x579681):this['_createSearchResultIndividualActionButton'](_0x319f7d,_0x13f662);}['_createSearchResultGroupedActionButton'](_0x29b7fc,_0x4f32fa,_0x224e7a,_0x4635fa){const _0x457f93=new _0x8173b9(this['locale']),_0x1b365c=new _0x5ee277(this['locale']),_0xf66340=_0x1b365c['bindTemplate'],{view:_0x564af0,highlightView:_0x1c2fd2}=this['_createSearchResultGroupRow'](_0x224e7a,_0x4635fa),{view:_0x1c1992,highlightView:_0x1e75c1}=this['_createSearchResultActionRow'](_0x4f32fa['displayedPrompt']),_0x3b3988=this['_createSearchResultContentView'](_0x564af0,_0x1c1992);return _0x1b365c['set']({'label':_0x4f32fa['displayedPrompt'],'withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button\x20ck-ai-quick-actions-search-result-button_with-group','tooltip':!0x1}),_0x1b365c['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':[_0x3b3988],'on':{'mouseenter':_0xf66340['to'](()=>{this['_isSearchFocused']()||_0x1b365c['focus']();}),'click':_0xf66340['to'](()=>{this['_handleSearchResultButtonClick'](_0x1b365c);})}}),this['_setupActionButtonExecution'](_0x1b365c,_0x29b7fc,_0x4f32fa),_0x457f93['children']['add'](_0x1b365c),{'listItem':_0x457f93,'highlightViews':[_0x1c2fd2,_0x1e75c1]};}['_createSearchResultIndividualActionButton'](_0x21fcac,_0x381f1b){const _0x2f6f3f=new _0x8173b9(this['locale']),_0xf14bf7=new _0x3ee38b(),_0x46f58b=new _0x5ee277(this['locale'],_0xf14bf7),_0x318a1a=_0x46f58b['bindTemplate'];return _0x46f58b['set']({'label':_0x381f1b['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x46f58b['extendTemplate']({'on':{'mouseenter':_0x318a1a['to'](()=>{this['_isSearchFocused']()||_0x46f58b['focus']();})}}),this['_setupActionButtonExecution'](_0x46f58b,_0x21fcac,_0x381f1b),_0x2f6f3f['children']['add'](_0x46f58b),{'listItem':_0x2f6f3f,'highlightViews':[_0xf14bf7]};}['_createSearchResultGroupRow'](_0x3d0182,_0x541df7){const _0x587ca6=new _0x3b9d21(this['locale']),_0x55a3ca=new _0x53ac42();_0x55a3ca['content']=_0x541df7,_0x55a3ca['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x523eee=new _0x29efef();return _0x523eee['text']=_0x3d0182,_0x587ca6['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x55a3ca,_0x523eee]}),{'view':_0x587ca6,'highlightView':_0x523eee};}['_createSearchResultActionRow'](_0x428117){const _0x3c1327=new _0x3b9d21(this['locale']),_0x4c42b4=new _0x29efef();return _0x4c42b4['text']=_0x428117,_0x3c1327['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x4c42b4]}),{'view':_0x3c1327,'highlightView':_0x4c42b4};}['_createSearchResultContentView'](_0x166a55,_0xac1744){const _0x568a16=new _0x3b9d21(this['locale']);return _0x568a16['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x166a55,_0xac1744]}),_0x568a16;}['_setupActionButtonExecution'](_0x36fd7e,_0x490bf5,_0x53f92c){_0x36fd7e['on']('execute',()=>{_0x490bf5['editing']['view']['focus'](),_0x490bf5['commands']['execute']('aiQuickAction',_0x53f92c);});}['_createActionGroupButton'](_0x3637a4,_0x238c92,_0x12421b){const _0x38d3ea=new _0x8173b9(this['locale']),_0x3110fd=new _0x3ee38b(),_0x11d649=new Ss(this['locale'],_0x3110fd),_0x1d6597=_0x11d649['bindTemplate'],_0x3de3d9=this['_getPanelKeystroke'](_0x12421b),_0x290ed1=this['_createGroupActionsList'](_0x3637a4,_0x238c92['actions'],_0x12421b);_0x11d649['set']({'label':_0x238c92['label'],'withText':!0x0,'role':Rs,'icon':_0x238c92['icon']??_0x1cd5bc,'isEnabled':_0x238c92['actions']['some'](_0x3587dd=>_0x3587dd['isEnabled'])}),_0x11d649['extendTemplate']({'on':{'mouseenter':_0x1d6597['to'](()=>{this['_isSearchFocused']()||_0x11d649['focus']();})}});const _0x381243=new _0x509620(this['locale']);return _0x381243['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x1d6597['to'](_0x398b76=>{this['_handlePanelKeydown'](_0x398b76,_0x3de3d9,_0x11d649,_0x381243);})}}),_0x11d649['bind']('isOn')['to'](_0x381243,'isVisible'),this['_bodyCollection']['add'](_0x381243),_0x381243['content']['add'](_0x290ed1),this['_setupGroupMenuBehavior'](_0x11d649,_0x381243),_0x38d3ea['children']['add'](_0x11d649),{'listItem':_0x38d3ea,'highlightView':_0x3110fd};}['_createGroupActionsList'](_0x9a640d,_0x1794f2,_0x2b285b){const _0xb2ca28=new _0x40233d(this['locale']);return _0xb2ca28['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x1794f2['forEach'](_0x35829b=>{const _0x1920b4=new _0x8173b9(this['locale']),_0x362370=Xt({'editor':_0x9a640d,'action':_0x35829b,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x1920b4['children']['add'](_0x362370),_0x2b285b['focusTracker']['add'](_0x362370),_0xb2ca28['items']['add'](_0x1920b4);}),_0xb2ca28;}['_setupGroupMenuBehavior'](_0x1dc4d6,_0x2ba5bc){const _0x2c6d2a=_0x1dc4d6['bindTemplate'],_0x1498e2=this['_getButtonKeystroke'](_0x1dc4d6);_0x1dc4d6['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x2c6d2a['to'](()=>{this['_showNestedPanel'](_0x2ba5bc,_0x1dc4d6);}),'mouseleave':_0x2c6d2a['to'](_0x1b0f5d=>{const _0x48f513=_0x1b0f5d['relatedTarget'];this['_isMovingToNestedMenu'](_0x48f513,_0x2ba5bc)||this['_hideNestedPanel'](_0x2ba5bc);}),'keydown':_0x2c6d2a['to'](_0x3628eb=>{_0x3628eb['key']==_0x1498e2&&(this['_showNestedPanel'](_0x2ba5bc,_0x1dc4d6),_0x2ba5bc['content']['get'](0x0)['focus']());})}}),_0x2ba5bc['on']('render',()=>{_0x2ba5bc['element']?.['addEventListener']('mouseleave',_0x4bcb6e=>{const _0x4fcc31=_0x4bcb6e['relatedTarget'];_0x1dc4d6['element']?.['contains'](_0x4fcc31)||this['_isMovingToNestedMenu'](_0x4fcc31,_0x2ba5bc)||this['_hideNestedPanel'](_0x2ba5bc);});});}['_showNestedPanel'](_0x445406,_0x4c7627){this['_openNestedPanels']['forEach'](_0x49c214=>{_0x49c214!==_0x445406&&_0x49c214['isVisible']&&_0x49c214['hide']();}),_0x445406['show'](),_0x445406['pin']({'positions':[_0x253906['eastSouth']],'target':_0x4c7627['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x445406);}['_hideNestedPanel'](_0x41f897){_0x41f897['hide'](),this['_openNestedPanels']['delete'](_0x41f897);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x555882=>_0x555882['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x5ed9b9,_0x495514){if(!_0x5ed9b9)return!0x1;if(_0x495514['element']?.['contains'](_0x5ed9b9))return!0x0;const _0x23ea9c=_0x5ed9b9;return _0x23ea9c['closest']&&(null!==_0x23ea9c['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x23ea9c['closest']('.ck-ai-quick-actions-group-list')||null!==_0x23ea9c['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'](_0x3c824e){return'rtl'===_0x3c824e['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x555d65){return'rtl'===_0x555d65['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x1635e4,_0x9b3331,_0x38720b,_0x507908){_0x1635e4['key']==_0x9b3331&&(_0x38720b['focus'](),this['_hideNestedPanel'](_0x507908));}['_handleSearchResultButtonClick'](_0x50af57){_0x50af57['fire']('execute');}}function Vt(_0x23c70e){const {editor:_0xefd20b,content:_0x5134fc,buttonDefinition:_0x36ab4b,bodyCollection:_0x553ecc,hasSearch:_0x175fcf=!0x1}=_0x23c70e;return()=>{const _0x3be30d=_0xefd20b['locale'],_0xc66ec8=_0x36aac4(_0x3be30d);_0xc66ec8['buttonView']['set']({'icon':_0x36ab4b['icon']??_0x1cd5bc,'label':_0x36ab4b['label'],'tooltip':!0x0}),_0xc66ec8['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x4380b8=new ao(_0xefd20b,_0x5134fc,_0xc66ec8,_0x553ecc,_0x175fcf);if(_0xc66ec8['panelView']['children']['add'](_0x4380b8),_0x175fcf){const _0x27dac2='ai-quick-actions-dropdown-selection';_0xc66ec8['on']('change:isOpen',(_0xbf20e7,_0x10c035,_0x3baaeb)=>{if(_0x3baaeb){if(_0xefd20b['plugins']['has']('AIEditing')){const _0x306966=_0xefd20b['plugins']['get'](l),_0x59d2c0=_0xefd20b['model']['document']['selection'],_0x35e0bc=Array['from'](_0x59d2c0['getRanges']());_0x35e0bc['length']>0x0&&_0x306966['showFakeVisualSelection'](_0x35e0bc,_0x27dac2,!0x1,!0x0);}}else _0xefd20b['plugins']['has']('AIEditing')&&_0xefd20b['plugins']['get'](l)['hideFakeVisualSelection'](_0x27dac2),_0x4380b8['resetSearch']();});}return _0xc66ec8;};}const te='<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>',ee='<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>',ie='<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 Dt=function(_0x2308b3){return _0x2308b3['CHAT']='CHAT',_0x2308b3['ACTION']='ACTION',_0x2308b3['REVIEW']='REVIEW',_0x2308b3;}({}),Ua=function(_0x48f4f8){return _0x48f4f8['CHAT']='AIChat',_0x48f4f8['ACTION']='AIActions',_0x48f4f8['REVIEW']='AIReviewMode',_0x48f4f8;}({});class ri extends _0x35c0a2{static get['requires'](){return[Zt];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x4457c7=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x4457c7),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x37a09f){return function(_0x492ef1){const _0x17246a=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x492ef1['uiLanguage']),_0x129ef6=_0x17246a||'English',_0x2ebafe=[{'id':'ask-ai','displayedPrompt':C(_0x492ef1,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Yt},{'id':'chat-commands','label':C(_0x492ef1,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Yt,'actions':[{'id':'explain','displayedPrompt':C(_0x492ef1,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':te['replace']('%0',_0x129ef6),'type':'CHAT'},{'id':'summarize','displayedPrompt':C(_0x492ef1,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':ee['replace']('%0',_0x129ef6),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':C(_0x492ef1,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':ie['replace']('%0',_0x129ef6),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':C(_0x492ef1,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Wt},{'id':'continue','displayedPrompt':C(_0x492ef1,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Gt},{'id':'fix-grammar','displayedPrompt':C(_0x492ef1,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Ft},{'id':'adjust-length','label':C(_0x492ef1,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Qt,'actions':[{'id':'make-shorter','displayedPrompt':C(_0x492ef1,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':C(_0x492ef1,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':C(_0x492ef1,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Kt,'actions':[{'id':'make-tone-casual','displayedPrompt':C(_0x492ef1,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':C(_0x492ef1,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':C(_0x492ef1,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':C(_0x492ef1,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':C(_0x492ef1,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':C(_0x492ef1,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Jt,'actions':[{'id':'translate-to-english','displayedPrompt':C(_0x492ef1,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':C(_0x492ef1,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':C(_0x492ef1,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':C(_0x492ef1,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':C(_0x492ef1,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':C(_0x492ef1,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':C(_0x492ef1,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':C(_0x492ef1,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':C(_0x492ef1,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':C(_0x492ef1,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':C(_0x492ef1,'AI_QUICK_ACTIONS_OTHER'),'icon':Bt,'actions':[]}];return _0x2ebafe;}(_0x37a09f);}async['_getDefaultAndCustomActions'](){const _0x2106a2=ri['getDefaultQuickActions'](this['editor']['locale']),_0x45afbe=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x462642=[];try{_0x462642=await new ft({'connector':this['editor']['plugins']['get']('AIConnector'),'availableModels':this['editor']['config']['get']('ai.chat.models.displayedModels'),'locale':this['editor']['locale']})['getAvailableModels']();}catch(_0x43363c){const _0x5f1aa5=new _0x15f966('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x43363c});gt(_0x5f1aa5['message']);}finally{const _0x14284f=_0x45afbe['map'](_0x1e241a=>({..._0x1e241a,'icon':void 0x0}));_0x2106a2['find'](_0x5010f7=>'other'===_0x5010f7['id'])['actions']['push'](..._0x14284f),_0x2106a2['forEach'](_0xd0c154=>{if('actions'in _0xd0c154)_0xd0c154['actions']['forEach'](_0xfbf34f=>{if(_0xfbf34f['isEnabled']=!!_0x462642['find'](_0x5c93cf=>_0x5c93cf['id']===_0xfbf34f['model'])||void 0x0===_0xfbf34f['model'],!_0xfbf34f['isEnabled']){const _0x5162cf=new _0x15f966('ai-quick-actions-unavailable-model',this,{'actionId':_0xfbf34f['id'],'modelId':_0xfbf34f['model']});gt(_0x5162cf['message']);}});else{if(_0xd0c154['isEnabled']=!!_0x462642['find'](_0x317ff9=>_0x317ff9['id']===_0xd0c154['model'])||void 0x0===_0xd0c154['model'],!_0xd0c154['isEnabled']){const _0x177692=new _0x15f966('ai-quick-actions-unavailable-model',this,{'actionId':_0xd0c154['id'],'modelId':_0xd0c154['model']});gt(_0x177692['message']);}}});}return _0x2106a2;}['_initializeQuickActionsComponentsAndCommands'](){const _0x2f0847=new _0x57ac2d(this['editor']['locale']);_0x2f0847['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x2f0847),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x2f0847);}['_initializeQuickActionsDropdown'](_0x424289){const _0x5009bd=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Vt({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x1cd5bc,'label':C(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x424289,'hasSearch':_0x5009bd}));}['_prepareQuickActionsDefinition'](_0x2b008e){this['_quickActionsDefinition']=_0x2b008e['map'](_0x2b882b=>{if('actions'in _0x2b882b){const _0x39225f=_0x2b882b;return{..._0x39225f,'actions':_0x39225f['actions']['map'](_0x4ced63=>{const {actions:_0x55cd8b,..._0x3b6c77}=_0x39225f;return{..._0x4ced63,'parent':_0x3b6c77};})['filter'](_0x143b31=>this['_shouldIncludeAction'](_0x143b31))};}return _0x2b882b;})['filter'](_0x267949=>'actions'in _0x267949?_0x267949['actions']['length']>0x0:this['_shouldIncludeAction'](_0x267949));}['_shouldIncludeAction'](_0x172ae7){const _0x33700f=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ua[_0x172ae7['type']])&&!_0x33700f['includes'](_0x172ae7['id'])&&!('CHAT'===_0x172ae7['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x257cce){this['_quickActionsDefinition']['forEach'](_0x36d2cb=>{if('actions'in _0x36d2cb){const _0x1ddeff=Vt({'editor':this['editor'],'content':_0x36d2cb['actions'],'buttonDefinition':_0x36d2cb,'bodyCollection':_0x257cce});this['editor']['ui']['componentFactory']['add'](_0x36d2cb['id'],_0x1ddeff),_0x36d2cb['actions']['forEach'](_0x20e6d0=>{const _0x10f046=Xt({'editor':this['editor'],'action':_0x20e6d0});this['editor']['ui']['componentFactory']['add'](_0x20e6d0['id'],_0x10f046);});}else{const _0x153b43=Xt({'editor':this['editor'],'action':_0x36d2cb,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x36d2cb['id'],_0x153b43);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x55d4f8=>{const _0x491d60=new _0x2c511b(_0x55d4f8),_0x4c3f3d=C(_0x55d4f8,'AI_QUICK_ACTIONS_HEADING');_0x491d60['buttonView']['set']({'label':_0x4c3f3d,'icon':_0x1cd5bc});const _0x5ec2b2=new _0x1f7c03(_0x55d4f8);_0x5ec2b2['set']({'ariaLabel':_0x4c3f3d,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x61a35d=>{if('actions'in _0x61a35d){const _0x15fb30=_0x61a35d,_0x2327c0=new _0x44c9e0(_0x55d4f8,_0x491d60),_0x11144f=new _0x2c511b(_0x55d4f8),_0x4cc1f9=new _0x1f7c03(_0x55d4f8);_0x11144f['buttonView']['set']({'label':_0x15fb30['label'],'icon':_0x15fb30['icon']}),_0x15fb30['actions']['forEach'](_0x5227a3=>{const _0x4e35b5=new _0x44c9e0(_0x55d4f8,_0x11144f),_0x2fd126=new _0x2cc372(_0x55d4f8);_0x2fd126['set']({'label':_0x5227a3['displayedPrompt'],'icon':_0x5227a3['icon'],'role':'menuitem','isEnabled':_0x5227a3['isEnabled']}),_0x2fd126['on']('execute',()=>{this['_executeQuickAction'](_0x5227a3);}),_0x2fd126['delegate']('execute')['to'](_0x11144f),_0x4e35b5['children']['add'](_0x2fd126),_0x4cc1f9['items']['add'](_0x4e35b5);}),_0x11144f['panelView']['children']['add'](_0x4cc1f9),_0x2327c0['children']['add'](_0x11144f),_0x5ec2b2['items']['add'](_0x2327c0);}else{const _0xe6b9e6=_0x61a35d,_0x38ac20=new _0x44c9e0(_0x55d4f8,_0x491d60),_0x14414b=new _0x2cc372(_0x55d4f8);_0x14414b['set']({'label':_0xe6b9e6['displayedPrompt'],'icon':_0xe6b9e6['icon'],'role':'menuitem','isEnabled':_0xe6b9e6['isEnabled']}),_0x14414b['on']('execute',()=>{this['_executeQuickAction'](_0xe6b9e6);}),_0x14414b['delegate']('execute')['to'](_0x491d60),_0x38ac20['children']['add'](_0x14414b),_0x5ec2b2['items']['add'](_0x38ac20);}});const _0x2c39ab=Object['values'](Ua)['some'](_0x3fb038=>this['editor']['plugins']['has'](_0x3fb038));return _0x491d60['set']({'isEnabled':_0x2c39ab}),_0x491d60['panelView']['children']['add'](_0x5ec2b2),_0x491d60;});}['_executeQuickAction'](_0x4f61d3){const _0x1ddfb8=this['editor'];_0x1ddfb8['editing']['view']['focus'](),_0x1ddfb8['commands']['execute']('aiQuickAction',_0x4f61d3);const _0x28fc98=_0x1ddfb8['ui']['view']['menuBarView'];_0x28fc98&&_0x28fc98['close']&&_0x28fc98['close']();}}class ni extends Mt{['execute'](_0x3df562){switch(this['_expandSelectionIfCollapsed'](),_0x3df562['type']){case Dt['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x2eec08=C(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x15f966('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x2eec08});}this['_handleAIChatAction'](_0x3df562);break;case Dt['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x9dafea=C(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x15f966('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x9dafea});}this['_handleAIActionsAction'](_0x3df562);break;case Dt['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x4c957c=C(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x15f966('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x4c957c});}this['_handleAIReviewAction'](_0x3df562);}}async['_handleAIChatAction'](_0x572e52){const _0x2d5cce=this['editor']['plugins']['get']('AIChat'),_0x4c2cc5=this['editor']['plugins']['get']('AIChatController'),_0x274789=this['editor']['plugins']['get']('AITabs')['view'];if(_0x274789['isVisible']||(_0x274789['isVisible']=!0x0),'chat'!==_0x274789['activeTab']&&_0x274789['activateTab']('chat'),'ask-ai'===_0x572e52['id'])_0x4c2cc5['removeSelectionFromChatContext'](),await _0x2d5cce['addSelectionToChatContext'](),_0x2d5cce['focusPromptInput']();else await _0x2d5cce['startConversation'](),_0x4c2cc5['removeSelectionFromChatContext'](),await _0x2d5cce['addSelectionToChatContext'](),_0x2d5cce['focusPromptInput'](),await _0x2d5cce['sendMessage']({'message':_0x572e52['prompt']||_0x572e52['displayedPrompt'],'quickActionData':{'id':_0x572e52['id'],'displayedPrompt':_0x572e52['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x3197be=this['editor'],_0x475b7a=_0x3197be['model']['document']['selection'];if(!_0x475b7a['isCollapsed'])return;const _0x366d77=_0x37a4b7(_0x475b7a['getSelectedBlocks']())||_0x3197be['model']['schema']['getLimitElement'](_0x475b7a);_0x3197be['model']['change'](_0xf0c1e0=>{_0xf0c1e0['setSelection'](_0x366d77,'in');});}['_handleAIActionsActionLabel'](_0x4cbd64){return _0x4cbd64['parent']?.['label']&&'other'!==_0x4cbd64['parent']?.['id']?_0x4cbd64['parent']['label']+':\x20'+_0x4cbd64['displayedPrompt']:_0x4cbd64['displayedPrompt'];}async['_handleAIActionsAction'](_0x59caa8){const _0x1dd174=this['editor']['plugins']['get']('AIActions'),_0x247e08=_0x59caa8['prompt']?{'userMessage':_0x59caa8['prompt'],'model':_0x59caa8['model']}:{'actionName':_0x59caa8['actionName']||_0x59caa8['id'],'args':_0x59caa8['args']},_0x56ba68=this['_handleAIActionsActionLabel'](_0x59caa8);await _0x1dd174['executeAction'](_0x247e08,_0x56ba68,_0x59caa8['icon']);}async['_handleAIReviewAction'](_0x18f89b){console['log']('handleAIReviewAction',_0x18f89b);}}class ci extends _0x35c0a2{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x912f2=this['editor'],_0x4b4623=new ni(this['editor']);if(_0x912f2['commands']['add']('aiQuickAction',_0x4b4623),_0x912f2['plugins']['has']('AIChat')){const _0xcded2a=this['editor']['plugins']['get']('AIChat');_0x912f2['model']['document']['selection']['on']('change:range',(_0x5e33dd,_0x56b3b0)=>{_0x56b3b0['directChange']&&_0xcded2a['removeSelectionFromChatContext']();});}}}class ye extends je{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x338b84=this['documentContextContent']['children']['map'](_0x5aacb6=>({'node':_0x5aacb6,'id':yt(_0x5aacb6,'data-id')})),_0x4d34f5=this['parsedMergedContent']['children']['map'](_0x2ae9fb=>({'node':_0x2ae9fb,'id':yt(_0x2ae9fb,'data-id')||_0x53b360()})),_0xfa0eab=_0x16e846(_0x338b84,_0x4d34f5,{'comparator':(_0x53b0af,_0x49357c)=>_0x53b0af['id']==_0x49357c['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0xfa0eab['length']&&_0xfa0eab[_0xfa0eab['length']-0x1]['removed'];)_0xfa0eab['pop']();}const _0x5c5c66=_0xfa0eab['map'](_0x199b17=>{const _0x5b832f=_0x199b17['added']?'new':_0x199b17['removed']?'removed':'modified';return{'node':_0x199b17['value'][0x0]['node'],'type':_0x5b832f,'id':_0x199b17['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x5c5c66,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0xc15197,_0x41e4a3){return _0x41e4a3;}}class u extends pe{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x159da5){super(_0x159da5),this['content']=_0x159da5['content'],this['version']=_0x159da5['version'],this['actionName']=_0x159da5['actionName'],this['args']=_0x159da5['args'],this['userMessage']=_0x159da5['userMessage'],this['model']=_0x159da5['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':xe['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x2d9ef0){const _0x1cf977=new ye({'editor':this['editor'],'documentContextContent':this['content'],..._0x2d9ef0});return this['replies']['push'](_0x1cf977),_0x1cf977['delegate'](...ge)['to'](this),this['fire']('replyCreated',_0x1cf977),_0x1cf977;}}class oi extends _0x35c0a2{static get['requires'](){return[s,_0x416bba,l,_,_0x16a419];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_customViews']=new _0x49e6be();['_navigationPreviousButton'];['_navigationCounter'];['_isNavigationCounterInView']=!0x1;['_navigationNextButton'];['_isNavigationPreviousButtonInView']=!0x1;['_isNavigationNextButtonInView']=!0x1;['_promiseQueue'];['_bodyCollection'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}constructor(_0x5d1339){super(_0x5d1339),this['_bodyCollection']=new _0x57ac2d(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new y(),this['_setupCustomViews']();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x577dd0,_0x3e5657,_0x4dcfce){if(this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0xd37553,anchorData:_0x1c63df}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x577dd0,_0xd37553,_0x1c63df,_0x3e5657,_0x4dcfce);}}const {modelFragment:_0x56ccc0,anchorData:_0x255165}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x577dd0,_0x56ccc0,_0x255165,_0x3e5657,_0x4dcfce);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_getExecuteDataRegular'](){const _0x27d5bd=this['editor']['model']['document']['selection'];if(_0x27d5bd['isCollapsed']){const _0x59cda9=_0x37a4b7(_0x27d5bd['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x27d5bd);this['editor']['model']['change'](_0x48bc09=>{_0x48bc09['setSelection'](_0x59cda9,'in');});}const _0x5c5a56=_0x27d5bd['getFirstRange'](),_0x491146=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x27d5bd),_0x5c5a56['start'],_0x5c5a56['end']),_0x279ef8=_0x27d5bd['getFirstRange']()['start'],_0x45e327=new Map();let _0x46aa1f=_0x491146;for(let _0x1711a0=0x0;_0x1711a0<_0x279ef8['path']['length'];_0x1711a0++)_0x45e327['set'](_0x46aa1f,_0x279ef8['path'][_0x1711a0]),_0x46aa1f=_0x46aa1f['getChild'](0x0);return{'modelFragment':_0x491146,'anchorData':_0x45e327};}['_getExecuteDataInTable'](){const _0x4060b6=this['editor']['model']['document']['selection'],_0x5bb8c7=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x2d46e9=_0x4060b6['getFirstRange']()['start']['parent']['parent'],_0x1c0fdb=this['_wrapWithCommonAncestors'](_0x5bb8c7,this['editor']['model']['createPositionBefore'](_0x2d46e9),this['editor']['model']['createPositionAfter'](_0x2d46e9)),_0x2e4546=_0x4060b6['getFirstRange']()['start'],_0x5ef032=new Map();let _0x1bb8a0=_0x1c0fdb;for(let _0x181a7f=0x0;_0x181a7f<_0x2e4546['path']['length'];_0x181a7f++)if(_0x5ef032['set'](_0x1bb8a0,_0x2e4546['path'][_0x181a7f]),_0x181a7f<_0x2e4546['path']['length']-0x1)_0x1bb8a0=_0x1bb8a0['getChild'](0x0);else{let _0x272949=_0x1bb8a0['nextSibling'];for(;_0x272949;)_0x5ef032['set'](_0x272949,_0x2e4546['path'][_0x181a7f]),_0x272949=_0x272949['nextSibling'];}return{'modelFragment':_0x1c0fdb,'anchorData':_0x5ef032};}['_executeAction'](_0x446af4,_0x3bf6d2,_0x4d27cd,_0x3d4f3f,_0x15178f){const _0x130f41=this['editor']['plugins']['get'](l),_0x4d6c00=this['editor']['plugins']['get'](_),_0x5e06e9=this['editor']['model']['document']['selection'],_0x1326e3=_0x130f41['modelToViewWithIds'](_0x3bf6d2),_0x598e6d=this['editor']['data']['processor']['toData'](_0x1326e3),_0x2067be=this['editor']['model']['document']['version'],_0x4c852b=[..._0x5e06e9['getRanges']()];let _0x3ecfab=this['editor']['config']['get']('ai.availableReplyActions')||[...x];this['editor']['plugins']['has']('TrackChanges')||(_0x3ecfab=_0x3ecfab['filter'](_0x1ba5ff=>'insertSuggestion'!=_0x1ba5ff));const _0x570ecd=new e(this['editor']['locale'],{'showDiff':!0x1,'areActionsDisabled':!0x1,'hideHeader':!0x0,'showLoader':!0x0,'miniToolbarConfig':{'showChanges':'icon','customView':this['_customViews']},'showUnchangedParts':!0x0,'availableActions':_0x3ecfab},this['_bodyCollection']);return _0x4d6c00['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x3d4f3f,'icon':_0x15178f||_0x1cd5bc,'mainView':_0x570ecd,'showRotator':!0x1,'showApplyButton':!0x0,'showSuggestButton':this['editor']['plugins']['has']('TrackChanges'),'ranges':_0x4c852b}),this['_setLoadingState'](_0x570ecd,_0x4d6c00),this['listenTo'](_0x4d6c00,'applySuggestion',()=>{this['_applyChanges'](_0x3bf6d2,_0x4d27cd,!0x1);}),this['listenTo'](_0x4d6c00,'insertSuggestion',()=>{this['_applyChanges'](_0x3bf6d2,_0x4d27cd,!0x0);}),this['listenTo'](_0x4d6c00,'selectionRemoved',()=>{this['_stopInteraction'](),this['_disableCustomViews']();}),this['listenTo'](_0x4d6c00,'dialogClosed',()=>{if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x5efe85=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x418c3e=_0x5efe85['changeGroups'][0x0];_0x418c3e&&'pending'===_0x418c3e['state']&&_0x5efe85['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](_0x4d6c00);}),this['_createInteraction'](_0x598e6d,_0x2067be,_0x570ecd,_0x4d6c00,_0x446af4);}['_wrapWithCommonAncestors'](_0x5b3726,_0x4138c8,_0x2d6569){const _0x1ae7de=this['editor']['model']['createRange'](_0x4138c8,_0x2d6569)['getCommonAncestor'](),_0x750ca=_0x1ae7de['is']('documentFragment')?[]:_0x1ae7de['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x750ca['length']){const _0x3b6497=_0x750ca['map'](_0x27508f=>_0x27508f['_clone'](!0x1));for(let _0x3c99d1=0x1;_0x3c99d1<_0x3b6497['length'];_0x3c99d1++)_0x3b6497[_0x3c99d1-0x1]['_appendChild'](_0x3b6497[_0x3c99d1]);return _0x3b6497[_0x3b6497['length']-0x1]['_appendChild'](_0x5b3726),new _0xce7080(_0x3b6497[0x0]);}return _0x5b3726;}async['_createInteraction'](_0x2992de,_0x38f05b,_0x580c8b,_0x389641,_0x143597){const _0x2ced93=this['editor'];this['_interactionParams']={'action':_0x143597,'content':_0x2992de,'version':_0x38f05b,'mainView':_0x580c8b,'aiBalloon':_0x389641};const _0x1ce039=new u({'connector':this['_aiConnector'],'editor':_0x2ced93,'content':_0x2992de,'version':_0x38f05b,..._0x143597});this['_interactions']['push'](_0x1ce039),_0x580c8b['hideError']();const _0xa3b25a=(_0xd59415,_0x5d598e,_0x2b3096=!0x1,_0xcf81cb='streaming')=>this['_promiseQueue']['enqueue'](async _0x23166b=>{try{const _0x33e132=I({'editor':_0x2ced93,'changeGroups':_0xd59415['changeGroups'],'documentContextContent':_0xd59415['documentContextContent'],'showDiff':_0x2b3096,'trimUnchanged':!0x1});await _0x5d598e['updateContent']({'parts':_0x33e132,'renderingStrategy':_0xcf81cb,'abortSignal':_0x23166b});}catch(_0x42b7a2){if(this['_isAbortError'](_0x42b7a2))return;throw _0x42b7a2;}});this['_interaction']['on']('replyCreated',(_0x1021f3,_0x5f3145)=>{_0x580c8b['hideLoader'](),_0x389641['startAutoScroll'](),_0xa3b25a(_0x5f3145,_0x580c8b)['catch'](_0x56f9f3=>{this['_isAbortError'](_0x56f9f3)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x56f9f3),this['_setErrorState'](_0x1ce039,_0x580c8b));});}),this['_interaction']['on']('replyContentUpdated',(_0x3ea646,_0x144574)=>{_0xa3b25a(_0x144574,_0x580c8b)['catch'](_0x3edc27=>{this['_isAbortError'](_0x3edc27)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x3edc27),this['_setErrorState'](_0x1ce039,_0x580c8b));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](_0x580c8b,_0x389641),this['_updateNavigationUI'](),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x3e6a0f){this['_isAbortError'](_0x3e6a0f)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x3e6a0f),this['_setErrorState'](_0x1ce039,_0x580c8b));}finally{_0x389641['stopAutoScroll']();}}),this['listenTo'](_0x580c8b,'toggleSuggestionDisplayMode',async(_0x586f9a,{showDiff:_0x1bcce0})=>{try{this['_balloonShowDiff']=_0x1bcce0;const _0x2ce397=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x2ce397&&await _0xa3b25a(_0x2ce397,_0x580c8b,_0x1bcce0,'static');}catch(_0x52fa53){this['_isAbortError'](_0x52fa53)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x52fa53),this['_setErrorState'](_0x1ce039,_0x580c8b));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0xc45d59,{reply:_0x505473})=>{const _0x4cf367={'positiveCount':_0x505473['changeGroups']['filter'](_0x160929=>'accepted'===_0x160929['state'])['length'],'totalCount':_0x505473['changeGroups']['length']},_0x38322f=this['_interaction']['actionCallId'],_0x4b523d=this['_interaction']['actionName'];_0x4b523d?this['_aiConnector']['upsertAIActionRating'](_0x4b523d,_0x38322f,_0x4cf367):this['_aiConnector']['upsertCustomAIActionRating'](_0x38322f,_0x4cf367);}),this['_setLoadingState'](_0x580c8b,_0x389641);try{const _0x1b5741=await this['_interaction']['start']();return this['_updateNavigationUI'](),_0x1b5741;}catch(_0x5d1b4a){if(this['_isAbortError'](_0x5d1b4a))return;_0x580c8b['hideLoader'](),this['_setErrorState'](_0x1ce039,_0x580c8b);}}['_applyChanges'](_0x296b0b,_0x6e1e48,_0x3245da){const _0x4832c3=this['editor'];if(_0x3245da&&!_0x4832c3['plugins']['has']('TrackChanges'))throw new _0x15f966('ai-no-track-changes',null);const _0x562432=this['editor']['plugins']['get'](_0x16a419),_0x5cdafe=this['_interaction'],_0x1065de=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x30f819=_0x1065de['changeGroups'];_0x1065de['setChangeGroupState'](0x0,'accepted');let _0x42390d=A({'editor':_0x4832c3,'reply':_0x1065de,'interaction':_0x5cdafe,'groups':_0x30f819,'transform':!0x1,'documentCompare':_0x562432,'documentCompareOptions':{'anchor':_0x4832c3['model']['createPositionAt'](_0x296b0b,0x0),'markDeletions':_0x3245da}});_0x42390d=this['_filterOperationsOutsideRange'](_0x42390d,_0x6e1e48);for(const _0x5d01f7 of _0x42390d)this['_anchorOperation'](_0x6e1e48,_0x5d01f7,_0x4832c3['model']['document']['getRoot']());const _0x6d746c=_0x5cdafe['getDocumentContext']()['version'],_0x263ced=_0x4832c3['model']['document']['history']['getOperations'](_0x6d746c),_0x320b52={'document':_0x4832c3['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x9276fe=_0x47c5f7(_0x42390d,_0x263ced,_0x320b52)['operationsA'];_0x4832c3['model']['change'](_0x3979f2=>{if(_0x3979f2['setSelection'](_0x4832c3['model']['document']['selection']['focus']),_0x3245da)_0x4832c3['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x9276fe);else{for(const _0x53a7bc of _0x9276fe)_0x53a7bc['baseVersion']=_0x4832c3['model']['document']['version'],v(_0x4832c3,_0x53a7bc),_0x3979f2['batch']['addOperation'](_0x53a7bc),_0x4832c3['model']['applyOperation'](_0x53a7bc);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x2dc8ce,_0x2d6c3c){return _0x2dc8ce['filter'](_0x278b9d=>{if('rename'==_0x278b9d['type']){const _0x194e42=_0x278b9d['position']['nodeAfter'];return!_0x2d6c3c['has'](_0x194e42);}if(_0x278b9d['type']['indexOf']('Attribute')>-0x1){const _0x555f25=_0x278b9d['range']['start']['nodeAfter'];return!_0x2d6c3c['has'](_0x555f25);}return!0x0;});}['_anchorOperation'](_0x4955a3,_0x29e0a7,_0x36fb8d){const _0x34ee03=_0x29e0a7['clone']();for(const _0x495e99 in _0x29e0a7){const _0x5f535b=_0x29e0a7[_0x495e99];_0x5f535b instanceof _0x4a8fb1?_0x29e0a7[_0x495e99]=new _0x4a8fb1(_0x3bcbc1(_0x5f535b['start']),_0x3bcbc1(_0x5f535b['end'])):_0x5f535b instanceof _0x1e8cb7&&(_0x29e0a7[_0x495e99]=_0x3bcbc1(_0x5f535b));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x34ee03['type'])){if(_0x34ee03['isDocumentOperation']=!0x1,_0x34ee03['baseVersion']=null,'remove'==_0x34ee03['type']){const _0x4a62d6=_0x34ee03['sourcePosition'],_0x4980bd=_0x34ee03['howMany'];new _0x19ceb4(_0x4a62d6,_0x4980bd)['_execute']();}else _0x34ee03['_execute']();}function _0x3bcbc1(_0x4bcfa3){if('$graveyard'==_0x4bcfa3['root']['rootName'])return _0x4bcfa3;const _0x29616a=[];let _0x19778c=_0x4bcfa3['root'];for(let _0x55ce4c=0x0;_0x55ce4c<_0x4bcfa3['path']['length'];_0x55ce4c++){const _0x24f924=_0x4955a3['get'](_0x19778c)||0x0;_0x29616a[_0x55ce4c]=_0x4bcfa3['path'][_0x55ce4c]+_0x24f924,_0x19778c=_0x19778c['getChildAtOffset'](_0x4bcfa3['path'][_0x55ce4c]);}return new _0x1e8cb7(_0x36fb8d,_0x29616a,_0x4bcfa3['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x43b353,content:_0x40ec0d,version:_0x2ce05a,mainView:_0x535aa5,aiBalloon:_0x211038}=this['_interactionParams'];_0x535aa5['areChangesVisible']=!0x1,_0x535aa5['hideError'](),this['_clearErrorState'](_0x535aa5,_0x211038);const _0x542746=_0x535aa5;_0x542746['miniToolbarView']&&_0x542746['miniToolbarView']['showChangesButton']&&_0x542746['miniToolbarView']['showChangesButton']['set']({'isOn':!0x1,'icon':_0x8d0f12}),this['_clearSuggestionContent'](_0x535aa5),_0x535aa5['showLoader'](),this['_updateNavigationUI'](),this['stopListening'](_0x535aa5),this['_createInteraction'](_0x40ec0d,_0x2ce05a,_0x535aa5,_0x211038,_0x43b353)['catch'](_0x1d9f42=>{this['_isAbortError'](_0x1d9f42)||console['error']('Error\x20refreshing\x20interaction:',_0x1d9f42);});}['_clearSuggestionContent'](_0x81f1b2){const _0xc10d12=_0x81f1b2['bodyView']['_children'];for(;_0xc10d12['length']>0x0;)_0xc10d12['remove'](_0xc10d12['first']);_0x81f1b2['bodyView']['hasPendingParts']=!0x1;}['_isAbortError'](_0x1f1ba8){return!!_0x1f1ba8['message']&&_0x1f1ba8['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_updateNavigationUI']();}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['_interactionParams']&&this['_interactionParams']['aiBalloon']['stopAutoScroll']();}['_setupCustomViews'](){const _0x13bf3e=new _0x5ee277(this['editor']['locale']),_0xc87f6=new _0x5ee277(this['editor']['locale']),_0x2fc086=new _0x3b9d21(this['editor']['locale']),_0x334848=new _0x5ee277(this['editor']['locale']);_0x13bf3e['set']({'icon':_0x959f82,'label':C(this['editor']['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0xc87f6['set']({'icon':_0x94bcdd,'tooltip':C(this['editor']['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x2fc086['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':['1/1']}),_0x334848['set']({'icon':_0x38fee0,'tooltip':C(this['editor']['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x13bf3e['bind']('isEnabled')['to'](this,'isBusy',_0x30070d=>!_0x30070d),_0x13bf3e['on']('execute',()=>{this['_refreshInteraction']();}),_0xc87f6['bind']('isEnabled')['to'](this,'isBusy',_0x4347df=>!_0x4347df),_0xc87f6['on']('execute',()=>{this['_navigateToPrevious']();}),_0x334848['bind']('isEnabled')['to'](this,'isBusy',_0x21c6df=>!_0x21c6df),_0x334848['on']('execute',()=>{this['_navigateToNext']();}),this['_navigationPreviousButton']=_0xc87f6,this['_navigationCounter']=_0x2fc086,this['_navigationNextButton']=_0x334848,this['_customViews']['add'](_0x13bf3e);}['_navigateToPrevious'](){const _0x55cadc=this['_interactions']['length'];this['_currentInteractionIndex']<_0x55cadc-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x14ad17){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x14ad17;const {mainView:_0x9748b8}=this['_interactionParams'],_0x576bba=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x576bba)return;if(_0x576bba['hasError'])return this['_setErrorState'](_0x576bba,_0x9748b8),void this['_updateNavigationUI']();if(!_0x576bba['replies']['length'])return;_0x9748b8['hideError'](),this['_interactionParams']&&this['_clearErrorState'](_0x9748b8,this['_interactionParams']['aiBalloon']);const _0x392b35=_0x576bba['replies'][_0x576bba['replies']['length']-0x1];if(_0x392b35){const _0x20c48f=this['editor'];this['_clearSuggestionContent'](_0x9748b8);try{const _0xe1e705=I({'editor':_0x20c48f,'changeGroups':_0x392b35['changeGroups'],'documentContextContent':_0x392b35['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});this['_clearSuggestionContent'](_0x9748b8),await new Promise(_0x398682=>setTimeout(_0x398682,0x32)),await _0x9748b8['updateContent']({'parts':_0xe1e705,'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x507ae4){this['_isAbortError'](_0x507ae4)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x507ae4);}}this['_updateNavigationUI']();}['_updateNavigationUI'](){if(!this['_navigationPreviousButton']||!this['_navigationCounter']||!this['_navigationNextButton'])return;const _0x28c37b=this['_interactions']['length'],_0x13d17a=_0x28c37b>0x1,_0x475446=this['_interactionParams']?.['mainView'];if(_0x13d17a){this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView']||(this['_customViews']['add'](this['_navigationPreviousButton']),_0x475446?.['addNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x0,this['_customViews']['add'](this['_navigationCounter']),_0x475446?.['addNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x0,this['_customViews']['add'](this['_navigationNextButton']),_0x475446?.['addNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x0);const _0x18ff44=_0x28c37b-this['_currentInteractionIndex'];this['_navigationCounter']['element']&&(this['_navigationCounter']['element']['textContent']=_0x18ff44+'/'+_0x28c37b),this['_navigationPreviousButton']['isEnabled']=this['_currentInteractionIndex']<_0x28c37b-0x1,this['_navigationNextButton']['isEnabled']=this['_currentInteractionIndex']>0x0;}else(this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView'])&&(this['_customViews']['remove'](this['_navigationPreviousButton']),_0x475446?.['removeNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x1,this['_customViews']['remove'](this['_navigationCounter']),_0x475446?.['removeNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x1,this['_customViews']['remove'](this['_navigationNextButton']),_0x475446?.['removeNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x1);}['_setLoadingState'](_0x48b64f,_0x2995c1){_0x48b64f['setLoading'](),_0x2995c1['balloonView']['setLoading'](),this['isBusy']=!0x0;}async['_setErrorState'](_0x52f930,_0x17adc9){const _0x13a788=C(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');_0x17adc9['showError'](_0x13a788),_0x52f930['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],_0x17adc9['setErrorState'](),this['_interactionParams']?.['aiBalloon']['balloonView']['toolbar']&&(this['_interactionParams']['aiBalloon']['balloonView']['toolbar']['isLoading']=!0x0);}['_clearErrorState'](_0x381849,_0x2021fa){_0x381849['clearErrorState'](),_0x2021fa['balloonView']['toolbar']&&(_0x2021fa['balloonView']['toolbar']['isLoading']=!0x1);}async['_clearLoadingState'](_0x46a0a9,_0x197ed3){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,_0x46a0a9['clearLoading'](),_0x197ed3['balloonView']['clearLoading']();}['_disableCustomViews'](){this['_customViews']['forEach'](_0x798f7e=>{'isEnabled'in _0x798f7e&&(_0x798f7e['isEnabled']=!0x1);});}}class Va extends _0x35c0a2{static get['requires'](){return[ri,ci,oi];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2fe797){super(_0x2fe797),_0x2fe797['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class js{['id'];['title'];['description'];['isParameterized'];['useArgs'];['options'];constructor({id:_0x1bf3c6,title:_0x4fedc8,description:_0x1df495,isParameterized:_0x12d01d,useArgs:_0x5ceb10,options:_0x177212}){this['id']=_0x1bf3c6,this['title']=_0x4fedc8,this['description']=_0x1df495,this['isParameterized']=_0x12d01d,this['useArgs']=_0x5ceb10,this['options']=_0x177212;}}class Bs extends js{['_models']=[];get['models'](){return this['_models'];}set['models'](_0x5d7154){this['_models']=_0x5d7154;}}class ai extends ts(){['_checks'];constructor(_0x5cf4ce){super(),this['_checks']=this['_mapCheckDefinitions'](_0x5cf4ce);}get['checks'](){return this['_checks'];}['getCheckById'](_0x55b207){return this['checks']['find'](_0x258bb1=>_0x258bb1['id']===_0x55b207);}['removeCheckById'](_0x3ec2ff){this['_checks']=this['_checks']['filter'](_0x36444e=>_0x36444e['id']!==_0x3ec2ff);}['_mapCheckDefinitions'](_0x2faafe){return _0x2faafe['map'](_0x113f2d=>'custom'===_0x113f2d['id']?new Bs(_0x113f2d):new js(_0x113f2d));}}class Ds extends _0x554e67(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x4a5a38,contentNew:_0x3f7e80,contentInitial:_0x27f053,documentVersion:_0x52b0da}){super(),this['id']=_0x4a5a38,this['contentNew']=_0x3f7e80,this['contentInitial']=_0x27f053,this['documentVersion']=_0x52b0da;}}class Es extends ts(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x13e949,_0x5ea1b8,_0x4fdfb7){super(),this['id']=_0x13e949,this['parent']=_0x4fdfb7,this['_data']=_0x5ea1b8,this['set']('isActivated',!0x1),this['set']('isRated',!0x1),this['set']('status','pending'),this['on']('change:status',()=>{'pending'!==this['status']&&this['isActivated']&&(this['isActivated']=!0x1);});}get['contentDiffed'](){return this['_data']['context']();}get['operations'](){return this['_data']['operations'];}get['operationsIsolated'](){return this['_data']['operationsIsolated'];}}class zs extends ts(){['id']=_0x53b360();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];constructor(_0x385f2e,_0x41f956,_0xaf4d4c,_0x41b01d,_0x3e1f74){super(),this['_sourceCheck']=_0x41f956,this['_documentData']=_0x385f2e,this['_aiConnector']=_0xaf4d4c,this['_reviewParams']=_0x41b01d,this['_reviewArgs']=_0x3e1f74,this['on']('change:status',(_0x280686,_0x5c78e0,_0xeabd47)=>{this['fire']('reviewCheckRunUpdated',{'status':_0xeabd47,'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'](_0x276b6b=>'pending'===_0x276b6b['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x5011d4){this['_documentData']=_0x5011d4;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x40477a=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x50866b of _0x40477a)'unmodified'!==_0x50866b['data']['operation']&&('error'!==_0x50866b['data']['operation']?'review-metadata'!==_0x50866b['event']?this['_addReviewCheckResult'](_0x50866b['data']['dataId'],_0x50866b['data']['textDelta']):this['callId']=_0x50866b['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(_0x247963){this['_currentError']=_0x247963,_0x247963 instanceof Error&&_0x247963['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'](_0x269762,_0x1930ee){const _0x461f36=this['_results']['get'](_0x269762);if(!_0x461f36)return;if(0x0===_0x1930ee['length'])return;const _0x3d0704=[];_0x1930ee['forEach']((_0x4c13e1,_0xc59736)=>{const _0x23fa00=new Es(_0x461f36['id']+'-'+_0xc59736,_0x4c13e1,_0x461f36);_0x23fa00['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x23fa00,'status':_0x23fa00['status']});}),_0x23fa00['on']('change:isActivated',()=>{_0x23fa00['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x23fa00}):this['fire']('reviewCheckResultDeactivated',{'change':_0x23fa00});}),this['_changes']['push'](_0x23fa00),_0x3d0704['push'](_0x23fa00);}),this['fire']('reviewCheckResultReady',{'changes':_0x3d0704,'result':_0x461f36,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x4e3be2){const _0x5068d0=this['_changes']['find'](_0x51d2c5=>_0x51d2c5['id']===_0x4e3be2);return!(!_0x5068d0||'pending'!==_0x5068d0['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x175055=>!0x0===_0x175055['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x1f1f3b=>'pending'===_0x1f1f3b['status']);}['getChangeById'](_0x283259){return this['_changes']['find'](_0x4e9be5=>_0x4e9be5['id']===_0x283259);}['markAllChangesAsAccepted'](){for(const _0x53595e of this['_changes'])'pending'===_0x53595e['status']&&(_0x53595e['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x7de622){const _0xb326a3=this['_changes']['find'](_0x47958d=>_0x47958d['id']===_0x7de622);_0xb326a3&&'pending'===_0xb326a3['status']&&(_0xb326a3['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x1bb1c0){const _0x51aed8=this['_changes']['find'](_0x5d5a32=>_0x5d5a32['id']===_0x1bb1c0);_0x51aed8&&'pending'===_0x51aed8['status']&&(_0x51aed8['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x29d91c){const _0x5581ae=this['_changes']['find'](_0x315e01=>_0x315e01['id']===_0x29d91c);_0x5581ae&&'pending'===_0x5581ae['status']&&(_0x5581ae['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x3fe17a){const _0xf2ad39=this['_changes']['find'](_0x38489e=>_0x38489e['id']===_0x3fe17a);_0xf2ad39&&'outdated'===_0xf2ad39['status']&&(_0xf2ad39['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x3a3c4a){this['_changes']['filter'](_0x35faa8=>_0x35faa8['isActivated']&&_0x35faa8['id']!==_0x3a3c4a)['forEach'](_0x5619d6=>{_0x5619d6['isActivated']=!0x1;});const _0x4d577b=this['_changes']['find'](_0x13b330=>_0x13b330['id']===_0x3a3c4a);_0x4d577b&&'pending'===_0x4d577b['status']&&(_0x4d577b['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x3ecedd=>_0x3ecedd['isActivated'])['forEach'](_0x38dc9c=>{_0x38dc9c['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x101b0f){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x858cf3;if(_0x101b0f){const _0x1fe7d9=this['_changes']['find'](_0x4ef614=>_0x4ef614['id']===_0x101b0f);if(_0x1fe7d9&&_0x1fe7d9['isRated'])return;_0x1fe7d9&&(_0x858cf3=_0x1fe7d9['parent']['id'],_0x1fe7d9['isRated']=!0x0);}const _0x1d3e2b={'positiveCount':this['_changes']['filter'](_0x113237=>'accepted'===_0x113237['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x1d3e2b,this['callId'],_0x858cf3);}['_addReviewCheckResult'](_0x27936b,_0x1bb6c7){const _0x131773=this['_documentData']['elements']['get'](_0x27936b);if(!_0x131773)return;const _0x220c21=_0x131773['getContent']();if(_0x220c21===_0x1bb6c7)return;const _0x5ebf32=new Ds({'id':_0x27936b,'contentInitial':_0x220c21,'contentNew':_0x1bb6c7,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x5ebf32['id'],_0x5ebf32),this['fire']('reviewCheckResultAdded',{'result':_0x5ebf32,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x117601=>'pending'===_0x117601['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x187731=>'pending'===_0x187731['status'])['length']&&(this['status']='finished'));}}class di extends zs{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x156e9c=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x47c21f=0x0;_0x47c21f<this['_reviewParams']['length'];_0x47c21f++){if(!this['_reviewParams'][_0x47c21f]||!this['_sourceCheck']['options'][_0x47c21f])continue;const _0x300217=this['_sourceCheck']['options'][_0x47c21f],_0x24a84d=_0x300217['data']?.['find'](_0x304985=>_0x304985['id']===this['_reviewParams'][_0x47c21f]);_0x24a84d&&_0x156e9c['push'](_0x24a84d['label']);}return _0x156e9c['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x7e17d4,_0x331de6,_0x2eac67){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x331de6,_0x7e17d4,_0x2eac67);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['id']:[this['_sourceCheck']['id'],...this['_reviewParams']]['join']('-');}}class li extends zs{['_prompt'];['_model'];constructor(_0x199ee1,_0x2fc89a,_0x148bad,_0x4c7761,_0xd60a88){super(_0x148bad,_0x4c7761,_0xd60a88),this['_prompt']=_0x199ee1,this['_model']=_0x2fc89a;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x2b1b55,_0x1f0add,_0x40772a){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x1f0add,_0x2b1b55,_0x40772a);}}const ui=[{'id':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]},{'id':'translate','title':'Translate','description':'Translate\x20the\x20text\x20into\x20another\x20language.','isParameterized':!0x0,'useArgs':!0x0,'options':[{'formType':'dropdown','label':'Select\x20language','argsKey':'language','data':[{'label':'English','id':'english'},{'label':'Spanish','id':'spanish'},{'label':'French','id':'french'},{'label':'German','id':'german'},{'label':'Chinese\x20(Simplified)','id':'chinese'},{'label':'Japanese','id':'japanese'},{'label':'Russian','id':'russian'},{'label':'Portuguese','id':'portuguese'},{'label':'Korean','id':'korean'},{'label':'Italian','id':'italian'}]}]}];class re extends tt{['_aiConnector'];['_aiReviewModeUi'];['_aiReviewModeEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_isDiffOn']=!0x1;['_changeActivationSource']=null;static get['requires'](){return[s];}static get['pluginName'](){return'AIReviewModeController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiReviewModeUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewModeEditing']=this['context']['plugins']['get']('AIReviewModeEditing');const _0xdb44bc=this['context']['config']['get']('ai.reviewMode.translations');if(_0xdb44bc){for(const _0x1b4c24 of ui)'translate'===_0x1b4c24['id']&&(_0x1b4c24['options'][0x0]['data']=_0xdb44bc);}const _0x2a24a5=this['_translateReviewChecks'](ui);this['_aiReviewCheckList']=new ai(_0x2a24a5);const _0x10ce6f=this['_aiReviewCheckList']['checks']['find'](_0x27da97=>'custom'===_0x27da97['id']);if(_0x10ce6f)try{_0x10ce6f['models']=await new ft({'connector':this['_aiConnector'],'locale':this['context']['locale']})['getAll']();}catch(_0x4c4b0c){this['_aiReviewCheckList']['removeCheckById']('custom'),this['_logError'](new _0x15f966('ai-review-mode-models-unable-to-retrieve',this,{'error':_0x4c4b0c}));}this['listenTo'](this['_aiReviewModeUi'],'getReviewCheckList',()=>{this['_aiReviewModeUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewModeUi'],'runReviewCheck',async(_0x4b7d57,_0x184f73)=>{const _0x26cafc=this['_aiReviewCheckList']['getCheckById'](_0x184f73['id']);if(_0x26cafc){this['_onDiffChange'](this['_isDiffOn']),_0x184f73['isCustom']?this['_currentReviewCheckRun']=new li(_0x184f73['args']['prompt'],_0x184f73['args']['model'],this['_aiReviewModeEditing']['getDocumentData'](),_0x26cafc,this['_aiConnector']):this['_currentReviewCheckRun']=new di(this['_aiReviewModeEditing']['getDocumentData'](),_0x26cafc,this['_aiConnector'],_0x184f73['params'],_0x184f73['args']),this['_aiReviewModeUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x1c334f,_0x4ce88c)=>{switch(_0x4ce88c['status']){case'data':case'loading':this['_aiReviewModeEditing']['switchToReadOnly'](),this['_aiReviewModeUi']['showCheckRunResults'](_0x4ce88c);break;case'finished':this['_aiReviewModeUi']['showReviewCompletedView']();break;case'ready':this['_aiReviewModeUi']['showActionsWhenResultIsReady']();break;case'unmodified':this['_aiReviewModeUi']['showNoChangesView']();break;case'error-general':this['_aiReviewModeUi']['showGeneralResultsErrorView'](),this['_logError'](new _0x15f966('ai-review-mode-check-run-general-error',this,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewModeUi']['showChunkErrorView'](),this['_logError'](new _0x15f966('ai-review-mode-check-run-chunk-error',this,this['_currentReviewCheckRun']?.['currentError']));break;case'aborted':this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewModeRunLeave'](!0x0);}'ready'!==_0x4ce88c['status']&&'error-chunk'!==_0x4ce88c['status']&&'error-general'!==_0x4ce88c['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x362e5f,_0x2b80f5)=>{if(!this['_currentReviewCheckRun'])throw new _0x15f966('ai-review-mode-no-current-check-run',this);const _0x58a1cf=this['_aiReviewModeEditing']['diffContent'](_0x2b80f5['result']['contentInitial'],_0x2b80f5['result']['contentNew']);_0x2b80f5['source']['addResultChanges'](_0x2b80f5['result']['id'],_0x58a1cf);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x3962e9,_0x458451)=>{for(const _0x3400f6 of _0x458451['changes'])this['_aiReviewModeUi']['showCheckRunResult'](_0x3400f6);this['_aiReviewModeEditing']['markChangePositionInEditorContent'](_0x458451['changes'],_0x458451['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x96b936,_0x33717a)=>{this['_aiReviewModeUi']['updateChangeState'](_0x33717a['change']['id'],_0x33717a['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x5584c1,_0x439606)=>{this['_aiReviewModeUi']['setActiveStateInResults'](_0x439606['change']['id']);const _0x14f242=this['_aiReviewModeEditing']['getMarkerElementForChange'](_0x439606['change']['id']);if(!_0x14f242)return;if('content'===this['_changeActivationSource']){const _0x157601=this['_aiReviewModeUi']['getChangeElement'](_0x439606['change']['id']);_0x157601&&_0x44bea0(_0x157601['closest']('.ck-ai-review-mode__check-run-result')||_0x157601);}else{if('panel'===this['_changeActivationSource']){const _0x22cbf5={'target':_0x14f242['domElement'],'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0};at(_0x22cbf5);}}const _0x402f59=this['_aiReviewModeEditing']['getEditor']();this['_aiReviewModeUi']['showChangeBalloon'](_0x439606['change'],_0x14f242['domElement'],void 0x0,'click',_0x402f59?.['editing']?.['view']?.['getDomRoot'](),_0x402f59?.['ui']?.['viewportOffset']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_aiReviewModeUi']['resetActiveStateInResults'](),this['_aiReviewModeUi']['hideChangeBalloon']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x4a8e98){_0x4a8e98 instanceof Error&&_0x4a8e98['message']['includes']('ai-request-aborted')||(_0x4a8e98 instanceof _0x15f966?this['_logError'](_0x4a8e98):this['_logError'](new _0x15f966('ai-review-mode-check-run-failed',this,{'error':_0x4a8e98})));}}else this['_logError'](new _0x15f966('ai-review-mode-source-check-not-found',this,{'checkId':_0x184f73['id']}));}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewMode',()=>{this['_onReviewModeRunLeave']();}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewModeResultList',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewModeUi'],'finishReview',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x39863e=this['_currentReviewCheckRun']['getActiveChanges']();_0x39863e['length']&&(this['_aiReviewModeEditing']['applyChange'](_0x39863e['map'](_0x2e93c6=>_0x2e93c6['id'])),this['_currentReviewCheckRun']['markAllChangesAsAccepted'](),this['_currentReviewCheckRun']['sendRating']());}),this['listenTo'](this['_aiReviewModeUi'],'acceptChange',(_0x3f86e5,_0x4d694e)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x4d694e['id'])&&(this['_aiReviewModeEditing']['applyChange']([_0x4d694e['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x4d694e['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x4d694e['id']));}),this['listenTo'](this['_aiReviewModeUi'],'dismissChange',(_0x391fb9,_0x2e6051)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x2e6051['id'])&&(this['_aiReviewModeEditing']['rejectChange'](_0x2e6051['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x2e6051['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x2e6051['id']));}),this['listenTo'](this['_aiReviewModeUi'],'toggleDiff',(_0x2be966,_0x4528d3)=>{this['_isDiffOn']=_0x4528d3['on'],this['_onDiffChange'](this['_isDiffOn']);}),this['listenTo'](this['_aiReviewModeUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&(this['_aiReviewModeEditing']['clearAllMarkers'](),this['_currentReviewCheckRun']['updateDocumentData'](this['_aiReviewModeEditing']['getDocumentData']()),await this['_currentReviewCheckRun']['restart']());}),this['listenTo'](this['_aiReviewModeUi'],'activateChange',(_0xcdaa,_0x40223a)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x40223a['id']));}),this['listenTo'](this['_aiReviewModeUi'],'deactivateChange',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['deactivateChange']();}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerClick',(_0x1fe908,_0x5b67ef)=>{if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x5b67ef['changeId']);const _0x3e469b=this['_currentReviewCheckRun']['getChangeById'](_0x5b67ef['changeId']);if(!_0x3e469b)return;const _0xe875df=this['_aiReviewModeEditing']['getEditor']();this['_aiReviewModeUi']['showChangeBalloon'](_0x3e469b,_0x5b67ef['markerElement'],_0x5b67ef['domEvent'],'click',_0xe875df?.['editing']?.['view']?.['getDomRoot'](),_0xe875df?.['ui']?.['viewportOffset']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerHovered',(_0x4dea43,_0x5bca7e)=>{if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x20a053=this['_currentReviewCheckRun']['getChangeById'](_0x5bca7e['changeId']);if(!_0x20a053)return;const _0x4f0685=this['_aiReviewModeEditing']['getEditor']();this['_aiReviewModeUi']['showChangeBalloon'](_0x20a053,_0x5bca7e['markerElement'],_0x5bca7e['domEvent'],'hover',_0x4f0685?.['editing']?.['view']?.['getDomRoot'](),_0x4f0685?.['ui']?.['viewportOffset']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerBlurred',()=>{if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewModeUi']['hideChangeBalloon']();}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRemoved',(_0x5a0240,_0x6a8e0a)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x6a8e0a['changeId']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRestored',(_0x4b3831,_0x38f567)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x38f567['changeId']);});}['_onReviewModeRunLeave'](_0x10d21d=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x10d21d&&this['_aiReviewModeUi']['showReviewCheckList'](),this['_aiReviewModeEditing']['clearAllMarkers'](),this['_aiReviewModeEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x1d0c0e=this['_aiReviewModeEditing']['getEditor']();_0x1d0c0e&&_0x1d0c0e['editing']['view']['change'](_0x4fcd33=>{const _0x1a7b90=_0x1d0c0e['editing']['view']['document']['getRoot']();_0x4fcd33['removeClass']('ck-ai-review-mode-diff',_0x1a7b90),_0x4fcd33['removeClass']('ck-ai-review-mode-highlights',_0x1a7b90);});}['_onDiffChange'](_0x57be24){const _0x896137=this['_aiReviewModeEditing']['getEditor']();_0x57be24?this['_aiReviewModeUi']['hideDiffInBalloon']():this['_aiReviewModeUi']['showDiffInBalloon'](),_0x896137&&_0x896137['editing']['view']['change'](_0x2558d5=>{const _0x23bd97=_0x896137['editing']['view']['document']['getRoot']();_0x2558d5['removeClass']('ck-ai-review-mode-diff',_0x23bd97),_0x2558d5['removeClass']('ck-ai-review-mode-highlights',_0x23bd97),_0x2558d5['addClass'](_0x57be24?'ck-ai-review-mode-diff':'ck-ai-review-mode-highlights',_0x23bd97);});}['_translateReviewChecks'](_0x578ddc){return _0x578ddc['map'](_0x11b18a=>{const _0x13cd21='AI_REVIEW_CHECK_'+_0x11b18a['id']['toUpperCase']()['replaceAll']('-','_'),_0x37e53a={..._0x11b18a,'title':this['_getTranslationWithDefault'](_0x13cd21+'_TITLE',_0x11b18a['title']),'description':this['_getTranslationWithDefault'](_0x13cd21+'_DESCRIPTION',_0x11b18a['description'])};return _0x11b18a['options']&&(_0x37e53a['options']=_0x11b18a['options']['map'](_0x338e37=>({..._0x338e37,'label':this['_getTranslationWithDefault'](_0x13cd21+'_OPTIONS_LABEL',_0x338e37['label']||''),'data':_0x338e37['data']?_0x338e37['data']['map'](_0x1154e1=>({..._0x1154e1,'label':this['_getTranslationWithDefault'](_0x13cd21+'_OPTIONS_DATA_'+_0x1154e1['id']['toUpperCase'](),_0x1154e1['label'])})):void 0x0}))),_0x37e53a;});}['_getTranslationWithDefault'](_0x1f75c7,_0x3fb9d6){const _0x32f8aa=C(this['context']['locale'],_0x1f75c7);return _0x32f8aa===_0x1f75c7?_0x3fb9d6:_0x32f8aa;}['_logError'](_0x150976){gt(_0x150976['message']),_0x150976['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewModeUi']['showGeneralReviewModeErrorView']():this['_aiReviewModeUi']['showGeneralResultsErrorView']();}}class Mr extends _0x3b9d21{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x2ceb6d,_0x2675a5){super(_0x2ceb6d),this['_defaultValue']=_0x2675a5['default']||(_0x2675a5['data']['length']>0x0?_0x2675a5['data'][0x0]['id']:''),this['_defaultLabel']=_0x2675a5['data']['find'](_0x55b8c1=>_0x55b8c1['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x36aac4(this['locale']);const _0x2fe264=this['_prepareListOptions'](_0x2675a5['data']);_0x3c9480(this['_dropdownView'],_0x2fe264,{'role':'menu','ariaLabel':_0x2675a5['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x1f83af=>{_0x1f83af['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x40f4b2=>{this['formValue']=_0x40f4b2['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x40f4b2['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review-mode__check-list-item-parameterized-form-element','ck-ai-review-mode__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x26376b=[]){const _0x265ab7=new _0x39615e();this['resetToDefault']();for(const _0x3e54f7 of _0x26376b){const _0x494505=new _0x2ab623({'label':_0x3e54f7['label'],'withText':!0x0,'role':'menuitemradio','id':_0x3e54f7['id'],'model':_0x3e54f7});_0x494505['bind']('isOn')['to'](this,'formValue',_0x27a516=>_0x27a516===_0x494505['id']);const _0x50cd78={'type':'button','model':_0x494505};_0x265ab7['add'](_0x50cd78);}return _0x265ab7;}}class ic extends _0x8173b9{['_formItem']=null;constructor(_0x4a9e5b,_0x5c9f08,_0xc913bc){super(_0x4a9e5b),this['argsKey']=_0x5c9f08?.['argsKey'];if('dropdown'===_0x5c9f08['formType'])this['_formItem']=new Mr(this['locale'],_0x5c9f08);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x3ce687=new _0x80e4dd(this['locale'],{'children':[this['_formItem']],'class':[_0xc913bc?'ck-form__row_with-submit':'']});_0xc913bc&&_0x3ce687['children']['add'](_0xc913bc),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__form-item','ck-reset_all']},'children':[_0x3ce687]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class Us extends _0x459523{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x2b43e7){super(_0x2b43e7),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x5593a8(),this['minRows']=Us['MIN_ROWS'],this['maxRows']=Us['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-mode-prompt-input','class':['ck','ck-review-mode__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class tc extends _0x3b9d21{['focusTracker']=new _0x5364ba();['keystrokes']=new _0x5593a8();['focusCycler'];['_focusables']=new _0x49e6be();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x39442e,_0x12651c){super(_0x39442e),this['_check']=_0x12651c,this['set']('prompt',''),this['set']('modelId',''),this['_defaultValue']=_0x12651c['models']&&_0x12651c['models']['length']>0x0?_0x12651c['models'][0x0]['id']:'',this['_defaultLabel']=_0x12651c['models']&&_0x12651c['models']['length']>0x0?_0x12651c['models'][0x0]['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x425b6a(this['locale'],()=>new Us(_0x39442e)),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 _0x39615e(),this['_setModelList'](),_0x3c9480(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions']},'children':[new _0x80e4dd(this['locale'],{'children':[this['promptInputView']]}),new _0x80e4dd(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x1353d7,_0x42ecb6)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x42ecb6()):_0x42ecb6();}),this['focusCycler']=new _0x1cce22({'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'](_0x1a2bc0=>{this['_focusables']['add'](_0x1a2bc0),this['focusTracker']['add'](_0x1a2bc0['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 _0x3769f4 of this['_getFormValidators']()){const _0x58797e=_0x3769f4();if(_0x58797e)return this['promptInputView']['errorText']=_0x58797e,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return C(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x4a150a=new _0x5ee277(this['locale']),t=this['locale']['t'];return _0x4a150a['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x4a150a['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x4a150a;}['_createCancelButtonView'](){const _0x22d089=new _0x5ee277(this['locale']),t=this['locale']['t'];return _0x22d089['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled'}),_0x22d089['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x251067=>{_0x251067['stopPropagation']();})}}),_0x22d089['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x22d089;}['_setModelList'](){this['_modelSelectionDropdownItems']['clear']();const _0x131926=this['_check']['models'];if(this['resetToDefault'](),_0x131926?.['length'])for(const _0x5c9e1c of _0x131926){const _0x32ebb7=new _0x2ab623({'label':_0x5c9e1c['name'],'withText':!0x0,'role':'menuitemradio','id':_0x5c9e1c['id'],'model':_0x5c9e1c});_0x32ebb7['bind']('isOn')['to'](this,'modelId',_0x4ba833=>_0x4ba833===_0x5c9e1c['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x32ebb7,'labelView':new Xs(this['locale'],_0x5c9e1c)});}}['_createModelSelectionDropdown'](){const _0x162759=_0x36aac4(this['locale']);return _0x162759['set']({'panelPosition':'se','class':'ck-ai-review-mode__check-list-item-model-dropdown'}),_0x162759['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),this['listenTo'](_0x162759,'execute',_0x2d8668=>{this['modelId']=_0x2d8668['source']['model']['id'],_0x162759['buttonView']['label']=_0x2d8668['source']['label'];}),_0x162759;}['_createActionsFooterView'](){const _0xeac548=new _0x3b9d21(this['locale']);return _0xeac548['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0xeac548;}}class Xs extends _0x5a5387{constructor(_0x54ea5e,_0x1d0d53){super();const _0x5650b4=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x5650b4['to']('style'),'id':_0x5650b4['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x5650b4['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x1d0d53['description']||'']}]}]});}}class Zs extends _0x8173b9{['_formItemsCollection']=new _0x49e6be();['_customCheckView']=null;constructor(_0x25fa18,_0x4ed011,_0x3878fb){super(_0x25fa18),this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x4ed011['isParameterized']);const _0x560bfd=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai-review-mode__check-list-item_selected',_0x3ddd43=>_0x3ddd43),this['bindTemplate']['if']('isListItemRendered','ck-ai-review-mode__check-list-item_rendered',_0x23a9ab=>_0x23a9ab)],'style':{'--ck-ai-review-check-list-item-index':_0x3878fb}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-list-item-title-text']},'children':[{'text':_0x4ed011['title']}]},_0x560bfd]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-description']},'children':[{'text':_0x4ed011['description']}]}]}]},..._0x4ed011['isParameterized']?[this['_createParameterizedView'](_0x4ed011)]:[],...'custom'===_0x4ed011['id']?[this['_createCustomView'](_0x4ed011)]:[]]}),this['on']('click',()=>{_0x4ed011['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x4ed011['id']});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x3685ee({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0xb08d6b=>{_0xb08d6b['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x1e4610=new _0x53ac42();return _0x1e4610['content']=_0x39814a,_0x1e4610['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-title-icon']}}),_0x1e4610;}['_createParameterizedView'](_0x374a7c){const _0x48eaca=new _0x3b9d21(),_0x11914a=this['_createFormView'](_0x374a7c);return _0x48eaca['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x453fb0=>!_0x453fb0)]},'children':[_0x11914a]}),_0x48eaca;}['_createFormView'](_0x20111d){const _0x4e071a=new _0x3b9d21(),_0x368063=Array['isArray'](_0x20111d['options'])?_0x20111d['options']:[],_0x406382=new _0x5ee277(this['locale']),t=this['locale']['t'];_0x406382['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x406382['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x26dc8e=>{_0x26dc8e['stopPropagation']();})}}),_0x406382['on']('execute',()=>{const _0x4e203a=[],_0x12ea6a={};this['_formItemsCollection']['forEach'](_0x4dda1e=>{_0x4e203a['push'](_0x4dda1e['value']),_0x20111d['useArgs']&&_0x20111d['options']&&(_0x12ea6a[_0x4dda1e['argsKey']]=_0x4dda1e['value']);}),this['fire']('runReviewCheck',{'id':_0x20111d['id'],'params':_0x4e203a['length']?_0x4e203a:void 0x0,'args':Object['keys'](_0x12ea6a)['length']?_0x12ea6a:void 0x0});});const _0x42c0c1=_0x368063['length'];return _0x368063['forEach']((_0xd2b7ae,_0x4bad6d)=>{const _0x346f72=_0x4bad6d===_0x42c0c1-0x1;this['_formItemsCollection']['add'](new ic(this['locale'],_0xd2b7ae,_0x346f72?_0x406382:null));}),_0x4e071a['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x4e071a;}['_createCustomView'](_0x366f71){return this['_customCheckView']=new tc(this['locale'],_0x366f71),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized','ck-ai-review-mode__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x32889b=>!_0x32889b)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x44cdb6,_0x525a82,_0x5a38ce)=>{_0x5a38ce||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class ih extends _0x8173b9{['_checkViews'];constructor(_0x3dc2bb){super(_0x3dc2bb),this['_checkViews']=new _0x49e6be();const _0x35d76a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list',_0x35d76a['if']('isVisible','ck-hidden',_0x5e8ce0=>!_0x5e8ce0)]},'children':this['_checkViews']});}['setChecks'](_0x3cf4b6){this['_checkViews']['clear']();for(const [_0x247958,_0x329c4f]of _0x3cf4b6['entries']()){const _0x48825c=new Zs(this['locale'],_0x329c4f,_0x247958);_0x48825c['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x48825c);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x34d9cd of this['_checkViews'])_0x34d9cd instanceof Zs&&_0x34d9cd['resetToDefault']();}}class Ps extends _0x3b9d21{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x45abe6,_0x16ba68){super(_0x45abe6),this['id']=_0x16ba68,this['set']('status','pending'),this['set']('changeId',_0x16ba68),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-mode__check-run-result',this['bindTemplate']['if']('isActive','ck-ai-review-mode__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView'],this['outdatedButtonView']]},this['infoButtonView']]}]}),this['on']('click',()=>{this['fire']('activateChange',{'id':_0x16ba68,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x3ae6cb=new _0x3b9d21(this['locale']);return _0x3ae6cb['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-content-direct-excluded','ck-ai-review-mode__check-run-result-response',this['bindTemplate']['if']('showDiff','ck-hidden',_0x576b45=>!_0x576b45)]}}),_0x3ae6cb;}['_createAcceptButtonView'](){const _0x2a078d=new _0x5ee277(this['locale']);return _0x2a078d['set']({'label':C(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x2a078d['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x56bdf6=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x56bdf6['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x3f04a7=>'pending'!==_0x3f04a7&&'accepted'!==_0x3f04a7),this['bindTemplate']['if']('status','ck-ai-review-mode__check-run-result-accept-button',_0x2070bd=>'pending'===_0x2070bd),this['bindTemplate']['if']('status','ck-ai-review-mode__check-run-result-status-button',_0x586132=>'accepted'===_0x586132)]}}),this['on']('change:status',(_0x17afb9,_0x38bb73,_0x307c44)=>{_0x2a078d['isEnabled']=!0x1,'accepted'===_0x307c44&&(_0x2a078d['label']=C(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x2a078d['icon']=_0x354c14);}),_0x2a078d;}['_createDismissButtonView'](){const _0xf0d9d0=new _0x5ee277(this['locale']);return _0xf0d9d0['set']({'label':C(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0xf0d9d0['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x4686c2=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x4686c2['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary-filled',this['bindTemplate']['if']('status','ck-hidden',_0x1a24bb=>'pending'!==_0x1a24bb&&'rejected'!==_0x1a24bb),this['bindTemplate']['if']('status','ck-ai-review-mode__check-run-result-dismiss-button',_0x548e56=>'pending'===_0x548e56),this['bindTemplate']['if']('status','ck-ai-review-mode__check-run-result-status-button',_0x4fec75=>'rejected'===_0x4fec75)]}}),this['on']('change:status',(_0x4855f2,_0x421622,_0x329475)=>{_0xf0d9d0['isEnabled']=!0x1,'rejected'===_0x329475&&(_0xf0d9d0['label']=C(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0xf0d9d0['icon']=_0x199223);}),_0xf0d9d0;}['_createInfoButtonView'](){const _0x3e2b34=new _0x5ee277(this['locale']);return _0x3e2b34['set']({'label':C(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0xadb1db,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-info-button\x20ck-hidden'}),_0x3e2b34['bind']('isOn')['to'](this,'isInfoToggleOn',_0xfa4d10=>_0xfa4d10),_0x3e2b34['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x3e2b34;}['_createOutdatedButtonView'](){const _0x1e6ef6=new _0x5ee277(this['locale']);return _0x1e6ef6['set']({'label':C(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':_0x33a81d,'withText':!0x0,'isEnabled':!0x1}),_0x1e6ef6['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x5402e1=>'outdated'!==_0x5402e1)],'disabled':'disabled'}}),_0x1e6ef6;}}class gr extends _0x5ee277{constructor(_0x5e4cb9){super(_0x5e4cb9),this['set']({'label':C(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class eh extends _0x8173b9{['_resultViews'];['resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];constructor(_0x26cad5){super(_0x26cad5),this['_resultViews']=new _0x49e6be(),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 Ri(_0x26cad5),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 _0x4128ad=this['_createCombinedSkeletonLoader'](),_0x38ab8f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run',_0x38ab8f['if']('isVisible','ck-hidden',_0x3298cc=>!_0x3298cc)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x3b8706=>_0x3b8706)]},'children':this['_resultViews']},_0x4128ad]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0xe8875){const _0xc8311a=new Ps(this['locale'],_0xe8875['id']);_0xc8311a['delegate']('acceptChange','dismissChange','activateChange')['to'](this),this['_resultViews']['add'](_0xc8311a),_0xc8311a['resultResponseView']['element']['innerHTML']=_0xe8875['contentDiffed'];}['hideResult'](_0x2da116,_0x1a3019){if('pending'===_0x1a3019)return;const _0x301fe6=this['_resultViews']['find'](_0x56cfc8=>_0x56cfc8['id']===_0x2da116);_0x301fe6&&(_0x301fe6['status']=_0x1a3019,_0x301fe6['element']?.['classList']['add']('ck-ai-review-mode__check-run-result_grayout'));}['showResult'](_0x56eeab,_0x9287a0){if('pending'!==_0x9287a0)return;const _0x449590=this['_resultViews']['find'](_0x4702ed=>_0x4702ed['id']===_0x56eeab);_0x449590&&(_0x449590['status']=_0x9287a0,_0x449590['element']?.['classList']['remove']('ck-ai-review-mode__check-run-result_grayout'));}['setTitle'](_0x4abeb4,_0x389d10){this['headerTitle']=_0x4abeb4,this['headerSubtitle']=_0x389d10||'';}['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 Oe(this['locale'],Fe['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x379862=new _0x3b9d21(this['locale']),_0x16f598=[];for(let _0x5a79d8=0x0;_0x5a79d8<0x10;_0x5a79d8++){const _0x49b764=this['_createSkeletonLoader']();_0x49b764['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-run-skeleton-item']}}),_0x16f598['push'](_0x49b764);}return _0x379862['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0xafe727=>!_0xafe727)]},'children':_0x16f598}),_0x379862;}['_createErrorView'](){const _0x48ea4f=new _0x3b9d21(this['locale']),_0x38f4ef=new _0x5ee277(this['locale']),t=this['locale']['t'];return _0x48ea4f['delegate']('retryReview')['to'](this),_0x38f4ef['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-error-retry-button'}),_0x38f4ef['on']('execute',()=>{this['fire']('retryReview');}),_0x48ea4f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x57b763=>!_0x57b763),this['bindTemplate']['if']('errorType','ck-ai-review-mode__check-run-error-container_border-bottom',_0x4b10ef=>'chunk'===_0x4b10ef)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error','ck-ai-notification__full-width','ck-ai-review-mode__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-notification_warning',_0x2a3e89=>'chunk'===_0x2a3e89)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x1b1d7d=>'general'!==_0x1b1d7d)]},'children':[{'text':C(this['locale'],'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x411260=>'chunk'!==_0x411260)]},'children':[{'text':C(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x38f4ef]}),_0x48ea4f;}['_createCancelButtonView'](){const _0x2b4ef2=new _0x5ee277(this['locale']);return _0x2b4ef2['set']({'label':C(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x4b519f}),_0x2b4ef2['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x97d7ea=>_0x97d7ea),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4efd34=>_0x4efd34)]}}),_0x2b4ef2['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x2b4ef2;}['_createToggleDiffButtonView'](){const _0x58b54b=new _0x5ee277(this['locale']);_0x58b54b['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x58b54b['bind']('isEnabled')['to'](this,'isError',_0x4a8d8e=>!_0x4a8d8e),_0x58b54b['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x3fa899=>!_0x3fa899),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x24c363=>_0x24c363)]}});const _0xdc85fd=C(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x19e0a7=C(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x58b54b['bind']('isOn')['to'](this,'isToggleDiffOn',_0x4fabbf=>_0x4fabbf),_0x58b54b['bind']('icon')['to'](this,'isToggleDiffOn',_0x132869=>_0x132869?_0x3aa20e:_0x4f3e4b),_0x58b54b['bind']('label')['to'](this,'isToggleDiffOn',_0x89fbf6=>_0x89fbf6?_0xdc85fd:_0x19e0a7),_0x58b54b['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x58b54b;}['_createAcceptAllButtonView'](){const _0x11729d=new _0x5ee277(this['locale']);return _0x11729d['set']({'label':C(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x11729d['bind']('isEnabled')['to'](this,'isError',_0x2ebee5=>!_0x2ebee5),_0x11729d['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai-review-mode__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x166c96=>!_0x166c96),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5a2555=>_0x5a2555)]}}),_0x11729d['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x11729d;}['_createExitReviewButtonView'](){const _0x407068=new _0x5ee277(this['locale']);return _0x407068['set']({'label':C(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x407068['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x4bbed1=>!_0x4bbed1),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3a9ca9=>_0x3a9ca9)]}}),_0x407068['on']('execute',()=>{this['fire']('leaveReviewModeResultList');}),_0x407068;}['_createResultHeaderView'](){const _0x33f91c=new _0x3b9d21(this['locale']),_0x29af7d=this['_createTitleView']();return _0x33f91c['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai-review-mode__review-completed-header',_0x1dbdfb=>_0x1dbdfb)]},'children':[_0x29af7d,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x33f91c;}['_createTitleView'](){const _0x3059e4=new _0x3b9d21(this['locale']),_0x230dca=new Pe();return _0x230dca['bind']('isVisible')['to'](this,'isResultReady',_0x5b9d09=>!_0x5b9d09),_0x3059e4['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-wrapper']},'children':[_0x230dca,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x15cfc7=>_0x15cfc7)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]},{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x200ca9=>!_0x200ca9)]},'children':[{'text':C(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x3059e4;}['_createFinishReviewButtonView'](){const _0x2cfb90=new gr(this['locale']);return _0x2cfb90['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x13bb32=>!_0x13bb32)]}}),_0x2cfb90['delegate']('finishReview')['to'](this),_0x2cfb90;}}class th extends _0x8173b9{['resultsHeader'];['_finishReviewButtonView'];constructor(_0x3dad7a){super(_0x3dad7a),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['resultsHeader']=this['_createResultHeaderView']();const _0x2c73a5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed',_0x2c73a5['if']('isVisible','ck-hidden',_0xe45044=>!_0xe45044)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai-review-mode__review-completed-content-text']},'children':[{'text':C(_0x3dad7a,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT')}]}]}]});}['_createFinishReviewButtonView'](){const _0x49dc3e=new gr(this['locale']);return _0x49dc3e['delegate']('finishReview')['to'](this),_0x49dc3e;}['_createResultHeaderView'](){const _0x1944b8=new _0x3b9d21(this['locale']);return _0x1944b8['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-header-title']},'children':[{'text':C(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x1944b8;}}class hh extends _0x3b9d21{constructor(_0x53e5e9){super(_0x53e5e9),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x1e5b5d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__general-error-container',_0x1e5b5d['if']('isVisible','ck-hidden',_0x41cf1d=>!_0x41cf1d)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x1e5b5d['to']('errorMessage')}]}]});}}class ue extends _0x3b9d21{['reviewModeHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x791edc){super(_0x791edc),this['reviewModeHeader']=new _0x37a3e8(_0x791edc,{'label':C(_0x791edc,'AI_REVIEW_MODE'),'icon':_0x413f91,'class':'ck-ai-header\x20ck-ai-header_review-mode'}),this['generalErrorView']=new hh(_0x791edc),this['reviewCheckListView']=new ih(_0x791edc),this['reviewCheckListView']['delegate'](...sh)['to'](this),this['reviewCheckResultsView']=new eh(_0x791edc),this['reviewCheckResultsView']['delegate'](...sh)['to'](this),this['reviewCompletedView']=new th(_0x791edc),this['reviewCompletedView']['delegate']('finishReview')['to'](this),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isLoading',!0x1),this['reviewCheckResultsView']['set']('isResultReady',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review-mode','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewModeHeader'],this['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'](_0x21f07b){this['reviewCheckResultsView']['addResult'](_0x21f07b),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;}['showGeneralReviewModeErrorView'](_0x412e80){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x412e80;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class Re extends _0x509620{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x3061e0,_0x41905e){super(_0x3061e0),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']()),_0x41905e['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x3dc171){this['resultItemView']['changeId']=_0x3dc171['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x3dc171['contentDiffed'];}['showBalloon'](_0xce5104,_0x8c8b07,_0x4acad1,_0x4d72f5,_0x253336,_0x3f3386){this['_removeActiveClassFromMarkers'](),this['updateContent'](_0xce5104),this['show']();const _0x49ecbc=Array['from'](_0x8c8b07['getClientRects']())['reverse'](),_0xc07821=this['_getPointedRectIndexFromEvent'](_0x4acad1,_0x49ecbc);'click'===_0x4d72f5?(this['isDiffActive']=!0x0,this['_setActiveClassOnMarker'](_0xce5104['id']),this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x8c8b07,_0xc07821,_0xce5104['id'],_0x253336,_0x3f3386)})):'hover'===_0x4d72f5&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x8c8b07,_0xc07821,_0xce5104['id'])}));}['hideBalloon'](){this['hide'](),this['unpin'](),this['_removeActiveClassFromMarkers'](),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');}['_removeActiveClassFromMarkers'](){et['document']['querySelectorAll']('.ck-ai-review-mode__change_active')['forEach'](_0x19e780=>{_0x19e780['classList']['remove']('ck-ai-review-mode__change_active');});}['_setActiveClassOnMarker'](_0x3a3120){et['document']['querySelectorAll']('span[data-marker-id*=\x22'+_0x3a3120+'\x22]')['forEach'](_0x10e9aa=>{_0x10e9aa['classList']['add']('ck-ai-review-mode__change_active');});}['_setupClickOutsideHandler'](){_0x3685ee({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x221af0=[this['element']];return this['_pinnedTargetElement']&&_0x221af0['push'](this['_pinnedTargetElement']),_0x221af0;},'callback':()=>{this['hide'](),this['unpin'](),this['_removeActiveClassFromMarkers'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x7df575=new _0x3b9d21();return this['resultItemView']=new Ps(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x7df575['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai-review-mode-balloon-panel-suggestion',this['bindTemplate']['if']('isDiffActive','ck-ai-review-mode-balloon-panel-suggestion_diff-active')]},'children':[{'tag':'p','attributes':{'class':['ck-ai-review-mode__suggestion-text']},'children':[this['resultItemView']]}]}),_0x7df575;}['_getBestRectPositionOnClick'](_0x2c88fb,_0x1ac0ad,_0xd083d6,_0x59a791,_0xdb0dce){const _0x456d02=this['position']['replace']('arrow_',''),_0x37d462=Array['from'](_0x2c88fb['getClientRects']());let _0x54e0a3,_0x220044=_0x37d462['reverse']();return void 0x0!==_0x1ac0ad&&this['_isPinnedRectVisible'](_0x220044[_0x1ac0ad],_0x59a791,_0xdb0dce)?(_0x54e0a3=_0x220044[_0x1ac0ad],this['_pinnedRectIndex']=_0x1ac0ad):this['_isPinnedRectVisible'](_0x220044[0x0],_0x59a791,_0xdb0dce)&&void 0x0===_0x1ac0ad?_0x54e0a3=_0x220044[0x0]:(_0x220044='s'==_0x456d02[0x0]?[..._0x37d462]['reverse']():_0x37d462,_0x220044['forEach'](_0x5f3f92=>{this['_isPinnedRectVisible'](_0x5f3f92,_0x59a791,_0xdb0dce)&&(_0x54e0a3=_0x5f3f92);})),this['_pinnedTargetChangeId']=_0xd083d6,this['_pinnedTargetElement']=_0x2c88fb,_0x54e0a3||_0x2c88fb['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x18829f,_0xb698a2,_0x37eecf){const _0x4da78f=Array['from'](_0x18829f['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0xb698a2&&this['_pinnedTargetChangeId']!==_0x37eecf)return this['_pinnedRectIndex']=_0xb698a2,this['_pinnedTargetElement']=_0x18829f,this['_pinnedTargetChangeId']=_0x37eecf,_0x4da78f[_0xb698a2];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x37eecf){if(_0x18829f!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x4da78f[this['_pinnedRectIndex']];}return void 0x0!==_0xb698a2&&this['_pinnedTargetChangeId']!==_0x37eecf?(this['_pinnedRectIndex']=_0xb698a2,this['_pinnedTargetElement']=_0x18829f,this['_pinnedTargetChangeId']=_0x37eecf,_0x4da78f[_0xb698a2]):_0x18829f['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x3efc5e,_0x36eafd){if(_0x3efc5e)for(let _0x31809b=0x0;_0x31809b<_0x36eafd['length'];_0x31809b++){const _0x3dbd1c=_0x36eafd[_0x31809b];if(_0x3efc5e['clientX']>=_0x3dbd1c['left']-0x3&&_0x3efc5e['clientX']<=_0x3dbd1c['right']+0x3&&_0x3efc5e['clientY']>=_0x3dbd1c['top']-0x3&&_0x3efc5e['clientY']<=_0x3dbd1c['bottom']+0x3)return _0x31809b;}}['_isPinnedRectVisible'](_0x4b5641,_0x24f05b,_0x45e8c3){const _0x4c7d4a=new nt(_0x4b5641),_0x1e3681=_0x24f05b||document['documentElement'],_0x5098bb=_0x4c7d4a['getIntersection'](_0x5271b3(_0x45e8c3)),_0x48c0e1=new nt(_0x1e3681)['getIntersection'](_0x4c7d4a);return!!(_0x5098bb&&_0x48c0e1&&_0x4c7d4a['width']>0x0);}}const sh=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewModeResultList','activateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class oe extends tt{['_reviewModeView'];['_reviewModeBalloonSuggestionItemView'];['_bodyCollection'];static get['requires'](){return[pt];}static get['pluginName'](){return'AIReviewModeUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x28f393){super(_0x28f393),this['_bodyCollection']=new _0x57ac2d(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_reviewModeView']=new ue(this['context']['locale']),this['_reviewModeView']['delegate'](...sh)['to'](this),this['_reviewModeBalloonSuggestionItemView']=new Re(this['context']['locale'],this['_bodyCollection']),this['_reviewModeBalloonSuggestionItemView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x19f5db=this['context']['plugins']['get']('AITabs');_0x19f5db['view']['on']('activateTab',(_0x4db1e6,_0x5095df)=>{'reviewMode'===_0x5095df?this['fire']('getReviewCheckList'):this['fire']('leaveReviewMode');}),_0x19f5db['view']['addTab']({'id':'reviewMode','buttonLabel':C(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x413f91,'order':0x0,'content':this['_reviewModeView']});}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x5bd3b4){this['_reviewModeView']['reviewCheckListView']['hasChecks']()||this['_reviewModeView']['reviewCheckListView']['setChecks'](_0x5bd3b4),this['_reviewModeView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x39d430){_0x39d430&&('error-general'!==_0x39d430['status']?'error-chunk'!==_0x39d430['status']?this['_reviewModeView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x1e8846){this['_reviewModeView']['addCheckRunResult'](_0x1e8846);}['showGeneralResultsErrorView'](){this['_reviewModeView']['showGeneralResultsErrorView']();}['showGeneralReviewModeErrorView'](_0x1e0883){this['_reviewModeView']['showGeneralReviewModeErrorView'](_0x1e0883??C(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_reviewModeView']['showChunkErrorView']();}['setCheckResultTitle'](_0x1c9d86,_0x105e43){this['_reviewModeView']['reviewCheckResultsView']['setTitle'](_0x1c9d86,_0x105e43);}['setActiveStateInResults'](_0x51b6ac){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0xd9a02d=>{_0xd9a02d['id']===_0x51b6ac&&_0xd9a02d['setItemAsActive']();});}['resetActiveStateInResults'](){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x17d509=>_0x17d509['setItemAsInactive']());}['updateChangeState'](_0x1351cc,_0x30d939){'accepted'===_0x30d939||'rejected'===_0x30d939||'outdated'===_0x30d939?this['_reviewModeView']['reviewCheckResultsView']['hideResult'](_0x1351cc,_0x30d939):this['_reviewModeView']['reviewCheckResultsView']['showResult'](_0x1351cc,_0x30d939);}['showReviewCompletedView'](){this['_reviewModeView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_reviewModeView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_reviewModeView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_reviewModeView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x5e4414,_0x25197d,_0x577632,_0x4b8f33,_0x2ff6a2,_0x22b644){this['_reviewModeBalloonSuggestionItemView']['showBalloon'](_0x5e4414,_0x25197d,_0x577632,_0x4b8f33,_0x2ff6a2,_0x22b644);}['hideChangeBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideBalloon']();}['hideDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['showDiffInBalloon']();}['getChangeElement'](_0x34aff5){const _0xde829d=this['_reviewModeView']['reviewCheckResultsView']['getResults']()['find'](_0x24b0e5=>_0x24b0e5['id']===_0x34aff5);return _0xde829d?_0xde829d['element']:null;}['deactivateChange'](){this['_reviewModeBalloonSuggestionItemView']['deactivateChange']();}}const le='reviewmode-';class se extends tt{static get['pluginName'](){return'AIReviewModeEditing';}static get['requires'](){return[_0x16a419,l];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_domEmitter'];['_eventEmitter'];constructor(_0x19ac19){super(_0x19ac19),this['_domEmitter']=new(_0x4fb3ec())(),this['_eventEmitter']=new(_0x554e67())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0xd9c4fe=rt(this['context']);_0xd9c4fe['conversion']['for']('editingDowncast')['markerToElement']({'model':le+'insert','view':(_0x347521,{writer:_0x31fee2})=>{const _0xe2f6c3=this['_markers']['get'](_0x347521['markerName']),_0x596020={'class':'ck-ai_review-mode-marker_add','data-marker-id':_0x347521['markerName']};return _0x31fee2['createUIElement']('span',_0x596020,function(_0x48ea7b){const _0x3c1d8e=this['toDomElement'](_0x48ea7b);return _0x3c1d8e['innerHTML']=_0xe2f6c3?.['text']||'',_0x3c1d8e;});}}),_0xd9c4fe['conversion']['for']('editingDowncast')['markerToHighlight']({'model':le+'remove-only','view':_0x16b0ed=>({'classes':'ck-ai_review-mode-marker_strikethrough','attributes':{'data-marker-id':_0x16b0ed['markerName']}})}),_0xd9c4fe['conversion']['for']('editingDowncast')['markerToHighlight']({'model':le+'remove-context','view':_0x323c44=>({'classes':'ck-ai_review-mode-marker_underline','attributes':{'data-marker-id':_0x323c44['markerName']}})}),_0xd9c4fe['conversion']['for']('editingDowncast')['markerToHighlight']({'model':le+'remove-text','view':_0x20b99d=>({'classes':'ck-ai_review-mode-marker_hide','attributes':{'data-marker-id':_0x20b99d['markerName']}})}),_0xd9c4fe['conversion']['for']('dataDowncast')['markerToElement']({'model':le+'suggestion-context','view':(_0x412595,{writer:_0x9af9b0})=>_0x9af9b0['createRawElement']('span',{'class':'ck-ai_review-mode-marker_context-'+(_0x412595['isOpening']?'start':'end')})}),_0xd9c4fe['conversion']['for']('downcast')['attributeToAttribute']({'model':Ct,'view':_0x59ae46}),this['_domEmitter']['listenTo'](document,'click',(_0x5afc8b,_0x416547)=>{const _0xbb4363=_0x416547['target'],_0x2c33a5=this['_findMarkerElement'](_0xbb4363);if(!_0x2c33a5)return;const _0x110160=_0x2c33a5['getAttribute']('data-marker-id'),_0x38935b=_0x110160['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClick',{'markerId':_0x110160,'changeId':_0x38935b,'markerElement':_0x2c33a5,'domEvent':_0x416547});}),this['_domEmitter']['listenTo'](document,'mouseover',(_0x4aafc1,_0x5b7e60)=>{const _0x41e9e4=_0x5b7e60['target'],_0x388f46=_0x5b7e60['relatedTarget'];let _0x5eac73=this['_findMarkerElement'](_0x41e9e4);if(!_0x5eac73&&_0x388f46&&(_0x5eac73=this['_findMarkerElement'](_0x388f46)),!_0x5eac73)return;const _0x3cba81=_0x5eac73['getAttribute']('data-marker-id'),_0x226092=_0x3cba81['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x226092,'markerElement':_0x5eac73,'domEvent':_0x5b7e60});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x2a7aa9((_0x815583,_0x4b5f63)=>{const _0x9f67b0=_0x4b5f63['target'];if(this['_findMarkerElement'](_0x9f67b0))return;_0x9f67b0['closest']('.ck-reset.ck-ai-review-mode-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0xd9c4fe['model']['document']['registerPostFixer'](_0xbce1c=>this['_validateMarkers'](_0xd9c4fe,_0xbce1c)),_0xd9c4fe['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0xd9c4fe));}['getDocumentData'](){const _0x4074b4=this['context']['plugins']['get']('AIEditing'),_0x32ae36=rt(this['context']),_0x26da04=_0x32ae36['model'],_0x4be95b=new _0xce7080();for(const _0x4c4606 of _0x26da04['document']['getRoot']()['getChildren']()){const _0x18d619=_0x4c4606['_clone'](!0x0);_0x4be95b['_appendChild'](_0x18d619);}for(const _0x1408f7 of _0x26da04['markers'])_0x4be95b['markers']['set'](_0x1408f7['name'],this['_changeRangeOwnerDocument'](_0x1408f7['getRange']()['clone'](),_0x4be95b));const _0x16b486=new _0x306492({'ignoreElementEnd':!0x0,'startPosition':_0x26da04['createPositionAt'](_0x4be95b,0x0)}),_0x13cfb8=new Set(),_0x4c3446=new Map();for(const {item:_0x352024}of _0x16b486){if(!_0x352024['is']('$textProxy'))continue;const _0x45df38=_0x352024['parent'];if(_0x45df38&&_0x45df38['is']('element')){const _0x28da11=this['_upsertDataId'](_0x45df38,()=>_0x4074b4['_nextDataId'](_0x13cfb8));_0x13cfb8['add'](_0x28da11);for(const _0x192917 of _0x45df38['getChildren']())_0x192917['is']('element')&&_0x13cfb8['add'](this['_upsertDataId'](_0x192917,()=>_0x4074b4['_nextDataId'](_0x13cfb8)));let _0x5432cc=_0x45df38;for(;_0x5432cc['parent']&&!_0x5432cc['parent']['is']('documentFragment');)_0x5432cc=_0x5432cc['parent'],_0x5432cc['hasAttribute'](Ct)&&_0x5432cc['_removeAttribute'](Ct);_0x4c3446['set'](_0x28da11,{'path':_0x45df38['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x5432cc['_clone'](!0x0),_0x28da11,_0x32ae36['data'])}),_0x16b486['jumpTo'](_0x26da04['createPositionAfter'](_0x45df38));}}return{'content':_0x32ae36['data']['processor']['toData'](_0x32ae36['data']['toView'](_0x4be95b)),'version':_0x32ae36['model']['document']['version'],'elements':_0x4c3446};}['diffContent'](_0x521638,_0x2d93e1){const _0x558cf7=[],_0x3485dd=rt(this['context']),_0x3f333a=_0x3485dd['data']['parse'](_0x2d93e1,'$documentFragment'),_0x161492=_0x3485dd['data']['parse'](_0x521638,'$documentFragment'),_0x11a189=_0x3485dd['model']['createPositionAt'](_0x161492,0x0);if(this['_haveSingleTopLevelElement'](_0x3f333a)){if(!this['_hasSameTopLevelElement'](_0x161492,_0x3f333a))return _0x558cf7;}else{const _0x53b672=_0x3485dd['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x161492,_0x53b672)||!this['_haveOnlyInlineContent'](_0x3f333a,_0x53b672))return _0x558cf7;}const _0x570c30=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x521638,_0x2d93e1,{'anchor':_0x11a189,'markDeletions':!0x0})['getOperations']()['filter'](_0xae7ade=>'insert'===_0xae7ade['type']||'marker'===_0xae7ade['type']&&_0xae7ade['name']['startsWith']('$markedRemove')),_0x3d4a50=this['_groupAdjacentOperations'](_0x570c30);let _0x5cfb38=0x0;return _0x3485dd['model']['change'](_0x1e52e6=>{for(let _0x2a1c31=0x0;_0x2a1c31<_0x3d4a50['length'];_0x2a1c31++){const _0x54d0d9=_0x3d4a50[_0x2a1c31],_0x9d0de8=_0x1e52e6['createDocumentFragment']();for(const _0xd59942 of _0x161492['getChildren']())_0x1e52e6['append'](_0xd59942['_clone'](!0x0),_0x9d0de8);for(const _0x7540 of _0x54d0d9['operationsIsolated'])if('insert'===_0x7540['type']){const _0xdd2c40=_0x7540;_0xdd2c40['baseVersion']=null,_0xdd2c40['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0xdd2c40,_0x9d0de8),_0x1e52e6['batch']['addOperation'](_0x7540),_0x3485dd['model']['applyOperation'](_0x7540);const _0x3e3f47='suggestion:insertion:id:authorId:'+_0x5cfb38++,_0xc3bf14=_0x3485dd['model']['createRange'](_0xdd2c40['position'],_0xdd2c40['position']['getShiftedBy'](_0xdd2c40['howMany']));_0x9d0de8['markers']['set'](_0x3e3f47,_0xc3bf14);}else{if('marker'===_0x7540['type']&&_0x7540['name']['startsWith']('$markedRemove')){const _0x17179a=_0x7540,_0x3d01d2='suggestion:deletion:id:authorId:'+_0x5cfb38++;this['_changeOperationOwnerDocument'](_0x17179a,_0x9d0de8),_0x9d0de8['markers']['set'](_0x3d01d2,_0x17179a['newRange']);}}const _0x13e7d4=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x54d0d9['operationsIsolated'][0x0]),_0x9d0de8),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x54d0d9['operationsIsolated'][_0x54d0d9['operationsIsolated']['length']-0x1]),_0x9d0de8));_0x9d0de8['markers']['set'](le+'suggestion-context',new _0x4a8fb1(_0x13e7d4['start'],_0x13e7d4['end'])),_0x558cf7['push']({..._0x54d0d9,'context':this['_createGetContextFn'](_0x9d0de8,_0x3485dd['data'],{'ellipsisBefore':_0x13e7d4['hasContentBefore'],'ellipsisAfter':_0x13e7d4['hasContentAfter']}),'content':this['_createGetContentFn'](_0x9d0de8,_0x3485dd['data'])});}}),_0x558cf7;}['markChangePositionInEditorContent'](_0x108c2d,_0xf1892){if(!_0x108c2d['length'])return;const _0xd6c109=_0x108c2d[0x0]['parent']['id'],_0x3bd3b7=_0xf1892['elements']['get'](_0xd6c109);if(!_0x3bd3b7)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0xd6c109);const _0x3ead83=_0x3bd3b7['path'],_0x4771ca=rt(this['context']),_0x4dbb13=_0x4771ca['model']['document']['history']['getOperations'](_0xf1892['version']),_0xa801f3=[];for(const _0x55e4c7 of _0x108c2d){const _0x253952=_0x55e4c7['operationsIsolated']['map'](_0x551cc0=>this['_translateOperationToEditorContent'](_0x551cc0,_0x3ead83,_0x4771ca['model']['document']['getRoots']()[0x0]));if(!_0x253952||!_0x253952['length'])continue;const _0x357d22=_0x253952['every'](_0x44e1b9=>'marker'===_0x44e1b9['type']&&_0x44e1b9['name']['startsWith']('$markedRemove')),_0x25b73f={'document':_0x4771ca['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x243e28=_0x47c5f7(_0x253952,_0x4dbb13,_0x25b73f)['operationsA'];for(const _0x2e0343 of _0x243e28)if('insert'===_0x2e0343['type']){const _0x4eb33e=_0x2e0343,_0x5140dd=_0x4eb33e['nodes'];let _0x523abb='';for(const _0x1d31f6 of _0x5140dd)_0x1d31f6&&_0x1d31f6['is']('model:$text')&&(_0x523abb+=_0x1d31f6['data']);_0xa801f3['push']({'start':_0x4eb33e['position'],'end':_0x4eb33e['position'],'type':'insert','groupId':_0x55e4c7['id'],'text':_0x523abb});}else{if('marker'===_0x2e0343['type']&&_0x2e0343['name']['startsWith']('$markedRemove')){const _0x428b65=_0x2e0343;let _0x15e98c='remove-text';if(_0x357d22){const _0x3da36c=this['_findAdjacentContextDistance'](_0x428b65['newRange']['start'],'backward',_0x4771ca['model']['schema']),_0x1a7804=this['_findAdjacentContextDistance'](_0x428b65['newRange']['end'],'forward',_0x4771ca['model']['schema']);if(_0x3da36c||_0x1a7804){const _0x195277=_0x428b65['newRange']['start']['getShiftedBy'](-_0x3da36c),_0x2513d1=_0x428b65['newRange']['end']['getShiftedBy'](_0x1a7804);_0xa801f3['push']({'start':_0x195277,'end':_0x2513d1,'groupId':_0x55e4c7['id'],'type':'remove-context'});}else _0x15e98c='remove-only';}_0xa801f3['push']({'start':_0x428b65['newRange']['start'],'end':_0x428b65['newRange']['end'],'groupId':_0x55e4c7['id'],'type':_0x15e98c});}}}this['_insertMarkers'](_0xa801f3);}['clearAllMarkers'](){const _0x94cb76=rt(this['context']);_0x94cb76['model']['change'](_0x39311f=>{for(const _0x2fd95b of this['_markers']['keys']())_0x94cb76['model']['markers']['get'](_0x2fd95b)&&_0x39311f['removeMarker'](_0x2fd95b);}),this['_markers']['clear']();}['switchToReadOnly'](){rt(this['context'])['enableReadOnlyMode']('ai-review-mode');}['switchToEdit'](){rt(this['context'])['disableReadOnlyMode']('ai-review-mode');}['applyChange'](_0x16448c){const _0x3f7245=rt(this['context']),_0x359401=_0x3f7245['model'],_0x3f2863=_0x16448c['map'](_0x528d9f=>this['_getMarkersDataForGroup'](_0x528d9f))['flat']();_0x359401['change'](_0x5ce936=>{for(const _0x15abd2 of _0x3f2863){const _0x3c7d5c=_0x3f7245['model']['markers']['get'](_0x15abd2['id']);_0x3c7d5c&&('insert'===_0x15abd2['type']?_0x359401['insertContent'](_0x5ce936['createText'](_0x15abd2['text']||''),_0x3c7d5c['getRange']()['start']):'remove-text'!==_0x15abd2['type']&&'remove-only'!==_0x15abd2['type']||_0x359401['deleteContent'](_0x359401['createSelection'](_0x3c7d5c['getRange']())),_0x5ce936['removeMarker'](_0x15abd2['id']),this['_markers']['delete'](_0x15abd2['id']));}});}['rejectChange'](_0x1cc9f4){const _0x5f023f=rt(this['context']),_0x45cad1=this['_getMarkersDataForGroup'](_0x1cc9f4);_0x5f023f['model']['change'](_0x1fe425=>{for(const _0x286272 of _0x45cad1)_0x1fe425['removeMarker'](_0x286272['id']),this['_markers']['delete'](_0x286272['id']);});}['getEditor'](){return rt(this['context']);}['getMarkerElementForChange'](_0x2240c9){const _0x9a457c=Array['from'](this['_markers']['values']())['filter'](_0x12febf=>_0x12febf['groupId']===_0x2240c9);if(!_0x9a457c['length'])return null;const _0x163917=0x1===_0x9a457c['length']?_0x9a457c[0x0]:this['_sortMarkers'](_0x9a457c)[0x0],_0x440e1f=rt(this['context']),_0x3e9bd1=_0x440e1f['model']['markers']['get'](_0x163917['id']);if(!_0x3e9bd1)return null;const _0x51eae0=_0x3e9bd1['getRange'](),_0x4a2be6=_0x440e1f['editing']['view']['getDomRoot']();if(!_0x4a2be6||!_0x51eae0)return null;const _0x19d648=_0x4a2be6['querySelector']('[data-marker-id=\x22'+_0x163917['id']+'\x22]');return _0x19d648?{'modelRange':_0x51eae0,'domElement':_0x19d648}:null;}['_validateMarkers'](_0x117d36,_0x4b8dff){const _0x4bc1cb=Array['from'](this['_markers']['keys']()),_0x13d6ae=new Map();for(const _0x3423c2 of _0x4bc1cb){const _0x1b360a=_0x117d36['model']['markers']['get'](_0x3423c2);if(!_0x1b360a)continue;const _0x1404f7=_0x1b360a['getStart']()['path'][0x0];_0x13d6ae['has'](_0x1404f7)||_0x13d6ae['set'](_0x1404f7,[]),_0x13d6ae['get'](_0x1404f7)['push'](_0x1b360a);}const _0x1d4e05=new Set();for(const _0x8300e5 of _0x117d36['model']['document']['differ']['getChanges']()){let _0x5c00ad=-0x1,_0x91c72c=null;if('insert'===_0x8300e5['type'])_0x91c72c=new _0x4a8fb1(_0x8300e5['position'],_0x8300e5['position']['getShiftedBy'](_0x8300e5['length'])),_0x5c00ad=_0x8300e5['position']['path'][0x0];else{if('remove'!==_0x8300e5['type'])continue;_0x91c72c=new _0x4a8fb1(_0x8300e5['position']),_0x5c00ad=_0x8300e5['position']['path'][0x0];}const _0x8e3cbd=_0x13d6ae['get'](_0x5c00ad)||[];if(_0x8e3cbd['length']){for(const _0x399043 of _0x8e3cbd)if(_0x91c72c['root']['rootName']===_0x399043['getRange']()['root']['rootName']&&('insert'!==_0x8300e5['type']||!_0x91c72c['containsRange'](_0x399043['getRange']()))&&(_0x91c72c['isIntersecting'](_0x399043['getRange']())||_0x91c72c['start']['isTouching'](_0x399043['getRange']()['end'])||_0x91c72c['end']['isTouching'](_0x399043['getRange']()['start']))){const _0x492a7f=this['_parseMarkerName'](_0x399043['name']);Array['from'](this['_markers']['values']())['filter'](_0x5e1fdd=>_0x5e1fdd['groupId']===_0x492a7f['groupId'])['forEach'](_0x7f5e24=>_0x1d4e05['add'](_0x7f5e24['id']));}}}if(_0x1d4e05['size']){for(const _0xa16c6c of _0x1d4e05)_0x4b8dff['removeMarker'](_0xa16c6c);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x59302d){for(const {name:_0x4e7be2,data:_0x1db2be}of _0x59302d['model']['document']['differ']['getChangedMarkers']()){if(!_0x4e7be2['startsWith'](le))continue;const _0xeb7fca=_0x1db2be['oldRange'],_0x2018c3=_0x1db2be['newRange'],_0x52a3d8=_0xeb7fca&&'$graveyard'===_0xeb7fca['root']['rootName'],_0x354d98=_0x2018c3&&'$graveyard'===_0x2018c3['root']['rootName'];if(_0x52a3d8&&_0x354d98)continue;const _0x255c48=this['_parseMarkerName'](_0x4e7be2);this['_markers']['get'](_0x4e7be2)&&(_0x354d98||!_0x2018c3?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x4e7be2,'changeId':_0x255c48['groupId']}):_0x52a3d8&&_0x2018c3&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x4e7be2,'changeId':_0x255c48['groupId']}));}}['_parseMarkerName'](_0x204178){const _0x3b13f5=_0x204178['split'](':'),_0x1263b0=(_0x3b13f5[0x1]||'')['split']('_');return{'prefix':_0x3b13f5[0x0],'groupId':_0x1263b0[0x0],'suffix':_0x1263b0[0x1]};}['_translateOperationToEditorContent'](_0x236de6,_0x1f4f33,_0x452114){if('insert'===_0x236de6['type']){const _0x1b83c8=_0x236de6;return new _0x22f4fa(this['_changePosition'](_0x1f4f33['concat'](_0x1b83c8['position']['offset']),_0x452114),_0x1b83c8['nodes'],_0x1b83c8['baseVersion']);}if('marker'===_0x236de6['type']&&_0x236de6['name']['startsWith']('$markedRemove')){const _0x4ce88a=_0x236de6;return new _0x169d8c(_0x4ce88a['name'],_0x4ce88a['oldRange'],this['_changeRange'](_0x4ce88a['newRange'],_0x1f4f33['concat'](_0x4ce88a['newRange']['start']['offset']),_0x1f4f33['concat'](_0x4ce88a['newRange']['end']['offset']),_0x452114),_0x4ce88a['_markers'],_0x4ce88a['affectsData'],_0x4ce88a['baseVersion']);}return _0x236de6;}['_groupAdjacentOperations'](_0x3fad20){if(!_0x3fad20['length'])return[];const _0x139061=[];let _0x19fe8e=0x0,_0x2db83f=0x0,_0x35e5ee=[];for(let _0x312300=0x0;_0x312300<=_0x3fad20['length'];_0x312300++){const _0x162483=_0x3fad20[_0x312300],_0x224764=_0x3fad20[_0x312300-0x1];!_0x162483||_0x224764&&!this['_getOperationEnd'](_0x224764)['isTouching'](this['_getOperationStart'](_0x162483))?(_0x139061['push']({'operations':_0x35e5ee,'operationsIsolated':_0x35e5ee['map'](_0x22a5f6=>this['_shiftOperation'](_0x22a5f6['clone'](),-_0x2db83f)),'groupOffset':_0x19fe8e}),_0x35e5ee=_0x162483?[_0x162483]:[],_0x2db83f+=_0x19fe8e,_0x19fe8e=0x0):_0x35e5ee['push'](_0x162483),_0x162483&&'insert'===_0x162483['type']&&(_0x19fe8e+=_0x162483['howMany']);}return _0x139061;}['_findAdjacentContextDistance'](_0x1d6545,_0x42929a,_0x24a62f,_0x3829b9=0x1){const _0x3664e1=new _0x306492({'startPosition':_0x1d6545,'direction':_0x42929a});let _0xa8115e=0x0;for(let _0x159dd7=0x0;_0x159dd7<_0x3829b9;_0x159dd7++){let _0x3c96a6=0x0,_0x28cecc=!0x1,_0x774133='forward'===_0x42929a?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x1937e}of _0x3664e1)if(_0x1937e['is']('$textProxy')){const _0x4285ce=_0x774133['exec'](_0x1937e['data']);if(_0x4285ce&&_0x4285ce['length']){if(_0x3c96a6+='forward'===_0x42929a?_0x4285ce['index']+_0x4285ce[0x0]['length']:_0x1937e['data']['length']-_0x4285ce['index'],_0x4285ce[0x0]['length']!==_0x1937e['data']['length'])break;_0x28cecc=!0x0,_0x774133='forward'===_0x42929a?/^\w+/:/\w+$/;}else{if(_0x28cecc)break;_0x3c96a6+=_0x1937e['offsetSize'];}}else{if(_0x1937e['is']('element')){_0x24a62f['isInline'](_0x1937e)&&!_0x28cecc&&(_0x3c96a6+=0x1);break;}}_0xa8115e+=_0x3c96a6,_0x3664e1['jumpTo'](_0x1d6545['getShiftedBy']('forward'===_0x42929a?_0xa8115e:-_0xa8115e));}return _0xa8115e;}['_getChangeContext'](_0x3b5f2b,_0x534322){const _0x31c85c=rt(this['context'])['model']['schema'],_0x33758d=this['_findAdjacentContextDistance'](_0x3b5f2b,'backward',_0x31c85c,0x6),_0x140d31=this['_findAdjacentContextDistance'](_0x534322,'forward',_0x31c85c,0x6),_0x433105=_0x3b5f2b['getShiftedBy'](-_0x33758d),_0x10cbbe=_0x534322['getShiftedBy'](_0x140d31);return{'start':_0x433105,'end':_0x10cbbe,'hasContentBefore':!_0x433105['isAtStart'],'hasContentAfter':!_0x10cbbe['isAtEnd']};}['_insertMarkers'](_0x582a65){const _0x1da0e7=this['context']['plugins']['get']('AIEditing'),_0x25e2b2=new Set();rt(this['context'])['model']['change'](_0x537406=>{for(const _0x32470a of _0x582a65){const _0x1729f2=''+le+_0x32470a['type']+':'+_0x32470a['groupId']+'_'+_0x1da0e7['_nextDataId'](_0x25e2b2);this['_markers']['set'](_0x1729f2,{'id':_0x1729f2,'groupId':_0x32470a['groupId'],'type':_0x32470a['type'],'text':_0x32470a['text']}),_0x537406['addMarker'](_0x1729f2,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x537406['createRange'](_0x32470a['start'],_0x32470a['end'])});}});}['_createGetContextFn'](_0x240488,_0x22cf2b,_0x429532){let _0x34adf7='';return()=>{if(!_0x34adf7){const _0x49dd5c=_0x22cf2b['toView'](_0x240488,{'showSuggestionHighlights':!0x0});let _0x254c7a=_0x49dd5c['getChild'](0x0);if(_0x254c7a['is']('containerElement')||(_0x254c7a=_0x49dd5c),!_0x254c7a)return'';let _0x2210b2=!0x1;const _0x35603c=[];for(const _0x3a9828 of _0x254c7a['getChildren']())_0x3a9828['is']('element','span')&&_0x3a9828['hasClass']('ck-ai_review-mode-marker_context-end')&&(_0x2210b2=!0x1),_0x2210b2&&_0x35603c['push'](_0x3a9828),_0x3a9828['is']('element','span')&&_0x3a9828['hasClass']('ck-ai_review-mode-marker_context-start')&&(_0x2210b2=!0x0);_0x254c7a['_removeChildren'](0x0,_0x254c7a['childCount']),_0x429532?.['ellipsisBefore']&&_0x254c7a['_appendChild']('…'),_0x254c7a['_appendChild'](_0x35603c),_0x429532?.['ellipsisAfter']&&_0x254c7a['_appendChild']('…');const _0x2a78b9=_0x22cf2b['htmlProcessor']['domConverter']['viewToDom'](_0x49dd5c),_0x1993e3=_0x22cf2b['htmlProcessor']['htmlWriter']['getHtml'](_0x2a78b9);_0x34adf7=_0x1993e3;}return _0x34adf7;};}['_createGetContentFn'](_0x4e1e6b,_0x23b67b){let _0x46a505='';return()=>(_0x46a505||(_0x46a505=_0x23b67b['stringify'](_0x4e1e6b,{'showSuggestionHighlights':!0x0})),_0x46a505);}['_createGetContentUsingDataIdFn'](_0x4d796b,_0x51d575,_0x19f22a){let _0x57ef2a='';return()=>{if(!_0x57ef2a){const _0x2e38f3=_0x19f22a['toView'](new _0xce7080(_0x4d796b)),_0x1eff86=_0x19f22a['htmlProcessor']['domConverter']['viewToDom'](_0x2e38f3)['querySelector']('[data-id=\x22'+_0x51d575+'\x22]');_0x57ef2a=_0x1eff86?.['outerHTML']||'';}return _0x57ef2a;};}['_findMarkerElement'](_0x56fcd8,_0x1db5f9=0x5){let _0x1f2a2b=_0x56fcd8,_0x44cf09=null;for(let _0x528038=0x0;_0x528038<_0x1db5f9&&_0x1f2a2b;_0x528038++){if(!_0x1f2a2b['className']){_0x1f2a2b=_0x1f2a2b['parentElement'];continue;}if(!(''+_0x1f2a2b['className'])['includes']('ck-ai_review-mode-marker_')){_0x1f2a2b=_0x1f2a2b['parentElement'];continue;}if(!_0x1f2a2b['getAttribute']('data-marker-id'))break;_0x44cf09=_0x1f2a2b;break;}return _0x44cf09;}['_getMarkersDataForGroup'](_0x13d7bf){return Array['from'](this['_markers']['values']())['filter'](_0x56de7c=>_0x56de7c['groupId']===_0x13d7bf);}['_getOperationStart'](_0x1bbe61){return'insert'===_0x1bbe61['type']?_0x1bbe61['position']:_0x1bbe61['newRange']['start'];}['_getOperationEnd'](_0x15ef8a,_0x5d871d=!0x1){return'insert'===_0x15ef8a['type']?_0x5d871d?_0x15ef8a['position']:_0x15ef8a['position']['getShiftedBy'](_0x15ef8a['howMany']):_0x15ef8a['newRange']['end'];}['_shiftOperation'](_0x4e9486,_0x12dd60){return'insert'===_0x4e9486['type']?_0x4e9486['position']=_0x4e9486['position']['getShiftedBy'](_0x12dd60):'marker'===_0x4e9486['type']&&_0x4e9486['newRange']&&(_0x4e9486['newRange']=new _0x4a8fb1(_0x4e9486['newRange']['start']['getShiftedBy'](_0x12dd60),_0x4e9486['newRange']['end']['getShiftedBy'](_0x12dd60))),_0x4e9486;}['_changeOperationOwnerDocument'](_0x10cf14,_0x57acc8){'insert'===_0x10cf14['type']?_0x10cf14['position']=this['_changePositionOwnerDocument'](_0x10cf14['position'],_0x57acc8):'marker'===_0x10cf14['type']&&_0x10cf14['newRange']&&(_0x10cf14['newRange']=this['_changeRangeOwnerDocument'](_0x10cf14['newRange'],_0x57acc8));}['_changePositionOwnerDocument'](_0x495927,_0xabc711){return new _0x1e8cb7(_0xabc711,_0x495927['path']);}['_changeRangeOwnerDocument'](_0x3a42cc,_0x3f3eb8){return new _0x4a8fb1(this['_changePositionOwnerDocument'](_0x3a42cc['start'],_0x3f3eb8),this['_changePositionOwnerDocument'](_0x3a42cc['end'],_0x3f3eb8));}['_changePosition'](_0x48b57d,_0x4eaa8d){return new _0x1e8cb7(_0x4eaa8d,[..._0x48b57d]);}['_changeRange'](_0x3458e0,_0x187e21,_0x3f32fc,_0x2d7a7b){return new _0x4a8fb1(this['_changePosition'](_0x187e21,_0x2d7a7b),this['_changePosition'](_0x3f32fc,_0x2d7a7b));}['_sortMarkers'](_0x59d5b7){const _0x90e977=_0x1b7040=>{switch(_0x1b7040){case'insert':return 0x1;case'remove-context':return 0x2;case'remove-only':return 0x3;case'remove-text':return 0x4;}};return _0x59d5b7['sort']((_0x34558f,_0x48af3d)=>_0x90e977(_0x34558f['type'])-_0x90e977(_0x48af3d['type']));}['_hasSameTopLevelElement'](_0x362b20,_0x1f6c5a){const _0x2e23af=_0x362b20['getChild'](0x0),_0x4027f9=_0x1f6c5a['getChild'](0x0);return!(!_0x2e23af||!_0x4027f9)&&((!_0x2e23af['is']('element')||!_0x4027f9['is']('element')||_0x2e23af['name']===_0x4027f9['name'])&&!(_0x2e23af['is']('element')&&!_0x4027f9['is']('element')||!_0x2e23af['is']('element')&&_0x4027f9['is']('element')));}['_haveSingleTopLevelElement'](_0x2e1528){return 0x1===_0x2e1528['childCount'];}['_haveOnlyInlineContent'](_0x4a1cbe,_0x34ba59){for(const _0x1f4c70 of _0x4a1cbe['getChildren']())if(_0x1f4c70['is']('element')&&!_0x34ba59['isInline'](_0x1f4c70))return!0x1;return!0x0;}['_upsertDataId'](_0x4ba83b,_0x39b01f){let _0x411380=_0x4ba83b['getAttribute'](Ct);return _0x411380||(_0x411380=_0x39b01f(),_0x4ba83b['_setAttribute'](Ct,_0x411380)),_0x411380;}}class Ga extends tt{static get['requires'](){return[re,oe,se];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{oi as AIActions,W as AIAdapter,$n as AIAssistant,L as AIAssistantUI,_ as AIBalloon,Da as AIChat,ct as AIChatController,dt as AIChatHistory,jt as AIChatHistoryController,xt as AIChatHistoryUI,mt as AIChatUI,s as AIConnector,l as AIEditing,Ma as AIEditorIntegration,Dt as AIQuickActionType,Va as AIQuickActions,ri as AIQuickActionsUI,is as AIRequestError,js as AIReviewCheck,Ds as AIReviewCheckResult,zs as AIReviewCheckRun,Ga as AIReviewMode,re as AIReviewModeController,se as AIReviewModeEditing,oe as AIReviewModeUI,pt as AITabs,Se as AITextAdapter,qt as AIToggleButtonUI,Xn as AWSTextAdapter,Qn as OpenAITextAdapter,X as ShowAIAssistantCommand,co as ToggleAICommand,ks as createResizeButton,qn as getDefaultAICommands};
23
+ import{Plugin as _0x346ac8,Command as Qt,ContextPlugin as ot,Editor as _t}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x8c93b,IconCheck as _0x3cb840,IconError as _0x3769b2,IconSubmit as _0x2913f7,IconAIHistory as Ut,IconMagicWand as _0x49e0da,IconRobotPencil as _0x54d69e,IconMaximize as _0x5502eb,IconMinimize as to,IconDocumentWithLoupe as _0x4e4a4d,IconAddComment as _0x5a38fc,IconShowChangesOn as _0x44c63f,IconShowChangesOff as _0x4f3f9b,IconDocument as _0x193d2b,IconThreeStars as _0x2fb154,IconRemove as _0x5472b4,IconDocumentWithCheckmark as _0x411438,IconDocumentWithCross as _0x4b0f8d,IconLoupe as _0x4f50f5,IconCancel as _0x3a96a0,IconStop as _0x171167,IconAIChat as Ht,IconPlus as _0x357a3c,IconPin as _0x39ada3,IconThreeHorizontalDots as _0x16c5df,IconChevronRight as _0x37e1aa,IconInfo as _0x314620,IconOutdated as _0x2f860e,IconEye as _0x3db73e,IconEyeCrossedOut as _0x2bc066,IconAIReview as _0x223d73}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0xdc126c,CKEditorError as _0x36b126,ObservableMixin as ts,global as lt,isVisible as _0x13140d,Rect as ct,Collection as _0x5137f7,FocusTracker as _0x25d272,KeystrokeHandler as _0xfe6d51,first as _0x165b43,toArray as _0x4a22ae,EmitterMixin as _0x19d98c,logWarning as _0x3219ae,logError as ft,scrollViewportToShowTarget as ht,ResizeObserver as _0x123cdf,_isMotionReduced as Pt,scrollAncestorsToShowTarget as _0x4ff008,getConstrainedViewportRect as _0x114f82,DomEmitterMixin as _0x5b5d27}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x312a64,ButtonView as _0xcbb426,View as _0x43effc,SpinnerView as _0x5da037,IconView as _0x4caa0b,AutocompleteView as _0x53698e,ListView as _0x5bd1ba,ListItemGroupView as _0x5230c7,ListItemView as _0x3f0116,ButtonLabelView as _0x43f368,FocusCycler as _0x4b849d,createLabeledTextarea as _0x49d9f6,Dialog as _0xe646c5,createDropdown as _0x2e287a,addMenuToDropdown as _0x10a136,MenuBarMenuView as _0x44a9af,MenuBarMenuListItemButtonView as _0x3ce5a8,DialogViewPosition as _0x54d5b5,MenuBarMenuListView as _0x32dd81,MenuBarMenuListItemView as _0x53ce29,UIModel as _0x3344bf,SplitButtonView as _0x25f6a8,BalloonPanelView as _0x2ae23a,BodyCollection as _0x44dc72,clickOutsideHandler as _0x4b855c,ListItemButtonView as _0x2ab14c,ViewCollection as _0x317ee8,addListToDropdown as _0x44b9be,submitHandler as _0x27e72b,LabeledFieldView as _0x454e15,createLabeledInputText as _0x42b133,FormHeaderView as _0xbcda8a,HighlightedTextView as _0x407d13,FileDialogButtonView as _0x486231,InputTextView as _0xa4bda4,SearchTextView as _0x1f1a68,ButtonLabelWithHighlightView as _0xa65920,DropdownMenuPanelPositioningFunctions as _0x3686ba,BalloonToolbar as _0x5a3ac9,FormRowView as _0x2eaca7,TextareaView as _0x19a367}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x210076,ClipboardMarkersUtils as _0x500258}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x407c9a,ViewDataTransfer as _0x13d2e1,ViewUpcastWriter as _0x5b43a2,Matcher as _0xa40f65,_DetachOperation as it,_insertIntoModelNodeList as _0xf35697,_removeFromModelNodeList as _0x2f772f,ModelRange as _0x1026dd,ViewDowncastWriter as Ft,transformOperationSets as st,ModelDocumentFragment as _0x490745,ModelPosition as tt,ModelTreeWalker as _0x467163,InsertOperation as _0x55f538,MarkerOperation as _0x22c2d1}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x5d07f8,escape as _0x469020,escapeRegExp as _0x54c692,debounce as _0x51d0da}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x3bdc8d,InvokeModelWithResponseStreamCommand as _0x26e8c7,InvokeModelCommand as _0x62d133}from'@aws-sdk/client-bedrock-runtime';import{createParser as $t}from'eventsource-parser';import{parseDocument as _0x3254d4}from'htmlparser2';import{isTag as _0x499346,findOne as St,getParent as _0x5d775c,findAll as _0x4a6dcc,removeElement as _0x1b183f,replaceElement as _0x46b47c,prepend as _0x4c7871,prependChild as _0x377b76,appendChild as _0x19757f,append as _0x2301a3,find as _0x2e7bf0,isComment as _0x543d27,getChildren as _0x2bc64a,textContent as _0x1f24f8}from'domutils';import _0x4b71ff from'dom-serializer';import{Document as Rt,Element as _0xec973e,Text as _0x4e1833,cloneNode as _0xdcae32,isDocument as _0x59f677,isText as _0xa705c,NodeWithChildren as _0x1f4fb6}from'domhandler';import{MarkdownGfmMdToHtml as _0x46b180}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x7900ef,getAllMarkersDomElementsSorted as rt,DocumentCompare as _0x2dc9e7,DATA_ID_MODEL_ATTRIBUTE as yt,ConfirmMixin as _0x57d898,LateFocusDropdownButtonView as _0x1fb857,DATA_ID_VIEW_ATTRIBUTE as _0x29ff88}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x26086b}from'es-toolkit';import{IconThumbUp as _0x526026,IconThumbDown as _0xbf231a,IconCopy as _0x2178ff,IconCheck as _0x16fc5d,IconShowChangesOff as _0x24690e,IconShowChangesOn as _0x4c508d,IconWeb as _0x46b22c,IconNextArrow as _0x4309f7,IconPreviousArrow as _0x1420c7,IconAI as Nt,IconClose as _0x516001,IconSelection as _0x498e88,IconFileUpload as _0x18ec8e,IconLink as _0x3ed6af,IconDocument as _0x584f93,IconBulb as _0x279253,IconDocumentOutline as _0x1c2f3f,IconPaperClip as _0x40e1b5,IconBrowseFiles as _0x26357d,IconDropdownArrow as _0x53f601,IconAIAskAI as _0x4e4731,IconAIQuickActions as _0x157b90,IconAIChatCommands as Bt,IconAIImproveWriting as Xt,IconAIContinueWriting as Jt,IconAIGrammarCheck as Vt,IconAIAdjustLength as Kt,IconAIChangeTone as Wt,IconAITranslate as te,IconAIOther as Zt,IconRefresh as _0xdacbe3}from'@ckeditor/ckeditor5-icons/dist/index.js';import _0x34c121 from'morphdom';import{SuggestionsConversion as zt}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import{diffArrays as _0xbfd009}from'diff';const x='_ungrouppedCommands';function o(_0x2c4e9c,_0x439502){const _0x12add=(0x0,_0x439502['t'])('Other');return _0x2c4e9c['length']?'groupId'in _0x2c4e9c[0x0]?_0x2c4e9c:[{'groupId':x,'groupLabel':_0x12add,'order':0x1/0x0,'commands':_0x2c4e9c}]:[{'groupId':x,'groupLabel':_0x12add,'order':0x1/0x0,'commands':[]}];}const Wn=globalThis['DataTransfer'],f='ai-ui';class a extends _0x346ac8{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x270e6b}=this,_0x51bfb0=['ck-fake-ai-selection'];_0x270e6b['config']['get']('ai.assistant.useTheme')&&_0x51bfb0['push']('ck-ai-assistant-ui_theme'),_0x270e6b['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x51bfb0,'priority':0xc}}),_0x270e6b['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x57be62,{writer:_0x16ae8d})=>{if(!_0x57be62['markerRange']['isCollapsed'])return null;const _0x5b23c7=_0x16ae8d['createUIElement']('span');return _0x16ae8d['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x5b23c7),_0x5b23c7;}});}['afterInit'](){!async function(_0x2d7956){const _0xf9afc3=_0x796f11([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]),_0x5933cf=0x3dffc4e1,_0x1a9713=0x3df8ba61^_0x5933cf,_0x5490a7=window[_0x796f11([0x44,0x61,0x74,0x65])][_0x796f11([0x6e,0x6f,0x77])](),_0x3b9147=_0x2d7956[_0x796f11([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x5075e5=new window[(_0x796f11([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x12de43=>{_0x3b9147[_0x796f11([0x6f,0x6e,0x63,0x65])](_0x796f11([0x72,0x65,0x61,0x64,0x79]),_0x12de43);}),_0x446134={[_0x796f11([0x6b,0x74,0x79])]:_0x796f11([0x45,0x43]),[_0x796f11([0x75,0x73,0x65])]:_0x796f11([0x73,0x69,0x67]),[_0x796f11([0x63,0x72,0x76])]:_0x796f11([0x50,0x2d,0x32,0x35,0x36]),[_0x796f11([0x78])]:_0x796f11([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]),[_0x796f11([0x79])]:_0x796f11([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]),[_0x796f11([0x61,0x6c,0x67])]:_0x796f11([0x45,0x53,0x32,0x35,0x36])},_0x483298=_0x3b9147[_0x796f11([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x796f11([0x67,0x65,0x74])](_0x796f11([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x5ee7a4(){let _0x760a17,_0x24a1c2=null,_0xca1ce1=null;try{if(_0x483298==_0x796f11([0x47,0x50,0x4c]))return _0x796f11([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x760a17=_0x37761a(),!_0x760a17)return _0x796f11([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x760a17[_0x796f11([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0xca1ce1=_0x5b1e71(_0x760a17[_0x796f11([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x760a17[_0x796f11([0x6a,0x74,0x69])])),await _0x3cfe6d()?_0x5c2ab0()?_0x1083e8()?_0x796f11([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x165ec6()?(_0x760a17[_0x796f11([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x796f11([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x24a1c2=_0x1f1df7(_0x796f11([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x1c2c6a()):_0x796f11([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x796f11([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x796f11([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x796f11([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x1083e8(){const _0x542950=[_0x796f11([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x796f11([0x74,0x72,0x69,0x61,0x6c])][_0x796f11([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x760a17[_0x796f11([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x5490a7/0x3e8:0xe10*_0x1a9713;return _0x760a17[_0x796f11([0x65,0x78,0x70])]<_0x542950;}function _0x5c2ab0(){const _0xf0d5df=_0x760a17[_0x796f11([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0xf0d5df&&(!!_0xf0d5df[_0x796f11([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x796f11([0x2a]))||!!_0xf0d5df[_0x796f11([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x796f11([0x41,0x49])));}function _0x165ec6(){const _0x49a760=_0x760a17[_0x796f11([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x49a760||0x0==_0x49a760[_0x796f11([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x46c7b8}=new URL(window[_0x796f11([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x49a760[_0x796f11([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x46c7b8))return!0x0;const _0x18d05e=_0x46c7b8[_0x796f11([0x73,0x70,0x6c,0x69,0x74])](_0x796f11([0x2e]));return _0x49a760[_0x796f11([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x25cf89=>_0x25cf89[_0x796f11([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x796f11([0x2a])))[_0x796f11([0x6d,0x61,0x70])](_0x23922e=>_0x23922e[_0x796f11([0x73,0x70,0x6c,0x69,0x74])](_0x796f11([0x2e])))[_0x796f11([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x50ce22=>_0x50ce22[_0x796f11([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x18d05e[_0x796f11([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x796f11([0x6d,0x61,0x70])](_0x1348a9=>Array(_0x18d05e[_0x796f11([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x1348a9[_0x796f11([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x796f11([0x66,0x69,0x6c,0x6c])](_0x1348a9[0x0]===_0x796f11([0x2a])?_0x796f11([0x2a]):'')[_0x796f11([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x1348a9))[_0x796f11([0x73,0x6f,0x6d,0x65])](_0xe9b22d=>_0x18d05e[_0x796f11([0x65,0x76,0x65,0x72,0x79])]((_0xeda4dd,_0x4e10a7)=>_0xe9b22d[_0x4e10a7]===_0xeda4dd||_0xe9b22d[_0x4e10a7]===_0x796f11([0x2a])));}function _0x1c2c6a(){return _0x24a1c2&&_0xca1ce1?new window[(_0x796f11([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0xcc65c7,_0xb10702)=>{_0x24a1c2[_0x796f11([0x74,0x68,0x65,0x6e])](_0xcc65c7,_0xb10702),_0xca1ce1[_0x796f11([0x74,0x68,0x65,0x6e])](_0x2baaf1=>{_0x2baaf1!=_0x796f11([0x56,0x61,0x6c,0x69,0x64])&&_0xcc65c7(_0x2baaf1);},_0xb10702);}):_0x24a1c2||_0xca1ce1||_0x796f11([0x56,0x61,0x6c,0x69,0x64]);}}function _0x5b1e71(_0x2937af,_0x390fba){return new window[(_0x796f11([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2fad52=>{if(_0x25367b())return _0x2fad52(_0x796f11([0x56,0x61,0x6c,0x69,0x64]));_0x2b260a(),_0x3b9147[_0x796f11([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x796f11([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x9fc533=!0x1;const _0x353920=_0xdc126c();function _0x25a367(_0x1885b1){return!!_0x1885b1&&(typeof _0x1885b1===_0x796f11([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x1885b1===_0x796f11([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x1885b1[_0x796f11([0x74,0x68,0x65,0x6e])]===_0x796f11([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x1885b1[_0x796f11([0x63,0x61,0x74,0x63,0x68])]===_0x796f11([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x1e0b42(_0x20bc57){_0x20ad41(_0x20bc57)[_0x796f11([0x74,0x68,0x65,0x6e])](_0x22e700=>{if(!_0x22e700||_0x22e700[_0x796f11([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x796f11([0x6f,0x6b]))return _0x796f11([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x255fa5(_0x414269(_0x353920+_0x390fba))!=_0x22e700[_0x796f11([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x796f11([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x796f11([0x56,0x61,0x6c,0x69,0x64]);})[_0x796f11([0x74,0x68,0x65,0x6e])](_0x4f402b=>(_0x30d60d(),_0x4f402b),()=>{const _0x2cca0c=_0x4e5696();return null==_0x2cca0c?(_0x30d60d(),_0x796f11([0x56,0x61,0x6c,0x69,0x64])):_0x796f11(_0x5490a7-_0x2cca0c>(0x19f340e1^_0x5933cf)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x796f11([0x74,0x68,0x65,0x6e])](_0x2fad52)[_0x796f11([0x63,0x61,0x74,0x63,0x68])](()=>{_0x2fad52(_0x796f11([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x1cb1a6=0x3dc92a61^_0x5933cf;function _0x30d60d(){const _0x224a23=_0x796f11([0x6c,0x6c,0x63,0x74,0x2d])+_0x255fa5(_0x414269(_0x2937af)),_0x42471d=_0x8cc13f(_0x255fa5(window[_0x796f11([0x4d,0x61,0x74,0x68])][_0x796f11([0x63,0x65,0x69,0x6c])](_0x5490a7/_0x1cb1a6)));window[_0x796f11([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x796f11([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x224a23,_0x42471d);}function _0x4e5696(){const _0x54b042=_0x796f11([0x6c,0x6c,0x63,0x74,0x2d])+_0x255fa5(_0x414269(_0x2937af)),_0x588242=window[_0x796f11([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x796f11([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x54b042);return _0x588242?window[_0x796f11([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x8cc13f(_0x588242),0x10)*_0x1cb1a6:null;}function _0x20ad41(_0x429ce7){return new window[(_0x796f11([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x35aeaf,_0x3999c6)=>{_0x429ce7[_0x796f11([0x74,0x68,0x65,0x6e])](_0x35aeaf,_0x3999c6),window[_0x796f11([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x3999c6,0x3dfe1021^_0x5933cf);});}}_0x3b9147[_0x796f11([0x6f,0x6e])](_0x796f11([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x5ca421,_0xf527b7)=>{if(_0xf527b7[0x0]!=_0x2937af)return _0x2fad52(_0x796f11([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0xf527b7[0x1]={..._0xf527b7[0x1],[_0x796f11([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x353920};},{[_0x796f11([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x796f11([0x68,0x69,0x67,0x68])}),_0x3b9147[_0x796f11([0x6f,0x6e])](_0x796f11([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x176df6=>{_0x25a367(_0x176df6[_0x796f11([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x9fc533=!0x0,_0x1e0b42(_0x176df6[_0x796f11([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x796f11([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x796f11([0x6c,0x6f,0x77])}),_0x5075e5[_0x796f11([0x74,0x68,0x65,0x6e])](()=>{_0x9fc533||_0x2fad52(_0x796f11([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x25367b(){return _0x3b9147[_0x796f11([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x796f11([0x76,0x69,0x65,0x77])][_0x796f11([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x796f11([0x61,0x75,0x74,0x6f]);}function _0x2b260a(){_0x3b9147[_0x796f11([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x796f11([0x76,0x69,0x65,0x77])][_0x796f11([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x796f11([0x61,0x75,0x74,0x6f]);}}function _0x1f1df7(_0x4a822f){const _0x19c63f=[new window[(_0x796f11([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xec3727=>setTimeout(_0xec3727,0x3df6fa2d^_0x5933cf)),_0x5075e5[_0x796f11([0x74,0x68,0x65,0x6e])](()=>new window[(_0x796f11([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1c431c=>{let _0x324761=0x0;_0x3b9147[_0x796f11([0x6d,0x6f,0x64,0x65,0x6c])][_0x796f11([0x6f,0x6e])](_0x796f11([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0xfbfae0,_0x45f616)=>{_0x45f616[0x0][_0x796f11([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x324761++,_0x324761==(0x3dffc109^_0x5933cf)&&(_0x1c431c(),_0xfbfae0[_0x796f11([0x6f,0x66,0x66])]());});}))];return window[_0x796f11([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x796f11([0x72,0x61,0x63,0x65])](_0x19c63f)[_0x796f11([0x74,0x68,0x65,0x6e])](()=>_0x4a822f);}async function _0xb81f0c(){await _0x5075e5,_0x3b9147[_0x796f11([0x6d,0x6f,0x64,0x65,0x6c])][_0x796f11([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x51b2f6,_0x3b9147[_0x796f11([0x6d,0x6f,0x64,0x65,0x6c])][_0x796f11([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x51b2f6,_0x3b9147[_0x796f11([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x796f11([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x16513d(_0x45deec){const _0x3a6d1b=_0x58543d();_0x3b9147[_0x3a6d1b]=_0x796f11([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x45deec,_0x45deec!=_0x796f11([0x56,0x61,0x6c,0x69,0x64])&&_0xb81f0c();}function _0x58543d(){const _0x5f4b18=window[_0x796f11([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x796f11([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x796f11([0x6e,0x6f,0x77])]())[_0x796f11([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x796f11([0x2e]),'');let _0x4f9d82=_0x796f11([0x6e]);for(let _0x57bbbf=0x0;_0x57bbbf<_0x5f4b18[_0x796f11([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x57bbbf+=0x2){let _0x5a97d1=window[_0x796f11([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5f4b18[_0x796f11([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x57bbbf,_0x57bbbf+0x2));_0x5a97d1>=_0xf9afc3[_0x796f11([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x5a97d1-=_0xf9afc3[_0x796f11([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x4f9d82+=_0xf9afc3[_0x5a97d1];}return _0x4f9d82;}function _0x37761a(){const _0x1187b4=_0x483298[_0x796f11([0x73,0x70,0x6c,0x69,0x74])](_0x796f11([0x2e]));if(0x3!=_0x1187b4[_0x796f11([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x5278f4(_0x1187b4[0x1]);function _0x5278f4(_0x2c7eea){const _0x57f021=_0x53b221(_0x2c7eea);return _0x57f021&&_0x32f996()?_0x57f021:null;function _0x32f996(){const _0x30b78e=_0x57f021[_0x796f11([0x6a,0x74,0x69])],_0x20b700=window[_0x796f11([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x30b78e[_0x796f11([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x30b78e[_0x796f11([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x3bfe6a={..._0x57f021,[_0x796f11([0x6a,0x74,0x69])]:_0x30b78e[_0x796f11([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x30b78e[_0x796f11([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x3bfe6a[_0x796f11([0x76,0x63])],_0x414269(_0x3bfe6a)==_0x20b700;}}}async function _0x3cfe6d(){let _0x450db0=!0x0;try{const _0xa903ba=_0x483298[_0x796f11([0x73,0x70,0x6c,0x69,0x74])](_0x796f11([0x2e])),[_0x485cf5,_0x2fd19e,_0x4ac066]=_0xa903ba;return _0x228290(_0x485cf5),await _0x179192(_0x485cf5,_0x2fd19e,_0x4ac066),_0x450db0;}catch{return!0x1;}function _0x228290(_0x281b2f){const _0x5c5ceb=_0x53b221(_0x281b2f);_0x5c5ceb&&_0x5c5ceb[_0x796f11([0x61,0x6c,0x67])]==_0x796f11([0x45,0x53,0x32,0x35,0x36])||(_0x450db0=!0x1);}async function _0x179192(_0x24585b,_0x7c42ca,_0x4e12c7){const _0x3c350d=window[_0x796f11([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x796f11([0x66,0x72,0x6f,0x6d])](_0x414260(_0x4e12c7),_0x298589=>_0x298589[_0x796f11([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x2d190d=new window[(_0x796f11([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x796f11([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x24585b+_0x796f11([0x2e])+_0x7c42ca),_0x3d4d2d=window[_0x796f11([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x796f11([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x3d4d2d)return;const _0x3ea799=await _0x3d4d2d[_0x796f11([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x796f11([0x6a,0x77,0x6b]),_0x446134,{[_0x796f11([0x6e,0x61,0x6d,0x65])]:_0x796f11([0x45,0x43,0x44,0x53,0x41]),[_0x796f11([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x796f11([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x796f11([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x3d4d2d[_0x796f11([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x796f11([0x6e,0x61,0x6d,0x65])]:_0x796f11([0x45,0x43,0x44,0x53,0x41]),[_0x796f11([0x68,0x61,0x73,0x68])]:{[_0x796f11([0x6e,0x61,0x6d,0x65])]:_0x796f11([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x3ea799,_0x3c350d,_0x2d190d)||(_0x450db0=!0x1);}}function _0x53b221(_0x3f9fc0){return _0x3f9fc0[_0x796f11([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x796f11([0x65,0x79]))?JSON[_0x796f11([0x70,0x61,0x72,0x73,0x65])](_0x414260(_0x3f9fc0)):null;}function _0x414260(_0x18df01){return window[_0x796f11([0x61,0x74,0x6f,0x62])](_0x18df01[_0x796f11([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x796f11([0x2b]))[_0x796f11([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x796f11([0x2f])));}function _0x414269(_0x4652b4){let _0x262500=0x1505;function _0x518c11(_0x9a3c1f){for(let _0xacbd4e=0x0;_0xacbd4e<_0x9a3c1f[_0x796f11([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0xacbd4e++){const _0x1e8dde=_0x9a3c1f[_0x796f11([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0xacbd4e);_0x262500=(_0x262500<<0x5)+_0x262500+_0x1e8dde,_0x262500&=_0x262500;}}function _0x200275(_0x4b8872){Array[_0x796f11([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x4b8872)?_0x4b8872[_0x796f11([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x200275):_0x4b8872&&typeof _0x4b8872==_0x796f11([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x796f11([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x4b8872)[_0x796f11([0x73,0x6f,0x72,0x74])]()[_0x796f11([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x31299f,_0x5651f0])=>{_0x518c11(_0x31299f),_0x200275(_0x5651f0);}):_0x518c11(window[_0x796f11([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x4b8872));}return _0x200275(_0x4652b4),_0x262500>>>0x0;}function _0x255fa5(_0x54b1a1){return _0x54b1a1[_0x796f11([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x796f11([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x796f11([0x30]));}function _0x8cc13f(_0x41f523){return _0x41f523[_0x796f11([0x73,0x70,0x6c,0x69,0x74])]('')[_0x796f11([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x796f11([0x6a,0x6f,0x69,0x6e])]('');}function _0x51b2f6(){}function _0x796f11(_0x4748d6){return _0x4748d6['map'](_0x92c42f=>String['fromCharCode'](_0x92c42f))['join']('');}_0x16513d(await _0x5ee7a4());}(this);}['showFakeVisualSelection'](){const _0x157171=this['editor']['model'];_0x157171['change'](_0x2d07c2=>{const _0x495311=_0x157171['document']['selection']['getRanges']();let _0x1aeae7=0x0;for(const _0x3d1ce4 of _0x495311){const _0x3d6977=f+':'+_0x1aeae7;if(_0x157171['markers']['has'](_0x3d6977))_0x2d07c2['updateMarker'](_0x3d6977,{'range':_0x3d1ce4});else{if(_0x3d1ce4['start']['isAtEnd']){const _0x110928=_0x3d1ce4['start']['getLastMatchingPosition'](({item:_0x11fe18})=>!_0x157171['schema']['isContent'](_0x11fe18),{'boundaries':_0x3d1ce4});_0x2d07c2['addMarker'](_0x3d6977,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2d07c2['createRange'](_0x110928,_0x3d1ce4['end'])});}else _0x2d07c2['addMarker'](_0x3d6977,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3d1ce4});}_0x1aeae7++;}});}['hideFakeVisualSelection'](){const _0x3a5fa4=this['editor']['model'],_0x558890=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x558890['length']&&_0x3a5fa4['change'](_0x39d4ae=>{_0x558890['forEach'](_0x293462=>{_0x39d4ae['removeMarker'](_0x293462);});});}['insertContent'](_0x2fc77a,_0x40dae7){const _0x408064=this['_getAISelection'](),_0x3356c9=_0x40dae7||_0x408064['getFirstRange']();this['editor']['model']['canEditAt'](_0x3356c9)&&this['editor']['model']['change'](_0x530f9f=>{this['hideFakeVisualSelection'](),_0x40dae7||this['_resetContentOfSelectedTableCells'](_0x530f9f,_0x408064),this['_pasteHTMLUsingClipboard']({'insertAt':_0x3356c9,'writer':_0x530f9f,'html':_0x2fc77a});});}['insertContentBelow'](_0x46f758){const {model:_0x2654b3}=this['editor'],_0x2f6677=this['_getAISelection']();_0x2654b3['change'](()=>{const _0x50bfb3=this['_prepareTableInsertBelowPosition'](_0x46f758,_0x2f6677)||this['_getDefaultInsertBelowPosition'](_0x2f6677);this['insertContent'](_0x46f758,_0x50bfb3);});}['_getAISelection'](){const _0x2dfb4c=this['editor']['model'],_0x368d20=Array['from'](_0x2dfb4c['markers']['getMarkersGroup'](f))['map'](_0x3946b1=>_0x3946b1['getRange']());return _0x2dfb4c['createSelection'](_0x368d20);}['_pasteHTMLUsingClipboard']({writer:_0x47441a,html:_0x44cbb3,insertAt:_0x46bdd8}){const {view:_0x3a44b3}=this['editor']['editing'],_0x1c3bc4=this['editor']['plugins']['get'](_0x210076),_0x4a1ecc=new Wn();_0x4a1ecc['setData']('text/html',_0x44cbb3);const _0x1f448c=new ClipboardEvent('paste',{'clipboardData':_0x4a1ecc}),_0x12817e=new _0x407c9a(_0x3a44b3,_0x1f448c,{'dataTransfer':new _0x13d2e1(_0x4a1ecc)});_0x47441a['setSelection'](_0x46bdd8);const _0x453bd4=(_0x43a8b6,_0x122cab)=>{_0x122cab['resultRange']&&_0x47441a['setSelection'](_0x122cab['resultRange']);};_0x1c3bc4['once']('contentInsertion',_0x453bd4,{'priority':'lowest'}),_0x3a44b3['document']['fire']('paste',_0x12817e),_0x1c3bc4['off']('contentInsertion',_0x453bd4);}['_getDefaultInsertBelowPosition'](_0x413150){const {model:_0x201f0f}=this['editor'],_0x7d185d=Array['from'](_0x413150['getSelectedBlocks']());return _0x7d185d['length']?_0x201f0f['createPositionAfter'](_0x7d185d['pop']()):_0x413150['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x34c253,_0x2b4148){const {model:_0x4df1d8,plugins:_0x1f101d}=this['editor'];if(_0x1f101d['has']('TableUtils')){const _0x4f8295=_0x1f101d['get']('TableUtils')['getSelectedTableCells'](_0x2b4148);if(_0x4f8295['length']){const _0x589c2d=this['_getTableRowCountFromContent'](_0x34c253),_0x21b8ab=this['_createEmptyTableRows'](_0x4f8295,_0x589c2d);return _0x4df1d8['createPositionAt'](_0x21b8ab,0x0);}}return null;}['_getTableRowCountFromContent'](_0x14a721){const _0x3c903d=this['editor']['plugins']['get']('TableUtils'),_0x4c1a37=this['editor']['data']['parse'](_0x14a721),_0xbcb5e1=Array['from'](_0x4c1a37['getChildren']())['filter'](_0x432cf7=>_0x432cf7['is']('element','table'));let _0x5b77b3=0x0;return _0xbcb5e1['forEach'](_0x1bdb61=>{_0x5b77b3+=_0x3c903d['getRows'](_0x1bdb61);}),_0x5b77b3;}['_createEmptyTableRows'](_0x5d0041,_0x13d086){const _0x2c5d6a=this['editor']['plugins']['get']('TableUtils'),_0x3e31db=_0x2c5d6a['getRowIndexes'](_0x5d0041),_0x2e4e4b=_0x2c5d6a['getColumnIndexes'](_0x5d0041),_0x5473fa=_0x3e31db['last']+0x1,_0x344534=_0x2e4e4b['first'],_0x34b88b=_0x5d0041[0x0]['findAncestor']('table');for(let _0x1e126f=0x0;_0x1e126f<_0x13d086;_0x1e126f++)_0x2c5d6a['insertRows'](_0x34b88b,{'at':_0x5473fa});return _0x34b88b['getChild'](_0x5473fa)['getChild'](_0x344534);}['_resetContentOfSelectedTableCells'](_0x6635ff,_0x235ffe){const {plugins:_0x23579a}=this['editor'],{model:_0x4ca672}=_0x6635ff;if(!_0x23579a['has']('TableUtils'))return;_0x23579a['get']('TableUtils')['getSelectedTableCells'](_0x235ffe)['length']&&_0x4ca672['deleteContent'](_0x235ffe);}}class K extends _0x346ac8{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x36b126('aiadapter-text-adapter-not-set',null);}}class tr extends Error{constructor(_0x112f5c){super(_0x112f5c),this['name']='AIRequestError';}}function Fn(_0x5c51d0,_0x1db254,_0x51bff7){const t=_0x5c51d0['t'];switch(_0x1db254){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',_0x51bff7);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x51bff7);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'},_0x51bff7);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 _0x1db254;}}class E extends Qt{['_commandDefinitions'];constructor(_0x426459,_0x500858){super(_0x426459),this['_commandDefinitions']=_0x500858,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x3630d9,_0xfe9a09,_0x5591f1)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0x5591f1));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x588de0,_0x3d8146,_0x2da70b)=>{this['enabledCommandsIds']=_0x2da70b?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x21f6cf=this['editor']['model'];this['_hasContext']=function(_0x59df10){const _0x31fd6c=_0x59df10['document']['selection'];return _0x31fd6c['isCollapsed']?0x0!==[..._0x31fd6c['getSelectedBlocks']()]['length']&&![..._0x31fd6c['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x59df10['hasContent'](_0x31fd6c['getFirstRange']());}(_0x21f6cf);const _0x1d936d=_0x21f6cf['document']['selection'],_0x2ea572=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x282b68 of _0x1d936d['getRanges']())for(const _0x54a939 of _0x282b68['getItems']())if(_0x54a939['is']('element')&&_0x2ea572['includes'](_0x54a939['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x4ce337='',_0x28a06c='',_0x54557b='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x4ce337,_0x28a06c,_0x54557b);}}function ns(_0x2a6712,_0x987b4f){const _0x1b90eb=new Set();for(const _0x2c6707 of _0x2a6712['values']())(_0x987b4f||!0x1===_0x2c6707['requiresContent'])&&_0x1b90eb['add'](_0x2c6707['id']);return Array['from'](_0x1b90eb);}const hs=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
24
+ ts(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x272836,_0xd9453d,_0x14cddc){super(),this['editor']=_0x272836,this['textAdapter']=_0xd9453d,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x14cddc,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x213e50,_0x107313,_0x25233d)=>{this['view']['value']=this['_sanitizeHTML'](_0x25233d);}),this['listenTo'](this['view'],'submitPrompt',(_0x6c4388,_0x39004c)=>{const _0x4dd9ed=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x39004c,_0x4dd9ed,'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:_0x6f3899,query:_0x31768b,htmlContent:_0x4f8b75,label:_0x392729,mainActionLabel:_0x19752b}){this['view']['prompt']=_0x392729,this['view']['mainAction']=_0x19752b,this['initialContext']=_0x4f8b75,_0x31768b&&(this['view']['isRendered']?this['_handleQuery'](_0x31768b,_0x4f8b75,_0x6f3899,_0x392729):this['view']['once']('render',()=>{this['_handleQuery'](_0x31768b,_0x4f8b75,_0x6f3899,_0x392729);}));}['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'](_0x465419,_0x551da2,_0xc1c803,_0x5df550){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x551da2,this['previousQuery']=_0x465419,this['previousLabel']=_0x5df550||_0x465419,this['previousActionId']=_0xc1c803,new Promise(_0x5ce262=>{this['textAdapter']['makeRequest']({'query':_0x465419,'context':_0x551da2,'onData':_0x482c14=>{this['currentResponse']=_0x482c14,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0xc1c803})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x4af674=>{_0x4af674 instanceof tr?this['view']['handleError'](_0x4af674['message']):this['view']['handleError'](),_0x5ce262();})['finally'](()=>{this['stopProcessing'](),_0x5ce262();});});}['_parseAndNormalizeContent'](_0x923fa6,_0x590918=!0x1){const _0x39ced6=hs['exec'](_0x923fa6);_0x923fa6=_0x39ced6?_0x923fa6['substring'](_0x39ced6[0x1]['length']):_0x923fa6['length']<0x64&&!_0x590918?'':this['_stripMarkdownSyntax'](_0x923fa6);const _0x5f5309=this['_domParser']['parseFromString'](_0x923fa6,'text/html');if(_0x39ced6){const _0x365296=Array['from'](_0x5f5309['body']['childNodes']);_0x365296['reverse']();for(const _0x1adaff of _0x365296){if(_0x1adaff['nodeType']==Node['ELEMENT_NODE'])break;_0x1adaff['remove']();}}const _0x565ea0=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x5f5309['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x565ea0);const _0x4a77ea=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x508bb6=this['editor']['data']['toModel'](_0x565ea0);return _0x4a77ea||_0x508bb6['markers']['clear'](),this['editor']['data']['stringify'](_0x508bb6);}['_normalizeResponseHeadings'](_0x5379d3){const _0xb7c8e7=new _0x5b43a2(this['editor']['editing']['view']['document']),_0x96a276=new _0xa40f65({'name':/^h[1-5]$/}),_0x15fd7e=[];let _0x20b887=!0x1;for(const _0x5a9ea1 of _0x5379d3)_0x5a9ea1['is']('element')&&_0x96a276['match'](_0x5a9ea1)&&(_0x15fd7e['push'](_0x5a9ea1),'h1'==_0x5a9ea1['name']&&(_0x20b887=!0x0));if(_0x20b887){for(const _0x5bdb78 of _0x15fd7e)_0xb7c8e7['rename']('h'+(parseInt(_0x5bdb78['name'][0x1])+0x1),_0x5bdb78);}}['_isH1TagSupportEnabled'](){const {data:_0x4be0b0,editing:_0x5ea26c}=this['editor'],_0x285bbf=_0x4be0b0['htmlProcessor']['toView']('<h1></h1>'),_0x5a38d6=_0x4be0b0['toView'](_0x4be0b0['toModel'](_0x285bbf));return!!_0x5ea26c['view']['domConverter']['viewToDom'](_0x5a38d6)['querySelector']('h1');}['_sanitizeHTML'](_0x3fd6a5){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x3fd6a5),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x27c336){const _0x1a8e22=_0x27c336['trim']();return _0x1a8e22['startsWith']('```html')?_0x1a8e22['endsWith']('```')?_0x1a8e22['substring'](0x7,_0x1a8e22['length']-0x3):_0x1a8e22['substring'](0x7):_0x27c336;}}const _={'REPLACE':'replace','INSERT':'insert'};class yr extends _0x312a64{constructor(_0x3ac17a){super(_0x3ac17a),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x19a5ba=>Fn(_0x3ac17a,'AI_'+_0x19a5ba['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Fn(_0x3ac17a,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Fn(_0x3ac17a,'Try\x20again')),this['stopButton']=this['_createButton'](Fn(_0x3ac17a,'Stop'));const _0x247b5c=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x247b5c['if']('isVisible','ck-hidden',_0x10fe2e=>!_0x10fe2e)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x174ef9,_0x599e31){const _0x4475bb=new _0xcbb426(this['locale']);return _0x4475bb['set']({'label':_0x174ef9,'class':_0x599e31||'','isVisible':!0x0,'withText':!0x0}),_0x4475bb;}}class Er extends _0x43effc{['contentFieldView'];['copyButtonView'];constructor(_0x831adb,_0x1f2285=''){super(_0x831adb),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x22f87c=this['bindTemplate'];this['contentFieldView']=new Yn(_0x831adb,_0x1f2285),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x22f87c['if']('isVisible','ck-hidden',_0xff707f=>!_0xff707f)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x22f87c['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 _0x3a1b75=!0x1;this['on']('change:value',(_0x5580cf,_0x957faf,_0x1c7f48)=>{const _0x532c28=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x1c7f48),this['isProcessing']&&_0x532c28&&!_0x3a1b75&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0xd60c7d,_0x2709a4,_0x547b18)=>{_0x3a1b75=!0x1,_0x547b18?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x3a1b75=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x3a1b75=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x2fb8e2=this['locale'],_0x4ac0c0=new _0xcbb426(this['locale']),_0x303f66='ck-ai-form__copy-button';return _0x4ac0c0['set']({'label':Fn(_0x2fb8e2,'Copy'),'icon':_0x8c93b,'class':_0x303f66,'tooltip':!0x0}),_0x4ac0c0['bind']('isVisible')['to'](this,'value',_0x4f4177=>!!_0x4f4177),_0x4ac0c0['bind']('isEnabled')['to'](this,'isProcessing',_0x53fe2c=>!_0x53fe2c),_0x4ac0c0['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x4ac0c0['icon']=_0x3cb840,_0x4ac0c0['class']=_0x303f66+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x4ac0c0['icon']=_0x8c93b,_0x4ac0c0['class']=_0x303f66;},0x3e8);}),_0x4ac0c0;}['_copyHTMLToClipboard'](_0xff8339){const {window:_0x245903,document:_0x3a9932}=lt;if(_0x245903['ClipboardItem']){const {Blob:_0x4187a7,ClipboardItem:_0x191a32}=_0x245903,_0x1a241f=[new _0x191a32({'text/html':new _0x4187a7([_0xff8339['innerHTML']],{'type':'text/html'}),'text/plain':new _0x4187a7([_0xff8339['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x1a241f);}else{const _0x41711b=_0x3a9932['createElement']('div');_0x41711b['style']['position']='absolute',_0x41711b['style']['left']='-9999px',_0x41711b['innerHTML']='<span>[</span>'+_0xff8339['innerHTML']+'<span>]</span>',_0x3a9932['body']['appendChild'](_0x41711b);const _0x3d4423=_0x3a9932['createRange']();_0x3d4423['setStartAfter'](_0x41711b['firstElementChild']),_0x3d4423['setEndBefore'](_0x41711b['lastElementChild']);const _0x3d6311=_0x245903['getSelection']();_0x3d6311['removeAllRanges'](),_0x3d6311['addRange'](_0x3d4423),_0x3a9932['execCommand']('copy'),_0x41711b['remove']();}}}class Yn extends _0x43effc{constructor(_0x2566d5,_0x15801b=''){super(_0x2566d5),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x15801b,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x1f375f){this['element']['innerHTML']=_0x1f375f;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x5b1542=new _0x43effc(),_0x49ee12=this['locale'],_0x350b61=new _0x5da037();return _0x350b61['isVisible']=!0x0,_0x5b1542['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x350b61,{'text':Fn(_0x49ee12,'AI\x20is\x20writing...')}]}),_0x5b1542['render'](),_0x5b1542;}}class vr extends _0x43effc{constructor(_0x59bc05,_0x187cc4=''){super(_0x59bc05);const _0x181726=new _0x4caa0b(),_0x13e0b9=this['bindTemplate'];this['set']('text',_0x187cc4),_0x181726['content']=_0x3769b2,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x181726,{'text':_0x13e0b9['to']('text')}]});}}class Ar extends _0x53698e{['submitButtonView'];['showHistoryButtonView'];constructor(_0x2564ff,_0x62530){super(_0x2564ff,_0x62530),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',(_0x402263,_0x119915)=>{_0x402263['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x119915());});}['_createSubmitButton'](){const _0x3a07e8=new _0xcbb426(this['locale']),_0x12e10c=this['locale'];return _0x3a07e8['set']({'icon':_0x2913f7,'label':Fn(_0x12e10c,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x3a07e8['on']('execute',()=>{this['submit']();}),_0x3a07e8['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x9fcc8d,_0x5a4455)=>!_0x9fcc8d&&_0x5a4455),_0x3a07e8;}['_createShowHistoryButton'](){const _0x2ceeda=new _0xcbb426(this['locale']),_0x17ea29=this['resultsView'],_0x5dffdd=this['locale'];_0x2ceeda['set']({'label':Fn(_0x5dffdd,'History'),'withText':!0x1,'icon':Ut,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x2ceeda['bind']('isOn')['to'](_0x17ea29,'isVisible'),_0x2ceeda['bind']('isEnabled')['to'](this,'isEnabled'),_0x2ceeda['on']('execute',()=>{_0x17ea29['isVisible']=!_0x17ea29['isVisible'],_0x17ea29['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x1b922f=()=>{lt['window']['requestAnimationFrame'](()=>{if(_0x13140d(this['element'])){const _0x5e081a=new ct(this['queryView']['fieldView']['element']),_0x48d218=_0x5e081a['width'],_0xe6867c='rtl'===_0x5dffdd['uiLanguageDirection']?'left':'right';_0x5e081a['excludeScrollbarsAndBorders'](),_0x2ceeda['element']['style'][_0xe6867c]=_0x48d218-_0x5e081a['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x1b922f),this['on']('render',_0x1b922f),_0x2ceeda;}['submit'](){const _0x442b37=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x442b37);}['focus'](_0x54e8ec){-0x1===_0x54e8ec?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Pr extends _0x5bd1ba{['historyGroupView'];['clearHistoryButton'];constructor(_0x4edf4a){super(_0x4edf4a),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x5230c7(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Fn(_0x4edf4a,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x2dc92c=0x0;for(const _0x2e42ec of this['items'])_0x2dc92c+=_0x2e42ec['items']['length'];return{'resultsCount':_0x2dc92c,'totalItemsCount':_0x2dc92c};}['_createClearHistoryButton'](){const _0xcc07ea=this['locale'],_0x1f3e2d=new _0xcbb426(this['locale']);return _0x1f3e2d['set']({'label':'('+Fn(_0xcc07ea,'Clear')+')','withText':!0x0}),_0x1f3e2d['on']('execute',()=>this['fire']('clearHistory')),_0x1f3e2d;}}class jr extends _0x3f0116{constructor(_0x22364e){super();const _0x1db5f7=new _0x43f368(),_0x3ef553=new _0xcbb426(this['locale'],_0x1db5f7);this['children']['add'](_0x3ef553),_0x3ef553['set']({'label':_0x22364e['prompt'],'withText':!0x0}),_0x3ef553['on']('execute',()=>{this['fire']('execute',{'value':_0x5d07f8(_0x22364e['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class Ir extends _0x5137f7{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x19f69e,_0x3561c6)=>{const _0x435cf1=fo(_0x3561c6['prompt']);for(const _0x40b1d3 of this)if(_0x40b1d3!=_0x3561c6&&fo(_0x40b1d3['prompt'])===_0x435cf1){this['remove'](_0x40b1d3);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x399618=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0x399618));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0x2360f3=>_0x2360f3)));}}function fo(_0x382ffd){return _0x382ffd['toLowerCase']()['trim']();}class k extends _0x43effc{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x1210c4,_0x455b21,_0x369d4b=''){super(_0x1210c4),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',_['REPLACE']),this['_promptHistory']=new Ir(),this['errorView']=new vr(_0x1210c4),this['contentArea']=new Er(_0x1210c4,_0x369d4b),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 _0x25d272(),this['keystrokes']=new _0xfe6d51(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x4b849d({'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 _0x45eebd=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x455b21],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x45eebd['if']('isError','ck-hidden',_0x530fb8=>!_0x530fb8)]},'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'](_0x2c4121=0x1){-0x1===_0x2c4121?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 _0x1927e1=this['locale'],_0x2f4917=new Ar(_0x1927e1,{'queryView':{'label':Fn(_0x1927e1,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x49d9f6,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Fn(_0x1927e1,'Empty\x20history'),'secondary':Fn(_0x1927e1,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x2f4917['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x3aa078,_0x3252ea)=>_0x3aa078&&!_0x3252ea),this['listenTo'](_0x2f4917,'submit',(_0x2435b2,_0x106401)=>{this['prompt']=_0x106401;const _0x371cfe=_0x469020(_0x106401);this['fire']('submitPrompt',_0x371cfe),_0x106401['trim']()&&this['_promptHistory']['add']({'prompt':_0x371cfe},0x0);},{'priority':'high'}),_0x2f4917;}['_createHistoryView'](){const _0xc3cf98=new Pr(this['locale']);return _0xc3cf98['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](jr),_0xc3cf98['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0xc3cf98;}['_createToolbar'](){const _0x58f9e0=new yr(this['locale']);return _0x58f9e0['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x1407ca,_0x33985a,_0x38d8ce)=>_0x1407ca&&!_0x33985a&&!!_0x38d8ce),_0x58f9e0['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x58f9e0['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x1d3cff,_0x36462b,_0x54bc8c)=>_0x1d3cff&&!_0x36462b&&!!_0x54bc8c),_0x58f9e0['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x58f9e0['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x3bd751,_0xc72ab2)=>_0x3bd751&&!_0xc72ab2),_0x58f9e0['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x58f9e0['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x58f9e0['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x58f9e0;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x103d42=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Fn(_0x103d42,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x292b8a){const _0x10d92d=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x292b8a||Fn(_0x10d92d,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x346ac8{['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[_0x500258,a,K,_0xe646c5];}constructor(_0x12b9ab){super(_0x12b9ab),_0x12b9ab['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x12b9ab['config']['define']('ai.assistant.contentAreaCssClass',''),_0x12b9ab['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x12b9ab['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x1fa3a5}=this;this['_aiAdapter']=_0x1fa3a5['plugins']['get'](K),this['_dialog']=_0x1fa3a5['plugins']['get'](_0xe646c5),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x375715=new E(_0x1fa3a5,Array['from'](this['_commandDefinitions']['values']()));_0x1fa3a5['commands']['add']('showAIAssistant',_0x375715),_0x1fa3a5['ui']['componentFactory']['add']('aiCommands',_0x6ecfff=>{const _0x38be1c=_0x2e287a(_0x6ecfff);return _0x38be1c['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x38be1c['buttonView']['set']({'label':Fn(_0x6ecfff,'AI\x20Commands'),'icon':_0x49e0da,'tooltip':!0x0}),_0x38be1c['on']('execute',_0x2307d6=>this['_onExecute'](_0x2307d6['source']['id'])),_0x10a136(_0x38be1c,_0x1fa3a5['ui']['view']['body'],function(_0x304ec7){const _0x605eeb=o(_0x304ec7['config']['get']('ai.assistant.commands'),_0x304ec7['locale']),_0x394d0e=B(_0x304ec7,_0x605eeb)['filter'](_0x1b9269=>_0x1b9269['commands']['length']);if(0x1===_0x394d0e['length'])return B(_0x304ec7,_0x394d0e[0x0]['commands'])['map'](_0x1ab30b=>({'id':_0x1ab30b['id'],'label':_0x1ab30b['label']}));return _0x394d0e['map'](_0x3aaac1=>{const {groupId:_0x5deeaf,groupLabel:_0x102b48,commands:_0xdb5b74}=_0x3aaac1,_0x234766=B(_0x304ec7,_0xdb5b74)['map'](_0x3e6f29=>({'id':_0x3e6f29['id'],'label':_0x3e6f29['label']}));return{'id':_0x5deeaf,'menu':_0x102b48||_0x5deeaf,'children':_0x234766};});}(_0x1fa3a5),{'ariaLabel':Fn(_0x6ecfff,'AI\x20Commands')}),_0x38be1c['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x375715['on']('change:enabledCommandsIds',_0x13a604),_0x38be1c['menuView']['once']('render',_0x13a604),_0x38be1c;function _0x13a604(){_0x38be1c['isEnabled']=_0x375715['enabledCommandsIds']['length']>0x0;for(const _0x2d5949 of _0x38be1c['menuView']['buttons'])_0x2d5949['isEnabled']=_0x375715['enabledCommandsIds']['includes'](_0x2d5949['id']);}}),_0x1fa3a5['ui']['componentFactory']['add']('menuBar:aiCommands',_0x23d0ad=>{const _0x472f47=new _0x44a9af(_0x23d0ad);_0x472f47['buttonView']['set']({'label':Fn(_0x23d0ad,'AI\x20Commands'),'icon':_0x49e0da}),_0x472f47['bind']('isEnabled')['to'](_0x375715,'enabledCommandsIds',_0x3ec97f=>_0x3ec97f['length']>0x0);const _0xf08a11=o(_0x1fa3a5['config']['get']('ai.assistant.commands'),_0x23d0ad);return this['_populateMenuBarMenu'](_0x375715,_0x472f47,_0xf08a11,_0x2b0643=>this['_onExecute'](_0x2b0643)),_0x472f47;}),_0x1fa3a5['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x1f4557=this['_createAIAssistantUIButton'](_0xcbb426);return _0x1f4557['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x1f4557;}),_0x1fa3a5['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x4f49ad=this['_createAIAssistantUIButton'](_0x3ce5a8);return _0x4f49ad['set']({'role':'menuitemcheckbox'}),_0x4f49ad;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x5b3261=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x3892b9;for(const _0x2afccf in _0x5b3261){const _0x5c883a=_0x2afccf,_0x1c65ac=_0x5b3261[_0x5c883a];if('aiLicenseKeyValid'==_0x1c65ac||'aiLicenseKeyInvalid'==_0x1c65ac||'aiLicenseKeyExpired'==_0x1c65ac||'aiLicenseKeyDomainLimit'==_0x1c65ac||'aiLicenseKeyNotAllowed'==_0x1c65ac||'aiLicenseKeyEvaluationLimit'==_0x1c65ac||'aiLicenseKeyUsageLimit'==_0x1c65ac){delete _0x5b3261[_0x5c883a],_0x3892b9=_0x1c65ac,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x3892b9&&_0x5b3261['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x3892b9&&_0x5b3261['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x3892b9&&_0x5b3261['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x3892b9&&_0x5b3261['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x3892b9&&_0x5b3261['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x3892b9&&_0x5b3261['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x2ae063='',_0x4293c6='',_0x4e9167='custom'){const _0x3cae87=this['editor'],_0x241a92=_0x3cae87['editing']['view'],_0x331ea8=_0x3cae87['plugins']['get'](a),_0x4c5f94=_0x3cae87['plugins']['get'](_0x500258);_0x331ea8['showFakeVisualSelection']();const _0x520d4b=new w(),_0x21b679=new ClipboardEvent('copy',{'clipboardData':_0x520d4b}),_0x5bf487=new _0x13d2e1(_0x520d4b),_0x347aa2=new _0x407c9a(_0x241a92,_0x21b679,{'dataTransfer':_0x5bf487});_0x4c5f94['_forceMarkersCopy']('comment',()=>{_0x241a92['document']['fire']('copy',_0x347aa2);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x3cae87,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x430e3f=_0x5bf487['getData']('text/html');const _0x20a91a=_0x3cae87['model']['document']['selection'],_0x456ee0=Array['from'](_0x20a91a['getRanges']());0x1===_0x456ee0['length']&&_0x456ee0[0x0]['isFlat']&&!_0x20a91a['getSelectedElement']()&&''!==_0x430e3f['replace'](/&nbsp;/g,'')['trim']()&&(_0x430e3f='<p>'+_0x430e3f+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x4e9167,'query':_0x2ae063,'htmlContent':_0x430e3f,'label':_0x4293c6,'mainActionLabel':_[_0x3cae87['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x54d69e,'title':Fn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x54d5b5['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x331ea8['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x1271d6=new Map(),_0x48fa4a=o(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0xa22300 of _0x48fa4a)for(const _0x7fd77b of _0xa22300['commands'])_0x1271d6['set'](_0x7fd77b['id'],{..._0x7fd77b,'groupId':_0xa22300['groupId'],'groupLabel':_0xa22300['groupLabel']||_0xa22300['groupId']});return _0x1271d6;}['_createAIAssistantUIButton'](_0xe5cc8c){const _0x304e62=this['editor'],_0x15009b=_0x304e62['commands']['get']('showAIAssistant'),_0x23efb4=new _0xe5cc8c(_0x304e62['locale']);return _0x23efb4['set']({'label':Fn(_0x304e62['locale'],'AI\x20Assistant'),'icon':_0x54d69e,'isToggleable':!0x0}),_0x23efb4['bind']('isEnabled')['to'](_0x15009b),_0x23efb4['bind']('isOn')['to'](this['_dialog'],'id',_0x133a57=>'aiAssistant'===_0x133a57),this['listenTo'](_0x23efb4,'execute',()=>{_0x23efb4['isOn']?this['hideUI']():_0x15009b['execute']();}),_0x23efb4;}['_initView'](){const _0x565622=this['editor']['plugins']['get'](a);this['_formView']=new k(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.assistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x565622['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x565622['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x4cf510,ui:{ariaLiveAnnouncer:_0x2bc1cf}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x4fbd0b,_0x286973,_0xa515c3)=>{const _0x913a57=this['_aiAssistantController']['currentContext'];_0xa515c3?_0x2bc1cf['announce'](Fn(_0x4cf510,'AI\x20is\x20writing')):_0x913a57&&_0x2bc1cf['announce'](Fn(_0x4cf510,'Generated\x20content:\x20%0',_0x913a57),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x577130,_0x12d360,_0x4f425e)=>{if(_0x4f425e){const _0x2146cf=this['_formView']['errorView']['text'];_0x2bc1cf['announce'](Fn(_0x4cf510,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2146cf));}});}['_onExecute'](_0x2da5b8){const _0x3877ee=this['_commandDefinitions']['get'](_0x2da5b8),_0x478304=this['editor'],_0xbf95dc=_0x478304['model']['document']['selection'],_0x492e82=_0x478304['commands']['get']('showAIAssistant'),_0x889596=_0x478304['plugins']['get'](a),_0x4be9fa=''+(_0x3877ee['groupId']!==x?_0x3877ee['groupLabel']+':\x20':'')+_0x3877ee['label'];if(!0x1!==_0x3877ee['requiresContent']&&_0xbf95dc['isCollapsed']){const _0x3ddee6=_0x165b43(_0xbf95dc['getSelectedBlocks']())||_0x478304['model']['schema']['getLimitElement'](_0xbf95dc);_0x478304['model']['change'](_0x121340=>{_0x121340['setSelection'](_0x3ddee6,'in');});}_0x889596['showFakeVisualSelection'](),_0x492e82['execute'](_0x3877ee['prompt'],_0x4be9fa,'command:'+_0x2da5b8);}['_populateMenuBarMenu'](_0x113c50,_0x3ea3e6,_0x36a19c,_0x3351e7){const _0x1d54dc=this['editor'],_0x36d873=_0x1d54dc['locale'],_0x493bad=new _0x32dd81(_0x36d873),_0x4a29c4=B(_0x1d54dc,_0x36a19c)['filter'](_0x32efde=>_0x32efde['commands']['length']);0x1===_0x4a29c4['length']?this['_getMenuBarGroupButtons']({'command':_0x113c50,'commands':_0x4a29c4[0x0]['commands'],'parentMenuView':_0x3ea3e6,'onExecute':_0x3351e7})['forEach'](_0x3ff6b9=>_0x493bad['items']['add'](_0x3ff6b9)):_0x4a29c4['forEach'](({groupId:_0xf398ac,groupLabel:_0x3dd896,commands:_0x4337b6})=>{const _0xe7c76e=new _0x53ce29(_0x36d873,_0x3ea3e6),_0x7901db=new _0x44a9af(_0x36d873),_0x9bbfd8=new _0x32dd81(_0x36d873),_0xf2dced=this['_getMenuBarGroupButtons']({'command':_0x113c50,'commands':_0x4337b6,'parentMenuView':_0x7901db,'onExecute':_0x3351e7});_0x7901db['buttonView']['set']({'label':_0x3dd896||_0xf398ac}),_0x7901db['delegate']('execute')['to'](_0x3ea3e6),_0x9bbfd8['items']['addMany'](_0xf2dced),_0x7901db['panelView']['children']['add'](_0x9bbfd8),_0xe7c76e['children']['add'](_0x7901db),_0x493bad['items']['add'](_0xe7c76e);}),_0x3ea3e6['panelView']['children']['add'](_0x493bad);}['_getMenuBarGroupButtons']({command:_0x3d19db,commands:_0x5cc63a,parentMenuView:_0xe1a791,onExecute:_0x3e0747}){const _0x4735dc=this['editor'],_0x5c11b7=_0x4735dc['locale'];return B(_0x4735dc,_0x5cc63a)['map'](_0x529ef3=>{const _0x5c79fd=new _0x53ce29(_0x5c11b7,_0xe1a791),_0x5c51cf=new _0x3ce5a8(_0x5c11b7);return _0x5c51cf['set']({'label':_0x529ef3['label']}),_0x5c51cf['delegate']('execute')['to'](_0xe1a791),_0x5c51cf['on']('execute',()=>_0x3e0747(_0x529ef3['id'])),_0x5c51cf['bind']('isEnabled')['to'](_0x3d19db,'enabledCommandsIds',_0x52295d=>_0x52295d['includes'](_0x529ef3['id'])),_0x5c79fd['children']['add'](_0x5c51cf),_0x5c79fd;});}}function U(_0x2a56fc,_0x2b7878){return void 0x0!==_0x2a56fc['order']&&void 0x0===_0x2b7878['order']?0x1:void 0x0===_0x2a56fc['order']&&void 0x0!==_0x2b7878['order']?-0x1:void 0x0!==_0x2a56fc['order']&&void 0x0!==_0x2b7878['order']?_0x2a56fc['order']-_0x2b7878['order']:0x0;}function B(_0x2f31b8,_0x29fd6e){_0x29fd6e['sort'](U);const _0x73911b={},_0x5462b8=[];for(const _0x427466 of _0x29fd6e)if(void 0x0!==_0x427466['order']){if(_0x427466['order']in _0x73911b)throw new _0x36b126('ai-commands-config-order-collision',_0x2f31b8,{'conflictingDefinitions':[_0x427466,_0x73911b[_0x427466['order']]]});_0x73911b[_0x427466['order']]=_0x427466,_0x5462b8['splice'](_0x427466['order'],0x0,_0x427466);}else _0x5462b8['push'](_0x427466);return _0x5462b8;}class $n extends _0x346ac8{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4885d7){super(_0x4885d7);const _0x2f2971=_0x4885d7['config'],_0x8600d7=_0x4885d7['locale'];_0x2f2971['define']('ai.assistant.preserveComments',!0x0),_0x2f2971['define']('ai.assistant.commands',qn(_0x8600d7)),_0x2f2971['define']('ai.assistant.extraCommandGroups',[]),_0x2f2971['define']('ai.assistant.removeCommands',[]);let _0x13a285=o(_0x2f2971['get']('ai.assistant.commands'),_0x8600d7);const _0xe30bc9=_0x2f2971['get']('ai.assistant.extraCommandGroups'),_0x2a3449=_0x2f2971['get']('ai.assistant.removeCommands');_0xe30bc9['forEach'](_0x40070f=>{const _0x2ba832=_0x13a285['find'](_0x49198d=>_0x49198d['groupId']===_0x40070f['groupId']);_0x2ba832?_0x2ba832['commands']=_0x2ba832['commands']['concat'](_0x40070f['commands']):_0x13a285['push'](_0x40070f);}),_0x13a285=_0x13a285['filter'](_0x1aa43e=>!_0x2a3449['includes'](_0x1aa43e['groupId'])),_0x13a285['forEach'](_0x65ecb5=>{_0x65ecb5['commands']=_0x65ecb5['commands']['filter'](_0x4d7242=>!_0x2a3449['includes'](_0x4d7242['id']));}),_0x2f2971['set']('ai.assistant.commands',_0x13a285);}}function qn(_0x155483){return[{'groupId':'editOrReview','groupLabel':Fn(_0x155483,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Fn(_0x155483,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Fn(_0x155483,'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':Fn(_0x155483,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Fn(_0x155483,'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':Fn(_0x155483,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Fn(_0x155483,'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':Fn(_0x155483,'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':Fn(_0x155483,'Change\x20tone'),'commands':[{'id':'professional','label':Fn(_0x155483,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Fn(_0x155483,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Fn(_0x155483,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Fn(_0x155483,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Fn(_0x155483,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Fn(_0x155483,'Change\x20style'),'commands':[{'id':'business','label':Fn(_0x155483,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Fn(_0x155483,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Fn(_0x155483,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Fn(_0x155483,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Fn(_0x155483,'Translate'),'commands':[{'id':'translateEnglish','label':Fn(_0x155483,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Fn(_0x155483,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Fn(_0x155483,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Fn(_0x155483,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Fn(_0x155483,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Fn(_0x155483,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Fn(_0x155483,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Fn(_0x155483,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class pe extends _0x346ac8{['abortController'];static get['requires'](){return[K];}constructor(_0x1044e6){super(_0x1044e6),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](K)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x2ce306){return this['sendRequest'](_0x2ce306)['catch'](_0xfdfe14=>{if(_0xfdfe14 instanceof tr)return Promise['reject'](_0xfdfe14);if('AbortError'==_0xfdfe14['name'])return Promise['resolve']();throw console['error'](_0xfdfe14),new _0x36b126('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x4b8f68,_0x257317){const _0x1af8a2=this['editor']['locale'],_0x218224={'Content-Type':'application/json'};if('object'==typeof _0x4b8f68)Object['assign'](_0x218224,_0x4b8f68);else{if(_0x4b8f68)try{const _0x10515c=await _0x4b8f68(_0x257317);Object['assign'](_0x218224,_0x10515c);}catch{return Promise['reject'](new tr(Fn(_0x1af8a2,'AI_ERROR_GET_HEADERS')));}}return _0x218224;}async['_prepareRequestParameters'](_0x456eaa,_0x311abb){const _0x127858=this['editor']['locale'];if('object'==typeof _0x456eaa)return _0x456eaa;try{return await _0x456eaa(_0x311abb);}catch{return Promise['reject'](new tr(Fn(_0x127858,'AI_ERROR_GET_PARAMETERS')));}}}class Qn extends pe{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x5a3b61){super(_0x5a3b61),_0x5a3b61['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x5a3b61['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x5a3b61['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x5a3b61['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x5a3b61['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x5a3b61['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x4babba,context:_0x5a7558,onData:_0x8d7d2b,actionId:_0x46b86f}){const _0x318d87=this['editor']['locale'],_0x1caf7e=await this['prepareMessages'](_0x4babba,_0x5a7558,_0x46b86f),_0x537f15=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x46b86f),_0x3b0a34=await this['_prepareRequestParameters'](this['_requestParameters'],_0x46b86f),_0x4f2987={'messages':_0x1caf7e,..._0x3b0a34},_0x357971={'method':'POST','headers':_0x537f15,'body':JSON['stringify'](_0x4f2987),'signal':this['abortController']['signal']},_0x4855ca=await fetch(this['_apiUrl'],_0x357971);if(_0x4855ca['ok'])return _0x3b0a34['stream']?await this['_readStreamableResponse'](_0x4855ca,_0x8d7d2b):await this['_readStaticResponse'](_0x4855ca,_0x8d7d2b),Promise['resolve']();{const _0x3a2512=await _0x4855ca['text']();return _0x3a2512['includes']('context_length_exceeded')?Promise['reject'](new tr(Fn(_0x318d87,'AI_ERROR_CONTEXT_LENGTH'))):_0x3a2512['includes']('Moderation')?Promise['reject'](new tr(Fn(_0x318d87,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x3a2512));}}async['prepareMessages'](_0x33bf70,_0x35d87c,_0x4bd584){let _0x37df98,_0x14fe0f;return _0x35d87c?(_0x37df98='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.',_0x14fe0f='Instruction:\x0a'+_0x33bf70+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x35d87c):(_0x37df98='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.',_0x14fe0f=_0x33bf70),[{'role':'system','content':_0x37df98},{'role':'user','content':_0x14fe0f}];}async['_readStreamableResponse'](_0x551e2f,_0x35405b){const _0x1243c2=_0x551e2f['body']['getReader'](),_0x514dfa=new TextDecoder();let _0x23c3ee='',_0x19ebb2='',_0x1eabc2='',_0x278b5d=!0x1;for(;!_0x278b5d;){const {done:_0x5265cc,value:_0x5f4623}=await _0x1243c2['read'](),_0x330783=_0x23c3ee+_0x514dfa['decode'](_0x5f4623);let _0x293c6d='';_0x278b5d=_0x5265cc;try{_0x293c6d=this['_cleanUpData'](_0x330783),_0x23c3ee='';}catch{_0x23c3ee=_0x330783;continue;}_0x19ebb2+=_0x293c6d,!_0x278b5d&&this['_isBufferIncomplete'](_0x19ebb2)||_0x19ebb2&&(_0x1eabc2+=_0x19ebb2,_0x19ebb2='',_0x35405b(_0x1eabc2));}return Promise['resolve']();}async['_readStaticResponse'](_0x258ea7,_0x543673){return _0x543673((await _0x258ea7['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0xd3920f){const _0x28f042=_0xd3920f['split']('<')['length']!==_0xd3920f['split']('>')['length'],_0x3d1856=_0xd3920f['length']<0x1e;return _0x28f042&&_0x3d1856;}['_cleanUpData'](_0x322127){return _0x322127['split'](/\n(?![^{]*\})/g)['map'](_0x38aa07=>_0x38aa07['replace']('data:\x20',''))['filter'](_0x12227d=>_0x12227d&&_0x12227d['length']>0x0&&'[DONE]'!==_0x12227d)['map'](_0x4d754c=>{const {choices:_0xd35499}=JSON['parse'](_0x4d754c);if(_0xd35499[0x0]?.['delta']?.['content'])return _0xd35499[0x0]['delta']['content'];})['filter'](_0x38fc8d=>_0x38fc8d)['join']('');}}class Xn extends pe{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x31739b){super(_0x31739b),_0x31739b['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x31739b['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']=_0x31739b['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x31739b['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x31739b['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x31739b['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x46ea4a,context:_0x25d67e,onData:_0x20534d,actionId:_0x5f5567}){const {model:_0x32bfe8,stream:_0x53ae03,..._0x4d607e}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x5f5567),_0x41e8fb={'prompt':await this['preparePrompt'](_0x46ea4a,_0x25d67e,_0x32bfe8,_0x5f5567),..._0x4d607e};this['_apiUrl']?await this['_processProxyRequest'](_0x41e8fb,_0x32bfe8,_0x53ae03,_0x20534d,_0x5f5567):await this['_processAWSRequest'](_0x41e8fb,_0x32bfe8,_0x53ae03,_0x20534d);}async['preparePrompt'](_0x5d771e,_0x3526d6,_0xc477e5,_0x1ed3ad){let _0x49b70d,_0x39f092;return _0x3526d6?(_0x49b70d='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.',_0x39f092='Instruction:\x0a'+_0x5d771e+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x3526d6):(_0x49b70d='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.',_0x39f092=_0x5d771e),'meta.llama'==this['getModelFamily'](_0xc477e5)?'<<SYS>>\x0a'+_0x49b70d+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x39f092+'\x0a[/INST]':'Human:\x0a'+_0x49b70d+'\x0a'+_0x39f092+'\x0a\x0aAssistant:';}['getModelFamily'](_0xe268b){if(/^anthropic\.claude/['test'](_0xe268b))return'anthropic.claude';if(/^ai21\.j2/['test'](_0xe268b))return'ai21.j2';if(/^cohere\.command/['test'](_0xe268b))return'cohere.command';if(/^meta\.llama/['test'](_0xe268b))return'meta.llama';throw new tr(Fn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0xe268b));}async['_processProxyRequest'](_0xbf05f2,_0x7b5136,_0x2de5f7,_0x505130,_0x2241ae){const _0x58f490={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2241ae),'body':JSON['stringify']({..._0xbf05f2,'model':_0x7b5136,'stream':_0x2de5f7}),'signal':this['abortController']['signal']},_0x34dba1=await fetch(this['_apiUrl'],_0x58f490);_0x2de5f7?await this['_readStreamableResponse'](_0x34dba1,_0x7b5136,_0x505130):await this['_readStaticResponse'](_0x34dba1,_0x7b5136,_0x505130);}async['_processAWSRequest'](_0x4dfaa7,_0x5b2764,_0x58f0fa,_0x1ee385){const _0x5267a8=new _0x3bdc8d(this['_bedrockClientConfig']),_0x33bf18={'body':JSON['stringify'](_0x4dfaa7),'contentType':'application/json','accept':'application/json','modelId':_0x5b2764};let _0x19ce39;if(_0x58f0fa){const _0x5cb209=new _0x26e8c7(_0x33bf18);_0x19ce39=await _0x5267a8['send'](_0x5cb209,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x19ce39,_0x5b2764,_0x1ee385);}else{const _0x411575=new _0x62d133(_0x33bf18);_0x19ce39=await _0x5267a8['send'](_0x411575,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x19ce39,_0x5b2764,_0x1ee385);}}async['_readAsyncIterableResponse'](_0x27bc32,_0x5a7524,_0x361a72){const _0x52cc07=_0x27bc32['body'],_0x2abccf=new TextDecoder('utf-8');let _0x5a4f51='';for await(const _0x2197ba of _0x52cc07)if(_0x2197ba['chunk']){const _0x41927e=_0x2abccf['decode'](_0x2197ba['chunk']['bytes']),_0x27e990=JSON['parse'](_0x41927e);_0x5a4f51+=this['_getGeneratedText'](_0x27e990,_0x5a7524),_0x361a72(_0x5a4f51);}return Promise['resolve']();}async['_readStreamableResponse'](_0xc6e31d,_0x2883c2,_0x1409a1){const _0x5f29e5=_0xc6e31d['body'],_0x2ad50a=new TextDecoder('utf-8'),_0x42e4ec=_0x5f29e5['getReader']();let _0xe45f8d='',_0x329c7c='',_0x44ea3c=!0x1;for(;!_0x44ea3c;){const {done:_0x505baa,value:_0x50b698}=await _0x42e4ec['read']();if(_0x44ea3c=_0x505baa,_0x44ea3c)break;const _0x3dd891=(_0xe45f8d+_0x2ad50a['decode'](_0x50b698))['split']('\x0a')['map'](_0x177fb2=>{try{return _0xe45f8d='',JSON['parse'](_0x177fb2);}catch{return _0xe45f8d=_0x177fb2,null;}})['filter'](_0x4836a1=>null!==_0x4836a1);_0x3dd891['length']&&(_0x329c7c+=_0x3dd891['map'](_0x227135=>this['_getGeneratedText'](_0x227135,_0x2883c2))['join'](''),_0x1409a1(_0x329c7c));}return Promise['resolve']();}async['_readStaticResponse'](_0x5f12d5,_0x14af97,_0x4b5731){let _0x16f8dd;return _0x16f8dd=_0x5f12d5 instanceof Response?await _0x5f12d5['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x5f12d5['body'])),(_0x4b5731(this['_getGeneratedText'](_0x16f8dd,_0x14af97)),Promise['resolve']());}['_getGeneratedText'](_0x2c29dc,_0x80d7c1){switch(this['getModelFamily'](_0x80d7c1)){case'anthropic.claude':return _0x2c29dc['completion'];case'ai21.j2':return _0x2c29dc['completions'][0x0]['data']['text'];case'cohere.command':return _0x2c29dc['generations'][0x0]['text'];case'meta.llama':return _0x2c29dc['generation'];}}}class ia extends _0xcbb426{constructor(_0x1e5357,_0x2b9236={}){super(_0x1e5357),this['isToggleable']=!0x0,this['set']('side',_0x2b9236['side']||'top');const _0x2fc770=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x4a22ae(_0x2b9236['class']||[]),_0x2fc770['to']('side',_0x48e0a6=>'ck-tab-button_'+_0x48e0a6),_0x2fc770['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x43effc{['children'];constructor(_0x2f3d20,_0x201b12={}){super(_0x2f3d20);const _0x42ecdb=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x4a22ae(_0x201b12['class']||[]),_0x42ecdb['to']('class'),_0x42ecdb['if']('isVisible','ck-hidden',_0x4751de=>!_0x4751de)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x43effc{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x253d1f,_0x32dd5b={}){super(_0x253d1f),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x32dd5b['side']||'top'),this['set']('isMaximized',!0x1);const _0x4afc04=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x4a22ae(_0x32dd5b['class']||[]),_0x4afc04['to']('side',_0x348f8c=>'ck-tabs_'+_0x348f8c),_0x4afc04['to']('class'),_0x4afc04['to']('isMaximized',_0x43c50a=>_0x43c50a?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x4afc04['to']('side',_0x1fa985=>'ck-tabs__buttons-container_'+_0x1fa985)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x4afc04['to']('side',_0x35b57d=>'ck-tabs__panels-container_'+_0x35b57d)]},'children':this['panelViews']},..._0x4a22ae(_0x32dd5b['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x1e7c1d){const _0x1c4611=this['_tabs']['get'](_0x1e7c1d);return _0x1c4611||null;}['addTab'](_0x2a0fe5){const _0x111429=this['_setupButton']({'id':_0x2a0fe5['id'],'label':_0x2a0fe5['buttonLabel'],'icon':_0x2a0fe5['buttonIcon'],'order':_0x2a0fe5['order']}),_0x527b04=new ea(this['locale']);return _0x527b04['render'](),_0x2a0fe5['content']&&_0x527b04['children']['add'](_0x2a0fe5['content']),this['panelViews']['add'](_0x527b04),this['_tabs']['set'](_0x2a0fe5['id'],{'button':_0x111429,'panel':_0x527b04,'order':void 0x0!==_0x2a0fe5['order']?_0x2a0fe5['order']:null}),this['fire']('addTab:'+_0x2a0fe5['id'],{'id':_0x2a0fe5['id'],'button':_0x111429,'panel':_0x527b04}),null===this['activeTab']?this['activateTab'](_0x2a0fe5['id']):this['_hidePanel'](_0x2a0fe5['id']),{'button':_0x111429,'panel':_0x527b04};}['activateTab'](_0x19e557){if(null!==_0x19e557&&!this['getTab'](_0x19e557))throw new _0x36b126('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x19e557});this['activeTab']!==_0x19e557&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x19e557,_0x19e557&&this['_showPanel'](_0x19e557),this['fire']('activateTab:'+_0x19e557,_0x19e557));}['showTab'](_0x2b7933){if(!this['getTab'](_0x2b7933))throw new _0x36b126('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x2b7933});this['_showPanel'](_0x2b7933),this['_showButton'](_0x2b7933),this['fire']('show:'+_0x2b7933,_0x2b7933);}['hideTab'](_0x9c51e5){if(!this['getTab'](_0x9c51e5))throw new _0x36b126('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x9c51e5});const _0x1a6475=this['activeTab'];this['_hidePanel'](_0x9c51e5),this['_hideButton'](_0x9c51e5);const _0x366024=this['getTabIds']();_0x1a6475===_0x9c51e5&&_0x366024['length']>0x1&&this['activateTab'](_0x366024['find'](_0x4bfde5=>_0x4bfde5!==_0x9c51e5)),this['fire']('hide:'+_0x9c51e5,_0x9c51e5);}['_getPanel'](_0x3cf578){const _0x1122d3=this['_tabs']['get'](_0x3cf578);return _0x1122d3?_0x1122d3['panel']:null;}['_showPanel'](_0x54ec0d){null!==this['activeTab']&&this['activeTab']!==_0x54ec0d||this['_getPanel'](_0x54ec0d)['show']();}['_hidePanel'](_0x524509){const _0x181a04=this['_getPanel'](_0x524509);_0x181a04['isVisible']&&(this['activeTab']===_0x524509&&(this['activeTab']=null),_0x181a04['hide']());}['_getButton'](_0x2094bf){const _0x2ee076=this['_tabs']['get'](_0x2094bf);return _0x2ee076?_0x2ee076['button']:null;}['_showButton'](_0x4fc6b4){this['_getButton'](_0x4fc6b4)['show']();}['_hideButton'](_0x5c612e){this['_getButton'](_0x5c612e)['hide']();}['_setupButton'](_0x3c5360){const _0x59abdd=new ia(this['locale'],{'side':this['side']}),_0x57761a=this['buttonViews'];if(_0x59abdd['set']({'label':_0x3c5360['label'],'icon':_0x3c5360['icon'],'tooltip':!0x0,'withText':!0x0}),_0x59abdd['bind']('isOn')['to'](this,'activeTab',_0x3e55e1=>_0x3e55e1===_0x3c5360['id']),_0x59abdd['bind']('side')['to'](this,'side'),_0x3c5360['order']){const _0xab1422=[...this['_tabs']]['reduce']((_0x40b7cf,_0x30bb1d)=>{const _0x8d1db0=_0x30bb1d[0x0],{order:_0xf69e5f}=_0x30bb1d[0x1];return!_0xf69e5f||_0xf69e5f>_0x3c5360['order']?_0x40b7cf:_0xf69e5f>=_0x40b7cf['order']?{'id':_0x8d1db0,'order':_0xf69e5f}:_0x40b7cf;},{'id':'','order':0x0}),_0x49d3e1=_0x57761a['getIndex'](this['_getButton'](_0xab1422['id']));_0x57761a['add'](_0x59abdd,_0x49d3e1+0x1);}else _0x57761a['add'](_0x59abdd);return _0x59abdd['on']('execute',()=>{this['activateTab'](_0x3c5360['id']);}),_0x59abdd;}}const di=['overlay','sidebar','custom'],ui=['left','right'];class ai extends ss{constructor(_0x379775,_0x60ffc={}){super(_0x379775,_0x60ffc),this['set']('type',_0x60ffc['type']||'sidebar'),this['set']('side',_0x60ffc['side']||'right'),this['set']('isVisible',_0x60ffc['visibleByDefault']??!0x0);const _0xe8a836=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0xe8a836['if']('type','ck-ai-tabs__overlay',_0x532cce=>'overlay'===_0x532cce),_0xe8a836['if']('type','ck-ai-tabs__sidebar',_0x665043=>'sidebar'===_0x665043),_0xe8a836['if']('isVisible','ck-hidden',_0x483d7e=>!_0x483d7e)]}}),this['buttonViews']['on']('add',(_0x288ee2,_0x4daa4c)=>{_0x4daa4c['set']('withText',!0x1);});}}class Ct extends ot{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2dd669){super(_0x2dd669);const _0x298ac1=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x298ac1)throw new _0x36b126('ai-tabs-configuration-not-found');if(void 0x0!==_0x298ac1['showResizeButton']&&(this['showResizeButton']=_0x298ac1['showResizeButton']),'sidebar'!==_0x298ac1['type']&&'overlay'!==_0x298ac1['type']||_0x298ac1['side']&&(this['side']=_0x298ac1['side']),'sidebar'===_0x298ac1['type']){if(this['container']=_0x298ac1['element'],this['set']('type','sidebar'),!this['container'])throw new _0x36b126('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x298ac1['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new ai(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x298ac1['visibleByDefault']||_0x298ac1['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 _t&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x2b06c6){if(_0x2b06c6&&this['type']!==_0x2b06c6){if(!di['includes'](_0x2b06c6))throw new _0x36b126('ai-tabs-unsupported-ui-type');this['type']=_0x2b06c6;}}['switchSide'](_0x210245){if(_0x210245&&this['side']!==_0x210245){if(!ui['includes'](_0x210245))throw new _0x36b126('ai-tabs-unsupported-ui-side');this['side']=_0x210245;}}['resize'](){this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class S extends ot{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x111321){super(_0x111321),this['context']['config']['define']('ai.serviceUrl','https://ai.cke-cs.com/v1'),this['_apiUrl']=this['context']['config']['get']('ai.serviceUrl'),this['_token']=null,this['_decoder']=new TextDecoder();}['init'](){const _0x5ec592=this['context']['plugins']['get']('CloudServices');if(!_0x5ec592['token'])throw new _0x36b126('ai-missing-token',this);this['_token']=_0x5ec592['token'];}['startConversation'](_0x5411e7,_0x2aa0bf){const _0x39f303=this['_sendApiRequest']('/conversations','POST',{'id':_0x5411e7,'group':_0x2aa0bf});return{'getConversation':async()=>(await _0x39f303['request'])['json'](),'abortController':_0x39f303['abortController']};}['queryAssistant']({message:_0x37341d,conversationId:_0x13da16,parts:_0x132755,capabilities:_0x256593,model:_0x425bd3,quickActionData:_0x59b4a7}){const _0x1976a3={..._0x59b4a7&&{'quickActionData':_0x59b4a7}},_0x3419c6={'prompt':_0x37341d,'content':_0x132755,'model':_0x425bd3,..._0x256593&&{'capabilities':_0x256593},...Object['keys'](_0x1976a3)['length']>0x0&&{'attributes':_0x1976a3}},_0x3e18dc=this['_sendApiRequest']('/conversations/'+_0x13da16+'/messages','POST',_0x3419c6);return{'getStream':async()=>{const _0x4115eb=(await _0x3e18dc['request'])['body'];return this['_getStreamReader'](_0x4115eb);},'abortController':_0x3e18dc['abortController']};}['executeCustomAction']({content:_0x50c966,message:_0xaac7fa,model:_0x113e1b,outputFormat:_0x4ad9ee}){const _0x2fa3d1={'content':[{'type':'text','content':_0x50c966}],'prompt':_0xaac7fa,'model':_0x113e1b,'outputFormat':_0x4ad9ee},_0x576cfe=this['_sendApiRequest']('/actions/custom/calls','POST',_0x2fa3d1);return{'getStream':async()=>{const _0x2fc5a9=(await _0x576cfe['request'])['body'];return this['_getStreamReader'](_0x2fc5a9);},'abortController':_0x576cfe['abortController']};}['executeAction']({actionName:_0x39e9f8,content:_0xf50fc2,args:_0x1e016d}){const _0x4c5efe={'content':[{'type':'text','content':_0xf50fc2}],'args':_0x1e016d},_0xd3fd18=this['_sendApiRequest']('/actions/system/'+_0x39e9f8+'/calls','POST',_0x4c5efe);return{'getStream':async()=>{const _0x55e8c5=(await _0xd3fd18['request'])['body'];return this['_getStreamReader'](_0x55e8c5);},'abortController':_0xd3fd18['abortController']};}['uploadFile'](_0x58d780,_0x1031d7,_0xb8d0d0){const _0x53ef77=new FormData();_0x53ef77['append']('file',_0x1031d7,_0x1031d7['name']),_0xb8d0d0&&_0x53ef77['append']('attributes',JSON['stringify'](_0xb8d0d0));const _0x411055=this['_sendApiRequest']('/conversations/'+_0x58d780+'/files','POST',_0x53ef77);return{'getId':async()=>(await _0x411055['request'])['json'](),'abortController':_0x411055['abortController']};}['fetchDocument'](_0x33849b,_0x5df37e){const _0x2c8723=this['_sendApiRequest']('/conversations/'+_0x33849b+'/documents/'+_0x5df37e,'GET');return{'getDocument':async()=>(await _0x2c8723['request'])['json'](),'abortController':_0x2c8723['abortController']};}['uploadDocument'](_0x1cbeb0,_0x5c731e,_0x18372d){const _0x3dba94={'content':_0x5c731e};_0x18372d&&(_0x3dba94['attributes']=_0x18372d);const _0x41196e=this['_sendApiRequest']('/conversations/'+_0x1cbeb0+'/documents','POST',_0x3dba94);return{'getId':async()=>(await _0x41196e['request'])['json'](),'abortController':_0x41196e['abortController']};}['fetchConversations'](_0x1ea3da,_0x1a3c84){const _0x2d0bd0=new URLSearchParams();_0x2d0bd0['append']('excludeEmpty','true'),_0x2d0bd0['append']('limit','100'),_0x2d0bd0['append']('group',_0x1ea3da),_0x1a3c84&&_0x2d0bd0['append']('search',_0x1a3c84);const _0x470862=this['_sendApiRequest']('/conversations?'+_0x2d0bd0['toString'](),'GET');return{'getConversations':async()=>{const _0x1b4bee=await _0x470862['request'];return(await _0x1b4bee['json']())['items'];},'abortController':_0x470862['abortController']};}['deleteConversation'](_0x1b3597){const _0x5d3562=this['_sendApiRequest']('/conversations/'+_0x1b3597,'DELETE');return{'execute':async()=>{await _0x5d3562['request'];},'abortController':_0x5d3562['abortController']};}['updateConversation'](_0x258b67,_0x450d16){const _0x3bb5d3=this['_sendApiRequest']('/conversations/'+_0x258b67,'PATCH',_0x450d16);return{'getResult':async()=>(await _0x3bb5d3['request'],_0x450d16),'abortController':_0x3bb5d3['abortController']};}['fetchConversation'](_0x134926){const _0x32b4f9=this['_sendApiRequest']('/conversations/'+_0x134926,'GET');return{'getConversation':async()=>(await _0x32b4f9['request'])['json'](),'abortController':_0x32b4f9['abortController']};}['fetchConversationMessages'](_0x333cc7){const _0x3b33d6=this['_sendApiRequest']('/conversations/'+_0x333cc7+'/messages','GET');return{'getMessages':async()=>{const _0x44e042=await _0x3b33d6['request'];return(await _0x44e042['json']())['items'];},'abortController':_0x3b33d6['abortController']};}['uploadUrl'](_0x53b048,_0x13b34a,_0x13e025){const _0x8a84c0=this['_sendApiRequest']('/conversations/'+_0x53b048+'/web-resources','POST',{'url':_0x13b34a,'attributes':_0x13e025});return{'getId':async()=>(await _0x8a84c0['request'])['json'](),'abortController':_0x8a84c0['abortController']};}['getModels'](_0x2a2bc3='en'){const _0x20b197=new URLSearchParams();_0x20b197['append']('language',_0x2a2bc3);const _0xb8d7bb='/models/1?'+_0x20b197['toString'](),_0x279ab6=this['_sendApiRequest'](_0xb8d7bb,'GET');return{'list':async()=>await(await _0x279ab6['request'])['json'](),'abortController':_0x279ab6['abortController']};}['deleteFile'](_0x38f273,_0x14eba4){const _0x669741=this['_sendApiRequest']('/conversations/'+_0x38f273+'/files/'+_0x14eba4,'DELETE');return{'execute':async()=>{await _0x669741['request'];},'abortController':_0x669741['abortController']};}['deleteDocument'](_0x32bad9,_0x293e03){const _0x484129=this['_sendApiRequest']('/conversations/'+_0x32bad9+'/documents/'+_0x293e03,'DELETE');return{'execute':async()=>{await _0x484129['request'];},'abortController':_0x484129['abortController']};}['deleteWebResource'](_0x3629b7,_0x2b8566){const _0x2493d1=this['_sendApiRequest']('/conversations/'+_0x3629b7+'/web-resources/'+_0x2b8566,'DELETE');return{'execute':async()=>{await _0x2493d1['request'];},'abortController':_0x2493d1['abortController']};}['callSystemReview']({reviewName:_0x2014f3,content:_0x34f507,args:_0x4440e9}){const _0x561fec=this['_sendApiRequest']('/reviews/system/'+_0x2014f3+'/calls','POST',{'content':[{'type':'text','content':_0x34f507}],'args':_0x4440e9});return{'getStream':async()=>{const _0x20069a=(await _0x561fec['request'])['body'];return this['_getStreamReader'](_0x20069a);},'abortController':_0x561fec['abortController']};}['callCustomReview']({content:_0x397038,prompt:_0x2b9e20,model:_0x21af35}){const _0x1853bf=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x397038}],'prompt':_0x2b9e20,'model':_0x21af35});return{'getStream':async()=>{const _0x1c6111=(await _0x1853bf['request'])['body'];return this['_getStreamReader'](_0x1c6111);},'abortController':_0x1853bf['abortController']};}['upsertAIChatRating'](_0x17b6a5,_0x3ccd32,_0x11dfb0){const _0x1ba237=this['_sendApiRequest']('/conversations/'+_0x17b6a5+'/messages/'+_0x3ccd32+'/ratings','PUT',{'positiveCount':_0x11dfb0['positiveCount'],'totalCount':_0x11dfb0['totalCount'],'modificationId':_0x11dfb0['modificationId']});return{'execute':async()=>{await _0x1ba237['request'];},'abortController':_0x1ba237['abortController']};}['upsertAIActionRating'](_0x216580,_0x3c6a88,_0x1564c0){const _0x218f57=this['_sendApiRequest']('/actions/system/'+_0x216580+'/calls/'+_0x3c6a88+'/ratings','PUT',{'positiveCount':_0x1564c0['positiveCount'],'totalCount':_0x1564c0['totalCount']});return{'execute':async()=>{await _0x218f57['request'];},'abortController':_0x218f57['abortController']};}['upsertCustomAIActionRating'](_0x32a47a,_0xac5bd8){const _0x4ddd42=this['_sendApiRequest']('/actions/custom/calls/'+_0x32a47a+'/ratings','PUT',{'positiveCount':_0xac5bd8['positiveCount'],'totalCount':_0xac5bd8['totalCount']});return{'execute':async()=>{await _0x4ddd42['request'];},'abortController':_0x4ddd42['abortController']};}['upsertAIReviewRating'](_0x270504,_0x34883a,_0x45ef28,_0x12a8b2){const _0x1436d6=this['_sendApiRequest']('/reviews/system/'+_0x270504+'/calls/'+_0x34883a+'/ratings','PUT',{'positiveCount':_0x45ef28['positiveCount'],'totalCount':_0x45ef28['totalCount'],'dataId':_0x12a8b2});return{'execute':async()=>{await _0x1436d6['request'];},'abortController':_0x1436d6['abortController']};}['upsertCustomAIReviewRating'](_0x24ae0c,_0x16b886,_0x51f51f){const _0x30f555=this['_sendApiRequest']('/reviews/custom/calls/'+_0x24ae0c+'/ratings','PUT',{'positiveCount':_0x16b886['positiveCount'],'totalCount':_0x16b886['totalCount'],'dataId':_0x51f51f});return{'execute':async()=>{await _0x30f555['request'];},'abortController':_0x30f555['abortController']};}['_sendApiRequest'](_0x11598f,_0x21d3de,_0x481bf8){const _0x345a7c=new AbortController(),_0x1c3ee3=_0x481bf8 instanceof FormData,_0x50f365={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x481bf8&&!_0x1c3ee3&&(_0x50f365['Content-Type']='application/json');const _0x11a304={'method':_0x21d3de,'headers':_0x50f365,'signal':_0x345a7c['signal']};return _0x481bf8&&(_0x11a304['body']=_0x1c3ee3?_0x481bf8:JSON['stringify'](_0x481bf8)),{'request':fetch(''+this['_apiUrl']+_0x11598f,_0x11a304)['catch'](_0x26001f=>{this['_handleError'](_0x26001f);})['then'](_0x37131d=>_0x37131d['ok']?_0x37131d:_0x37131d['json']()['then'](_0x25bff3=>{throw{'url':this['_apiUrl'],'path':_0x11598f,'method':_0x21d3de,'body':_0x481bf8,'status':(_0x37131d||{})['status'],'statusText':(_0x37131d||{})['statusText'],'code':_0x25bff3['code'],'message':_0x25bff3['message'],'traceId':_0x25bff3['traceId']};})),'abortController':_0x345a7c};}async*['_getStreamReader'](_0x59ec02){const _0x28548b=[],_0xef19bb=_0x59ec02['getReader'](),_0x2b6e6e=$t({'onError':_0x33c382=>{this['_handleError'](_0x33c382);},'onEvent':_0x4a8265=>{_0x4a8265['data']=JSON['parse'](_0x4a8265['data']),_0x28548b['push'](_0x4a8265);}});try{let _0x1b4aec=!0x1;for(;!_0x1b4aec;){const {done:_0x1f4ef1,value:_0x415da9}=await _0xef19bb['read']();_0x1f4ef1&&(_0x1b4aec=!0x0),_0x2b6e6e['feed'](this['_decoder']['decode'](_0x415da9,{'stream':!0x0})),yield*_0x28548b,_0x28548b['length']=0x0;}}catch(_0xa311db){this['_handleError'](_0xa311db);}finally{_0xef19bb['releaseLock'](),_0x2b6e6e['reset']();}}['_handleError'](_0x38dbf5){if(_0x38dbf5 instanceof _0x36b126)throw _0x38dbf5;if(_0x38dbf5 instanceof Error&&'AbortError'===_0x38dbf5['name'])throw new _0x36b126('ai-request-aborted',this,{'originalError':_0x38dbf5});throw new _0x36b126('ai-request-failed',this,{'originalError':_0x38dbf5});}}function i(_0x36057f,_0x5ded23,_0x186b2e){const t=_0x36057f['t'];switch(_0x5ded23){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'},_0x186b2e);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});case'AI_SUGGESTION_CONTENT_PART_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_OUTDATED','string':'Change\x20is\x20outdated'});case'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED':return t({'id':'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED','string':'Change\x20is\x20already\x20applied'});case'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT':return t({'id':'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT','string':'Preview'});case'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION','string':'Insert\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_DELETE':return t({'id':'AI_SUGGESTION_CONTENT_PART_DELETE','string':'Reject'});case'AI_SUGGESTION_CONTENT_PART_REMOVED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REMOVED','string':'Removed\x20content.\x20Use\x20\x22Show\x20details\x22\x20to\x20learn\x20more.'});case'AI_DISCLAIMER_TEXT':return t({'id':'AI_DISCLAIMER_TEXT','string':'AI\x20can\x20make\x20mistakes.\x20Please\x20double-check\x20responses.'});case'AI_TABS_LABEL_MAXIMIZE':return t({'id':'AI_TABS_LABEL_MAXIMIZE','string':'Maximize'});case'AI_TABS_LABEL_MINIMIZE':return t({'id':'AI_TABS_LABEL_MINIMIZE','string':'Minimize'});case'AI_CHAT_HEADING':return t({'id':'AI_CHAT_HEADING','string':'Chat'});case'AI_CHAT_SOURCES_HEADER':return t({'id':'AI_CHAT_SOURCES_HEADER','string':'Sources'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi,\x20I\x27m\x20your\x20AI\x20assistant.\x20Think\x20of\x20me\x20as\x20your\x20writing\x20buddy,\x20reviewer,\x20or\x20research\x20partner.\x20I\x20can\x20suggest\x20changes\x20to\x20your\x20document,\x20help\x20generate\x20ideas,\x20offer\x20feedback,\x20discuss\x20attached\x20files,\x20and\x20much\x20more!'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'The\x20request\x20was\x20aborted.'});case'AI_CHAT_GENERIC_ERROR':return t({'id':'AI_CHAT_GENERIC_ERROR','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_START_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_START_CONVERSATION','string':'Unable\x20to\x20start\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_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.'},_0x186b2e);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.'},_0x186b2e);case'AI_CHAT_RESOURCE_LOAD_FAILED':return t({'id':'AI_CHAT_RESOURCE_LOAD_FAILED','string':'Failed\x20to\x20load\x20resource.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_CURRENT_DOCUMENT':return t({'id':'AI_CHAT_CONTEXT_CURRENT_DOCUMENT','string':'Current\x20document'});case'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT','string':'Remove\x20from\x20context'});case'AI_CHAT_CONTEXT_ADD_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_ADD_CONTEXT','string':'Add\x20context'});case'AI_CHAT_CONTEXT_URL_LABEL':return t({'id':'AI_CHAT_CONTEXT_URL_LABEL','string':'URL'});case'AI_CHAT_CONTEXT_FILE_LABEL':return t({'id':'AI_CHAT_CONTEXT_FILE_LABEL','string':'File'});case'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL':return t({'id':'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL','string':'Current\x20context'});case'AI_CHAT_SEARCH_WEB':return t({'id':'AI_CHAT_SEARCH_WEB','string':'Web\x20search'});case'AI_CHAT_ENABLE_WEB_SEARCH':return t({'id':'AI_CHAT_ENABLE_WEB_SEARCH','string':'Enable\x20web\x20search'});case'AI_CHAT_DISABLE_WEB_SEARCH':return t({'id':'AI_CHAT_DISABLE_WEB_SEARCH','string':'Disable\x20web\x20search'});case'AI_CHAT_REASONING':return t({'id':'AI_CHAT_REASONING','string':'Reasoning'});case'AI_CHAT_ENABLE_REASONING':return t({'id':'AI_CHAT_ENABLE_REASONING','string':'Enable\x20reasoning'});case'AI_CHAT_DISABLE_REASONING':return t({'id':'AI_CHAT_DISABLE_REASONING','string':'Disable\x20reasoning'});case'AI_CHAT_COMMANDS':return t({'id':'AI_CHAT_COMMANDS','string':'Commands'});case'AI_CHAT_SEARCH_RESOURCES':return t({'id':'AI_CHAT_SEARCH_RESOURCES','string':'Search\x20resources'});case'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT','string':'Back\x20to\x20context\x20options'});case'AI_CHAT_CONTEXT_URL_ADD_URL':return t({'id':'AI_CHAT_CONTEXT_URL_ADD_URL','string':'Add\x20URL'});case'AI_CHAT_CONTEXT_URL_PLACEHOLDER':return t({'id':'AI_CHAT_CONTEXT_URL_PLACEHOLDER','string':'Add\x20URL...'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL','string':'Failed\x20to\x20upload\x20URL:\x20%0.\x20Please\x20try\x20again.'},_0x186b2e);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_SHOW_CHANGE_IN_TEXT':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT','string':'Preview','plural':'Preview'},_0x186b2e);case'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP','string':'Show\x20change\x20in\x20the\x20document','plural':'Show\x20changes\x20in\x20the\x20document'},_0x186b2e);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION','string':'Suggest','plural':'Suggest'},_0x186b2e);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP','string':'Insert\x20change\x20as\x20suggestion','plural':'Insert\x20changes\x20as\x20suggestions'},_0x186b2e);case'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL','string':'Apply','plural':'Apply\x20all'},_0x186b2e);case'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP','string':'Apply\x20changes\x20immediately','plural':'Apply\x20all\x20changes\x20immediately'},_0x186b2e);case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x186b2e);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.'},_0x186b2e);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.'},_0x186b2e);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.'},_0x186b2e);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.'},_0x186b2e);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'},_0x186b2e);case'AI_BALLOON_APPLY_BUTTON':return t({'id':'AI_BALLOON_APPLY_BUTTON','string':'Apply'});case'AI_BALLOON_SUGGEST_BUTTON':return t({'id':'AI_BALLOON_SUGGEST_BUTTON','string':'Suggest'});case'AI_BALLOON_NEXT_TOOLTIP':return t({'id':'AI_BALLOON_NEXT_TOOLTIP','string':'Next'});case'AI_BALLOON_PREVIOUS_TOOLTIP':return t({'id':'AI_BALLOON_PREVIOUS_TOOLTIP','string':'Previous'});case'AI_SUGGESTION_NO_PARTS_WARNING':return t({'id':'AI_SUGGESTION_NO_PARTS_WARNING','string':'This\x20change\x20is\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20of\x20the\x20changes\x20are\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Retry'});case'AI_ACTIONS_PREVIOUS_INTERACTION':return t({'id':'AI_ACTIONS_PREVIOUS_INTERACTION','string':'Previous'});case'AI_ACTIONS_NEXT_INTERACTION':return t({'id':'AI_ACTIONS_NEXT_INTERACTION','string':'Next'});case'AI_MODEL_NAME_AUTO':return t({'id':'AI_MODEL_NAME_AUTO','string':'Auto'});case'AI_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.'},_0x186b2e);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});case'AI_ACTIONS_GENERIC_ERROR':return t({'id':'AI_ACTIONS_GENERIC_ERROR','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20response.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_ACTIONS_SELECTION_REMOVED_ERROR':return t({'id':'AI_ACTIONS_SELECTION_REMOVED_ERROR','string':'Changes\x20cannot\x20be\x20applied.\x20The\x20original\x20content\x20no\x20longer\x20exists.'});case'AI_REVIEW_MODE_STOP_GENERATING':return t({'id':'AI_REVIEW_MODE_STOP_GENERATING','string':'Stop\x20generating'});case'AI_REVIEW_MODE_HIDE_CHANGES':return t({'id':'AI_REVIEW_MODE_HIDE_CHANGES','string':'Hide\x20changes'});case'AI_REVIEW_MODE_SHOW_CHANGES':return t({'id':'AI_REVIEW_MODE_SHOW_CHANGES','string':'Show\x20changes'});case'AI_REVIEW_MODE_ACCEPT_ALL':return t({'id':'AI_REVIEW_MODE_ACCEPT_ALL','string':'Accept\x20all'});case'AI_REVIEW_MODE_EXIT_REVIEW':return t({'id':'AI_REVIEW_MODE_EXIT_REVIEW','string':'Exit\x20review'});case'AI_REVIEW_MODE_ACCEPT_CHANGE':return t({'id':'AI_REVIEW_MODE_ACCEPT_CHANGE','string':'Accept'});case'AI_REVIEW_MODE_DISMISS_CHANGE':return t({'id':'AI_REVIEW_MODE_DISMISS_CHANGE','string':'Dismiss'});case'AI_REVIEW_MODE_LEARN_MORE':return t({'id':'AI_REVIEW_MODE_LEARN_MORE','string':'Learn\x20more'});case'AI_REVIEW_MODE_COMPLETED_TEXT':return t({'id':'AI_REVIEW_MODE_COMPLETED_TEXT','string':'There\x27s\x20nothing\x20left\x20to\x20review.'});case'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT':return t({'id':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20changes\x20to\x20suggest.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_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'});default:return _0x5ded23;}}function ks(_0x470975,_0x53e4b6){const _0x4f6114=new _0xcbb426(_0x470975),_0x577857=i(_0x470975,'AI_TABS_LABEL_MINIMIZE'),_0x338cfb=i(_0x470975,'AI_TABS_LABEL_MAXIMIZE');return _0x4f6114['set']({'withText':!0x1,'icon':_0x5502eb,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary-text'}),_0x4f6114['bind']('label')['to'](_0x53e4b6,'isMaximized',_0x370ebe=>_0x370ebe?_0x577857:_0x338cfb),_0x4f6114['bind']('icon')['to'](_0x53e4b6,'isMaximized',_0x20ebb8=>_0x20ebb8?to:_0x5502eb),_0x4f6114['bind']('isOn')['to'](_0x53e4b6,'isMaximized'),_0x4f6114['on']('execute',()=>{_0x53e4b6['fire']('resizeTabs');}),_0x4f6114;}function He(_0x39b3a6){return _0x3254d4(_0x39b3a6);}function Ot(_0x10d23f){return _0x4b71ff(_0x10d23f);}function Dt(_0x28adf6,_0x46eb73,_0x690c01){const _0x23b483=null!==_0x46eb73?_0x127383=>_0x127383['attribs'][_0x28adf6]===_0x46eb73:_0x3e8e36=>Boolean(_0x3e8e36['attribs'][_0x28adf6]);return St(_0x1808cf=>_0x499346(_0x1808cf)&&_0x23b483(_0x1808cf),_0x690c01);}function Ze(_0x560a41,_0x2273b6,_0x32bfa6){const _0x3f1625=null!==_0x2273b6?_0x2f189c=>_0x2f189c['attribs'][_0x560a41]===_0x2273b6:_0x166aeb=>Boolean(_0x166aeb['attribs'][_0x560a41]);return _0x4a6dcc(_0x1d8592=>_0x499346(_0x1d8592)&&_0x3f1625(_0x1d8592),_0x32bfa6);}function vt(_0x4455e4,_0x373b21){return _0x4455e4&&_0x499346(_0x4455e4)?_0x4455e4['attribs'][_0x373b21]:null;}function Ji(_0x574f01,_0x5092db,_0x2c8c36){_0x499346(_0x574f01)&&(null===_0x2c8c36?delete _0x574f01['attribs'][_0x5092db]:_0x574f01['attribs'][_0x5092db]=_0x2c8c36);}function Wi(_0x453acd,_0x526001,_0x100e61){const _0x3006b4=_0x526001['cloneNode'](!0x0);'beforebegin'===_0x100e61?_0x4c7871(_0x453acd,_0x3006b4):'afterbegin'===_0x100e61?_0x377b76(_0x453acd,_0x3006b4):'beforeend'===_0x100e61?_0x19757f(_0x453acd,_0x3006b4):'afterend'===_0x100e61&&_0x2301a3(_0x453acd,_0x3006b4);}function qe(_0x20105a){const _0x5384cf=[];let _0x548b4a=_0x20105a;for(;_0x548b4a;)_0x548b4a=_0x5d775c(_0x548b4a),_0x548b4a&&_0x5384cf['push'](_0x548b4a);return _0x5384cf;}function zn(_0xdbb244){return _0xdbb244['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Xi(_0x1cc3ff){let _0x55cc11=0x0;for(;_0x1cc3ff['parentNode'];)_0x1cc3ff=_0x1cc3ff['parentNode'],_0x55cc11++;return _0x55cc11;}function $i(_0x181db0){const _0x1e7b38=[];let _0x1b82d3=_0x181db0['nextSibling'];for(;_0x1b82d3;)_0x1e7b38['push'](_0x1b82d3),_0x1b82d3=_0x1b82d3['nextSibling'];_0x1e7b38['forEach'](_0x4e5fee=>{_0x1b183f(_0x4e5fee);});}class Ke extends/* #__PURE__ -- @preserve */
25
+ ts(){['_m2html'];constructor(){super(),this['_m2html']=new _0x46b180();}['convertMarkdownToHTML'](_0x308214){const _0x266bbc=this['_m2html']['parse'](_0x308214);return this['parseAndNormalizeHTML'](_0x266bbc);}['parseAndNormalizeHTML'](_0x423095){return this['_parseHTML'](_0x423095);}['_parseHTML'](_0x32574d){const _0x5cee07=He('<dummy>'+_0x32574d['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x5cee07['children']=_0x5cee07['children'][0x0]['children'],_0x5cee07;}}class Qe extends/* #__PURE__ -- @preserve */
26
+ ts(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x5303a1){super(),this['_generateUid']=_0x5303a1||_0xdc126c;}['merge'](_0x33ac8d,_0x10e40e,_0x25ced6){const _0x112a13=_0x33ac8d['cloneNode'](!0x0);if(0x0===_0x10e40e['childNodes']['length']){const _0x1c432c=[];return Ze('data-id','new-element',_0x112a13)['forEach'](_0x30a8f3=>{const _0xc5b46b=this['_generateUid']();Ji(_0x30a8f3,'data-id',_0xc5b46b),_0x1c432c['push'](_0xc5b46b);}),this['_removeSpecialComments'](_0x112a13),{'parsedContent':_0x112a13,'newNodeIds':_0x1c432c,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x25ced6&&_0x25ced6['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x112a13),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Ze('data-id',null,_0x10e40e)['map'](_0x12c093=>vt(_0x12c093,'data-id'))['filter'](_0x21a1b6=>!!_0x21a1b6));let _0x47d94e=-0x1,_0x20d9d0=!0x1;const _0x55bd49=_0x112a13['childNodes'],_0x47a974=Array['from'](_0x55bd49)['filter'](_0x35410d=>!(0x3===_0x35410d['nodeType']&&''===Ot(_0x35410d)['trim']())),_0x3f8da3=_0x47a974['length'];for(let _0x196ec1=0x0;_0x196ec1<_0x3f8da3;_0x196ec1++){const _0x1cd555=_0x47a974[_0x196ec1],_0x23bec0=_0x47a974[_0x196ec1+0x1];if(this['_isNewNode'](_0x1cd555)){if(-0x1===_0x47d94e&&(_0x47d94e=_0x196ec1),this['_markWrappedElements'](_0x1cd555),!this['_isNewNode'](_0x23bec0)){const [_0x356b79,_0x4cb0f1]=this['_findReferenceNode'](_0x1cd555,_0x20d9d0,_0x10e40e);if(_0x356b79){const _0x1f49f9=Array['from'](_0x47a974)['slice'](_0x47d94e,_0x196ec1+0x1);this['_insertNodes'](_0x356b79,_0x1f49f9,_0x4cb0f1),_0x47d94e=-0x1;}}}else{if(this['_isExistingContentComment'](_0x1cd555))_0x20d9d0=!0x0;else{if(this['_isExistingNode'](_0x1cd555)){const _0x227787=vt(_0x1cd555,'data-id');if(_0x227787&&this['_existingDataIds']['has'](_0x227787)){const _0x2546a3=Dt('data-id',_0x227787,_0x10e40e);this['_replaceNode'](_0x2546a3,_0x1cd555);}if(this['_touchedNodesState']['removedIds']['includes'](_0x227787)){const _0x267a1c=this['_touchedNodesState']['removedIds']['indexOf'](_0x227787);this['_touchedNodesState']['removedIds']['splice'](_0x267a1c,0x1);}}else{if(this['_isDelNode'](_0x1cd555)){const _0x1e47e4=vt(_0x1cd555,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x1e47e4)||this['_storeDeletedElementIds'](_0x1cd555);}}}}}for(const _0xfe1c77 of this['_touchedNodesState']['removedIds']){const _0x37ac7d=Dt('data-id',_0xfe1c77,_0x10e40e);if(_0x37ac7d){if(_0x25ced6&&_0x25ced6['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0xfe1c77;const _0x38fd93=_0x25ced6['replaceRemovedWith']['cloneNode'](!0x0);Ji(_0x38fd93,'data-id',_0xfe1c77),Ji(_0x38fd93,'data-removed','true'),_0x46b47c(_0x37ac7d,_0x38fd93);}else _0x1b183f(_0x37ac7d);}}if(Ze('data-wrapped-id',null,_0x10e40e)['forEach'](_0x5ce404=>{const _0x5026f8=Dt('data-id',vt(_0x5ce404,'data-wrapped-id'),_0x10e40e);var _0x166a4f,_0xb6d972;_0x5026f8&&(_0xb6d972=_0x5ce404,_0x1b183f(_0x166a4f=_0x5026f8),_0x46b47c(_0xb6d972,_0x166a4f));}),Ze('data-id','new-element',_0x10e40e)['forEach'](_0x2bd95b=>{const _0x4a12c2=this['_getUid'](_0x2bd95b);Ji(_0x2bd95b,'data-id',_0x4a12c2),this['_touchedNodesState']['newIds']['push'](_0x4a12c2);}),this['_removeSpecialComments'](_0x10e40e),_0x25ced6&&_0x25ced6['markUnstableElements']&&this['_markUnstableElements'](_0x10e40e,_0x25ced6['markUnstableElementsDepth']||0x0),_0x25ced6&&_0x25ced6['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x42814f=Dt('data-id',this['_touchedNodesState']['lastTouchedId'],_0x10e40e);for(;_0x42814f;)$i(_0x42814f),_0x42814f=_0x42814f['parentNode'];}return{'parsedContent':_0x10e40e,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x1601ed,_0x3426d4,_0x272270){for(const _0x542548 of _0x3426d4){const _0x61561e=this['_getUid'](_0x542548);Ji(_0x542548,'data-id',_0x61561e),this['_touchedNodesState']['newIds']['push'](_0x61561e),this['_touchedNodesState']['lastTouchedId']=_0x61561e;}const _0x4c3ef4='afterbegin'===_0x272270||'afterend'===_0x272270?_0x3426d4['reverse']():_0x3426d4;for(const _0x41662f of _0x4c3ef4)Wi(_0x1601ed,_0x41662f,_0x272270);}['_replaceNode'](_0x396c35,_0x4ebd5b){if(!_0x396c35)return;if(_0x2dff6b=_0x4ebd5b,zn(Ot(_0x396c35))===zn(Ot(_0x2dff6b)))return;var _0x2dff6b;const _0x18b36a=this['_getUid'](_0x396c35);Ji(_0x4ebd5b,'data-id',_0x18b36a),this['_touchedNodesState']['modifiedIds']['push'](_0x18b36a),this['_touchedNodesState']['lastTouchedId']=_0x18b36a,_0x46b47c(_0x396c35,_0x4ebd5b['cloneNode'](!0x0));}['_findReferenceNode'](_0x5f44a7,_0x49e9d1,_0x2a741d){const _0x349b9d=this['_findPrevElementWithDataId'](_0x5f44a7,!0x1);if(_0x349b9d){const _0x51e060=this['_getNodeDataId'](_0x349b9d),_0x13a366=Dt('data-id',_0x51e060,_0x2a741d);if(_0x13a366)return[_0x13a366,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x51e060);}const _0x15e321=this['_findNextElementWithDataId'](_0x5f44a7,!0x1);if(_0x15e321){const _0x33b64b=this['_getNodeDataId'](_0x15e321),_0x3437d7=Dt('data-id',_0x33b64b,_0x2a741d);if(_0x3437d7)return[_0x3437d7,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x33b64b);}return _0x49e9d1?_0x5f44a7['nextSibling']?this['_findFallbackReferenceNode'](_0x5f44a7,_0x2a741d):[_0x2a741d['childNodes'][_0x2a741d['childNodes']['length']-0x1],'afterend']:[_0x2a741d['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x116776,_0x296a97){const _0x32721a=[],_0x30de67=this['_findPrevElementWithDataId'](_0x116776,!0x0);if(_0x30de67){const _0x45119f=Dt('data-id',this['_getNodeDataId'](_0x30de67),_0x296a97);_0x45119f&&_0x32721a['push']([_0x45119f,'afterend']);}const _0x46b802=this['_findNextElementWithDataId'](_0x116776,!0x0);if(_0x46b802){const _0x5cbf22=Dt('data-id',this['_getNodeDataId'](_0x46b802),_0x296a97);_0x5cbf22&&_0x32721a['push']([_0x5cbf22,'beforebegin']);}if(_0x32721a['length']>0x1)return Xi(_0x32721a[0x0][0x0])<=Xi(_0x32721a[0x1][0x0])?_0x32721a[0x0]:_0x32721a[0x1];return 0x1===_0x32721a['length']?_0x32721a[0x0]:[_0x296a97['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x3b1d9b,_0x170da3){let _0x1ec046=_0x3b1d9b['nextSibling'],_0x2545e4=null,_0x3e53ae=!0x1;for(;_0x1ec046;){if(_0x543d27(_0x1ec046)){if(this['_isDelNode'](_0x1ec046)&&(_0x2545e4=_0x1ec046),this['_isExistingContentComment'](_0x1ec046)&&_0x170da3&&!_0x3e53ae){_0x3e53ae=!0x0,_0x1ec046=_0x1ec046['nextSibling'];continue;}break;}const _0x15f448=vt(_0x1ec046,'data-id');if(_0x15f448&&'new-element'!==_0x15f448&&this['_existingDataIds']['has'](_0x15f448)){_0x2545e4=_0x1ec046;break;}_0x1ec046=_0x1ec046['nextSibling'];}return _0x2545e4;}['_findPrevElementWithDataId'](_0x47b82e,_0x549770){let _0x29021e=_0x47b82e['previousSibling'],_0x2a4a0c=null,_0x384869=!0x1;for(;_0x29021e;){if(_0x543d27(_0x29021e)){if(this['_isDelNode'](_0x29021e)&&(_0x2a4a0c=_0x29021e),this['_isExistingContentComment'](_0x29021e)&&_0x549770&&!_0x384869){_0x384869=!0x0,_0x29021e=_0x29021e['previousSibling'];continue;}break;}const _0x348685=vt(_0x29021e,'data-id');if(_0x348685&&'new-element'!==_0x348685&&this['_existingDataIds']['has'](_0x348685)){_0x2a4a0c=_0x29021e;break;}_0x29021e=_0x29021e['previousSibling'];}return _0x2a4a0c;}['_markWrappedElements'](_0x21ed1a){_0x499346(_0x21ed1a)&&Ze('data-id',null,_0x21ed1a)['forEach'](_0x3be3fe=>{this['_isExistingNode'](_0x3be3fe)&&!this['_hasWrappedParent'](_0x3be3fe)&&(Ji(_0x3be3fe,'data-wrapped-id',vt(_0x3be3fe,'data-id')),Ji(_0x3be3fe,'data-id',null));});}['_getNodeDataId'](_0x65a43){if(!_0x65a43)return null;if(_0x499346(_0x65a43))return vt(_0x65a43,'data-id');if(_0x543d27(_0x65a43)){const _0x4cb1c2=Ot(_0x65a43)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x4cb1c2&&_0x4cb1c2[0x1])return _0x4cb1c2[0x1];}return null;}['_storeDeletedElementIds'](_0x5e4156){if(_0x543d27(_0x5e4156)){const _0x4939b3=Ot(_0x5e4156)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x4939b3&&_0x4939b3[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x4939b3[0x1]);}}['_getUid'](_0x40a9ff){return this['_isExistingNode'](_0x40a9ff)?vt(_0x40a9ff,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x288973){(function(_0x2096e0){return _0x2e7bf0(_0x2e0a2c=>_0x543d27(_0x2e0a2c),_0x2096e0,!0x0,0x1/0x0);}(_0x288973)['filter'](_0xea3bcd=>this['_isDelNode'](_0xea3bcd)||this['_isExistingContentComment'](_0xea3bcd))['forEach'](_0x8e55ef=>{_0x1b183f(_0x8e55ef);}));}['_markLastTagElementUnstable'](_0x3239fd){const _0x3e4377=_0x3239fd['childNodes'],_0x2b00f5=_0x3e4377[_0x3e4377['length']-0x1];_0x2b00f5&&_0x499346(_0x2b00f5)&&Ji(_0x2b00f5,'data-unstable','true');}['_markUnstableElements'](_0x110a97,_0x30a7fb){const _0x32f792=Dt('data-unstable','true',_0x110a97);if(!_0x32f792)return;const _0x9211e6=qe(_0x32f792)['slice'](0x0,-0x1),_0x21f531=_0x9211e6['length'];let _0x4f3b4b=_0x32f792;if(_0x21f531>_0x30a7fb){let _0x135be1=_0x21f531,_0x230598=null;for(;_0x135be1>_0x30a7fb&&_0x135be1>=0x0;)_0x135be1--,_0x230598=_0x9211e6[_0x135be1];_0x230598&&(_0x4f3b4b=_0x230598,Ji(_0x32f792,'data-unstable',null),Ji(_0x230598,'data-unstable','true'));}else{if(_0x21f531<_0x30a7fb){let _0x371427=_0x21f531,_0x4d3b5f=_0x32f792;for(;_0x371427<_0x30a7fb;){const _0x7fa4cc=_0x4d3b5f['childNodes']['filter'](_0x452551=>_0x499346(_0x452551));if(0x0===_0x7fa4cc['length'])break;_0x371427++,_0x4d3b5f=_0x7fa4cc[_0x7fa4cc['length']-0x1];}_0x4d3b5f&&(_0x4f3b4b=_0x4d3b5f,Ji(_0x32f792,'data-unstable',null),Ji(_0x4d3b5f,'data-unstable','true'));}}let _0x597a1d=_0x4f3b4b;for(;_0x597a1d;){for(;_0x597a1d['nextSibling'];)_0x597a1d=_0x597a1d['nextSibling'],_0x499346(_0x597a1d)&&Ji(_0x597a1d,'data-unstable','true');_0x597a1d=_0x597a1d['parentNode'];}}['_isNewNode'](_0x2b21ba){return Boolean('new-element'===vt(_0x2b21ba,'data-id'));}['_isExistingNode'](_0x24bd3d){return Boolean((vt(_0x24bd3d,'data-id')||'')['length']>0x0&&'new-element'!==vt(_0x24bd3d,'data-id'));}['_isDelNode'](_0x1962c2){return!!_0x1962c2&&Boolean(_0x543d27(_0x1962c2)&&Ot(_0x1962c2)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x50507b){let _0x582af0=_0x50507b['parentNode'];for(;_0x582af0;){if(vt(_0x582af0,'data-wrapped-id'))return!0x0;_0x582af0=_0x582af0['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x1116f3){return Boolean(_0x543d27(_0x1116f3)&&Ot(_0x1116f3)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function Q({editor:_0x3cb05a,changeGroups:_0x4c5cdc,documentContextContent:_0x412da1,showDiff:_0x4475c2,trimUnchanged:_0x2284d9=!0x0}){return _0x4c5cdc['map'](_0x4ec97a=>{const _0x2eb078=new Rt([]),_0x18cc3f=new Rt([]);for(const _0x2b6d57 of _0x4ec97a['changes'])if(_0x4475c2&&'removed'==_0x2b6d57['type']||_0x18cc3f['children']['push'](_0x2b6d57['node']['cloneNode'](!0x0)),'new'!=_0x2b6d57['type']&&(_0x4475c2||'removed'!=_0x2b6d57['type'])){const _0x3860f4=St(_0x629e62=>vt(_0x629e62,'data-id')==_0x2b6d57['id'],_0x412da1,!0x0);_0x3860f4&&_0x2eb078['children']['push'](_0x3860f4['cloneNode'](!0x0));}const {content:_0x4616a5,hasChanges:_0x15b0a0}=function(_0x264322,_0x3dc22b,_0x53df0e,_0x46262f,_0x237fe0=!0x0){const _0x8eb063=_0x264322['plugins']['get']('DocumentCompare'),_0x43dfde=Ot(_0x3dc22b),_0xac1c1f=Ot(_0x53df0e),_0x38e6ee=_0x264322['data']['parse'](_0x43dfde,'$root'),_0x309cdb=_0x264322['model']['createPositionAt'](_0x38e6ee,0x0),_0x2bd284=_0x8eb063['getDiff'](_0x43dfde,_0xac1c1f,{'anchor':_0x309cdb,'markDeletions':_0x46262f,'context':'$root'}),_0x173ade=_0x2bd284['getOperations']();if(0x0==_0x173ade['length'])return{'content':_0x3dc22b['cloneNode'](!0x0),'hasChanges':!0x1};_0x46262f?function(_0x5eb7c6,_0x10a4c2,_0x1aa63f){if(0x0==_0x5eb7c6['length'])return;const _0x1a380d=_0x1aa63f['plugins']['get']('DocumentCompare'),_0x4ad08e=_0x1aa63f['plugins']['get']('SuggestionsConversion');_0x1aa63f['model']['change'](_0x5ed5af=>{const _0x36ac53=new Set();for(let _0x1134f7=0x0;_0x1134f7<_0x5eb7c6['length'];_0x1134f7++){const _0x2732d=_0x5eb7c6[_0x1134f7];if(_0x2732d['baseVersion']=null,_0x2732d['isDocumentOperation']=!0x1,_0x1a380d['isMarkedRemoveOperation'](_0x2732d)){const _0x145108=_0x7900ef(_0x2732d['newRange'],_0x1aa63f['model']),_0x15eec1='suggestion:deletion:'+_0xdc126c()+':$aiSuggestion';_0x10a4c2['markers']['set'](_0x15eec1,_0x145108);}else switch(_0x2732d['type']){case'rename':{if(_0x2732d['oldName']==_0x2732d['newName'])break;_0x5ed5af['batch']['addOperation'](_0x2732d),_0x1aa63f['model']['applyOperation'](_0x2732d);const _0x530c86='$elementName',_0x459301=_0x2732d['position'],_0x4026a0=_0x1aa63f['model']['createRange'](_0x459301,_0x1aa63f['model']['createPositionAt'](_0x459301['nodeAfter'],'end')),_0x5b17a='suggestion:attribute:'+_0x530c86+':'+_0xdc126c()+':$aiSuggestion';_0x10a4c2['markers']['set'](_0x5b17a,_0x4026a0);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x2732d['oldValue']==_0x2732d['newValue'])break;_0x5ed5af['batch']['addOperation'](_0x2732d),_0x1aa63f['model']['applyOperation'](_0x2732d);const _0x1176b2=_0x2732d['key'];if(!_0x4ad08e['isRegisteredAttribute'](_0x1176b2))break;const _0x2baa45=_0x7900ef(_0x2732d['range'],_0x1aa63f['model']),_0x18aab1='suggestion:attribute:'+_0x1176b2+':'+_0xdc126c()+':$aiSuggestion';_0x10a4c2['markers']['set'](_0x18aab1,_0x2baa45);break;}case'insert':{_0x5ed5af['batch']['addOperation'](_0x2732d),_0x1aa63f['model']['applyOperation'](_0x2732d);if(_0x5eb7c6[_0x1134f7+0x1]&&'move'==_0x5eb7c6[_0x1134f7+0x1]['type']){ro(_0x10a4c2,_0x2732d);break;}const _0x2a0bc8=_0x2732d['position'],_0x2ce0a3=_0x2732d['howMany'],_0x1de6e0=_0x7900ef(_0x1aa63f['model']['createRange'](_0x2a0bc8,_0x2a0bc8['getShiftedBy'](_0x2ce0a3)),_0x1aa63f['model']),_0x253a42='suggestion:insertion:'+_0xdc126c()+':$aiSuggestion';_0x10a4c2['markers']['set'](_0x253a42,_0x1de6e0);break;}case'split':{_0x5ed5af['batch']['addOperation'](_0x2732d),_0x1aa63f['model']['applyOperation'](_0x2732d);const _0x492bef=_0x2732d['splitPosition'],_0x57a23e=_0x2732d['moveTargetPosition'],_0x5d4323=_0x1aa63f['model']['createRange'](_0x492bef,_0x57a23e),_0x22c6a7='suggestion:insertion:'+_0xdc126c()+':$aiSuggestion';_0x10a4c2['markers']['set'](_0x22c6a7,_0x5d4323);break;}case'move':{_0x5ed5af['batch']['addOperation'](_0x2732d),_0x1aa63f['model']['applyOperation'](_0x2732d),_0x5eb7c6[_0x1134f7-0x1]&&'insert'==_0x5eb7c6[_0x1134f7-0x1]['type']&&ro(_0x10a4c2,_0x2732d);const _0x3ff60d=_0x2732d['getMovedRangeStart'](),_0x46b144=_0x2732d['howMany'];for(let _0xe3f8fc=0x0;_0xe3f8fc<_0x46b144;_0xe3f8fc++){const _0xc1c507=_0x3ff60d['getShiftedBy'](_0xe3f8fc)['nodeAfter'];_0x36ac53['add'](_0xc1c507);}break;}case'remove':{const _0x5ace75=_0x2732d['sourcePosition'],_0x52e636=_0x2732d['howMany'],_0x47ed11=new it(_0x5ace75,_0x52e636);_0x5ed5af['batch']['addOperation'](_0x47ed11),_0x1aa63f['model']['applyOperation'](_0x47ed11);break;}}}for(const _0x25eabd of _0x36ac53){const _0x5d47cd=_0x1aa63f['model']['createRangeOn'](_0x25eabd),_0x1cc4d2='suggestion:formatBlock:$fakeWrap:'+_0xdc126c()+':$aiSuggestion';_0x10a4c2['markers']['set'](_0x1cc4d2,_0x7900ef(_0x5d47cd,_0x1aa63f['model']));}});}(_0x173ade,_0x38e6ee,_0x264322):_0x264322['model']['change'](_0x13f68c=>{for(const _0x2db3e2 of _0x173ade)if('remove'==_0x2db3e2['type']){const _0x457072=_0x2db3e2['sourcePosition'],_0xef58cf=_0x2db3e2['howMany'],_0x1d08b2=new it(_0x457072,_0xef58cf);_0x13f68c['batch']['addOperation'](_0x1d08b2),_0x264322['model']['applyOperation'](_0x1d08b2);}else{if('marker'==_0x2db3e2['type']){const _0xf09c7d=_0x2db3e2['name'],_0x5dfab7=_0x2db3e2['newRange'];_0x38e6ee['markers']['set'](_0xf09c7d,_0x5dfab7);}else _0x2db3e2['baseVersion']=null,_0x2db3e2['isDocumentOperation']=!0x1,_0x13f68c['batch']['addOperation'](_0x2db3e2),_0x264322['model']['applyOperation'](_0x2db3e2);}});if(_0x237fe0){const _0x330958=wt(_0x264322,_0x173ade,_0x38e6ee);Et(_0x264322['model'],_0x330958),function(_0x36a2b5,_0x5d1b83){const _0x108a17=_0x5d1b83['getFirstRange']()['start'];let _0x2285c9=_0x5d1b83['getFirstRange']()['end'];const _0x2def73=_0x108a17['root'];(_0x2285c9['textNode']||_0x2285c9['nodeAfter']&&_0x2285c9['nodeAfter']['is']('$text'))&&(_0xf35697(_0x2285c9,'...'),_0x2285c9=_0x2285c9['getShiftedBy'](0x3)),(_0x108a17['textNode']||_0x108a17['nodeBefore']&&_0x108a17['nodeBefore']['is']('$text'))&&(_0xf35697(_0x108a17,'...'),function(_0x1e57c5,_0x2abc59,_0x16b931){for(let [_0x20c8b8,_0x9f0df9]of _0x1e57c5['markers']){const _0x18ad00=_0x9f0df9['_getTransformedByInsertion'](_0x2abc59,_0x16b931,!0x1);_0x9f0df9=_0x18ad00[0x0],_0x1e57c5['markers']['set'](_0x20c8b8,_0x9f0df9);}}(_0x2def73,_0x108a17,0x3),_0x108a17['parent']==_0x2285c9['parent']&&(_0x2285c9=_0x2285c9['getShiftedBy'](0x3)));const _0x59fe55=_0x36a2b5['createRange'](_0x36a2b5['createPositionAt'](_0x2def73,0x0),_0x108a17),_0x1ede86=_0x36a2b5['createRange'](_0x2285c9,_0x36a2b5['createPositionAt'](_0x2def73,'end')),_0x45356f=[..._0x59fe55['getMinimalFlatRanges'](),..._0x1ede86['getMinimalFlatRanges']()];_0x45356f['reverse']();for(const _0x1d54e9 of _0x45356f)_0x2f772f(_0x1d54e9),Jn(_0x2def73,_0x1d54e9);}(_0x264322['model'],_0x330958);}const _0xca964d=_0x264322['data']['stringify'](_0x38e6ee,{'showSuggestionHighlights':!0x0});return{'content':He(_0xca964d),'hasChanges':!0x0};}(_0x3cb05a,_0x2eb078,_0x18cc3f,_0x4475c2,_0x2284d9);return{'type':_0x4ec97a['changes'][0x0]['type'],'index':_0x4ec97a['index'],'content':_0x4616a5,'hasChanges':_0x15b0a0};});}function ro(_0x566238,_0x3e9c8d){for(const [_0x10f26a,_0x258392]of _0x566238['markers']){const _0x13ebbd=_0x1026dd['_createFromRanges'](_0x258392['getTransformedByOperation'](_0x3e9c8d));_0x566238['markers']['set'](_0x10f26a,_0x13ebbd);}}function wt(_0x538aab,_0x381c1f,_0x16785f){const _0x1b13a4=_0x538aab['plugins']['get']('DocumentCompare');let _0x59915e=_0x538aab['model']['createPositionAt'](_0x16785f,Number['POSITIVE_INFINITY']),_0x3ac891=_0x538aab['model']['createPositionAt'](_0x16785f,0x0);for(const _0x214353 of _0x381c1f){let _0x1850e9,_0x50e4ff;if(_0x1b13a4['isMarkedRemoveOperation'](_0x214353))_0x1850e9=_0x214353['newRange']['start'],_0x50e4ff=_0x214353['newRange']['end'];else switch(_0x59915e=_0x59915e['getTransformedByOperation'](_0x214353),_0x3ac891=_0x3ac891['getTransformedByOperation'](_0x214353),_0x214353['type']){case'rename':_0x1850e9=_0x214353['position'],_0x50e4ff=_0x1850e9['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x1850e9=_0x214353['range']['start'],_0x50e4ff=_0x214353['range']['end'];break;case'insert':_0x1850e9=_0x214353['position'],_0x50e4ff=_0x1850e9['getShiftedBy'](_0x214353['howMany']);break;case'split':_0x1850e9=_0x214353['splitPosition'],_0x50e4ff=_0x214353['moveTargetPosition'];break;case'merge':{const _0x3094e9=_0x214353['targetPosition']['path']['slice'](0x0,-0x1);_0x1850e9=_0x538aab['model']['createPositionFromPath'](_0x16785f,_0x3094e9),_0x50e4ff=_0x1850e9['getShiftedBy'](0x1);break;}case'remove':{const _0x39a3cc=_0x214353['howMany'],_0x31ee22=_0x214353['sourcePosition']['_getTransformedByInsertion'](_0x214353['targetPosition'],_0x39a3cc),_0x4709ae=_0x214353['getMovedRangeStart']();'remove'==_0x214353['type']?(_0x1850e9=_0x31ee22,_0x50e4ff=_0x31ee22):(_0x1850e9=_0x4709ae,_0x50e4ff=_0x4709ae['getShiftedBy'](_0x39a3cc));break;}}_0x1850e9&&_0x1850e9['isBefore'](_0x59915e)&&(_0x59915e=_0x1850e9['clone'](),_0x59915e['stickiness']='toNone'),_0x50e4ff&&_0x50e4ff['isAfter'](_0x3ac891)&&(_0x3ac891=_0x50e4ff['clone'](),_0x3ac891['stickiness']='toNone');}return _0x538aab['model']['createSelection'](_0x538aab['model']['createRange'](_0x59915e,_0x3ac891));}function Et(_0x3574ad,_0x36b0db){so(_0x3574ad,_0x36b0db,'forward');const _0x5a28cc=_0x36b0db['getFirstRange']();_0x36b0db['setTo']([]),_0x36b0db['setTo'](_0x5a28cc,{'backward':!0x0}),so(_0x3574ad,_0x36b0db,'backward');}function so(_0x2ca9ec,_0x4b15b4,_0x500161){let _0x34f653=0x14;for(;_0x34f653;){_0x2ca9ec['modifySelection'](_0x4b15b4,{'unit':'word','direction':_0x500161}),_0x34f653--;const _0x43abbf=_0x4b15b4['focus']['forward'==_0x500161?'nodeBefore':'nodeAfter'];if(_0x43abbf&&_0x43abbf['is']('element')&&_0x2ca9ec['schema']['isBlock'](_0x43abbf)&&_0x2ca9ec['schema']['isObject'](_0x43abbf))break;}}function Jn(_0x461ca6,_0x1d5d78){for(const [_0x5d4786,_0x55964f]of _0x461ca6['markers']){const _0x50c8db=_0x55964f['_getTransformedByDeletion'](_0x1d5d78['start'],_0x1d5d78['end']['offset']-_0x1d5d78['start']['offset']);null!=_0x50c8db?_0x461ca6['markers']['set'](_0x5d4786,_0x50c8db):_0x461ca6['markers']['delete'](_0x5d4786);}}const Zn=['modification-delta','text-delta','web-search','reasoning'],Wr=['conversation-title'];class Ge extends ts(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new Rt([]);['parsedMergedContent']=new Rt([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x403015,content:_0x2ba85b='',isDone:_0x15987a=!0x1,interactionId:_0x48edab,areActionsDisabled:_0x17442b,documentContextContent:_0x4158de,editor:_0x29760f,id:_0x4cece4}){super(),this['id']=_0x4cece4||_0xdc126c(),this['interactionId']=_0x48edab,this['type']=_0x403015,this['areActionsDisabled']=!!_0x17442b,this['editor']=_0x29760f,this['aiResponseParser']=new Ke(),this['aiResponseApplier']=new Qe(),this['documentContextContent']=He(_0x4158de||''),this['set']('isDone',_0x15987a),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x2ba85b);}['appendContent'](_0x201b35){this['set']('content',this['content']+_0x201b35);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x4aedf0,_0x25d8aa){this['changeGroups'][_0x4aedf0]['state']=_0x25d8aa,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x4aedf0,'state':_0x25d8aa});}['getContentParts']({showDiff:_0x51554d,groupIndex:_0x4c9e85}){if(!this['editor'])throw new _0x36b126('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x33a4dd=this['_getCachedContentParts'](_0x51554d,_0x4c9e85);if(_0x33a4dd)return _0x33a4dd;let _0x1fbe60=[];if(void 0x0===_0x4c9e85)_0x1fbe60=this['changeGroups'];else{const _0x2764f5=this['changeGroups']['find'](({index:_0x1ce2d8})=>_0x1ce2d8===_0x4c9e85);if(!_0x2764f5)throw new _0x36b126('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x4c9e85});_0x1fbe60=[_0x2764f5];}const _0x164eb8=Q({'editor':this['editor'],'showDiff':_0x51554d,'changeGroups':_0x1fbe60,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x51554d,_0x164eb8),_0x164eb8;}['_getCachedContentParts'](_0x5e87b1,_0x35c414){const _0x5826b6=_0x5e87b1?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x5826b6]['length'])return null;const _0x5011c2=this['cachedSuggestionContentParts'][_0x5826b6];if(void 0x0===_0x35c414)return _0x26086b(_0x5011c2);{const _0x310217=_0x5011c2['find'](({index:_0x527c7e})=>_0x527c7e===_0x35c414);if(_0x310217)return[_0x26086b(_0x310217)];}return null;}['_setCachedContentParts'](_0x50cafa,_0x1c6179){const _0x212e8b=_0x50cafa?'withDiff':'withoutDiff';_0x1c6179['forEach'](_0x160ef7=>{const _0x57c88c=this['cachedSuggestionContentParts'][_0x212e8b],_0x3a2f44=_0x57c88c['find'](({index:_0x1f7a24})=>_0x1f7a24===_0x160ef7['index']);if(_0x3a2f44){const _0x31cb68=_0x57c88c['indexOf'](_0x3a2f44);_0x57c88c['splice'](_0x31cb68,0x1,_0x160ef7);}else _0x57c88c['push'](_0x160ef7);});}['onContentChange'](){if('modification-delta'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x4d1965=this['changeGroups'];this['updateChangeGroups']();const _0x5c32f4=this['_getDifferentChangeGroups'](_0x4d1965,this['changeGroups']);(_0x5c32f4['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x5c32f4),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0xbd8762,_0x3a88ca){const _0x62a2da=[];for(const _0x5042e2 of _0x3a88ca){const _0x547ec5=_0xbd8762[_0x5042e2['index']];_0x547ec5?_0x547ec5['changes']['length']!==_0x5042e2['changes']['length']?_0x62a2da['push'](_0x5042e2):_0x547ec5['changes']['forEach']((_0x22d14b,_0x31ece2)=>{const _0x8e5d0b=_0x5042e2['changes'][_0x31ece2];_0x22d14b['id']!==_0x8e5d0b['id']&&_0x62a2da['push'](_0x5042e2);}):_0x62a2da['push'](_0x5042e2);}return _0x62a2da;}['updateChangeGroups'](){const _0x303926=new _0xec973e('p',{},[new _0xec973e('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x4e1833(i(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x41af65=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x303926,'cutAfterLastChange':!this['isDone']});if(!_0x41af65['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x41af65['parsedContent'];let _0x1a7b78=[];if(_0x4a6dcc(_0x17f011=>{const _0x304022=vt(_0x17f011,'data-id');if(!_0x304022||!_0x3ab0a8(_0x304022))return!0x1;const _0x58aab2=[_0x17f011,...qe(_0x17f011)]['at'](-0x2);if(_0x17f011!=_0x58aab2){const _0x465a89=vt(_0x58aab2,'data-id');_0x3ab0a8(_0x465a89)||(_0x1a7b78['push']({'node':_0x58aab2,'id':_0x465a89,'type':'modified'}),_0x41af65['modifiedNodeIds']['push'](_0x465a89));}else _0x41af65['modifiedNodeIds']['includes'](_0x304022)?_0x1a7b78['push']({'node':_0x17f011,'type':'modified','id':_0x304022}):_0x41af65['newNodeIds']['includes'](_0x304022)?_0x1a7b78['push']({'node':_0x17f011,'type':'new','id':_0x304022,'anchorId':vt(_0x17f011['previousSibling'],'data-id')}):_0x1a7b78['push']({'node':_0x17f011,'type':'removed','id':_0x304022});return!0x0;},this['parsedMergedContent']),_0x1a7b78=_0x1a7b78['filter'](({node:_0x35abfd})=>[...qe(_0x35abfd),_0x35abfd]['every'](_0x2251da=>!vt(_0x2251da,'data-unstable'))),0x0==_0x1a7b78['length'])return;const _0xd83c4=[[_0x1a7b78[0x0]]];for(let _0x23a7a4=0x1;_0x23a7a4<_0x1a7b78['length'];_0x23a7a4++){const _0x523dfc=_0xd83c4[_0xd83c4['length']-0x1],_0x4ed4b6=_0x523dfc[_0x523dfc['length']-0x1];_0x1a7b78[_0x23a7a4]['node']['previousSibling']==_0x4ed4b6['node']&&'modified'!=_0x1a7b78[_0x23a7a4]['type']&&'modified'!=_0x4ed4b6['type']?_0x523dfc['push'](_0x1a7b78[_0x23a7a4]):_0xd83c4['push']([_0x1a7b78[_0x23a7a4]]);}for(const _0x3069d6 of _0xd83c4){const _0x239fae=_0x3069d6[0x0],_0x2b2251=_0x3069d6[_0x3069d6['length']-0x1],_0x1d94c6=_0x7ced98(_0x239fae['node']['previousSibling']);_0x1d94c6&&_0x3069d6['unshift'](_0x1d94c6);const _0x253c82=_0x7ced98(_0x2b2251['node']['nextSibling']);_0x253c82&&_0x3069d6['push'](_0x253c82);}function _0x3ab0a8(_0x57724b){return _0x41af65['modifiedNodeIds']['includes'](_0x57724b)||_0x41af65['newNodeIds']['includes'](_0x57724b)||_0x41af65['removedNodeIds']['includes'](_0x57724b);}function _0x7ced98(_0x21764b){if(_0x21764b&&vt(_0x21764b,'data-id')&&!vt(_0x21764b,'data-unstable')){const _0x543863=vt(_0x21764b,'data-id');if(!_0x3ab0a8(_0x543863))return{'node':_0x21764b,'type':'context','id':_0x543863};}return null;}this['changeGroups']=_0xd83c4['map']((_0x546924,_0x138efe)=>({'changes':_0x546924,'state':'pending','index':_0x138efe}));}}function Di(_0xa44217){return Object['values'](Zn)['includes'](_0xa44217);}function Fi(_0x1704bf){return Wr['includes'](_0x1704bf);}function Ui(_0x42f9f6){return'conversation-title'===_0x42f9f6;}function qi(_0x3cc342){return'source'===_0x3cc342;}const Ce=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','error'];class xe extends _0x19d98c(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x4372e5,editor:_0x4a0c71}){super(),this['id']=_0xdc126c(),this['connector']=_0x4372e5,this['isStopped']=!0x0,this['editor']=_0x4a0c71;}async['start'](){let _0x5d85e4;const _0x580dae=[];this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x4c9694=await this['currentRequest']['getStream']();for await(const _0x52c34f of _0x4c9694){if(this['isStopped'])return;if('error'===_0x52c34f['event'])return void this['fire']('error',{'error':new _0x36b126('ai-chat-interaction-error',this)});if('message-metadata'!==_0x52c34f['event']){if('action-metadata'!==_0x52c34f['event']){if(Ui(_0x52c34f['event'])&&this['setConversationTitle'](_0x52c34f['data']['conversationTitle'],!0x0),qi(_0x52c34f['event']))_0x580dae['push'](_0x52c34f['data']['source']);else{if(Di(_0x52c34f['event'])){if(_0x52c34f['event']!==_0x5d85e4){if(_0x5d85e4=_0x52c34f['event'],'web-search'===_0x52c34f['event']){this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));continue;}if('reasoning'===_0x52c34f['event']){this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));continue;}this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this)),this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this)),this['currentReply']&&this['currentReply']['done'](),this['currentReply']=this['createReply']({'type':_0x52c34f['event'],'interactionId':this['id'],'id':_0x52c34f['data']?.['id']}),_0x580dae['length']>0x0&&'modification-delta'===_0x52c34f['event']&&(this['currentReply']['sources']=_0x580dae['splice'](0x0));}_0x52c34f['data']['textDelta']&&this['currentReply']['appendContent'](_0x52c34f['data']['textDelta']);}else Fi(_0x52c34f['event']);}}else this['actionCallId']=_0x52c34f['data']['callId'];}else this['messageId']=_0x52c34f['data']['messageId'];}}finally{this['isStopped']||(_0x580dae['length']>0x0&&(this['currentReply']['sources']=_0x580dae['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x3c90af){return this['replies']['find'](_0x1e8ae5=>_0x1e8ae5['id']===_0x3c90af);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x483225=>_0x483225['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x43e054){const _0x1f0475=new Ge({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x43e054});return this['replies']['push'](_0x1f0475),_0x1f0475['delegate'](...Ce)['to'](this),this['fire']('replyCreated',_0x1f0475),_0x1f0475;}['setConversationTitle'](_0x43107f,_0x21b218=!0x1){this['fire']('setConversationTitle',_0x43107f,_0x21b218);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var je=function(_0x55b129){return _0x55b129['FILE']='file',_0x55b129['DOCUMENT']='document',_0x55b129['URL']='web-resource',_0x55b129['TEXT']='text',_0x55b129['SELECTION']='selection',_0x55b129;}({}),be=function(_0x151a3f){return _0x151a3f['TEXT']='text',_0x151a3f['MARKDOWN']='markdown',_0x151a3f['HTML']='html',_0x151a3f;}({});const Fe=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']]),vi=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class wi extends ts(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x33af3c,config:_0x4cfa80,ownerId:_0x15a682}){super(),this['_connector']=_0x33af3c,this['_config']=_0x4cfa80,this['_ownerId']=_0x15a682;}['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'](_0x2132b3){const _0x85fd47=await this['_createContextItemFromContent'](_0x2132b3);return this['_addToConversationContextItem'](_0x85fd47),'current-document'===_0x85fd47['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x85fd47;}async['_createContextItemFromContent'](_0x45ecc8){if(_0x45ecc8['type']===je['DOCUMENT']){const _0x9e6acc=await this['_connector']['fetchDocument'](this['_ownerId'],_0x45ecc8['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x45ecc8['type'],'content':_0x9e6acc['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x9e6acc['attributes']?.['version'],'sessionId':_0x9e6acc['attributes']?.['sessionId']};}return{'id':_0x45ecc8['id'],'uiId':_0x45ecc8['id'],'label':_0x45ecc8['attributes']?.['label']||_0x45ecc8['name']||_0x45ecc8['url']||_0x45ecc8['id'],'type':_0x45ecc8['type'],..._0x45ecc8?.['attributes']?.['resourceId']?{'resourceId':_0x45ecc8['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x385f62){const _0x57115b=this['_pendingContextItems']['get'](_0x385f62);_0x57115b?.['isReadOnly']||this['_removeContextItem'](_0x385f62);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x302a8a of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x302a8a['uiId']);const _0x591f11=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x591f11&&this['_addContextItem']({..._0x591f11,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x25b5bc){for(const _0x4522f5 of _0x25b5bc['values']())this['_addToConversationContextItem'](_0x4522f5);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'](_0x4d34a9){return Array['from'](_0x4d34a9['values']())['map'](_0x5d3195=>this['_mapContextItemToRequestData'](_0x5d3195))['filter'](_0x32210f=>null!==_0x32210f);}async['addFilesToContext'](_0x5e4b13,_0x44f5df,_0x19605=je['FILE']){const _0x27ec2f='files-'+_0xdc126c();this['_startUploadOperation'](_0x27ec2f);try{await Promise['all'](_0x5e4b13['map'](async _0x1a5012=>{const _0x12933a='file-'+_0xdc126c(),_0x266c92=_0x469020(_0x1a5012['name']);try{this['_addContextItem']({'type':_0x19605,'label':_0x44f5df?.['label']||_0x266c92,'uiId':_0x12933a,'resourceId':_0x44f5df?.['resourceId']},!0x0);const _0x5714e7=this['_connector']['uploadFile'](this['_ownerId'],_0x1a5012,_0x44f5df);this['_ongoingUploads']['set'](_0x12933a,_0x5714e7['abortController']);const {id:_0x4a1f8c}=await _0x5714e7['getId']();this['_ongoingUploads']['delete'](_0x12933a),this['_finishContextItemLoading']({'type':_0x19605,'id':_0x4a1f8c,'label':_0x44f5df?.['label']||_0x266c92,'uiId':_0x12933a,'resourceId':_0x44f5df?.['resourceId']},!0x1);}catch(_0xab6536){this['_ongoingUploads']['delete'](_0x12933a);if(!(_0xab6536 instanceof _0x36b126&&_0xab6536['message']['startsWith']('ai-request-aborted'))){const _0x37cac3=Fe['get'](_0xab6536['code'])||'ai-chat-file-upload-failed',_0x905357=new _0x36b126(_0x37cac3,null,{'fileName':_0x266c92,..._0xab6536});_0x905357['stack']=_0xab6536['stack'],this['fire']('error',{'error':_0x905357});}this['_removeContextItem'](_0x12933a);}}));}finally{this['_finishUploadOperation'](_0x27ec2f);}}['addCurrentDocumentToContext'](_0x2feed8){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0xd152a={'type':je['DOCUMENT'],'uiId':'current-document','label':_0x2feed8,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0xd152a);}async['updateCurrentDocument'](_0x520a41,_0xe55585,_0x55be6f,_0x3790d9){const _0x4cb08e=this['_pendingContextItems']['get']('current-document');if(_0x4cb08e&&_0x520a41){_0x4cb08e['selection']=_0x3790d9?_0x3790d9['map'](_0x16dce1=>({'start':_0x16dce1['start'],'end':_0x16dce1['end']})):[];try{if(_0x4cb08e['version']===_0xe55585)return;const {id:_0x544928}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x520a41,{'version':_0xe55585,'sessionId':_0x55be6f})['getId']();_0x4cb08e['id']=_0x544928,_0x4cb08e['content']=_0x520a41,_0x4cb08e['version']=_0xe55585,_0x4cb08e['sessionId']=_0x55be6f;}catch(_0x540d7e){const _0x4115e9=new _0x36b126('ai-chat-document-upload-failed',null);_0x4115e9['stack']=_0x540d7e['stack'],this['fire']('error',{'error':_0x4115e9});}}}['addSelectionToContext'](_0x201524){this['_addContextItem']({'type':je['SELECTION'],'label':_0x201524,'uiId':'selection','content':_0x201524});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x48823c,_0x62df04){const _0x34c34d='url-'+_0xdc126c();this['_startUploadOperation'](_0x34c34d);const _0x3773dc='url-'+_0xdc126c();try{this['_addContextItem']({'type':je['URL'],'label':_0x62df04?.['label']||_0x48823c,'uiId':_0x3773dc,'resourceId':_0x62df04?.['resourceId']},!0x0);const _0x546a2f=this['_connector']['uploadUrl'](this['_ownerId'],_0x48823c,_0x62df04);this['_ongoingUploads']['set'](_0x3773dc,_0x546a2f['abortController']);const {id:_0x4591f9}=await _0x546a2f['getId']();this['_ongoingUploads']['delete'](_0x3773dc),this['_finishContextItemLoading']({'type':je['URL'],'id':_0x4591f9,'label':_0x62df04?.['label']||_0x48823c,'uiId':_0x3773dc,'resourceId':_0x62df04?.['resourceId']},!0x1);}catch(_0x4fd9b1){this['_ongoingUploads']['delete'](_0x3773dc),(_0x4fd9b1['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x36b126('ai-chat-url-upload-failed',this,{'url':_0x48823c,'originalError':_0x4fd9b1}),'url':_0x48823c}),this['_removeContextItem'](_0x3773dc));}finally{this['_finishUploadOperation'](_0x34c34d);}}async['loadSourceResources'](_0x216602,_0x127182,_0x1db5d6){const _0x1f748f=this['_addContextOptionsState']['sources']['find'](_0x6e3c1e=>_0x6e3c1e['id']===_0x216602);if(!_0x1f748f)return this['fire']('error',{'error':new _0x36b126('ai-chat-source-not-found',this,{'sourceId':_0x216602}),'sourceId':_0x216602}),[];try{const _0x9daec7=(await _0x1f748f['getResources'](_0x127182))['map'](_0x505eb1=>{const _0x4fde36=this['_isResourceInContext'](_0x505eb1['id']);return{..._0x505eb1,'isInContext':_0x4fde36};});return _0x1f748f['resources']=_0x9daec7,this['fire']('sourceResourcesLoaded',{'sourceId':_0x216602,'source':_0x1f748f,'resources':_0x9daec7,'uid':_0x1db5d6}),_0x9daec7;}catch(_0x3c2d75){return this['fire']('error',{'error':new _0x36b126('ai-chat-source-resources-load-failed',this,{'sourceId':_0x216602,'originalError':_0x3c2d75}),'sourceId':_0x216602,'sourceLabel':_0x1f748f['label']}),[];}}async['addResourceToContext'](_0x210f94,_0x585f7c){if(this['_isResourceInContext'](_0x585f7c['id']))return;let _0x40974e=_0x585f7c['data'];if(!_0x40974e&&_0x210f94['getData'])try{_0x40974e=await _0x210f94['getData'](_0x585f7c['id']);}catch(_0x3465e5){return void this['fire']('error',{'error':new _0x36b126('ai-chat-resource-load-failed',this,{'resourceId':_0x585f7c['id'],'sourceId':_0x210f94['id'],'originalError':_0x3465e5}),'resourceId':_0x585f7c['id'],'sourceId':_0x210f94['id']});}if(_0x40974e)switch(_0x585f7c['type']){case je['URL']:if('string'!=typeof _0x40974e)return void this['fire']('error',{'error':new _0x36b126('ai-chat-context-invalid-data',this,{'resourceId':_0x585f7c['id'],'sourceId':_0x210f94['id'],'expectedType':'string','actualType':typeof _0x40974e}),'resourceId':_0x585f7c['id'],'sourceId':_0x210f94['id']});await this['addUrlToContext'](_0x40974e,{'label':_0x585f7c['label'],'resourceId':_0x585f7c['id']});break;case je['FILE']:if(!(_0x40974e instanceof File))return void this['fire']('error',{'error':new _0x36b126('ai-chat-context-invalid-data',this,{'resourceId':_0x585f7c['id'],'sourceId':_0x210f94['id'],'expectedType':'File','actualType':typeof _0x40974e}),'resourceId':_0x585f7c['id'],'sourceId':_0x210f94['id']});await this['addFilesToContext']([_0x40974e],{'label':_0x585f7c['label'],'resourceId':_0x585f7c['id']});break;case je['TEXT']:if('object'!=typeof _0x40974e||!('content'in _0x40974e)||!('type'in _0x40974e))return void this['fire']('error',{'error':new _0x36b126('ai-chat-context-invalid-data',this,{'resourceId':_0x585f7c['id'],'sourceId':_0x210f94['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x40974e}),'resourceId':_0x585f7c['id'],'sourceId':_0x210f94['id']});_0x40974e=wi['_convertTextResourceToFile'](_0x40974e,_0x585f7c['label']),await this['addFilesToContext']([_0x40974e],{'label':_0x585f7c['label'],'resourceId':_0x585f7c['id']},je['TEXT']);break;default:this['fire']('error',{'error':new _0x36b126('ai-chat-context-unsupported-type',this,{'resourceId':_0x585f7c['id'],'sourceId':_0x210f94['id'],'resourceType':_0x585f7c['type']}),'resourceId':_0x585f7c['id'],'sourceId':_0x210f94['id']});}else this['fire']('error',{'error':new _0x36b126('ai-chat-resource-no-data',this,{'resourceId':_0x585f7c['id'],'sourceId':_0x210f94['id']}),'resourceId':_0x585f7c['id'],'sourceId':_0x210f94['id']});}static['_convertTextResourceToFile'](_0x58c130,_0x57cf7b){switch(_0x58c130['type']){case be['MARKDOWN']:return new File([_0x58c130['content']],_0x57cf7b,{'type':'text/markdown'});case be['HTML']:return new File([_0x58c130['content']],_0x57cf7b,{'type':'text/html'});default:return new File([_0x58c130['content']],_0x57cf7b,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x2f23f8){switch(_0x2f23f8['type']){case je['FILE']:return{'type':je['FILE'],'id':_0x2f23f8['id']};case je['URL']:return{'type':je['URL'],'id':_0x2f23f8['id']};case je['DOCUMENT']:return{'type':je['DOCUMENT'],'id':_0x2f23f8['id'],..._0x2f23f8['selection']?.['length']&&{'selection':_0x2f23f8['selection']}};case je['TEXT']:return{'type':je['FILE'],'id':_0x2f23f8['id']};default:return null;}}['_addContextItem'](_0x1a4a9b,_0x504252=!0x1){if(this['_pendingContextItems']['set'](_0x1a4a9b['uiId'],_0x1a4a9b),_0x1a4a9b['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x1a4a9b,'isLoading':_0x504252}),'current-document'===_0x1a4a9b['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x1a4a9b['resourceId']){const _0x1630ff=this['_findSourceIdsByResourceId'](_0x1a4a9b['resourceId']);_0x1630ff&&_0x1630ff['forEach'](_0x596fc5=>{this['_updateResourceInContextState'](_0x596fc5,_0x1a4a9b['resourceId'],!0x0);});}}['_removeContextItem'](_0x13b0a6){const _0x5309b7=this['_pendingContextItems']['get'](_0x13b0a6),_0x296240=this['_ongoingUploads']['get'](_0x13b0a6);if(_0x296240&&(_0x296240['abort'](),this['_ongoingUploads']['delete'](_0x13b0a6)),_0x5309b7?.['resourceId']){const _0xcd8fe4=this['_findSourceIdsByResourceId'](_0x5309b7['resourceId']);_0xcd8fe4&&_0xcd8fe4['forEach'](_0x5c671a=>{this['_updateResourceInContextState'](_0x5c671a,_0x5309b7['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x13b0a6),this['fire']('contextItemRemoved',{'uiId':_0x13b0a6,'type':_0x5309b7?.['type']}),'current-document'===_0x13b0a6&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x32abc5,_0x28d726){if(this['_pendingContextItems']['has'](_0x32abc5['uiId'])&&(this['_pendingContextItems']['set'](_0x32abc5['uiId'],_0x32abc5),this['fire']('contextItemLoadingEnded',{'contextItem':_0x32abc5,'isLoading':_0x28d726}),_0x32abc5['resourceId'])){const _0x5c1477=this['_findSourceIdsByResourceId'](_0x32abc5['resourceId']);_0x5c1477&&_0x5c1477['forEach'](_0x2b984a=>{this['_updateResourceInContextState'](_0x2b984a,_0x32abc5['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x5128be){this['_conversationContextItems']['set'](_0x5128be['uiId'],_0x5128be);}['_setAddContextOptionsDefaultState'](){this['_addContextOptionsState']={'document':{'enabled':!0x1!==this['_config']?.['document']?.['enabled'],'isHidden':!0x1},'urls':{'enabled':!0x1!==this['_config']?.['urls']?.['enabled']},'files':{'enabled':!0x1!==this['_config']?.['files']?.['enabled']},'sources':this['_getCustomSourcesInitialState']()},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x6f9ce8=>({..._0x6f9ce8,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x131dbc=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x131dbc,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x5b487c){for(const _0x4875d2 of this['_pendingContextItems']['values']())if(_0x4875d2['resourceId']===_0x5b487c)return!0x0;for(const _0x2f3c47 of this['_conversationContextItems']['values']())if(_0x2f3c47['resourceId']===_0x5b487c)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x50376d){const _0x3444ec=[];for(const _0x51bd06 of this['_addContextOptionsState']['sources']){_0x51bd06['resources']['find'](_0x4cc081=>_0x4cc081['id']===_0x50376d)&&_0x3444ec['push'](_0x51bd06['id']);}return 0x0===_0x3444ec['length']?null:_0x3444ec;}['_updateResourceInContextState'](_0x31449c,_0x146540,_0x395794){const _0x23969c=this['_addContextOptionsState']['sources']['find'](_0x490857=>_0x490857['id']===_0x31449c);if(!_0x23969c)return;const _0x25049c=_0x23969c['resources']['find'](_0x3d143b=>_0x3d143b['id']===_0x146540);_0x25049c&&(_0x25049c['isInContext']=_0x395794,this['fire']('resourceStateChanged',{'sourceId':_0x31449c,'resourceId':_0x146540,'isInContext':_0x395794}));}['_startUploadOperation'](_0x49fc37){this['_ongoingUploadOperations']['set'](_0x49fc37,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x1ef602){this['_ongoingUploadOperations']['delete'](_0x1ef602),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const fi=['capabilitiesUpdated'];class Ii extends _0x19d98c(){['_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'](_0x385658){const _0x366661={};return _0x385658&&_0x385658['isWebSearchEnabled']&&(_0x366661['webSearch']={}),_0x385658&&_0x385658['isReasoningEnabled']&&(_0x366661['reasoning']={}),_0x366661;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x119dec){_0x119dec!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x119dec,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x54b211){_0x54b211!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x54b211,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Ci extends xe{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['quickActionData'];constructor(_0x3f1814){super(_0x3f1814),this['conversationId']=_0x3f1814['conversationId'],this['contextItems']=_0x3f1814['contextItems'],this['capabilities']=_0x3f1814['capabilities'],this['userMessage']=_0x3f1814['userMessage'],this['model']=_0x3f1814['model'],this['quickActionData']=_0x3f1814['quickActionData'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':wi['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Ii['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'quickActionData':this['quickActionData']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class Tt extends _0x19d98c(){['id'];['isStarted']=!0x1;['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x5e9d35){super(),this['options']=_0x5e9d35,this['connector']=_0x5e9d35['connector'],this['chatModels']=_0x5e9d35['chatModels'],this['id']=_0x5e9d35['conversationId'];}async['init'](_0x274811){try{this['chatContext']=new wi({'connector':this['connector'],'config':_0x274811,'ownerId':this['id']}),this['chatContext']['delegate'](...vi)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Ii(),this['chatCapabilities']['delegate'](...fi)['to'](this),this['chatCapabilities']['init']();const _0x2ca5d6=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x2ca5d6});const _0x5ec9a8=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x5ec9a8&&await this['setModel'](_0x5ec9a8);}catch(_0x8bb769){const _0x244af0=new _0x36b126('ai-chat-conversation-init-failed',null,{'message':_0x8bb769['message']||_0x8bb769});_0x244af0['stack']=_0x8bb769['stack'],this['fire']('error',{'error':_0x244af0});}}async['start'](){if(this['isStarted'])throw new _0x36b126('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x36b126('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x2fa657}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x2fa657,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x2bcea8){const _0x4c85ec=new _0x36b126('ai-chat-conversation-start-failed',null,{'message':_0x2bcea8['message'],'conversationId':this['id']});throw _0x4c85ec['stack']=_0x2bcea8['stack'],this['fire']('error',{'error':_0x4c85ec}),_0x4c85ec;}}async['load'](_0x835bb3,_0x313037){try{const _0x400346=await this['connector']['fetchConversation'](_0x835bb3)['getConversation'](),_0x2fa0d6=await this['connector']['fetchConversationMessages'](_0x835bb3)['getMessages'](),_0x12ff76=_0x2fa0d6[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x400346['id'],'title'in _0x400346?this['fire']('setConversationTitle',_0x400346['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x573d78=(await this['chatModels']['getAll']())['find'](_0x5c7965=>_0x5c7965['id']['toLowerCase']()===_0x12ff76['toLowerCase']());return this['selectedModel']=_0x573d78,this['fire']('modelSelected',{'selectedModel':_0x573d78,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x2fa0d6,_0x313037,_0x12ff76),this['currentInteraction']=void 0x0,this;}catch(_0x5901d6){const _0x4f3313=new _0x36b126('ai-chat-conversation-init-from-id-failed',null,{'message':_0x5901d6['message'],'conversationId':_0x835bb3});throw _0x4f3313['stack']=_0x5901d6['stack'],this['fire']('error',{'error':_0x4f3313}),_0x4f3313;}}async['_processMessagesToInteractions'](_0x5e74dd,_0x3dbd2e,_0x403062){let _0x3c1928;for(const _0xb2f075 of _0x5e74dd)if('user'===_0xb2f075['role']){const _0x569a9d=await this['_extractContextItems'](_0xb2f075),_0x1f549a={'isReasoningEnabled':Object['hasOwn'](_0xb2f075['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0xb2f075['capabilities'],'webSearch')};_0x3c1928=this['createInteraction']({'userMessage':_0xb2f075['prompt'],'contextItems':_0x569a9d,'capabilities':_0x1f549a,'modelId':_0x403062,'quickActionData':_0xb2f075['attributes']?.['quickActionData']}),this['currentInteraction']=_0x3c1928,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0xb2f075['role']&&_0x3c1928)for(const _0x508218 of _0xb2f075['content']){const _0x25d236='text'===_0x508218['type']?'text-delta':'modification-delta',_0x48c96b=_0x3c1928['getDocumentContext']()?.['sessionId']!==_0x3dbd2e;_0x3c1928['currentReply']=_0x3c1928['createReply']({'type':_0x25d236,'isDone':!0x0,'interactionId':_0x3c1928['id'],'areActionsDisabled':_0x48c96b}),_0x3c1928['currentReply']['appendContent'](_0x508218['content']);}}}async['_extractContextItems'](_0x4a9b4a){const _0x57a66b=new Map();if(!_0x4a9b4a['content'])return _0x57a66b;for(const _0x45d41b of _0x4a9b4a['content']){const _0x3c2e78=await this['chatContext']['populateFromMessage'](_0x45d41b);_0x3c2e78&&_0x57a66b['set'](_0x3c2e78['id'],_0x3c2e78);}return _0x57a66b;}async['handleUserInteraction']({userMessage:_0x347f14,quickActionData:_0xa20983}){if(!this['isStarted'])throw new _0x36b126('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x36b126('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x358b4d=this['chatContext']['getPendingContextItems'](),_0x8c8872=this['chatCapabilities']['getCapabilitiesConfig'](),_0x3ded3a=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x347f14,'contextItems':_0x358b4d,'capabilities':_0x8c8872,'modelId':_0x3ded3a,'quickActionData':_0xa20983}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x545c42){if(_0x545c42 instanceof _0x36b126)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x545c42});else{const _0x15a1cf=Fe['get'](_0x545c42['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new _0x36b126(_0x15a1cf,null,{'error':_0x545c42})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x33bd17,contextItems:_0x4c5b3d,capabilities:_0x3b2f7d,modelId:_0x54d15a,quickActionData:_0x5690c5}){const _0x10ee43=new Ci({'userMessage':_0x33bd17,'contextItems':_0x4c5b3d,'capabilities':_0x3b2f7d,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x54d15a,'quickActionData':_0x5690c5});return _0x10ee43['delegate'](...Ce)['to'](this),this['interactions']['push'](_0x10ee43),this['fire']('interactionCreated',_0x10ee43),_0x10ee43;}['getInteraction'](_0x4d11ee){return this['interactions']['find'](_0x5e9de6=>_0x5e9de6['id']===_0x4d11ee);}['removeInteraction'](_0x481da1){const _0x4de9c9=this['getInteraction'](_0x481da1);_0x4de9c9&&(_0x4de9c9['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x4de9c9),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x4e3918){this['chatContext']['addCurrentDocumentToContext'](_0x4e3918);}async['updateCurrentDocumentInContext']({content:_0x2a8424,version:_0x40b7f9,sessionId:_0x51b74d,selections:_0x56459e}){await this['chatContext']['updateCurrentDocument'](_0x2a8424,_0x40b7f9,_0x51b74d,_0x56459e);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x5f5850){this['chatContext']['addSelectionToContext'](_0x5f5850);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x519737){this['chatContext']['addFilesToContext'](_0x519737);}['addUrlToContext'](_0x599f65){this['chatContext']['addUrlToContext'](_0x599f65);}['addResourceToContext'](_0x4533d6,_0x302104){this['chatContext']['addResourceToContext'](_0x4533d6,_0x302104);}['loadSourceResources'](_0x50f969,_0x2f07ff,_0x3d8c8e){return this['chatContext']['loadSourceResources'](_0x50f969,_0x2f07ff,_0x3d8c8e);}['removeFromContext'](_0x379735){this['chatContext']['removeFromContext'](_0x379735);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x5a1f53){_0x5a1f53?!0x1===await this['chatModels']['isAvailable'](_0x5a1f53)&&(_0x3219ae('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x5a1f53}),_0x5a1f53=(await this['chatModels']['getAvailableModels']())[0x0]):(_0x3219ae('ai-chat-conversation-set-model-null',{'conversation':this}),_0x5a1f53=(await this['chatModels']['getAvailableModels']())[0x0]),_0x5a1f53['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x5a1f53,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x5a1f53}));}}function ut(_0x4a14a3){if(_0x4a14a3 instanceof _t)return _0x4a14a3;if(_0x4a14a3?.['editors']&&_0x4a14a3['editors']['get'](0x0))return _0x4a14a3['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.'),_0x4a14a3['editors']['get'](0x0);throw new _0x36b126('ai-get-editor-from-context-no-editor');}const It='ai-selection';class R extends ot{['_displayedFakeSelectionId']=null;['_displayedFakeSelectionLocked']=!0x1;['_sessionId'];static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['sessionId'](){if(!this['_sessionId']){const _0x4811af=ut(this['context']),_0x564308=_0x4811af['plugins']['has']('RealTimeCollaborationClient')&&_0x4811af['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x564308||_0xdc126c();}return this['_sessionId'];}['getDocumentData'](){const _0xcd3b6b=ut(this['context']),_0x42c3c7=_0xcd3b6b['model'],_0x360a86=_0xcd3b6b['data']['toView'](_0x42c3c7['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x7479f2=new Ft(_0xcd3b6b['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x360a86,_0x7479f2);let _0x3def2d=_0xcd3b6b['data']['processor']['toData'](_0x360a86);const _0x509016=this['_getMarkersInDocumentOrder'](),_0x43cbcd=[];for(const _0x7bc0dd of _0x509016){const _0x51bb8='<'+_0x7bc0dd['name']+':start></'+_0x7bc0dd['name']+':start>',_0x1409ce=_0x3def2d['indexOf'](_0x51bb8);_0x3def2d=_0x3def2d['substring'](0x0,_0x1409ce)+_0x3def2d['substring'](_0x1409ce+_0x51bb8['length']);const _0x134048='<'+_0x7bc0dd['name']+':end></'+_0x7bc0dd['name']+':end>',_0x2b7bd3=_0x3def2d['indexOf'](_0x134048);_0x3def2d=_0x3def2d['substring'](0x0,_0x2b7bd3)+_0x3def2d['substring'](_0x2b7bd3+_0x134048['length']),_0x43cbcd['push']({'markerName':_0x7bc0dd['name'],'start':_0x1409ce,'end':_0x2b7bd3,'htmlFragment':_0x3def2d['substring'](_0x1409ce,_0x2b7bd3)});}return{'content':_0x3def2d,'version':_0xcd3b6b['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x43cbcd};}async['afterInit'](){this['context']instanceof _t?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x350237,_0x48023f)=>{_0x48023f['on']('ready',()=>{this['_integrateEditor'](_0x48023f);});});}['_integrateEditor'](_0xa57537){_0xa57537['conversion']['for']('editingDowncast')['markerToHighlight']({'model':It,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0xa57537['conversion']['for']('dataDowncast')['markerToElement']({'model':It,'view':(_0x932b2a,{writer:_0x4842f7,options:_0x2a1719})=>_0x2a1719['convertAiChatSelectionMarker']?_0x4842f7['createUIElement'](_0x932b2a['markerName']+':'+(_0x932b2a['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x4a234a,_0xc73302,_0x2fdec4=!0x1,_0x171c11=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x171c11)return!0x1;const _0x13cfdd=ut(this['context'])['model'];return _0x13cfdd['change'](_0x5c64b3=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0xc73302,this['_displayedFakeSelectionLocked']=_0x2fdec4;let _0x3ddf08=0x0;for(let _0x1c140c of _0x4a234a){const _0x370249=It+':'+_0x3ddf08;if(_0x1c140c['start']['isAtEnd']){const _0x3bae49=_0x1c140c['start']['getLastMatchingPosition'](({item:_0x1a699e})=>!_0x13cfdd['schema']['isContent'](_0x1a699e),{'boundaries':_0x1c140c});_0x1c140c=_0x5c64b3['createRange'](_0x3bae49,_0x1c140c['end']);}_0x5c64b3['addMarker'](_0x370249,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1c140c}),_0x3ddf08++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x3a4ff0){if(this['_displayedFakeSelectionId']!=_0x3a4ff0)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x44284f=ut(this['context']),_0x1dc0ca=_0x44284f['model']['markers']['getMarkersGroup'](It);return _0x44284f['model']['change'](_0x288529=>{for(const _0x38d6e5 of _0x1dc0ca)_0x288529['removeMarker'](_0x38d6e5);}),!0x0;}['modelToViewWithIds'](_0x1df521){const _0x49ae64=ut(this['context']),_0x14818d=_0x49ae64['data']['toView'](_0x1df521),_0x437834=new Ft(_0x49ae64['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x14818d,_0x437834),_0x14818d;}['_setDataIdsOnChildren'](_0x4c2d52,_0x1bff85){let _0x345f16=!0x1;const _0x482b4b=new Set();for(const _0x5ad649 of _0x4c2d52['getChildren']()){const _0x3b2bcb=_0x5ad649['is']('emptyElement')||_0x5ad649['is']('containerElement');if(!_0x5ad649['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x5ad649,_0x1bff85)||_0x3b2bcb)&&(_0x1bff85['setAttribute']('data-id',this['_nextDataId'](_0x482b4b),_0x5ad649),_0x345f16=!0x0);}return _0x345f16;}['_nextDataId'](_0x1d3646){let _0x3ea80d;do{_0x3ea80d='';for(let _0x1a0c3f=0x0;_0x1a0c3f<0x4;_0x1a0c3f++)_0x3ea80d+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x1d3646['has'](_0x3ea80d));return _0x1d3646['add'](_0x3ea80d),_0x3ea80d;}['getSelectionText'](){const {model:_0x4127d3}=ut(this['context']),_0x292285=_0x4127d3['document']['selection'],_0x4c825a=_0x4127d3['getSelectedContent'](_0x292285),_0x435d73=[],_0x4fc32e=_0x4127d3['createRangeIn'](_0x4c825a)['getWalker']();for(const {item:_0x154091}of _0x4fc32e)_0x154091['is']('$textProxy')?_0x435d73['push'](_0x154091['data']):_0x154091['is']('element')&&_0x435d73['length']>0x0&&'\x20'!==_0x435d73[_0x435d73['length']-0x1]&&_0x435d73['push']('\x20');return'\x22'+_0x435d73['join']('')['trim']()+'\x22';}['_getMarkersInDocumentOrder'](){const _0x241fed=ut(this['context'])['model'];return Array['from'](_0x241fed['markers']['getMarkersGroup'](It))['sort']((_0x5a8b4a,_0x2be942)=>_0x5a8b4a['getStart']()['isBefore'](_0x2be942['getStart']())?-0x1:_0x5a8b4a['getStart']()['isAfter'](_0x2be942['getStart']())?0x1:0x0);}}const et=['applySuggestion','insertSuggestion','showChangeInText'];class ah extends _0x43effc{['actionsButton'];['children'];['applySuggestionModel'];['showChangeInTextModel'];['insertSuggestionModel'];['_partsCount']=0x1;['_dropdownOriginalConfig'];['_dropdownCurrentConfig'];['_firstRender']=!0x0;constructor(_0xc432a0,_0x42e192){super(_0xc432a0),this['_dropdownOriginalConfig']=_0x42e192||[...et],this['_dropdownCurrentConfig']=[...this['_dropdownOriginalConfig']];const _0x17e0da=this['bindTemplate'];this['set']('isEnabled',!0x0),this['set']('isVisible',!0x0),this['set']('isTrackChangesOn',!0x1),this['applySuggestionModel']=new _0x3344bf({'label':Pn('applySuggestion',_0xc432a0,this['_partsCount']),'icon':_0x3cb840,'withText':!0x0,'type':'button','actionName':'applySuggestion'}),this['showChangeInTextModel']=new _0x3344bf({'label':Pn('showChangeInText',_0xc432a0,this['_partsCount']),'icon':_0x4e4a4d,'withText':!0x0,'type':'button','actionName':'showChangeInText'}),this['insertSuggestionModel']=new _0x3344bf({'label':Pn('insertSuggestion',_0xc432a0,this['_partsCount']),'icon':_0x5a38fc,'withText':!0x0,'type':'button','actionName':'insertSuggestion'}),this['actionsButton']=this['_createActionsDropdownOrButton'](_0xc432a0),this['children']=this['createCollection'](),this['actionsButton']&&this['children']['add'](this['actionsButton']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x17e0da['if']('isVisible','ck-hidden',_0x5a77af=>!_0x5a77af)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_dropdownCurrentConfig']=this['isTrackChangesOn']?this['_dropdownOriginalConfig']['filter'](_0x4855bc=>'applySuggestion'!==_0x4855bc):[...this['_dropdownOriginalConfig']],this['_updateDropdownActions'](_0xc432a0);});}['_updateDropdownActions'](_0x58a824){this['actionsButton']&&this['children']['has'](this['actionsButton'])&&(this['children']['remove'](this['actionsButton']),this['actionsButton']['destroy']()),this['actionsButton']=this['_createActionsDropdownOrButton'](_0x58a824),this['actionsButton']&&this['children']['add'](this['actionsButton']);}['_createActionsDropdownOrButton'](_0x4e1909){if(0x0==this['_dropdownCurrentConfig']['length'])return null;const _0x425171=0x1===this['_dropdownCurrentConfig']['length']?this['_createActionsButton'](_0x4e1909):this['_createActionsDropdown'](_0x4e1909),_0x292388=this['_firstRender']?'':'ck-ai-chat__feed__ai-suggestion__actions--no-animation';_0x425171['set']({'label':Pn(this['_dropdownCurrentConfig'][0x0],_0x4e1909,this['_partsCount']),'tooltip':Hn(this['_dropdownCurrentConfig'][0x0],_0x4e1909,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions\x20'+_0x292388});for(const _0x2f9551 of this['_dropdownCurrentConfig'])_0x425171['on'](_0x2f9551,()=>{this['fire'](_0x2f9551);});return this['_firstRender']=!0x1,_0x425171;}['_createActionsButton'](_0x583655){const _0x3f56be=new _0xcbb426(_0x583655);return _0x3f56be['set']({'class':'ck-ai-button-primary','withText':!0x0}),_0x3f56be['on']('execute',()=>{_0x3f56be['fire'](this['_dropdownCurrentConfig'][0x0]);}),_0x3f56be;}['_createActionsDropdown'](_0x2e4ead){const _0x2807d9=new Nn(_0x2e4ead,{'listItemModels':this['_dropdownCurrentConfig']['map'](_0x56eb7b=>{switch(_0x56eb7b){case'applySuggestion':return this['applySuggestionModel'];case'showChangeInText':return this['showChangeInTextModel'];case'insertSuggestion':return this['insertSuggestionModel'];}})});return _0x2807d9['set']({'label':Pn(this['_dropdownCurrentConfig'][0x0],_0x2e4ead,this['_partsCount']),'tooltip':Hn(this['_dropdownCurrentConfig'][0x0],_0x2e4ead,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions','balloonPanelClass':'ck-ai-chat__feed__ai-suggestion__actions__balloon'}),_0x2807d9['bind']('isEnabled')['to'](this),_0x2807d9;}['updateLabels'](_0x2ecf40){const _0x43befd=this['locale'];this['_partsCount']=_0x2ecf40||this['_partsCount'],this['actionsButton']['set']({'label':Pn(this['_dropdownCurrentConfig'][0x0],_0x43befd,this['_partsCount']),'tooltip':Hn(this['_dropdownCurrentConfig'][0x0],_0x43befd,this['_partsCount'])}),this['applySuggestionModel']['label']=Pn('applySuggestion',_0x43befd,this['_partsCount']),this['showChangeInTextModel']['label']=Pn('showChangeInText',_0x43befd,this['_partsCount']),this['insertSuggestionModel']['label']=Pn('insertSuggestion',_0x43befd,this['_partsCount']);}}class Nn extends _0x25f6a8{['bodyCollection'];['balloonPanelView'];['listView'];['keystrokeHandler'];constructor(_0x379f12,_0x234116){super(_0x379f12),this['balloonPanelView']=new _0x2ae23a(this['locale']),this['bodyCollection']=new _0x44dc72(this['locale']),this['bodyCollection']['attachToDom'](),this['set']('balloonPanelClass',''),this['balloonPanelView']['bind']('class')['to'](this,'balloonPanelClass'),this['listView']=this['_setUpList'](_0x234116['listItemModels']['slice'](0x1)),this['bodyCollection']['add'](this['balloonPanelView']),this['balloonPanelView']['content']['add'](this['listView']),this['arrowView']['unbind']('tooltip'),this['arrowView']['set']('tooltip',i(this['locale'],'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP')),this['_setUpKeystrokes'](),this['on']('execute',()=>{const _0xbace12=_0x234116['listItemModels'][0x0]['actionName'];this['fire'](_0xbace12),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),this['on']('open',()=>{this['balloonPanelView']['isVisible']?(this['balloonPanelView']['hide'](),this['arrowView']['focus']()):(this['balloonPanelView']['pin']({'target':this['element'],'positions':['ltr'===this['locale']['uiLanguageDirection']?Gn:yn]}),this['listView']['focus']());}),_0x4b855c({'emitter':this['balloonPanelView'],'callback':()=>{this['balloonPanelView']['hide']();},'activator':()=>this['balloonPanelView']['isVisible'],'contextElements':()=>[this['element'],this['balloonPanelView']['element']]});}['_setUpList'](_0x2d4aae){const _0x5bcfa0=this['locale'],_0x44ab7e=new _0x5bd1ba(_0x5bcfa0);for(const _0x46f1ce of _0x2d4aae){const _0x1c4383=new _0x3f0116(_0x5bcfa0),_0x4ddb39=new _0x2ab14c(_0x5bcfa0);_0x4ddb39['bind'](...Object['keys'](_0x46f1ce))['to'](_0x46f1ce),_0x4ddb39['delegate']('execute')['to'](_0x44ab7e),_0x1c4383['children']['add'](_0x4ddb39),_0x44ab7e['items']['add'](_0x1c4383);}return _0x44ab7e['items']['delegate']('execute')['to'](this),_0x44ab7e['on']('execute',_0x110fa9=>{const _0xe65d0a=_0x110fa9['source'];this['fire'](_0xe65d0a['actionName']),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),_0x44ab7e;}['_setUpKeystrokes'](){this['keystrokeHandler']=new _0xfe6d51(),this['keystrokeHandler']['listenTo'](this['balloonPanelView']['element']),this['keystrokeHandler']['set']('esc',(_0x176590,_0x518ec4)=>{this['balloonPanelView']['hide'](),this['arrowView']['focus'](),_0x518ec4();});}['destroy'](){super['destroy'](),this['keystrokeHandler']['destroy'](),this['balloonPanelView']['destroy'](),this['bodyCollection']['detachFromDom']();}}function Gn(_0x2b012e){return{'top':_0x2b012e['bottom'],'left':_0x2b012e['left'],'name':'arrowless','config':{'withArrow':!0x1}};}function yn(_0x1dc332,_0x5ddcea){return{'top':_0x1dc332['bottom'],'left':_0x1dc332['left']-(_0x5ddcea['width']-_0x1dc332['width']),'name':'arrowless','config':{'withArrow':!0x1}};}function Pn(_0x51d472,_0x196888,_0x4d2ad5){switch(_0x51d472){case'applySuggestion':return i(_0x196888,'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL',_0x4d2ad5);case'showChangeInText':return i(_0x196888,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT',_0x4d2ad5);case'insertSuggestion':return i(_0x196888,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION',_0x4d2ad5);}}function Hn(_0x389d68,_0x2f52b4,_0x4b1853){switch(_0x389d68){case'applySuggestion':return i(_0x2f52b4,'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP',_0x4b1853);case'showChangeInText':return i(_0x2f52b4,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP',_0x4b1853);case'insertSuggestion':return i(_0x2f52b4,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP',_0x4b1853);}}class At extends _0x19d98c(){['_connector'];['_availableModels'];['_defaultModelId'];['_locale'];['_modelList']=[];constructor({connector:_0x58dfa8,availableModels:_0x47d77c,defaultModelId:_0x3e9298,locale:_0xed423a}){super(),this['_connector']=_0x58dfa8,this['_availableModels']=_0x47d77c,this['_defaultModelId']=_0x3e9298,this['_locale']=_0xed423a;}async['getAll'](){if(!this['_modelList']['length'])try{const _0x41400b=this['_locale']['uiLanguage']||'en',_0x4776c2=this['_connector']['getModels'](_0x41400b),_0x483cf4=await _0x4776c2['list']();this['_modelList']=_0x483cf4['items']['map'](_0x9564c4=>ze(_0x9564c4)?{..._0x9564c4,'name':i(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x9564c4);}catch(_0x41b7b4){throw ft('ai-models-unable-to-retrieve',{'error':_0x41b7b4}),_0x41b7b4;}return[...this['_modelList']];}async['getAvailableModels'](){const _0x216a37=await this['getAll']();return this['_filterModels'](_0x216a37,this['_availableModels']);}async['getModel'](_0x5a32e1){const _0x26921e=await this['getAll']();if(!_0x26921e['length'])return null;if(_0x5a32e1){const _0x34a1d0=this['_getModelById'](_0x26921e,_0x5a32e1);if(_0x34a1d0)return _0x34a1d0;_0x3219ae('ai-chat-model-id-unrecognized',{'modelId':_0x5a32e1,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x1ed004=await this['getAvailableModels']();if(!_0x1ed004['length'])return null;if(this['_defaultModelId']){const _0x40d211=this['_getModelById'](_0x1ed004,this['_defaultModelId']);if(_0x40d211)return _0x40d211;_0x3219ae('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x1ed004[0x0]['id']});}return _0x1ed004[0x0];}async['isAvailable'](_0x86fe2b){return(await this['getAvailableModels']())['some'](_0x247b98=>_0x247b98['name']===_0x86fe2b['name']&&_0x247b98['provider']===_0x86fe2b['provider']);}['_filterModels'](_0xb38136,_0xb372ed){let _0x3cb768;if(_0xb372ed){_0x3cb768=[];const _0x5abf15='string'==typeof _0xb372ed?[_0xb372ed['toLocaleLowerCase']()]:_0xb372ed['map'](_0x5ce9b6=>_0x5ce9b6['toLocaleLowerCase']());for(const _0x593475 of _0x5abf15)for(const _0x27ecec of _0xb38136)(_0x27ecec['id']['toLocaleLowerCase']()===_0x593475||_0x27ecec['name']['toLocaleLowerCase']()===_0x593475||ze(_0x27ecec)&&'auto'===_0x593475||_0x27ecec['provider']['toLocaleLowerCase']()===_0x593475||_0x27ecec['id']['toLocaleLowerCase']()['startsWith'](_0x593475))&&_0x3cb768['push'](_0x27ecec);}else _0x3cb768=_0xb38136;return _0x3cb768;}['_getModelById'](_0x2f98c4,_0x26bacd){return _0x2f98c4['find'](_0x20b9a6=>ze(_0x20b9a6)&&'auto'===_0x26bacd?_0x20b9a6:_0x20b9a6['id']===_0x26bacd)||null;}}function ze(_0x2572ba){return _0x2572ba['id']['startsWith']('agent');}function z({editor:_0x55987a,interaction:_0x2e0d55,reply:_0x30f479,groups:_0x43cf36,transform:_0x244737,documentCompare:_0x4c9e0b,documentCompareOptions:_0x2ca538}){const _0x18bf1a=_0x2e0d55['getDocumentContext']();if(!_0x18bf1a)return[];const _0x120b48=_0x18bf1a['content'],_0x1e68d7=_0x18bf1a['version'],_0x190f98=_0x30f479['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x1252cf}of _0x43cf36){const _0x4540d0=_0x1252cf['filter'](_0x26fa78=>'new'!=_0x26fa78['type'])['map'](_0x48c3ea=>Dt('data-id',_0x48c3ea['id'],_0x190f98)),_0x19f63b=_0x1252cf['filter'](_0x3a3b2b=>'removed'!=_0x3a3b2b['type'])['map'](_0x447d41=>_0x447d41['node']['cloneNode'](!0x0));let _0x4fa7b2=null;if(_0x4540d0['length']){_0x4fa7b2=_0x4540d0[0x0]['previousSibling'];for(let _0xe5a0a0=0x0;_0xe5a0a0<_0x4540d0['length'];_0xe5a0a0++)_0x1b183f(_0x4540d0[_0xe5a0a0]);}if(_0x19f63b['length']){_0x4fa7b2||(_0x1252cf[0x0]['anchorId']?_0x4fa7b2=Dt('data-id',_0x1252cf[0x0]['anchorId'],_0x190f98):(_0x4fa7b2=_0x19f63b['shift'](),_0x377b76(_0x190f98,_0x4fa7b2)));for(let _0x2192f8=0x0;_0x2192f8<_0x19f63b['length'];_0x2192f8++)_0x2301a3(_0x4fa7b2,_0x19f63b[_0x2192f8]),_0x4fa7b2=_0x19f63b[_0x2192f8];}}const _0xba0cf5=Ot(_0x190f98),_0x4fdcad=_0x4c9e0b['getDiff'](_0x120b48,_0xba0cf5,_0x2ca538)['getOperations']();if(_0x244737){const _0x4f35a1=_0x55987a['model']['document']['history']['getOperations'](_0x1e68d7),_0x35fff0={'document':_0x55987a['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return st(_0x4fdcad,_0x4f35a1,_0x35fff0)['operationsA'];}return _0x4fdcad;}function Y(_0x1d5411,_0x2d73f1){if('marker'!=_0x2d73f1['type'])return;const _0x556721=_0x1d5411['model']['markers']['get'](_0x2d73f1['name']);_0x556721&&(_0x2d73f1['oldRange']=_0x556721['getRange']());}class Lr extends _0x312a64{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x4fd133,_0x30b134={},_0x2a931a){super(_0x4fd133),this['set']('isLoading',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x30b134};const _0x1a1685=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x1a1685?'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'](_0x2a931a),this['items']['add'](this['showChangesButton'])),this['_setupRatingButtons'](),this['_config']['showLike']&&this['items']['add'](this['likeButton']),this['_config']['showDislike']&&this['items']['add'](this['dislikeButton']),this['_config']['customView']&&this['items']['addMany'](this['_config']['customView']);}['_setupRatingButtons'](){this['likeButton']=new _0xcbb426(this['locale']),this['likeButton']['set']({'icon':_0x526026,'label':i(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x52b3ce=>!_0x52b3ce),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0xcbb426(this['locale']),this['dislikeButton']['set']({'icon':_0xbf231a,'label':i(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x52b3ae=>!_0x52b3ae),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0xcbb426(this['locale']),this['copyButton']['set']({'icon':_0x2178ff,'label':i(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x30dd65=>!_0x30dd65);const _0x2ad00d=new _0x4caa0b();_0x2ad00d['set']({'content':_0x16fc5d}),_0x2ad00d['extendTemplate']({'attributes':{'class':['ck-ai-mini-toolbar-copy-button__check-mark']}}),this['copyButton']['on']('execute',()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20ck-ai-mini-toolbar-copy-button_copied',setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button';},0x7d0);}),this['copyButton']['children']['add'](_0x2ad00d);}['_setupShowChangesButton'](_0xb46260){this['showChangesButton']=new _0xcbb426(this['locale']),this['showChangesButton']['set']({'icon':_0x24690e,'label':i(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'isOn':_0xb46260}),this['showChangesButton']['bind']('isEnabled')['to'](this,'isLoading',_0x57b031=>!_0x57b031),this['showChangesButton']['on']('execute',()=>{const _0x50c633=!this['showChangesButton']['isOn'];this['showChangesButton']['set']({'isOn':_0x50c633,'icon':_0x50c633?_0x4c508d:_0x24690e}),this['fire']('toggleShowChanges',_0x50c633);});}}class Tr extends _0x43effc{['showChangesToggleView'];constructor(_0x3f6946,_0x14b3d7){super(_0x3f6946),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Yr(_0x3f6946),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':i(_0x3f6946,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x14b3d7['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x5ea7e0=>_0x5ea7e0?_0x44c63f:_0x4f3f9b),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x38aed3=new _0x4caa0b();_0x38aed3['content']=_0x193d2b,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x14b3d7['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x38aed3,{'tag':'span','children':[i(_0x3f6946,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Yr extends _0xcbb426{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}class ha{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;constructor(_0x27f5cc){this['options']={'delay':_0x27f5cc['delay']??0x14,'textNodeStyle':_0x27f5cc['textNodeStyle'],'onStreamUpdate':_0x27f5cc['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x49b23c,targetElement:_0x466ac0,abortSignal:_0x2ac3e0}){this['isStreaming']&&this['stop'](),_0x2ac3e0?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0xdcae32(_0x49b23c,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(_0x3219ae('ai-html-streamer-current-index-out-of-bounds',{'currentIndex':this['currentIndex'],'nodeList':this['nodesList']}),this['currentIndex']=this['nodesList']['length']);for(let _0x22ff61=0x0;_0x22ff61<this['currentIndex'];_0x22ff61++)this['nodesList'][_0x22ff61]['shouldBeStreamed']=!0x0;let _0x4c5bb9=0x0;for(let _0x4ebcf5=this['currentIndex'];_0x4ebcf5<this['nodesList']['length'];_0x4ebcf5++){const _0x4c6e4b=Date['now'](),_0x1ce9e4=this['nodesList'][_0x4ebcf5],_0x5ce969=_0x4c6e4b-_0x4c5bb9;_0x1ce9e4['shouldBeStreamed']=!0x0;let _0x1b6482=_0x1ce9e4['parent'];for(;_0x1b6482;)_0x1b6482['shouldBeStreamed']=!0x0,_0x1b6482=_0x1b6482['parent'];if(_0x5ce969<this['options']['delay'])try{const {promise:_0xdca0d9,abortController:_0x5b6059}=pr(this['options']['delay']-_0x5ce969);this['timeoutAbortController']=_0x5b6059,await _0xdca0d9;}catch(_0x4b6643){return;}_0x34c121(_0x466ac0,'<'+_0x466ac0['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x466ac0['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']=_0x4ebcf5,_0x4c5bb9=Date['now']();}this['isStreaming']=!0x1;}['cleanUpAnimations']({targetElement:_0x559319}){Array['from'](_0x559319['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x41194=>{_0x41194['replaceWith'](_0x41194['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x21964c){let _0x245a7c='';if(function(_0x25ca3a){return _0x59f677(_0x25ca3a);}(_0x21964c)){for(const _0x2fbe30 of _0x21964c['children'])_0x245a7c+=this['renderNode'](_0x2fbe30);}else{if(dr(_0x21964c)){if(!_0x21964c['shouldBeStreamed'])return'';const _0xb8bb0f=_0x21964c,_0x121952=Object['entries'](_0xb8bb0f['attribs'])['map'](([_0x362b1c,_0x4be4ad])=>_0x362b1c+'=\x22'+_0x4be4ad+'\x22')['join']('\x20');_0x245a7c+='<'+_0xb8bb0f['tagName']+(_0x121952?'\x20'+_0x121952:'')+'>';for(const _0x338f1e of _0x2bc64a(_0xb8bb0f))_0x245a7c+=this['renderNode'](_0x338f1e);_0x245a7c+='</'+_0xb8bb0f['tagName']+'>';}else{if(!ar(_0x21964c))return'';if(!_0x21964c['shouldBeStreamed'])return'';!function(_0x864f8e){if(!_0x864f8e['parent']||!dr(_0x864f8e['parent']))return!0x1;if(!cr['includes'](_0x864f8e['parent']['tagName']))return!0x1;return!_0x1f24f8(_0x864f8e)['match'](/^\s*[<>]\s*$/);}(_0x21964c)?_0x245a7c+=_0x4b71ff(_0x21964c):_0x245a7c+=_0x4b71ff(new _0xec973e('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x21964c]));}}return _0x245a7c;}['getParsedDocumentNodeList'](){const _0x329699=[];return function(_0x5bd166,_0x603e6b){const _0x129d97=_0x4ba272=>{if(_0x603e6b(_0x4ba272),_0x4ba272 instanceof _0x1f4fb6)for(let _0x494b1f=0x0;_0x494b1f<_0x4ba272['children']['length'];_0x494b1f++){const _0x252e58=_0x4ba272['children'][_0x494b1f];_0x129d97(_0x252e58);}};for(let _0x26e2fb=0x0;_0x26e2fb<_0x5bd166['children']['length'];_0x26e2fb++)_0x129d97(_0x5bd166['children'][_0x26e2fb]);}(this['document'],_0x4f4f09=>{if(ar(_0x4f4f09)){const _0x3689d7=this['splitTextNodeIntoWordNodes'](_0x4f4f09);_0x3689d7['length']&&_0x329699['push'](..._0x3689d7);}_0x4f4f09['isWordSplitSource']||_0x4f4f09['isWordSplitResult']||_0x329699['push'](_0x4f4f09);}),_0x329699;}['splitTextNodeIntoWordNodes'](_0xc4024e){if(_0xc4024e['isWordSplitSource']||_0xc4024e['isWordSplitResult'])return[];const _0x547e87=_0x1f24f8(_0xc4024e)['match'](/(?:\s*\S+\s*)/g),_0x3494d7=[];if(_0x547e87&&_0x547e87['length']>0x1){for(const _0x3e298d of _0x547e87){const _0x23a7cc=new _0x4e1833(_0x3e298d);_0x23a7cc['isWordSplitResult']=!0x0,_0x4c7871(_0xc4024e,_0x23a7cc),_0x3494d7['push'](_0x23a7cc);}_0xc4024e['isWordSplitSource']=!0x0,_0x1b183f(_0xc4024e);}return _0x3494d7;}}const cr=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function ar(_0x444d31){return _0xa705c(_0x444d31);}function dr(_0x569be2){return _0x499346(_0x569be2);}function pr(_0x2a6d69){const _0x5de601=new AbortController();return{'promise':new Promise((_0x3a3e12,_0x5e53bb)=>{const _0x1973dd=setTimeout(_0x3a3e12,_0x2a6d69);_0x5de601['signal']['addEventListener']('abort',()=>{clearTimeout(_0x1973dd),_0x5e53bb();});}),'abortController':_0x5de601};}const Ee=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'];class na extends _0x43effc{['htmlStreamer'];['children'];['headerView'];['contentView'];constructor(_0x185ecf,{part:_0x54b350,uiIndex:_0x4c9625,areActionsDisabled:_0x38298e,availableActions:_0x56989b}){super(_0x185ecf),this['set']('partDefinition',_0x54b350),this['set']('state','pending'),this['set']('isVisible',!0x1),this['bind']('isEnabled')['to'](this,'state',_0x46f71e=>'pending'==_0x46f71e&&!_0x38298e),this['children']=this['createCollection'](),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['headerView']=new Un(_0x185ecf,{'part':_0x54b350,'uiIndex':_0x4c9625,'availableActions':_0x56989b}),this['headerView']['bind']('partDefinition')['to'](this),this['headerView']['bind']('isEnabled')['to'](this),this['headerView']['bind']('state')['to'](this),this['headerView']['delegate'](...Ee)['to'](this);const _0x496cf2=this['bindTemplate'];this['contentView']=new _0x43effc(),this['contentView']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__content']}}),this['children']['addMany']([this['contentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x496cf2['to']('state',_0x436b30=>'ck-ai-suggestion__body__content-part_'+_0x436b30),_0x496cf2['to']('isEnabled',_0xdfc4e6=>_0xdfc4e6?'ck-ai-suggestion__body__content-part_active':void 0x0),_0x496cf2['if']('isVisible','ck-hidden',_0x5af501=>!_0x5af501)]},'children':this['children'],'on':{'mouseenter':_0x496cf2['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x54b350['index']});}),'mouseleave':_0x496cf2['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x54b350['index']});})}});}async['updateContent']({part:_0x5f0639,renderingStrategy:_0x142869,showUnchangedParts:_0x531d25=!0x1,abortSignal:_0x227a6d}){this['partDefinition']=_0x5f0639,this['isVisible']=this['partDefinition']['hasChanges']||_0x531d25,this['isVisible']&&('streaming'===_0x142869?await this['htmlStreamer']['stream']({'document':this['partDefinition']['content'],'targetElement':this['contentView']['element'],'abortSignal':_0x227a6d}):this['contentView']['element']['innerHTML']=Ot(this['partDefinition']['content']));}['toggleHeader'](_0x3cb42f){_0x3cb42f?this['children']['has'](this['headerView'])||this['children']['add'](this['headerView'],0x0):this['children']['has'](this['headerView'])&&this['children']['remove'](this['headerView']);}}class Un extends _0x43effc{['children'];['_toolbarView'];['_iconStateAccepted'];['_iconStateRejected'];['_iconStateOutdated'];constructor(_0x399e95,{part:_0x46f1a4,uiIndex:_0x299cee,availableActions:_0x43e3a1}){super(_0x399e95),this['set']('partDefinition',_0x46f1a4),this['set']('isEnabled',!0x0),this['set']('state','pending');const _0x245a73=new _0x4caa0b();_0x245a73['content']=_0x2fb154,_0x245a73['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-title']}});const _0x30040e=[];if(_0x43e3a1['includes']('showChangeInText')){const _0x570e40=new _0xcbb426(_0x399e95);_0x570e40['set']({'label':i(_0x399e95,'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT'),'tooltip':!0x0,'withText':!0x1,'icon':_0x4e4a4d}),_0x570e40['bind']('isEnabled')['to'](this),_0x570e40['on']('execute',()=>{this['fire']('showChangeInText',{'index':_0x46f1a4['index']});}),_0x30040e['push'](_0x570e40);}if(_0x43e3a1['includes']('insertSuggestion')){const _0x592d0c=new _0xcbb426(_0x399e95);_0x592d0c['set']({'label':i(_0x399e95,'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION'),'tooltip':!0x0,'withText':!0x1,'icon':_0x5a38fc}),_0x592d0c['bind']('isEnabled')['to'](this),_0x592d0c['on']('execute',()=>{this['fire']('insertSuggestion',{'index':_0x46f1a4['index']});}),_0x30040e['push'](_0x592d0c);}const _0x164cd6=new _0xcbb426(_0x399e95);_0x164cd6['set']({'label':i(_0x399e95,'AI_SUGGESTION_CONTENT_PART_DELETE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x5472b4}),_0x164cd6['bind']('isEnabled')['to'](this),_0x164cd6['on']('execute',()=>{this['fire']('rejectSuggestion',{'index':_0x46f1a4['index']});}),_0x30040e['push'](_0x164cd6),this['_toolbarView']=new _0x312a64(_0x399e95),this['_toolbarView']['items']['addMany'](_0x30040e),this['_iconStateAccepted']=new _0x4caa0b(),this['_iconStateAccepted']['content']=_0x411438,this['_iconStateAccepted']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-accepted'],'data-cke-tooltip-text':i(_0x399e95,'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED'),'data-cke-tooltip-position':'n'}}),this['_iconStateRejected']=new _0x4caa0b(),this['_iconStateRejected']['content']=_0x4b0f8d,this['_iconStateRejected']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-rejected'],'data-cke-tooltip-text':i(_0x399e95,'AI_SUGGESTION_CONTENT_PART_REJECTED'),'data-cke-tooltip-position':'n'}}),this['_iconStateOutdated']=new _0x4caa0b(),this['_iconStateOutdated']['content']=_0x4b0f8d,this['_iconStateOutdated']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-outdated'],'data-cke-tooltip-text':i(_0x399e95,'AI_SUGGESTION_CONTENT_PART_OUTDATED'),'data-cke-tooltip-position':'n'}});const _0x2f7dfd=new _0x43effc(_0x399e95);_0x2f7dfd['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[i(_0x399e95,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x299cee['toString']())]}),this['children']=this['createCollection'](),this['children']['addMany']([_0x245a73,_0x2f7dfd,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',(_0x194433,_0x56c5e2,_0x5491f7,_0xb9f795)=>{switch(_0xb9f795){case'pending':this['children']['remove'](this['_toolbarView']);break;case'accepted':this['children']['remove'](this['_iconStateAccepted']);break;case'rejected':this['children']['remove'](this['_iconStateRejected']);break;case'outdated':this['children']['remove'](this['_iconStateOutdated']);}switch(_0x5491f7){case'pending':this['children']['add'](this['_toolbarView']);break;case'accepted':this['children']['add'](this['_iconStateAccepted']);break;case'rejected':this['children']['add'](this['_iconStateRejected']);break;case'outdated':this['children']['add'](this['_iconStateOutdated']);}});}}class W extends _0x19d98c(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x49fb90){const _0x4d0f25=this['createTask'](_0x49fb90);return this['queue']['push'](_0x4d0f25),this['_processQueue'](),_0x4d0f25['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(_0x5989f3=>{this['once']('_queueEmpty',()=>{_0x5989f3();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x1cea8e=this['queue']['shift']();try{await _0x1cea8e['callback'](this['_abortController']['signal']),_0x1cea8e['resolve']();}catch(_0x510ea2){_0x1cea8e['reject'](_0x510ea2);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x4f0a74){let _0x40f4e6,_0x5d7249;const _0x3571d7=new Promise((_0xcfbf8a,_0x26b005)=>{_0x40f4e6=_0xcfbf8a,_0x5d7249=_0x26b005;});return{'callback':_0x4f0a74,'resolve':_0x40f4e6,'reject':_0x5d7249,'completePromise':_0x3571d7};}}class Fr extends _0x43effc{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0xb1c7da){super();const _0x4caea2=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0xb1c7da,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x4caea2['if']('isDone','ck-ai-chat__feed__item_done'),_0x4caea2['if']('isVisible','ck-hidden',_0x4c39ab=>!_0x4c39ab),'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'](_0x11126b=>{_0x11126b['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x406484,_0x36530c,_0x5a79e2){await this['htmlStreamer']['stream']({'document':_0x406484,'targetElement':_0x36530c,'abortSignal':_0x5a79e2});}}class Oe extends Fr{constructor(_0x3e7d76){super(_0x3e7d76),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x3e7d76['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x413972){this['element']['innerHTML']=_0x413972;}}class Dr extends _0x43effc{['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x5b726e,_0x5d5d2a){super(_0x5b726e);const {areActionsDisabled:_0x2552e6,showUnchangedParts:_0x11dd2b,availableActions:_0x487da9}=_0x5d5d2a;this['_areActionsDisabled']=_0x2552e6,this['_showUnchangedParts']=_0x11dd2b,this['_availableActions']=_0x487da9,this['set']('hasPendingParts',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new W(),this['_emptyPartsWarningView']=new Oe({'id':'empty-parts-warning','initialContent':i(_0x5b726e,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0x5f3908,renderingStrategy:_0xd80f06,abortSignal:_0x310e4c}){this['_children']['length']?_0x5f3908['forEach'](_0xa19437=>{const _0x217151=this['_cachedContentParts']['findIndex'](_0x5135e8=>_0x5135e8['index']==_0xa19437['index']);-0x1===_0x217151?this['_cachedContentParts']['push'](_0xa19437):this['_cachedContentParts'][_0x217151]=_0xa19437;}):this['_cachedContentParts']=_0x5f3908;for(const _0x4d683c of _0x5f3908['filter'](_0x180d8f=>_0x180d8f['hasChanges']))this['_updateContentPartsPromiseQueue']['enqueue'](async _0x2cc9c0=>{let _0x3f8de1=this['getPartView'](_0x4d683c['index']);_0x3f8de1||(_0x3f8de1=new na(this['locale'],{'part':_0x4d683c,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x3f8de1['delegate'](...Ee)['to'](this),this['_children']['add'](_0x3f8de1),this['hasPendingParts']=!0x0),0x2===this['_children']['length']&&this['_children']['first']['toggleHeader'](!0x0),_0x3f8de1['toggleHeader'](this['_children']['length']>0x1),await _0x3f8de1['updateContent']({'part':_0x4d683c,'renderingStrategy':_0xd80f06,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x2cc9c0});});return _0x310e4c?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x15c20e,_0x52776c){const _0x5164ff=this['getPartView'](_0x15c20e);_0x5164ff&&(_0x5164ff['state']=_0x52776c),this['hasPendingParts']='pending'==_0x52776c||Array['from'](this['_children'])['some'](_0x4c0d3e=>'pending'==_0x4c0d3e['state']);}['getPartView'](_0x4bbd65){return this['_children']['find'](_0x4a9bca=>_0x4a9bca['partDefinition']['index']==_0x4bbd65)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x4f1ca1=!this['_cachedContentParts']['find'](({hasChanges:_0x251372})=>_0x251372),_0x1ce9a0=!!this['_cachedContentParts']['find'](({hasChanges:_0xe7dded})=>!_0xe7dded);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x1ce9a0,_0x4f1ca1?this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}}get['hasNonEmptyParts'](){return!!this['_children']['find'](_0x1bf491=>_0x1bf491['partDefinition']['hasChanges']);}}class We extends _0x5da037{constructor(_0x44916f=void 0x0){super();const _0x148a7e=_0x44916f?'ck-ai-spinner_'+_0x44916f:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x148a7e]}});}}class T extends _0x43effc{['bodyView'];['miniToolbarView'];['children'];['headerView'];['loaderView'];['errorView'];['sourcesView'];['_bodyCollection'];constructor(_0xf7364c,_0x563da0,_0x20cf13){super(_0xf7364c),this['_bodyCollection']=_0x20cf13;const {showDiff:_0x45922b,areActionsDisabled:_0x5a7082,miniToolbarConfig:_0x3f5a91,hideHeader:_0x59974f,showLoader:_0x2a7173,showUnchangedParts:_0x3db276,availableActions:_0x341d20}=_0x563da0;this['set']('areChangesVisible',!0x1),this['set']('isLoaderVisible',!!_0x2a7173),this['set']('isErrorVisible',!0x1),this['set']('isLoading',!0x1),this['children']=this['createCollection'](),_0x59974f||(this['headerView']=new Tr(_0xf7364c,{'showDiff':_0x45922b}),this['headerView']['on']('toggleShowChanges',(_0x27025a,_0x2a9089)=>{this['areChangesVisible']=_0x2a9089['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x2a9089['isOn']});}),this['children']['add'](this['headerView'])),this['bodyView']=new Dr(_0xf7364c,{'areActionsDisabled':_0x5a7082,'showUnchangedParts':!!_0x3db276,'availableActions':_0x341d20}),this['bodyView']['delegate'](...Ee)['to'](this),this['bodyView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoaderVisible','ck-hidden'),this['bindTemplate']['if']('isErrorVisible','ck-hidden')]}}),this['miniToolbarView']=new Lr(_0xf7364c,_0x3f5a91,_0x45922b),this['miniToolbarView']['delegate'](...Ee)['to'](this),this['miniToolbarView']['on']('toggleShowChanges',(_0xb1ed59,_0x2f0f69)=>{this['areChangesVisible']=_0x2f0f69,this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x2f0f69});}),this['miniToolbarView']['bind']('isLoading')['to'](this),this['children']['add'](this['bodyView']),this['children']['add'](this['miniToolbarView']),this['sourcesView']=new Sr(this['locale'],this['_bodyCollection']),this['children']['add'](this['sourcesView']),_0x2a7173&&(this['loaderView']=this['_createLoaderView'](),this['children']['add'](this['loaderView'])),this['errorView']=this['_createErrorView'](),this['children']['add'](this['errorView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x27b841){await this['bodyView']['updateContentParts'](_0x27b841);}['updateSources'](_0x5e7806){const _0x329958=this['sourcesView'],_0x15bf25=_0x329958['balloonPanelView'];_0x329958['children']['addMany'](_0x5e7806['map'](_0x122443=>new Rr(this['locale'],_0x122443,_0x15bf25))),_0x329958['isVisible']=!0x0;}['showLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x0);}['hideLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x1);}['showError'](_0x2ef342){if(this['errorView']){const _0x4ce7b4=this['errorView']['element']?.['querySelector']('.ck-ai-suggestion__error-text');_0x4ce7b4&&(_0x4ce7b4['textContent']=_0x2ef342),this['isErrorVisible']=!0x0;}}['hideError'](){this['errorView']&&(this['isErrorVisible']=!0x1);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['setErrorState'](){this['miniToolbarView']&&(this['miniToolbarView']['isLoading']=!0x0),this['headerView']?.['showChangesToggleView']&&(this['headerView']['showChangesToggleView']['isEnabled']=!0x1);}['clearErrorState'](){this['miniToolbarView']&&(this['miniToolbarView']['isLoading']=!0x1),this['headerView']?.['showChangesToggleView']&&(this['headerView']['showChangesToggleView']['isEnabled']=!0x0);}['addNavigationItem'](_0x428e28){this['miniToolbarView']['items']['add'](_0x428e28);}['removeNavigationItem'](_0x583bfd){this['miniToolbarView']['items']['remove'](_0x583bfd);}['_createLoaderView'](){const _0x3e9d67=new _0x43effc(this['locale']),_0x555191=new We('small');_0x555191['isVisible']=!0x0;const _0x4ba11b=new _0x43effc(this['locale']);return _0x4ba11b['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[i(this['locale'],'AI_CHAT_IS_WRITING')]}),_0x3e9d67['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isLoaderVisible','ck-hidden',_0x1f4be2=>!_0x1f4be2)]},'children':[_0x555191,_0x4ba11b]}),_0x3e9d67;}['_createErrorView'](){const _0x400286=new _0x43effc(this['locale']),_0x45fade=new _0x43effc(this['locale']);return _0x45fade['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[i(this['locale'],'AI_CHAT_GENERIC_ERROR')]}),_0x400286['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0x34a50e=>!_0x34a50e)]},'children':[_0x45fade]}),_0x400286;}}class Sr extends _0x43effc{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x1f54dd,_0x33f0bf){super(_0x1f54dd),this['bodyCollection']=_0x33f0bf,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',_0x4dcdb7=>!_0x4dcdb7)]},'children':this['children']});const _0x230da9=new _0x43effc(this['locale']),_0x566604=new _0x4caa0b();_0x566604['content']=_0x46b22c,_0x230da9['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x566604,{'tag':'span','children':[{'text':i(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x230da9),this['_setupBalloonPanel'](_0x1f54dd);}['_setupBalloonPanel'](_0x2448dc){this['balloonPanelView']=new _0x2ae23a(_0x2448dc),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class Rr extends _0xcbb426{['balloonPanelView'];['source'];constructor(_0x2bbe88,_0x344cdc,_0x3d62ca){super(_0x2bbe88),this['source']=_0x344cdc,this['balloonPanelView']=_0x3d62ca,this['set']({'label':_0x344cdc['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x144ff0=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x144ff0['to'](()=>{window['open'](_0x344cdc['url'],'_blank');}),'mouseenter':_0x144ff0['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x144ff0['to'](()=>{this['_hideTooltip']();})}}),_0x344cdc['favicon']){const _0x269fa2=new _0x43effc(_0x2bbe88);_0x269fa2['setTemplate']({'tag':'img','attributes':{'src':_0x344cdc['favicon']||_0x46b22c,'alt':_0x344cdc['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x269fa2);}else this['set']('icon',_0x46b22c);}['_createTooltipContentView'](_0x34b41f,_0x3171b5){const _0xfd6e5d=new _0x43effc(_0x34b41f),_0x5e4970=[];let _0x16f916;_0x3171b5?.['favicon']?(_0x16f916=new _0x43effc(_0x34b41f),_0x16f916['setTemplate']({'tag':'img','attributes':{'src':_0x3171b5['favicon'],'alt':_0x3171b5['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x16f916=new _0x4caa0b(),_0x16f916['content']=_0x46b22c,_0x16f916['extendTemplate']({'attributes':{'alt':_0x3171b5['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x5e4970['push'](_0x16f916);const _0x1620d2=new _0x43effc(_0x34b41f);_0x1620d2['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x3171b5['url']},'children':[{'text':new URL(_0x3171b5['url'])?.['hostname']}]}),_0x5e4970['push'](_0x1620d2);const _0xfaa3f3=new _0x43effc(_0x34b41f);_0xfaa3f3['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x5e4970});const _0x16bff1=new _0x43effc(_0x34b41f);return _0x16bff1['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x3171b5['title']['length']>0x190?_0x3171b5['title']['substring'](0x0,0x190)+'...':_0x3171b5['title']}]}),_0xfd6e5d['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0xfaa3f3,_0x16bff1]}),_0xfd6e5d;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[_0x2ae23a['defaultPositions']['northArrowSouth'],_0x2ae23a['defaultPositions']['northArrowSouthWest'],_0x2ae23a['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 _0x29b3b0=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x29b3b0);}}class cs extends _0x312a64{constructor(_0x4c16d6,_0x440f4f=!0x0,_0x55d679=!0x0){super(_0x4c16d6),this['set']('isLoading',!0x1),_0x440f4f&&(this['applyButton']=this['_createButton'](i(_0x4c16d6,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this,'isLoading',_0xf923e9=>!_0xf923e9),this['items']['add'](this['applyButton'])),_0x55d679&&(this['suggestButton']=this['_createButton'](i(_0x4c16d6,'AI_BALLOON_SUGGEST_BUTTON'),_0x440f4f?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this,'isLoading',_0x271872=>!_0x271872),this['items']['add'](this['suggestButton'])),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['_createButton'](_0x466f1a,_0x37443f){const _0x5ddf1e=new _0xcbb426(this['locale']);return _0x5ddf1e['set']({'label':_0x466f1a,'class':_0x37443f||'','isVisible':!0x0,'withText':!0x0}),_0x5ddf1e;}}class ls extends _0x43effc{constructor(_0x4d085c){super(_0x4d085c),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':i(_0x4d085c,'AI_DISCLAIMER_TEXT')}]}]});}}const fs=['wheel','touchstart','pointerdown','keydown'],Fs=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class us{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x3d6e77){this['element']=_0x3d6e77,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x59e2fa of fs){const _0x2a3834='keydown'!==_0x59e2fa;this['element']['addEventListener'](_0x59e2fa,this['_onUserEvent']['bind'](this),{'passive':_0x2a3834,'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'](_0x1708cd){if(this['isRunning']){if('keydown'===_0x1708cd['type']){const _0x2a7d08=_0x1708cd['key'];if(!Fs['includes'](_0x2a7d08))return;}_0x1708cd instanceof WheelEvent?_0x1708cd['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x476b35,scrollHeight:_0x20a618,clientHeight:_0x1d2b3f}=this['element'];return _0x20a618-_0x476b35-_0x1d2b3f<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}const nt=['applySuggestion','insertSuggestion','showNext','showPrevious'];class at extends _0x43effc{['focusTracker'];['keystrokes'];['focusCycler'];['_availableActions'];['_focusables'];['_errorView'];['scrollManager'];constructor(_0x456d13,_0x16e446,_0x46b126,_0x33d32a){super(_0x456d13),this['_availableActions']=_0x46b126,this['set']('isLoading',!0x1),this['set']('isTrackChangesOn',_0x33d32a),this['set']('isErrorVisible',!0x1),this['set']('errorMessage',''),this['focusTracker']=new _0x25d272(),this['keystrokes']=new _0xfe6d51(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x4b849d({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x317ee8(),this['_addContentView'](_0x16e446['mainView']),this['_addDisclaimerView'](),this['_addToolbar'](_0x16e446['showApplyButton'],_0x16e446['showSuggestButton']),this['toolbar']['bind']('isLoading')['to'](this),this['_focusables']['clear'](),this['_focusables']['addMany']([this['toolbar']]),this['setTemplate']({'tag':'div','attributes':{'class':'ai-balloon-content'},'children':this['_dialogContent']}),this['on']('change:isTrackChangesOn',()=>{this['_dialogContent']['remove'](this['toolbar']),this['_addToolbar'](_0x16e446['showApplyButton'],_0x16e446['showSuggestButton']);});}['render'](){super['render']();for(const _0xfc9112 of this['_focusables'])this['focusTracker']['add'](_0xfc9112['element']);this['keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['scrollManager']&&this['scrollManager']['destroy']();}['focus'](_0x540337){-0x1===_0x540337?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['showError'](_0x173e0b){this['_errorView']||(this['_errorView']=this['_createErrorView'](),this['_dialogContent']['addMany']([this['_errorView']],0x0)),this['errorMessage']=_0x173e0b,this['isErrorVisible']=!0x0;}['hideError'](){this['isErrorVisible']=!0x1;}['showRecoverableError'](_0x140a62){this['showError'](_0x140a62);}['showBlockingError'](_0x467106){this['showError'](_0x467106),this['toolbar']&&(this['toolbar']['applyButton']&&(this['toolbar']['applyButton']['isEnabled']=!0x1),this['toolbar']['suggestButton']&&(this['toolbar']['suggestButton']['isEnabled']=!0x1));}['setupRotator'](_0x6e6055){const _0x17e3ce=this['_createNextButtonView'](),_0x20bf52=this['_createPreviousButtonView']();_0x6e6055['view']['headerView']['children']['add'](_0x17e3ce,0x2),_0x6e6055['view']['headerView']['children']['add'](_0x20bf52,0x0),this['_focusables']['addMany']([_0x17e3ce,_0x20bf52]),this['focusTracker']['add'](_0x17e3ce['element']),this['focusTracker']['add'](_0x20bf52['element']);}['_addContentView'](_0x5152dd){this['_mainView']=_0x5152dd,this['_dialogContent']['add'](this['_mainView']);}['updateContent'](_0x2cb3e1){const _0x1a63fb=this['_dialogContent']['getIndex'](this['_mainView']);this['_dialogContent']['remove'](this['_mainView']),this['_mainView']=_0x2cb3e1,this['_dialogContent']['add'](this['_mainView'],_0x1a63fb),this['hideError'](),this['scrollManager']&&this['scrollManager']['destroy'](),this['_initializeScrollManager']();}['_addDisclaimerView'](){this['disclaimerView']=new ls(this['locale']),this['_dialogContent']['add'](this['disclaimerView']);}['_addToolbar'](_0x21c93b=!0x0,_0x3cd64a=!0x0){_0x21c93b=_0x21c93b&&!this['isTrackChangesOn']&&this['_availableActions']['includes']('applySuggestion'),_0x3cd64a=_0x3cd64a&&this['_availableActions']['includes']('insertSuggestion'),this['toolbar']=new cs(this['locale'],_0x21c93b,_0x3cd64a),this['toolbar']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['toolbar']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_dialogContent']['add'](this['toolbar']);}['_createNextButtonView'](){const _0x3b9e2c=new _0xcbb426(this['locale']);return _0x3b9e2c['set']({'icon':_0x4309f7,'tooltip':i(this['locale'],'AI_BALLOON_NEXT_TOOLTIP')}),_0x3b9e2c['on']('execute',()=>{this['fire']('showNext');}),_0x3b9e2c;}['_createPreviousButtonView'](){const _0x2f3405=new _0xcbb426(this['locale']);return _0x2f3405['set']({'icon':_0x1420c7,'tooltip':i(this['locale'],'AI_BALLOON_PREVIOUS_TOOLTIP')}),_0x2f3405['on']('execute',()=>{this['fire']('showPrevious');}),_0x2f3405;}['_createErrorView'](){const _0xec9718=new _0x43effc(this['locale']),_0x4b83c1=new _0x43effc(this['locale']);return _0x4b83c1['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('errorMessage')}]}),_0xec9718['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ai-balloon-error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0xdd2eab=>!_0xdd2eab)]},'children':[_0x4b83c1]}),_0xec9718;}['startAutoScroll'](){this['_initializeScrollManager'](),this['scrollManager']&&this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']&&this['scrollManager']['stop']();}['_initializeScrollManager'](){const _0x55100a=this['_getScrollableElement']();_0x55100a&&!this['scrollManager']&&(this['scrollManager']=new us(_0x55100a));}['_getScrollableElement'](){return this['_mainView']instanceof T&&this['_mainView']['bodyView']['element']?this['_mainView']['bodyView']['element']:null;}}const mt=0xa;class H extends ot{static get['requires'](){return[S,R];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_config'];['_isUpdatingMarkers']=!0x1;['_pendingRenderCallback']=null;['open'](_0x20519e){const _0x53aa47=ut(this['context']);if(this['_config']=_0x20519e,this['isOpen'])return void this['_updateBalloon'](_0x20519e);const _0x1d4952=this['context']['config']['get']('ai.availableReplyActions')||[...et],_0x738ca7=_0x53aa47?.['commands']['get']('trackChanges'),_0x491edf=_0x738ca7?.['value'];this['balloonView']=new at(_0x53aa47['locale'],_0x20519e,_0x1d4952,!!_0x491edf),this['balloonView']['delegate'](...nt)['to'](this),_0x738ca7&&this['balloonView']['bind']('isTrackChangesOn')['to'](_0x738ca7,'value'),this['_showDialog'](_0x20519e);}['close'](){ut(this['context'])['plugins']['get']('Dialog')['hide']();}['startAutoScroll'](){this['balloonView']&&this['balloonView']['startAutoScroll']();}['stopAutoScroll'](){this['balloonView']&&this['balloonView']['stopAutoScroll']();}['_updateBalloon'](_0x5d3f17){const _0x302e36=ut(this['context']),_0x52ae14=_0x302e36['plugins']['get']('Dialog');this['_pendingRenderCallback']&&(_0x302e36['editing']['view']['off']('render',this['_pendingRenderCallback']),this['_pendingRenderCallback']=null),this['_isUpdatingMarkers']=!0x0,_0x52ae14['view']?.['headerView']&&(_0x52ae14['view']['headerView']['label']=_0x5d3f17['title'],_0x52ae14['view']['headerView']['iconView']&&_0x5d3f17['icon']&&(_0x52ae14['view']['headerView']['iconView']['content']=_0x5d3f17['icon'])),this['balloonView']['updateContent'](_0x5d3f17['mainView']),this['_setupVisualSelection'](_0x5d3f17['ranges'],_0x5d3f17['index']),this['_pendingRenderCallback']=()=>{this['_isUpdatingMarkers']=!0x1,this['_pendingRenderCallback']=null,_0x52ae14['view']&&_0x52ae14['view']['updatePosition']();},_0x302e36['editing']['view']['once']('render',this['_pendingRenderCallback']);}['_setupVisualSelection'](_0x5c6c7a,_0x3d5a24){this['context']['plugins']['get'](R)['showFakeVisualSelection'](_0x5c6c7a,'ai-balloon-'+_0x3d5a24,!0x0,!0x0);}['_showDialog'](_0x361f24){const _0x30fa3e=ut(this['context']);this['_setupVisualSelection'](_0x361f24['ranges'],_0x361f24['index']);const _0x232561=this['_getSelectionElements']();_0x232561&&_0x232561[0x0]&&ht({'target':_0x232561[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),_0x30fa3e['plugins']['get']('Dialog')['show']({'title':_0x361f24['title'],'icon':_0x361f24['icon'],'hasCloseButton':!0x0,'id':'aiBalloon','position':this['_calculateDialogPosition']['bind'](this),'className':'ai-balloon'+(_0x361f24['showRotator']?'\x20ai-balloon-rotator':''),'content':this['balloonView'],'onShow':_0x1d025a=>{_0x361f24['showRotator']&&this['balloonView']['setupRotator'](_0x1d025a),this['_setupMarkerRemovalListener'](),this['isOpen']=!0x0;},'onHide':()=>{this['context']['plugins']['get']('AIEditing')['hideFakeVisualSelection']('ai-balloon-'+this['_config']['index']),this['_cleanupMarkerRemovalListener'](),this['fire']('dialogClosed'),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x1d3b72,_0x5caee3){if(!_0x5caee3)return null;const _0x23fb22=this['_getSelectionElements']();if(!_0x23fb22||0x0===_0x23fb22['length'])return{'left':Math['round'](_0x5caee3['left']+_0x5caee3['width']/0x2-_0x1d3b72['width']/0x2),'top':Math['round'](_0x5caee3['top']+_0x5caee3['height']/0x2-_0x1d3b72['height']/0x2)};const _0x4806f2=Math['round'](_0x5caee3['left']+_0x5caee3['width']/0x2-_0x1d3b72['width']/0x2),_0x3f128a=new ct(_0x23fb22[0x0]),_0x1e8393=new ct(_0x23fb22[_0x23fb22['length']-0x1]),_0x5a4d64=_0x1d3b72['height'],_0x19ae37=this['_config']['showRotator']?0x8:0x0;return{'left':_0x4806f2,'top':this['_calculateOptimalTopPosition'](_0x3f128a,_0x1e8393,_0x5a4d64,_0x19ae37,_0x5caee3)};}['_calculateOptimalTopPosition'](_0x50be2e,_0x3b396e,_0x4b8529,_0x55c2ac=0x0,_0x3711db){const _0x2bc77b=_0x4b8529+_0x55c2ac,_0x5318d5=new ct(lt['window']),_0x2e025c=[_0x50be2e['getVisible'](),_0x3b396e['getVisible']()]['filter'](_0x7bdfd1=>_0x7bdfd1),_0x57678c=ct['getBoundingRect'](_0x2e025c);if(!_0x57678c)return Math['round'](_0x3711db['top']+_0x3711db['height']/0x2);const _0x2f13f7=_0x5318d5['getIntersection'](_0x57678c);if(!_0x2f13f7)return Math['round'](_0x3711db['top']+_0x3711db['height']/0x2);const _0x5172f0=_0x3711db['getVisible'](),_0x41f076=_0x5172f0&&_0x57678c['height']>_0x5172f0['height'],_0x3a9578=_0x2f13f7['top'],_0x3344ef=_0x2f13f7['bottom'];if(_0x41f076){const _0x559dc3=(_0x5172f0||_0x5318d5)['height']/0x2-_0x2bc77b/0x2,_0x5a96eb=_0x3a9578-mt-_0x3711db['top'],_0x1bf94c=_0x3711db['bottom']-_0x3344ef-mt;return _0x5a96eb>=_0x2bc77b?Math['max'](mt,_0x3a9578-_0x2bc77b-mt):_0x1bf94c>=_0x2bc77b?_0x3344ef+mt:Math['max'](mt,_0x559dc3);}const _0x5660a2=_0x3a9578-_0x2bc77b,_0x4adc5e=_0x3711db['bottom']-_0x3344ef-mt,_0x5a769d=_0x3a9578-mt-_0x3711db['top'];let _0x106c62;if(_0x4adc5e>=_0x2bc77b)_0x106c62=_0x3344ef+mt;else{if(_0x5a769d>=_0x2bc77b)_0x106c62=_0x5660a2-mt;else _0x106c62=_0x3a9578+_0x57678c['height']/0x2-_0x2bc77b/0x2;}return _0x106c62;}['_setupMarkerRemovalListener'](){const _0x3e793f=ut(this['context']);this['listenTo'](_0x3e793f['model']['document'],'change',()=>{if(this['_isUpdatingMarkers'])return;for(const {name:_0x67d4e7,data:{newRange:_0xdbd48b}}of _0x3e793f['model']['document']['differ']['getChangedMarkers']())if(_0x67d4e7['startsWith']('ai-selection:')&&(_0xdbd48b&&(_0xdbd48b['start']['isEqual'](_0xdbd48b['end'])||'$graveyard'==_0xdbd48b['root']['rootName'])||null==_0xdbd48b)){const _0x32756b=i(this['context']['locale'],'AI_ACTIONS_SELECTION_REMOVED_ERROR');this['balloonView']['showBlockingError'](_0x32756b),this['fire']('selectionRemoved');}});}['_cleanupMarkerRemovalListener'](){const _0x3fe11d=ut(this['context']);this['stopListening'](_0x3fe11d['model']['document']);}['_getSelectionElements'](){const _0x234dea=ut(this['context']);return rt(_0x234dea['editing'],[..._0x234dea['model']['markers']['getMarkersGroup']('ai-selection'),..._0x234dea['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class dt extends ot{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_batchToChanges']=new Map();['_previewedChangeGroup']=null;['_balloonShowDiff']=!0x1;['_bodyCollection'];static get['requires'](){return[S,H,_0x2dc9e7];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new _0x44dc72(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new At({'connector':this['_aiConnector'],'availableModels':this['context']['config']['get']('ai.chat.models.displayedModels'),'defaultModelId':this['context']['config']['get']('ai.chat.models.defaultModelId'),'locale':this['context']['locale']});const _0x10a993=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x5b5a8f,_0x429ffa)=>{this['_handleUIUserMessage']({'userMessage':_0x429ffa});}),this['listenTo'](_0x10a993,'resizedTabs',(_0x3b1ed6,_0x26dde8)=>{this['_setIsMaximized'](_0x26dde8);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x10a993['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x56070b,_0x38afa8)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x38afa8));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x57e23b,_0x539b2b)=>{this['activeConversation']?.['addUrlToContext'](_0x539b2b);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x16fc07,_0x4a87cc)=>{this['activeConversation']?.['addResourceToContext'](_0x4a87cc['source'],_0x4a87cc['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x9b21c1,_0x2467f5)=>{this['_removeFromContext'](_0x2467f5);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x1229cc,_0x114906)=>{this['activeConversation']?.['loadSourceResources'](_0x114906['sourceId'],_0x114906['query'],_0x114906['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x390971,_0x1e5ea0)=>{this['activeConversation']?.['setModel'](_0x1e5ea0);}),this['listenTo'](this['_aiChatUi'],'like',(_0x3b6fea,{replyId:_0x38ba3a})=>{console['log']('Liked\x20response',_0x38ba3a);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x32bf3,{replyId:_0x5b5537})=>{console['log']('Disliked\x20response',_0x5b5537);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x16dce2,_0x2acd1a)=>{this['context']['plugins']['get'](H)['close'](),this['_insertSuggestion'](_0x2acd1a);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0xb70b3b,{replyId:_0x469bbd,partIndex:_0x351e38})=>{this['_balloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x469bbd,_0x351e38);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x26caba,{replyId:_0x53078c,partIndex:_0x419efd})=>{const _0x21086e=this['_getDocumentRangeForReplyChanges'](_0x53078c,_0x419efd);_0x21086e&&'$graveyard'!=_0x21086e['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x21086e['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x31a7a3,_0x20117e)=>{this['context']['plugins']['get'](H)['close'](),this['_applySuggestion'](_0x20117e);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x31d21d,{replyId:_0x2b1ccd,showDiff:_0x59c93e})=>{const {reply:_0x5132f7}=this['getInteractionAndReplyById'](_0x2b1ccd),_0x4c10e8=_0x5132f7['getContentParts']({'showDiff':_0x59c93e});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x5132f7['id'],'parts':_0x4c10e8,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x5b28e9,{replyId:_0x1b33f1,partIndex:_0x527037})=>{this['_previewedChangeGroup']?.['replyId']==_0x1b33f1&&this['_previewedChangeGroup']?.['partIndex']==_0x527037&&this['context']['plugins']['get'](H)['close']();const {reply:_0x297cbe}=this['getInteractionAndReplyById'](_0x1b33f1);_0x297cbe['setChangeGroupState'](_0x527037,'rejected'),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');});}async['afterInit'](){this['context']instanceof _t?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x3a28cd,_0x738682)=>{_0x738682['on']('ready',()=>{this['_integrateEditor'](_0x738682);});}),await this['_startConversationSafely']();}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_insertSuggestion'](_0x585822){const _0x5f5377=ut(this['context']);if(!_0x5f5377['plugins']['has']('TrackChanges'))throw new _0x36b126('ai-no-track-changes',null);const _0x52cbe7=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x2b000e,interaction:_0x263b88}=this['getInteractionAndReplyById'](_0x585822['replyId']),_0x6e542e=this['_getDocumentRangeForReplyChanges'](_0x585822['replyId'],_0x585822['partIndex']),_0x22a1a1=void 0x0!==_0x585822['partIndex']?[_0x2b000e['changeGroups'][_0x585822['partIndex']]]:_0x2b000e['changeGroups']['filter'](_0x4f5afa=>'pending'==_0x4f5afa['state']),_0x183055=_0x22a1a1['map'](_0xa0dda3=>_0x2b000e['changeGroups']['indexOf'](_0xa0dda3));if(!_0x6e542e||'$graveyard'==_0x6e542e['range']['root']['rootName'])return void _0x183055['forEach'](_0x129b93=>_0x2b000e['setChangeGroupState'](_0x129b93,'outdated'));_0x183055['forEach'](_0x41e9cb=>_0x2b000e['setChangeGroupState'](_0x41e9cb,'accepted'));const _0x4a6ce4=z({'editor':_0x5f5377,'reply':_0x2b000e,'interaction':_0x263b88,'groups':_0x22a1a1,'transform':!0x0,'documentCompare':_0x52cbe7,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x13a269;_0x6e542e&&this['_scrollToSuggestionRange'](_0x6e542e['range']),_0x5f5377['model']['change'](_0x104d5f=>{_0x13a269=_0x104d5f['batch'],_0x5f5377['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x4a6ce4),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x13a269,{'interactionId':_0x263b88['id'],'replyId':_0x2b000e['id'],'indexes':_0x183055['slice']()}),this['_updateRatings'](_0x2b000e);}['_applySuggestion'](_0x2ad079){const _0x155f1b=ut(this['context']),_0xdb5740=this['context']['plugins']['get'](_0x2dc9e7),{reply:_0x22a1e2,interaction:_0x3b5b2e}=this['getInteractionAndReplyById'](_0x2ad079['replyId']),_0x4de1f9=this['_getDocumentRangeForReplyChanges'](_0x2ad079['replyId'],_0x2ad079['partIndex']),_0x3c63eb=void 0x0!==_0x2ad079['partIndex']?[_0x22a1e2['changeGroups'][_0x2ad079['partIndex']]]:_0x22a1e2['changeGroups']['filter'](_0x23609c=>'pending'==_0x23609c['state']),_0x33134e=_0x3c63eb['map'](_0x3f2a71=>_0x22a1e2['changeGroups']['indexOf'](_0x3f2a71));if(!_0x4de1f9||'$graveyard'==_0x4de1f9['range']['root']['rootName'])return void _0x33134e['forEach'](_0x1b5089=>_0x22a1e2['setChangeGroupState'](_0x1b5089,'outdated'));_0x33134e['forEach'](_0x40c952=>_0x22a1e2['setChangeGroupState'](_0x40c952,'accepted'));const _0x19888c=z({'editor':_0x155f1b,'reply':_0x22a1e2,'interaction':_0x3b5b2e,'groups':_0x3c63eb,'transform':!0x0,'documentCompare':_0xdb5740,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x295100;_0x4de1f9&&this['_scrollToSuggestionRange'](_0x4de1f9['range']),_0x155f1b['model']['change'](_0x4edb4f=>{_0x295100=_0x4edb4f['batch'];for(const _0x3a0035 of _0x19888c)_0x3a0035['baseVersion']=_0x155f1b['model']['document']['version'],Y(_0x155f1b,_0x3a0035),_0x4edb4f['batch']['addOperation'](_0x3a0035),_0x155f1b['model']['applyOperation'](_0x3a0035);}),this['_batchToChanges']['set'](_0x295100,{'interactionId':_0x3b5b2e['id'],'replyId':_0x22a1e2['id'],'indexes':_0x33134e['slice']()}),this['_updateRatings'](_0x22a1e2);}['_openBalloonFor'](_0x1395c6,_0x1d8708){const _0x175f8d=ut(this['context']),_0x37a508=this['_getDocumentRangeForReplyChanges'](_0x1395c6,_0x1d8708),_0x577856=this['context']['plugins']['get'](H);if(!_0x37a508)return void _0x577856['close']();const {range:_0x26f895,currentIndex:_0x5c8095}=_0x37a508;if('$graveyard'==_0x26f895['root']['rootName']){const {reply:_0x597cc5}=this['getInteractionAndReplyById'](_0x1395c6);return _0x597cc5['setChangeGroupState'](_0x5c8095,'outdated'),void _0x577856['close']();}if(this['_previewedChangeGroup']?.['replyId']==_0x1395c6&&this['_previewedChangeGroup']?.['partIndex']==_0x5c8095)return;this['stopListening'](_0x577856),this['_previewedChangeGroup']={'replyId':_0x1395c6,'partIndex':_0x5c8095};let _0x1d9094=_0x175f8d['config']['get']('ai.availableReplyActions')||[...et];_0x175f8d['plugins']['has']('TrackChanges')||(_0x1d9094=_0x1d9094['filter'](_0x146bd3=>'insertSuggestion'!=_0x146bd3));const _0x5cdbb1=new T(_0x175f8d['locale'],{'showDiff':this['_balloonShowDiff'],'areActionsDisabled':!0x1,'miniToolbarConfig':{'showChanges':'full'},'hideHeader':!0x0,'availableActions':_0x1d9094},this['_bodyCollection']);this['stopListening'](_0x5cdbb1);const {reply:_0x59d00e}=this['getInteractionAndReplyById'](_0x1395c6),_0x42f568=_0x59d00e['getContentParts']({'showDiff':this['_balloonShowDiff']})['filter'](_0x2c3e5e=>_0x2c3e5e['hasChanges']),_0x4e51eb=_0x42f568['findIndex'](_0x4c57c5=>_0x4c57c5['index']==_0x5c8095);if(-0x1==_0x4e51eb)return;const _0x3b7c74=_0x42f568[_0x4e51eb],_0x3a934f=_0x42f568['at']((_0x4e51eb-0x1)%_0x42f568['length'])?.['index'],_0xc85b05=_0x42f568['at']((_0x4e51eb+0x1)%_0x42f568['length'])?.['index'];_0x5cdbb1['updateContent']({'parts':[_0x3b7c74],'renderingStrategy':'static'});const _0x2060dd=_0x5c8095!==_0x3a934f;this['_scrollToSuggestionRange'](_0x26f895,!0x0),_0x577856['open']({'index':_0x5c8095,'title':i(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x4e51eb+0x1)['toString']()),'icon':Nt,'mainView':_0x5cdbb1,'showRotator':_0x2060dd,'showApplyButton':!0x0,'showSuggestButton':_0x175f8d['plugins']['has']('TrackChanges'),'ranges':[_0x26f895]}),this['_aiChatUi']['scrollFeedToSuggestion'](_0x1395c6,_0x5c8095),this['listenTo'](_0x5cdbb1,'toggleSuggestionDisplayMode',(_0x1ea24f,{showDiff:_0x218aff})=>{this['_balloonShowDiff']=_0x218aff;const {reply:_0x15c04e}=this['getInteractionAndReplyById'](_0x1395c6),_0x15141a=_0x15c04e['getContentParts']({'showDiff':_0x218aff,'groupIndex':_0x5c8095});_0x5cdbb1['updateContent']({'parts':_0x15141a,'renderingStrategy':'static'});}),this['listenTo'](_0x577856,'applySuggestion',()=>{this['_applySuggestion']({'replyId':_0x1395c6,'partIndex':_0x5c8095}),_0x2060dd?this['_openBalloonFor'](_0x1395c6,_0xc85b05):_0x577856['close']();}),this['listenTo'](_0x577856,'insertSuggestion',()=>{this['_insertSuggestion']({'replyId':_0x1395c6,'partIndex':_0x5c8095}),_0x2060dd?this['_openBalloonFor'](_0x1395c6,_0xc85b05):_0x577856['close']();}),_0x2060dd&&(this['listenTo'](_0x577856,'showNext',()=>{this['_openBalloonFor'](_0x1395c6,_0xc85b05);}),this['listenTo'](_0x577856,'showPrevious',()=>{this['_openBalloonFor'](_0x1395c6,_0x3a934f);})),this['listenTo'](_0x577856,'dialogClosed',()=>{this['stopListening'](_0x577856),this['stopListening'](_0x5cdbb1),this['_previewedChangeGroup']=null;});}['_getDocumentRangeForReplyChanges'](_0x552499,_0x937049){const _0x2a72c9=ut(this['context']),{reply:_0x7b7e32,interaction:_0x35d476}=this['getInteractionAndReplyById'](_0x552499),_0x4f0129=_0x7b7e32['changeGroups']['filter'](_0x1c2f71=>'pending'==_0x1c2f71['state']),_0x48b4e8=_0x4f0129['map'](_0x29a4eb=>_0x7b7e32['changeGroups']['indexOf'](_0x29a4eb));void 0x0===_0x937049&&(_0x937049=_0x48b4e8[0x0]);const _0x1fbde0=_0x48b4e8['indexOf'](_0x937049);if(-0x1==_0x1fbde0)return null;const _0x2cf7c7=_0x4f0129[_0x1fbde0],_0xc080e3=new Rt([]),_0x4b4de6=new Rt([]);for(const _0x29f9bf of _0x2cf7c7['changes'])if('removed'!=_0x29f9bf['type']&&_0x4b4de6['children']['push'](_0x29f9bf['node']['cloneNode'](!0x0)),'new'!=_0x29f9bf['type']){const _0x27684b=St(_0x5a4d29=>vt(_0x5a4d29,'data-id')==_0x29f9bf['id'],_0x7b7e32['documentContextContent'],!0x0);_0xc080e3['children']['push'](_0x27684b['cloneNode'](!0x0));}if(0x0==_0xc080e3['children']['length']){if(_0x2cf7c7['changes'][0x0]['anchorId']){const _0x159bbf=Dt('data-id',_0x2cf7c7['changes'][0x0]['anchorId'],_0x7b7e32['documentContextContent']);_0xc080e3['children']['unshift'](_0x159bbf['cloneNode'](!0x0)),_0x4b4de6['children']['unshift'](_0x159bbf['cloneNode'](!0x0)),_0x159bbf['nextSibling']&&(_0xc080e3['children']['push'](_0x159bbf['nextSibling']['cloneNode'](!0x0)),_0x4b4de6['children']['push'](_0x159bbf['nextSibling']['cloneNode'](!0x0)));}else{const _0xf04082=_0x7b7e32['documentContextContent']['children'][0x0];if(!_0xf04082)return null;_0xc080e3['children']['push'](_0xf04082['cloneNode'](!0x0)),_0x4b4de6['children']['push'](_0xf04082['cloneNode'](!0x0));}}const _0x43975d=_0x35d476['getDocumentContext'](),_0x47ea8e=_0x2a72c9['data']['parse'](_0x43975d['content'],'$root'),_0x1319eb=Ot(_0xc080e3),_0x3a86b4=_0x2a72c9['data']['parse'](_0x1319eb),_0x5b7ea4=_0x2a72c9['data']['parse'](_0x1319eb),_0x11fd26=_0x2a72c9['model']['createPositionAt'](_0x3a86b4,0x0),_0x2446a7=Ot(_0x4b4de6),_0x2bcffe={'anchor':_0x11fd26,'markDeletions':!0x1,'context':'$root'},_0x44df58=_0x2a72c9['plugins']['get'](_0x2dc9e7)['getDiff'](_0x1319eb,_0x2446a7,_0x2bcffe)['getOperations']();if(!_0x44df58['length'])return null;_0x2a72c9['model']['change'](_0x1fb17b=>{for(const _0x256205 of _0x44df58)if('remove'==_0x256205['type']){const _0x51bcda=_0x256205['sourcePosition'],_0x3458fb=_0x256205['howMany'],_0x2c1a9d=new it(_0x51bcda,_0x3458fb);_0x1fb17b['batch']['addOperation'](_0x2c1a9d),_0x2a72c9['model']['applyOperation'](_0x2c1a9d);}else'marker'!==_0x256205['type']&&(_0x256205['baseVersion']=null,_0x256205['isDocumentOperation']=!0x1,_0x1fb17b['batch']['addOperation'](_0x256205),_0x2a72c9['model']['applyOperation'](_0x256205));});const _0x9a9d13=wt(_0x2a72c9,_0x44df58,_0x3a86b4);Et(_0x2a72c9['model'],_0x9a9d13);const _0x4295d0=_0x9a9d13['getFirstRange']()['start']['path']['slice'](),_0x6764a2=_0x9a9d13['getFirstRange']()['end']['path']['slice'](),_0x4f9827=[];let _0x1a4411=_0x3a86b4,_0x374208=_0x5b7ea4;for(let _0x3a84b5=0x0;_0x3a84b5<_0x6764a2['length'];_0x3a84b5++){const _0x15fa72=_0x1a4411['maxOffset']-_0x6764a2[_0x3a84b5];_0x4f9827[_0x3a84b5]=_0x374208['maxOffset']-_0x15fa72,_0x1a4411=_0x1a4411['getChildAtOffset'](_0x6764a2[_0x3a84b5]),_0x374208=_0x374208['getChildAtOffset'](_0x4f9827[_0x3a84b5]);}const _0x1697ad=_0x2a72c9['model']['createRange'](_0x2a72c9['model']['createPositionFromPath'](_0x5b7ea4,_0x4295d0),_0x2a72c9['model']['createPositionFromPath'](_0x5b7ea4,_0x4f9827)),_0x1c9a82=_0x5b7ea4['getChild'](0x0)['getAttribute'](yt),_0x216fd4=Array['from'](_0x47ea8e['getChildren']())['find'](_0x5a1f49=>_0x5a1f49['getAttribute'](yt)==_0x1c9a82)['getPath'](),_0x27e873=_0x1697ad['start']['path']['slice'](),_0xb28ba1=_0x1697ad['end']['path']['slice']();_0x27e873[0x0]=_0x216fd4[0x0]+_0x27e873[0x0],_0xb28ba1[0x0]=_0x216fd4[0x0]+_0xb28ba1[0x0];let _0x324d66=_0x2a72c9['model']['createRange'](_0x2a72c9['model']['createPositionFromPath'](_0x2a72c9['model']['document']['getRoot'](),_0x27e873),_0x2a72c9['model']['createPositionFromPath'](_0x2a72c9['model']['document']['getRoot'](),_0xb28ba1));const _0x4437f9=_0x2a72c9['model']['document']['history']['getOperations'](_0x43975d['version']);for(const _0x4daf6c of _0x4437f9)_0x324d66=_0x1026dd['_createFromRanges'](_0x324d66['getTransformedByOperation'](_0x4daf6c));return{'range':_0x324d66,'currentIndex':_0x937049};}['_integrateEditor'](_0x3e3edc){if(!_0x3e3edc['plugins']['has']('Undo'))return;const _0x4518f6=_0x3e3edc['commands']['get']('undo'),_0x1f89e8=_0x3e3edc['commands']['get']('redo');this['listenTo'](_0x4518f6,'revert',(_0x4c69b5,_0x13603b,_0x1aa13f)=>{const _0x39fab4=this['_batchToChanges']['get'](_0x13603b);if(!_0x39fab4)return;const _0x9f66a4=this['activeConversation']['getInteraction'](_0x39fab4['interactionId'])['getReply'](_0x39fab4['replyId']);_0x39fab4['indexes']['forEach'](_0x4a9bb8=>_0x9f66a4['setChangeGroupState'](_0x4a9bb8,'pending')),this['_batchToChanges']['delete'](_0x13603b),this['_batchToChanges']['set'](_0x1aa13f,_0x39fab4);}),this['listenTo'](_0x1f89e8,'revert',(_0x10903a,_0x487fb5,_0x5e63e6)=>{const _0x28c33e=this['_batchToChanges']['get'](_0x487fb5);if(!_0x28c33e)return;const _0x5b76f4=this['activeConversation']['getInteraction'](_0x28c33e['interactionId'])['getReply'](_0x28c33e['replyId']);_0x28c33e['indexes']['forEach'](_0x143485=>_0x5b76f4['setChangeGroupState'](_0x143485,'accepted')),this['_batchToChanges']['delete'](_0x487fb5),this['_batchToChanges']['set'](_0x5e63e6,_0x28c33e);});}async['loadConversation'](_0x57f25b){this['context']['plugins']['get'](H)['close'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']();try{await this['_aiConnector']['fetchConversation'](_0x57f25b)['getConversation'](),await this['_startConversationSafely'](_0x57f25b),this['updateConversationTitle']('\x20');const {sessionId:_0x442004}=this['_aiEditing']['getDocumentData']();await this['activeConversation']['load'](_0x57f25b,_0x442004),this['activeConversation']['isCurrentDocumentInConversation']()&&this['activeConversation']['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}catch(_0x1a1a18){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x57f25b}),this['_logError'](new _0x36b126('ai-chat-conversation-not-found',this,{'error':_0x1a1a18}));}finally{this['context']['plugins']['get'](Ct)['view']['activateTab']('chat'),this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['handleRemovedConversation'](_0x64f15a){this['activeConversation']['id']===_0x64f15a&&this['_startConversationSafely']();}async['addSelectionToChatContext'](){const _0x43df24=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x43df24),this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x191132,quickActionData:_0x3e78a6}){await this['_handleUIUserMessage']({'userMessage':_0x191132,'quickActionData':_0x3e78a6});}['getGroupId'](){const _0x5c77e4=this['context']['config']['get']('collaboration.channelId');if(!_0x5c77e4)throw new _0x36b126('ai-chat-missing-channel-id',this);return _0x5c77e4;}async['_startConversationSafely'](_0x106f64){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x106f64);}catch(_0x16f022){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x106f64||_0xdc126c()}),console['error'](_0x16f022),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x2e7453){const _0x2335c0=this['context']['plugins']['get'](H);let _0x4d03b8;_0x2335c0['isOpen']&&_0x2335c0['close'](),_0x2e7453||!this['activeConversation']?_0x4d03b8=this['context']['config']['get']('ai.chat.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x4d03b8=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x47e271=this['getGroupId'](),_0x37355c=_0x2e7453||_0xdc126c();this['activeConversation']=new Tt({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x4d03b8,'conversationId':_0x37355c,'group':_0x47e271,'getEditor':()=>ut(this['context'])}),this['activeConversation']['on']('conversationInitialized',(_0x31e967,_0x480d92)=>{this['_aiChatUi']['createConversation'](_0x480d92),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x2e7453||(this['_aiChatUi']['resetConversationTitle'](),this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT')));}),this['activeConversation']['on']('uploadProgressChanged',(_0x760dd9,_0x5e5b38)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x5e5b38['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x421901,_0x581210)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x581210);}),this['activeConversation']['on']('webSearchStarted',()=>{this['_aiChatUi']['setLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningStarted',()=>{this['_aiChatUi']['setLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('webSearchFinished',(_0x1a18a6,_0x4718d2)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x4718d2,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x298762,_0xf29f05)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0xf29f05,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x366f86,_0x4bd5ff)=>{this['_aiChatUi']['removeFeedInteraction'](_0x4bd5ff['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x432b6c,_0x2b8fc1,_0x5a3756)=>{this['updateConversationTitle'](_0x2b8fc1,_0x5a3756);}),this['activeConversation']['on']('replyCreated',(_0x564622,_0x15485e)=>{'text-delta'===_0x15485e['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x15485e):this['_aiChatUi']['addFeedItemAISuggestion'](_0x15485e);}),this['activeConversation']['on']('replyContentUpdated',async(_0x525e06,_0x4f2f82)=>{await this['_updateReplyContent']({'reply':_0x4f2f82});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x367809,{reply:_0x43b599,index:_0x5adf96,state:_0x51f896})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x43b599['id'],'index':_0x5adf96,'state':_0x51f896});}),this['activeConversation']['on']('contextItemAdded',(_0xd538ff,_0x4dc9e1)=>{if(this['_aiChatUi']['addContextItem'](_0x4dc9e1['contextItem'],_0x4dc9e1['isLoading']),'selection'===_0x4dc9e1['contextItem']['type']){const _0x50826e=[...ut(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x50826e,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x2daafc,_0x4ad343)=>{this['_aiChatUi']['removeContextItem'](_0x4ad343['uiId']),'current-document'==_0x4ad343['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x4ad343['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x2782cd,_0x32689f)=>{this['_aiChatUi']['setContextItemLoading'](_0x32689f['contextItem']['uiId'],_0x32689f['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x174172,_0x27dc44)=>{this['_aiChatUi']['setConversationContext'](_0x27dc44['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x1d281b,_0x4f9e5a)=>{this['_aiChatUi']['setAddContextOptions'](_0x4f9e5a['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x2d8119,_0x25c8dd)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x25c8dd['sourceId'],_0x25c8dd['source'],_0x25c8dd['resources'],_0x25c8dd['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x45efd7,_0x3d2bf0)=>{this['_aiChatUi']['updateResourceState'](_0x3d2bf0['sourceId'],_0x3d2bf0['resourceId'],_0x3d2bf0['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x448414,_0xc1aa83)=>{this['_aiChatUi']['updateCapabilities'](_0xc1aa83);}),this['activeConversation']['on']('modelSelected',(_0x8b1c96,_0x204a64)=>{this['_aiChatUi']['setSelectedModel'](_0x204a64['selectedModel'],_0x204a64['isDisabled']);}),this['activeConversation']['on']('error',(_0x4c8b8b,{error:_0x24873f,interactionId:_0x18b242,fileName:_0x370473,url:_0x4b05cf,sourceId:_0x34996c,sourceLabel:_0x3a1808})=>{const _0x205098=_0x18b242?_0x18b242+':'+_0xdc126c():_0xdc126c();_0x24873f['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':i(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x205098}):_0x24873f['message']['startsWith']('ai-chat-conversation-init-failed')||_0x24873f['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x205098}),this['_logError'](_0x24873f)):_0x24873f['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x370473),'id':_0x205098}):_0x24873f['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x4b05cf),'id':_0x205098}):_0x24873f['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x205098}):_0x24873f['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x205098}):_0x24873f['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x34996c&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x34996c),this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x3a1808||'source'),'id':_0x205098}),this['_logError'](_0x24873f)):_0x24873f['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x205098}),this['_logError'](_0x24873f)):_0x24873f['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x205098}),this['_logError'](_0x24873f)):_0x24873f['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x205098}),this['_logError'](_0x24873f)):_0x24873f['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x205098}),this['_logError'](_0x24873f)):_0x24873f['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x205098}),this['_logError'](_0x24873f)):_0x24873f['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x205098}),this['_logError'](_0x24873f)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x205098}),this['_logError'](_0x24873f));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x2e7453||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x4112f1,quickActionData:_0x554753}){if(!this['activeConversation'])throw new _0x36b126('ai-chat-controller-no-active-conversation');this['activeConversation']['isCurrentDocumentInContext']()&&await this['activeConversation']['updateCurrentDocumentInContext'](this['_aiEditing']['getDocumentData']()),this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x4112f1,'quickActionData':_0x554753}),this['_removeAISelectionMarkers']();}['_removeAISelectionMarkers'](){const _0x6d26a1=ut(this['context'])['model'],_0xcf3bd6=Array['from'](_0x6d26a1['markers']['getMarkersGroup'](It));_0x6d26a1['change'](_0x3bcb47=>{_0xcf3bd6['forEach'](_0x37a764=>_0x3bcb47['removeMarker'](_0x37a764));});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x48a4c9){this['_aiChatUi']['setIsMaximized'](_0x48a4c9);}['_logError'](_0x2c0e43){ft(_0x2c0e43['message']);}['_removeFromContext'](_0x2c5d55){this['activeConversation']?.['removeFromContext'](_0x2c5d55);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x4df697){const [_0x4adcd5,_0x4a6661]=_0x4df697['split'](':'),_0x223125=this['activeConversation']['getInteraction'](_0x4adcd5),_0x1052f4=_0x223125['getReply'](_0x4a6661);return{'interaction':_0x223125,'reply':_0x1052f4};}['_scrollToSuggestionRange'](_0x980b4c,_0x14e6ca=!0x1){const _0x480495=ut(this['context']),_0x4ae1e2={'target':_0x480495['editing']['view']['domConverter']['viewRangeToDom'](_0x480495['editing']['mapper']['toViewRange'](_0x980b4c)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x14e6ca};_0x14e6ca&&(_0x4ae1e2['alignToTop']=!0x0),ht(_0x4ae1e2);}['updateConversationTitle'](_0x2dd316,_0x396068=!0x1){this['_aiChatUi']['setConversationTitle'](_0x2dd316||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x396068);}async['_updateReplyContent']({reply:_0x343a65,renderingStrategy:_0x13cdf6}){const {id:_0x4b6c3a,isDone:_0x583797,type:_0x2b2112,parsedContent:_0xe97eb1}=_0x343a65;if('modification-delta'===_0x2b2112){const _0x3a4e88=_0x343a65['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x4b6c3a,'parts':_0x3a4e88,'renderingStrategy':_0x13cdf6,'isDone':_0x583797});}else'text-delta'===_0x2b2112&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x4b6c3a,'parsedContent':_0xe97eb1,'renderingStrategy':_0x13cdf6,'isDone':_0x583797});_0x583797&&_0x343a65['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x4b6c3a,_0x343a65['sources']);}async['_stopLastInteraction'](){const _0x4af752=this['activeConversation']?.['lastInteraction'];_0x4af752&&(_0x4af752['stop'](),this['_aiChatUi']['stopInteraction'](_0x4af752));}async['_flushLastInteractionUI'](){const _0x8da560=this['activeConversation']?.['lastInteraction'];if(_0x8da560){for await(const _0x36b483 of _0x8da560['replies'])await this['_updateReplyContent']({'reply':_0x36b483,'renderingStrategy':'static'});}}['_updateRatings'](_0x582b6b){const _0x473d0f={'positiveCount':_0x582b6b['changeGroups']['filter'](_0x2d92af=>'accepted'===_0x2d92af['state'])['length'],'totalCount':_0x582b6b['changeGroups']['length'],'modificationId':_0x582b6b['id']},_0x232d19=this['activeConversation']['getInteraction'](_0x582b6b['interactionId'])['messageId'];this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x232d19,_0x473d0f);}}const Mt=[...Ee,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class Le extends Fr{['containerView'];['actionsView'];constructor(_0x218e46,_0x3e9342,_0x4523cc){super(_0x3e9342),this['set']('isTrackChangesOn',!0x1),this['containerView']=new T(_0x218e46,{'showDiff':_0x3e9342['showDiff'],'areActionsDisabled':_0x3e9342['areActionsDisabled'],'availableActions':_0x3e9342['availableActions']},_0x4523cc),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x1e8415,_0x3c3e33)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x3c3e33['showDiff']});}),this['containerView']['on']('like',()=>{this['fire']('like',{'replyId':this['options']['id']});}),this['containerView']['on']('dislike',()=>{this['fire']('dislike',{'replyId':this['options']['id']});}),this['containerView']['on']('showChangeInText',(_0x2972a0,{index:_0x295699})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x295699});}),this['containerView']['on']('insertSuggestion',(_0x1afae9,{index:_0x2cf8ea})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x2cf8ea});}),this['containerView']['on']('rejectSuggestion',(_0x161dd7,{index:_0x659864})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x659864});}),this['containerView']['on']('mouseOverSuggestion',(_0x2590be,{index:_0x14b885})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x14b885});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x573260,{index:_0x273d85})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x273d85});}),this['actionsView']=new ah(_0x218e46,this['options']['availableActions']),this['actionsView']['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn'),this['actionsView']['on']('showChangeInText',()=>{this['fire']('showChangeInText',{'replyId':this['options']['id']});}),this['actionsView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'replyId':this['options']['id']});}),this['actionsView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'replyId':this['options']['id']});}),_0x3e9342['areActionsDisabled']?this['actionsView']['isEnabled']=!0x1:this['actionsView']['bind']('isEnabled')['to'](this['containerView']['bodyView'],'hasPendingParts'),this['children']['addMany']([this['containerView'],this['actionsView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x21bc63){await this['containerView']['updateContent'](_0x21bc63),this['actionsView']['updateLabels'](this['containerView']['bodyView']['partsCount']);}['updatePartState'](_0x1a6bb5,_0x3ae2c1){this['containerView']['bodyView']['updatePartState'](_0x1a6bb5,_0x3ae2c1);}['updateSources'](_0x3b8f62){this['containerView']['updateSources'](_0x3b8f62);}['getPartView'](_0x4dcf02){return this['containerView']['bodyView']['getPartView'](_0x4dcf02);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone'](),this['actionsView']['isVisible']=this['containerView']['bodyView']['hasNonEmptyParts'];}}class Ve extends Fr{['replyContainer'];['_bodyCollection'];constructor(_0x183f8b,_0x332fbe,_0x34ddde){super(_0x332fbe),this['_bodyCollection']=_0x34ddde,this['locale']=_0x183f8b,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x43effc(),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':He(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x5340fe,renderingStrategy:_0x236be4,abortSignal:_0x1eddec}){'streaming'===_0x236be4?await this['streamIntoElement'](_0x5340fe,this['replyContainer']['element'],_0x1eddec):this['replyContainer']['element']['innerHTML']=_0x4b71ff(_0x5340fe);}['updateSources'](_0x21c007){const _0x19295c=new Sr(this['locale'],this['_bodyCollection']);_0x19295c['children']['addMany'](_0x21c007['map'](_0x13f8b1=>new Rr(this['locale'],_0x13f8b1,_0x19295c['balloonPanelView']))),_0x19295c['isVisible']=!0x0,this['children']['add'](_0x19295c);}}const xn={'file':_0x18ec8e,'document':_0x584f93,'web-resource':_0x3ed6af,'text':_0x18ec8e,'selection':_0x498e88},$r='ck-ai-chat-context-chip',Qr='ck-ai-chat-context-chip_wide',Zr='ck-ai-chat-context-chip_document',ra='ck-ai-chat-context-chip__label',oa='ck-ai-chat-context-chip__type-icon',ca='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class Bo extends _0xcbb426{constructor(_0x3e77d4,_0x366e91,_0x54c9dd,_0x35bdc9,_0x3c43e3=!0x1){super(_0x3e77d4),this['_isAnimationOnEnterEnabled']=_0x35bdc9,this['_initializeProperties'](_0x366e91,_0x54c9dd,_0x3c43e3),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'](_0x4fd988,_0x277d1e,_0x2ede93){this['set']('label',_0x4fd988['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x4fd988['type']),this['set']('id',_0x4fd988['uiId']),this['set']('readonly',_0x277d1e),this['set']('isLoading',_0x2ede93);}['_setupTemplate'](){const _0x11ad04=this['_createIconView'](),_0x64f8f8=this['_createRemoveButton'](),_0x25f42d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x25f42d),'children':this['_createTemplateChildren'](_0x11ad04,_0x64f8f8,_0x25f42d)});}['_createTemplateAttributes'](_0x100a95){return{'class':[$r,_0x100a95['if']('itemType',Zr,_0x2e0a38=>'document'==_0x2e0a38),_0x100a95['if']('itemType',Qr,_0x1a2b60=>'selection'==_0x1a2b60)],'data-cke-tooltip-text':_0x100a95['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':ca};}['_createTemplateChildren'](_0x4f079d,_0x46cbca,_0x379f62){const _0x55293d=this['_createLabelElement'](_0x379f62),_0x5d13a3=this['_createLoaderIcon']();return this['readonly']?[_0x4f079d,_0x55293d]:[_0x4f079d,_0x5d13a3,_0x55293d,_0x46cbca];}['_createLabelElement'](_0x316785){return{'tag':'span','attributes':{'class':ra},'children':[{'text':_0x316785['to']('label')}]};}['_createRemoveButton'](){const _0x439c86=new _0xcbb426(this['locale']);return _0x439c86['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x516001}),this['_setupRemoveButtonEvent'](_0x439c86),_0x439c86;}['_setupRemoveButtonEvent'](_0x55bc60){_0x55bc60['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x4f9d9c=this['bindTemplate'],_0x362165=new _0x4caa0b();return _0x362165['content']=xn[this['itemType']],_0x362165['extendTemplate']({'attributes':{'class':[oa,_0x4f9d9c['if']('isLoading','ck-hidden',_0xde3d3e=>_0xde3d3e)]}}),_0x362165;}['_handleAnimationEndOnce'](_0x2afad2,_0x4f7bcc){if(!_0x2afad2)return;const _0x1c80c3=()=>{_0x4f7bcc(),_0x2afad2['removeEventListener']('animationend',_0x1c80c3),_0x2afad2['removeEventListener']('webkitAnimationEnd',_0x1c80c3);};_0x2afad2['addEventListener']('animationend',_0x1c80c3),_0x2afad2['addEventListener']('webkitAnimationEnd',_0x1c80c3);}['_createLoaderIcon'](){const _0x4dcbff=new We('small');return _0x4dcbff['bind']('isVisible')['to'](this,'isLoading',_0x3de9ee=>_0x3de9ee),_0x4dcbff;}}function In(_0x13578a){if(!_0x13578a)return _0x13578a;if(_0x13578a['length']<=0x78)return _0x13578a;const _0x59cbbe=_0x13578a['slice'](0x0,0x78),_0x49eadf=_0x59cbbe['lastIndexOf']('\x20');return(_0x49eadf>0x0?_0x59cbbe['slice'](0x0,_0x49eadf):_0x59cbbe)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},an='300px';class To{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x43b93b,_0x474526,_0x20b326,_0x4cbdad,_0x184ab5){this['_locale']=_0x43b93b,this['_visibleChips']=_0x474526,this['_config']={...hn,..._0x20b326,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x20b326['cssClasses']}},this['_overflowChips']=new _0x5137f7(),this['_bodyCollection']=_0x4cbdad,this['_parentView']=_0x184ab5||null;}['setContainerElement'](_0x173d13){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x173d13,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 _0x24f124=[...this['_visibleChips'],...this['_overflowChips']],_0xf3caa9=this['_createCalculationContainer'](),_0x4ed926=this['_calculateOverflowInContainer'](_0xf3caa9,_0x24f124),_0xf738c5=_0xf3caa9['_ancestorsToRestore'];_0xf738c5&&this['_restoreAncestorVisibility'](_0xf738c5),_0xf3caa9['remove'](),this['_applyOverflowResults'](_0x24f124,_0x4ed926);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x4b855c({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x2ac3d8=new _0xcbb426(this['_locale']);_0x2ac3d8['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x3ccbfc=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x3ccbfc['push'](this['_config']['cssClasses']['controlsButton']),_0x2ac3d8['extendTemplate']({'attributes':{'class':_0x3ccbfc}}),_0x2ac3d8;}['_createShowMoreBalloonPanelView'](){const _0x77b0e0=new _0x2ae23a(this['_locale']);return _0x77b0e0['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x77b0e0),_0x77b0e0;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x441640=>{_0x441640['disableAnimationOnEnter']();});const _0x23c3a2=new _0x43effc(this['_locale']);_0x23c3a2['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x23c3a2);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x469f04=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x469f04?'':'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'](_0x3b1541){const _0x2405e9=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x2014a2=this['_containerElement']?.['classList'];if(_0x2014a2){const _0x528fba=_0x2014a2[0x0]||'',_0x4da932=_0x3b1541['querySelector']('.'+_0x528fba),_0x108732=_0x3b1541['querySelector'](_0x2405e9);return _0x4da932||_0x108732||_0x3b1541;}return _0x3b1541['querySelector'](_0x2405e9)||_0x3b1541;}['_calculateContainerWidth'](){const _0x369fb9=this['_parentView']?.['element']||this['_containerElement'];if(!_0x369fb9)return an;const _0x3f130d=window['getComputedStyle'](_0x369fb9)['width'];if('auto'===_0x3f130d||'0px'===_0x3f130d||!_0x3f130d){const _0x2083f3=_0x369fb9['parentElement'];if(_0x2083f3){const _0x4cd83b=window['getComputedStyle'](_0x2083f3);return'auto'!==_0x4cd83b['width']?_0x4cd83b['width']:an;}return an;}return _0x3f130d;}['_applyCalculationStyles'](_0x24a60c,_0x3e4c6d){this['_config']['cssClasses']['calculationContainer']&&_0x24a60c['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x24a60c['style']['width']=_0x3e4c6d,_0x24a60c['style']['position']='absolute',_0x24a60c['style']['top']='-9999px',_0x24a60c['style']['left']='-9999px',_0x24a60c['style']['opacity']='0',_0x24a60c['style']['pointerEvents']='none',_0x24a60c['style']['zIndex']='-1',_0x24a60c['style']['visibility']='visible\x20!important',_0x24a60c['style']['display']='block\x20!important',_0x24a60c['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x529cc7){_0x529cc7['forEach'](({element:_0x559791,originalDisplay:_0x21944a,originalVisibility:_0x26b462})=>{_0x559791['style']['display']=_0x21944a,_0x559791['style']['visibility']=_0x26b462;});}['_makeAncestorsVisible'](_0x15d7f2){const _0x9ef97e=[];let _0x52996d=_0x15d7f2;for(;_0x52996d&&_0x52996d!==document['body'];){const _0x424fb6=window['getComputedStyle'](_0x52996d);'none'!==_0x424fb6['display']&&'hidden'!==_0x424fb6['visibility']||(_0x9ef97e['push']({'element':_0x52996d,'originalDisplay':_0x52996d['style']['display'],'originalVisibility':_0x52996d['style']['visibility']}),_0x52996d['style']['display']='block',_0x52996d['style']['visibility']='visible'),_0x52996d=_0x52996d['parentElement'];}return _0x9ef97e;}['_createContainerElements'](){let _0x49a71b,_0x3a5464;return this['_parentView']?.['element']?(_0x49a71b=this['_parentView']['element']['cloneNode'](!0x0),_0x3a5464=this['_findTargetContainer'](_0x49a71b)):(_0x49a71b=document['createElement']('div'),_0x3a5464=_0x49a71b),{'calculationContainer':_0x49a71b,'targetContainer':_0x3a5464};}['_createCalculationContainer'](){const {calculationContainer:_0x446bcb,targetContainer:_0x4df2a4}=this['_createContainerElements'](),_0x1b4a83=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x446bcb,_0x1b4a83);const _0x26250a=this['_parentView']?.['element']||this['_containerElement'],_0x20ddc2=_0x26250a?.['parentElement'];_0x20ddc2?_0x20ddc2['appendChild'](_0x446bcb):document['body']['appendChild'](_0x446bcb),_0x446bcb['_targetContainer']=_0x4df2a4;const _0xfa828b=this['_makeAncestorsVisible'](_0x20ddc2||null);return _0x446bcb['offsetWidth'],_0x446bcb['_ancestorsToRestore']=_0xfa828b,_0x446bcb;}['_calculateOverflowInContainer'](_0x4271d7,_0x284384){const _0x535591=_0x4271d7['_targetContainer']||_0x4271d7,_0x1d278e=[],{rowCount:_0x2a05e6}=this['_renderChipsAndCountRows'](_0x535591,_0x284384);if(_0x2a05e6<=this['_config']['maxVisibleRows'])return _0x1d278e;const _0x3b1f06=_0x284384['slice']();for(;_0x3b1f06['length']>0x0;){if(this['_testButtonFit'](_0x4271d7,_0x535591,_0x3b1f06)){const _0x3e3d49=_0x284384['filter'](_0x1f6866=>!_0x3b1f06['includes'](_0x1f6866));_0x1d278e['push'](..._0x3e3d49);break;}if(!_0x3b1f06['pop']())break;}return _0x1d278e;}['_renderChipsAndCountRows'](_0x6e9b51,_0x2c57c4){_0x6e9b51['innerHTML']='',_0x2c57c4['forEach'](_0x5cc88b=>{if(_0x5cc88b['element']){const _0x1d4d19=_0x5cc88b['element']['cloneNode'](!0x0);_0x6e9b51['appendChild'](_0x1d4d19);}}),_0x6e9b51['offsetWidth'];const _0xac641a=_0x6e9b51['children'],_0x5673fa=[];return Array['from'](_0xac641a)['forEach'](_0x534dfa=>{const _0x5eb1db=_0x534dfa['getBoundingClientRect']()['top'];_0x5673fa['some'](_0x206667=>Math['abs'](_0x206667-_0x5eb1db)<this['_config']['rowDetectionTolerance'])||_0x5673fa['push'](_0x5eb1db);}),{'rowCount':_0x5673fa['length']};}['_createMockButton'](){const _0x22cae3=document['createElement']('button');return _0x22cae3['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x22cae3['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x22cae3['textContent']='+\x201',_0x22cae3;}['_testButtonFit'](_0x57cdc9,_0x8f36cf,_0x3732e0){this['_renderChipsAndCountRows'](_0x8f36cf,_0x3732e0);const _0x452876=this['_createMockButton']();_0x57cdc9['appendChild'](_0x452876),_0x57cdc9['offsetWidth'];const _0x3c2276=[..._0x8f36cf['children'],_0x452876],_0x3dcc93=[];_0x3c2276['forEach'](_0x15441d=>{const _0x381f93=_0x15441d['getBoundingClientRect']()['top'];_0x3dcc93['some'](_0xc734d1=>Math['abs'](_0xc734d1-_0x381f93)<this['_config']['rowDetectionTolerance'])||_0x3dcc93['push'](_0x381f93);});const _0x1f17ea=_0x3dcc93['length'];return _0x452876['remove'](),_0x1f17ea<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x134389,_0x39c88a){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x134389['forEach'](_0xa078c3=>{_0x39c88a['includes'](_0xa078c3)?this['_overflowChips']['add'](_0xa078c3):this['_visibleChips']['add'](_0xa078c3);});}['_updateOverflowUI'](_0x389415){if(_0x389415>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x389415>0x0&&this['_showMoreButtonView']){const _0x7f578d=''+this['_config']['showMoreLabelPrefix']+(_0x389415<0x63?_0x389415:'99');this['_showMoreButtonView']['label']=_0x7f578d;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x5349c0,_0x4404c5){this['_distributeChips'](_0x5349c0,_0x4404c5),this['_updateOverflowUI'](_0x4404c5['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0xb2811e=>{_0xb2811e[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 _0x3e47e3=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x3e47e3['width']||0x0===_0x3e47e3['height'])return!0x1;const _0x1ccff9=window['innerHeight']||document['documentElement']['clientHeight'],_0x46934e=window['innerWidth']||document['documentElement']['clientWidth'],_0x442e0a=0xc8;return _0x3e47e3['bottom']>=-0xc8&&_0x3e47e3['top']<=_0x1ccff9+_0x442e0a&&_0x3e47e3['right']>=-0xc8&&_0x3e47e3['left']<=_0x46934e+_0x442e0a;}}const la='ck-ai-chat__feed__context-chips',da='ck-ai-chat-context-chips-wrapper',ua='ck-ai-chat-context-chips-wrapper-balloon',_a='ck-ai-chat-controls-button',Ia='ck-ai-chat-controls_context_show-more-button',Aa='ck-ai-chat-context-controls__show-more-balloon-panel';class _h extends _0x43effc{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x56be63,_0x2fb7c9,_0x68b904){super(_0x56be63),this['_bodyCollection']=_0x68b904,this['_createContextChips'](_0x2fb7c9);const _0x2fb07c={'cssClasses':{'showMoreButton':Ia,'showMoreBalloon':Aa,'overflowContainer':ua,'controlsButton':_a}};this['_overflowManager']=new To(_0x56be63,this['_contextChips'],_0x2fb07c,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[la,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':da},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x37ff2b=this['element']['querySelector']('.'+da);_0x37ff2b&&(this['_overflowManager']['setContainerElement'](_0x37ff2b),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x6f70a4){for(const _0x260b71 of _0x6f70a4){const _0xe5092b=new Bo(this['locale'],_0x260b71,!0x0,!0x1);this['_contextChips']['add'](_0xe5092b);}}}class Me extends Fr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x2480e5,_0x2051da,_0x404000){super(_0x2051da),this['_locale']=_0x2480e5,this['_bodyCollection']=_0x404000,this['_createContextChipsView'](),this['_createMessageContentView'](),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__user-message']}});}['_createContextChipsView'](){this['options']['contextItems']&&this['options']['contextItems']['length']>0x0&&(this['_contextChipsView']=new _h(this['_locale'],this['options']['contextItems']['filter'](_0x2b7da0=>!_0x2b7da0['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x43effc(this['_locale']),this['_messageContentView']['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__message-content'}}),this['children']['add'](this['_messageContentView']);}['render'](){super['render'](),this['_messageContentView']['element']['innerHTML']=this['options']['initialContent'],this['markAsDone']();}}class Lt extends Fr{['capabilities'];constructor(_0x4027c4,_0x412896){super(_0x412896);const {isWebSearchEnabled:_0x3118fd,isReasoningEnabled:_0x41695b}=_0x412896['capabilities'],_0x4ff799=[];let _0x159b88='';_0x3118fd&&_0x41695b?(_0x159b88=i(_0x4027c4,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x4ff799['push'](aa(_0x46b22c)),_0x4ff799['push'](aa(_0x279253))):_0x3118fd?(_0x159b88=i(_0x4027c4,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x4ff799['push'](aa(_0x46b22c))):_0x41695b&&(_0x159b88=i(_0x4027c4,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x4ff799['push'](aa(_0x279253))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x159b88?'':'ck-hidden']}});const _0x28a8b2=new _0x43effc();_0x28a8b2['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x4ff799,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x159b88]}]}),this['children']['add'](_0x28a8b2),this['capabilities']=_0x412896['capabilities'];}}function aa(_0x171e6e){const _0x2e4edf=new _0x4caa0b();return _0x2e4edf['content']=_0x171e6e,_0x2e4edf;}class Pe extends _0x43effc{constructor(_0x2fef8e,_0x2b973c){super(_0x2fef8e),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x2b973c)});}['_createSkeletonItems'](_0x4f8663){const _0x1a6018=['ck','ck-ai-skeleton__item'];return _0x4f8663['map'](_0x2039e3=>{let _0x56cdef='';switch(_0x2039e3['attributes']['align']){case'right':_0x56cdef='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x56cdef='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x56cdef='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x2039e3['tag'],'attributes':{'class':[..._0x1a6018,_0x2039e3['attributes']['class']?_0x2039e3['attributes']['class']:''],'style':'width:\x20'+_0x2039e3['attributes']['width']+';\x20height:\x20'+_0x2039e3['attributes']['height']+';'+_0x56cdef}};});}}const Be={'aiFeed':[{'tag':'div','attributes':{'width':'100%','height':'72px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}},{'tag':'div','attributes':{'width':'150px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'140px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}}],'aiHistory':ta(0x5,'100%','44px','right'),'aiChatResources':ta(0x8,'100%','24px','right'),'aiReviewChecks':[{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}}]};function ta(_0x22126b,_0x3dc3e2,_0x121b76,_0x5c000e){return new Array(_0x22126b)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x3dc3e2,'height':_0x121b76,'align':_0x5c000e}}));}class pi extends _0x43effc{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x212474,_0x1164d9){super(_0x212474),this['_bodyCollection']=_0x1164d9,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Mt)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new us(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0xf97736,_0x332f22){let _0x36a8b8;'ai-reply'===_0xf97736?_0x36a8b8=new Ve(this['locale'],_0x332f22,this['_bodyCollection']):'ai-suggestion-reply'===_0xf97736?(_0x36a8b8=new Le(this['locale'],_0x332f22,this['_bodyCollection']),_0x36a8b8['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn')):_0x36a8b8='user-message'===_0xf97736?new Me(this['locale'],_0x332f22,this['_bodyCollection']):'interaction-header'===_0xf97736?new Lt(this['locale'],_0x332f22):new Oe(_0x332f22),this['children']['add'](_0x36a8b8);}async['updateReplyItem']({id:_0x53f5ad,parsedContent:_0x4dac,renderingStrategy:_0x3e5328,abortSignal:_0x1375d8}){const _0x3afe85=this['getItemById'](_0x53f5ad);if(!(_0x3afe85 instanceof Ve))throw new _0x36b126('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x3afe85,'id':_0x53f5ad,'parsedContent':_0x4dac});await _0x3afe85['updateContent']({'parsedContent':_0x4dac,'renderingStrategy':_0x3e5328,'abortSignal':_0x1375d8});}async['updateWebSources'](_0x587bba,_0x25f135){const _0x3e40c1=this['getItemById'](_0x587bba);if(_0x3e40c1 instanceof Le)_0x3e40c1['updateSources'](_0x25f135);else{if(!(_0x3e40c1 instanceof Ve))throw new _0x36b126('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x3e40c1,'id':_0x587bba,'sources':_0x25f135});_0x3e40c1['updateSources'](_0x25f135);}}async['updateSuggestionItem']({id:_0x5cbd67,parts:_0x579b3f,renderingStrategy:_0x29afee,abortSignal:_0x35aeb5}){const _0x575696=this['getItemById'](_0x5cbd67);if(!(_0x575696 instanceof Le))throw new _0x36b126('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x575696,'id':_0x5cbd67,'parts':_0x579b3f});await _0x575696['updateContent']({'parts':_0x579b3f,'renderingStrategy':_0x29afee,'abortSignal':_0x35aeb5});}['updateSuggestionPartState']({id:_0x1d82fd,index:_0x32213a,state:_0x5dc59d}){const _0x54f93b=this['getItemById'](_0x1d82fd);if(!(_0x54f93b instanceof Le))throw new _0x36b126('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x1d82fd});_0x54f93b['updatePartState'](_0x32213a,_0x5dc59d);}['markItemAsDone'](_0x1379d8){this['getItemById'](_0x1379d8)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x17308a=>_0x17308a['options']['id']);}['removeItem'](_0xd08e5e){this['children']['remove'](this['getItemById'](_0xd08e5e));}['scrollToSuggestion'](_0x2a0c87,_0x10c5a5){const _0x283780=this['getItemById'](_0x2a0c87);if(!(_0x283780 instanceof Le))return void _0x3219ae('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x2a0c87,'partIndex':_0x10c5a5});const _0x281973=_0x283780['getPartView'](_0x10c5a5);_0x281973?ht({'target':_0x281973['element'],'ancestorOffset':0x14,'alignToTop':!0x0,'forceScroll':!0x0}):_0x3219ae('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x2a0c87,'partIndex':_0x10c5a5});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x5c6040=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x5c6040,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x414bcd=new Pe(this['locale'],Be['aiFeed']);return _0x414bcd['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x23fbbe=>!_0x23fbbe)]}}),_0x414bcd;}['_createFeedItems'](){const _0x4e66f7=new _0x43effc(this['locale']);return _0x4e66f7['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x4e66f7;}['_createFeedLoader'](){const _0x4e03e5=new _0x43effc(this['locale']);return _0x4e03e5['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x3fde7c=>!_0x3fde7c)]},'children':this['_createLoaderChildren']()}),_0x4e03e5;}['_createLoaderChildren'](){const _0x818c9f=new We();return _0x818c9f['isVisible']=!0x0,[_0x818c9f,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x14af41){const _0x12783f=this['children']['find'](_0x33bb16=>_0x33bb16['options']['id']['includes'](_0x14af41));if(!_0x12783f)throw new _0x36b126('ai-chat-feed-view-item-not-found',this,{'id':_0x14af41});return _0x12783f;}['setLoadingMessage'](_0x1f8061){this['set']('loadingMessage',_0x1f8061);}['toggleLoadingSkeleton'](_0x444374){this['set']('isLoadingSkeletonVisible',_0x444374);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class Br extends _0x5bd1ba{['filter'](){let _0x497e71=0x0;for(const _0x5bb372 of this['items'])_0x497e71+=_0x5bb372['items']['length'];return{'resultsCount':_0x497e71,'totalItemsCount':_0x497e71};}}class ps extends _0x53698e{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x374734,_0x21a5de){super(_0x374734,{'queryView':{'label':'','creator':_0x49d9f6,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new Br(_0x374734),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x21a5de,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=ps['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=ps['MAX_ROWS'],this['queryView']['fieldWrapperChildren']['add'](this['_addContextButtonView']),this['_setUpAddContextButtonPositioning'](),this['extendTemplate']({'attributes':{'class':['ck','ck-ai-chat__prompt-input']}}),this['submitButtonView']=this['_createSubmitButton'](),this['submitButtonView']['bind']('isEnabled')['to'](this,'isEmpty',this,'isUploadInProgress',(_0x36fc97,_0x242059)=>!_0x36fc97&&!_0x242059),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x1d6aa1,_0xc835b0)=>{this['isUploadInProgress']||this['isEmpty']||_0x1d6aa1['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0xc835b0());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0xf472dd=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0xf472dd)return this['queryView']['errorText']=i(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x42d226=_0x469020(_0xf472dd);this['fire']('sendUserMessage',_0x42d226),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x58d58c){this['queryView']['fieldView']['set']('placeholder',_0x58d58c);}['_createSubmitButton'](){const _0x1a869b=new _0xcbb426(this['locale']);return _0x1a869b['set']({'icon':_0x2913f7,'label':i(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x1a869b['on']('execute',()=>{this['submit']();}),_0x1a869b;}['setIsUploadInProgress'](_0x5214ab){this['isUploadInProgress']=_0x5214ab;}['_setUpAddContextButtonPositioning'](){const _0x21be18=this['locale'],_0x3d9e5f=()=>{lt['window']['requestAnimationFrame'](()=>{if(_0x13140d(this['element'])){const _0x2c0e9d=new ct(this['queryView']['fieldView']['element']),_0x402d60=new ct(this['_addContextButtonView']['element']),_0x28452d=_0x2c0e9d['width'],_0x5b0fe2='rtl'===_0x21be18['uiLanguageDirection']?'right':'left';_0x2c0e9d['excludeScrollbarsAndBorders']();const _0x2aae0=_0x28452d-_0x2c0e9d['width']+0x1;this['_addContextButtonView']['element']['style'][_0x5b0fe2]='calc('+(_0x28452d-_0x402d60['width']-_0x2aae0)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x3d9e5f),this['on']('render',()=>{_0x3d9e5f(),this['_queryViewResizeObserver']=new _0x123cdf(this['queryView']['fieldView']['element'],()=>{_0x3d9e5f();});});}}const ga='ck-ai-chat__prompt-capabilities',ma='ck-ai-chat-controls-button',pa='ck-ai-chat-controls-button--commands',Ea='ck-ai-chat-controls__model-selection',Ta='ck-ai-chat-controls__model-selection__item-name',Ca='ck-ai-chat-controls__model-selection__item-description',wa='ck-ai-chat-controls__model-selection__item-capabilities',fa='n';class ms extends _0x43effc{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x5c089b){super(_0x5c089b),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelSelectorVisible',!0x0),this['set']('modelSelectorEnabled',!0x0),this['set']('activeModelId',null),this['set']('activeModelName',null),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelNameView']=this['_createModelNameView'](),this['_webSearchButton']=this['_createWebSearchButton'](),this['_reasoningButton']=this['_createReasoningButton'](),this['_commandsButton']=this['_createCommandsButton'](),this['_modelSelectionDropdown']['buttonView']['bind']('isVisible')['to'](this,'modelSelectorVisible',_0x37b02c=>_0x37b02c),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x48be37=>_0x48be37?this['_modelSelectionDropdown']['buttonView']['label']:i(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x2a3009=>_0x2a3009),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x2c1ad5=>_0x2c1ad5),this['_webSearchButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x18254a=>!_0x18254a),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x503bb5=>i(this['locale'],_0x503bb5?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x3399a7=>_0x3399a7),this['_reasoningButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x2e699f=>!_0x2e699f),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x1f3127=>i(this['locale'],_0x1f3127?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[ga]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x5137f7(),_0x44b9be(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x45f222,_0x291895){if(this['set']('modelSelectorVisible',!(_0x291895&&_0x45f222['length']<=0x1)),this['_modelSelectionDropdownItems']['clear'](),_0x45f222?.['length'])for(const _0x28402a of _0x45f222){const _0x1d571e=new _0x3344bf({'label':_0x28402a['name'],'withText':!0x0,'role':'menuitemradio','id':_0x28402a['id'],'model':_0x28402a});_0x1d571e['bind']('isOn')['to'](this,'activeModelId',_0x3745b5=>_0x3745b5===_0x28402a['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x1d571e,'labelView':new ba(this['locale'],_0x28402a)});}}['setWebSearch'](_0x42e876){this['set']('webSearchActive',_0x42e876);}['setReasoning'](_0x1e2937){this['set']('reasoningActive',_0x1e2937);}['setModel'](_0x26bec){if(!_0x26bec)return;this['activeModelId']=_0x26bec['id'],this['activeModelName']=_0x26bec['name']||_0x26bec['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x26bec['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x26bec['name']);const _0x331bfc=_0x26bec['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x331bfc),this['_webSearchButton']['set']('isVisible',_0x331bfc);const _0x34fb31=_0x26bec['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x34fb31),this['_reasoningButton']['set']('isVisible',_0x34fb31);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0),this['set']('modelSelectorVisible',!0x0);}['disableModelSelector'](_0x5978dc){this['set']('modelSelectorEnabled',!0x1),_0x5978dc&&this['set']('modelSelectorVisible',!0x1);}['_createWebSearchButton'](){const _0x245b21=new _0xcbb426();return _0x245b21['set']({'label':i(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x46b22c,'class':ma,'isToggleable':!0x0,'tooltipPosition':fa}),_0x245b21['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x245b21;}['_createReasoningButton'](){const _0x4caf51=new _0xcbb426();return _0x4caf51['set']({'label':i(this['locale'],'AI_CHAT_REASONING'),'icon':_0x279253,'class':ma,'isToggleable':!0x0,'tooltipPosition':fa}),_0x4caf51['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x4caf51;}['_createCommandsButton'](){const _0x5801d3=new _0xcbb426();return _0x5801d3['set']({'label':i(this['locale'],'AI_CHAT_COMMANDS'),'icon':Nt,'withText':!0x0,'class':ma,'isToggleable':!0x0,'tooltip':i(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':fa}),_0x5801d3['extendTemplate']({'attributes':{'class':[pa]}}),_0x5801d3['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x5801d3;}['_createModelSelectionDropdown'](){const _0x38c090=_0x2e287a(this['locale']);return _0x38c090['set']({'panelPosition':'ne','class':[Ea]}),_0x38c090['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':fa}),this['listenTo'](_0x38c090,'execute',_0x347203=>{this['fire']('selectModel',_0x347203['source']['model']);}),_0x38c090;}['_createModelNameView'](){const _0x3609c2=new Jo(this['locale']);return _0x3609c2['bind']('text')['to'](this,'activeModelName',_0x16c9f3=>_0x16c9f3??''),_0x3609c2['bind']('isVisible')['to'](this,'modelSelectorVisible',this,'activeModelName',(_0x42dd8f,_0x22f886)=>!_0x42dd8f&&!_0x22f886?.['toLowerCase']()['startsWith']('agent')),_0x3609c2;}}let ba=class extends _0x43f368{constructor(_0x53e0bb,_0x1d0ea1){super();const _0x373f1b=this['bindTemplate'],_0x4cc98a=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x373f1b['to']('style'),'id':_0x373f1b['to']('id')},'children':[{'tag':'div','attributes':{'class':[Ta]},'children':[{'text':_0x373f1b['to']('text')}]},{'tag':'div','attributes':{'class':[Ca]},'children':[{'tag':'span','children':[{'text':_0x1d0ea1['description']}]}]},{'tag':'div','attributes':{'class':[wa]},'children':_0x4cc98a}]}),_0x4cc98a['addMany'](this['_getCapabilityParts'](_0x53e0bb,_0x46b22c,'AI_CHAT_SEARCH_WEB',_0x1d0ea1['capabilities']['webSearch']?.['enabled']??!0x1)),_0x4cc98a['addMany'](this['_getCapabilityParts'](_0x53e0bb,_0x279253,'AI_CHAT_REASONING',_0x1d0ea1['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x417382,_0x22a10f,_0x1f6f20,_0x5a080e){const _0x39fe5c=new _0x4caa0b();_0x39fe5c['content']=_0x22a10f;const _0x56ba0a=new _0x43effc(_0x417382);_0x56ba0a['setTemplate']({'tag':'span','children':[{'text':i(_0x417382,_0x1f6f20)+':\x20'}]});const _0x2bda63=new _0x43effc(_0x417382);return _0x2bda63['setTemplate']({'tag':'span','children':[{'text':i(_0x417382,_0x5a080e?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x39fe5c,_0x56ba0a,_0x2bda63];}};class Jo extends _0x43effc{constructor(_0x4df94c){super(_0x4df94c),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x49dbb3=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x49dbb3['if']('isVisible','ck-hidden',_0x510b75=>!_0x510b75)]},'children':[{'text':_0x49dbb3['to']('text')}]});}}const Sa='ck-ai-chat-context-controls__url-form',Oa='ck-ai-chat-context-controls__url-input-section';class bo extends _0x43effc{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x599c8c){super(_0x599c8c),this['focusTracker']=new _0x25d272(),this['keystrokes']=new _0xfe6d51(),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 _0x4b849d({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x39f20c=>{this['focusTracker']['add'](_0x39f20c['element']),this['keystrokes']['listenTo'](_0x39f20c['element']);}),_0x27e72b({'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'](_0x1d31fc){this['urlInputField']['errorText']=_0x1d31fc,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x276cdb=new _0xcbb426(this['locale']);return _0x276cdb['set']({'icon':_0x1420c7,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':'ck-button-icon\x20ck-button-back'}),_0x276cdb;}['_createUrlInputField'](){const _0x47bea7=new _0x454e15(this['locale'],_0x42b133);return _0x47bea7['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x47bea7['fieldView']['set']({'placeholder':i(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x47bea7;}['_createConfirmButton'](){const _0x4e5740=new _0xcbb426(this['locale']);return _0x4e5740['set']({'icon':_0x16fc5d,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x4e5740;}['_setupTemplate'](){const _0x59c446=new _0xbcda8a(this['locale'],{'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x59c446['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Sa,'tabindex':'-1'},'children':[_0x59c446,{'tag':'div','attributes':{'class':Oa},'children':[this['urlInputField'],this['confirmButton']]}]});}['_setupEventHandlers'](){this['backButton']['on']('execute',()=>{this['clear'](),this['fire']('cancel');}),this['urlInputField']['fieldView']['on']('input',()=>{this['clearError'](),this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}),this['on']('submit',_0x2fde4c=>{_0x2fde4c['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x2dacd6,_0x570131)=>{this['clear'](),this['fire']('cancel'),_0x570131();});}['_handleSubmit'](){const _0x51d767=this['getValue']()['trim']();_0x51d767?this['_isValidUrl'](_0x51d767)?(this['clearError'](),this['fire']('submitUrl',_0x51d767)):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x245567=this['getValue']()['trim'](),_0x1bffab=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x245567['length']>0x0&&!_0x1bffab;}['_isValidUrl'](_0x3c2244){try{return!!new URL(_0x3c2244);}catch{return!0x1;}}}const Ra='ck-ai-chat-resources__item',Na='ck-ai-chat-resources__item--in-context',ka='ck-ai-chat-resources__item-title',ya='ck-ai-chat-resources__item__icon';class sc extends _0x3f0116{['resource'];['_titleView'];['_iconView'];constructor(_0x36d578,_0x61fc94){super(_0x36d578),this['resource']=_0x61fc94,this['set']('isInContext',!!_0x61fc94['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x52f020){if(_0x52f020['isInContext'])return _0x16fc5d;switch(_0x52f020['type']){case je['DOCUMENT']:return _0x584f93;case je['URL']:return _0x3ed6af;case je['FILE']:case je['TEXT']:return _0x18ec8e;default:return _0x1c2f3f;}}['highlightText'](_0x3928bb){if(!_0x3928bb||''===_0x3928bb['trim']())return void this['_titleView']['highlightText'](null);const _0x1d6b15=new RegExp(_0x54c692(_0x3928bb),'gi');this['_titleView']['highlightText'](_0x1d6b15);}['updateResourceState'](_0x2b5ef0){this['resource']['isInContext']=_0x2b5ef0,this['isInContext']=_0x2b5ef0,this['_updateIcon']();}['_createTitleView'](){const _0x2fa17b=new _0x407d13();return _0x2fa17b['text']=this['resource']['label'],_0x2fa17b['extendTemplate']({'tag':'span','attributes':{'class':[ka]}}),_0x2fa17b;}['_createIconView'](){const _0x14b982=new _0x4caa0b();return _0x14b982['content']=this['getResourceIcon'](this['resource']),_0x14b982;}['_setupTemplate'](){const _0x4d5886=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[Ra,_0x4d5886['if']('isVisible','ck-hidden',_0x12a43a=>!_0x12a43a),_0x4d5886['if']('isInContext',Na)]},'children':[{'tag':'div','attributes':{'class':[ya]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x4d5886['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const va='ck-ai-chat-resources__list';class qr extends _0x5bd1ba{['_source'];constructor(_0x216c77,_0x126dbd){super(_0x216c77),this['_source']=_0x126dbd,this['extendTemplate']({'attributes':{'class':[va]}});}['setResources'](_0x432ff8,_0xbe6930){this['items']['clear']();let _0x5ddc8a=_0x432ff8;if(this['_source']['useDefaultFiltering']&&_0xbe6930&&''!==_0xbe6930['trim']()){const _0x195bb8=new RegExp(_0xbe6930['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x5ddc8a=_0x432ff8['filter'](_0x12bd17=>_0x195bb8['test'](_0x12bd17['label']));}for(const _0x472ce6 of _0x5ddc8a){const _0x48c002=new sc(this['locale'],_0x472ce6);_0x48c002['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x472ce6);}),this['items']['add'](_0x48c002);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0xbe6930);}['highlightText'](_0x2417d5){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x4ff711=>{_0x4ff711['highlightText'](_0x2417d5);});}['updateResourceState'](_0x5f4185,_0x298bc7){for(const _0xa064f9 of this['items']){const _0x2e52f1=_0xa064f9;_0x2e52f1['resource']['id']===_0x5f4185&&_0x2e52f1['updateResourceState'](_0x298bc7);}}['_handleResourceSelection'](_0x107864,_0x2b9c1a){this['fire']('addResourceToContext',{'source':_0x107864,'resource':_0x2b9c1a});}}class Ur extends _0x454e15{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x307556){const t=_0x307556['t'],_0x5093ca={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x42b133,'label':i(_0x307556,'AI_CHAT_SEARCH_RESOURCES')};super(_0x307556,_0x5093ca['creator']),this['label']=_0x5093ca['label'],this['_viewConfig']=_0x5093ca,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x307556,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x5e59a3){this['fire']('search',_0x5e59a3);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x4caa0b(),this['iconView']['content']=_0x4f50f5,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x4a799b,t){this['resetButtonView']=new _0xcbb426(_0x4a799b),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x3a96a0,'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',_0x27a5f0=>!_0x27a5f0),this['fieldWrapperChildren']['add'](this['resetButtonView']),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-reset'}});}['_setupEventListeners'](){this['listenTo'](this['fieldView'],'input',()=>{this['search'](this['fieldView']['element']['value']);}),this['bind']('isEnabled')['to'](this);}}class Or extends _0x43effc{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x40846b,_0x2eae33){super(_0x40846b),this['_source']=_0x2eae33['source'],this['_searchInputVisibleFrom']=_0x2eae33['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 _0x317ee8([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new Ur(this['locale']);}['_createSearchSection'](){const _0x310929=new _0x43effc(this['locale']);return _0x310929['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0xfd3668,_0x106ab4)=>{this['loadResources'](_0x106ab4),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x106ab4);}),_0x310929;}['_createResourcesListView'](){const _0x270bc9=new qr(this['locale'],this['_source']);return _0x270bc9['delegate']('addResourceToContext')['to'](this),_0x270bc9['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x270bc9;}['_createSkeletonView'](){const _0x67ca44=new Pe(this['locale'],Be['aiChatResources']);return _0x67ca44['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x4f364d=>!_0x4f364d)]}}),_0x67ca44;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x264911){const _0x4d0427=_0xdc126c();this['_latestLoadResourcesUid']=_0x4d0427,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x264911,'uid':_0x4d0427}),this['isLoading']=!0x0;}['setResources'](_0x1dce85,_0x4505c3){if(_0x4505c3&&_0x4505c3!==this['_latestLoadResourcesUid'])return;const _0x58ceb4=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x1dce85,_0x58ceb4),_0x1dce85['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x1fab8d,_0x568f5f){this['_resourcesListView']['updateResourceState'](_0x1fab8d,_0x568f5f);}}const xa='ck-ai-chat-context-controls__source-balloon-panel',La='ck-button-icon\x20ck-button-back',Ha='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Ao{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x5ade79,_0x253a13,_0xe1977d){this['_locale']=_0x5ade79,this['_bodyCollection']=_0x253a13,this['_config']=_0xe1977d;}['showSourceResourcesBalloon'](_0x37159a){let _0x2af5ec=this['_sourceResourceBalloons']['get'](_0x37159a['id']);_0x2af5ec||(_0x2af5ec=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x37159a['id'],_0x2af5ec),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x2af5ec)),this['_addSourceResourceContent'](_0x2af5ec,_0x37159a),_0x2af5ec['show']();const _0x2106d6=this['_config']['getTargetElement']();_0x2106d6&&_0x2af5ec['pin']({'target':_0x2106d6,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x1a0129,_0x3e412c,_0x5ef9e3){const _0x55e316=this['_sourceResourceBalloons']['get'](_0x1a0129);if(!_0x55e316)return;const _0x5f5108=this['_getResourcesViewFromBalloon'](_0x55e316);_0x5f5108&&(_0x5f5108['setResources'](_0x3e412c,_0x5ef9e3),_0x5f5108['once']('change:isLoading',()=>{_0x55e316['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x29ceba){const _0x107cdb=this['_sourceResourceBalloons']['get'](_0x29ceba);_0x107cdb&&requestAnimationFrame(()=>{_0x107cdb['hide'](),this['_sourceResourceBalloons']['delete'](_0x29ceba),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x4d7605 of this['_sourceResourceBalloons']['values']())if(_0x4d7605['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x1b3b53,_0x2dff56,_0x35c22d){const _0x593112=this['_sourceResourceBalloons']['get'](_0x1b3b53);if(!_0x593112||!_0x593112['isVisible'])return;const _0x2a19fb=this['_config']['getTargetElement']();if(!_0x2a19fb)return;_0x593112['pin']({'target':_0x2a19fb,'limiter':this['_config']['getLimiterElement']()});const _0x32f5ae=this['_getResourcesViewFromBalloon'](_0x593112);_0x32f5ae&&_0x32f5ae['updateResourceState'](_0x2dff56,_0x35c22d);}['destroy'](){for(const _0x387a3a of this['_sourceResourceBalloons']['values']())_0x387a3a['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x1c165d=new _0x2ae23a(this['_locale']);return _0x1c165d['extendTemplate']({'attributes':{'class':xa}}),this['_bodyCollection']['add'](_0x1c165d),_0x1c165d;}['_addSourceResourceContent'](_0x20aa82,_0x361095){_0x20aa82['content']['clear']();const _0x1db7cb=this['_createBalloonHeader'](_0x20aa82,_0x361095);_0x20aa82['content']['add'](_0x1db7cb);const _0x979e80=this['_createBalloonResourcesView'](_0x361095);_0x20aa82['content']['add'](_0x979e80);}['_createBalloonHeader'](_0x381564,_0x478303){const _0x427e5c=this['_createBackButton'](_0x381564),_0x51b19a=new _0xbcda8a(this['_locale'],{'label':_0x478303['label'],'class':Ha});return _0x51b19a['children']['add'](_0x427e5c,0x0),_0x51b19a;}['_createBackButton'](_0x250cf3){const _0x4414fe=new _0xcbb426(this['_locale']);return _0x4414fe['set']({'icon':_0x1420c7,'tooltip':i(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':La}),_0x4414fe['on']('execute',()=>{_0x250cf3['hide'](),this['_config']['onBackToContext']();}),_0x4414fe;}['_createBalloonResourcesView'](_0x4f2aa0){const _0x1849e0=new Or(this['_locale'],{'source':_0x4f2aa0,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x1849e0['on']('loadSourceResources',(_0x524457,_0x25cbe6)=>{this['_config']['onLoadSourceResources'](_0x25cbe6);}),_0x1849e0['on']('addResourceToContext',(_0x345b24,_0x2e9490)=>{this['_config']['onResourceSelected'](_0x2e9490['source'],_0x2e9490['resource']),this['closeSourceResourceBalloon'](_0x4f2aa0['id']);}),_0x1849e0;}['_getResourcesViewFromBalloon'](_0x2e88df){const _0xa9c05c=_0x2e88df['content']['get'](0x1);return _0xa9c05c instanceof Or?_0xa9c05c:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x14ee35){_0x4b855c({'emitter':_0x14ee35,'contextElements':[_0x14ee35['element']],'callback':()=>{_0x14ee35['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x14ee35['isVisible']});}}const gs=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources'],ko='ck-ai-chat-context-controls',Eo='ck-ai-chat-context-controls__pending-contexts',vo='ck-ai-chat-context-controls__add-context-balloon-panel',Vo='ck-ai-chat-context-controls__add-context-button',Io='ck-ai-chat-context-controls__url-balloon-panel',Po='ck-ai-chat-context-controls__balloon-button',Ro='ck-ai-chat-context-controls__balloon-button-source',Uo='ck-ai-chat-controls-button',Lo='ck-ai-chat-context-chips-wrapper-balloon',No='ck-ai-chat-controls_context_show-more-button',Oo='ck-ai-chat-context-controls__show-more-balloon-panel',Mo='ck-ai-chat',Ho=[_0x2ae23a['defaultPositions']['northArrowSouthWest'],_0x2ae23a['defaultPositions']['northArrowSouth'],_0x2ae23a['defaultPositions']['northArrowSouthEast'],_0x2ae23a['defaultPositions']['southArrowNorthWest'],_0x2ae23a['defaultPositions']['southArrowNorth'],_0x2ae23a['defaultPositions']['southArrowNorthEast']];class bs extends _0x43effc{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['bodyCollection'];constructor(_0x4ee439,_0x2c62cd){super(_0x4ee439),this['bodyCollection']=_0x2c62cd['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x4ee439),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x4ee439),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x4ee439),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x4ee439,_0x2c62cd);const _0x59c663={'cssClasses':{'showMoreButton':No,'showMoreBalloon':Oo,'overflowContainer':Lo,'controlsButton':Uo}};this['_overflowManager']=new To(_0x4ee439,this['_currentContextsChips'],_0x59c663,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'](_0xb4df79,_0x37fca7){const _0x20a02c=this['_createContextButton'](_0xb4df79,'current',!0x0,_0x37fca7);this['_addContextToCollection'](_0x20a02c,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x17b9e9){this['_removeContextFromCollection'](_0x17b9e9,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x17b9e9,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x592c4a,_0x193443){let _0x5f0a5f=this['_currentContextsChips']['find'](_0x48e6c2=>_0x48e6c2['id']===_0x592c4a);_0x5f0a5f||(_0x5f0a5f=this['_overflowManager']['overflowChips']['find'](_0x5c8965=>_0x5c8965['id']===_0x592c4a)),_0x5f0a5f&&(_0x5f0a5f['isLoading']=_0x193443);}['setConversationContext'](_0x3c1df3){this['_conversationContextsChips']['clear']();for(const _0x101245 of _0x3c1df3){const _0x19ea66=this['_createContextButton'](_0x101245,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x19ea66,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x144a6d,_0x42b5f8,_0x3ba428){this['_resourcesBalloonView']['updateResourceState'](_0x144a6d,_0x42b5f8,_0x3ba428);}['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'](_0x3981fe){this['_resourcesBalloonView']['showSourceResourcesBalloon'](_0x3981fe),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x2f3f61,_0x24e649,_0x5848c3,_0x1d8772){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x2f3f61,_0x5848c3,_0x1d8772);}['closeSourceResourceBalloon'](_0x226edd){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x226edd),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x278e26){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x278e26),this['_setAddContextButtonEnabled'](_0x278e26);}['_setAddContextButtonEnabled'](_0x3bb80a){const _0x2bb0c3=!_0x3bb80a['document']['isHidden']&&_0x3bb80a['document']['enabled'],_0x400400=_0x3bb80a['urls']['enabled'],_0x52737a=_0x3bb80a['files']['enabled'];this['addContextButtonView']['isEnabled']=_0x2bb0c3||_0x400400||_0x52737a;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[ko,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Eo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x4a2420){const _0xa82c4b=new _0xcbb426(_0x4a2420);return _0xa82c4b['set']({'label':i(_0x4a2420,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Uo+'\x20'+Vo,'icon':_0x40e1b5,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0xa82c4b;}['_createAddContextBalloonPanelView'](_0x97d24b){return this['_createBaseBalloonPanel'](_0x97d24b,vo);}['_createUrlBalloonPanelView'](_0x3b4891){const _0x32d275=this['_createBaseBalloonPanel'](_0x3b4891,Io);return this['_addUrlContent'](_0x32d275,_0x3b4891),_0x32d275;}['_createResourcesBalloonView'](_0x6408eb,_0x294dfe){const _0x45b042={'searchInputVisibleFrom':_0x294dfe['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ho});},'onResourceSelected':(_0x2e6d13,_0x493f74)=>{this['fire']('addResourceToContext',{'source':_0x2e6d13,'resource':_0x493f74});},'onLoadSourceResources':_0x29dec6=>{this['fire']('loadSourceResources',_0x29dec6);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Ao(_0x6408eb,_0x294dfe['bodyCollection'],_0x45b042);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Mo)||document['body'];}['_createBaseBalloonPanel'](_0x4dbd72,_0x2ccffa){const _0x158f52=new _0x2ae23a(_0x4dbd72);return _0x158f52['extendTemplate']({'attributes':{'class':_0x2ccffa}}),this['bodyCollection']['add'](_0x158f52),_0x158f52;}['_setBalloonPanelContent'](_0x1fcba8,_0x107568,_0x5c28f8){if(_0x1fcba8['content']['clear'](),!_0x5c28f8['document']['isHidden']&&_0x5c28f8['document']['enabled']){const _0x4609a0=this['_createBalloonButton'](_0x107568,{'label':i(_0x107568,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x584f93});_0x4609a0['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x1fcba8['content']['add'](_0x4609a0);}if(_0x5c28f8['urls']['enabled']){const _0x10e32e=this['_createBalloonButton'](_0x107568,{'label':i(_0x107568,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x3ed6af});_0x10e32e['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ho}),this['_urlInputView']['focus']();}),_0x1fcba8['content']['add'](_0x10e32e);}if(_0x5c28f8['files']['enabled']){const _0x3a0658=new _0x486231(_0x107568);_0x3a0658['set']({'label':i(_0x107568,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x26357d,'withText':!0x0,'tooltip':!0x0,'class':Po,'allowMultipleFiles':!0x0}),_0x3a0658['on']('done',(_0x4c6386,_0x2508bc)=>{this['fire']('addFileToContext',_0x2508bc),this['hideAddContextBalloonPanel']();}),_0x3a0658['tooltip']=!0x0,_0x1fcba8['content']['add'](_0x3a0658);}for(const _0x9785cc of _0x5c28f8['sources']){const _0xdfe6e=this['_createBalloonButton'](_0x107568,{'label':_0x9785cc['label'],'icon':_0x9785cc['icon']||_0x1c2f3f,'type':'source'});_0x1fcba8['content']['add'](_0xdfe6e),_0xdfe6e['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon'](_0x9785cc);});}}['_addUrlContent'](_0x1111c3,_0xc4c4d){this['_urlInputView']=new bo(_0xc4c4d),this['_urlInputView']['on']('submitUrl',(_0x507905,_0x12113c)=>{this['_handleUrlSubmit'](_0x12113c);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ho});}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ho});}),_0x1111c3['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x43ab5c,_0x14dfc4){const _0x1615fc='source'===_0x14dfc4['type']?new Pa(_0x43ab5c):new _0xcbb426(_0x43ab5c);return _0x1615fc['set']({'label':_0x14dfc4['label'],'icon':_0x14dfc4['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Po}),_0x1615fc;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x4b855c({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x17dc7c){const _0x21396c=this['_addContextBalloonConfig'];_0x21396c['buttonView']['isOn']=_0x17dc7c,_0x17dc7c?_0x21396c['balloonView']['show']():_0x21396c['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0xc10d51,buttonView:_0x2c0199,hideMethod:_0x48c0b9}=this['_addContextBalloonConfig'];_0x4b855c({'emitter':_0xc10d51,'contextElements':[_0xc10d51['element'],_0x2c0199['element']],'callback':()=>{_0x48c0b9();},'activator':()=>_0x2c0199['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x702dce,_0x98299e,_0x344800=!0x1,_0xf77137=!0x1){const _0x487b86='conversation'===_0x98299e||!0x0===_0x702dce['isReadOnly'],_0x1e8f45=new Bo(this['locale'],_0x702dce,_0x487b86,_0x344800,_0xf77137);return _0x487b86||_0x1e8f45['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x1e8f45['id']);}),_0x1e8f45;}['_addContextToCollection'](_0x2c5ae6,_0x421bdc){_0x421bdc['add'](_0x2c5ae6,0x0);}['_removeContextFromCollection'](_0x13a45c,_0x570391){const _0x24b3b1=_0x570391['find'](_0x2efe6c=>_0x2efe6c['id']===_0x13a45c);_0x24b3b1&&_0x570391['remove'](_0x24b3b1);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ho}));}['_handleUrlSubmit'](_0x15d70e){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x15d70e);}}class Pa extends _0xcbb426{['arrowView'];constructor(_0x5daf54){super(_0x5daf54),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Ro]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x106c73=new _0x4caa0b();return _0x106c73['content']=_0x53f601,_0x106c73['extendTemplate']({'attributes':{'class':Ro+'__arrow'}}),_0x106c73;}}class _s extends _0x43effc{['_cancelButtonView'];['_loaderView'];constructor(_0x30ddb8){super(_0x30ddb8),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 _0x5d063a=new _0xcbb426(this['locale']);return _0x5d063a['set']({'label':i(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x171167}),_0x5d063a['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x5d063a;}['_createLoaderView'](){const _0x7225d2=new _0x43effc(this['locale']);return _0x7225d2['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}}]},{'text':i(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x7225d2;}}class ji extends _0x43effc{['_displayedModels']=[];['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x392f7a,_0x38334b){super(_0x392f7a),this['_contextPanelView']=this['_createContextPanelView'](_0x392f7a,{'bodyCollection':_0x38334b['bodyCollection'],'searchInputVisibleFrom':_0x38334b['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x392f7a),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x392f7a),this['_loaderView']=this['_createLoaderView'](_0x392f7a),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x392f7a),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'](...gs)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x19fa7b=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x19fa7b['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x19fa7b['if']('isLoading','ck-hidden',_0x3b2460=>_0x3b2460||!this['isModelAvailable']),_0x19fa7b['if']('isModelAvailable','ck-hidden',_0x1dd672=>!_0x1dd672||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x19fa7b['if']('isLoading','ck-hidden',_0x55fb8b=>!_0x55fb8b)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x19fa7b['if']('isModelAvailable','ck-hidden',_0x400b14=>_0x400b14)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x4b855c({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x12e6ad,_0x29e699){return new bs(_0x12e6ad,_0x29e699);}['_createPromptInputView'](_0x4fa7bd){return new ps(_0x4fa7bd,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x1aad33){return new ms(_0x1aad33);}['_createLoaderView'](_0x41170b){return new _s(_0x41170b);}['_createModelUnavailableMessageView'](_0x19426a){const _0x2311c3=new ws(_0x19426a);return _0x2311c3['delegate']('startConversation')['to'](this),_0x2311c3;}['_handlePromptInputFocus'](_0x411925,_0x2bab2f,_0x3e77c2){_0x3e77c2?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x3ba8ce,_0x50bae2){this['_contextPanelView']['addContextItem'](_0x3ba8ce,_0x50bae2);}['removeContextItem'](_0x1ec102){this['_contextPanelView']['removeContextItem'](_0x1ec102);}['setContextItemLoading'](_0x1c5faa,_0x180c13){this['_contextPanelView']['setContextItemLoading'](_0x1c5faa,_0x180c13);}['setIsUploadInProgress'](_0x42375a){this['_promptInputView']['setIsUploadInProgress'](_0x42375a);}['setConversationContext'](_0x44df66){this['_contextPanelView']['setConversationContext'](_0x44df66);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x5917f4,_0x558908,_0x1920d8){this['_contextPanelView']['updateResourceState'](_0x5917f4,_0x558908,_0x1920d8);}['setWebSearch'](_0x4ff67f){this['_promptCapabilitiesView']['setWebSearch'](_0x4ff67f);}['setReasoning'](_0x450a49){this['_promptCapabilitiesView']['setReasoning'](_0x450a49);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x49b68e){this['_contextPanelView']['setAddContextOptions'](_0x49b68e);}['setInputPlaceholder'](_0x11c600){this['_promptInputView']['setPlaceholderText'](_0x11c600);}['setModelList'](_0x2cecd3,_0x5f5abf){this['_displayedModels']=_0x2cecd3,this['_promptCapabilitiesView']['setModelList'](_0x2cecd3,_0x5f5abf);}['setModel'](_0x2e50fd){(_0x2e50fd?this['_displayedModels']['find'](_0x2bdaab=>_0x2bdaab['id']===_0x2e50fd['id']):null)?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x2e50fd)):_0x2e50fd?.['id']['startsWith']('agent')?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](this['_displayedModels'][0x0])):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0xda8f2e){this['_promptCapabilitiesView']['disableModelSelector'](_0xda8f2e);}['populateSourceResourceBalloon'](_0x2b812d,_0x2cf7b0,_0x22adfb,_0x3010ec){this['_contextPanelView']['populateSourceResourceBalloon'](_0x2b812d,_0x2cf7b0,_0x22adfb,_0x3010ec);}['closeSourceResourceBalloon'](_0x2fc503){this['_contextPanelView']['closeSourceResourceBalloon'](_0x2fc503);}['focusPromptInput'](){this['_promptInputView']['focus']();}}class ws extends _0x43effc{constructor(_0x588fdc){super(_0x588fdc);const _0x5212b0=new _0xcbb426(_0x588fdc);_0x5212b0['set']({'label':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x5212b0['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x5212b0]}]});}}class ki extends _0xbcda8a{['conversationStartButton'];['resizeButton'];constructor(_0x770052,_0x4067a2){super(_0x770052,{'label':i(_0x770052,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':Ht}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x770052),this['children']['add'](this['conversationStartButton']),_0x4067a2&&(this['resizeButton']=ks(_0x770052,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x2f0ba6){const _0x5696fc=new _0xcbb426(_0x2f0ba6);return _0x5696fc['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x357a3c,'class':'ck-ai-chat__start-conversation'}),_0x5696fc['on']('execute',()=>{this['fire']('startConversation');}),_0x5696fc;}}class bi extends _0x43effc{constructor(_0x214883){super(_0x214883),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':i(_0x214883,'AI_DISCLAIMER_TEXT')}]}]});}}class bt extends _0x43effc{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x39b500,_0x38ec8b){super(_0x39b500),this['_bodyCollection']=new _0x44dc72(_0x39b500),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new ki(_0x39b500,_0x38ec8b['showResizeButton']),this['chatHeader']['delegate'](...Mt)['to'](this),this['chatFeed']=new pi(_0x39b500,this['_bodyCollection']),this['chatFeed']['delegate'](...Mt)['to'](this),this['chatControls']=new ji(_0x39b500,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x38ec8b['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...Mt)['to'](this),this['chatDisclaimer']=new bi(_0x39b500),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x39b500['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x540f2f,_0x2038ab,_0x127888,_0x2e7ab0){this['chatControls']['populateSourceResourceBalloon'](_0x540f2f,_0x2038ab,_0x127888,_0x2e7ab0);}['closeSourceResourceBalloon'](_0xb161c9){this['chatControls']['closeSourceResourceBalloon'](_0xb161c9);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class gt extends ot{static get['requires'](){return[Ct];}['_view'];static get['pluginName'](){return'AIChatUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['feedItemRenderingStrategy']='streaming';['showDiff']=!0x0;['_promiseQueue'];['_interactionPromiseResolver'];['_titleAnimationInterval']=void 0x0;['_isTrackChangesCommandValueBound']=!0x1;constructor(_0x43c3d4){super(_0x43c3d4);const _0x316306=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new W(),this['_view']=new bt(this['context']['locale'],{'showResizeButton':_0x316306['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...Mt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x14da55,{showDiff:_0x5972c1})=>{this['showDiff']=_0x5972c1;}),_0x316306['view']['addTab']({'id':'chat','buttonLabel':i(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':Ht,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x4f7215=>_0x4f7215),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x93144b=>_0x93144b),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x455233){this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x455233['availableModels'],!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':i(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE')});}['addFeedItemStaticMessage']({id:_0x16f7cb,staticMessage:_0x1a7987}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x16f7cb,'initialContent':'<p>'+_0x1a7987+'</p>'});}['addFeedItemUserMessage'](_0xb189a4){const _0x1bcbc5=_0xb189a4['quickActionData']?.['displayedPrompt']||_0xb189a4['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0xb189a4['contextItems']['values']()),'initialContent':'<p>'+_0x1bcbc5+'</p>','id':_0xb189a4['id']});}['addFeedItemError']({errorMessage:_0x930879,id:_0x48e9c7}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x930879+'</p>','id':_0x48e9c7});}['addFeedItemAIReply'](_0x285c54){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x285c54['interactionId']+':'+_0x285c54['id']}),this['setLoadingMessage'](null);});}async['addFeedItemAISuggestion'](_0x4ca9a3){const _0x2a5c7d=ut(this['context']);let _0x166f4f=_0x2a5c7d['config']['get']('ai.availableReplyActions')||[...et];if(_0x2a5c7d['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x52fdad=_0x2a5c7d['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x52fdad,'value');}}else _0x166f4f=_0x166f4f['filter'](_0x33e48b=>'insertSuggestion'!=_0x33e48b);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x4ca9a3['interactionId']+':'+_0x4ca9a3['id'],'areActionsDisabled':_0x4ca9a3['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x166f4f}),this['setLoadingMessage'](null);});}['addFeedInteractionHeader'](_0xc52268,_0x586f32){const _0x12cbeb=this['_view']['chatFeed']['children']['last'];if(_0x12cbeb instanceof Lt)return this['_view']['chatFeed']['children']['remove'](_0x12cbeb),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0xc52268['id'],'capabilities':{'isWebSearchEnabled':_0x12cbeb['capabilities']['isWebSearchEnabled']||_0x586f32['isWebSearchEnabled'],'isReasoningEnabled':_0x12cbeb['capabilities']['isReasoningEnabled']||_0x586f32['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0xc52268['id'],'capabilities':_0x586f32});}['updateFeedInteractionHeader'](_0x249f2b){const _0xa03360=this['_view']['chatFeed']['children']['find'](_0x6bc019=>_0x6bc019['options']['id']==_0x249f2b['id']&&_0x6bc019 instanceof Lt);_0xa03360&&_0xa03360['set']('isVisible',_0x249f2b['isVisible']);}async['updateFeedItemAIReplyContent'](_0x20e2b0){const _0x1921a4=_0x20e2b0['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x165056=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x20e2b0,'abortSignal':_0x165056,'renderingStrategy':_0x1921a4}),_0x20e2b0['isDone']&&this['markFeedItemAsDone'](_0x20e2b0['id']);});}['updateFeedItemAIReplySources'](_0x24eb5e,_0x1945e4){this['_view']['chatFeed']['updateWebSources'](_0x24eb5e,_0x1945e4);}async['updateFeedItemAIReplySuggestionContent'](_0x18fdf9){const _0x123dd2=_0x18fdf9['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x3ad32b=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x18fdf9,'abortSignal':_0x3ad32b,'renderingStrategy':_0x123dd2}),_0x18fdf9['isDone']&&this['markFeedItemAsDone'](_0x18fdf9['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x1ddbc7){this['_view']['chatFeed']['updateSuggestionPartState'](_0x1ddbc7);}['markFeedItemAsDone'](_0xc9699f){this['_view']['chatFeed']['markItemAsDone'](_0xc9699f);}['removeFeedInteraction'](_0xb45d95){this['_view']['chatFeed']['getItemIds']()['filter'](_0x4e49bd=>_0x4e49bd['startsWith'](_0xb45d95))['forEach'](_0x3df760=>this['_view']['chatFeed']['removeItem'](_0x3df760));}['startInteraction'](){this['setLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1}),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x454968){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x5611db=>_0x5611db['startsWith'](_0x454968['id']))['forEach'](_0x2c9661=>this['markFeedItemAsDone'](_0x2c9661)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x5b8b37,_0x5422ab){this['_view']['chatControls']['addContextItem'](_0x5b8b37,_0x5422ab);}['removeContextItem'](_0xc9d999){this['_view']['chatControls']['removeContextItem'](_0xc9d999);}['setContextItemLoading'](_0x2834ae,_0x21a9c3){this['_view']['chatControls']['setContextItemLoading'](_0x2834ae,_0x21a9c3);}['setIsUploadInProgress'](_0x273f9d){this['_view']['chatControls']['setIsUploadInProgress'](_0x273f9d);}['setConversationContext'](_0x3044e0){this['_view']['chatControls']['setConversationContext'](_0x3044e0);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x2138e0,_0x46e4fa,_0xa5723e){this['_view']['chatControls']['updateResourceState'](_0x2138e0,_0x46e4fa,_0xa5723e);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x3db65a){this['_view']['chatControls']['setAddContextOptions'](_0x3db65a);}['updateCapabilities'](_0x445690){this['_view']['chatControls']['setWebSearch'](_0x445690['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x445690['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x445690));}['setSelectedModel'](_0x47b9e7,_0x11f2ef){this['_view']['chatControls']['setModel'](_0x47b9e7),_0x11f2ef&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x5eee62){this['feedItemRenderingStrategy']=_0x5eee62;}['toggleLoadingSkeleton'](_0x2b4a17){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x2b4a17);}['resetConversationTitle'](){this['setConversationTitle'](i(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x37ad5d,_0x49f641=!0x1){if(_0x49f641&&!Pt()&&_0x37ad5d['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x37ad5d);this['_view']['chatHeader']['label']=_0x37ad5d;}['setLoadingMessage'](_0x18c0fa){const _0xcd4d7b=this['_getLoadingMessage'](_0x18c0fa);this['_view']['chatFeed']['setLoadingMessage'](_0xcd4d7b);}['_animateConversationTitle'](_0x182e62){let _0x35c8ac=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x182e62[_0x35c8ac],_0x35c8ac++,_0x35c8ac===_0x182e62['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x2873a3){this['_view']['chatHeader']['isMaximized']=_0x2873a3;}['_getLoadingMessage'](_0xf79960){return _0xf79960?_0xf79960['isWebSearchEnabled']&&_0xf79960['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0xf79960['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0xf79960['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR'):'';}['_getInputPlaceholder'](_0x4d6b53){return _0x4d6b53?_0x4d6b53['isWebSearchEnabled']&&_0x4d6b53['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x4d6b53['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x4d6b53['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x1d7062,_0x3af516,_0x23bf7c,_0x5efaf4){this['_view']['populateSourceResourceBalloon'](_0x1d7062,_0x3af516,_0x23bf7c,_0x5efaf4);}['closeSourceResourceBalloon'](_0x4dd7eb){this['_view']['closeSourceResourceBalloon'](_0x4dd7eb);}['focusPromptInput'](){this['_view']['chatControls']['focusPromptInput']();}['scrollFeedToSuggestion'](_0xf092d0,_0x5bf42a){this['_view']['chatFeed']['scrollToSuggestion'](_0xf092d0,_0x5bf42a);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class Mi extends _0x5bd1ba{['sections'];constructor(_0x3ebc8c,_0x382935){super(_0x3ebc8c),this['sections']=_0x382935,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x5cce19){let _0x3f494d=0x0,_0x1b360f=0x0;for(const _0x575849 of this['sections']){const {resultsCount:_0x3cecf4,totalItemsCount:_0xb31a10}=_0x575849['filter'](_0x5cce19);_0x3f494d+=_0x3cecf4,_0x1b360f+=_0xb31a10;}return{'resultsCount':_0x3f494d,'totalItemsCount':_0x1b360f};}}class xi extends _0x3f0116{['title'];['itemsViews'];['_itemsListView'];constructor(_0x4ab95e,{title:_0x58f440,items:_0x5755eb}){super(_0x4ab95e);const _0x261181=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x58f440,this['itemsViews']=_0x5755eb;const _0x12c30e=new _0x43effc(_0x4ab95e);_0x12c30e['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x5bd1ba(_0x4ab95e),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x261181['if']('isVisible','ck-hidden',_0x4c2be8=>!_0x4c2be8)]},'children':[_0x12c30e,this['_itemsListView']]});}['filter'](_0x498d32){const _0x268e65=this['itemsViews']['length'];let _0x3351e5=0x0;for(const _0x2c3804 of this['itemsViews']){if(_0x498d32){const _0x59a5e9=_0x2c3804['isMatching'](_0x498d32);_0x2c3804['isVisible']=!!_0x59a5e9,_0x2c3804['highlightText'](_0x498d32);}else _0x2c3804['isVisible']=!0x0,_0x2c3804['highlightText'](null);_0x2c3804['isVisible']&&_0x3351e5++;}return this['isVisible']=_0x3351e5>0x0,{'resultsCount':_0x3351e5,'totalItemsCount':_0x268e65};}['getItem'](_0x9894c3){return this['itemsViews']['find'](_0x11fe2a=>_0x11fe2a['id']===_0x9894c3);}['removeItem'](_0x403596){const _0x302370=this['itemsViews']['indexOf'](_0x403596);-0x1!==_0x302370&&(this['itemsViews']['splice'](_0x302370,0x1),this['_itemsListView']['items']['remove'](_0x403596));}}class Li extends/* #__PURE__ -- @preserve */
27
+ _0x57d898(_0x3f0116){['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(_0x3cd637,_0x1f0860){super(_0x3cd637);const _0x32bdc4=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x1f0860['pinned']),this['set']('loadingState',null),this['id']=_0x1f0860['id'];const {title:_0x854df4,createdAt:_0x33d221,active:_0x193eff=!0x1}=_0x1f0860;this['_titleView']=new _0x407d13(),this['_titleView']['text']=_0x854df4,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x3c26b6=this['_createCheckView'](),_0x266f8e=this['_createPinButtonView'](_0x3cd637),_0x65d795=this['_createMenuDropdownView'](),_0x4b4fe5=this['_createEditInputView'](_0x3cd637,_0x854df4),_0x212437=this['_createAcceptEditButtonView'](_0x3cd637,_0x4b4fe5),_0x48eb95=this['_createCancelEditButtonView'](_0x3cd637,_0x4b4fe5);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x266f8e),this['actions']['add'](_0x65d795),this['on']('change:isEdit',(_0x5add2b,_0x57ca9a,_0x5cccc4)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x5cccc4?(this['actions']['add'](_0x212437),this['actions']['add'](_0x48eb95),this['mainContent']['add'](_0x4b4fe5),_0x4b4fe5['element']['focus']()):(this['actions']['add'](_0x266f8e),this['actions']['add'](_0x65d795),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x193eff?'ck-ai-chat-history__item--active':'',_0x32bdc4['if']('isVisible','ck-hidden',_0x3beb84=>!_0x3beb84),_0x32bdc4['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',_0x32bdc4['if']('loadingState','ck-hidden',_0x1a1cca=>!!_0x1a1cca)]},'children':_0x193eff?[_0x3c26b6]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x32bdc4['if']('loadingState','ck-hidden',_0x2fb936=>!_0x2fb936)]},'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',_0x32bdc4['if']('loadingState','ck-hidden',_0x20e059=>!!_0x20e059)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x32bdc4['if']('loadingState','ck-hidden',_0x50e79=>!_0x50e79)]},'children':[{'text':_0x32bdc4['to']('loadingState',_0x4beb28=>_0x4beb28?i(this['locale'],Li['LOADING_LABELS'][_0x4beb28]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x33d221]}]},{'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'](_0x5c68e0){this['_titleView']['text']=_0x469020(_0x5c68e0);}['updateLoadingState'](_0x416ffa,_0x56acfc){this['set']('loadingState',_0x56acfc?_0x416ffa:null);}['_createCheckView'](){const _0x84eff9=new _0x4caa0b();return _0x84eff9['set']({'content':_0x3cb840}),_0x84eff9;}['_createPinButtonView'](_0x527077){const _0x27889b=new _0xcbb426(_0x527077);return _0x27889b['set']({'label':i(_0x527077,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x39ada3,'withText':!0x1,'tooltip':!0x0}),_0x27889b['bind']('isOn')['to'](this,'pinned'),_0x27889b['on']('execute',()=>{const _0x52e638=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x52e638});}),_0x27889b;}['_createMenuDropdownView'](){const _0x20c79f=_0x2e287a(this['locale'],_0x1fb857),_0x39c9ff=_0x20c79f['panelView']['children'];_0x20c79f['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x16c5df}),_0x20c79f['panelPosition']='sw';const _0x561b65=new _0xcbb426(this['locale']);_0x561b65['label']=i(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x561b65['withText']=!0x0,_0x561b65['on']('execute',()=>{this['isEdit']=!0x0;});const _0x91be65=new _0xcbb426(this['locale']);_0x91be65['label']=i(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x91be65['withText']=!0x0,_0x91be65['on']('execute',()=>{this['showConfirm'](i(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x5b6d0d=new _0x5bd1ba(this['locale']),_0x5994b8=new _0x3f0116(this['locale']);_0x5994b8['children']['add'](_0x561b65);const _0x25bb43=new _0x3f0116(this['locale']);return _0x25bb43['children']['add'](_0x91be65),_0x5b6d0d['items']['addMany']([_0x5994b8,_0x25bb43]),_0x39c9ff['add'](_0x5b6d0d),_0x20c79f;}['_createEditInputView'](_0x48f746,_0x23502c){const _0x31cec4=new _0xa4bda4(_0x48f746),_0x39ab5c=_0x31cec4['bindTemplate'];return _0x31cec4['value']=_0x23502c,_0x31cec4['extendTemplate']({'on':{'keydown':_0x39ab5c['to'](_0x57663f=>{'Enter'==_0x57663f['key']&&this['_commitEditInputValue'](_0x31cec4);})}}),_0x31cec4;}['_createAcceptEditButtonView'](_0x2b7847,_0x31bf25){const _0x288e69=new _0xcbb426(_0x2b7847);return _0x288e69['set']({'icon':_0x3cb840,'withText':!0x1,'tooltip':i(_0x2b7847,'AI_CHAT_HISTORY_ACCEPT')}),_0x288e69['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x288e69['on']('execute',()=>{this['_commitEditInputValue'](_0x31bf25);}),_0x288e69;}['_commitEditInputValue'](_0x7410c){const _0x366af2=_0x7410c['element']['value']||'';this['_titleView']['text']=_0x366af2,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x366af2});}['_createCancelEditButtonView'](_0x1885da,_0x151502){const _0x4d094f=new _0xcbb426(_0x1885da);return _0x4d094f['set']({'icon':_0x3a96a0,'withText':!0x1,'tooltip':i(_0x1885da,'AI_CHAT_HISTORY_CANCEL')}),_0x4d094f['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x4d094f['on']('execute',()=>{this['isEdit']=!0x1,_0x151502['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x4d094f;}['_createSpinnerView'](){const _0x4d87cb=new We('tiny');return _0x4d87cb['isVisible']=!0x0,_0x4d87cb;}['isMatching'](_0x3dacd5){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x3dacd5)?{'title':!0x0}:null;}['highlightText'](_0x334b1a){this['_titleView']['highlightText'](_0x334b1a);}}class kt extends _0x43effc{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x1d595f,_0x4deef4){super(_0x1d595f),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 _0x5c8eb4=new _0xbcda8a(_0x1d595f,{'label':i(_0x1d595f,'AI_CHAT_HISTORY_HEADING'),'icon':Ut,'class':'ck-ai-header\x20ck-ai-header_history'});_0x4deef4&&(this['resizeButton']=ks(_0x1d595f,this),_0x5c8eb4['children']['add'](this['resizeButton'])),this['sectionsView']=new Mi(_0x1d595f,[]),this['sectionsView']['delegate'](...Yi)['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',_0x3ad8ad=>!_0x3ad8ad)]}}),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':[_0x5c8eb4,{'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 _0x27bd7a=new _0x1f1a68(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x17328c=>i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x17328c),'secondary':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x548e51=this['_createErrorView']();return _0x548e51['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x5603c8=>!_0x5603c8)]}}),_0x27bd7a['on']('render',()=>{_0x27bd7a['children']['add'](_0x548e51,0x1);}),_0x27bd7a['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x249333=>!_0x249333)]}}),_0x27bd7a;}['_createSkeletonView'](){const _0x4315d6=new Pe(this['locale'],Be['aiHistory']);return _0x4315d6['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x2bf249=>!_0x2bf249)]}}),_0x4315d6;}['_createErrorView'](){const _0x3ab89d=new _0x43effc(this['locale']),_0x1501dd=new _0xcbb426(this['locale']);_0x1501dd['set']({'withText':!0x1,'icon':_0x3a96a0,'class':'ck-ai-notification_error__dismiss-button'}),_0x1501dd['bind']('isVisible')['to'](this,'hasItems',_0x71ce0d=>!!_0x71ce0d),_0x1501dd['on']('execute',()=>{this['errorMessage']='';});const _0x5515ad=this['bindTemplate'];return _0x3ab89d['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x5515ad['to']('errorMessage')}]},_0x1501dd]}),_0x3ab89d;}['_createEmptyStateView'](){const _0x3581c9=new _0xcbb426(this['locale']);_0x3581c9['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x357a3c,'class':'ck-ai-chat__start-conversation'}),_0x3581c9['on']('execute',()=>{this['fire']('openChat');});const _0x1e99cc=new _0x43effc(this['locale']);return _0x1e99cc['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x1df687=>!_0x1df687)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[i(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x3581c9]}),_0x1e99cc;}['_createListItemViews'](_0x2be066,_0x5292cc){const _0x214008=[];for(const _0x320897 of _0x2be066){const _0x3a5d6e=new Li(_0x5292cc,_0x320897);_0x3a5d6e['delegate'](...Yi)['to'](this),_0x214008['push'](_0x3a5d6e);}return _0x214008;}['updateHistoryItemsWithCategories'](_0x222d6f){const _0x44fb96=this['locale']||'en',_0x7382c7=[];for(const _0x2c7d3c of _0x222d6f){const _0x25b99b=this['_createListItemViews'](_0x2c7d3c['items'],_0x44fb96);_0x7382c7['push'](new xi(_0x44fb96,{'title':_0x2c7d3c['title'],'items':_0x25b99b}));}this['sectionsView']['sections']=_0x7382c7,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x7382c7),this['hasItems']=_0x222d6f['some'](_0x4d9fe1=>_0x4d9fe1['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x3eb949){for(const _0x32797e of this['sectionsView']['sections']){const _0x33c493=_0x32797e['getItem'](_0x3eb949);if(_0x33c493){if(_0x32797e['removeItem'](_0x33c493),0x0===_0x32797e['itemsViews']['length']){const _0x353cb1=this['sectionsView']['sections']['indexOf'](_0x32797e);-0x1!==_0x353cb1&&(this['sectionsView']['sections']['splice'](_0x353cb1,0x1),this['sectionsView']['items']['remove'](_0x32797e));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0xca72e8,_0x494dbe){for(const _0x5efb67 of this['sectionsView']['sections']){const _0x537f0d=_0x5efb67['getItem'](_0xca72e8);if(_0x537f0d){_0x537f0d['updateTitle'](_0x494dbe);break;}}}['updateItemLoadingState'](_0x362779,_0x417fb4,_0x4d4a31){for(const _0x3f2ef7 of this['sectionsView']['sections']){const _0x1fe35e=_0x3f2ef7['getItem'](_0x362779);if(_0x1fe35e){_0x1fe35e['updateLoadingState'](_0x417fb4,_0x4d4a31);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x38fad7=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x38fad7);}}}const Yi=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class xt extends ot{static get['requires'](){return[Ct];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3e806e){super(_0x3e806e);const _0x3a077d=this['context']['plugins']['get']('AITabs');this['_historyView']=new kt(this['context']['locale'],_0x3a077d['showResizeButton']),this['_historyView']['delegate'](...Yi)['to'](this),_0x3a077d['view']['addTab']({'id':'history','buttonLabel':i(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Ut,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x2c8d4a){this['_historyView']['removeHistoryItem'](_0x2c8d4a);}['updateItems'](_0x2852e3){this['_historyView']['updateHistoryItemsWithCategories'](_0x2852e3);}['updateItemTitle'](_0x2a30f1,_0xc473d7){this['_historyView']['updateItemTitle'](_0x2a30f1,_0xc473d7);}['updateItemLoadingState'](_0x207aea,_0x57e862,_0xc8c793){this['_historyView']['updateItemLoadingState'](_0x207aea,_0x57e862,_0xc8c793);}['setLoadingSkeleton'](_0x33a20c){this['_historyView']['isLoading']=_0x33a20c;}['showError'](_0x1a3395){this['_historyView']['errorMessage']=_0x1a3395;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x171052){this['_historyView']['isMaximized']=_0x171052;}}class Ue extends ts(){['id'];['createdAt'];constructor({id:_0x252af6,title:_0x520bf1,createdAt:_0xc2f7c8,updatedAt:_0x316c4d,pinned:_0x1f2524}){super(),this['id']=_0x252af6,this['createdAt']=new Date(_0xc2f7c8),this['set']('title',_0x520bf1),this['set']('updatedAt',_0x316c4d?new Date(_0x316c4d):null),this['set']('pinned',_0x1f2524||!0x1);}['updateTitle'](_0x890f5b){this['set']('title',_0x469020(_0x890f5b)),this['updatedAt']=new Date();}['updatePinned'](_0xf5702b){this['set']('pinned',_0xf5702b),this['updatedAt']=new Date();}}class Yt extends _0x19d98c(){['items']=[];['connector'];['group'];constructor({connector:_0x20ecb9,group:_0xd790c9}){super(),this['connector']=_0x20ecb9,this['group']=_0xd790c9;}async['init'](){try{const _0xeb08e5=this['connector']['fetchConversations'](this['group']),_0xbc3b36=await _0xeb08e5['getConversations']();this['loadItems'](_0xbc3b36);}catch(_0x38645b){this['fire']('error',{'error':_0x38645b,'operation':'init'});}}['addItem'](_0x183c55){this['items']['push'](_0x183c55);}async['removeItem'](_0x47ebf7){const _0x451d0e=this['items']['findIndex'](_0x1d8605=>_0x1d8605['id']===_0x47ebf7);if(-0x1===_0x451d0e)return!0x1;try{return await this['connector']['deleteConversation'](_0x47ebf7)['execute'](),this['items']['splice'](_0x451d0e,0x1),this['fire']('itemRemoved',{'itemId':_0x47ebf7}),!0x0;}catch(_0x3693d0){return this['fire']('error',{'error':_0x3693d0,'operation':'removeItem','itemId':_0x47ebf7}),!0x1;}}['getItem'](_0x506de5){return this['items']['find'](_0x3187dd=>_0x3187dd['id']===_0x506de5);}async['updateItemTitle'](_0x3303ca,_0x247d78){const _0x2a5333=this['getItem'](_0x3303ca);if(!_0x2a5333)return!0x1;try{return await this['connector']['updateConversation'](_0x3303ca,{'title':_0x247d78})['getResult'](),_0x2a5333['updateTitle'](_0x247d78),this['fire']('itemUpdated',{'itemId':_0x3303ca,'updates':{'title':_0x247d78}}),!0x0;}catch(_0x1f07c1){return this['fire']('error',{'error':_0x1f07c1,'operation':'updateItemTitle','itemId':_0x3303ca}),!0x1;}}async['updateItemPinned'](_0x312c78,_0x5cbc66){const _0x5a6015=this['getItem'](_0x312c78);if(!_0x5a6015)return!0x1;try{return await this['connector']['updateConversation'](_0x312c78,{'pinned':_0x5cbc66})['getResult'](),_0x5a6015['updatePinned'](_0x5cbc66),this['fire']('itemUpdated',{'itemId':_0x312c78,'updates':{'pinned':_0x5cbc66}}),!0x0;}catch(_0x46e71d){return this['fire']('error',{'error':_0x46e71d,'operation':'updateItemPinned','itemId':_0x312c78}),!0x1;}}['loadItems'](_0x45623e){try{this['items']=[],_0x45623e['map'](_0x30b639=>{this['addItem'](new Ue(_0x30b639));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x3417dc){this['fire']('error',{'error':_0x3417dc,'operation':'loadItems'});}}['getItems'](_0x561a19={}){const _0x10c05=void 0x0!==_0x561a19['pinned']&&_0x561a19['pinned'],_0x2e455e=_0x561a19['from']?new Date(_0x561a19['from']['getFullYear'](),_0x561a19['from']['getMonth'](),_0x561a19['from']['getDate']()):null,_0x5dadfc=_0x561a19['to']?new Date(_0x561a19['to']['getFullYear'](),_0x561a19['to']['getMonth'](),_0x561a19['to']['getDate']()):null;return this['items']['filter'](_0x44f3e5=>{if(_0x44f3e5['pinned']!==_0x10c05)return!0x1;if(_0x5dadfc){const _0x119617=new Date(_0x44f3e5['createdAt']['getFullYear'](),_0x44f3e5['createdAt']['getMonth'](),_0x44f3e5['createdAt']['getDate']());return _0x2e455e?_0x2e455e['getTime']()===_0x5dadfc['getTime']()?_0x119617['getTime']()===_0x2e455e['getTime']():_0x119617<_0x5dadfc&&_0x119617>=_0x2e455e:_0x119617<_0x5dadfc;}return!0x0;});}}class jt extends ot{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[S,dt,xt,Ct];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](S),this['_aiChatHistoryUi']=this['context']['plugins']['get'](xt),this['_aiChatController']=this['context']['plugins']['get'](dt);const _0x3df52a=this['context']['plugins']['get'](Ct);try{const _0x1f4d53=this['_aiChatController']['getGroupId']();this['history']=new Yt({'connector':this['_aiConnector'],'group':_0x1f4d53}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x18a9ee,_0x37572e)=>{this['_setItemLoading'](_0x37572e['id'],'remove'),this['_handleRemove'](_0x37572e['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x184318,_0x627ddc)=>{this['_setItemLoading'](_0x627ddc['id'],'rename'),this['_handleEditTitle'](_0x627ddc['id'],_0x627ddc['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x5e905a,_0xb2eee)=>{void 0x0!==_0xb2eee['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0xb2eee['itemId'],_0xb2eee['updates']['title']),void 0x0!==_0xb2eee['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0xb2eee['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x212fab,_0x570eeb)=>{this['_aiChatController']['handleRemovedConversation'](_0x570eeb['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x570eeb['itemId']),this['_clearItemLoading'](_0x570eeb['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x1c5903,_0x501953)=>{this['_handleHistoryErrorUI'](_0x501953['error'],_0x501953['operation'],_0x501953['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x42ccf2,_0x5be722)=>{this['_handleSelectConversation'](_0x5be722['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x4855b2,_0x3e7d85)=>{const _0x46f0d3=_0x3e7d85['pinned']?'pin':'unpin';this['_setItemLoading'](_0x3e7d85['id'],_0x46f0d3),this['_handleTogglePin'](_0x3e7d85['id'],_0x3e7d85['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x3df52a['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x3df52a['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x3df52a,'resizedTabs',(_0x139347,_0x4ee75c)=>{this['_setIsMaximized'](_0x4ee75c);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x3df52a['resize']();});}catch(_0x148dcc){this['_handleHistoryErrorUI'](_0x148dcc,'init');}}async['_handleEditTitle'](_0x36094a,_0x3b0e8a){await this['history']['updateItemTitle'](_0x36094a,_0x3b0e8a);}async['_handleTogglePin'](_0x4e9f0c,_0x29841a){await this['history']['updateItemPinned'](_0x4e9f0c,_0x29841a);}async['_handleRemove'](_0x33548a){await this['history']['removeItem'](_0x33548a);}async['_handleSelectConversation'](_0x35e990){await this['_aiChatController']['loadConversation'](_0x35e990);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x18f88c=this['_aiChatController']['activeConversation']?.['id'],_0x4d49c2=this['_getCategorizedItems']()['map'](_0x2763f3=>({'title':_0x2763f3['title'],'items':_0x2763f3['items']['map'](_0x5ead32=>({'id':_0x5ead32['id'],'title':_0x5ead32['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x5ead32['createdAt'])['toLocaleDateString'](),'active':_0x5ead32['id']===_0x18f88c,'pinned':_0x5ead32['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x4d49c2);}['_setItemLoading'](_0x2c768a,_0x3b7b9f){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x2c768a,_0x3b7b9f,!0x0);}['_clearItemLoading'](_0x4573ea){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x4573ea,null,!0x1);}['_handleHistoryErrorUI'](_0x4ac747,_0x56ccc5,_0x3c87ba){const _0x21bf7a=this['_generateErrorMessage'](_0x56ccc5,_0x3c87ba);this['_aiChatHistoryUi']['showError'](_0x21bf7a),_0x3c87ba&&this['_clearItemLoading'](_0x3c87ba),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x5e9265,_0xbb9046){const _0x59784f=_0xbb9046?this['history']['getItem'](_0xbb9046):null,_0x4ef82c=_0x59784f?.['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x5e9265){case'updateItemTitle':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x4ef82c);case'updateItemPinned':{const _0x511b03=i(this['context']['locale'],_0x59784f?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x511b03,_0x4ef82c]);}case'removeItem':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x4ef82c);case'init':case'loadItems':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x476874=new Date(),_0x2825d8=new Date(_0x476874['getFullYear'](),_0x476874['getMonth'](),_0x476874['getDate']()),_0xdb9f9=new Date(_0x2825d8);_0xdb9f9['setDate'](_0xdb9f9['getDate']()-0x1);const _0x32f89b=new Date(_0x2825d8);_0x32f89b['setDate'](_0x32f89b['getDate']()-0xe);const _0x2666d6=this['history']['getItems']({'pinned':!0x0}),_0x4c4063=this['history']['getItems']({'from':_0x2825d8,'to':_0x2825d8}),_0x171015=this['history']['getItems']({'from':_0xdb9f9,'to':_0xdb9f9}),_0x332dd4=this['history']['getItems']({'from':_0x32f89b,'to':_0xdb9f9}),_0x31b02c=this['history']['getItems']({'to':_0x32f89b}),_0x4ba323=[];return _0x2666d6['length']>0x0&&_0x4ba323['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x2666d6}),_0x4c4063['length']>0x0&&_0x4ba323['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x4c4063}),_0x171015['length']>0x0&&_0x4ba323['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x171015}),_0x332dd4['length']>0x0&&_0x4ba323['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x332dd4}),_0x31b02c['length']>0x0&&_0x4ba323['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x31b02c}),_0x4ba323;}['_setIsMaximized'](_0x220c6c){this['_aiChatHistoryUi']['setIsMaximized'](_0x220c6c);}}class pt extends ot{static get['requires'](){return[jt,xt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Da extends ot{static get['requires'](){return[dt,R,gt,pt];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x125fe8){super(_0x125fe8),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),this['context']['config']['define']('ai.chat.models',{'defaultModelId':void 0x0,'modelSelectorAlwaysVisible':!0x0,'displayedModels':void 0x0});}async['addSelectionToChatContext'](){await this['context']['plugins']['get'](dt)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](dt)['startConversation']();}async['sendMessage']({message:_0x13eaad,quickActionData:_0x407363}){await this['context']['plugins']['get'](dt)['sendMessage']({'message':_0x13eaad,'quickActionData':_0x407363});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](dt)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](dt)['focusPromptInput']();}}class co extends Qt{constructor(_0x5957b5){super(_0x5957b5);const _0x5dbcae=_0x5957b5['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x5dbcae,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x574c2e=this['editor']['plugins']['get']('AITabs')['view'];_0x574c2e['isVisible']=!_0x574c2e['isVisible'];}}class qt extends _0x346ac8{static get['requires'](){return[Ct];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x1fc82f=this['editor'];_0x1fc82f['commands']['add']('toggleAi',new co(_0x1fc82f)),_0x1fc82f['ui']['componentFactory']['add']('toggleAi',()=>{const _0x5cee11=this['_createAIUIButton'](_0xcbb426);return _0x5cee11['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x5cee11;}),_0x1fc82f['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x54b3ca=this['_createAIUIButton'](_0x3ce5a8);return _0x54b3ca['set']({'role':'menuitemcheckbox'}),_0x54b3ca;});}['_createAIUIButton'](_0x23408e){const _0x4ca724=this['editor'],_0x4bb434=_0x4ca724['commands']['get']('toggleAi'),_0x46d23=new _0x23408e(_0x4ca724['locale']);return _0x46d23['set']({'label':i(_0x4ca724['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x4e4731,'isToggleable':!0x0}),_0x46d23['bind']('isEnabled')['to'](_0x4bb434),_0x46d23['bind']('isOn')['to'](_0x4bb434,'value',_0x1c3e89=>!!_0x1c3e89),this['listenTo'](_0x46d23,'execute',()=>{_0x4bb434['execute']();}),_0x46d23;}}class Ma extends _0x346ac8{static get['requires'](){return[qt,zt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function ie(_0x341601){const {editor:_0x2226db,action:_0x109f5f,withText:_0x4f972f=!0x1,withIcon:_0x3255b3=!0x0,isInDropdown:_0x295ac6=!0x0,shouldPreventFocus:_0x5a6284=!0x1}=_0x341601;return()=>{const _0x7e7ff7=_0x2226db['locale'],_0xe56606=new _0xcbb426(_0x7e7ff7),_0x4b5879=_0xe56606['bindTemplate'];_0x295ac6&&_0xe56606['extendTemplate']({'on':{'mouseenter':_0x4b5879['to'](()=>{_0x5a6284&&_0x5a6284()||_0xe56606['focus']();})}});const _0x3b2529=_0x109f5f['icon']??_0x109f5f['parent']?.['icon'];return _0xe56606['set']({'label':_0x109f5f['displayedPrompt'],'withText':_0x4f972f,'role':'menuitem','icon':_0x3255b3?_0x3b2529??_0x157b90:void 0x0,'tooltip':!_0x4f972f,'class':'ck-ai-quick-actions-button','isEnabled':_0x109f5f['isEnabled']}),_0xe56606['on']('execute',()=>{_0x2226db['editing']['view']['focus'](),_0x2226db['commands']['execute']('aiQuickAction',_0x109f5f);}),_0xe56606;};}class vs extends _0x2ab14c{['arrowView'];constructor(_0x2ad149,_0x22692f){super(_0x2ad149,_0x22692f);const _0x4d61ed=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',_0xa1e339=>String(_0xa1e339)),'data-cke-tooltip-disabled':_0x4d61ed['to']('isOn')},'on':{'mouseenter':_0x4d61ed['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x3e21c8=new _0x4caa0b();return _0x3e21c8['content']=_0x53f601,_0x3e21c8['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x3e21c8;}}class Ss extends _0x5bd1ba{['_allListItems'];['_allSearchableItems'];constructor(_0x52c1d5,_0x4e1c70,_0xf63934){super(_0x52c1d5),this['_allListItems']=_0x4e1c70,this['_allSearchableItems']=_0xf63934;}['filter'](_0x3b1425){if(!_0x3b1425)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x2f4dee=_0x3b1425['source']['toLowerCase']()['trim'](),_0x104075=this['_allSearchableItems']['filter'](_0x48a809=>(_0x48a809['groupLabel']?_0x48a809['label']+'\x20('+_0x48a809['groupLabel']+')':_0x48a809['label'])['toLowerCase']()['includes'](_0x2f4dee));return this['items']['clear'](),this['items']['addMany'](_0x104075['sort']((_0x5bedbc,_0x162f4b)=>{const _0x336ce1=_0x5bedbc['groupLabel'],_0x4fe132=_0x162f4b['groupLabel'];return _0x336ce1||_0x4fe132?_0x336ce1?0x1:-0x1:0x0;})['map'](_0x3f044f=>_0x3f044f['item'])),this['_highlightQuery'](_0x2f4dee,_0x104075),{'resultsCount':_0x104075['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x2a9f88,_0x2a9ea7){if(!_0x2a9f88)return;const _0xd25176=new RegExp(_0x54c692(_0x2a9f88),'gi');_0x2a9ea7['forEach'](_0x43e22e=>{_0x43e22e['highlightViews']&&_0x43e22e['highlightViews']['forEach'](_0x408cf0=>{'function'==typeof _0x408cf0['highlightText']&&_0x408cf0['highlightText'](_0xd25176);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x2fc370=>{_0x2fc370['highlightViews']&&_0x2fc370['highlightViews']['forEach'](_0x573015=>{'function'==typeof _0x573015['highlightText']&&_0x573015['highlightText'](null);});});}}const ys='menu',Ts='menuitem';class ao extends _0x43effc{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x5576f1,_0x2279cf,_0x2c744a,_0x1c72ba,_0x5c8a57=!0x1){const _0x16e4db=_0x5576f1['locale'];super(_0x16e4db),this['_bodyCollection']=_0x1c72ba,this['_hasSearch']=_0x5c8a57;const _0x3c0ed3=this['_createListItems'](_0x5576f1,_0x2279cf,_0x2c744a);this['optionsListView']=new Ss(_0x16e4db,_0x3c0ed3,this['_allSearchableItems']),this['optionsListView']['role']=ys,this['optionsListView']['items']['addMany'](_0x3c0ed3),this['focusTracker']=new _0x25d272(),this['keystrokes']=new _0xfe6d51(),_0x5c8a57&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x3c0ed3,this['focusCycler']=new _0x4b849d({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x5c8a57&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x2c77cd=_0x5c8a57&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x317ee8(_0x2c77cd),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x16e4db['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x1f1a68(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':i(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':i(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x260a1d=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x260a1d);}['_createListItems'](_0x1d80ce,_0x2b9308,_0x6ad2a){const _0x47d54f=new _0x317ee8();return _0x2b9308['forEach'](_0x57419e=>{if('actions'in _0x57419e){const {listItem:_0x369243}=this['_createActionGroupButton'](_0x1d80ce,_0x57419e,_0x6ad2a);_0x47d54f['add'](_0x369243),_0x57419e['actions']['forEach'](_0x55381c=>{this['_createActionButton'](_0x1d80ce,_0x55381c,_0x57419e['label'],_0x57419e['icon']);const {listItem:_0x48d2a5,highlightViews:_0x25ab40}=this['_createSearchResultActionButton'](_0x1d80ce,_0x55381c,_0x57419e['label'],_0x57419e['icon']);this['_allSearchableItems']['push']({'item':_0x48d2a5,'label':_0x55381c['displayedPrompt'],'groupLabel':_0x57419e['label'],'highlightViews':_0x25ab40});});}else{const {listItem:_0x31f872}=this['_createActionButton'](_0x1d80ce,_0x57419e);_0x47d54f['add'](_0x31f872);const _0x2b813e=_0x31f872['children']['first'];if(_0x2b813e){const {listItem:_0x5085b6,highlightViews:_0x546bd4}=this['_createSearchResultActionButton'](_0x1d80ce,_0x57419e);this['_allSearchableItems']['push']({'item':_0x5085b6,'label':_0x2b813e['label']||'','highlightViews':_0x546bd4});}}}),_0x47d54f;}['_createActionButton'](_0xb4c6ca,_0xd32874,_0x145289,_0x13c732){const _0xc61b98=new _0x3f0116(this['locale']);if(_0x145289&&_0x13c732){const _0x1ae0f3=new _0xcbb426(this['locale']),_0x7fb069=_0x1ae0f3['bindTemplate'],_0x33acbe=new _0x407d13();_0x33acbe['text']=_0xd32874['displayedPrompt'];const _0x1ca95c=new _0x407d13();_0x1ca95c['text']=_0x145289;const _0x37e269=new _0x4caa0b();_0x37e269['content']=_0x13c732,_0x37e269['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x5ac68c=new _0x43effc(this['locale']);_0x5ac68c['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x1c4e76=new _0x43effc(this['locale']);return _0x1c4e76['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x1ae0f3['set']({'label':_0xd32874['displayedPrompt']+'\x20('+_0x145289+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x1ae0f3['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':[_0x33acbe,_0x5ac68c,_0x37e269,_0x1ca95c,_0x1c4e76],'on':{'mouseenter':_0x7fb069['to'](()=>{this['_isSearchFocused']()||_0x1ae0f3['focus']();}),'click':_0x7fb069['to'](()=>{_0x1ae0f3['fire']('execute');})}}),_0x1ae0f3['on']('execute',()=>{_0xb4c6ca['editing']['view']['focus'](),_0xb4c6ca['commands']['execute']('aiQuickAction',_0xd32874);}),_0xc61b98['children']['add'](_0x1ae0f3),{'listItem':_0xc61b98,'highlightViews':[_0x33acbe,_0x1ca95c]};}{const _0xc99098=new _0xa65920(),_0x234133=new _0xcbb426(this['locale'],_0xc99098),_0x3509ec=_0x234133['bindTemplate'],_0x1b3f0a=_0xd32874['icon']??_0xd32874['parent']?.['icon'],_0xa64028=void 0x0!==_0xd32874['icon'];return _0x234133['set']({'label':_0xd32874['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':_0xa64028?_0x1b3f0a??_0x157b90:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x234133['extendTemplate']({'on':{'mouseenter':_0x3509ec['to'](()=>{this['_isSearchFocused']()||_0x234133['focus']();})}}),_0x234133['on']('execute',()=>{_0xb4c6ca['editing']['view']['focus'](),_0xb4c6ca['commands']['execute']('aiQuickAction',_0xd32874);}),_0xc61b98['children']['add'](_0x234133),{'listItem':_0xc61b98,'highlightViews':[_0xc99098]};}}['_createSearchResultActionButton'](_0x240a92,_0x9d229c,_0x39e148,_0x5f5abe){return _0x39e148&&_0x5f5abe?this['_createSearchResultGroupedActionButton'](_0x240a92,_0x9d229c,_0x39e148,_0x5f5abe):this['_createSearchResultIndividualActionButton'](_0x240a92,_0x9d229c);}['_createSearchResultGroupedActionButton'](_0x41c051,_0x1bba59,_0x3d6f7a,_0x4081a6){const _0x514e6d=new _0x3f0116(this['locale']),_0x43832d=new _0xcbb426(this['locale']),_0x72ab31=_0x43832d['bindTemplate'],{view:_0x260a48,highlightView:_0x1417ce}=this['_createSearchResultGroupRow'](_0x3d6f7a,_0x4081a6),{view:_0x2d94e3,highlightView:_0xb1e079}=this['_createSearchResultActionRow'](_0x1bba59['displayedPrompt']),_0x1d8d0d=this['_createSearchResultContentView'](_0x260a48,_0x2d94e3);return _0x43832d['set']({'label':_0x1bba59['displayedPrompt'],'withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button\x20ck-ai-quick-actions-search-result-button_with-group','tooltip':!0x1}),_0x43832d['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':[_0x1d8d0d],'on':{'mouseenter':_0x72ab31['to'](()=>{this['_isSearchFocused']()||_0x43832d['focus']();}),'click':_0x72ab31['to'](()=>{this['_handleSearchResultButtonClick'](_0x43832d);})}}),this['_setupActionButtonExecution'](_0x43832d,_0x41c051,_0x1bba59),_0x514e6d['children']['add'](_0x43832d),{'listItem':_0x514e6d,'highlightViews':[_0x1417ce,_0xb1e079]};}['_createSearchResultIndividualActionButton'](_0x22b2a9,_0x4594ac){const _0x3e4e9d=new _0x3f0116(this['locale']),_0x2f9d8d=new _0xa65920(),_0x50499a=new _0xcbb426(this['locale'],_0x2f9d8d),_0x167813=_0x50499a['bindTemplate'];return _0x50499a['set']({'label':_0x4594ac['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x50499a['extendTemplate']({'on':{'mouseenter':_0x167813['to'](()=>{this['_isSearchFocused']()||_0x50499a['focus']();})}}),this['_setupActionButtonExecution'](_0x50499a,_0x22b2a9,_0x4594ac),_0x3e4e9d['children']['add'](_0x50499a),{'listItem':_0x3e4e9d,'highlightViews':[_0x2f9d8d]};}['_createSearchResultGroupRow'](_0x4c3cc7,_0x17e7cd){const _0x428ebe=new _0x43effc(this['locale']),_0x44c590=new _0x4caa0b();_0x44c590['content']=_0x17e7cd,_0x44c590['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x58721f=new _0x407d13();return _0x58721f['text']=_0x4c3cc7,_0x428ebe['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x44c590,_0x58721f]}),{'view':_0x428ebe,'highlightView':_0x58721f};}['_createSearchResultActionRow'](_0x571b0d){const _0x176a39=new _0x43effc(this['locale']),_0x172dfd=new _0x407d13();return _0x172dfd['text']=_0x571b0d,_0x176a39['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x172dfd]}),{'view':_0x176a39,'highlightView':_0x172dfd};}['_createSearchResultContentView'](_0x3e2cea,_0x54617f){const _0x59544c=new _0x43effc(this['locale']);return _0x59544c['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x3e2cea,_0x54617f]}),_0x59544c;}['_setupActionButtonExecution'](_0x52e501,_0x1b9a4a,_0x2479f4){_0x52e501['on']('execute',()=>{_0x1b9a4a['editing']['view']['focus'](),_0x1b9a4a['commands']['execute']('aiQuickAction',_0x2479f4);});}['_createActionGroupButton'](_0x3ffbf5,_0x480bb2,_0x4f3728){const _0x3e1b08=new _0x3f0116(this['locale']),_0x1bd2ad=new _0xa65920(),_0x52438a=new vs(this['locale'],_0x1bd2ad),_0x30eabc=_0x52438a['bindTemplate'],_0x1d7ebe=this['_getPanelKeystroke'](_0x4f3728),_0x5c31b8=this['_createGroupActionsList'](_0x3ffbf5,_0x480bb2['actions'],_0x4f3728);_0x52438a['set']({'label':_0x480bb2['label'],'withText':!0x0,'role':Ts,'icon':_0x480bb2['icon']??_0x157b90,'isEnabled':_0x480bb2['actions']['some'](_0x11c926=>_0x11c926['isEnabled'])}),_0x52438a['extendTemplate']({'on':{'mouseenter':_0x30eabc['to'](()=>{this['_isSearchFocused']()||_0x52438a['focus']();})}});const _0x1b7221=new _0x2ae23a(this['locale']);return _0x1b7221['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x30eabc['to'](_0x58c4f1=>{this['_handlePanelKeydown'](_0x58c4f1,_0x1d7ebe,_0x52438a,_0x1b7221);})}}),_0x52438a['bind']('isOn')['to'](_0x1b7221,'isVisible'),this['_bodyCollection']['add'](_0x1b7221),_0x1b7221['content']['add'](_0x5c31b8),this['_setupGroupMenuBehavior'](_0x52438a,_0x1b7221),_0x3e1b08['children']['add'](_0x52438a),{'listItem':_0x3e1b08,'highlightView':_0x1bd2ad};}['_createGroupActionsList'](_0x2d0428,_0xb8a6ad,_0x22fa60){const _0x4a46c5=new _0x5bd1ba(this['locale']);return _0x4a46c5['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0xb8a6ad['forEach'](_0x1db923=>{const _0x55049e=new _0x3f0116(this['locale']),_0x528023=ie({'editor':_0x2d0428,'action':_0x1db923,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x55049e['children']['add'](_0x528023),_0x22fa60['focusTracker']['add'](_0x528023),_0x4a46c5['items']['add'](_0x55049e);}),_0x4a46c5;}['_setupGroupMenuBehavior'](_0xf5d5b4,_0x3cd56d){const _0x4064f0=_0xf5d5b4['bindTemplate'],_0x4cc23f=this['_getButtonKeystroke'](_0xf5d5b4);_0xf5d5b4['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x4064f0['to'](()=>{this['_showNestedPanel'](_0x3cd56d,_0xf5d5b4);}),'mouseleave':_0x4064f0['to'](_0x406c79=>{const _0x53157f=_0x406c79['relatedTarget'];this['_isMovingToNestedMenu'](_0x53157f,_0x3cd56d)||this['_hideNestedPanel'](_0x3cd56d);}),'keydown':_0x4064f0['to'](_0x5dca62=>{_0x5dca62['key']==_0x4cc23f&&(this['_showNestedPanel'](_0x3cd56d,_0xf5d5b4),_0x3cd56d['content']['get'](0x0)['focus']());})}}),_0x3cd56d['on']('render',()=>{_0x3cd56d['element']?.['addEventListener']('mouseleave',_0x52ccad=>{const _0xace7e0=_0x52ccad['relatedTarget'];_0xf5d5b4['element']?.['contains'](_0xace7e0)||this['_isMovingToNestedMenu'](_0xace7e0,_0x3cd56d)||this['_hideNestedPanel'](_0x3cd56d);});});}['_showNestedPanel'](_0x328795,_0xde407){this['_openNestedPanels']['forEach'](_0x1c8e04=>{_0x1c8e04!==_0x328795&&_0x1c8e04['isVisible']&&_0x1c8e04['hide']();}),_0x328795['show'](),_0x328795['pin']({'positions':[_0x3686ba['eastSouth']],'target':_0xde407['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x328795);}['_hideNestedPanel'](_0x2e3607){_0x2e3607['hide'](),this['_openNestedPanels']['delete'](_0x2e3607);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x29179f=>_0x29179f['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x2447e5,_0x2c8026){if(!_0x2447e5)return!0x1;if(_0x2c8026['element']?.['contains'](_0x2447e5))return!0x0;const _0x22b564=_0x2447e5;return _0x22b564['closest']&&(null!==_0x22b564['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x22b564['closest']('.ck-ai-quick-actions-group-list')||null!==_0x22b564['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'](_0x119dbe){return'rtl'===_0x119dbe['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x469223){return'rtl'===_0x469223['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0xb295c8,_0xe9196f,_0xef8f76,_0x123411){_0xb295c8['key']==_0xe9196f&&(_0xef8f76['focus'](),this['_hideNestedPanel'](_0x123411));}['_handleSearchResultButtonClick'](_0xd4eb23){_0xd4eb23['fire']('execute');}}function ee(_0x12b33e){const {editor:_0x11d610,content:_0x535aa7,buttonDefinition:_0x629f19,bodyCollection:_0x410c8f,hasSearch:_0x3760de=!0x1}=_0x12b33e;return()=>{const _0x2472b6=_0x11d610['locale'],_0x1e4bf4=_0x2e287a(_0x2472b6);_0x1e4bf4['buttonView']['set']({'icon':_0x629f19['icon']??_0x157b90,'label':_0x629f19['label'],'tooltip':!0x0}),_0x1e4bf4['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x1f22c9=new ao(_0x11d610,_0x535aa7,_0x1e4bf4,_0x410c8f,_0x3760de);if(_0x1e4bf4['panelView']['children']['add'](_0x1f22c9),_0x3760de){const _0x57d73e='ai-quick-actions-dropdown-selection';_0x1e4bf4['on']('change:isOpen',(_0x45843e,_0x139a1c,_0x38a68a)=>{if(_0x38a68a){if(_0x11d610['plugins']['has']('AIEditing')){const _0xe2dae8=_0x11d610['plugins']['get'](R),_0x55ca59=_0x11d610['model']['document']['selection'],_0x316aa6=Array['from'](_0x55ca59['getRanges']());_0x316aa6['length']>0x0&&_0xe2dae8['showFakeVisualSelection'](_0x316aa6,_0x57d73e,!0x1,!0x0);}}else _0x11d610['plugins']['has']('AIEditing')&&_0x11d610['plugins']['get'](R)['hideFakeVisualSelection'](_0x57d73e),_0x1f22c9['resetSearch']();});}return _0x1e4bf4;};}const oe='<task>For\x20given\x20selected\x20part\x20of\x20HTML\x20document\x20you\x20must\x20explain\x20the\x20meaning\x20of\x20it\x27s\x20content\x20clearly\x20and\x20in\x20plain\x20language.</task><rules>1.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is:-\x20If\x20it\x20looks\x20like\x20a\x20definition\x20explain\x20the\x20concept\x20in\x20simple\x20terms.-\x20If\x20it\x20looks\x20like\x20a\x20description\x20clarify\x20what\x20it\x20is\x20describing\x20and\x20why\x20it\x20matters.-\x20If\x20it\x20contains\x20technical\x20terms\x20or\x20jargon\x20break\x20them\x20down\x20into\x20everyday\x20language.-\x20If\x20it\x20looks\x20instructional\x20restate\x20as\x20clear\x20steps\x20someone\x20can\x20follow.-\x20If\x20it\x20provides\x20examples\x20explain\x20what\x20the\x20example\x20shows\x20and\x20why\x20it\x27s\x20relevant.-\x20If\x20it\x20presents\x20an\x20argument\x20or\x20claim\x20restate\x20the\x20claim\x20neutrally\x20and\x20explain\x20its\x20purpose.-\x20If\x20it\x20is\x20narrative/story-like\x20explain\x20what\x20event\x20or\x20situation\x20is\x20being\x20described.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20explain\x20what\x20the\x20data\x20indicates.-\x20If\x20it\x20is\x20a\x20quotation\x20explain\x20the\x20meaning\x20of\x20the\x20quote\x20in\x20context.-\x20If\x20it\x20compares/contrasts\x20things\x20explain\x20the\x20key\x20differences\x20or\x20similarities\x20simply.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20give\x20a\x20clear,\x20plain-language\x20explanation\x20of\x20its\x20meaning,\x20focusing\x20on\x20usefulness.2.\x20Provide\x20context\x20if\x20the\x20meaning\x20could\x20be\x20unclear\x20without\x20it.\x20(e.g.,\x20explain\x20where\x20such\x20a\x20term\x20might\x20be\x20used,\x20or\x20why\x20it\x20is\x20important).3.\x20Keep\x20the\x20explanation\x20short\x20but\x20complete\x20(2–5\x20sentences).Avoid\x20overly\x20technical\x20detail\x20unless\x20it\x20is\x20necessary\x20for\x20understanding.4.\x20Do\x20not\x20simply\x20repeat\x20the\x20original\x20text\x20—\x20restate\x20and\x20expand\x20it\x20in\x20plain\x20words.5.\x20If\x20possible,\x20add\x20a\x20short\x20example\x20or\x20analogy\x20to\x20make\x20it\x20easier\x20to\x20understand.6.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20explanation.7.\x20Your\x20explanation\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20explanation.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',ae='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20summarize\x20its\x20content\x20in\x20a\x20few\x20sentences,\x20keeping\x20only\x20the\x20essential\x20meaning.</task><rules>1.\x20Your\x20summary\x20should\x20be\x20short\x20and\x20clear:-\x20Aim\x20for\x202–4\x20sentences\x20unless\x20the\x20text\x20is\x20extremely\x20short.-\x20Focus\x20on\x20capturing\x20the\x20main\x20idea(s)\x20without\x20unnecessary\x20detail.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20summary\x20style:-\x20If\x20it\x20is\x20descriptive\x20condense\x20the\x20description\x20into\x20its\x20core\x20idea.-\x20If\x20it\x20is\x20argumentative\x20or\x20opinion-based\x20summarize\x20the\x20main\x20claim\x20and\x20reasoning\x20neutrally.-\x20If\x20it\x20is\x20narrative/story-like\x20capture\x20the\x20main\x20event\x20or\x20outcome\x20without\x20side\x20details.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20summarize\x20what\x20the\x20data\x20shows\x20in\x20plain\x20language.-\x20If\x20it\x20is\x20instructional\x20restate\x20the\x20overall\x20purpose\x20of\x20the\x20steps\x20without\x20listing\x20every\x20step.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20provide\x20a\x20general\x20concise\x20summary.3.\x20Provide\x20context\x20if\x20necessary\x20for\x20clarity:-\x20Mention\x20the\x20subject\x20or\x20topic\x20explicitly\x20so\x20the\x20summary\x20can\x20stand\x20alone.4.\x20Do\x20not\x20simply\x20copy\x20sentences\x20from\x20the\x20original\x20text\x20—\x20rephrase\x20in\x20plain\x20language.5.\x20Avoid\x20adding\x20new\x20information\x20or\x20interpretation\x20not\x20present\x20in\x20the\x20text.6.\x20Summarize\x20in\x20a\x20way\x20that\x20would\x20make\x20sense\x20to\x20someone\x20who\x20has\x20not\x20read\x20the\x20original\x20text.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20summary.8.\x20Your\x20summary\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20summary.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',se='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20extract\x20and\x20present\x20the\x20key\x20points\x20from\x20its\x20content.</task><rules>1.\x20Present\x20the\x20output\x20as\x20a\x20clear,\x20structured\x20list\x20(bullets\x20or\x20numbered).-\x20Each\x20point\x20should\x20be\x20concise\x20(one\x20sentence\x20or\x20less).-\x20Do\x20not\x20merge\x20distinct\x20ideas\x20into\x20one\x20bullet.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20extraction\x20style:-\x20If\x20it\x20is\x20descriptive\x20capture\x20the\x20main\x20attributes\x20or\x20features.-\x20If\x20it\x20is\x20argumentative\x20extract\x20the\x20main\x20claim\x20and\x20supporting\x20reasons\x20separately.-\x20If\x20it\x20is\x20narrative/story-like\x20extract\x20the\x20main\x20events\x20in\x20chronological\x20order.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20highlight\x20the\x20most\x20important\x20facts\x20or\x20numbers.-\x20If\x20it\x20is\x20instructional\x20list\x20the\x20steps\x20or\x20main\x20actions\x20in\x20simplified\x20form.-\x20If\x20it\x20provides\x20comparisons\x20extract\x20the\x20contrasted\x20items\x20and\x20their\x20differences/similarities.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20category\x20above\x20extract\x20the\x20main\x20ideas\x20in\x20plain,\x20short\x20statements.3.\x20Keep\x20the\x20list\x20between\x203–7\x20items\x20where\x20possible.-\x20If\x20the\x20text\x20is\x20very\x20short,\x20fewer\x20items\x20are\x20fine.-\x20If\x20it\x20is\x20very\x20long,\x20focus\x20on\x20the\x20most\x20important\x20ideas\x20only.4.\x20Do\x20not\x20copy\x20long\x20text\x20fragments\x20—\x20restate\x20in\x20simple\x20words.5.\x20Do\x20not\x20add\x20interpretation,\x20evaluation,\x20or\x20commentary\x20beyond\x20the\x20text.6.\x20Ensure\x20the\x20list\x20can\x20stand\x20alone\x20without\x20requiring\x20the\x20reader\x20to\x20see\x20the\x20original\x20document.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20key\x20points.8.\x20Your\x20key\x20points\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20extracted\x20key\x20points.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>';var Gt=function(_0x3798c0){return _0x3798c0['CHAT']='CHAT',_0x3798c0['ACTION']='ACTION',_0x3798c0['REVIEW']='REVIEW',_0x3798c0;}({}),Ua=function(_0x21a657){return _0x21a657['CHAT']='AIChat',_0x21a657['ACTION']='AIActions',_0x21a657['REVIEW']='AIReviewMode',_0x21a657;}({});class ii extends _0x346ac8{static get['requires'](){return[_0x5a3ac9];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0xaf9407=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0xaf9407),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x2e33ad){return function(_0x4e0da2){const _0x1a9510=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x4e0da2['uiLanguage']),_0x57b199=_0x1a9510||'English',_0x361ce6=[{'id':'ask-ai','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Bt},{'id':'chat-commands','label':i(_0x4e0da2,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Bt,'actions':[{'id':'explain','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':oe['replace']('%0',_0x57b199),'type':'CHAT'},{'id':'summarize','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':ae['replace']('%0',_0x57b199),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':se['replace']('%0',_0x57b199),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Xt},{'id':'continue','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Jt},{'id':'fix-grammar','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Vt},{'id':'adjust-length','label':i(_0x4e0da2,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Kt,'actions':[{'id':'make-shorter','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':i(_0x4e0da2,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Wt,'actions':[{'id':'make-tone-casual','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':i(_0x4e0da2,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':te,'actions':[{'id':'translate-to-english','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':i(_0x4e0da2,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':i(_0x4e0da2,'AI_QUICK_ACTIONS_OTHER'),'icon':Zt,'actions':[]}];return _0x361ce6;}(_0x2e33ad);}async['_getDefaultAndCustomActions'](){const _0x1e1cec=ii['getDefaultQuickActions'](this['editor']['locale']),_0xbe1c00=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x4dc8ec=[];try{_0x4dc8ec=await new At({'connector':this['editor']['plugins']['get']('AIConnector'),'availableModels':this['editor']['config']['get']('ai.chat.models.displayedModels'),'locale':this['editor']['locale']})['getAvailableModels']();}catch(_0x5b05e1){const _0x449e07=new _0x36b126('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x5b05e1});ft(_0x449e07['message']);}finally{const _0x372136=_0xbe1c00['map'](_0x2a9174=>({..._0x2a9174,'icon':void 0x0}));_0x1e1cec['find'](_0x43c002=>'other'===_0x43c002['id'])['actions']['push'](..._0x372136),_0x1e1cec['forEach'](_0x43ac9f=>{if('actions'in _0x43ac9f)_0x43ac9f['actions']['forEach'](_0x338bb8=>{if(_0x338bb8['isEnabled']=!!_0x4dc8ec['find'](_0x40f0bd=>_0x40f0bd['id']===_0x338bb8['model'])||void 0x0===_0x338bb8['model'],!_0x338bb8['isEnabled']){const _0x57621d=new _0x36b126('ai-quick-actions-unavailable-model',this,{'actionId':_0x338bb8['id'],'modelId':_0x338bb8['model']});ft(_0x57621d['message']);}});else{if(_0x43ac9f['isEnabled']=!!_0x4dc8ec['find'](_0x5ab8cc=>_0x5ab8cc['id']===_0x43ac9f['model'])||void 0x0===_0x43ac9f['model'],!_0x43ac9f['isEnabled']){const _0x3ebbc6=new _0x36b126('ai-quick-actions-unavailable-model',this,{'actionId':_0x43ac9f['id'],'modelId':_0x43ac9f['model']});ft(_0x3ebbc6['message']);}}});}return _0x1e1cec;}['_initializeQuickActionsComponentsAndCommands'](){const _0x7fd204=new _0x44dc72(this['editor']['locale']);_0x7fd204['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x7fd204),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x7fd204);}['_initializeQuickActionsDropdown'](_0x52d553){const _0x27911f=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',ee({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x157b90,'label':i(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x52d553,'hasSearch':_0x27911f}));}['_prepareQuickActionsDefinition'](_0x270498){this['_quickActionsDefinition']=_0x270498['map'](_0x5181f7=>{if('actions'in _0x5181f7){const _0x319d50=_0x5181f7;return{..._0x319d50,'actions':_0x319d50['actions']['map'](_0x57782d=>{const {actions:_0x56bc5c,..._0x385bcb}=_0x319d50;return{..._0x57782d,'parent':_0x385bcb};})['filter'](_0x2dd217=>this['_shouldIncludeAction'](_0x2dd217))};}return _0x5181f7;})['filter'](_0x567ed0=>'actions'in _0x567ed0?_0x567ed0['actions']['length']>0x0:this['_shouldIncludeAction'](_0x567ed0));}['_shouldIncludeAction'](_0x3640ad){const _0x2b0988=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ua[_0x3640ad['type']])&&!_0x2b0988['includes'](_0x3640ad['id'])&&!('CHAT'===_0x3640ad['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x3bb302){this['_quickActionsDefinition']['forEach'](_0x382ba2=>{if('actions'in _0x382ba2){const _0x2f0a38=ee({'editor':this['editor'],'content':_0x382ba2['actions'],'buttonDefinition':_0x382ba2,'bodyCollection':_0x3bb302});this['editor']['ui']['componentFactory']['add'](_0x382ba2['id'],_0x2f0a38),_0x382ba2['actions']['forEach'](_0x7b160d=>{const _0x4e90d6=ie({'editor':this['editor'],'action':_0x7b160d});this['editor']['ui']['componentFactory']['add'](_0x7b160d['id'],_0x4e90d6);});}else{const _0xf6ac5f=ie({'editor':this['editor'],'action':_0x382ba2,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x382ba2['id'],_0xf6ac5f);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x5f32eb=>{const _0x47e492=new _0x44a9af(_0x5f32eb),_0x3f7f79=i(_0x5f32eb,'AI_QUICK_ACTIONS_HEADING');_0x47e492['buttonView']['set']({'label':_0x3f7f79,'icon':_0x157b90});const _0x1a527a=new _0x32dd81(_0x5f32eb);_0x1a527a['set']({'ariaLabel':_0x3f7f79,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x422350=>{if('actions'in _0x422350){const _0xafb27c=_0x422350,_0x82ed1=new _0x53ce29(_0x5f32eb,_0x47e492),_0x1e120d=new _0x44a9af(_0x5f32eb),_0x5e371c=new _0x32dd81(_0x5f32eb);_0x1e120d['buttonView']['set']({'label':_0xafb27c['label'],'icon':_0xafb27c['icon']}),_0xafb27c['actions']['forEach'](_0x53569e=>{const _0x1c9bae=new _0x53ce29(_0x5f32eb,_0x1e120d),_0x2349f6=new _0x3ce5a8(_0x5f32eb);_0x2349f6['set']({'label':_0x53569e['displayedPrompt'],'icon':_0x53569e['icon'],'role':'menuitem','isEnabled':_0x53569e['isEnabled']}),_0x2349f6['on']('execute',()=>{this['_executeQuickAction'](_0x53569e);}),_0x2349f6['delegate']('execute')['to'](_0x1e120d),_0x1c9bae['children']['add'](_0x2349f6),_0x5e371c['items']['add'](_0x1c9bae);}),_0x1e120d['panelView']['children']['add'](_0x5e371c),_0x82ed1['children']['add'](_0x1e120d),_0x1a527a['items']['add'](_0x82ed1);}else{const _0x134526=_0x422350,_0x2f7df1=new _0x53ce29(_0x5f32eb,_0x47e492),_0x647f34=new _0x3ce5a8(_0x5f32eb);_0x647f34['set']({'label':_0x134526['displayedPrompt'],'icon':_0x134526['icon'],'role':'menuitem','isEnabled':_0x134526['isEnabled']}),_0x647f34['on']('execute',()=>{this['_executeQuickAction'](_0x134526);}),_0x647f34['delegate']('execute')['to'](_0x47e492),_0x2f7df1['children']['add'](_0x647f34),_0x1a527a['items']['add'](_0x2f7df1);}});const _0xdc83bc=Object['values'](Ua)['some'](_0x356c2c=>this['editor']['plugins']['has'](_0x356c2c));return _0x47e492['set']({'isEnabled':_0xdc83bc}),_0x47e492['panelView']['children']['add'](_0x1a527a),_0x47e492;});}['_executeQuickAction'](_0x51c11){const _0x3f18ad=this['editor'];_0x3f18ad['editing']['view']['focus'](),_0x3f18ad['commands']['execute']('aiQuickAction',_0x51c11);const _0xff6829=_0x3f18ad['ui']['view']['menuBarView'];_0xff6829&&_0xff6829['close']&&_0xff6829['close']();}}class ci extends Qt{['execute'](_0x2bbf68){switch(this['_expandSelectionIfCollapsed'](),_0x2bbf68['type']){case Gt['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x1d2054=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x36b126('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x1d2054});}this['_handleAIChatAction'](_0x2bbf68);break;case Gt['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x3d16fc=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x36b126('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x3d16fc});}this['_handleAIActionsAction'](_0x2bbf68);break;case Gt['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x506e1c=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x36b126('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x506e1c});}this['_handleAIReviewAction'](_0x2bbf68);}}async['_handleAIChatAction'](_0x1c6497){const _0x4696cd=this['editor']['plugins']['get']('AIChat'),_0x38db8a=this['editor']['plugins']['get']('AIChatController'),_0x4d8c23=this['editor']['plugins']['get']('AITabs')['view'];if(_0x4d8c23['isVisible']||(_0x4d8c23['isVisible']=!0x0),'chat'!==_0x4d8c23['activeTab']&&_0x4d8c23['activateTab']('chat'),'ask-ai'===_0x1c6497['id'])_0x38db8a['removeSelectionFromChatContext'](),await _0x4696cd['addSelectionToChatContext'](),_0x4696cd['focusPromptInput']();else await _0x4696cd['startConversation'](),_0x38db8a['removeSelectionFromChatContext'](),await _0x4696cd['addSelectionToChatContext'](),_0x4696cd['focusPromptInput'](),await _0x4696cd['sendMessage']({'message':_0x1c6497['prompt']||_0x1c6497['displayedPrompt'],'quickActionData':{'id':_0x1c6497['id'],'displayedPrompt':_0x1c6497['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x2952c3=this['editor'],_0xd4d6b0=_0x2952c3['model']['document']['selection'];if(!_0xd4d6b0['isCollapsed'])return;const _0x532b1d=_0x165b43(_0xd4d6b0['getSelectedBlocks']())||_0x2952c3['model']['schema']['getLimitElement'](_0xd4d6b0);_0x2952c3['model']['change'](_0x315c2b=>{_0x315c2b['setSelection'](_0x532b1d,'in');});}['_handleAIActionsActionLabel'](_0x4274af){return _0x4274af['parent']?.['label']&&'other'!==_0x4274af['parent']?.['id']?_0x4274af['parent']['label']+':\x20'+_0x4274af['displayedPrompt']:_0x4274af['displayedPrompt'];}async['_handleAIActionsAction'](_0x1be2a0){const _0x3ddecb=this['editor']['plugins']['get']('AIActions'),_0x4612f7=_0x1be2a0['prompt']?{'userMessage':_0x1be2a0['prompt'],'model':_0x1be2a0['model']}:{'actionName':_0x1be2a0['actionName']||_0x1be2a0['id'],'args':_0x1be2a0['args']},_0x84a91e=this['_handleAIActionsActionLabel'](_0x1be2a0);await _0x3ddecb['executeAction'](_0x4612f7,_0x84a91e,_0x1be2a0['icon']);}async['_handleAIReviewAction'](_0x1517e3){console['log']('handleAIReviewAction',_0x1517e3);}}class ti extends _0x346ac8{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x2076a0=this['editor'],_0x436018=new ci(this['editor']);if(_0x2076a0['commands']['add']('aiQuickAction',_0x436018),_0x2076a0['plugins']['has']('AIChat')){const _0x110db2=this['editor']['plugins']['get']('AIChat');_0x2076a0['model']['document']['selection']['on']('change:range',(_0x53f373,_0x46fe77)=>{_0x46fe77['directChange']&&_0x110db2['removeSelectionFromChatContext']();});}}}class Ae extends Ge{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x37b459=this['documentContextContent']['children']['map'](_0x23f536=>({'node':_0x23f536,'id':vt(_0x23f536,'data-id')})),_0x1b981c=this['parsedMergedContent']['children']['map'](_0x54e504=>({'node':_0x54e504,'id':vt(_0x54e504,'data-id')||_0xdc126c()})),_0x10ba9e=_0xbfd009(_0x37b459,_0x1b981c,{'comparator':(_0x456978,_0x3d52a8)=>_0x456978['id']==_0x3d52a8['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x10ba9e['length']&&_0x10ba9e[_0x10ba9e['length']-0x1]['removed'];)_0x10ba9e['pop']();}const _0x3f3089=_0x10ba9e['map'](_0x2cb13c=>{const _0x39fc08=_0x2cb13c['added']?'new':_0x2cb13c['removed']?'removed':'modified';return{'node':_0x2cb13c['value'][0x0]['node'],'type':_0x39fc08,'id':_0x2cb13c['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x3f3089,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0xe2c45a,_0x3115e2){return _0x3115e2;}}class V extends xe{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x20641e){super(_0x20641e),this['content']=_0x20641e['content'],this['version']=_0x20641e['version'],this['actionName']=_0x20641e['actionName'],this['args']=_0x20641e['args'],this['userMessage']=_0x20641e['userMessage'],this['model']=_0x20641e['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':je['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x1a7cb3){const _0xe3745f=new Ae({'editor':this['editor'],'documentContextContent':this['content'],..._0x1a7cb3});return this['replies']['push'](_0xe3745f),_0xe3745f['delegate'](...Ce)['to'](this),this['fire']('replyCreated',_0xe3745f),_0xe3745f;}}class ri extends _0x346ac8{static get['requires'](){return[S,_0xe646c5,R,H,_0x2dc9e7];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_customViews']=new _0x317ee8();['_navigationPreviousButton'];['_navigationCounter'];['_isNavigationCounterInView']=!0x1;['_navigationNextButton'];['_isNavigationPreviousButtonInView']=!0x1;['_isNavigationNextButtonInView']=!0x1;['_promiseQueue'];['_bodyCollection'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}constructor(_0x19846f){super(_0x19846f),this['_bodyCollection']=new _0x44dc72(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new W(),this['_setupCustomViews']();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x18c36e,_0x512aba,_0x3f0efd){if(this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x2f7994,anchorData:_0x1ac6e2}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x18c36e,_0x2f7994,_0x1ac6e2,_0x512aba,_0x3f0efd);}}const {modelFragment:_0x1e6f8c,anchorData:_0xd32317}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x18c36e,_0x1e6f8c,_0xd32317,_0x512aba,_0x3f0efd);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_getExecuteDataRegular'](){const _0x2aa4f3=this['editor']['model']['document']['selection'];if(_0x2aa4f3['isCollapsed']){const _0x5bfc43=_0x165b43(_0x2aa4f3['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x2aa4f3);this['editor']['model']['change'](_0x449845=>{_0x449845['setSelection'](_0x5bfc43,'in');});}const _0x348d31=_0x2aa4f3['getFirstRange'](),_0x52da76=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x2aa4f3),_0x348d31['start'],_0x348d31['end']),_0x3fed0f=_0x2aa4f3['getFirstRange']()['start'],_0x5a83ff=new Map();let _0x530df0=_0x52da76;for(let _0x507e04=0x0;_0x507e04<_0x3fed0f['path']['length'];_0x507e04++)_0x5a83ff['set'](_0x530df0,_0x3fed0f['path'][_0x507e04]),_0x530df0=_0x530df0['getChild'](0x0);return{'modelFragment':_0x52da76,'anchorData':_0x5a83ff};}['_getExecuteDataInTable'](){const _0x3d175c=this['editor']['model']['document']['selection'],_0x534d73=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x51f426=_0x3d175c['getFirstRange']()['start']['parent']['parent'],_0x9bd2c7=this['_wrapWithCommonAncestors'](_0x534d73,this['editor']['model']['createPositionBefore'](_0x51f426),this['editor']['model']['createPositionAfter'](_0x51f426)),_0x5dd8d7=_0x3d175c['getFirstRange']()['start'],_0x478a24=new Map();let _0x575079=_0x9bd2c7;for(let _0x1e333d=0x0;_0x1e333d<_0x5dd8d7['path']['length'];_0x1e333d++)if(_0x478a24['set'](_0x575079,_0x5dd8d7['path'][_0x1e333d]),_0x1e333d<_0x5dd8d7['path']['length']-0x1)_0x575079=_0x575079['getChild'](0x0);else{let _0x1841d5=_0x575079['nextSibling'];for(;_0x1841d5;)_0x478a24['set'](_0x1841d5,_0x5dd8d7['path'][_0x1e333d]),_0x1841d5=_0x1841d5['nextSibling'];}return{'modelFragment':_0x9bd2c7,'anchorData':_0x478a24};}['_executeAction'](_0x32c400,_0x5c6cfc,_0x46177e,_0x3814d6,_0x332940){const _0x156bd8=this['editor']['plugins']['get'](R),_0x115fea=this['editor']['plugins']['get'](H),_0x2b9664=this['editor']['model']['document']['selection'],_0x37efd6=_0x156bd8['modelToViewWithIds'](_0x5c6cfc),_0x37e8e0=this['editor']['data']['processor']['toData'](_0x37efd6),_0x969143=this['editor']['model']['document']['version'],_0x4af74c=[..._0x2b9664['getRanges']()];let _0x244187=this['editor']['config']['get']('ai.availableReplyActions')||[...et];this['editor']['plugins']['has']('TrackChanges')||(_0x244187=_0x244187['filter'](_0x2d1d92=>'insertSuggestion'!=_0x2d1d92));const _0x2e48cf=new T(this['editor']['locale'],{'showDiff':!0x1,'areActionsDisabled':!0x1,'hideHeader':!0x0,'showLoader':!0x0,'miniToolbarConfig':{'showChanges':'icon','customView':this['_customViews']},'showUnchangedParts':!0x0,'availableActions':_0x244187},this['_bodyCollection']);return _0x115fea['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x3814d6,'icon':_0x332940||_0x157b90,'mainView':_0x2e48cf,'showRotator':!0x1,'showApplyButton':!0x0,'showSuggestButton':this['editor']['plugins']['has']('TrackChanges'),'ranges':_0x4af74c}),this['_setLoadingState'](_0x2e48cf,_0x115fea),this['listenTo'](_0x115fea,'applySuggestion',()=>{this['_applyChanges'](_0x5c6cfc,_0x46177e,!0x1);}),this['listenTo'](_0x115fea,'insertSuggestion',()=>{this['_applyChanges'](_0x5c6cfc,_0x46177e,!0x0);}),this['listenTo'](_0x115fea,'selectionRemoved',()=>{this['_stopInteraction'](),this['_disableCustomViews']();}),this['listenTo'](_0x115fea,'dialogClosed',()=>{if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x3a09a8=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x336f4c=_0x3a09a8['changeGroups'][0x0];_0x336f4c&&'pending'===_0x336f4c['state']&&_0x3a09a8['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](_0x115fea);}),this['_createInteraction'](_0x37e8e0,_0x969143,_0x2e48cf,_0x115fea,_0x32c400);}['_wrapWithCommonAncestors'](_0x5459ee,_0x160411,_0x5ce0c7){const _0x42ddb1=this['editor']['model']['createRange'](_0x160411,_0x5ce0c7)['getCommonAncestor'](),_0x26308c=_0x42ddb1['is']('documentFragment')?[]:_0x42ddb1['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x26308c['length']){const _0x172351=_0x26308c['map'](_0xd691dd=>_0xd691dd['_clone'](!0x1));for(let _0x249fdc=0x1;_0x249fdc<_0x172351['length'];_0x249fdc++)_0x172351[_0x249fdc-0x1]['_appendChild'](_0x172351[_0x249fdc]);return _0x172351[_0x172351['length']-0x1]['_appendChild'](_0x5459ee),new _0x490745(_0x172351[0x0]);}return _0x5459ee;}async['_createInteraction'](_0xc0e3c1,_0x4be520,_0x16280d,_0x3d4942,_0x5e9e03){const _0x129618=this['editor'];this['_interactionParams']={'action':_0x5e9e03,'content':_0xc0e3c1,'version':_0x4be520,'mainView':_0x16280d,'aiBalloon':_0x3d4942};const _0x20be21=new V({'connector':this['_aiConnector'],'editor':_0x129618,'content':_0xc0e3c1,'version':_0x4be520,..._0x5e9e03});this['_interactions']['push'](_0x20be21),_0x16280d['hideError']();const _0x24e7a2=(_0x11bfdd,_0x4a2433,_0x1b900a=!0x1,_0x270a0b='streaming')=>this['_promiseQueue']['enqueue'](async _0x43dea5=>{try{const _0x37908c=Q({'editor':_0x129618,'changeGroups':_0x11bfdd['changeGroups'],'documentContextContent':_0x11bfdd['documentContextContent'],'showDiff':_0x1b900a,'trimUnchanged':!0x1});await _0x4a2433['updateContent']({'parts':_0x37908c,'renderingStrategy':_0x270a0b,'abortSignal':_0x43dea5});}catch(_0x3c9f61){if(this['_isAbortError'](_0x3c9f61))return;throw _0x3c9f61;}});this['_interaction']['on']('replyCreated',(_0x4dbe0b,_0x5b2503)=>{_0x16280d['hideLoader'](),_0x3d4942['startAutoScroll'](),_0x24e7a2(_0x5b2503,_0x16280d)['catch'](_0x4e2845=>{this['_isAbortError'](_0x4e2845)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x4e2845),this['_setErrorState'](_0x20be21,_0x16280d));});}),this['_interaction']['on']('replyContentUpdated',(_0x3f5953,_0x29ea90)=>{_0x24e7a2(_0x29ea90,_0x16280d)['catch'](_0x2acbac=>{this['_isAbortError'](_0x2acbac)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x2acbac),this['_setErrorState'](_0x20be21,_0x16280d));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](_0x16280d,_0x3d4942),this['_updateNavigationUI'](),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x2b09a2){this['_isAbortError'](_0x2b09a2)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x2b09a2),this['_setErrorState'](_0x20be21,_0x16280d));}finally{_0x3d4942['stopAutoScroll']();}}),this['listenTo'](_0x16280d,'toggleSuggestionDisplayMode',async(_0x3e4276,{showDiff:_0x455ac8})=>{try{this['_balloonShowDiff']=_0x455ac8;const _0x5b6b72=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x5b6b72&&await _0x24e7a2(_0x5b6b72,_0x16280d,_0x455ac8,'static');}catch(_0x393cba){this['_isAbortError'](_0x393cba)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x393cba),this['_setErrorState'](_0x20be21,_0x16280d));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x2c8811,{reply:_0x14fd75})=>{const _0xc78eea={'positiveCount':_0x14fd75['changeGroups']['filter'](_0x5e632e=>'accepted'===_0x5e632e['state'])['length'],'totalCount':_0x14fd75['changeGroups']['length']},_0x5e19f6=this['_interaction']['actionCallId'],_0x39ffb7=this['_interaction']['actionName'];_0x39ffb7?this['_aiConnector']['upsertAIActionRating'](_0x39ffb7,_0x5e19f6,_0xc78eea):this['_aiConnector']['upsertCustomAIActionRating'](_0x5e19f6,_0xc78eea);}),this['_setLoadingState'](_0x16280d,_0x3d4942);try{const _0x4bf709=await this['_interaction']['start']();return this['_updateNavigationUI'](),_0x4bf709;}catch(_0x3cc74a){if(this['_isAbortError'](_0x3cc74a))return;_0x16280d['hideLoader'](),this['_setErrorState'](_0x20be21,_0x16280d);}}['_applyChanges'](_0x47b24c,_0x15decd,_0x1508a7){const _0xe74b39=this['editor'];if(_0x1508a7&&!_0xe74b39['plugins']['has']('TrackChanges'))throw new _0x36b126('ai-no-track-changes',null);const _0x33522f=this['editor']['plugins']['get'](_0x2dc9e7),_0x51b105=this['_interaction'],_0x377aab=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x3de63c=_0x377aab['changeGroups'];_0x377aab['setChangeGroupState'](0x0,'accepted');let _0x379efe=z({'editor':_0xe74b39,'reply':_0x377aab,'interaction':_0x51b105,'groups':_0x3de63c,'transform':!0x1,'documentCompare':_0x33522f,'documentCompareOptions':{'anchor':_0xe74b39['model']['createPositionAt'](_0x47b24c,0x0),'markDeletions':_0x1508a7}});_0x379efe=this['_filterOperationsOutsideRange'](_0x379efe,_0x15decd);for(const _0x5259ba of _0x379efe)this['_anchorOperation'](_0x15decd,_0x5259ba,_0xe74b39['model']['document']['getRoot']());const _0x1e363b=_0x51b105['getDocumentContext']()['version'],_0x39b7e2=_0xe74b39['model']['document']['history']['getOperations'](_0x1e363b),_0x515590={'document':_0xe74b39['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x38072e=st(_0x379efe,_0x39b7e2,_0x515590)['operationsA'];_0xe74b39['model']['change'](_0x3c9bfe=>{if(_0x3c9bfe['setSelection'](_0xe74b39['model']['document']['selection']['focus']),_0x1508a7)_0xe74b39['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x38072e);else{for(const _0x32cc04 of _0x38072e)_0x32cc04['baseVersion']=_0xe74b39['model']['document']['version'],Y(_0xe74b39,_0x32cc04),_0x3c9bfe['batch']['addOperation'](_0x32cc04),_0xe74b39['model']['applyOperation'](_0x32cc04);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x31b3bf,_0x9501fd){return _0x31b3bf['filter'](_0x580694=>{if('rename'==_0x580694['type']){const _0x169f5a=_0x580694['position']['nodeAfter'];return!_0x9501fd['has'](_0x169f5a);}if(_0x580694['type']['indexOf']('Attribute')>-0x1){const _0x33106e=_0x580694['range']['start']['nodeAfter'];return!_0x9501fd['has'](_0x33106e);}return!0x0;});}['_anchorOperation'](_0x225a7f,_0x54f7b8,_0x1e7d66){const _0x5f413d=_0x54f7b8['clone']();for(const _0x38019c in _0x54f7b8){const _0x1cab7f=_0x54f7b8[_0x38019c];_0x1cab7f instanceof _0x1026dd?_0x54f7b8[_0x38019c]=new _0x1026dd(_0x1c6094(_0x1cab7f['start']),_0x1c6094(_0x1cab7f['end'])):_0x1cab7f instanceof tt&&(_0x54f7b8[_0x38019c]=_0x1c6094(_0x1cab7f));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x5f413d['type'])){if(_0x5f413d['isDocumentOperation']=!0x1,_0x5f413d['baseVersion']=null,'remove'==_0x5f413d['type']){const _0x4f0911=_0x5f413d['sourcePosition'],_0x561d33=_0x5f413d['howMany'];new it(_0x4f0911,_0x561d33)['_execute']();}else _0x5f413d['_execute']();}function _0x1c6094(_0x3908ab){if('$graveyard'==_0x3908ab['root']['rootName'])return _0x3908ab;const _0x1cba33=[];let _0x5c16a4=_0x3908ab['root'];for(let _0x1e862f=0x0;_0x1e862f<_0x3908ab['path']['length'];_0x1e862f++){const _0x399672=_0x225a7f['get'](_0x5c16a4)||0x0;_0x1cba33[_0x1e862f]=_0x3908ab['path'][_0x1e862f]+_0x399672,_0x5c16a4=_0x5c16a4['getChildAtOffset'](_0x3908ab['path'][_0x1e862f]);}return new tt(_0x1e7d66,_0x1cba33,_0x3908ab['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x153433,content:_0x4fb8cd,version:_0x1777cc,mainView:_0x4e3644,aiBalloon:_0x2edbaa}=this['_interactionParams'];_0x4e3644['areChangesVisible']=!0x1,_0x4e3644['hideError'](),this['_clearErrorState'](_0x4e3644,_0x2edbaa);const _0x142a2e=_0x4e3644;_0x142a2e['miniToolbarView']&&_0x142a2e['miniToolbarView']['showChangesButton']&&_0x142a2e['miniToolbarView']['showChangesButton']['set']({'isOn':!0x1,'icon':_0x24690e}),this['_clearSuggestionContent'](_0x4e3644),_0x4e3644['showLoader'](),this['_updateNavigationUI'](),this['stopListening'](_0x4e3644),this['_createInteraction'](_0x4fb8cd,_0x1777cc,_0x4e3644,_0x2edbaa,_0x153433)['catch'](_0x5951e6=>{this['_isAbortError'](_0x5951e6)||console['error']('Error\x20refreshing\x20interaction:',_0x5951e6);});}['_clearSuggestionContent'](_0xbfab4e){const _0x3f2ddf=_0xbfab4e['bodyView']['_children'];for(;_0x3f2ddf['length']>0x0;)_0x3f2ddf['remove'](_0x3f2ddf['first']);_0xbfab4e['bodyView']['hasPendingParts']=!0x1;}['_isAbortError'](_0x54ab18){return!!_0x54ab18['message']&&_0x54ab18['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_updateNavigationUI']();}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['_interactionParams']&&this['_interactionParams']['aiBalloon']['stopAutoScroll']();}['_setupCustomViews'](){const _0x570d51=new _0xcbb426(this['editor']['locale']),_0xc671cd=new _0xcbb426(this['editor']['locale']),_0x3d794a=new _0x43effc(this['editor']['locale']),_0x582254=new _0xcbb426(this['editor']['locale']);_0x570d51['set']({'icon':_0xdacbe3,'label':i(this['editor']['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0xc671cd['set']({'icon':_0x1420c7,'tooltip':i(this['editor']['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x3d794a['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':['1/1']}),_0x582254['set']({'icon':_0x4309f7,'tooltip':i(this['editor']['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x570d51['bind']('isEnabled')['to'](this,'isBusy',_0x192db2=>!_0x192db2),_0x570d51['on']('execute',()=>{this['_refreshInteraction']();}),_0xc671cd['bind']('isEnabled')['to'](this,'isBusy',_0x41fe56=>!_0x41fe56),_0xc671cd['on']('execute',()=>{this['_navigateToPrevious']();}),_0x582254['bind']('isEnabled')['to'](this,'isBusy',_0x1670e7=>!_0x1670e7),_0x582254['on']('execute',()=>{this['_navigateToNext']();}),this['_navigationPreviousButton']=_0xc671cd,this['_navigationCounter']=_0x3d794a,this['_navigationNextButton']=_0x582254,this['_customViews']['add'](_0x570d51);}['_navigateToPrevious'](){const _0x2c2045=this['_interactions']['length'];this['_currentInteractionIndex']<_0x2c2045-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x3e16bc){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x3e16bc;const {mainView:_0x2f7e8b}=this['_interactionParams'],_0x8e8a05=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x8e8a05)return;if(_0x8e8a05['hasError'])return this['_setErrorState'](_0x8e8a05,_0x2f7e8b),void this['_updateNavigationUI']();if(!_0x8e8a05['replies']['length'])return;_0x2f7e8b['hideError'](),this['_interactionParams']&&this['_clearErrorState'](_0x2f7e8b,this['_interactionParams']['aiBalloon']);const _0x2adfbf=_0x8e8a05['replies'][_0x8e8a05['replies']['length']-0x1];if(_0x2adfbf){const _0x5b0c65=this['editor'];this['_clearSuggestionContent'](_0x2f7e8b);try{const _0x17e354=Q({'editor':_0x5b0c65,'changeGroups':_0x2adfbf['changeGroups'],'documentContextContent':_0x2adfbf['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});this['_clearSuggestionContent'](_0x2f7e8b),await new Promise(_0x2abc5d=>setTimeout(_0x2abc5d,0x32)),await _0x2f7e8b['updateContent']({'parts':_0x17e354,'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0xacc46e){this['_isAbortError'](_0xacc46e)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0xacc46e);}}this['_updateNavigationUI']();}['_updateNavigationUI'](){if(!this['_navigationPreviousButton']||!this['_navigationCounter']||!this['_navigationNextButton'])return;const _0x1d010b=this['_interactions']['length'],_0x1e6936=_0x1d010b>0x1,_0x2229c7=this['_interactionParams']?.['mainView'];if(_0x1e6936){this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView']||(this['_customViews']['add'](this['_navigationPreviousButton']),_0x2229c7?.['addNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x0,this['_customViews']['add'](this['_navigationCounter']),_0x2229c7?.['addNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x0,this['_customViews']['add'](this['_navigationNextButton']),_0x2229c7?.['addNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x0);const _0x1d94d8=_0x1d010b-this['_currentInteractionIndex'];this['_navigationCounter']['element']&&(this['_navigationCounter']['element']['textContent']=_0x1d94d8+'/'+_0x1d010b),this['_navigationPreviousButton']['isEnabled']=this['_currentInteractionIndex']<_0x1d010b-0x1,this['_navigationNextButton']['isEnabled']=this['_currentInteractionIndex']>0x0;}else(this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView'])&&(this['_customViews']['remove'](this['_navigationPreviousButton']),_0x2229c7?.['removeNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x1,this['_customViews']['remove'](this['_navigationCounter']),_0x2229c7?.['removeNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x1,this['_customViews']['remove'](this['_navigationNextButton']),_0x2229c7?.['removeNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x1);}['_setLoadingState'](_0x2fbcab,_0xee9acf){_0x2fbcab['setLoading'](),_0xee9acf['balloonView']['setLoading'](),this['isBusy']=!0x0;}async['_setErrorState'](_0x39d090,_0x2d3bb8){const _0x42875f=i(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');_0x2d3bb8['showError'](_0x42875f),_0x39d090['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],_0x2d3bb8['setErrorState'](),this['_interactionParams']?.['aiBalloon']['balloonView']['toolbar']&&(this['_interactionParams']['aiBalloon']['balloonView']['toolbar']['isLoading']=!0x0);}['_clearErrorState'](_0x218bf8,_0x32c449){_0x218bf8['clearErrorState'](),_0x32c449['balloonView']['toolbar']&&(_0x32c449['balloonView']['toolbar']['isLoading']=!0x1);}async['_clearLoadingState'](_0xefca58,_0x4c7fe9){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,_0xefca58['clearLoading'](),_0x4c7fe9['balloonView']['clearLoading']();}['_disableCustomViews'](){this['_customViews']['forEach'](_0x56015c=>{'isEnabled'in _0x56015c&&(_0x56015c['isEnabled']=!0x1);});}}class Va extends _0x346ac8{static get['requires'](){return[ii,ti,ri];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3abe63){super(_0x3abe63),_0x3abe63['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class js{['id'];['title'];['description'];['isParameterized'];['useArgs'];['options'];constructor({id:_0x35d5aa,title:_0x3ae232,description:_0x10ba1d,isParameterized:_0x2d146d,useArgs:_0x2fc6f5,options:_0x34d2a3}){this['id']=_0x35d5aa,this['title']=_0x3ae232,this['description']=_0x10ba1d,this['isParameterized']=_0x2d146d,this['useArgs']=_0x2fc6f5,this['options']=_0x34d2a3;}}class Bs extends js{['_models']=[];get['models'](){return this['_models'];}set['models'](_0x287530){this['_models']=_0x287530;}}class si extends ts(){['_checks'];constructor(_0x57190e){super(),this['_checks']=this['_mapCheckDefinitions'](_0x57190e);}get['checks'](){return this['_checks'];}['getCheckById'](_0x414b91){return this['checks']['find'](_0x16d45a=>_0x16d45a['id']===_0x414b91);}['removeCheckById'](_0xddb815){this['_checks']=this['_checks']['filter'](_0x4741bc=>_0x4741bc['id']!==_0xddb815);}['_mapCheckDefinitions'](_0x3c65a6){return _0x3c65a6['map'](_0x1e0ea6=>'custom'===_0x1e0ea6['id']?new Bs(_0x1e0ea6):new js(_0x1e0ea6));}}class Rs extends _0x19d98c(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x9dc594,contentNew:_0x15d35c,contentInitial:_0x534bc5,documentVersion:_0x76776}){super(),this['id']=_0x9dc594,this['contentNew']=_0x15d35c,this['contentInitial']=_0x534bc5,this['documentVersion']=_0x76776;}}class Ds extends ts(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0xca41b1,_0x5e930d,_0x1d6d10){super(),this['id']=_0xca41b1,this['parent']=_0x1d6d10,this['_data']=_0x5e930d,this['set']('isActivated',!0x1),this['set']('isRated',!0x1),this['set']('status','pending'),this['on']('change:status',()=>{'pending'!==this['status']&&this['isActivated']&&(this['isActivated']=!0x1);});}get['contentDiffed'](){return this['_data']['context']();}get['operations'](){return this['_data']['operations'];}get['operationsIsolated'](){return this['_data']['operationsIsolated'];}}class zs extends ts(){['id']=_0xdc126c();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];constructor(_0x456293,_0x1ed6f0,_0x7f4350,_0x3239d2,_0x16c386){super(),this['_sourceCheck']=_0x1ed6f0,this['_documentData']=_0x456293,this['_aiConnector']=_0x7f4350,this['_reviewParams']=_0x3239d2,this['_reviewArgs']=_0x16c386,this['on']('change:status',(_0x2ca7e6,_0x2d5a33,_0x48525c)=>{this['fire']('reviewCheckRunUpdated',{'status':_0x48525c,'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'](_0x4da877=>'pending'===_0x4da877['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x1fd127){this['_documentData']=_0x1fd127;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x5a031d=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x5b154e of _0x5a031d)'unmodified'!==_0x5b154e['data']['operation']&&('error'!==_0x5b154e['data']['operation']?'review-metadata'!==_0x5b154e['event']?this['_addReviewCheckResult'](_0x5b154e['data']['dataId'],_0x5b154e['data']['textDelta']):this['callId']=_0x5b154e['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(_0x53518f){this['_currentError']=_0x53518f,_0x53518f instanceof Error&&_0x53518f['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'](_0x30cda0,_0x1e427f){const _0x4b417d=this['_results']['get'](_0x30cda0);if(!_0x4b417d)return;if(0x0===_0x1e427f['length'])return;const _0x2f092e=[];_0x1e427f['forEach']((_0x34fcf6,_0x1f79d0)=>{const _0x374df1=new Ds(_0x4b417d['id']+'-'+_0x1f79d0,_0x34fcf6,_0x4b417d);_0x374df1['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x374df1,'status':_0x374df1['status']});}),_0x374df1['on']('change:isActivated',()=>{_0x374df1['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x374df1}):this['fire']('reviewCheckResultDeactivated',{'change':_0x374df1});}),this['_changes']['push'](_0x374df1),_0x2f092e['push'](_0x374df1);}),this['fire']('reviewCheckResultReady',{'changes':_0x2f092e,'result':_0x4b417d,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x9f430e){const _0x4748d3=this['_changes']['find'](_0x4733c4=>_0x4733c4['id']===_0x9f430e);return!(!_0x4748d3||'pending'!==_0x4748d3['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x299305=>!0x0===_0x299305['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x36d1bd=>'pending'===_0x36d1bd['status']);}['getChangeById'](_0x33a0b7){return this['_changes']['find'](_0x4cce08=>_0x4cce08['id']===_0x33a0b7);}['markAllChangesAsAccepted'](){for(const _0x1032d9 of this['_changes'])'pending'===_0x1032d9['status']&&(_0x1032d9['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0xed4ce0){const _0x3bcd45=this['_changes']['find'](_0x1f34b8=>_0x1f34b8['id']===_0xed4ce0);_0x3bcd45&&'pending'===_0x3bcd45['status']&&(_0x3bcd45['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x1ad548){const _0x228e75=this['_changes']['find'](_0xefb337=>_0xefb337['id']===_0x1ad548);_0x228e75&&'pending'===_0x228e75['status']&&(_0x228e75['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x4bc840){const _0x1e2865=this['_changes']['find'](_0x38f198=>_0x38f198['id']===_0x4bc840);_0x1e2865&&'pending'===_0x1e2865['status']&&(_0x1e2865['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x45d83c){const _0x2a089e=this['_changes']['find'](_0x37b5ab=>_0x37b5ab['id']===_0x45d83c);_0x2a089e&&'outdated'===_0x2a089e['status']&&(_0x2a089e['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x3e2fc4){this['_changes']['filter'](_0x86375e=>_0x86375e['isActivated']&&_0x86375e['id']!==_0x3e2fc4)['forEach'](_0x28fe0e=>{_0x28fe0e['isActivated']=!0x1;});const _0xaf7a35=this['_changes']['find'](_0x45b502=>_0x45b502['id']===_0x3e2fc4);_0xaf7a35&&'pending'===_0xaf7a35['status']&&(_0xaf7a35['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x84f291=>_0x84f291['isActivated'])['forEach'](_0x108cc2=>{_0x108cc2['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x57b9ea){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x58880f;if(_0x57b9ea){const _0xbfb3c=this['_changes']['find'](_0x1bd351=>_0x1bd351['id']===_0x57b9ea);if(_0xbfb3c&&_0xbfb3c['isRated'])return;_0xbfb3c&&(_0x58880f=_0xbfb3c['parent']['id'],_0xbfb3c['isRated']=!0x0);}const _0x37e052={'positiveCount':this['_changes']['filter'](_0x4ef947=>'accepted'===_0x4ef947['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x37e052,this['callId'],_0x58880f);}['_addReviewCheckResult'](_0x3ff3c2,_0x5b7b4e){const _0x5c491f=this['_documentData']['elements']['get'](_0x3ff3c2);if(!_0x5c491f)return;const _0x16e429=_0x5c491f['getContent']();if(_0x16e429===_0x5b7b4e)return;const _0x3c892d=new Rs({'id':_0x3ff3c2,'contentInitial':_0x16e429,'contentNew':_0x5b7b4e,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x3c892d['id'],_0x3c892d),this['fire']('reviewCheckResultAdded',{'result':_0x3c892d,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0xa2de06=>'pending'===_0xa2de06['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x45b529=>'pending'===_0x45b529['status'])['length']&&(this['status']='finished'));}}class hi extends zs{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x17e515=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x3de0ff=0x0;_0x3de0ff<this['_reviewParams']['length'];_0x3de0ff++){if(!this['_reviewParams'][_0x3de0ff]||!this['_sourceCheck']['options'][_0x3de0ff])continue;const _0x475c53=this['_sourceCheck']['options'][_0x3de0ff],_0x16d81f=_0x475c53['data']?.['find'](_0x3649aa=>_0x3649aa['id']===this['_reviewParams'][_0x3de0ff]);_0x16d81f&&_0x17e515['push'](_0x16d81f['label']);}return _0x17e515['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x412e21,_0xb8ab42,_0x360a3d){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0xb8ab42,_0x412e21,_0x360a3d);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['id']:[this['_sourceCheck']['id'],...this['_reviewParams']]['join']('-');}}class oi extends zs{['_prompt'];['_model'];constructor(_0x1d3fb1,_0x408721,_0x4febe9,_0x1841af,_0x47e8f5){super(_0x4febe9,_0x1841af,_0x47e8f5),this['_prompt']=_0x1d3fb1,this['_model']=_0x408721;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x4f0571,_0x479eee,_0x3e284a){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x479eee,_0x4f0571,_0x3e284a);}}const ni=[{'id':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]},{'id':'translate','title':'Translate','description':'Translate\x20the\x20text\x20into\x20another\x20language.','isParameterized':!0x0,'useArgs':!0x0,'options':[{'formType':'dropdown','label':'Select\x20language','argsKey':'language','data':[{'label':'English','id':'english'},{'label':'Spanish','id':'spanish'},{'label':'French','id':'french'},{'label':'German','id':'german'},{'label':'Chinese\x20(Simplified)','id':'chinese'},{'label':'Japanese','id':'japanese'},{'label':'Russian','id':'russian'},{'label':'Portuguese','id':'portuguese'},{'label':'Korean','id':'korean'},{'label':'Italian','id':'italian'}]}]}];class re extends ot{['_aiConnector'];['_aiReviewModeUi'];['_aiReviewModeEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_isDiffOn']=!0x1;['_changeActivationSource']=null;static get['requires'](){return[S];}static get['pluginName'](){return'AIReviewModeController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiReviewModeUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewModeEditing']=this['context']['plugins']['get']('AIReviewModeEditing');const _0x4501b6=this['context']['config']['get']('ai.reviewMode.translations');if(_0x4501b6){for(const _0x867ae5 of ni)'translate'===_0x867ae5['id']&&(_0x867ae5['options'][0x0]['data']=_0x4501b6);}const _0x28f4ae=this['_translateReviewChecks'](ni);this['_aiReviewCheckList']=new si(_0x28f4ae);const _0x4bf82d=this['_aiReviewCheckList']['checks']['find'](_0x7671ff=>'custom'===_0x7671ff['id']);if(_0x4bf82d)try{_0x4bf82d['models']=await new At({'connector':this['_aiConnector'],'locale':this['context']['locale']})['getAll']();}catch(_0x4507c9){this['_aiReviewCheckList']['removeCheckById']('custom'),this['_logError'](new _0x36b126('ai-review-mode-models-unable-to-retrieve',this,{'error':_0x4507c9}));}this['listenTo'](this['_aiReviewModeUi'],'getReviewCheckList',()=>{this['_aiReviewModeUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewModeUi'],'runReviewCheck',async(_0x14e033,_0x133e35)=>{const _0x2b36b5=this['_aiReviewCheckList']['getCheckById'](_0x133e35['id']);if(_0x2b36b5){this['_onDiffChange'](this['_isDiffOn']),_0x133e35['isCustom']?this['_currentReviewCheckRun']=new oi(_0x133e35['args']['prompt'],_0x133e35['args']['model'],this['_aiReviewModeEditing']['getDocumentData'](),_0x2b36b5,this['_aiConnector']):this['_currentReviewCheckRun']=new hi(this['_aiReviewModeEditing']['getDocumentData'](),_0x2b36b5,this['_aiConnector'],_0x133e35['params'],_0x133e35['args']),this['_aiReviewModeUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0xeb0980,_0x4b6391)=>{switch(_0x4b6391['status']){case'data':case'loading':this['_aiReviewModeEditing']['switchToReadOnly'](),this['_aiReviewModeUi']['showCheckRunResults'](_0x4b6391);break;case'finished':this['_aiReviewModeUi']['showReviewCompletedView']();break;case'ready':this['_aiReviewModeUi']['showActionsWhenResultIsReady']();break;case'unmodified':this['_aiReviewModeUi']['showNoChangesView']();break;case'error-general':this['_aiReviewModeUi']['showGeneralResultsErrorView'](),this['_logError'](new _0x36b126('ai-review-mode-check-run-general-error',this,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewModeUi']['showChunkErrorView'](),this['_logError'](new _0x36b126('ai-review-mode-check-run-chunk-error',this,this['_currentReviewCheckRun']?.['currentError']));break;case'aborted':this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewModeRunLeave'](!0x0);}'ready'!==_0x4b6391['status']&&'error-chunk'!==_0x4b6391['status']&&'error-general'!==_0x4b6391['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x2a6b27,_0x3f318a)=>{if(!this['_currentReviewCheckRun'])throw new _0x36b126('ai-review-mode-no-current-check-run',this);const _0x4c0a29=this['_aiReviewModeEditing']['diffContent'](_0x3f318a['result']['contentInitial'],_0x3f318a['result']['contentNew']);_0x3f318a['source']['addResultChanges'](_0x3f318a['result']['id'],_0x4c0a29);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x251f66,_0x11f058)=>{for(const _0x24b3e8 of _0x11f058['changes'])this['_aiReviewModeUi']['showCheckRunResult'](_0x24b3e8);this['_aiReviewModeEditing']['markChangePositionInEditorContent'](_0x11f058['changes'],_0x11f058['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x1d9708,_0x33f1a9)=>{this['_aiReviewModeUi']['updateChangeState'](_0x33f1a9['change']['id'],_0x33f1a9['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x51fb86,_0x55f95d)=>{this['_aiReviewModeUi']['setActiveStateInResults'](_0x55f95d['change']['id']);const _0x341e2f=this['_aiReviewModeEditing']['getMarkerElementForChange'](_0x55f95d['change']['id']);if(!_0x341e2f)return;if('content'===this['_changeActivationSource']){const _0x13066f=this['_aiReviewModeUi']['getChangeElement'](_0x55f95d['change']['id']);_0x13066f&&_0x4ff008(_0x13066f['closest']('.ck-ai-review-mode__check-run-result')||_0x13066f);}else{if('panel'===this['_changeActivationSource']){const _0x138a74={'target':_0x341e2f['domElement'],'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0};ht(_0x138a74);}}const _0x36a86e=this['_aiReviewModeEditing']['getEditor']();this['_aiReviewModeUi']['showChangeBalloon'](_0x55f95d['change'],_0x341e2f['domElement'],void 0x0,'click',_0x36a86e?.['editing']?.['view']?.['getDomRoot'](),_0x36a86e?.['ui']?.['viewportOffset']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_aiReviewModeUi']['resetActiveStateInResults'](),this['_aiReviewModeUi']['hideChangeBalloon']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x1d4c48){_0x1d4c48 instanceof Error&&_0x1d4c48['message']['includes']('ai-request-aborted')||(_0x1d4c48 instanceof _0x36b126?this['_logError'](_0x1d4c48):this['_logError'](new _0x36b126('ai-review-mode-check-run-failed',this,{'error':_0x1d4c48})));}}else this['_logError'](new _0x36b126('ai-review-mode-source-check-not-found',this,{'checkId':_0x133e35['id']}));}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewMode',()=>{this['_onReviewModeRunLeave']();}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewModeResultList',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewModeUi'],'finishReview',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x4f5c6b=this['_currentReviewCheckRun']['getActiveChanges']();_0x4f5c6b['length']&&(this['_aiReviewModeEditing']['applyChange'](_0x4f5c6b['map'](_0xc9f9ff=>_0xc9f9ff['id'])),this['_currentReviewCheckRun']['markAllChangesAsAccepted'](),this['_currentReviewCheckRun']['sendRating']());}),this['listenTo'](this['_aiReviewModeUi'],'acceptChange',(_0x18c836,_0x4c293b)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x4c293b['id'])&&(this['_aiReviewModeEditing']['applyChange']([_0x4c293b['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x4c293b['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x4c293b['id']));}),this['listenTo'](this['_aiReviewModeUi'],'dismissChange',(_0xc680df,_0x27b908)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x27b908['id'])&&(this['_aiReviewModeEditing']['rejectChange'](_0x27b908['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x27b908['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x27b908['id']));}),this['listenTo'](this['_aiReviewModeUi'],'toggleDiff',(_0x5e7e39,_0x3ac574)=>{this['_isDiffOn']=_0x3ac574['on'],this['_onDiffChange'](this['_isDiffOn']);}),this['listenTo'](this['_aiReviewModeUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&(this['_aiReviewModeEditing']['clearAllMarkers'](),this['_currentReviewCheckRun']['updateDocumentData'](this['_aiReviewModeEditing']['getDocumentData']()),await this['_currentReviewCheckRun']['restart']());}),this['listenTo'](this['_aiReviewModeUi'],'activateChange',(_0x5097f6,_0xbd2604)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0xbd2604['id']));}),this['listenTo'](this['_aiReviewModeUi'],'deactivateChange',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['deactivateChange']();}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerClick',(_0x56a0f0,_0x1e50aa)=>{if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x1e50aa['changeId']);const _0x4aca94=this['_currentReviewCheckRun']['getChangeById'](_0x1e50aa['changeId']);if(!_0x4aca94)return;const _0x103ffa=this['_aiReviewModeEditing']['getEditor']();this['_aiReviewModeUi']['showChangeBalloon'](_0x4aca94,_0x1e50aa['markerElement'],_0x1e50aa['domEvent'],'click',_0x103ffa?.['editing']?.['view']?.['getDomRoot'](),_0x103ffa?.['ui']?.['viewportOffset']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerHovered',(_0x474193,_0x4bd229)=>{if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x5c364a=this['_currentReviewCheckRun']['getChangeById'](_0x4bd229['changeId']);if(!_0x5c364a)return;const _0x52e1d9=this['_aiReviewModeEditing']['getEditor']();this['_aiReviewModeUi']['showChangeBalloon'](_0x5c364a,_0x4bd229['markerElement'],_0x4bd229['domEvent'],'hover',_0x52e1d9?.['editing']?.['view']?.['getDomRoot'](),_0x52e1d9?.['ui']?.['viewportOffset']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerBlurred',()=>{if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewModeUi']['hideChangeBalloon']();}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRemoved',(_0x531251,_0x3b8d3e)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x3b8d3e['changeId']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRestored',(_0x58d6a8,_0x15ec5f)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x15ec5f['changeId']);});}['_onReviewModeRunLeave'](_0x1e298e=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x1e298e&&this['_aiReviewModeUi']['showReviewCheckList'](),this['_aiReviewModeEditing']['clearAllMarkers'](),this['_aiReviewModeEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x9cb39d=this['_aiReviewModeEditing']['getEditor']();_0x9cb39d&&_0x9cb39d['editing']['view']['change'](_0x1a08eb=>{const _0x18b514=_0x9cb39d['editing']['view']['document']['getRoot']();_0x1a08eb['removeClass']('ck-ai-review-mode-diff',_0x18b514),_0x1a08eb['removeClass']('ck-ai-review-mode-highlights',_0x18b514);});}['_onDiffChange'](_0x31786b){const _0xbfc552=this['_aiReviewModeEditing']['getEditor']();_0x31786b?this['_aiReviewModeUi']['hideDiffInBalloon']():this['_aiReviewModeUi']['showDiffInBalloon'](),_0xbfc552&&_0xbfc552['editing']['view']['change'](_0x2ec932=>{const _0x20bdad=_0xbfc552['editing']['view']['document']['getRoot']();_0x2ec932['removeClass']('ck-ai-review-mode-diff',_0x20bdad),_0x2ec932['removeClass']('ck-ai-review-mode-highlights',_0x20bdad),_0x2ec932['addClass'](_0x31786b?'ck-ai-review-mode-diff':'ck-ai-review-mode-highlights',_0x20bdad);});}['_translateReviewChecks'](_0x37c695){return _0x37c695['map'](_0x540d6f=>{const _0x543cb5='AI_REVIEW_CHECK_'+_0x540d6f['id']['toUpperCase']()['replaceAll']('-','_'),_0x525c61={..._0x540d6f,'title':this['_getTranslationWithDefault'](_0x543cb5+'_TITLE',_0x540d6f['title']),'description':this['_getTranslationWithDefault'](_0x543cb5+'_DESCRIPTION',_0x540d6f['description'])};return _0x540d6f['options']&&(_0x525c61['options']=_0x540d6f['options']['map'](_0x508f73=>({..._0x508f73,'label':this['_getTranslationWithDefault'](_0x543cb5+'_OPTIONS_LABEL',_0x508f73['label']||''),'data':_0x508f73['data']?_0x508f73['data']['map'](_0x1dc36c=>({..._0x1dc36c,'label':this['_getTranslationWithDefault'](_0x543cb5+'_OPTIONS_DATA_'+_0x1dc36c['id']['toUpperCase'](),_0x1dc36c['label'])})):void 0x0}))),_0x525c61;});}['_getTranslationWithDefault'](_0x1eb7af,_0x1d80be){const _0x466ae7=i(this['context']['locale'],_0x1eb7af);return _0x466ae7===_0x1eb7af?_0x1d80be:_0x466ae7;}['_logError'](_0x3e6b50){ft(_0x3e6b50['message']),_0x3e6b50['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewModeUi']['showGeneralReviewModeErrorView']():this['_aiReviewModeUi']['showGeneralResultsErrorView']();}}class Mr extends _0x43effc{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x2c5dde,_0x13358b){super(_0x2c5dde),this['_defaultValue']=_0x13358b['default']||(_0x13358b['data']['length']>0x0?_0x13358b['data'][0x0]['id']:''),this['_defaultLabel']=_0x13358b['data']['find'](_0xa7eb4=>_0xa7eb4['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x2e287a(this['locale']);const _0x27f5cb=this['_prepareListOptions'](_0x13358b['data']);_0x44b9be(this['_dropdownView'],_0x27f5cb,{'role':'menu','ariaLabel':_0x13358b['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x4eaaad=>{_0x4eaaad['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x5513ce=>{this['formValue']=_0x5513ce['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x5513ce['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review-mode__check-list-item-parameterized-form-element','ck-ai-review-mode__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x17bf4d=[]){const _0x27de80=new _0x5137f7();this['resetToDefault']();for(const _0x542f46 of _0x17bf4d){const _0x11bb7b=new _0x3344bf({'label':_0x542f46['label'],'withText':!0x0,'role':'menuitemradio','id':_0x542f46['id'],'model':_0x542f46});_0x11bb7b['bind']('isOn')['to'](this,'formValue',_0x5bed80=>_0x5bed80===_0x11bb7b['id']);const _0x9227ea={'type':'button','model':_0x11bb7b};_0x27de80['add'](_0x9227ea);}return _0x27de80;}}class ic extends _0x3f0116{['_formItem']=null;constructor(_0x1a3fb9,_0x56cb7f,_0x455045){super(_0x1a3fb9),this['argsKey']=_0x56cb7f?.['argsKey'];if('dropdown'===_0x56cb7f['formType'])this['_formItem']=new Mr(this['locale'],_0x56cb7f);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x305e3b=new _0x2eaca7(this['locale'],{'children':[this['_formItem']],'class':[_0x455045?'ck-form__row_with-submit':'']});_0x455045&&_0x305e3b['children']['add'](_0x455045),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__form-item','ck-reset_all']},'children':[_0x305e3b]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class Qs extends _0x19a367{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x312a61){super(_0x312a61),this['set']('isEmpty',!0x0),this['keystrokes']=new _0xfe6d51(),this['minRows']=Qs['MIN_ROWS'],this['maxRows']=Qs['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-mode-prompt-input','class':['ck','ck-review-mode__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class tc extends _0x43effc{['focusTracker']=new _0x25d272();['keystrokes']=new _0xfe6d51();['focusCycler'];['_focusables']=new _0x317ee8();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x4dd540,_0x4520e3){super(_0x4dd540),this['_check']=_0x4520e3,this['set']('prompt',''),this['set']('modelId',''),this['_defaultValue']=_0x4520e3['models']&&_0x4520e3['models']['length']>0x0?_0x4520e3['models'][0x0]['id']:'',this['_defaultLabel']=_0x4520e3['models']&&_0x4520e3['models']['length']>0x0?_0x4520e3['models'][0x0]['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x454e15(this['locale'],()=>new Qs(_0x4dd540)),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 _0x5137f7(),this['_setModelList'](),_0x44b9be(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions']},'children':[new _0x2eaca7(this['locale'],{'children':[this['promptInputView']]}),new _0x2eaca7(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x3a4a98,_0x5818ff)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x5818ff()):_0x5818ff();}),this['focusCycler']=new _0x4b849d({'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'](_0x4eface=>{this['_focusables']['add'](_0x4eface),this['focusTracker']['add'](_0x4eface['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 _0x528769 of this['_getFormValidators']()){const _0x207906=_0x528769();if(_0x207906)return this['promptInputView']['errorText']=_0x207906,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return i(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x212302=new _0xcbb426(this['locale']),t=this['locale']['t'];return _0x212302['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x212302['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x212302;}['_createCancelButtonView'](){const _0x46c4b0=new _0xcbb426(this['locale']),t=this['locale']['t'];return _0x46c4b0['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled'}),_0x46c4b0['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x13f0d8=>{_0x13f0d8['stopPropagation']();})}}),_0x46c4b0['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x46c4b0;}['_setModelList'](){this['_modelSelectionDropdownItems']['clear']();const _0x354e4f=this['_check']['models'];if(this['resetToDefault'](),_0x354e4f?.['length'])for(const _0x1260d6 of _0x354e4f){const _0x2a7368=new _0x3344bf({'label':_0x1260d6['name'],'withText':!0x0,'role':'menuitemradio','id':_0x1260d6['id'],'model':_0x1260d6});_0x2a7368['bind']('isOn')['to'](this,'modelId',_0x335abd=>_0x335abd===_0x1260d6['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x2a7368,'labelView':new Us(this['locale'],_0x1260d6)});}}['_createModelSelectionDropdown'](){const _0x449979=_0x2e287a(this['locale']);return _0x449979['set']({'panelPosition':'se','class':'ck-ai-review-mode__check-list-item-model-dropdown'}),_0x449979['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),this['listenTo'](_0x449979,'execute',_0x1c72dd=>{this['modelId']=_0x1c72dd['source']['model']['id'],_0x449979['buttonView']['label']=_0x1c72dd['source']['label'];}),_0x449979;}['_createActionsFooterView'](){const _0x4b6c7c=new _0x43effc(this['locale']);return _0x4b6c7c['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0x4b6c7c;}}class Us extends _0x43f368{constructor(_0x2d1a0f,_0x2a17d3){super();const _0x107e21=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x107e21['to']('style'),'id':_0x107e21['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x107e21['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x2a17d3['description']||'']}]}]});}}class Xs extends _0x3f0116{['_formItemsCollection']=new _0x317ee8();['_customCheckView']=null;constructor(_0x4dc76a,_0x4c5ff1,_0xf352df){super(_0x4dc76a),this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x4c5ff1['isParameterized']);const _0x237443=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai-review-mode__check-list-item_selected',_0x19acdf=>_0x19acdf),this['bindTemplate']['if']('isListItemRendered','ck-ai-review-mode__check-list-item_rendered',_0x683e6f=>_0x683e6f)],'style':{'--ck-ai-review-check-list-item-index':_0xf352df}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-list-item-title-text']},'children':[{'text':_0x4c5ff1['title']}]},_0x237443]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-description']},'children':[{'text':_0x4c5ff1['description']}]}]}]},..._0x4c5ff1['isParameterized']?[this['_createParameterizedView'](_0x4c5ff1)]:[],...'custom'===_0x4c5ff1['id']?[this['_createCustomView'](_0x4c5ff1)]:[]]}),this['on']('click',()=>{_0x4c5ff1['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x4c5ff1['id']});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x4b855c({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x18f7c7=>{_0x18f7c7['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x59fbb7=new _0x4caa0b();return _0x59fbb7['content']=_0x37e1aa,_0x59fbb7['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-title-icon']}}),_0x59fbb7;}['_createParameterizedView'](_0xa33280){const _0x42fbd0=new _0x43effc(),_0x3881d0=this['_createFormView'](_0xa33280);return _0x42fbd0['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x497cfc=>!_0x497cfc)]},'children':[_0x3881d0]}),_0x42fbd0;}['_createFormView'](_0x4a8084){const _0x56b116=new _0x43effc(),_0x970de6=Array['isArray'](_0x4a8084['options'])?_0x4a8084['options']:[],_0x3853bc=new _0xcbb426(this['locale']),t=this['locale']['t'];_0x3853bc['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x3853bc['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x35c019=>{_0x35c019['stopPropagation']();})}}),_0x3853bc['on']('execute',()=>{const _0x5bf0ad=[],_0x7d3a49={};this['_formItemsCollection']['forEach'](_0x148fb3=>{_0x5bf0ad['push'](_0x148fb3['value']),_0x4a8084['useArgs']&&_0x4a8084['options']&&(_0x7d3a49[_0x148fb3['argsKey']]=_0x148fb3['value']);}),this['fire']('runReviewCheck',{'id':_0x4a8084['id'],'params':_0x5bf0ad['length']?_0x5bf0ad:void 0x0,'args':Object['keys'](_0x7d3a49)['length']?_0x7d3a49:void 0x0});});const _0x29ec59=_0x970de6['length'];return _0x970de6['forEach']((_0x115ee3,_0x498388)=>{const _0x2ef590=_0x498388===_0x29ec59-0x1;this['_formItemsCollection']['add'](new ic(this['locale'],_0x115ee3,_0x2ef590?_0x3853bc:null));}),_0x56b116['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x56b116;}['_createCustomView'](_0x551bd5){return this['_customCheckView']=new tc(this['locale'],_0x551bd5),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized','ck-ai-review-mode__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x56052e=>!_0x56052e)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x3e62e8,_0x956496,_0x406d30)=>{_0x406d30||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class ih extends _0x3f0116{['_checkViews'];constructor(_0x1e1bf7){super(_0x1e1bf7),this['_checkViews']=new _0x317ee8();const _0x405ef8=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list',_0x405ef8['if']('isVisible','ck-hidden',_0x14ddd3=>!_0x14ddd3)]},'children':this['_checkViews']});}['setChecks'](_0x5e31e6){this['_checkViews']['clear']();for(const [_0xeaddf8,_0x2692b3]of _0x5e31e6['entries']()){const _0x520716=new Xs(this['locale'],_0x2692b3,_0xeaddf8);_0x520716['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x520716);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x1dd1b8 of this['_checkViews'])_0x1dd1b8 instanceof Xs&&_0x1dd1b8['resetToDefault']();}}class Ps extends _0x43effc{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x1b898a,_0x26f7f5){super(_0x1b898a),this['id']=_0x26f7f5,this['set']('status','pending'),this['set']('changeId',_0x26f7f5),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-mode__check-run-result',this['bindTemplate']['if']('isActive','ck-ai-review-mode__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView'],this['outdatedButtonView']]},this['infoButtonView']]}]}),this['on']('click',()=>{this['fire']('activateChange',{'id':_0x26f7f5,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x3f1c32=new _0x43effc(this['locale']);return _0x3f1c32['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-content-direct-excluded','ck-ai-review-mode__check-run-result-response',this['bindTemplate']['if']('showDiff','ck-hidden',_0x52d5a2=>!_0x52d5a2)]}}),_0x3f1c32;}['_createAcceptButtonView'](){const _0x453335=new _0xcbb426(this['locale']);return _0x453335['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x453335['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x3dd853=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x3dd853['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x5a391e=>'pending'!==_0x5a391e&&'accepted'!==_0x5a391e),this['bindTemplate']['if']('status','ck-ai-review-mode__check-run-result-accept-button',_0x10cfab=>'pending'===_0x10cfab),this['bindTemplate']['if']('status','ck-ai-review-mode__check-run-result-status-button',_0x9fe3c8=>'accepted'===_0x9fe3c8)]}}),this['on']('change:status',(_0x2a85f5,_0x35e370,_0x4c6d95)=>{_0x453335['isEnabled']=!0x1,'accepted'===_0x4c6d95&&(_0x453335['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x453335['icon']=_0x3cb840);}),_0x453335;}['_createDismissButtonView'](){const _0xa52285=new _0xcbb426(this['locale']);return _0xa52285['set']({'label':i(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0xa52285['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x47b890=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x47b890['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary-filled',this['bindTemplate']['if']('status','ck-hidden',_0x122a92=>'pending'!==_0x122a92&&'rejected'!==_0x122a92),this['bindTemplate']['if']('status','ck-ai-review-mode__check-run-result-dismiss-button',_0x3d6259=>'pending'===_0x3d6259),this['bindTemplate']['if']('status','ck-ai-review-mode__check-run-result-status-button',_0x4531ac=>'rejected'===_0x4531ac)]}}),this['on']('change:status',(_0x1a8ed9,_0x4150af,_0x2ca738)=>{_0xa52285['isEnabled']=!0x1,'rejected'===_0x2ca738&&(_0xa52285['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0xa52285['icon']=_0x3a96a0);}),_0xa52285;}['_createInfoButtonView'](){const _0x1fe4b2=new _0xcbb426(this['locale']);return _0x1fe4b2['set']({'label':i(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x314620,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-info-button\x20ck-hidden'}),_0x1fe4b2['bind']('isOn')['to'](this,'isInfoToggleOn',_0x3deada=>_0x3deada),_0x1fe4b2['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x1fe4b2;}['_createOutdatedButtonView'](){const _0xd6cc44=new _0xcbb426(this['locale']);return _0xd6cc44['set']({'label':i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':_0x2f860e,'withText':!0x0,'isEnabled':!0x1}),_0xd6cc44['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0xe38543=>'outdated'!==_0xe38543)],'disabled':'disabled'}}),_0xd6cc44;}}class gr extends _0xcbb426{constructor(_0x5694f9){super(_0x5694f9),this['set']({'label':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class eh extends _0x3f0116{['_resultViews'];['resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];constructor(_0x4c00be){super(_0x4c00be),this['_resultViews']=new _0x317ee8(),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_acceptAllButtonView']=this['_createAcceptAllButtonView'](),this['_exitReviewButtonView']=this['_createExitReviewButtonView'](),this['_toggleDiffButtonView']=this['_createToggleDiffButtonView'](),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['resultsHeader']=this['_createResultHeaderView'](),this['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new bi(_0x4c00be),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 _0x2fb61c=this['_createCombinedSkeletonLoader'](),_0x406d89=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run',_0x406d89['if']('isVisible','ck-hidden',_0x378cf6=>!_0x378cf6)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0xef900e=>_0xef900e)]},'children':this['_resultViews']},_0x2fb61c]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x33f242){const _0x1c56c3=new Ps(this['locale'],_0x33f242['id']);_0x1c56c3['delegate']('acceptChange','dismissChange','activateChange')['to'](this),this['_resultViews']['add'](_0x1c56c3),_0x1c56c3['resultResponseView']['element']['innerHTML']=_0x33f242['contentDiffed'];}['hideResult'](_0x1c08ca,_0x55c15e){if('pending'===_0x55c15e)return;const _0x36b5aa=this['_resultViews']['find'](_0x27e433=>_0x27e433['id']===_0x1c08ca);_0x36b5aa&&(_0x36b5aa['status']=_0x55c15e,_0x36b5aa['element']?.['classList']['add']('ck-ai-review-mode__check-run-result_grayout'));}['showResult'](_0x224c72,_0x5b4a4e){if('pending'!==_0x5b4a4e)return;const _0x2c09d8=this['_resultViews']['find'](_0x4092be=>_0x4092be['id']===_0x224c72);_0x2c09d8&&(_0x2c09d8['status']=_0x5b4a4e,_0x2c09d8['element']?.['classList']['remove']('ck-ai-review-mode__check-run-result_grayout'));}['setTitle'](_0x3684f6,_0x19464e){this['headerTitle']=_0x3684f6,this['headerSubtitle']=_0x19464e||'';}['showChunkErrorMessage'](){this['errorType']='chunk',this['showErrorMessage']=!0x0;}['showGeneralErrorMessage'](){this['isError']=!0x0,this['errorType']='general',this['showErrorMessage']=!0x0;}['resetErrorState'](){this['isError']=!0x1,this['errorType']='general',this['showErrorMessage']=!0x1;}['_createSkeletonLoader'](){return new Pe(this['locale'],Be['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0xae4c0b=new _0x43effc(this['locale']),_0x4e2ed5=[];for(let _0x5963dc=0x0;_0x5963dc<0x10;_0x5963dc++){const _0x3ad4fa=this['_createSkeletonLoader']();_0x3ad4fa['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-run-skeleton-item']}}),_0x4e2ed5['push'](_0x3ad4fa);}return _0xae4c0b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x8c41a5=>!_0x8c41a5)]},'children':_0x4e2ed5}),_0xae4c0b;}['_createErrorView'](){const _0xc3763c=new _0x43effc(this['locale']),_0x1036db=new _0xcbb426(this['locale']),t=this['locale']['t'];return _0xc3763c['delegate']('retryReview')['to'](this),_0x1036db['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-error-retry-button'}),_0x1036db['on']('execute',()=>{this['fire']('retryReview');}),_0xc3763c['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x1d0671=>!_0x1d0671),this['bindTemplate']['if']('errorType','ck-ai-review-mode__check-run-error-container_border-bottom',_0x5cc0c3=>'chunk'===_0x5cc0c3)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error','ck-ai-notification__full-width','ck-ai-review-mode__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-notification_warning',_0x396622=>'chunk'===_0x396622)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x2e9059=>'general'!==_0x2e9059)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x53fa4b=>'chunk'!==_0x53fa4b)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x1036db]}),_0xc3763c;}['_createCancelButtonView'](){const _0x26d728=new _0xcbb426(this['locale']);return _0x26d728['set']({'label':i(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x171167}),_0x26d728['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x2da039=>_0x2da039),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5a5e92=>_0x5a5e92)]}}),_0x26d728['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x26d728;}['_createToggleDiffButtonView'](){const _0x3882da=new _0xcbb426(this['locale']);_0x3882da['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x3882da['bind']('isEnabled')['to'](this,'isError',_0x4d2f38=>!_0x4d2f38),_0x3882da['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x183ece=>!_0x183ece),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2a31e2=>_0x2a31e2)]}});const _0x218e34=i(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x573110=i(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x3882da['bind']('isOn')['to'](this,'isToggleDiffOn',_0xcb51fd=>_0xcb51fd),_0x3882da['bind']('icon')['to'](this,'isToggleDiffOn',_0xedc355=>_0xedc355?_0x3db73e:_0x2bc066),_0x3882da['bind']('label')['to'](this,'isToggleDiffOn',_0x4d3c66=>_0x4d3c66?_0x218e34:_0x573110),_0x3882da['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x3882da;}['_createAcceptAllButtonView'](){const _0x2a2c1=new _0xcbb426(this['locale']);return _0x2a2c1['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x2a2c1['bind']('isEnabled')['to'](this,'isError',_0x2d2721=>!_0x2d2721),_0x2a2c1['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai-review-mode__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x28cc8a=>!_0x28cc8a),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1ae3dd=>_0x1ae3dd)]}}),_0x2a2c1['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x2a2c1;}['_createExitReviewButtonView'](){const _0x4846f0=new _0xcbb426(this['locale']);return _0x4846f0['set']({'label':i(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x4846f0['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x201c3f=>!_0x201c3f),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1672ac=>_0x1672ac)]}}),_0x4846f0['on']('execute',()=>{this['fire']('leaveReviewModeResultList');}),_0x4846f0;}['_createResultHeaderView'](){const _0x802d9c=new _0x43effc(this['locale']),_0x3ff100=this['_createTitleView']();return _0x802d9c['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai-review-mode__review-completed-header',_0x1b6b6d=>_0x1b6b6d)]},'children':[_0x3ff100,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x802d9c;}['_createTitleView'](){const _0x32e9ff=new _0x43effc(this['locale']),_0x12aadb=new We();return _0x12aadb['bind']('isVisible')['to'](this,'isResultReady',_0x58fed3=>!_0x58fed3),_0x32e9ff['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-wrapper']},'children':[_0x12aadb,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3ba346=>_0x3ba346)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]},{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1813ed=>!_0x1813ed)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x32e9ff;}['_createFinishReviewButtonView'](){const _0x2d375c=new gr(this['locale']);return _0x2d375c['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x39a64f=>!_0x39a64f)]}}),_0x2d375c['delegate']('finishReview')['to'](this),_0x2d375c;}}class th extends _0x3f0116{['resultsHeader'];['_finishReviewButtonView'];constructor(_0x46893e){super(_0x46893e),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['resultsHeader']=this['_createResultHeaderView']();const _0x362d61=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed',_0x362d61['if']('isVisible','ck-hidden',_0x4e7ed4=>!_0x4e7ed4)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai-review-mode__review-completed-content-text']},'children':[{'text':i(_0x46893e,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT')}]}]}]});}['_createFinishReviewButtonView'](){const _0x4e870a=new gr(this['locale']);return _0x4e870a['delegate']('finishReview')['to'](this),_0x4e870a;}['_createResultHeaderView'](){const _0x46fe7e=new _0x43effc(this['locale']);return _0x46fe7e['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-header-title']},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x46fe7e;}}class hh extends _0x43effc{constructor(_0x2655f1){super(_0x2655f1),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x2e0aea=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__general-error-container',_0x2e0aea['if']('isVisible','ck-hidden',_0x555c5a=>!_0x555c5a)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x2e0aea['to']('errorMessage')}]}]});}}class ve extends _0x43effc{['reviewModeHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x1b645d){super(_0x1b645d),this['reviewModeHeader']=new _0xbcda8a(_0x1b645d,{'label':i(_0x1b645d,'AI_REVIEW_MODE'),'icon':_0x223d73,'class':'ck-ai-header\x20ck-ai-header_review-mode'}),this['generalErrorView']=new hh(_0x1b645d),this['reviewCheckListView']=new ih(_0x1b645d),this['reviewCheckListView']['delegate'](...sh)['to'](this),this['reviewCheckResultsView']=new eh(_0x1b645d),this['reviewCheckResultsView']['delegate'](...sh)['to'](this),this['reviewCompletedView']=new th(_0x1b645d),this['reviewCompletedView']['delegate']('finishReview')['to'](this),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isLoading',!0x1),this['reviewCheckResultsView']['set']('isResultReady',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review-mode','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewModeHeader'],this['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'](_0x4b68c0){this['reviewCheckResultsView']['addResult'](_0x4b68c0),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;}['showGeneralReviewModeErrorView'](_0x5a4b60){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x5a4b60;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class Ie extends _0x2ae23a{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x5c67c3,_0x2a4a35){super(_0x5c67c3),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']()),_0x2a4a35['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x26e2fc){this['resultItemView']['changeId']=_0x26e2fc['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x26e2fc['contentDiffed'];}['showBalloon'](_0x5d347c,_0x70728,_0x27960e,_0x598c70,_0xb6e6c8,_0x2ffadc){this['_removeActiveClassFromMarkers'](),this['updateContent'](_0x5d347c),this['show']();const _0x338875=Array['from'](_0x70728['getClientRects']())['reverse'](),_0x27b8cb=this['_getPointedRectIndexFromEvent'](_0x27960e,_0x338875);'click'===_0x598c70?(this['isDiffActive']=!0x0,this['_setActiveClassOnMarker'](_0x5d347c['id']),this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x70728,_0x27b8cb,_0x5d347c['id'],_0xb6e6c8,_0x2ffadc)})):'hover'===_0x598c70&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x70728,_0x27b8cb,_0x5d347c['id'])}));}['hideBalloon'](){this['hide'](),this['unpin'](),this['_removeActiveClassFromMarkers'](),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');}['_removeActiveClassFromMarkers'](){lt['document']['querySelectorAll']('.ck-ai-review-mode__change_active')['forEach'](_0xde020f=>{_0xde020f['classList']['remove']('ck-ai-review-mode__change_active');});}['_setActiveClassOnMarker'](_0x346e32){lt['document']['querySelectorAll']('span[data-marker-id*=\x22'+_0x346e32+'\x22]')['forEach'](_0x5cb96a=>{_0x5cb96a['classList']['add']('ck-ai-review-mode__change_active');});}['_setupClickOutsideHandler'](){_0x4b855c({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x434edd=[this['element']];return this['_pinnedTargetElement']&&_0x434edd['push'](this['_pinnedTargetElement']),_0x434edd;},'callback':()=>{this['hide'](),this['unpin'](),this['_removeActiveClassFromMarkers'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x483124=new _0x43effc();return this['resultItemView']=new Ps(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x483124['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai-review-mode-balloon-panel-suggestion',this['bindTemplate']['if']('isDiffActive','ck-ai-review-mode-balloon-panel-suggestion_diff-active')]},'children':[{'tag':'p','attributes':{'class':['ck-ai-review-mode__suggestion-text']},'children':[this['resultItemView']]}]}),_0x483124;}['_getBestRectPositionOnClick'](_0x5aa45d,_0x12e981,_0x581fef,_0x1909cc,_0x278bbb){const _0x5c78b0=this['position']['replace']('arrow_',''),_0x1d0a95=Array['from'](_0x5aa45d['getClientRects']());let _0x278c2e,_0xd9e91=_0x1d0a95['reverse']();return void 0x0!==_0x12e981&&this['_isPinnedRectVisible'](_0xd9e91[_0x12e981],_0x1909cc,_0x278bbb)?(_0x278c2e=_0xd9e91[_0x12e981],this['_pinnedRectIndex']=_0x12e981):this['_isPinnedRectVisible'](_0xd9e91[0x0],_0x1909cc,_0x278bbb)&&void 0x0===_0x12e981?_0x278c2e=_0xd9e91[0x0]:(_0xd9e91='s'==_0x5c78b0[0x0]?[..._0x1d0a95]['reverse']():_0x1d0a95,_0xd9e91['forEach'](_0x15e26c=>{this['_isPinnedRectVisible'](_0x15e26c,_0x1909cc,_0x278bbb)&&(_0x278c2e=_0x15e26c);})),this['_pinnedTargetChangeId']=_0x581fef,this['_pinnedTargetElement']=_0x5aa45d,_0x278c2e||_0x5aa45d['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x3b583e,_0x4b0b36,_0x35f8a5){const _0x458985=Array['from'](_0x3b583e['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x4b0b36&&this['_pinnedTargetChangeId']!==_0x35f8a5)return this['_pinnedRectIndex']=_0x4b0b36,this['_pinnedTargetElement']=_0x3b583e,this['_pinnedTargetChangeId']=_0x35f8a5,_0x458985[_0x4b0b36];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x35f8a5){if(_0x3b583e!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x458985[this['_pinnedRectIndex']];}return void 0x0!==_0x4b0b36&&this['_pinnedTargetChangeId']!==_0x35f8a5?(this['_pinnedRectIndex']=_0x4b0b36,this['_pinnedTargetElement']=_0x3b583e,this['_pinnedTargetChangeId']=_0x35f8a5,_0x458985[_0x4b0b36]):_0x3b583e['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x771285,_0x12c239){if(_0x771285)for(let _0x559769=0x0;_0x559769<_0x12c239['length'];_0x559769++){const _0x34b670=_0x12c239[_0x559769];if(_0x771285['clientX']>=_0x34b670['left']-0x3&&_0x771285['clientX']<=_0x34b670['right']+0x3&&_0x771285['clientY']>=_0x34b670['top']-0x3&&_0x771285['clientY']<=_0x34b670['bottom']+0x3)return _0x559769;}}['_isPinnedRectVisible'](_0x1ab6fd,_0x5b203a,_0x53520b){const _0x4e5234=new ct(_0x1ab6fd),_0x5a2eaf=_0x5b203a||document['documentElement'],_0x2cd1b2=_0x4e5234['getIntersection'](_0x114f82(_0x53520b)),_0x3098f8=new ct(_0x5a2eaf)['getIntersection'](_0x4e5234);return!!(_0x2cd1b2&&_0x3098f8&&_0x4e5234['width']>0x0);}}const sh=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewModeResultList','activateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class me extends ot{['_reviewModeView'];['_reviewModeBalloonSuggestionItemView'];['_bodyCollection'];static get['requires'](){return[Ct];}static get['pluginName'](){return'AIReviewModeUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x307efd){super(_0x307efd),this['_bodyCollection']=new _0x44dc72(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_reviewModeView']=new ve(this['context']['locale']),this['_reviewModeView']['delegate'](...sh)['to'](this),this['_reviewModeBalloonSuggestionItemView']=new Ie(this['context']['locale'],this['_bodyCollection']),this['_reviewModeBalloonSuggestionItemView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x3c66fd=this['context']['plugins']['get']('AITabs');_0x3c66fd['view']['on']('activateTab',(_0xaa578b,_0x3307a9)=>{'reviewMode'===_0x3307a9?this['fire']('getReviewCheckList'):this['fire']('leaveReviewMode');}),_0x3c66fd['view']['addTab']({'id':'reviewMode','buttonLabel':i(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x223d73,'order':0x0,'content':this['_reviewModeView']});}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x26a001){this['_reviewModeView']['reviewCheckListView']['hasChecks']()||this['_reviewModeView']['reviewCheckListView']['setChecks'](_0x26a001),this['_reviewModeView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x3b1e1a){_0x3b1e1a&&('error-general'!==_0x3b1e1a['status']?'error-chunk'!==_0x3b1e1a['status']?this['_reviewModeView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x150d66){this['_reviewModeView']['addCheckRunResult'](_0x150d66);}['showGeneralResultsErrorView'](){this['_reviewModeView']['showGeneralResultsErrorView']();}['showGeneralReviewModeErrorView'](_0x530d43){this['_reviewModeView']['showGeneralReviewModeErrorView'](_0x530d43??i(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_reviewModeView']['showChunkErrorView']();}['setCheckResultTitle'](_0x45066b,_0x2a4763){this['_reviewModeView']['reviewCheckResultsView']['setTitle'](_0x45066b,_0x2a4763);}['setActiveStateInResults'](_0x27e910){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x5737a3=>{_0x5737a3['id']===_0x27e910&&_0x5737a3['setItemAsActive']();});}['resetActiveStateInResults'](){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x57305d=>_0x57305d['setItemAsInactive']());}['updateChangeState'](_0x1189c7,_0x5305ff){'accepted'===_0x5305ff||'rejected'===_0x5305ff||'outdated'===_0x5305ff?this['_reviewModeView']['reviewCheckResultsView']['hideResult'](_0x1189c7,_0x5305ff):this['_reviewModeView']['reviewCheckResultsView']['showResult'](_0x1189c7,_0x5305ff);}['showReviewCompletedView'](){this['_reviewModeView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_reviewModeView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_reviewModeView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_reviewModeView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x45ba11,_0x4e1f85,_0x4b41cf,_0x4124ea,_0x102302,_0x5b3f54){this['_reviewModeBalloonSuggestionItemView']['showBalloon'](_0x45ba11,_0x4e1f85,_0x4b41cf,_0x4124ea,_0x102302,_0x5b3f54);}['hideChangeBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideBalloon']();}['hideDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['showDiffInBalloon']();}['getChangeElement'](_0x5c39ed){const _0x42ae89=this['_reviewModeView']['reviewCheckResultsView']['getResults']()['find'](_0x26fc63=>_0x26fc63['id']===_0x5c39ed);return _0x42ae89?_0x42ae89['element']:null;}['deactivateChange'](){this['_reviewModeBalloonSuggestionItemView']['deactivateChange']();}}const we='reviewmode-';class ce extends ot{static get['pluginName'](){return'AIReviewModeEditing';}static get['requires'](){return[_0x2dc9e7,R];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_domEmitter'];['_eventEmitter'];constructor(_0x5b1928){super(_0x5b1928),this['_domEmitter']=new(_0x5b5d27())(),this['_eventEmitter']=new(_0x19d98c())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x359727=ut(this['context']);_0x359727['conversion']['for']('editingDowncast')['markerToElement']({'model':we+'insert','view':(_0x29bca7,{writer:_0x564bdb})=>{const _0x58f281=this['_markers']['get'](_0x29bca7['markerName']),_0x1d0e47={'class':'ck-ai_review-mode-marker_add','data-marker-id':_0x29bca7['markerName']};return _0x564bdb['createUIElement']('span',_0x1d0e47,function(_0x519a6d){const _0x38941d=this['toDomElement'](_0x519a6d);return _0x38941d['innerHTML']=_0x58f281?.['text']||'',_0x38941d;});}}),_0x359727['conversion']['for']('editingDowncast')['markerToHighlight']({'model':we+'remove-only','view':_0x40583a=>({'classes':'ck-ai_review-mode-marker_strikethrough','attributes':{'data-marker-id':_0x40583a['markerName']}})}),_0x359727['conversion']['for']('editingDowncast')['markerToHighlight']({'model':we+'remove-context','view':_0x400274=>({'classes':'ck-ai_review-mode-marker_underline','attributes':{'data-marker-id':_0x400274['markerName']}})}),_0x359727['conversion']['for']('editingDowncast')['markerToHighlight']({'model':we+'remove-text','view':_0x125469=>({'classes':'ck-ai_review-mode-marker_hide','attributes':{'data-marker-id':_0x125469['markerName']}})}),_0x359727['conversion']['for']('dataDowncast')['markerToElement']({'model':we+'suggestion-context','view':(_0x1b7af1,{writer:_0x262253})=>_0x262253['createRawElement']('span',{'class':'ck-ai_review-mode-marker_context-'+(_0x1b7af1['isOpening']?'start':'end')})}),_0x359727['conversion']['for']('downcast')['attributeToAttribute']({'model':yt,'view':_0x29ff88}),this['_domEmitter']['listenTo'](document,'click',(_0x8a3dbe,_0x4c0045)=>{const _0x1e3e97=_0x4c0045['target'],_0x48f1f6=this['_findMarkerElement'](_0x1e3e97);if(!_0x48f1f6)return;const _0x5ef12=_0x48f1f6['getAttribute']('data-marker-id'),_0x176334=_0x5ef12['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClick',{'markerId':_0x5ef12,'changeId':_0x176334,'markerElement':_0x48f1f6,'domEvent':_0x4c0045});}),this['_domEmitter']['listenTo'](document,'mouseover',(_0x1f00dd,_0x132ba0)=>{const _0x67ea67=_0x132ba0['target'],_0x580e8d=_0x132ba0['relatedTarget'];let _0x3aa548=this['_findMarkerElement'](_0x67ea67);if(!_0x3aa548&&_0x580e8d&&(_0x3aa548=this['_findMarkerElement'](_0x580e8d)),!_0x3aa548)return;const _0x23bd0a=_0x3aa548['getAttribute']('data-marker-id'),_0xcd445c=_0x23bd0a['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0xcd445c,'markerElement':_0x3aa548,'domEvent':_0x132ba0});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x51d0da((_0x14e130,_0x14f75b)=>{const _0x3e8ff5=_0x14f75b['target'];if(this['_findMarkerElement'](_0x3e8ff5))return;_0x3e8ff5['closest']('.ck-reset.ck-ai-review-mode-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x359727['model']['document']['registerPostFixer'](_0x528f73=>this['_validateMarkers'](_0x359727,_0x528f73)),_0x359727['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x359727));}['getDocumentData'](){const _0x13348b=this['context']['plugins']['get']('AIEditing'),_0x34dfeb=ut(this['context']),_0x22e1dc=_0x34dfeb['model'],_0x21b144=new _0x490745();for(const _0x16fcca of _0x22e1dc['document']['getRoot']()['getChildren']()){const _0x20307d=_0x16fcca['_clone'](!0x0);_0x21b144['_appendChild'](_0x20307d);}for(const _0x7b4532 of _0x22e1dc['markers'])_0x21b144['markers']['set'](_0x7b4532['name'],this['_changeRangeOwnerDocument'](_0x7b4532['getRange']()['clone'](),_0x21b144));const _0x10c6e8=new _0x467163({'ignoreElementEnd':!0x0,'startPosition':_0x22e1dc['createPositionAt'](_0x21b144,0x0)}),_0x21bd1c=new Set(),_0x3d3c67=new Map();for(const {item:_0x2c36b7}of _0x10c6e8){if(!_0x2c36b7['is']('$textProxy'))continue;const _0x228198=_0x2c36b7['parent'];if(_0x228198&&_0x228198['is']('element')){const _0x27b5bb=this['_upsertDataId'](_0x228198,()=>_0x13348b['_nextDataId'](_0x21bd1c));_0x21bd1c['add'](_0x27b5bb);for(const _0x10a8e2 of _0x228198['getChildren']())_0x10a8e2['is']('element')&&_0x21bd1c['add'](this['_upsertDataId'](_0x10a8e2,()=>_0x13348b['_nextDataId'](_0x21bd1c)));let _0x35dc9f=_0x228198;for(;_0x35dc9f['parent']&&!_0x35dc9f['parent']['is']('documentFragment');)_0x35dc9f=_0x35dc9f['parent'],_0x35dc9f['hasAttribute'](yt)&&_0x35dc9f['_removeAttribute'](yt);_0x3d3c67['set'](_0x27b5bb,{'path':_0x228198['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x35dc9f['_clone'](!0x0),_0x27b5bb,_0x34dfeb['data'])}),_0x10c6e8['jumpTo'](_0x22e1dc['createPositionAfter'](_0x228198));}}return{'content':_0x34dfeb['data']['processor']['toData'](_0x34dfeb['data']['toView'](_0x21b144)),'version':_0x34dfeb['model']['document']['version'],'elements':_0x3d3c67};}['diffContent'](_0x11e8a4,_0x28bf28){const _0x51b30f=[],_0x28c8f1=ut(this['context']),_0x753dc5=_0x28c8f1['data']['parse'](_0x28bf28,'$documentFragment'),_0x326868=_0x28c8f1['data']['parse'](_0x11e8a4,'$documentFragment'),_0x597750=_0x28c8f1['model']['createPositionAt'](_0x326868,0x0);if(this['_haveSingleTopLevelElement'](_0x753dc5)){if(!this['_hasSameTopLevelElement'](_0x326868,_0x753dc5))return _0x51b30f;}else{const _0x2c7661=_0x28c8f1['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x326868,_0x2c7661)||!this['_haveOnlyInlineContent'](_0x753dc5,_0x2c7661))return _0x51b30f;}const _0x110c18=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x11e8a4,_0x28bf28,{'anchor':_0x597750,'markDeletions':!0x0})['getOperations']()['filter'](_0x404c9a=>'insert'===_0x404c9a['type']||'marker'===_0x404c9a['type']&&_0x404c9a['name']['startsWith']('$markedRemove')),_0x754928=this['_groupAdjacentOperations'](_0x110c18);let _0x4382d5=0x0;return _0x28c8f1['model']['change'](_0x172808=>{for(let _0x251085=0x0;_0x251085<_0x754928['length'];_0x251085++){const _0x371e6a=_0x754928[_0x251085],_0x124e56=_0x172808['createDocumentFragment']();for(const _0x4b8bf0 of _0x326868['getChildren']())_0x172808['append'](_0x4b8bf0['_clone'](!0x0),_0x124e56);for(const _0x130117 of _0x371e6a['operationsIsolated'])if('insert'===_0x130117['type']){const _0x325082=_0x130117;_0x325082['baseVersion']=null,_0x325082['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x325082,_0x124e56),_0x172808['batch']['addOperation'](_0x130117),_0x28c8f1['model']['applyOperation'](_0x130117);const _0xfb9933='suggestion:insertion:id:authorId:'+_0x4382d5++,_0x2e9a08=_0x28c8f1['model']['createRange'](_0x325082['position'],_0x325082['position']['getShiftedBy'](_0x325082['howMany']));_0x124e56['markers']['set'](_0xfb9933,_0x2e9a08);}else{if('marker'===_0x130117['type']&&_0x130117['name']['startsWith']('$markedRemove')){const _0x31b1e5=_0x130117,_0x5dee9a='suggestion:deletion:id:authorId:'+_0x4382d5++;this['_changeOperationOwnerDocument'](_0x31b1e5,_0x124e56),_0x124e56['markers']['set'](_0x5dee9a,_0x31b1e5['newRange']);}}const _0x2aa998=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x371e6a['operationsIsolated'][0x0]),_0x124e56),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x371e6a['operationsIsolated'][_0x371e6a['operationsIsolated']['length']-0x1]),_0x124e56));_0x124e56['markers']['set'](we+'suggestion-context',new _0x1026dd(_0x2aa998['start'],_0x2aa998['end'])),_0x51b30f['push']({..._0x371e6a,'context':this['_createGetContextFn'](_0x124e56,_0x28c8f1['data'],{'ellipsisBefore':_0x2aa998['hasContentBefore'],'ellipsisAfter':_0x2aa998['hasContentAfter']}),'content':this['_createGetContentFn'](_0x124e56,_0x28c8f1['data'])});}}),_0x51b30f;}['markChangePositionInEditorContent'](_0x4d88b8,_0x2885d3){if(!_0x4d88b8['length'])return;const _0x4d8565=_0x4d88b8[0x0]['parent']['id'],_0x2acf39=_0x2885d3['elements']['get'](_0x4d8565);if(!_0x2acf39)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x4d8565);const _0x533fe3=_0x2acf39['path'],_0x4a1e59=ut(this['context']),_0x31e300=_0x4a1e59['model']['document']['history']['getOperations'](_0x2885d3['version']),_0x3233d8=[];for(const _0x2c8fcc of _0x4d88b8){const _0xb1f95a=_0x2c8fcc['operationsIsolated']['map'](_0x55b64e=>this['_translateOperationToEditorContent'](_0x55b64e,_0x533fe3,_0x4a1e59['model']['document']['getRoots']()[0x0]));if(!_0xb1f95a||!_0xb1f95a['length'])continue;const _0x47a126=_0xb1f95a['every'](_0xe0ea57=>'marker'===_0xe0ea57['type']&&_0xe0ea57['name']['startsWith']('$markedRemove')),_0x4dad33={'document':_0x4a1e59['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x1a073e=st(_0xb1f95a,_0x31e300,_0x4dad33)['operationsA'];for(const _0x47a2de of _0x1a073e)if('insert'===_0x47a2de['type']){const _0x48c8b4=_0x47a2de,_0x2d1672=_0x48c8b4['nodes'];let _0x432d26='';for(const _0x3ab0bc of _0x2d1672)_0x3ab0bc&&_0x3ab0bc['is']('model:$text')&&(_0x432d26+=_0x3ab0bc['data']);_0x3233d8['push']({'start':_0x48c8b4['position'],'end':_0x48c8b4['position'],'type':'insert','groupId':_0x2c8fcc['id'],'text':_0x432d26});}else{if('marker'===_0x47a2de['type']&&_0x47a2de['name']['startsWith']('$markedRemove')){const _0x2abaef=_0x47a2de;let _0x158e14='remove-text';if(_0x47a126){const _0x5678ea=this['_findAdjacentContextDistance'](_0x2abaef['newRange']['start'],'backward',_0x4a1e59['model']['schema']),_0x85de1b=this['_findAdjacentContextDistance'](_0x2abaef['newRange']['end'],'forward',_0x4a1e59['model']['schema']);if(_0x5678ea||_0x85de1b){const _0x5e6209=_0x2abaef['newRange']['start']['getShiftedBy'](-_0x5678ea),_0x55c92e=_0x2abaef['newRange']['end']['getShiftedBy'](_0x85de1b);_0x3233d8['push']({'start':_0x5e6209,'end':_0x55c92e,'groupId':_0x2c8fcc['id'],'type':'remove-context'});}else _0x158e14='remove-only';}_0x3233d8['push']({'start':_0x2abaef['newRange']['start'],'end':_0x2abaef['newRange']['end'],'groupId':_0x2c8fcc['id'],'type':_0x158e14});}}}this['_insertMarkers'](_0x3233d8);}['clearAllMarkers'](){const _0x949fab=ut(this['context']);_0x949fab['model']['change'](_0x10b36d=>{for(const _0x15c98d of this['_markers']['keys']())_0x949fab['model']['markers']['get'](_0x15c98d)&&_0x10b36d['removeMarker'](_0x15c98d);}),this['_markers']['clear']();}['switchToReadOnly'](){ut(this['context'])['enableReadOnlyMode']('ai-review-mode');}['switchToEdit'](){ut(this['context'])['disableReadOnlyMode']('ai-review-mode');}['applyChange'](_0x37651f){const _0x121548=ut(this['context']),_0x433454=_0x121548['model'],_0x47e75e=_0x37651f['map'](_0x6ddf35=>this['_getMarkersDataForGroup'](_0x6ddf35))['flat']();_0x433454['change'](_0x934b10=>{for(const _0x31ffc4 of _0x47e75e){const _0x5e5f60=_0x121548['model']['markers']['get'](_0x31ffc4['id']);_0x5e5f60&&('insert'===_0x31ffc4['type']?_0x433454['insertContent'](_0x934b10['createText'](_0x31ffc4['text']||''),_0x5e5f60['getRange']()['start']):'remove-text'!==_0x31ffc4['type']&&'remove-only'!==_0x31ffc4['type']||_0x433454['deleteContent'](_0x433454['createSelection'](_0x5e5f60['getRange']())),_0x934b10['removeMarker'](_0x31ffc4['id']),this['_markers']['delete'](_0x31ffc4['id']));}});}['rejectChange'](_0x15c2b3){const _0x101b7c=ut(this['context']),_0x5605c3=this['_getMarkersDataForGroup'](_0x15c2b3);_0x101b7c['model']['change'](_0x1c2931=>{for(const _0x4116b6 of _0x5605c3)_0x1c2931['removeMarker'](_0x4116b6['id']),this['_markers']['delete'](_0x4116b6['id']);});}['getEditor'](){return ut(this['context']);}['getMarkerElementForChange'](_0x1a61f3){const _0x471311=Array['from'](this['_markers']['values']())['filter'](_0x482732=>_0x482732['groupId']===_0x1a61f3);if(!_0x471311['length'])return null;const _0x310cdf=0x1===_0x471311['length']?_0x471311[0x0]:this['_sortMarkers'](_0x471311)[0x0],_0x492782=ut(this['context']),_0x3e55a3=_0x492782['model']['markers']['get'](_0x310cdf['id']);if(!_0x3e55a3)return null;const _0x28cade=_0x3e55a3['getRange'](),_0x4c76e5=_0x492782['editing']['view']['getDomRoot']();if(!_0x4c76e5||!_0x28cade)return null;const _0x2fc4be=_0x4c76e5['querySelector']('[data-marker-id=\x22'+_0x310cdf['id']+'\x22]');return _0x2fc4be?{'modelRange':_0x28cade,'domElement':_0x2fc4be}:null;}['_validateMarkers'](_0x4022cf,_0xce90d7){const _0xa3458c=Array['from'](this['_markers']['keys']()),_0x488600=new Map();for(const _0x5ed30d of _0xa3458c){const _0x1723b3=_0x4022cf['model']['markers']['get'](_0x5ed30d);if(!_0x1723b3)continue;const _0x5ae3c8=_0x1723b3['getStart']()['path'][0x0];_0x488600['has'](_0x5ae3c8)||_0x488600['set'](_0x5ae3c8,[]),_0x488600['get'](_0x5ae3c8)['push'](_0x1723b3);}const _0x3fd63a=new Set();for(const _0x9c900c of _0x4022cf['model']['document']['differ']['getChanges']()){let _0x581e80=-0x1,_0xda8f5b=null;if('insert'===_0x9c900c['type'])_0xda8f5b=new _0x1026dd(_0x9c900c['position'],_0x9c900c['position']['getShiftedBy'](_0x9c900c['length'])),_0x581e80=_0x9c900c['position']['path'][0x0];else{if('remove'!==_0x9c900c['type'])continue;_0xda8f5b=new _0x1026dd(_0x9c900c['position']),_0x581e80=_0x9c900c['position']['path'][0x0];}const _0x56e118=_0x488600['get'](_0x581e80)||[];if(_0x56e118['length']){for(const _0x3ba64f of _0x56e118)if(_0xda8f5b['root']['rootName']===_0x3ba64f['getRange']()['root']['rootName']&&('insert'!==_0x9c900c['type']||!_0xda8f5b['containsRange'](_0x3ba64f['getRange']()))&&(_0xda8f5b['isIntersecting'](_0x3ba64f['getRange']())||_0xda8f5b['start']['isTouching'](_0x3ba64f['getRange']()['end'])||_0xda8f5b['end']['isTouching'](_0x3ba64f['getRange']()['start']))){const _0x3bebc8=this['_parseMarkerName'](_0x3ba64f['name']);Array['from'](this['_markers']['values']())['filter'](_0x393be7=>_0x393be7['groupId']===_0x3bebc8['groupId'])['forEach'](_0x23267e=>_0x3fd63a['add'](_0x23267e['id']));}}}if(_0x3fd63a['size']){for(const _0x2c3534 of _0x3fd63a)_0xce90d7['removeMarker'](_0x2c3534);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x33db45){for(const {name:_0x3595b8,data:_0x4aab0a}of _0x33db45['model']['document']['differ']['getChangedMarkers']()){if(!_0x3595b8['startsWith'](we))continue;const _0x14274e=_0x4aab0a['oldRange'],_0x214680=_0x4aab0a['newRange'],_0x2030af=_0x14274e&&'$graveyard'===_0x14274e['root']['rootName'],_0x3f8143=_0x214680&&'$graveyard'===_0x214680['root']['rootName'];if(_0x2030af&&_0x3f8143)continue;const _0x82e553=this['_parseMarkerName'](_0x3595b8);this['_markers']['get'](_0x3595b8)&&(_0x3f8143||!_0x214680?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x3595b8,'changeId':_0x82e553['groupId']}):_0x2030af&&_0x214680&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x3595b8,'changeId':_0x82e553['groupId']}));}}['_parseMarkerName'](_0x421929){const _0x50c492=_0x421929['split'](':'),_0x3311ae=(_0x50c492[0x1]||'')['split']('_');return{'prefix':_0x50c492[0x0],'groupId':_0x3311ae[0x0],'suffix':_0x3311ae[0x1]};}['_translateOperationToEditorContent'](_0x2d3820,_0x2737b2,_0x233b4d){if('insert'===_0x2d3820['type']){const _0x3e2c05=_0x2d3820;return new _0x55f538(this['_changePosition'](_0x2737b2['concat'](_0x3e2c05['position']['offset']),_0x233b4d),_0x3e2c05['nodes'],_0x3e2c05['baseVersion']);}if('marker'===_0x2d3820['type']&&_0x2d3820['name']['startsWith']('$markedRemove')){const _0x284f27=_0x2d3820;return new _0x22c2d1(_0x284f27['name'],_0x284f27['oldRange'],this['_changeRange'](_0x284f27['newRange'],_0x2737b2['concat'](_0x284f27['newRange']['start']['offset']),_0x2737b2['concat'](_0x284f27['newRange']['end']['offset']),_0x233b4d),_0x284f27['_markers'],_0x284f27['affectsData'],_0x284f27['baseVersion']);}return _0x2d3820;}['_groupAdjacentOperations'](_0xb135f2){if(!_0xb135f2['length'])return[];const _0x4cca16=[];let _0x1b80be=0x0,_0x1c36be=0x0,_0x42a57a=[];for(let _0x59d997=0x0;_0x59d997<=_0xb135f2['length'];_0x59d997++){const _0x3a54c9=_0xb135f2[_0x59d997],_0x511877=_0xb135f2[_0x59d997-0x1];!_0x3a54c9||_0x511877&&!this['_getOperationEnd'](_0x511877)['isTouching'](this['_getOperationStart'](_0x3a54c9))?(_0x4cca16['push']({'operations':_0x42a57a,'operationsIsolated':_0x42a57a['map'](_0x4ba93d=>this['_shiftOperation'](_0x4ba93d['clone'](),-_0x1c36be)),'groupOffset':_0x1b80be}),_0x42a57a=_0x3a54c9?[_0x3a54c9]:[],_0x1c36be+=_0x1b80be,_0x1b80be=0x0):_0x42a57a['push'](_0x3a54c9),_0x3a54c9&&'insert'===_0x3a54c9['type']&&(_0x1b80be+=_0x3a54c9['howMany']);}return _0x4cca16;}['_findAdjacentContextDistance'](_0x596bc7,_0x5c4886,_0x22042d,_0x236d8a=0x1){const _0x1e4c1b=new _0x467163({'startPosition':_0x596bc7,'direction':_0x5c4886});let _0x1d3ebd=0x0;for(let _0x4df6ca=0x0;_0x4df6ca<_0x236d8a;_0x4df6ca++){let _0x60dbd1=0x0,_0x1ad860=!0x1,_0x4594a2='forward'===_0x5c4886?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x25da1e}of _0x1e4c1b)if(_0x25da1e['is']('$textProxy')){const _0x5e7292=_0x4594a2['exec'](_0x25da1e['data']);if(_0x5e7292&&_0x5e7292['length']){if(_0x60dbd1+='forward'===_0x5c4886?_0x5e7292['index']+_0x5e7292[0x0]['length']:_0x25da1e['data']['length']-_0x5e7292['index'],_0x5e7292[0x0]['length']!==_0x25da1e['data']['length'])break;_0x1ad860=!0x0,_0x4594a2='forward'===_0x5c4886?/^\w+/:/\w+$/;}else{if(_0x1ad860)break;_0x60dbd1+=_0x25da1e['offsetSize'];}}else{if(_0x25da1e['is']('element')){_0x22042d['isInline'](_0x25da1e)&&!_0x1ad860&&(_0x60dbd1+=0x1);break;}}_0x1d3ebd+=_0x60dbd1,_0x1e4c1b['jumpTo'](_0x596bc7['getShiftedBy']('forward'===_0x5c4886?_0x1d3ebd:-_0x1d3ebd));}return _0x1d3ebd;}['_getChangeContext'](_0x2a6259,_0x464b08){const _0x381996=ut(this['context'])['model']['schema'],_0x59adef=this['_findAdjacentContextDistance'](_0x2a6259,'backward',_0x381996,0x6),_0x5ac8a6=this['_findAdjacentContextDistance'](_0x464b08,'forward',_0x381996,0x6),_0x4a807e=_0x2a6259['getShiftedBy'](-_0x59adef),_0x311245=_0x464b08['getShiftedBy'](_0x5ac8a6);return{'start':_0x4a807e,'end':_0x311245,'hasContentBefore':!_0x4a807e['isAtStart'],'hasContentAfter':!_0x311245['isAtEnd']};}['_insertMarkers'](_0x263027){const _0x3b946c=this['context']['plugins']['get']('AIEditing'),_0x154560=new Set();ut(this['context'])['model']['change'](_0x4864b8=>{for(const _0x7cbd2e of _0x263027){const _0x7de82e=''+we+_0x7cbd2e['type']+':'+_0x7cbd2e['groupId']+'_'+_0x3b946c['_nextDataId'](_0x154560);this['_markers']['set'](_0x7de82e,{'id':_0x7de82e,'groupId':_0x7cbd2e['groupId'],'type':_0x7cbd2e['type'],'text':_0x7cbd2e['text']}),_0x4864b8['addMarker'](_0x7de82e,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4864b8['createRange'](_0x7cbd2e['start'],_0x7cbd2e['end'])});}});}['_createGetContextFn'](_0x32fcc2,_0x385d02,_0x1b8f78){let _0x2b8623='';return()=>{if(!_0x2b8623){const _0x24351=_0x385d02['toView'](_0x32fcc2,{'showSuggestionHighlights':!0x0});let _0x414dc9=_0x24351['getChild'](0x0);if(_0x414dc9['is']('containerElement')||(_0x414dc9=_0x24351),!_0x414dc9)return'';let _0x3cb9fd=!0x1;const _0x10a60c=[];for(const _0x4024f0 of _0x414dc9['getChildren']())_0x4024f0['is']('element','span')&&_0x4024f0['hasClass']('ck-ai_review-mode-marker_context-end')&&(_0x3cb9fd=!0x1),_0x3cb9fd&&_0x10a60c['push'](_0x4024f0),_0x4024f0['is']('element','span')&&_0x4024f0['hasClass']('ck-ai_review-mode-marker_context-start')&&(_0x3cb9fd=!0x0);_0x414dc9['_removeChildren'](0x0,_0x414dc9['childCount']),_0x1b8f78?.['ellipsisBefore']&&_0x414dc9['_appendChild']('…'),_0x414dc9['_appendChild'](_0x10a60c),_0x1b8f78?.['ellipsisAfter']&&_0x414dc9['_appendChild']('…');const _0x3f7caf=_0x385d02['htmlProcessor']['domConverter']['viewToDom'](_0x24351),_0x5aa577=_0x385d02['htmlProcessor']['htmlWriter']['getHtml'](_0x3f7caf);_0x2b8623=_0x5aa577;}return _0x2b8623;};}['_createGetContentFn'](_0x43fa65,_0x30543c){let _0x4ed2d6='';return()=>(_0x4ed2d6||(_0x4ed2d6=_0x30543c['stringify'](_0x43fa65,{'showSuggestionHighlights':!0x0})),_0x4ed2d6);}['_createGetContentUsingDataIdFn'](_0x8af6da,_0x31e527,_0xa49a79){let _0x16b37e='';return()=>{if(!_0x16b37e){const _0x4e9b73=_0xa49a79['toView'](new _0x490745(_0x8af6da)),_0x1c82b3=_0xa49a79['htmlProcessor']['domConverter']['viewToDom'](_0x4e9b73)['querySelector']('[data-id=\x22'+_0x31e527+'\x22]');_0x16b37e=_0x1c82b3?.['outerHTML']||'';}return _0x16b37e;};}['_findMarkerElement'](_0x21304b,_0x253b87=0x5){let _0x22dfd8=_0x21304b,_0x38e171=null;for(let _0x503326=0x0;_0x503326<_0x253b87&&_0x22dfd8;_0x503326++){if(!_0x22dfd8['className']){_0x22dfd8=_0x22dfd8['parentElement'];continue;}if(!(''+_0x22dfd8['className'])['includes']('ck-ai_review-mode-marker_')){_0x22dfd8=_0x22dfd8['parentElement'];continue;}if(!_0x22dfd8['getAttribute']('data-marker-id'))break;_0x38e171=_0x22dfd8;break;}return _0x38e171;}['_getMarkersDataForGroup'](_0xddf903){return Array['from'](this['_markers']['values']())['filter'](_0x57e4b4=>_0x57e4b4['groupId']===_0xddf903);}['_getOperationStart'](_0x195b34){return'insert'===_0x195b34['type']?_0x195b34['position']:_0x195b34['newRange']['start'];}['_getOperationEnd'](_0x20bffb,_0x5f1bdb=!0x1){return'insert'===_0x20bffb['type']?_0x5f1bdb?_0x20bffb['position']:_0x20bffb['position']['getShiftedBy'](_0x20bffb['howMany']):_0x20bffb['newRange']['end'];}['_shiftOperation'](_0x2b52a9,_0x436498){return'insert'===_0x2b52a9['type']?_0x2b52a9['position']=_0x2b52a9['position']['getShiftedBy'](_0x436498):'marker'===_0x2b52a9['type']&&_0x2b52a9['newRange']&&(_0x2b52a9['newRange']=new _0x1026dd(_0x2b52a9['newRange']['start']['getShiftedBy'](_0x436498),_0x2b52a9['newRange']['end']['getShiftedBy'](_0x436498))),_0x2b52a9;}['_changeOperationOwnerDocument'](_0x4950f7,_0x423cd2){'insert'===_0x4950f7['type']?_0x4950f7['position']=this['_changePositionOwnerDocument'](_0x4950f7['position'],_0x423cd2):'marker'===_0x4950f7['type']&&_0x4950f7['newRange']&&(_0x4950f7['newRange']=this['_changeRangeOwnerDocument'](_0x4950f7['newRange'],_0x423cd2));}['_changePositionOwnerDocument'](_0x3814aa,_0x406e4d){return new tt(_0x406e4d,_0x3814aa['path']);}['_changeRangeOwnerDocument'](_0x3dffd1,_0x54b834){return new _0x1026dd(this['_changePositionOwnerDocument'](_0x3dffd1['start'],_0x54b834),this['_changePositionOwnerDocument'](_0x3dffd1['end'],_0x54b834));}['_changePosition'](_0x5c747b,_0x3e28cf){return new tt(_0x3e28cf,[..._0x5c747b]);}['_changeRange'](_0xaa4cd4,_0x4ddb17,_0x5d17af,_0x271a00){return new _0x1026dd(this['_changePosition'](_0x4ddb17,_0x271a00),this['_changePosition'](_0x5d17af,_0x271a00));}['_sortMarkers'](_0x37e5e6){const _0x471222=_0x1b53f8=>{switch(_0x1b53f8){case'insert':return 0x1;case'remove-context':return 0x2;case'remove-only':return 0x3;case'remove-text':return 0x4;}};return _0x37e5e6['sort']((_0x25ce8a,_0x52b640)=>_0x471222(_0x25ce8a['type'])-_0x471222(_0x52b640['type']));}['_hasSameTopLevelElement'](_0x1b418b,_0x3b8a49){const _0x38864d=_0x1b418b['getChild'](0x0),_0x2f5f6d=_0x3b8a49['getChild'](0x0);return!(!_0x38864d||!_0x2f5f6d)&&((!_0x38864d['is']('element')||!_0x2f5f6d['is']('element')||_0x38864d['name']===_0x2f5f6d['name'])&&!(_0x38864d['is']('element')&&!_0x2f5f6d['is']('element')||!_0x38864d['is']('element')&&_0x2f5f6d['is']('element')));}['_haveSingleTopLevelElement'](_0x3d1b92){return 0x1===_0x3d1b92['childCount'];}['_haveOnlyInlineContent'](_0x4588b1,_0x5c37b2){for(const _0x33f623 of _0x4588b1['getChildren']())if(_0x33f623['is']('element')&&!_0x5c37b2['isInline'](_0x33f623))return!0x1;return!0x0;}['_upsertDataId'](_0x55fb5e,_0x4ba5af){let _0x43f478=_0x55fb5e['getAttribute'](yt);return _0x43f478||(_0x43f478=_0x4ba5af(),_0x55fb5e['_setAttribute'](yt,_0x43f478)),_0x43f478;}}class Ga extends ot{static get['requires'](){return[re,me,ce];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{ri as AIActions,K as AIAdapter,$n as AIAssistant,n as AIAssistantUI,H as AIBalloon,Da as AIChat,dt as AIChatController,pt as AIChatHistory,jt as AIChatHistoryController,xt as AIChatHistoryUI,gt as AIChatUI,S as AIConnector,R as AIEditing,Ma as AIEditorIntegration,Gt as AIQuickActionType,Va as AIQuickActions,ii as AIQuickActionsUI,tr as AIRequestError,js as AIReviewCheck,Rs as AIReviewCheckResult,zs as AIReviewCheckRun,Ga as AIReviewMode,re as AIReviewModeController,ce as AIReviewModeEditing,me as AIReviewModeUI,Ct as AITabs,pe as AITextAdapter,qt as AIToggleButtonUI,Xn as AWSTextAdapter,Qn as OpenAITextAdapter,E as ShowAIAssistantCommand,co as ToggleAICommand,ks as createResizeButton,qn as getDefaultAICommands};