@ckeditor/ckeditor5-ai 47.0.0-alpha.0 → 47.0.0-alpha.2

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 (313) hide show
  1. package/build/ai.js +1 -1
  2. package/dist/index-editor.css +114 -12
  3. package/dist/index.css +114 -12
  4. package/dist/index.js +4 -4
  5. package/dist/translations/af.js +1 -1
  6. package/dist/translations/af.umd.js +1 -1
  7. package/dist/translations/ar.js +1 -1
  8. package/dist/translations/ar.umd.js +1 -1
  9. package/dist/translations/ast.js +1 -1
  10. package/dist/translations/ast.umd.js +1 -1
  11. package/dist/translations/az.js +1 -1
  12. package/dist/translations/az.umd.js +1 -1
  13. package/dist/translations/be.js +1 -1
  14. package/dist/translations/be.umd.js +1 -1
  15. package/dist/translations/bg.js +1 -1
  16. package/dist/translations/bg.umd.js +1 -1
  17. package/dist/translations/bn.js +1 -1
  18. package/dist/translations/bn.umd.js +1 -1
  19. package/dist/translations/bs.js +1 -1
  20. package/dist/translations/bs.umd.js +1 -1
  21. package/dist/translations/ca.js +1 -1
  22. package/dist/translations/ca.umd.js +1 -1
  23. package/dist/translations/cs.js +1 -1
  24. package/dist/translations/cs.umd.js +1 -1
  25. package/dist/translations/da.js +1 -1
  26. package/dist/translations/da.umd.js +1 -1
  27. package/dist/translations/de-ch.js +1 -1
  28. package/dist/translations/de-ch.umd.js +1 -1
  29. package/dist/translations/de.js +1 -1
  30. package/dist/translations/de.umd.js +1 -1
  31. package/dist/translations/el.js +1 -1
  32. package/dist/translations/el.umd.js +1 -1
  33. package/dist/translations/en-au.js +1 -1
  34. package/dist/translations/en-au.umd.js +1 -1
  35. package/dist/translations/en-gb.js +1 -1
  36. package/dist/translations/en-gb.umd.js +1 -1
  37. package/dist/translations/en.js +1 -1
  38. package/dist/translations/en.umd.js +1 -1
  39. package/dist/translations/eo.js +1 -1
  40. package/dist/translations/eo.umd.js +1 -1
  41. package/dist/translations/es-co.js +1 -1
  42. package/dist/translations/es-co.umd.js +1 -1
  43. package/dist/translations/es.js +1 -1
  44. package/dist/translations/es.umd.js +1 -1
  45. package/dist/translations/et.js +1 -1
  46. package/dist/translations/et.umd.js +1 -1
  47. package/dist/translations/eu.js +1 -1
  48. package/dist/translations/eu.umd.js +1 -1
  49. package/dist/translations/fa.js +1 -1
  50. package/dist/translations/fa.umd.js +1 -1
  51. package/dist/translations/fi.js +1 -1
  52. package/dist/translations/fi.umd.js +1 -1
  53. package/dist/translations/fr.js +1 -1
  54. package/dist/translations/fr.umd.js +1 -1
  55. package/dist/translations/gl.js +1 -1
  56. package/dist/translations/gl.umd.js +1 -1
  57. package/dist/translations/gu.js +1 -1
  58. package/dist/translations/gu.umd.js +1 -1
  59. package/dist/translations/he.js +1 -1
  60. package/dist/translations/he.umd.js +1 -1
  61. package/dist/translations/hi.js +1 -1
  62. package/dist/translations/hi.umd.js +1 -1
  63. package/dist/translations/hr.js +1 -1
  64. package/dist/translations/hr.umd.js +1 -1
  65. package/dist/translations/hu.js +1 -1
  66. package/dist/translations/hu.umd.js +1 -1
  67. package/dist/translations/hy.js +1 -1
  68. package/dist/translations/hy.umd.js +1 -1
  69. package/dist/translations/id.js +1 -1
  70. package/dist/translations/id.umd.js +1 -1
  71. package/dist/translations/it.js +1 -1
  72. package/dist/translations/it.umd.js +1 -1
  73. package/dist/translations/ja.js +1 -1
  74. package/dist/translations/ja.umd.js +1 -1
  75. package/dist/translations/jv.js +1 -1
  76. package/dist/translations/jv.umd.js +1 -1
  77. package/dist/translations/kk.js +1 -1
  78. package/dist/translations/kk.umd.js +1 -1
  79. package/dist/translations/km.js +1 -1
  80. package/dist/translations/km.umd.js +1 -1
  81. package/dist/translations/kn.js +1 -1
  82. package/dist/translations/kn.umd.js +1 -1
  83. package/dist/translations/ko.js +1 -1
  84. package/dist/translations/ko.umd.js +1 -1
  85. package/dist/translations/ku.js +1 -1
  86. package/dist/translations/ku.umd.js +1 -1
  87. package/dist/translations/lt.js +1 -1
  88. package/dist/translations/lt.umd.js +1 -1
  89. package/dist/translations/lv.js +1 -1
  90. package/dist/translations/lv.umd.js +1 -1
  91. package/dist/translations/ms.js +1 -1
  92. package/dist/translations/ms.umd.js +1 -1
  93. package/dist/translations/nb.js +1 -1
  94. package/dist/translations/nb.umd.js +1 -1
  95. package/dist/translations/ne.js +1 -1
  96. package/dist/translations/ne.umd.js +1 -1
  97. package/dist/translations/nl.js +1 -1
  98. package/dist/translations/nl.umd.js +1 -1
  99. package/dist/translations/no.js +1 -1
  100. package/dist/translations/no.umd.js +1 -1
  101. package/dist/translations/oc.js +1 -1
  102. package/dist/translations/oc.umd.js +1 -1
  103. package/dist/translations/pl.js +1 -1
  104. package/dist/translations/pl.umd.js +1 -1
  105. package/dist/translations/pt-br.js +1 -1
  106. package/dist/translations/pt-br.umd.js +1 -1
  107. package/dist/translations/pt.js +1 -1
  108. package/dist/translations/pt.umd.js +1 -1
  109. package/dist/translations/ro.js +1 -1
  110. package/dist/translations/ro.umd.js +1 -1
  111. package/dist/translations/ru.js +1 -1
  112. package/dist/translations/ru.umd.js +1 -1
  113. package/dist/translations/si.js +1 -1
  114. package/dist/translations/si.umd.js +1 -1
  115. package/dist/translations/sk.js +1 -1
  116. package/dist/translations/sk.umd.js +1 -1
  117. package/dist/translations/sl.js +1 -1
  118. package/dist/translations/sl.umd.js +1 -1
  119. package/dist/translations/sq.js +1 -1
  120. package/dist/translations/sq.umd.js +1 -1
  121. package/dist/translations/sr-latn.js +1 -1
  122. package/dist/translations/sr-latn.umd.js +1 -1
  123. package/dist/translations/sr.js +1 -1
  124. package/dist/translations/sr.umd.js +1 -1
  125. package/dist/translations/sv.js +1 -1
  126. package/dist/translations/sv.umd.js +1 -1
  127. package/dist/translations/th.js +1 -1
  128. package/dist/translations/th.umd.js +1 -1
  129. package/dist/translations/ti.js +1 -1
  130. package/dist/translations/ti.umd.js +1 -1
  131. package/dist/translations/tk.js +1 -1
  132. package/dist/translations/tk.umd.js +1 -1
  133. package/dist/translations/tr.js +1 -1
  134. package/dist/translations/tr.umd.js +1 -1
  135. package/dist/translations/tt.js +1 -1
  136. package/dist/translations/tt.umd.js +1 -1
  137. package/dist/translations/ug.js +1 -1
  138. package/dist/translations/ug.umd.js +1 -1
  139. package/dist/translations/uk.js +1 -1
  140. package/dist/translations/uk.umd.js +1 -1
  141. package/dist/translations/ur.js +1 -1
  142. package/dist/translations/ur.umd.js +1 -1
  143. package/dist/translations/uz.js +1 -1
  144. package/dist/translations/uz.umd.js +1 -1
  145. package/dist/translations/vi.js +1 -1
  146. package/dist/translations/vi.umd.js +1 -1
  147. package/dist/translations/zh-cn.js +1 -1
  148. package/dist/translations/zh-cn.umd.js +1 -1
  149. package/dist/translations/zh.js +1 -1
  150. package/dist/translations/zh.umd.js +1 -1
  151. package/lang/contexts.json +36 -1
  152. package/package.json +15 -15
  153. package/src/aiactions/aiactions.js +1 -1
  154. package/src/aiactions/model/aiactionsinteraction.js +1 -1
  155. package/src/aiactions/model/aiactionsreply.js +1 -1
  156. package/src/aiassistant/adapters/aiadapter.js +1 -1
  157. package/src/aiassistant/adapters/aitextadapter.js +1 -1
  158. package/src/aiassistant/adapters/awstextadapter.js +1 -1
  159. package/src/aiassistant/adapters/openaitextadapter.js +1 -1
  160. package/src/aiassistant/aiassistant.js +1 -1
  161. package/src/aiassistant/aiassistantediting.js +1 -1
  162. package/src/aiassistant/aiassistantui.js +1 -1
  163. package/src/aiassistant/legacyerrors.js +1 -1
  164. package/src/aiassistant/ui/aiassistantcontroller.js +2 -2
  165. package/src/aiassistant/ui/form/aiformcontentarea.js +1 -1
  166. package/src/aiassistant/ui/form/aiformerrorview.js +1 -1
  167. package/src/aiassistant/ui/form/aiformpromptview.js +1 -1
  168. package/src/aiassistant/ui/form/aiformtoolbarview.js +1 -1
  169. package/src/aiassistant/ui/form/aiformview.js +1 -1
  170. package/src/aiassistant/ui/form/aihistorylistitemview.js +1 -1
  171. package/src/aiassistant/ui/form/aihistorylistview.js +1 -1
  172. package/src/aiassistant/ui/form/prompthistory.js +1 -1
  173. package/src/aiassistant/ui/showaiassistantcommand.js +1 -1
  174. package/src/aiassistant/utils/common-translations.js +1 -1
  175. package/src/aiassistant/utils/normalizecommandsconfig.js +1 -1
  176. package/src/aiballoon/aiballoon.js +1 -1
  177. package/src/aiballoon/ui/aiballoondisclaimerview.js +1 -1
  178. package/src/aiballoon/ui/aiballoontoolbarview.js +1 -1
  179. package/src/aiballoon/ui/aiballoonview.js +1 -1
  180. package/src/aichat/aichat.js +1 -1
  181. package/src/aichat/aichatcontroller.js +1 -1
  182. package/src/aichat/aichatui.js +1 -1
  183. package/src/aichat/model/aichatcontext.js +1 -1
  184. package/src/aichat/model/aichatconversation.js +1 -1
  185. package/src/aichat/model/aichatinteraction.js +1 -1
  186. package/src/aichat/model/aichatmodels.js +1 -1
  187. package/src/aichat/ui/aichatcontrolsview.js +1 -1
  188. package/src/aichat/ui/aichatfeedview.js +1 -1
  189. package/src/aichat/ui/aichatheaderview.js +1 -1
  190. package/src/aichat/ui/aichatview.js +1 -1
  191. package/src/aichat/ui/controls/aichatchipsoverflowmanager.js +1 -1
  192. package/src/aichat/ui/controls/aichatcontextitembuttonview.js +1 -1
  193. package/src/aichat/ui/controls/aichatcontextpanelurlinputview.js +1 -1
  194. package/src/aichat/ui/controls/aichatcontextpanelview.js +1 -1
  195. package/src/aichat/ui/controls/aichatcontrolsloaderview.js +1 -1
  196. package/src/aichat/ui/controls/aichatpromptcapabilitiesview.js +1 -1
  197. package/src/aichat/ui/controls/aichatpromptinputview.js +1 -1
  198. package/src/aichat/ui/controls/aichatpromptsuggestionslistview.js +1 -1
  199. package/src/aichat/ui/controls/resources/aichatresourcelistitemview.js +1 -1
  200. package/src/aichat/ui/controls/resources/aichatresourcesballoonview.js +1 -1
  201. package/src/aichat/ui/controls/resources/aichatresourceslistview.js +1 -1
  202. package/src/aichat/ui/controls/resources/aichatresourcessearchinputview.js +1 -1
  203. package/src/aichat/ui/controls/resources/aichatresourcesview.js +1 -1
  204. package/src/aichat/ui/feed/aichatfeedcontextchipsview.js +1 -1
  205. package/src/aichat/ui/feed/aichatfeederroritemview.js +1 -1
  206. package/src/aichat/ui/feed/aichatfeedinteractionheaderview.js +1 -1
  207. package/src/aichat/ui/feed/aichatfeeditemview.js +1 -1
  208. package/src/aichat/ui/feed/aichatfeedreplyitemview.js +1 -1
  209. package/src/aichat/ui/feed/aichatfeedsuggestionitemactionsview.js +1 -1
  210. package/src/aichat/ui/feed/aichatfeedsuggestionitemview.js +1 -1
  211. package/src/aichat/ui/feed/aichatfeedusermessageitem.js +1 -1
  212. package/src/aichat/utils/eventnames.js +1 -1
  213. package/src/aichat/utils/promisequeue.js +1 -1
  214. package/src/aichat/utils/scrollmanager.js +1 -1
  215. package/src/aichathistory/aichathistory.js +1 -1
  216. package/src/aichathistory/aichathistorycontroller.js +1 -1
  217. package/src/aichathistory/aichathistoryui.js +1 -1
  218. package/src/aichathistory/model/aichathistoryconversations.js +1 -1
  219. package/src/aichathistory/model/aichathistoryitem.js +1 -1
  220. package/src/aichathistory/ui/aichathistorylistitemview.js +1 -1
  221. package/src/aichathistory/ui/aichathistorylistview.js +1 -1
  222. package/src/aichathistory/ui/aichathistorysectionlistview.js +1 -1
  223. package/src/aichathistory/ui/aichathistoryview.js +1 -1
  224. package/src/aiconfig.d.ts +16 -0
  225. package/src/aicore/aiconnector.js +1 -1
  226. package/src/aicore/aiediting.js +1 -1
  227. package/src/aicore/model/aicapabilities.js +1 -1
  228. package/src/aicore/model/aicontext.js +1 -1
  229. package/src/aicore/model/aiinteraction.js +1 -1
  230. package/src/aicore/model/aireply.js +1 -1
  231. package/src/aicore/pipeline/airesponseapplier.js +2 -2
  232. package/src/aicore/pipeline/airesponseparser.js +2 -2
  233. package/src/aicore/ui/aidisclaimerview.js +1 -1
  234. package/src/aicore/ui/aiskeleton.js +1 -1
  235. package/src/aicore/ui/aispinner.js +1 -1
  236. package/src/aicore/ui/suggestioncontainer/aiminitoolbarview.js +1 -1
  237. package/src/aicore/ui/suggestioncontainer/aisuggestionbodyview.js +1 -1
  238. package/src/aicore/ui/suggestioncontainer/aisuggestioncontainerview.d.ts +1 -1
  239. package/src/aicore/ui/suggestioncontainer/aisuggestioncontainerview.js +1 -1
  240. package/src/aicore/ui/suggestioncontainer/aisuggestioncontentpartview.js +1 -1
  241. package/src/aicore/ui/suggestioncontainer/aisuggestionheaderview.js +1 -1
  242. package/src/aicore/utils/common-translations.js +1 -1
  243. package/src/aicore/utils/createresizebutton.js +1 -1
  244. package/src/aicore/utils/documentposition.js +1 -1
  245. package/src/aicore/utils/documentrange.js +1 -1
  246. package/src/aicore/utils/eventnames.js +1 -1
  247. package/src/aicore/utils/geteditorfromcontext.js +1 -1
  248. package/src/aicore/utils/getoperationsfromreply.js +1 -1
  249. package/src/aicore/utils/getsuggestionpartsfromreply.js +1 -1
  250. package/src/aicore/utils/htmlparser.js +1 -1
  251. package/src/aicore/utils/htmlstreamer.js +1 -1
  252. package/src/aiquickactions/aiquickactions.js +1 -1
  253. package/src/aiquickactions/aiquickactionscommand.js +1 -1
  254. package/src/aiquickactions/aiquickactionsediting.js +1 -1
  255. package/src/aiquickactions/aiquickactionsui.js +1 -1
  256. package/src/aiquickactions/ui/aiquickactionsbuttoncreator.js +1 -1
  257. package/src/aiquickactions/ui/aiquickactionsdropdowncontentview.js +1 -1
  258. package/src/aiquickactions/ui/aiquickactionsdropdowncreator.js +1 -1
  259. package/src/aiquickactions/utils/common-translations.js +1 -1
  260. package/src/aireviewmode/aireviewcheckdefinitions.d.ts +31 -0
  261. package/src/aireviewmode/aireviewcheckdefinitions.js +23 -0
  262. package/src/aireviewmode/aireviewmode.d.ts +37 -0
  263. package/src/aireviewmode/aireviewmode.js +1 -1
  264. package/src/aireviewmode/aireviewmodecontroller.d.ts +1 -1
  265. package/src/aireviewmode/aireviewmodecontroller.js +1 -1
  266. package/src/aireviewmode/aireviewmodeediting.d.ts +1 -1
  267. package/src/aireviewmode/aireviewmodeediting.js +1 -1
  268. package/src/aireviewmode/aireviewmodeui.d.ts +1 -1
  269. package/src/aireviewmode/aireviewmodeui.js +1 -1
  270. package/src/aireviewmode/model/aireviewcheck.d.ts +2 -19
  271. package/src/aireviewmode/model/aireviewcheck.js +1 -1
  272. package/src/aireviewmode/model/aireviewcheckcustom.js +1 -1
  273. package/src/aireviewmode/model/aireviewchecklist.d.ts +2 -5
  274. package/src/aireviewmode/model/aireviewchecklist.js +1 -1
  275. package/src/aireviewmode/model/aireviewcheckresult.js +1 -1
  276. package/src/aireviewmode/model/aireviewcheckresultchange.js +1 -1
  277. package/src/aireviewmode/model/aireviewcheckrun.d.ts +6 -1
  278. package/src/aireviewmode/model/aireviewcheckrun.js +1 -1
  279. package/src/aireviewmode/model/aireviewcustomcheckrun.d.ts +4 -0
  280. package/src/aireviewmode/model/aireviewcustomcheckrun.js +1 -1
  281. package/src/aireviewmode/model/aireviewmodels.js +1 -1
  282. package/src/aireviewmode/model/aireviewsystemcheckrun.d.ts +4 -0
  283. package/src/aireviewmode/model/aireviewsystemcheckrun.js +1 -1
  284. package/src/aireviewmode/ui/aireviemodepromptinputview.js +1 -1
  285. package/src/aireviewmode/ui/aireviewmodechecklistitemresultview.js +1 -1
  286. package/src/aireviewmode/ui/aireviewmodecustomcheckview.d.ts +4 -0
  287. package/src/aireviewmode/ui/aireviewmodecustomcheckview.js +1 -1
  288. package/src/aireviewmode/ui/aireviewmodereviewchecklistview.js +1 -1
  289. package/src/aireviewmode/ui/aireviewmodereviewcheckresultsview.js +1 -1
  290. package/src/aireviewmode/ui/aireviewmodereviewcommandlistitemview.d.ts +1 -0
  291. package/src/aireviewmode/ui/aireviewmodereviewcommandlistitemview.js +1 -1
  292. package/src/aireviewmode/ui/aireviewmodereviewcompletedview.js +1 -1
  293. package/src/aireviewmode/ui/aireviewmodeview.js +1 -1
  294. package/src/aireviewmode/ui/form/aireviewmodeformamanager.d.ts +1 -1
  295. package/src/aireviewmode/ui/form/aireviewmodeformamanager.js +1 -1
  296. package/src/aireviewmode/ui/form/aireviewmodeformdropdown.d.ts +1 -1
  297. package/src/aireviewmode/ui/form/aireviewmodeformdropdown.js +1 -1
  298. package/src/aireviewmode/ui/form/aireviewmodeformmanager.d.ts +1 -1
  299. package/src/aireviewmode/ui/form/aireviewmodeformmanager.js +1 -1
  300. package/src/aitabs/aitabs.js +1 -1
  301. package/src/aitabs/aitabsmainview.js +1 -1
  302. package/src/aitabs/tabs/aitabsview.js +1 -1
  303. package/src/aitabs/tabs/tabbuttonview.js +1 -1
  304. package/src/aitabs/tabs/tabpanelview.js +1 -1
  305. package/src/index.d.ts +3 -2
  306. package/src/index.js +1 -1
  307. package/theme/aichat/aichat-controls/aichat-controls-loader.css +1 -1
  308. package/theme/aichat/aichat-controls.css +4 -0
  309. package/theme/aichat/aichatfeed.css +4 -0
  310. package/theme/aireviewmode/aireviewmode-check-list.css +112 -11
  311. package/theme/aitabs/tabs/tabbuttonview.css +1 -0
  312. package/src/aireviewmode/utils/common-translations.d.ts +0 -9
  313. package/src/aireviewmode/utils/common-translations.js +0 -23
package/dist/index.js CHANGED
@@ -20,7 +20,7 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x24c1a8,Command as _0x417d51,ContextPlugin as _0x316379,Editor as dt}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x5e314f,IconCheck as _0x564196,IconError as _0x500579,IconSubmit as _0x1e3ea1,IconAIHistory as ot,IconMagicWand as _0x7e4bf6,IconRobotPencil as _0x535c35,IconMaximize as _0x148c4b,IconMinimize as _0x5b5f05,IconShowChangesOn as _0x192c0a,IconShowChangesOff as _0x3d9e18,IconDocument as _0x1a2e5f,IconThreeStars as _0x5e03fb,IconDocumentWithLoupe as _0x4be45b,IconAddComment as _0x23df72,IconRemove as _0x57ec11,IconDocumentWithCheckmark as _0x150120,IconDocumentWithCross as _0x21baee,IconLoupe as _0x3c6e76,IconCancel as _0x4916b4,IconStop as _0x3a9ce7,IconAIChat as Rt,IconPlus as _0x5f3a3b,IconPin as _0x252a95,IconThreeHorizontalDots as _0x3944e6,IconChevronRight as _0x512627,IconInfo as _0x3618e1,IconEye as _0x2ae657,IconEyeCrossedOut as _0x30fec7,IconAIReview as te}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x2458fa,CKEditorError as _0x4a8035,ObservableMixin as _0x757adc,global as _0x3125c6,isVisible as _0x346d68,Rect as _0x5198ab,Collection as _0x4041f8,FocusTracker as _0x30a616,KeystrokeHandler as _0xf37da3,first as _0x3d8d09,toArray as _0x25a514,EmitterMixin as _0x2f6768,logWarning as _0x3a0d50,logError as lt,scrollViewportToShowTarget as gt,ResizeObserver as _0x2c3742,_isMotionReduced as Et}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x24bea5,ButtonView as _0x155a80,View as _0x7ecbb5,SpinnerView as _0x4412dd,IconView as _0x29aaa9,AutocompleteView as _0x351fe1,ListView as _0x5c4336,ListItemGroupView as _0x46b328,ListItemView as _0x7baab6,ButtonLabelView as _0x46d8c3,FocusCycler as _0x5883a2,createLabeledTextarea as _0x39bf80,Dialog as _0x12fc7f,createDropdown as _0x30b0b5,addMenuToDropdown as _0x1c5f66,MenuBarMenuView as _0x173368,MenuBarMenuListItemButtonView as _0x4ee929,DialogViewPosition as _0x7f28e6,MenuBarMenuListView as _0x4593bb,MenuBarMenuListItemView as _0x45fd40,ViewCollection as _0xa841d5,UIModel as _0x1a9d93,SplitButtonView as _0x419f47,BalloonPanelView as _0x271ec1,BodyCollection as jt,clickOutsideHandler as _0x6d5b3a,ListItemButtonView as _0x416a68,addListToDropdown as _0x69c78d,submitHandler as _0x5b5e3c,LabeledFieldView as th,createLabeledInputText as _0x1b8929,FormHeaderView as _0xd9d6ea,HighlightedTextView as _0x19f11c,FileDialogButtonView as _0x49c261,InputTextView as _0x34abd3,SearchTextView as _0x459d27,DropdownMenuButtonView as _0x2b0b4e,DropdownMenuPanelPositioningFunctions as _0x1508da,BalloonToolbar as Ft,FormRowView as _0x28ba79,TextareaView as _0x3ec2e3}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x18893b,ClipboardMarkersUtils as _0x5efa5e}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x3ccb07,ViewDataTransfer as _0x13e34a,ViewUpcastWriter as _0x537982,Matcher as _0x1e2464,ViewDowncastWriter as kt,transformOperationSets as _0x59f1a9,_DetachOperation as It,_insertIntoModelNodeList as _0x3994a3,_removeFromModelNodeList as _0x3a9e1b,ModelRange as _0xd5274c,ModelDocumentFragment as _0x576a41,ModelPosition as _0x5dfdfe,ModelTreeWalker as Vt,InsertOperation as $t,MarkerOperation as Bt}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x476de9,escape as _0x3dcf64,escapeRegExp as _0x122b7b}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x1a4036,InvokeModelWithResponseStreamCommand as _0x17043a,InvokeModelCommand as _0x54a44d}from'@aws-sdk/client-bedrock-runtime';import{createParser as bt}from'eventsource-parser';import{parseDocument as _0x1d72b0}from'htmlparser2';import{isTag as _0xc13be1,findOne as yt,getParent as _0x5a308c,findAll as _0x541e0b,removeElement as _0x21776c,replaceElement as _0x350626,prepend as _0x3a9005,prependChild as to,appendChild as _0x2a43bb,append as _0x31729b,find as _0x2e749c,isComment as _0x4ff99e,getChildren as _0x324aa7,textContent as _0x1d0859}from'domutils';import _0xbd2e84 from'dom-serializer';import{Document as wt,Element as _0x49ffc0,Text as _0x3b69e4,cloneNode as _0x4da27b,isDocument as _0x23da46,isText as tn,NodeWithChildren as _0x51e3e9}from'domhandler';import{MarkdownGfmMdToHtml as _0xa272fd}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{getAllMarkersDomElementsSorted as _0x19c4e6,DocumentCompare as _0x2423ad,DATA_ID_MODEL_ATTRIBUTE as ft}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import{IconThumbUp as _0x307234,IconThumbDown as _0x239612,IconCopy as _0x12d5ff,IconCheck as _0x37c028,IconShowChangesOff as _0xaffe2e,IconShowChangesOn as _0x404179,IconWeb as _0x125eea,IconNextArrow as _0x32487b,IconPreviousArrow as _0x3454be,IconAI as xt,IconClose as _0x381c0a,IconSelection as _0x6d029b,IconFileUpload as _0x49634e,IconLink as _0xa4bf6f,IconDocument as _0x2025c1,IconBulb as _0x5e48f1,IconDocumentOutline as _0x6f1c93,IconPaperClip as _0x22ac03,IconBrowseFiles as _0x11aba8,IconDropdownArrow as _0x178d87,IconAIQuickActions as _0x35a1a1,IconAIAskAI as Qt,IconAIChatCommands as Ut,IconAIImproveWriting as Lt,IconAIContinueWriting as Kt,IconAIGrammarCheck as Mt,IconAIAdjustLength as Nt,IconAIChangeTone as Ot,IconAITranslate as Yt,IconAIOther as Dt,IconRefresh as _0x105e96}from'@ckeditor/ckeditor5-icons/dist/index.js';import _0x706d3a from'morphdom';import{ConfirmMixin as _0x103bd6,LateFocusDropdownButtonView as _0x3d3f9f,DocumentCompare as _0x1df88e,DATA_ID_VIEW_ATTRIBUTE as Xt,DATA_ID_MODEL_ATTRIBUTE as _0xc2e267}from'ckeditor5-collaboration/dist/index.js';const P='_ungrouppedCommands';function I(_0x306b8c,_0x5e972a){const _0x8037da=(0x0,_0x5e972a['t'])('Other');return _0x306b8c['length']?'groupId'in _0x306b8c[0x0]?_0x306b8c:[{'groupId':P,'groupLabel':_0x8037da,'order':0x1/0x0,'commands':_0x306b8c}]:[{'groupId':P,'groupLabel':_0x8037da,'order':0x1/0x0,'commands':[]}];}const Hn=globalThis['DataTransfer'],O='ai-ui';class v extends _0x24c1a8{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x2c9890}=this,_0x8bb6f4=['ck-fake-ai-selection'];_0x2c9890['config']['get']('ai.assistant.useTheme')&&_0x8bb6f4['push']('ck-ai-assistant-ui_theme'),_0x2c9890['conversion']['for']('editingDowncast')['markerToHighlight']({'model':O,'view':{'classes':_0x8bb6f4,'priority':0xc}}),_0x2c9890['conversion']['for']('editingDowncast')['markerToElement']({'model':O,'view':(_0x4b6b01,{writer:_0x5a129b})=>{if(!_0x4b6b01['markerRange']['isCollapsed'])return null;const _0x34848a=_0x5a129b['createUIElement']('span');return _0x5a129b['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x34848a),_0x34848a;}});}['afterInit'](){!async function(_0x3de3b1){const _0x8374e1=_0x25852f([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]),_0x8ed8d4=0x3dffc4e1,_0xfbcf53=0x3df8b0a9^_0x8ed8d4,_0x558115=window[_0x25852f([0x44,0x61,0x74,0x65])][_0x25852f([0x6e,0x6f,0x77])](),_0xe44071=_0x3de3b1[_0x25852f([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x42036e=new window[(_0x25852f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2e3aca=>{_0xe44071[_0x25852f([0x6f,0x6e,0x63,0x65])](_0x25852f([0x72,0x65,0x61,0x64,0x79]),_0x2e3aca);}),_0x40172f={[_0x25852f([0x6b,0x74,0x79])]:_0x25852f([0x45,0x43]),[_0x25852f([0x75,0x73,0x65])]:_0x25852f([0x73,0x69,0x67]),[_0x25852f([0x63,0x72,0x76])]:_0x25852f([0x50,0x2d,0x32,0x35,0x36]),[_0x25852f([0x78])]:_0x25852f([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]),[_0x25852f([0x79])]:_0x25852f([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]),[_0x25852f([0x61,0x6c,0x67])]:_0x25852f([0x45,0x53,0x32,0x35,0x36])},_0x3fc7e6=_0xe44071[_0x25852f([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x25852f([0x67,0x65,0x74])](_0x25852f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x2bff96(){let _0x4f39ba,_0xf03a57=null,_0x18d69f=null;try{if(_0x3fc7e6==_0x25852f([0x47,0x50,0x4c]))return _0x25852f([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x4f39ba=_0x105845(),!_0x4f39ba)return _0x25852f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x4f39ba[_0x25852f([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x18d69f=_0x4a4a80(_0x4f39ba[_0x25852f([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x4f39ba[_0x25852f([0x6a,0x74,0x69])])),await _0xa42784()?_0x984169()?_0x3c63de()?_0x25852f([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x27503b()?(_0x4f39ba[_0x25852f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x25852f([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0xf03a57=_0x3598bf(_0x25852f([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x4f39ba[_0x25852f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x25852f([0x74,0x72,0x69,0x61,0x6c])&&(_0xf03a57=_0x3598bf(_0x25852f([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x10b2b0()):_0x25852f([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x25852f([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x25852f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x25852f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x3c63de(){const _0x27d0e7=[_0x25852f([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x25852f([0x74,0x72,0x69,0x61,0x6c])][_0x25852f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4f39ba[_0x25852f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x558115/0x3e8:0xe10*_0xfbcf53;return _0x4f39ba[_0x25852f([0x65,0x78,0x70])]<_0x27d0e7;}function _0x984169(){const _0x29fa74=_0x4f39ba[_0x25852f([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x29fa74&&(!!_0x29fa74[_0x25852f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x25852f([0x2a]))||!!_0x29fa74[_0x25852f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x25852f([0x41,0x49])));}function _0x27503b(){const _0x53ec70=_0x4f39ba[_0x25852f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x53ec70||0x0==_0x53ec70[_0x25852f([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x48dc67}=new URL(window[_0x25852f([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x53ec70[_0x25852f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x48dc67))return!0x0;const _0x53cbdc=_0x48dc67[_0x25852f([0x73,0x70,0x6c,0x69,0x74])](_0x25852f([0x2e]));return _0x53ec70[_0x25852f([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x3e7504=>_0x3e7504[_0x25852f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x25852f([0x2a])))[_0x25852f([0x6d,0x61,0x70])](_0x59149f=>_0x59149f[_0x25852f([0x73,0x70,0x6c,0x69,0x74])](_0x25852f([0x2e])))[_0x25852f([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x24d60c=>_0x24d60c[_0x25852f([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x53cbdc[_0x25852f([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x25852f([0x6d,0x61,0x70])](_0x103338=>Array(_0x53cbdc[_0x25852f([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x103338[_0x25852f([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x25852f([0x66,0x69,0x6c,0x6c])](_0x103338[0x0]===_0x25852f([0x2a])?_0x25852f([0x2a]):'')[_0x25852f([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x103338))[_0x25852f([0x73,0x6f,0x6d,0x65])](_0x5c1325=>_0x53cbdc[_0x25852f([0x65,0x76,0x65,0x72,0x79])]((_0x439fc2,_0x15980d)=>_0x5c1325[_0x15980d]===_0x439fc2||_0x5c1325[_0x15980d]===_0x25852f([0x2a])));}function _0x10b2b0(){return _0xf03a57&&_0x18d69f?new window[(_0x25852f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x53ce8e,_0x131c1b)=>{_0xf03a57[_0x25852f([0x74,0x68,0x65,0x6e])](_0x53ce8e,_0x131c1b),_0x18d69f[_0x25852f([0x74,0x68,0x65,0x6e])](_0x12f0f0=>{_0x12f0f0!=_0x25852f([0x56,0x61,0x6c,0x69,0x64])&&_0x53ce8e(_0x12f0f0);},_0x131c1b);}):_0xf03a57||_0x18d69f||_0x25852f([0x56,0x61,0x6c,0x69,0x64]);}}function _0x4a4a80(_0xb54543,_0x52c5c1){return new window[(_0x25852f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2b653f=>{if(_0x54cc73())return _0x2b653f(_0x25852f([0x56,0x61,0x6c,0x69,0x64]));_0x46cfed(),_0xe44071[_0x25852f([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x25852f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0xc6153c=!0x1;const _0xde4490=_0x2458fa();function _0x38049f(_0x42fae3){return!!_0x42fae3&&(typeof _0x42fae3===_0x25852f([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x42fae3===_0x25852f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x42fae3[_0x25852f([0x74,0x68,0x65,0x6e])]===_0x25852f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x42fae3[_0x25852f([0x63,0x61,0x74,0x63,0x68])]===_0x25852f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x237f21(_0x2c4c8c){_0x308ad6(_0x2c4c8c)[_0x25852f([0x74,0x68,0x65,0x6e])](_0x5c3d44=>{if(!_0x5c3d44||_0x5c3d44[_0x25852f([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x25852f([0x6f,0x6b]))return _0x25852f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x1d1d78(_0x8dd95(_0xde4490+_0x52c5c1))!=_0x5c3d44[_0x25852f([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x25852f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x25852f([0x56,0x61,0x6c,0x69,0x64]);})[_0x25852f([0x74,0x68,0x65,0x6e])](_0x114c86=>(_0x562109(),_0x114c86),()=>{const _0x4eae10=_0x4c52e3();return null==_0x4eae10?(_0x562109(),_0x25852f([0x56,0x61,0x6c,0x69,0x64])):_0x25852f(_0x558115-_0x4eae10>(0x19f340e1^_0x8ed8d4)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x25852f([0x74,0x68,0x65,0x6e])](_0x2b653f)[_0x25852f([0x63,0x61,0x74,0x63,0x68])](()=>{_0x2b653f(_0x25852f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x4b3f1b=0x3dc92a61^_0x8ed8d4;function _0x562109(){const _0x34bad1=_0x25852f([0x6c,0x6c,0x63,0x74,0x2d])+_0x1d1d78(_0x8dd95(_0xb54543)),_0x438058=_0x2611af(_0x1d1d78(window[_0x25852f([0x4d,0x61,0x74,0x68])][_0x25852f([0x63,0x65,0x69,0x6c])](_0x558115/_0x4b3f1b)));window[_0x25852f([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x25852f([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x34bad1,_0x438058);}function _0x4c52e3(){const _0x30b859=_0x25852f([0x6c,0x6c,0x63,0x74,0x2d])+_0x1d1d78(_0x8dd95(_0xb54543)),_0x2c549a=window[_0x25852f([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x25852f([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x30b859);return _0x2c549a?window[_0x25852f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2611af(_0x2c549a),0x10)*_0x4b3f1b:null;}function _0x308ad6(_0x35dae8){return new window[(_0x25852f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x30123b,_0x4744c2)=>{_0x35dae8[_0x25852f([0x74,0x68,0x65,0x6e])](_0x30123b,_0x4744c2),window[_0x25852f([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x4744c2,0x3dfe1021^_0x8ed8d4);});}}_0xe44071[_0x25852f([0x6f,0x6e])](_0x25852f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x5d41c5,_0x3b87eb)=>{if(_0x3b87eb[0x0]!=_0xb54543)return _0x2b653f(_0x25852f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x3b87eb[0x1]={..._0x3b87eb[0x1],[_0x25852f([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0xde4490};},{[_0x25852f([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x25852f([0x68,0x69,0x67,0x68])}),_0xe44071[_0x25852f([0x6f,0x6e])](_0x25852f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x3d2b5b=>{_0x38049f(_0x3d2b5b[_0x25852f([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0xc6153c=!0x0,_0x237f21(_0x3d2b5b[_0x25852f([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x25852f([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x25852f([0x6c,0x6f,0x77])}),_0x42036e[_0x25852f([0x74,0x68,0x65,0x6e])](()=>{_0xc6153c||_0x2b653f(_0x25852f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x54cc73(){return _0xe44071[_0x25852f([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x25852f([0x76,0x69,0x65,0x77])][_0x25852f([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x25852f([0x61,0x75,0x74,0x6f]);}function _0x46cfed(){_0xe44071[_0x25852f([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x25852f([0x76,0x69,0x65,0x77])][_0x25852f([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x25852f([0x61,0x75,0x74,0x6f]);}}function _0x3598bf(_0x5c03f6){const _0x5d8173=[new window[(_0x25852f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xf51c20=>setTimeout(_0xf51c20,0x3df6fa2d^_0x8ed8d4)),_0x42036e[_0x25852f([0x74,0x68,0x65,0x6e])](()=>new window[(_0x25852f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x300b56=>{let _0x15cf42=0x0;_0xe44071[_0x25852f([0x6d,0x6f,0x64,0x65,0x6c])][_0x25852f([0x6f,0x6e])](_0x25852f([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x379b0d,_0x3eb009)=>{_0x3eb009[0x0][_0x25852f([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x15cf42++,_0x15cf42==(0x3dffc519^_0x8ed8d4)&&(_0x300b56(),_0x379b0d[_0x25852f([0x6f,0x66,0x66])]());});}))];return window[_0x25852f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x25852f([0x72,0x61,0x63,0x65])](_0x5d8173)[_0x25852f([0x74,0x68,0x65,0x6e])](()=>_0x5c03f6);}async function _0x3dc2cc(){await _0x42036e,_0xe44071[_0x25852f([0x6d,0x6f,0x64,0x65,0x6c])][_0x25852f([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x38a87f,_0xe44071[_0x25852f([0x6d,0x6f,0x64,0x65,0x6c])][_0x25852f([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x38a87f,_0xe44071[_0x25852f([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x25852f([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x55e5c5(_0x52ce5a){const _0xc4b5c6=_0x10cfbf();_0xe44071[_0xc4b5c6]=_0x25852f([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x52ce5a,_0x52ce5a!=_0x25852f([0x56,0x61,0x6c,0x69,0x64])&&_0x3dc2cc();}function _0x10cfbf(){const _0x2814f7=window[_0x25852f([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x25852f([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x25852f([0x6e,0x6f,0x77])]())[_0x25852f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x25852f([0x2e]),'');let _0x314f52=_0x25852f([0x6e]);for(let _0x4f5c74=0x0;_0x4f5c74<_0x2814f7[_0x25852f([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4f5c74+=0x2){let _0x5adc22=window[_0x25852f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2814f7[_0x25852f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4f5c74,_0x4f5c74+0x2));_0x5adc22>=_0x8374e1[_0x25852f([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x5adc22-=_0x8374e1[_0x25852f([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x314f52+=_0x8374e1[_0x5adc22];}return _0x314f52;}function _0x105845(){const _0x3c6d3c=_0x3fc7e6[_0x25852f([0x73,0x70,0x6c,0x69,0x74])](_0x25852f([0x2e]));if(0x3!=_0x3c6d3c[_0x25852f([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x13b276(_0x3c6d3c[0x1]);function _0x13b276(_0x4e5895){const _0x3e02c3=_0x92bb42(_0x4e5895);return _0x3e02c3&&_0x2bffe2()?_0x3e02c3:null;function _0x2bffe2(){const _0x4b326a=_0x3e02c3[_0x25852f([0x6a,0x74,0x69])],_0x1d0314=window[_0x25852f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4b326a[_0x25852f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4b326a[_0x25852f([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x491dcf={..._0x3e02c3,[_0x25852f([0x6a,0x74,0x69])]:_0x4b326a[_0x25852f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x4b326a[_0x25852f([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x491dcf[_0x25852f([0x76,0x63])],_0x8dd95(_0x491dcf)==_0x1d0314;}}}async function _0xa42784(){let _0xd46e25=!0x0;try{const _0x1b46f0=_0x3fc7e6[_0x25852f([0x73,0x70,0x6c,0x69,0x74])](_0x25852f([0x2e])),[_0x5c3987,_0x27cf39,_0x3b5699]=_0x1b46f0;return _0x4b111d(_0x5c3987),await _0x2e5d48(_0x5c3987,_0x27cf39,_0x3b5699),_0xd46e25;}catch{return!0x1;}function _0x4b111d(_0xa7d6df){const _0x36dc97=_0x92bb42(_0xa7d6df);_0x36dc97&&_0x36dc97[_0x25852f([0x61,0x6c,0x67])]==_0x25852f([0x45,0x53,0x32,0x35,0x36])||(_0xd46e25=!0x1);}async function _0x2e5d48(_0x2efe27,_0x28ddd8,_0x2689e7){const _0x300828=window[_0x25852f([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x25852f([0x66,0x72,0x6f,0x6d])](_0x2eb53e(_0x2689e7),_0x41e00e=>_0x41e00e[_0x25852f([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x226957=new window[(_0x25852f([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x25852f([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x2efe27+_0x25852f([0x2e])+_0x28ddd8),_0x50bfdc=window[_0x25852f([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x25852f([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x50bfdc)return;const _0x5a5036=await _0x50bfdc[_0x25852f([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x25852f([0x6a,0x77,0x6b]),_0x40172f,{[_0x25852f([0x6e,0x61,0x6d,0x65])]:_0x25852f([0x45,0x43,0x44,0x53,0x41]),[_0x25852f([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x25852f([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x25852f([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x50bfdc[_0x25852f([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x25852f([0x6e,0x61,0x6d,0x65])]:_0x25852f([0x45,0x43,0x44,0x53,0x41]),[_0x25852f([0x68,0x61,0x73,0x68])]:{[_0x25852f([0x6e,0x61,0x6d,0x65])]:_0x25852f([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x5a5036,_0x300828,_0x226957)||(_0xd46e25=!0x1);}}function _0x92bb42(_0x335e00){return _0x335e00[_0x25852f([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x25852f([0x65,0x79]))?JSON[_0x25852f([0x70,0x61,0x72,0x73,0x65])](_0x2eb53e(_0x335e00)):null;}function _0x2eb53e(_0x4e1f4c){return window[_0x25852f([0x61,0x74,0x6f,0x62])](_0x4e1f4c[_0x25852f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x25852f([0x2b]))[_0x25852f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x25852f([0x2f])));}function _0x8dd95(_0x12bf9f){let _0xab3a2b=0x1505;function _0x56ce0c(_0x23b16b){for(let _0x490e9d=0x0;_0x490e9d<_0x23b16b[_0x25852f([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x490e9d++){const _0x41cc7b=_0x23b16b[_0x25852f([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x490e9d);_0xab3a2b=(_0xab3a2b<<0x5)+_0xab3a2b+_0x41cc7b,_0xab3a2b&=_0xab3a2b;}}function _0x284283(_0xadd7c6){Array[_0x25852f([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0xadd7c6)?_0xadd7c6[_0x25852f([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x284283):_0xadd7c6&&typeof _0xadd7c6==_0x25852f([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x25852f([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0xadd7c6)[_0x25852f([0x73,0x6f,0x72,0x74])]()[_0x25852f([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x1a9e3a,_0x1b5279])=>{_0x56ce0c(_0x1a9e3a),_0x284283(_0x1b5279);}):_0x56ce0c(window[_0x25852f([0x53,0x74,0x72,0x69,0x6e,0x67])](_0xadd7c6));}return _0x284283(_0x12bf9f),_0xab3a2b>>>0x0;}function _0x1d1d78(_0x4d3f30){return _0x4d3f30[_0x25852f([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x25852f([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x25852f([0x30]));}function _0x2611af(_0x2352a4){return _0x2352a4[_0x25852f([0x73,0x70,0x6c,0x69,0x74])]('')[_0x25852f([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x25852f([0x6a,0x6f,0x69,0x6e])]('');}function _0x38a87f(){}function _0x25852f(_0x13ef02){return _0x13ef02['map'](_0xa463df=>String['fromCharCode'](_0xa463df))['join']('');}_0x55e5c5(await _0x2bff96());}(this);}['showFakeVisualSelection'](){const _0x39bf09=this['editor']['model'];_0x39bf09['change'](_0x3e20fc=>{const _0x13fc22=_0x39bf09['document']['selection']['getRanges']();let _0xf6ef9f=0x0;for(const _0x11ed33 of _0x13fc22){const _0xa52fa3=O+':'+_0xf6ef9f;if(_0x39bf09['markers']['has'](_0xa52fa3))_0x3e20fc['updateMarker'](_0xa52fa3,{'range':_0x11ed33});else{if(_0x11ed33['start']['isAtEnd']){const _0x202179=_0x11ed33['start']['getLastMatchingPosition'](({item:_0x46bb96})=>!_0x39bf09['schema']['isContent'](_0x46bb96),{'boundaries':_0x11ed33});_0x3e20fc['addMarker'](_0xa52fa3,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3e20fc['createRange'](_0x202179,_0x11ed33['end'])});}else _0x3e20fc['addMarker'](_0xa52fa3,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x11ed33});}_0xf6ef9f++;}});}['hideFakeVisualSelection'](){const _0x11a213=this['editor']['model'],_0x4e048e=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](O));_0x4e048e['length']&&_0x11a213['change'](_0x420b17=>{_0x4e048e['forEach'](_0x183c9f=>{_0x420b17['removeMarker'](_0x183c9f);});});}['insertContent'](_0x4de936,_0x5d9349){const _0x4b3c33=this['_getAISelection'](),_0x59467a=_0x5d9349||_0x4b3c33['getFirstRange']();this['editor']['model']['canEditAt'](_0x59467a)&&this['editor']['model']['change'](_0x2699b7=>{this['hideFakeVisualSelection'](),_0x5d9349||this['_resetContentOfSelectedTableCells'](_0x2699b7,_0x4b3c33),this['_pasteHTMLUsingClipboard']({'insertAt':_0x59467a,'writer':_0x2699b7,'html':_0x4de936});});}['insertContentBelow'](_0x3f1715){const {model:_0x3cdc72}=this['editor'],_0x554317=this['_getAISelection']();_0x3cdc72['change'](()=>{const _0x572f85=this['_prepareTableInsertBelowPosition'](_0x3f1715,_0x554317)||this['_getDefaultInsertBelowPosition'](_0x554317);this['insertContent'](_0x3f1715,_0x572f85);});}['_getAISelection'](){const _0x966488=this['editor']['model'],_0x3af56a=Array['from'](_0x966488['markers']['getMarkersGroup'](O))['map'](_0x2d8ba5=>_0x2d8ba5['getRange']());return _0x966488['createSelection'](_0x3af56a);}['_pasteHTMLUsingClipboard']({writer:_0x56b9c1,html:_0x37d3e8,insertAt:_0x238cc0}){const {view:_0x1f878d}=this['editor']['editing'],_0x46a750=this['editor']['plugins']['get'](_0x18893b),_0x2d2172=new Hn();_0x2d2172['setData']('text/html',_0x37d3e8);const _0x380082=new ClipboardEvent('paste',{'clipboardData':_0x2d2172}),_0x2f5402=new _0x3ccb07(_0x1f878d,_0x380082,{'dataTransfer':new _0x13e34a(_0x2d2172)});_0x56b9c1['setSelection'](_0x238cc0);const _0x3d4456=(_0x1a8df6,_0x16ba08)=>{_0x16ba08['resultRange']&&_0x56b9c1['setSelection'](_0x16ba08['resultRange']);};_0x46a750['once']('contentInsertion',_0x3d4456,{'priority':'lowest'}),_0x1f878d['document']['fire']('paste',_0x2f5402),_0x46a750['off']('contentInsertion',_0x3d4456);}['_getDefaultInsertBelowPosition'](_0x278cdf){const {model:_0x88f456}=this['editor'],_0x282274=Array['from'](_0x278cdf['getSelectedBlocks']());return _0x282274['length']?_0x88f456['createPositionAfter'](_0x282274['pop']()):_0x278cdf['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x555f68,_0x1ff225){const {model:_0x33d470,plugins:_0x3d5109}=this['editor'];if(_0x3d5109['has']('TableUtils')){const _0x43594d=_0x3d5109['get']('TableUtils')['getSelectedTableCells'](_0x1ff225);if(_0x43594d['length']){const _0x170e05=this['_getTableRowCountFromContent'](_0x555f68),_0x3275bb=this['_createEmptyTableRows'](_0x43594d,_0x170e05);return _0x33d470['createPositionAt'](_0x3275bb,0x0);}}return null;}['_getTableRowCountFromContent'](_0x30c668){const _0x39e270=this['editor']['plugins']['get']('TableUtils'),_0x431e1a=this['editor']['data']['parse'](_0x30c668),_0x1082e7=Array['from'](_0x431e1a['getChildren']())['filter'](_0xba2517=>_0xba2517['is']('element','table'));let _0x562888=0x0;return _0x1082e7['forEach'](_0x3970ae=>{_0x562888+=_0x39e270['getRows'](_0x3970ae);}),_0x562888;}['_createEmptyTableRows'](_0x48f957,_0x53347f){const _0x31cefa=this['editor']['plugins']['get']('TableUtils'),_0x43eeae=_0x31cefa['getRowIndexes'](_0x48f957),_0x3cfe5b=_0x31cefa['getColumnIndexes'](_0x48f957),_0x5f4c9d=_0x43eeae['last']+0x1,_0x12201a=_0x3cfe5b['first'],_0x317a80=_0x48f957[0x0]['findAncestor']('table');for(let _0x11a885=0x0;_0x11a885<_0x53347f;_0x11a885++)_0x31cefa['insertRows'](_0x317a80,{'at':_0x5f4c9d});return _0x317a80['getChild'](_0x5f4c9d)['getChild'](_0x12201a);}['_resetContentOfSelectedTableCells'](_0x13ba9d,_0x1102ca){const {plugins:_0xed3f80}=this['editor'],{model:_0x48d135}=_0x13ba9d;if(!_0xed3f80['has']('TableUtils'))return;_0xed3f80['get']('TableUtils')['getSelectedTableCells'](_0x1102ca)['length']&&_0x48d135['deleteContent'](_0x1102ca);}}class H extends _0x24c1a8{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x4a8035('aiadapter-text-adapter-not-set',null);}}class tr extends Error{constructor(_0x35aa4a){super(_0x35aa4a),this['name']='AIRequestError';}}function Dn(_0x3826dc,_0x9e948a,_0x49b775){const t=_0x3826dc['t'];switch(_0x9e948a){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',_0x49b775);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x49b775);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'},_0x49b775);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 _0x9e948a;}}class q extends _0x417d51{['_commandDefinitions'];constructor(_0x40cdf3,_0x51d02c){super(_0x40cdf3),this['_commandDefinitions']=_0x51d02c,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0xc9838d,_0x3a3fd4,_0x2ab88d)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0x2ab88d));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x2e20e9,_0x329835,_0x55ea19)=>{this['enabledCommandsIds']=_0x55ea19?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x2d62e6=this['editor']['model'];this['_hasContext']=function(_0x4a933a){const _0x153ef1=_0x4a933a['document']['selection'];return _0x153ef1['isCollapsed']?0x0!==[..._0x153ef1['getSelectedBlocks']()]['length']&&![..._0x153ef1['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x4a933a['hasContent'](_0x153ef1['getFirstRange']());}(_0x2d62e6);const _0x179463=_0x2d62e6['document']['selection'],_0x2ec349=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x45da99 of _0x179463['getRanges']())for(const _0x4c4ded of _0x45da99['getItems']())if(_0x4c4ded['is']('element')&&_0x2ec349['includes'](_0x4c4ded['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x58f069='',_0x2ba966='',_0x251aa0='custom'){this['editor']['plugins']['get'](b)['showUI'](_0x58f069,_0x2ba966,_0x251aa0);}}function ns(_0x484af2,_0x337991){const _0x396d9d=new Set();for(const _0x46451a of _0x484af2['values']())(_0x337991||!0x1===_0x46451a['requiresContent'])&&_0x396d9d['add'](_0x46451a['id']);return Array['from'](_0x396d9d);}const hs=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class G extends/* #__PURE__ -- @preserve */
24
- _0x757adc(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x133914,_0x1dd021,_0x572a91){super(),this['editor']=_0x133914,this['textAdapter']=_0x1dd021,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x572a91,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x5b850f,_0x438e31,_0x44513d)=>{this['view']['value']=this['_sanitizeHTML'](_0x44513d);}),this['listenTo'](this['view'],'submitPrompt',(_0x53a858,_0x48fe86)=>{const _0x331656=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x48fe86,_0x331656,'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:_0x10a7f5,query:_0x9e1f94,htmlContent:_0x3cebea,label:_0x5f24d7,mainActionLabel:_0x36c772}){this['view']['prompt']=_0x5f24d7,this['view']['mainAction']=_0x36c772,this['initialContext']=_0x3cebea,_0x9e1f94&&(this['view']['isRendered']?this['_handleQuery'](_0x9e1f94,_0x3cebea,_0x10a7f5,_0x5f24d7):this['view']['once']('render',()=>{this['_handleQuery'](_0x9e1f94,_0x3cebea,_0x10a7f5,_0x5f24d7);}));}['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'](_0x461af3,_0x2127f9,_0x515ec4,_0x3cbbfa){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x2127f9,this['previousQuery']=_0x461af3,this['previousLabel']=_0x3cbbfa||_0x461af3,this['previousActionId']=_0x515ec4,new Promise(_0x313362=>{this['textAdapter']['makeRequest']({'query':_0x461af3,'context':_0x2127f9,'onData':_0x21cd6a=>{this['currentResponse']=_0x21cd6a,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x515ec4})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x3eac33=>{_0x3eac33 instanceof tr?this['view']['handleError'](_0x3eac33['message']):this['view']['handleError'](),_0x313362();})['finally'](()=>{this['stopProcessing'](),_0x313362();});});}['_parseAndNormalizeContent'](_0x2de031,_0x1d7cf8=!0x1){const _0x472ea5=hs['exec'](_0x2de031);_0x2de031=_0x472ea5?_0x2de031['substring'](_0x472ea5[0x1]['length']):_0x2de031['length']<0x64&&!_0x1d7cf8?'':this['_stripMarkdownSyntax'](_0x2de031);const _0x538c2f=this['_domParser']['parseFromString'](_0x2de031,'text/html');if(_0x472ea5){const _0x5cab4e=Array['from'](_0x538c2f['body']['childNodes']);_0x5cab4e['reverse']();for(const _0x2fce85 of _0x5cab4e){if(_0x2fce85['nodeType']==Node['ELEMENT_NODE'])break;_0x2fce85['remove']();}}const _0x3e1ada=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x538c2f['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x3e1ada);const _0x21b199=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x27d707=this['editor']['data']['toModel'](_0x3e1ada);return _0x21b199||_0x27d707['markers']['clear'](),this['editor']['data']['stringify'](_0x27d707);}['_normalizeResponseHeadings'](_0x1af7b6){const _0x53345a=new _0x537982(this['editor']['editing']['view']['document']),_0x419242=new _0x1e2464({'name':/^h[1-5]$/}),_0x1bc958=[];let _0xe7f1ab=!0x1;for(const _0x46c247 of _0x1af7b6)_0x46c247['is']('element')&&_0x419242['match'](_0x46c247)&&(_0x1bc958['push'](_0x46c247),'h1'==_0x46c247['name']&&(_0xe7f1ab=!0x0));if(_0xe7f1ab){for(const _0x18c210 of _0x1bc958)_0x53345a['rename']('h'+(parseInt(_0x18c210['name'][0x1])+0x1),_0x18c210);}}['_isH1TagSupportEnabled'](){const {data:_0x40d1aa,editing:_0x5065f7}=this['editor'],_0x24952d=_0x40d1aa['htmlProcessor']['toView']('<h1></h1>'),_0x2b35c1=_0x40d1aa['toView'](_0x40d1aa['toModel'](_0x24952d));return!!_0x5065f7['view']['domConverter']['viewToDom'](_0x2b35c1)['querySelector']('h1');}['_sanitizeHTML'](_0x2a6e55){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x2a6e55),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x5bb61f){const _0x56b86a=_0x5bb61f['trim']();return _0x56b86a['startsWith']('```html')?_0x56b86a['endsWith']('```')?_0x56b86a['substring'](0x7,_0x56b86a['length']-0x3):_0x56b86a['substring'](0x7):_0x5bb61f;}}const R={'REPLACE':'replace','INSERT':'insert'};class dr extends _0x24bea5{constructor(_0xd4603e){super(_0xd4603e),this['set']('isVisible',!0x1),this['set']('mainAction',R['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x35559b=>Dn(_0xd4603e,'AI_'+_0x35559b['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Dn(_0xd4603e,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Dn(_0xd4603e,'Try\x20again')),this['stopButton']=this['_createButton'](Dn(_0xd4603e,'Stop'));const _0x1c7d83=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x1c7d83['if']('isVisible','ck-hidden',_0x3f191e=>!_0x3f191e)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x21aa6a,_0x50e123){const _0x229bbd=new _0x155a80(this['locale']);return _0x229bbd['set']({'label':_0x21aa6a,'class':_0x50e123||'','isVisible':!0x0,'withText':!0x0}),_0x229bbd;}}class fr extends _0x7ecbb5{['contentFieldView'];['copyButtonView'];constructor(_0xa5783f,_0x33ab0f=''){super(_0xa5783f),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x4c192f=this['bindTemplate'];this['contentFieldView']=new Mn(_0xa5783f,_0x33ab0f),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x4c192f['if']('isVisible','ck-hidden',_0x2cd164=>!_0x2cd164)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x4c192f['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 _0x3ce5e1=!0x1;this['on']('change:value',(_0x57f62a,_0x3f641e,_0xb1c0f1)=>{const _0x4963da=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0xb1c0f1),this['isProcessing']&&_0x4963da&&!_0x3ce5e1&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x136267,_0x2ddbb1,_0x4b55cf)=>{_0x3ce5e1=!0x1,_0x4b55cf?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x3ce5e1=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x3ce5e1=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x5e390c=this['locale'],_0x800ae8=new _0x155a80(this['locale']),_0x3a7333='ck-ai-form__copy-button';return _0x800ae8['set']({'label':Dn(_0x5e390c,'Copy'),'icon':_0x5e314f,'class':_0x3a7333,'tooltip':!0x0}),_0x800ae8['bind']('isVisible')['to'](this,'value',_0x38c303=>!!_0x38c303),_0x800ae8['bind']('isEnabled')['to'](this,'isProcessing',_0x3d5e90=>!_0x3d5e90),_0x800ae8['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x800ae8['icon']=_0x564196,_0x800ae8['class']=_0x3a7333+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x800ae8['icon']=_0x5e314f,_0x800ae8['class']=_0x3a7333;},0x3e8);}),_0x800ae8;}['_copyHTMLToClipboard'](_0xa49083){const {window:_0x10d97b,document:_0x2a8d58}=_0x3125c6;if(_0x10d97b['ClipboardItem']){const {Blob:_0x10ae9a,ClipboardItem:_0x13b52a}=_0x10d97b,_0x208248=[new _0x13b52a({'text/html':new _0x10ae9a([_0xa49083['innerHTML']],{'type':'text/html'}),'text/plain':new _0x10ae9a([_0xa49083['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x208248);}else{const _0x17cc93=_0x2a8d58['createElement']('div');_0x17cc93['style']['position']='absolute',_0x17cc93['style']['left']='-9999px',_0x17cc93['innerHTML']='<span>[</span>'+_0xa49083['innerHTML']+'<span>]</span>',_0x2a8d58['body']['appendChild'](_0x17cc93);const _0x2a81c0=_0x2a8d58['createRange']();_0x2a81c0['setStartAfter'](_0x17cc93['firstElementChild']),_0x2a81c0['setEndBefore'](_0x17cc93['lastElementChild']);const _0x23fb70=_0x10d97b['getSelection']();_0x23fb70['removeAllRanges'](),_0x23fb70['addRange'](_0x2a81c0),_0x2a8d58['execCommand']('copy'),_0x17cc93['remove']();}}}class Mn extends _0x7ecbb5{constructor(_0x1ff6ef,_0x5a66be=''){super(_0x1ff6ef),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x5a66be,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x45f2c3){this['element']['innerHTML']=_0x45f2c3;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x4a5e47=new _0x7ecbb5(),_0x35a5e1=this['locale'],_0x3ef103=new _0x4412dd();return _0x3ef103['isVisible']=!0x0,_0x4a5e47['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x3ef103,{'text':Dn(_0x35a5e1,'AI\x20is\x20writing...')}]}),_0x4a5e47['render'](),_0x4a5e47;}}class br extends _0x7ecbb5{constructor(_0x298c32,_0x6785=''){super(_0x298c32);const _0x4fcc1a=new _0x29aaa9(),_0x245acb=this['bindTemplate'];this['set']('text',_0x6785),_0x4fcc1a['content']=_0x500579,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x4fcc1a,{'text':_0x245acb['to']('text')}]});}}class wr extends _0x351fe1{['submitButtonView'];['showHistoryButtonView'];constructor(_0x36138a,_0x1859fc){super(_0x36138a,_0x1859fc),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',(_0x4c6569,_0xdad9b0)=>{_0x4c6569['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0xdad9b0());});}['_createSubmitButton'](){const _0x3f3769=new _0x155a80(this['locale']),_0x2a82e0=this['locale'];return _0x3f3769['set']({'icon':_0x1e3ea1,'label':Dn(_0x2a82e0,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x3f3769['on']('execute',()=>{this['submit']();}),_0x3f3769['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x51518b,_0x30e0e5)=>!_0x51518b&&_0x30e0e5),_0x3f3769;}['_createShowHistoryButton'](){const _0x362d4e=new _0x155a80(this['locale']),_0x2408eb=this['resultsView'],_0x4e0b65=this['locale'];_0x362d4e['set']({'label':Dn(_0x4e0b65,'History'),'withText':!0x1,'icon':ot,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x362d4e['bind']('isOn')['to'](_0x2408eb,'isVisible'),_0x362d4e['bind']('isEnabled')['to'](this,'isEnabled'),_0x362d4e['on']('execute',()=>{_0x2408eb['isVisible']=!_0x2408eb['isVisible'],_0x2408eb['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x1edbe8=()=>{_0x3125c6['window']['requestAnimationFrame'](()=>{if(_0x346d68(this['element'])){const _0x1187e9=new _0x5198ab(this['queryView']['fieldView']['element']),_0x20133f=_0x1187e9['width'],_0x4e767b='rtl'===_0x4e0b65['uiLanguageDirection']?'left':'right';_0x1187e9['excludeScrollbarsAndBorders'](),_0x362d4e['element']['style'][_0x4e767b]=_0x20133f-_0x1187e9['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x1edbe8),this['on']('render',_0x1edbe8),_0x362d4e;}['submit'](){const _0x24ab1c=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x24ab1c);}['focus'](_0x3401a3){-0x1===_0x3401a3?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class yr extends _0x5c4336{['historyGroupView'];['clearHistoryButton'];constructor(_0x3fb10c){super(_0x3fb10c),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x46b328(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Dn(_0x3fb10c,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x381ed3=0x0;for(const _0x555c71 of this['items'])_0x381ed3+=_0x555c71['items']['length'];return{'resultsCount':_0x381ed3,'totalItemsCount':_0x381ed3};}['_createClearHistoryButton'](){const _0x578833=this['locale'],_0x35eda7=new _0x155a80(this['locale']);return _0x35eda7['set']({'label':'('+Dn(_0x578833,'Clear')+')','withText':!0x0}),_0x35eda7['on']('execute',()=>this['fire']('clearHistory')),_0x35eda7;}}class gr extends _0x7baab6{constructor(_0xdae040){super();const _0x505b59=new _0x46d8c3(),_0x395749=new _0x155a80(this['locale'],_0x505b59);this['children']['add'](_0x395749),_0x395749['set']({'label':_0xdae040['prompt'],'withText':!0x0}),_0x395749['on']('execute',()=>{this['fire']('execute',{'value':_0x476de9(_0xdae040['prompt'])});});}}const ro='CKEditor/AIFormView/PromptHistory';class kr extends _0x4041f8{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x18546e,_0x249090)=>{const _0x87c5b7=no(_0x249090['prompt']);for(const _0x19ae85 of this)if(_0x19ae85!=_0x249090&&no(_0x19ae85['prompt'])===_0x87c5b7){this['remove'](_0x19ae85);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x484ec6=sessionStorage['getItem'](ro)||'[]';this['addMany'](JSON['parse'](_0x484ec6));}['_saveToSessionStorage'](){sessionStorage['setItem'](ro,JSON['stringify'](this['map'](_0x11db5f=>_0x11db5f)));}}function no(_0x1167dc){return _0x1167dc['toLowerCase']()['trim']();}class z extends _0x7ecbb5{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x282126,_0x596749,_0x523a19=''){super(_0x282126),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',R['REPLACE']),this['_promptHistory']=new kr(),this['errorView']=new br(_0x282126),this['contentArea']=new fr(_0x282126,_0x523a19),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 _0x30a616(),this['keystrokes']=new _0xf37da3(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x5883a2({'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 _0x51cda3=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x596749],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x51cda3['if']('isError','ck-hidden',_0x306037=>!_0x306037)]},'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'](_0x241647=0x1){-0x1===_0x241647?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 _0x3928ec=this['locale'],_0x704214=new wr(_0x3928ec,{'queryView':{'label':Dn(_0x3928ec,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x39bf80,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Dn(_0x3928ec,'Empty\x20history'),'secondary':Dn(_0x3928ec,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x704214['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x26f5ef,_0x248d73)=>_0x26f5ef&&!_0x248d73),this['listenTo'](_0x704214,'submit',(_0x1f3ab8,_0x546d36)=>{this['prompt']=_0x546d36;const _0x47eaca=_0x3dcf64(_0x546d36);this['fire']('submitPrompt',_0x47eaca),_0x546d36['trim']()&&this['_promptHistory']['add']({'prompt':_0x47eaca},0x0);},{'priority':'high'}),_0x704214;}['_createHistoryView'](){const _0x3d9306=new yr(this['locale']);return _0x3d9306['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](gr),_0x3d9306['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x3d9306;}['_createToolbar'](){const _0x3a2a26=new dr(this['locale']);return _0x3a2a26['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xd5675b,_0xa69f4a,_0x4ab146)=>_0xd5675b&&!_0xa69f4a&&!!_0x4ab146),_0x3a2a26['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x3a2a26['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x2d6853,_0x31be32,_0x232e0e)=>_0x2d6853&&!_0x31be32&&!!_0x232e0e),_0x3a2a26['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x3a2a26['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x432542,_0x3fe6f0)=>_0x432542&&!_0x3fe6f0),_0x3a2a26['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x3a2a26['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x3a2a26['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x3a2a26;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x316b9a=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Dn(_0x316b9a,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x32b9fb){const _0x2599c1=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x32b9fb||Dn(_0x2599c1,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const D=globalThis['DataTransfer'];class b extends _0x24c1a8{['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[_0x5efa5e,v,H,_0x12fc7f];}constructor(_0x1e1cf5){super(_0x1e1cf5),_0x1e1cf5['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x1e1cf5['config']['define']('ai.assistant.contentAreaCssClass',''),_0x1e1cf5['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x1e1cf5['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x13a334}=this;this['_aiAdapter']=_0x13a334['plugins']['get'](H),this['_dialog']=_0x13a334['plugins']['get'](_0x12fc7f),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x2d2d97=new q(_0x13a334,Array['from'](this['_commandDefinitions']['values']()));_0x13a334['commands']['add']('showAIAssistant',_0x2d2d97),_0x13a334['ui']['componentFactory']['add']('aiCommands',_0x15c032=>{const _0x43b602=_0x30b0b5(_0x15c032);return _0x43b602['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x43b602['buttonView']['set']({'label':Dn(_0x15c032,'AI\x20Commands'),'icon':_0x7e4bf6,'tooltip':!0x0}),_0x43b602['on']('execute',_0x5623bd=>this['_onExecute'](_0x5623bd['source']['id'])),_0x1c5f66(_0x43b602,_0x13a334['ui']['view']['body'],function(_0x2416d9){const _0x20b67a=I(_0x2416d9['config']['get']('ai.assistant.commands'),_0x2416d9['locale']),_0x5bc7d7=Q(_0x2416d9,_0x20b67a)['filter'](_0xa972ee=>_0xa972ee['commands']['length']);if(0x1===_0x5bc7d7['length'])return Q(_0x2416d9,_0x5bc7d7[0x0]['commands'])['map'](_0x4d820b=>({'id':_0x4d820b['id'],'label':_0x4d820b['label']}));return _0x5bc7d7['map'](_0x88f15c=>{const {groupId:_0x5cee31,groupLabel:_0x2f5447,commands:_0x5cb699}=_0x88f15c,_0x2df472=Q(_0x2416d9,_0x5cb699)['map'](_0x3a1c27=>({'id':_0x3a1c27['id'],'label':_0x3a1c27['label']}));return{'id':_0x5cee31,'menu':_0x2f5447||_0x5cee31,'children':_0x2df472};});}(_0x13a334),{'ariaLabel':Dn(_0x15c032,'AI\x20Commands')}),_0x43b602['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x2d2d97['on']('change:enabledCommandsIds',_0x47a406),_0x43b602['menuView']['once']('render',_0x47a406),_0x43b602;function _0x47a406(){_0x43b602['isEnabled']=_0x2d2d97['enabledCommandsIds']['length']>0x0;for(const _0x5e5b49 of _0x43b602['menuView']['buttons'])_0x5e5b49['isEnabled']=_0x2d2d97['enabledCommandsIds']['includes'](_0x5e5b49['id']);}}),_0x13a334['ui']['componentFactory']['add']('menuBar:aiCommands',_0x53f981=>{const _0x56e0c8=new _0x173368(_0x53f981);_0x56e0c8['buttonView']['set']({'label':Dn(_0x53f981,'AI\x20Commands'),'icon':_0x7e4bf6}),_0x56e0c8['bind']('isEnabled')['to'](_0x2d2d97,'enabledCommandsIds',_0x55f404=>_0x55f404['length']>0x0);const _0x224902=I(_0x13a334['config']['get']('ai.assistant.commands'),_0x53f981);return this['_populateMenuBarMenu'](_0x2d2d97,_0x56e0c8,_0x224902,_0x203122=>this['_onExecute'](_0x203122)),_0x56e0c8;}),_0x13a334['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x5880f7=this['_createAIAssistantUIButton'](_0x155a80);return _0x5880f7['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x5880f7;}),_0x13a334['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x2c74c0=this['_createAIAssistantUIButton'](_0x4ee929);return _0x2c74c0['set']({'role':'menuitemcheckbox'}),_0x2c74c0;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x7cafd7=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x3341bc;for(const _0x5bdc7c in _0x7cafd7){const _0x311391=_0x5bdc7c,_0x3b0432=_0x7cafd7[_0x311391];if('aiLicenseKeyValid'==_0x3b0432||'aiLicenseKeyInvalid'==_0x3b0432||'aiLicenseKeyExpired'==_0x3b0432||'aiLicenseKeyDomainLimit'==_0x3b0432||'aiLicenseKeyNotAllowed'==_0x3b0432||'aiLicenseKeyEvaluationLimit'==_0x3b0432||'aiLicenseKeyTrialLimit'==_0x3b0432||'aiLicenseKeyUsageLimit'==_0x3b0432){delete _0x7cafd7[_0x311391],_0x3341bc=_0x3b0432,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x3341bc&&_0x7cafd7['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x3341bc&&_0x7cafd7['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x3341bc&&_0x7cafd7['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x3341bc&&_0x7cafd7['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x3341bc&&_0x7cafd7['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x3341bc&&_0x7cafd7['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x3341bc&&_0x7cafd7['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x377e32='',_0x4f750b='',_0x257ba7='custom'){const _0x2ce2f8=this['editor'],_0x178725=_0x2ce2f8['editing']['view'],_0x4ec244=_0x2ce2f8['plugins']['get'](v),_0x5c9ab1=_0x2ce2f8['plugins']['get'](_0x5efa5e);_0x4ec244['showFakeVisualSelection']();const _0x20d2ed=new D(),_0x3aca7b=new ClipboardEvent('copy',{'clipboardData':_0x20d2ed}),_0x33a1c3=new _0x13e34a(_0x20d2ed),_0x4c48c9=new _0x3ccb07(_0x178725,_0x3aca7b,{'dataTransfer':_0x33a1c3});_0x5c9ab1['_forceMarkersCopy']('comment',()=>{_0x178725['document']['fire']('copy',_0x4c48c9);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new G(_0x2ce2f8,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x41cd23=_0x33a1c3['getData']('text/html');const _0x151658=_0x2ce2f8['model']['document']['selection'],_0x1753c2=Array['from'](_0x151658['getRanges']());0x1===_0x1753c2['length']&&_0x1753c2[0x0]['isFlat']&&!_0x151658['getSelectedElement']()&&''!==_0x41cd23['replace'](/&nbsp;/g,'')['trim']()&&(_0x41cd23='<p>'+_0x41cd23+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x257ba7,'query':_0x377e32,'htmlContent':_0x41cd23,'label':_0x4f750b,'mainActionLabel':R[_0x2ce2f8['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x535c35,'title':Dn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x7f28e6['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x4ec244['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x238cb8=new Map(),_0x39634c=I(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x2f03e0 of _0x39634c)for(const _0x2d95f6 of _0x2f03e0['commands'])_0x238cb8['set'](_0x2d95f6['id'],{..._0x2d95f6,'groupId':_0x2f03e0['groupId'],'groupLabel':_0x2f03e0['groupLabel']||_0x2f03e0['groupId']});return _0x238cb8;}['_createAIAssistantUIButton'](_0x47b67d){const _0x4aad43=this['editor'],_0x518c6c=_0x4aad43['commands']['get']('showAIAssistant'),_0x32b053=new _0x47b67d(_0x4aad43['locale']);return _0x32b053['set']({'label':Dn(_0x4aad43['locale'],'AI\x20Assistant'),'icon':_0x535c35,'isToggleable':!0x0}),_0x32b053['bind']('isEnabled')['to'](_0x518c6c),_0x32b053['bind']('isOn')['to'](this['_dialog'],'id',_0x49cd5c=>'aiAssistant'===_0x49cd5c),this['listenTo'](_0x32b053,'execute',()=>{_0x32b053['isOn']?this['hideUI']():_0x518c6c['execute']();}),_0x32b053;}['_initView'](){const _0x3f9211=this['editor']['plugins']['get'](v);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',()=>{_0x3f9211['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x3f9211['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x1ea72e,ui:{ariaLiveAnnouncer:_0x47db9b}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x1dc85e,_0x2753be,_0x471a70)=>{const _0xee2373=this['_aiAssistantController']['currentContext'];_0x471a70?_0x47db9b['announce'](Dn(_0x1ea72e,'AI\x20is\x20writing')):_0xee2373&&_0x47db9b['announce'](Dn(_0x1ea72e,'Generated\x20content:\x20%0',_0xee2373),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x3325a6,_0x44303f,_0x48ec79)=>{if(_0x48ec79){const _0x1b1092=this['_formView']['errorView']['text'];_0x47db9b['announce'](Dn(_0x1ea72e,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x1b1092));}});}['_onExecute'](_0x483043){const _0x45d175=this['_commandDefinitions']['get'](_0x483043),_0x43eaa5=this['editor'],_0x2346db=_0x43eaa5['model']['document']['selection'],_0xe510e8=_0x43eaa5['commands']['get']('showAIAssistant'),_0x357879=_0x43eaa5['plugins']['get'](v),_0x5793ba=''+(_0x45d175['groupId']!==P?_0x45d175['groupLabel']+':\x20':'')+_0x45d175['label'];if(!0x1!==_0x45d175['requiresContent']&&_0x2346db['isCollapsed']){const _0x5965bd=_0x3d8d09(_0x2346db['getSelectedBlocks']())||_0x43eaa5['model']['schema']['getLimitElement'](_0x2346db);_0x43eaa5['model']['change'](_0x32bf79=>{_0x32bf79['setSelection'](_0x5965bd,'in');});}_0x357879['showFakeVisualSelection'](),_0xe510e8['execute'](_0x45d175['prompt'],_0x5793ba,'command:'+_0x483043);}['_populateMenuBarMenu'](_0x5bf628,_0x1f9519,_0x148567,_0x1dead4){const _0x40d1ea=this['editor'],_0x5a8907=_0x40d1ea['locale'],_0x2629d3=new _0x4593bb(_0x5a8907),_0x56c481=Q(_0x40d1ea,_0x148567)['filter'](_0x58a04d=>_0x58a04d['commands']['length']);0x1===_0x56c481['length']?this['_getMenuBarGroupButtons']({'command':_0x5bf628,'commands':_0x56c481[0x0]['commands'],'parentMenuView':_0x1f9519,'onExecute':_0x1dead4})['forEach'](_0x753fc1=>_0x2629d3['items']['add'](_0x753fc1)):_0x56c481['forEach'](({groupId:_0x4f5117,groupLabel:_0x507cd7,commands:_0x3b3d72})=>{const _0x4a5170=new _0x45fd40(_0x5a8907,_0x1f9519),_0x2d4e18=new _0x173368(_0x5a8907),_0x263162=new _0x4593bb(_0x5a8907),_0x59b9dc=this['_getMenuBarGroupButtons']({'command':_0x5bf628,'commands':_0x3b3d72,'parentMenuView':_0x2d4e18,'onExecute':_0x1dead4});_0x2d4e18['buttonView']['set']({'label':_0x507cd7||_0x4f5117}),_0x2d4e18['delegate']('execute')['to'](_0x1f9519),_0x263162['items']['addMany'](_0x59b9dc),_0x2d4e18['panelView']['children']['add'](_0x263162),_0x4a5170['children']['add'](_0x2d4e18),_0x2629d3['items']['add'](_0x4a5170);}),_0x1f9519['panelView']['children']['add'](_0x2629d3);}['_getMenuBarGroupButtons']({command:_0x50d4ca,commands:_0x5cbbd6,parentMenuView:_0x5bf6be,onExecute:_0x41e7d5}){const _0x5c33ae=this['editor'],_0x205b3e=_0x5c33ae['locale'];return Q(_0x5c33ae,_0x5cbbd6)['map'](_0x2fcf85=>{const _0x264791=new _0x45fd40(_0x205b3e,_0x5bf6be),_0x2394f4=new _0x4ee929(_0x205b3e);return _0x2394f4['set']({'label':_0x2fcf85['label']}),_0x2394f4['delegate']('execute')['to'](_0x5bf6be),_0x2394f4['on']('execute',()=>_0x41e7d5(_0x2fcf85['id'])),_0x2394f4['bind']('isEnabled')['to'](_0x50d4ca,'enabledCommandsIds',_0x56693f=>_0x56693f['includes'](_0x2fcf85['id'])),_0x264791['children']['add'](_0x2394f4),_0x264791;});}}function J(_0x38d25a,_0x59dfcc){return void 0x0!==_0x38d25a['order']&&void 0x0===_0x59dfcc['order']?0x1:void 0x0===_0x38d25a['order']&&void 0x0!==_0x59dfcc['order']?-0x1:void 0x0!==_0x38d25a['order']&&void 0x0!==_0x59dfcc['order']?_0x38d25a['order']-_0x59dfcc['order']:0x0;}function Q(_0x540425,_0x1e414b){_0x1e414b['sort'](J);const _0x45a9ef={},_0x1d1e5b=[];for(const _0x53b6cc of _0x1e414b)if(void 0x0!==_0x53b6cc['order']){if(_0x53b6cc['order']in _0x45a9ef)throw new _0x4a8035('ai-commands-config-order-collision',_0x540425,{'conflictingDefinitions':[_0x53b6cc,_0x45a9ef[_0x53b6cc['order']]]});_0x45a9ef[_0x53b6cc['order']]=_0x53b6cc,_0x1d1e5b['splice'](_0x53b6cc['order'],0x0,_0x53b6cc);}else _0x1d1e5b['push'](_0x53b6cc);return _0x1d1e5b;}class Un extends _0x24c1a8{static get['requires'](){return[b,v];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x46cf41){super(_0x46cf41);const _0x5055c1=_0x46cf41['config'],_0x2ff433=_0x46cf41['locale'];_0x5055c1['define']('ai.assistant.preserveComments',!0x0),_0x5055c1['define']('ai.assistant.commands',Gn(_0x2ff433)),_0x5055c1['define']('ai.assistant.extraCommandGroups',[]),_0x5055c1['define']('ai.assistant.removeCommands',[]);let _0x301ac4=I(_0x5055c1['get']('ai.assistant.commands'),_0x2ff433);const _0x159b27=_0x5055c1['get']('ai.assistant.extraCommandGroups'),_0x3fc553=_0x5055c1['get']('ai.assistant.removeCommands');_0x159b27['forEach'](_0x5e4073=>{const _0xd245d4=_0x301ac4['find'](_0x50e550=>_0x50e550['groupId']===_0x5e4073['groupId']);_0xd245d4?_0xd245d4['commands']=_0xd245d4['commands']['concat'](_0x5e4073['commands']):_0x301ac4['push'](_0x5e4073);}),_0x301ac4=_0x301ac4['filter'](_0x287951=>!_0x3fc553['includes'](_0x287951['groupId'])),_0x301ac4['forEach'](_0x1608ae=>{_0x1608ae['commands']=_0x1608ae['commands']['filter'](_0x4f3ed0=>!_0x3fc553['includes'](_0x4f3ed0['id']));}),_0x5055c1['set']('ai.assistant.commands',_0x301ac4);}}function Gn(_0x57dc93){return[{'groupId':'editOrReview','groupLabel':Dn(_0x57dc93,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Dn(_0x57dc93,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Dn(_0x57dc93,'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':Dn(_0x57dc93,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Dn(_0x57dc93,'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':Dn(_0x57dc93,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Dn(_0x57dc93,'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':Dn(_0x57dc93,'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':Dn(_0x57dc93,'Change\x20tone'),'commands':[{'id':'professional','label':Dn(_0x57dc93,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Dn(_0x57dc93,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Dn(_0x57dc93,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Dn(_0x57dc93,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Dn(_0x57dc93,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Dn(_0x57dc93,'Change\x20style'),'commands':[{'id':'business','label':Dn(_0x57dc93,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Dn(_0x57dc93,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Dn(_0x57dc93,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Dn(_0x57dc93,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Dn(_0x57dc93,'Translate'),'commands':[{'id':'translateEnglish','label':Dn(_0x57dc93,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Dn(_0x57dc93,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Dn(_0x57dc93,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Dn(_0x57dc93,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Dn(_0x57dc93,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Dn(_0x57dc93,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Dn(_0x57dc93,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Dn(_0x57dc93,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ae extends _0x24c1a8{['abortController'];static get['requires'](){return[H];}constructor(_0x3630d9){super(_0x3630d9),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](H)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x39f822){return this['sendRequest'](_0x39f822)['catch'](_0x463565=>{if(_0x463565 instanceof tr)return Promise['reject'](_0x463565);if('AbortError'==_0x463565['name'])return Promise['resolve']();throw console['error'](_0x463565),new _0x4a8035('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x3fc339,_0xca805a){const _0x2b0714=this['editor']['locale'],_0x1c7a6b={'Content-Type':'application/json'};if('object'==typeof _0x3fc339)Object['assign'](_0x1c7a6b,_0x3fc339);else{if(_0x3fc339)try{const _0x5d6e5d=await _0x3fc339(_0xca805a);Object['assign'](_0x1c7a6b,_0x5d6e5d);}catch{return Promise['reject'](new tr(Dn(_0x2b0714,'AI_ERROR_GET_HEADERS')));}}return _0x1c7a6b;}async['_prepareRequestParameters'](_0x295e82,_0x41036e){const _0x5a6a20=this['editor']['locale'];if('object'==typeof _0x295e82)return _0x295e82;try{return await _0x295e82(_0x41036e);}catch{return Promise['reject'](new tr(Dn(_0x5a6a20,'AI_ERROR_GET_PARAMETERS')));}}}class Vn extends ae{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x3b99bf){super(_0x3b99bf),_0x3b99bf['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x3b99bf['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x3b99bf['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x3b99bf['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x3b99bf['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x3b99bf['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0xaee7a6,context:_0x466918,onData:_0x3e9201,actionId:_0x1033b5}){const _0x3c7a71=this['editor']['locale'],_0x5b3bad=await this['prepareMessages'](_0xaee7a6,_0x466918,_0x1033b5),_0x56cf50=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x1033b5),_0x2155b4=await this['_prepareRequestParameters'](this['_requestParameters'],_0x1033b5),_0x43b51a={'messages':_0x5b3bad,..._0x2155b4},_0x19d431={'method':'POST','headers':_0x56cf50,'body':JSON['stringify'](_0x43b51a),'signal':this['abortController']['signal']},_0x21f8a6=await fetch(this['_apiUrl'],_0x19d431);if(_0x21f8a6['ok'])return _0x2155b4['stream']?await this['_readStreamableResponse'](_0x21f8a6,_0x3e9201):await this['_readStaticResponse'](_0x21f8a6,_0x3e9201),Promise['resolve']();{const _0xfa094b=await _0x21f8a6['text']();return _0xfa094b['includes']('context_length_exceeded')?Promise['reject'](new tr(Dn(_0x3c7a71,'AI_ERROR_CONTEXT_LENGTH'))):_0xfa094b['includes']('Moderation')?Promise['reject'](new tr(Dn(_0x3c7a71,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0xfa094b));}}async['prepareMessages'](_0x192ee7,_0x4c50c5,_0x1b9dbf){let _0x17be5c,_0x132bf3;return _0x4c50c5?(_0x17be5c='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.',_0x132bf3='Instruction:\x0a'+_0x192ee7+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x4c50c5):(_0x17be5c='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.',_0x132bf3=_0x192ee7),[{'role':'system','content':_0x17be5c},{'role':'user','content':_0x132bf3}];}async['_readStreamableResponse'](_0x31bb89,_0x241493){const _0x3f2d12=_0x31bb89['body']['getReader'](),_0x527b40=new TextDecoder();let _0x1f6380='',_0x2e57e2='',_0x532b79='',_0x3804b2=!0x1;for(;!_0x3804b2;){const {done:_0x107ddd,value:_0x45a87a}=await _0x3f2d12['read'](),_0x3c6976=_0x1f6380+_0x527b40['decode'](_0x45a87a);let _0x54b461='';_0x3804b2=_0x107ddd;try{_0x54b461=this['_cleanUpData'](_0x3c6976),_0x1f6380='';}catch{_0x1f6380=_0x3c6976;continue;}_0x2e57e2+=_0x54b461,!_0x3804b2&&this['_isBufferIncomplete'](_0x2e57e2)||_0x2e57e2&&(_0x532b79+=_0x2e57e2,_0x2e57e2='',_0x241493(_0x532b79));}return Promise['resolve']();}async['_readStaticResponse'](_0x257625,_0x3848c9){return _0x3848c9((await _0x257625['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x5bb150){const _0x1ee875=_0x5bb150['split']('<')['length']!==_0x5bb150['split']('>')['length'],_0x161b95=_0x5bb150['length']<0x1e;return _0x1ee875&&_0x161b95;}['_cleanUpData'](_0x2a3e78){return _0x2a3e78['split'](/\n(?![^{]*\})/g)['map'](_0x476fb7=>_0x476fb7['replace']('data:\x20',''))['filter'](_0x2a0128=>_0x2a0128&&_0x2a0128['length']>0x0&&'[DONE]'!==_0x2a0128)['map'](_0x4b4070=>{const {choices:_0x3f6ce8}=JSON['parse'](_0x4b4070);if(_0x3f6ce8[0x0]?.['delta']?.['content'])return _0x3f6ce8[0x0]['delta']['content'];})['filter'](_0x36a854=>_0x36a854)['join']('');}}class Bn extends ae{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x54ad44){super(_0x54ad44),_0x54ad44['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x54ad44['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']=_0x54ad44['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x54ad44['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x54ad44['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x54ad44['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x32b513,context:_0xdc5005,onData:_0x5d5394,actionId:_0x127635}){const {model:_0x2a6006,stream:_0x131497,..._0x5cea4f}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x127635),_0x2f0d2b={'prompt':await this['preparePrompt'](_0x32b513,_0xdc5005,_0x2a6006,_0x127635),..._0x5cea4f};this['_apiUrl']?await this['_processProxyRequest'](_0x2f0d2b,_0x2a6006,_0x131497,_0x5d5394,_0x127635):await this['_processAWSRequest'](_0x2f0d2b,_0x2a6006,_0x131497,_0x5d5394);}async['preparePrompt'](_0x279776,_0x526388,_0xef2c79,_0x1c999a){let _0x1169f1,_0x1d6474;return _0x526388?(_0x1169f1='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.',_0x1d6474='Instruction:\x0a'+_0x279776+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x526388):(_0x1169f1='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.',_0x1d6474=_0x279776),'meta.llama'==this['getModelFamily'](_0xef2c79)?'<<SYS>>\x0a'+_0x1169f1+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x1d6474+'\x0a[/INST]':'Human:\x0a'+_0x1169f1+'\x0a'+_0x1d6474+'\x0a\x0aAssistant:';}['getModelFamily'](_0x437298){if(/^anthropic\.claude/['test'](_0x437298))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x437298))return'ai21.j2';if(/^cohere\.command/['test'](_0x437298))return'cohere.command';if(/^meta\.llama/['test'](_0x437298))return'meta.llama';throw new tr(Dn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x437298));}async['_processProxyRequest'](_0x56cbac,_0x3cb118,_0x3794b8,_0x101be7,_0x3a26f1){const _0x450f4b={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3a26f1),'body':JSON['stringify']({..._0x56cbac,'model':_0x3cb118,'stream':_0x3794b8}),'signal':this['abortController']['signal']},_0x2d7ebb=await fetch(this['_apiUrl'],_0x450f4b);_0x3794b8?await this['_readStreamableResponse'](_0x2d7ebb,_0x3cb118,_0x101be7):await this['_readStaticResponse'](_0x2d7ebb,_0x3cb118,_0x101be7);}async['_processAWSRequest'](_0x3ab399,_0x3c1253,_0x254651,_0x4aa24f){const _0x4732d0=new _0x1a4036(this['_bedrockClientConfig']),_0x315562={'body':JSON['stringify'](_0x3ab399),'contentType':'application/json','accept':'application/json','modelId':_0x3c1253};let _0x401db7;if(_0x254651){const _0x3c95e2=new _0x17043a(_0x315562);_0x401db7=await _0x4732d0['send'](_0x3c95e2,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x401db7,_0x3c1253,_0x4aa24f);}else{const _0xc96a93=new _0x54a44d(_0x315562);_0x401db7=await _0x4732d0['send'](_0xc96a93,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x401db7,_0x3c1253,_0x4aa24f);}}async['_readAsyncIterableResponse'](_0xd7824b,_0x4e5404,_0x1143bf){const _0x2ac7d9=_0xd7824b['body'],_0x56e6d4=new TextDecoder('utf-8');let _0x2390c7='';for await(const _0x4320fe of _0x2ac7d9)if(_0x4320fe['chunk']){const _0x14bcf5=_0x56e6d4['decode'](_0x4320fe['chunk']['bytes']),_0x264474=JSON['parse'](_0x14bcf5);_0x2390c7+=this['_getGeneratedText'](_0x264474,_0x4e5404),_0x1143bf(_0x2390c7);}return Promise['resolve']();}async['_readStreamableResponse'](_0x44e554,_0x1b3f2d,_0x37bffb){const _0x273d5a=_0x44e554['body'],_0x2bf2a7=new TextDecoder('utf-8'),_0x11d033=_0x273d5a['getReader']();let _0x18d2d9='',_0x4fda29='',_0x237eaf=!0x1;for(;!_0x237eaf;){const {done:_0x409365,value:_0xd1752e}=await _0x11d033['read']();if(_0x237eaf=_0x409365,_0x237eaf)break;const _0x3b2e5d=(_0x18d2d9+_0x2bf2a7['decode'](_0xd1752e))['split']('\x0a')['map'](_0x5c2210=>{try{return _0x18d2d9='',JSON['parse'](_0x5c2210);}catch{return _0x18d2d9=_0x5c2210,null;}})['filter'](_0x430d50=>null!==_0x430d50);_0x3b2e5d['length']&&(_0x4fda29+=_0x3b2e5d['map'](_0x4172c7=>this['_getGeneratedText'](_0x4172c7,_0x1b3f2d))['join'](''),_0x37bffb(_0x4fda29));}return Promise['resolve']();}async['_readStaticResponse'](_0x33bc11,_0x19cf65,_0x2e69f0){let _0x4400c8;return _0x4400c8=_0x33bc11 instanceof Response?await _0x33bc11['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x33bc11['body'])),(_0x2e69f0(this['_getGeneratedText'](_0x4400c8,_0x19cf65)),Promise['resolve']());}['_getGeneratedText'](_0x287e6c,_0x2c1e57){switch(this['getModelFamily'](_0x2c1e57)){case'anthropic.claude':return _0x287e6c['completion'];case'ai21.j2':return _0x287e6c['completions'][0x0]['data']['text'];case'cohere.command':return _0x287e6c['generations'][0x0]['text'];case'meta.llama':return _0x287e6c['generation'];}}}class Ns extends _0x155a80{constructor(_0x507d21,_0x1cf15a={}){super(_0x507d21),this['isToggleable']=!0x0,this['set']('side',_0x1cf15a['side']||'top');const _0x34ef68=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x25a514(_0x1cf15a['class']||[]),_0x34ef68['to']('side',_0x37491f=>'ck-tab-button_'+_0x37491f),_0x34ef68['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class Ks extends _0x7ecbb5{['children'];constructor(_0xf892a5,_0xbad2dc={}){super(_0xf892a5);const _0x39b27a=this['bindTemplate'];this['set']('isVisible',!0x1),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x25a514(_0xbad2dc['class']||[]),_0x39b27a['to']('class'),_0x39b27a['if']('isVisible','ck-hidden',_0x3ef06a=>!_0x3ef06a)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ts extends _0x7ecbb5{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x36f775,_0xa14dd2={}){super(_0x36f775),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0xa14dd2['side']||'top'),this['set']('isMaximized',!0x1);const _0x3743d8=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x25a514(_0xa14dd2['class']||[]),_0x3743d8['to']('side',_0x291186=>'ck-tabs_'+_0x291186),_0x3743d8['to']('class'),_0x3743d8['to']('isMaximized',_0x491c91=>_0x491c91?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x3743d8['to']('side',_0x38259a=>'ck-tabs__buttons-container_'+_0x38259a)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x3743d8['to']('side',_0x5a55d6=>'ck-tabs__panels-container_'+_0x5a55d6)]},'children':this['panelViews']},..._0x25a514(_0xa14dd2['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x34eabe){const _0x1ae359=this['_tabs']['get'](_0x34eabe);return _0x1ae359||null;}['addTab'](_0xee637f){const _0x20c191=this['_setupButton']({'id':_0xee637f['id'],'label':_0xee637f['buttonLabel'],'icon':_0xee637f['buttonIcon'],'order':_0xee637f['order']}),_0x3d888e=new Ks(this['locale']);return _0x3d888e['render'](),_0xee637f['content']&&_0x3d888e['children']['add'](_0xee637f['content']),this['panelViews']['add'](_0x3d888e),this['_tabs']['set'](_0xee637f['id'],{'button':_0x20c191,'panel':_0x3d888e,'order':void 0x0!==_0xee637f['order']?_0xee637f['order']:null}),this['fire']('addTab:'+_0xee637f['id'],{'id':_0xee637f['id'],'button':_0x20c191,'panel':_0x3d888e}),null===this['activeTab']?this['activateTab'](_0xee637f['id']):this['_hidePanel'](_0xee637f['id']),{'button':_0x20c191,'panel':_0x3d888e};}['activateTab'](_0x321bcc){if(null!==_0x321bcc&&!this['getTab'](_0x321bcc))throw new _0x4a8035('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x321bcc});this['activeTab']!==_0x321bcc&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x321bcc,_0x321bcc&&this['_showPanel'](_0x321bcc),this['fire']('activateTab:'+_0x321bcc,_0x321bcc));}['showTab'](_0x33c990){if(!this['getTab'](_0x33c990))throw new _0x4a8035('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x33c990});this['_showPanel'](_0x33c990),this['_showButton'](_0x33c990),this['fire']('show:'+_0x33c990,_0x33c990);}['hideTab'](_0x2944f4){if(!this['getTab'](_0x2944f4))throw new _0x4a8035('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x2944f4});const _0x13c258=this['activeTab'];this['_hidePanel'](_0x2944f4),this['_hideButton'](_0x2944f4);const _0x4c4aff=this['getTabIds']();_0x13c258===_0x2944f4&&_0x4c4aff['length']>0x1&&this['activateTab'](_0x4c4aff['find'](_0xc2e8b4=>_0xc2e8b4!==_0x2944f4)),this['fire']('hide:'+_0x2944f4,_0x2944f4);}['_getPanel'](_0x48c183){const _0x58d060=this['_tabs']['get'](_0x48c183);return _0x58d060?_0x58d060['panel']:null;}['_showPanel'](_0xa7b5cc){null!==this['activeTab']&&this['activeTab']!==_0xa7b5cc||this['_getPanel'](_0xa7b5cc)['show']();}['_hidePanel'](_0x397b27){const _0xc04af8=this['_getPanel'](_0x397b27);_0xc04af8['isVisible']&&(this['activeTab']===_0x397b27&&(this['activeTab']=null),_0xc04af8['hide']());}['_getButton'](_0x3c89b6){const _0x5dca6e=this['_tabs']['get'](_0x3c89b6);return _0x5dca6e?_0x5dca6e['button']:null;}['_showButton'](_0x23111b){this['_getButton'](_0x23111b)['show']();}['_hideButton'](_0x1d81fa){this['_getButton'](_0x1d81fa)['hide']();}['_setupButton'](_0x449ee5){const _0x21ed78=new Ns(this['locale'],{'side':this['side']}),_0x2ec9a0=this['buttonViews'];if(_0x21ed78['set']({'label':_0x449ee5['label'],'icon':_0x449ee5['icon'],'tooltip':!0x0,'withText':!0x0}),_0x21ed78['bind']('isOn')['to'](this,'activeTab',_0x438aee=>_0x438aee===_0x449ee5['id']),_0x21ed78['bind']('side')['to'](this,'side'),_0x449ee5['order']){const _0x5b2120=[...this['_tabs']]['reduce']((_0x580df2,_0x2c7f84)=>{const _0x28ce9c=_0x2c7f84[0x0],{order:_0x5df9c7}=_0x2c7f84[0x1];return!_0x5df9c7||_0x5df9c7>_0x449ee5['order']?_0x580df2:_0x5df9c7>=_0x580df2['order']?{'id':_0x28ce9c,'order':_0x5df9c7}:_0x580df2;},{'id':'','order':0x0}),_0x25914b=_0x2ec9a0['getIndex'](this['_getButton'](_0x5b2120['id']));_0x2ec9a0['add'](_0x21ed78,_0x25914b+0x1);}else _0x2ec9a0['add'](_0x21ed78);return _0x21ed78['on']('execute',()=>{this['activateTab'](_0x449ee5['id']);}),_0x21ed78;}}const di=['overlay','sidebar','custom'],ui=['left','right'];class ai extends ts{constructor(_0x3176d5,_0x63037e={}){super(_0x3176d5,_0x63037e),this['set']('type',_0x63037e['type']||'sidebar'),this['set']('side',_0x63037e['side']||'right');const _0x505006=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x505006['if']('type','ck-ai-tabs__overlay',_0x40bea7=>'overlay'===_0x40bea7),_0x505006['if']('type','ck-ai-tabs__sidebar',_0x46079e=>'sidebar'===_0x46079e)]}}),this['buttonViews']['on']('add',(_0x4e86d3,_0x3a6615)=>{_0x3a6615['set']('withText',!0x1);});}}class et extends _0x316379{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x278271){super(_0x278271);const _0x2be2df=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x2be2df)throw new _0x4a8035('ai-tabs-configuration-not-found');if(void 0x0!==_0x2be2df['showResizeButton']&&(this['showResizeButton']=_0x2be2df['showResizeButton']),'sidebar'!==_0x2be2df['type']&&'overlay'!==_0x2be2df['type']||_0x2be2df['side']&&(this['side']=_0x2be2df['side']),'sidebar'===_0x2be2df['type']){if(this['container']=_0x2be2df['element'],this['set']('type','sidebar'),!this['container'])throw new _0x4a8035('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x2be2df['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']}),this['view']['render'](),this['view']['bind']('side')['to'](this,'side'),this['view']['bind']('type')['to'](this,'type'),this['container']&&this['container']['appendChild'](this['view']['element']),this['context']instanceof dt&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x3a9e72){if(_0x3a9e72&&this['type']!==_0x3a9e72){if(!di['includes'](_0x3a9e72))throw new _0x4a8035('ai-tabs-unsupported-ui-type');this['type']=_0x3a9e72;}}['switchSide'](_0x3e7370){if(_0x3e7370&&this['side']!==_0x3e7370){if(!ui['includes'](_0x3e7370))throw new _0x4a8035('ai-tabs-unsupported-ui-side');this['side']=_0x3e7370;}}['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']();}}function Yn(_0x160040,_0xe6a376,_0x2913f0){const t=_0x160040['t'];switch(_0xe6a376){case'AI_SUGGESTION_HEADER_TITLE':return t({'id':'AI_SUGGESTION_HEADER_TITLE','string':'Suggested\x20content'});case'AI_SUGGESTION_BUTTON_SHOW_CHANGES':return t({'id':'AI_SUGGESTION_BUTTON_SHOW_CHANGES','string':'Show\x20changes'});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':'Suggestion\x20%0'},_0x2913f0);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});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':'Show\x20in\x20the\x20text'});case'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION','string':'Add\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_DELETE':return t({'id':'AI_SUGGESTION_CONTENT_PART_DELETE','string':'Delete'});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':'AI\x20Chat'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi,\x20I\x27m\x20your\x20AI\x20assistant.\x20Think\x20of\x20me\x20as\x20your\x20writing\x20buddy,\x20reviewer,\x20or\x20research\x20partner.\x20I\x20can\x20suggest\x20changes\x20to\x20your\x20document,\x20help\x20generate\x20ideas,\x20offer\x20feedback,\x20discuss\x20attached\x20files,\x20and\x20much\x20more!'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'The\x20request\x20was\x20aborted.'});case'AI_CHAT_GENERIC_ERROR':return t({'id':'AI_CHAT_GENERIC_ERROR','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_START_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_START_CONVERSATION','string':'Unable\x20to\x20start\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE','string':'Failed\x20to\x20upload\x20files:\x20%0.\x20Please\x20try\x20again.'},_0x2913f0);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.'},_0x2913f0);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.'},_0x2913f0);case'AI_CHAT_CONTEXT_INVALID_DATA':return t({'id':'AI_CHAT_CONTEXT_INVALID_DATA','string':'Invalid\x20context\x20data\x20type\x20for\x20the\x20selected\x20resource.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE','string':'Unsupported\x20resource\x20type.\x20Only\x20files\x20and\x20URLs\x20are\x20supported.'});case'AI_CHAT_CONTEXT_URL_EMPTY_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_EMPTY_ERROR','string':'URL\x20cannot\x20be\x20empty.'});case'AI_CHAT_CONTEXT_URL_INVALID_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_INVALID_ERROR','string':'Please\x20enter\x20a\x20valid\x20URL.'});case'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR','string':'AI\x20is\x20preparing\x20a\x20response...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH','string':'AI\x20is\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REASONING','string':'AI\x20is\x20performing\x20deep\x20research\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\x20performing\x20deep\x20research\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':'Thought\x20for\x20a\x20few\x20minutes'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING','string':'Took\x20a\x20moment\x20to\x20think\x20and\x20search\x20the\x20web'});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':'Show\x20change\x20in\x20text','plural':'Show\x20changes\x20in\x20text'},_0x2913f0);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION','string':'Insert\x20suggestion','plural':'Insert\x20suggestions'},_0x2913f0);case'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL','string':'Apply','plural':'Apply\x20all'},_0x2913f0);case'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP','string':'Apply\x20suggestion','plural':'Apply\x20all\x20suggestions'},_0x2913f0);case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x2913f0);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\x20a\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_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.'},_0x2913f0);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\x20is\x20currently\x20empty.\x20After\x20you\x20create\x20some\x20conversations,\x20you\x20will\x20be\x20able\x20to\x20revisit\x20them\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':'Sorry,\x20we\x20couldn\x27t\x20change\x20the\x20\x22%0\x22\x20chat\x20name.\x20Please\x20try\x20again\x20in\x20a\x20moment.'},_0x2913f0);case'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED':return t({'id':'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED','string':'Sorry,\x20we\x20couldn\x27t\x20%0\x20the\x20\x22%1\x22\x20chat.\x20Please\x20try\x20again\x20in\x20a\x20moment.'},_0x2913f0);case'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM':return t({'id':'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM','string':'Sorry,\x20we\x20couldn\x27t\x20delete\x20the\x20\x22%0\x22\x20chat.\x20Please\x20try\x20again\x20in\x20a\x20moment.'},_0x2913f0);case'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS':return t({'id':'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20chat\x20history.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_CHAT_HISTORY_ERROR_GENERIC':return t({'id':'AI_CHAT_HISTORY_ERROR_GENERIC','string':'Something\x20went\x20wrong.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});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_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':'The\x20suggestion\x20can’t\x20be\x20applied\x20to\x20the\x20editor\x20because\x20the\x20system\x20can’t\x20display\x20it\x20correctly..'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20suggestions\x20can’t\x20be\x20applied\x20to\x20the\x20editor\x20because\x20the\x20system\x20can’t\x20display\x20them\x20correctly.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Try\x20again'});case'AI_MODEL_DESCRIPTION_AGENT-1':return t({'id':'AI_MODEL_DESCRIPTION_AGENT-1','string':'Automatically\x20selects\x20the\x20best\x20model\x20for\x20speed,\x20quality,\x20and\x20cost'});case'AI_MODEL_DESCRIPTION_GPT-5':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5','string':'OpenAI\x27s\x20flagship\x20model\x20for\x20advanced\x20reasoning,\x20creativity,\x20and\x20complex\x20tasks'});case'AI_MODEL_DESCRIPTION_GPT-5-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5-MINI','string':'A\x20lightweight\x20version\x20of\x20GPT-5\x20for\x20faster,\x20more\x20cost-efficient\x20responses'});case'AI_MODEL_DESCRIPTION_GPT-4.1':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1','string':'OpenAI\x27s\x20model\x20for\x20reliable\x20reasoning,\x20speed,\x20and\x20versatility'});case'AI_MODEL_DESCRIPTION_GPT-4.1-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1-MINI','string':'A\x20lighter\x20variant\x20of\x20GPT-4.1\x20that\x20balances\x20speed\x20and\x20cost\x20while\x20maintaining\x20solid\x20accuracy'});case'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU','string':'Anthropic\x27s\x20fast,\x20cost-efficient\x20model\x20for\x20simpler\x20tasks'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-SONNET':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-SONNET','string':'Advanced\x20model\x20with\x20strong\x20reasoning\x20and\x20reliability\x20for\x20complex\x20tasks'});case'AI_MODEL_DESCRIPTION_GEMINI-2-5-PRO':return t({'id':'AI_MODEL_DESCRIPTION_GEMINI-2-5-PRO','string':'Google\x27s\x20advanced\x20model\x20for\x20versatile\x20problem-solving\x20and\x20research'});case'AI_MODEL_DESCRIPTION_GEMINI-2-5-FLASH':return t({'id':'AI_MODEL_DESCRIPTION_GEMINI-2-5-FLASH','string':'Lightweight\x20Gemini\x20model\x20for\x20fast,\x20cost-efficient\x20interactions'});default:return _0xe6a376;}}class o extends _0x316379{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3b0616){super(_0x3b0616),this['_apiUrl']='https://ai-assistant.cke-cs-staging.com/v1',this['_token']=null,this['_decoder']=new TextDecoder();}['init'](){const _0x311905=this['context']['plugins']['get']('CloudServices');if(!_0x311905['token'])throw new _0x4a8035('ai-missing-token',this);this['_token']=_0x311905['token'];}['startConversation'](_0x2cf567,_0x37bff6){const _0x425bd0=this['_sendApiRequest']('/conversations','POST',{'id':_0x2cf567,'group':_0x37bff6});return{'getConversation':async()=>(await _0x425bd0['request'])['json'](),'abortController':_0x425bd0['abortController']};}['queryAssistant']({message:_0x45e318,conversationId:_0x54a066,parts:_0x2df613,capabilities:_0x5649b7,model:_0x1a9066,quickActionData:_0x179647}){const _0x49c722={..._0x179647&&{'quickActionData':_0x179647}},_0x318de5={'prompt':_0x45e318,'content':_0x2df613,'model':_0x1a9066,..._0x5649b7&&{'capabilities':_0x5649b7},...Object['keys'](_0x49c722)['length']>0x0&&{'attributes':_0x49c722}},_0x2669bd=this['_sendApiRequest']('/conversations/'+_0x54a066+'/messages','POST',_0x318de5);return{'getStream':async()=>{const _0x32e0b8=(await _0x2669bd['request'])['body'];return this['_getStreamReader'](_0x32e0b8);},'abortController':_0x2669bd['abortController']};}['executeCustomAction']({content:_0x105c7a,message:_0x12871b,model:_0x4118e9,outputFormat:_0x4b38ae}){const _0x4cb2fa={'content':[{'type':'text','content':_0x105c7a}],'prompt':_0x12871b,'model':_0x4118e9,'outputFormat':_0x4b38ae},_0x260de5=this['_sendApiRequest']('/actions/custom/calls','POST',_0x4cb2fa);return{'getStream':async()=>{const _0x3e63e1=(await _0x260de5['request'])['body'];return this['_getStreamReader'](_0x3e63e1);},'abortController':_0x260de5['abortController']};}['executeAction']({actionName:_0x207698,content:_0x3963f8,args:_0x58c183}){const _0x187711={'content':[{'type':'text','content':_0x3963f8}],'args':_0x58c183},_0x110045=this['_sendApiRequest']('/actions/system/'+_0x207698+'/calls','POST',_0x187711);return{'getStream':async()=>{const _0x31975e=(await _0x110045['request'])['body'];return this['_getStreamReader'](_0x31975e);},'abortController':_0x110045['abortController']};}['uploadFile'](_0xfbccbb,_0x98b8c0,_0x22e51e){const _0x178082=new FormData();_0x178082['append']('file',_0x98b8c0,_0x98b8c0['name']),_0x22e51e&&_0x178082['append']('attributes',JSON['stringify'](_0x22e51e));const _0x1ae67c=this['_sendApiRequest']('/conversations/'+_0xfbccbb+'/files','POST',_0x178082);return{'getId':async()=>(await _0x1ae67c['request'])['json'](),'abortController':_0x1ae67c['abortController']};}['fetchDocument'](_0x1f64b6,_0x189f6f){const _0xa0b953=this['_sendApiRequest']('/conversations/'+_0x1f64b6+'/documents/'+_0x189f6f,'GET');return{'getDocument':async()=>(await _0xa0b953['request'])['json'](),'abortController':_0xa0b953['abortController']};}['uploadDocument'](_0x4ff763,_0xf6b67f,_0x365564){const _0x3730eb={'content':_0xf6b67f};_0x365564&&(_0x3730eb['attributes']=_0x365564);const _0x16bd9b=this['_sendApiRequest']('/conversations/'+_0x4ff763+'/documents','POST',_0x3730eb);return{'getId':async()=>(await _0x16bd9b['request'])['json'](),'abortController':_0x16bd9b['abortController']};}['fetchConversations'](_0xaca937,_0x23894c){const _0x372b94=new URLSearchParams();_0x372b94['append']('excludeEmpty','true'),_0x372b94['append']('limit','100'),_0x372b94['append']('group',_0xaca937),_0x23894c&&_0x372b94['append']('search',_0x23894c);const _0x3176b9=this['_sendApiRequest']('/conversations?'+_0x372b94['toString'](),'GET');return{'getConversations':async()=>{const _0x11b0a4=await _0x3176b9['request'];return(await _0x11b0a4['json']())['items'];},'abortController':_0x3176b9['abortController']};}['deleteConversation'](_0x1e9ca2){const _0x4f638c=this['_sendApiRequest']('/conversations/'+_0x1e9ca2,'DELETE');return{'execute':async()=>{await _0x4f638c['request'];},'abortController':_0x4f638c['abortController']};}['updateConversation'](_0x5dbf79,_0x1fbeb2){const _0x3d2fce=this['_sendApiRequest']('/conversations/'+_0x5dbf79,'PATCH',_0x1fbeb2);return{'getResult':async()=>(await _0x3d2fce['request'],_0x1fbeb2),'abortController':_0x3d2fce['abortController']};}['fetchConversation'](_0x34f967){const _0x75180f=this['_sendApiRequest']('/conversations/'+_0x34f967,'GET');return{'getConversation':async()=>(await _0x75180f['request'])['json'](),'abortController':_0x75180f['abortController']};}['fetchConversationMessages'](_0x28f0d1){const _0x457a41=this['_sendApiRequest']('/conversations/'+_0x28f0d1+'/messages','GET');return{'getMessages':async()=>{const _0x1385b2=await _0x457a41['request'];return(await _0x1385b2['json']())['items'];},'abortController':_0x457a41['abortController']};}['uploadUrl'](_0x1e4365,_0x2bc0dc,_0x4fa315){const _0x3b6296=this['_sendApiRequest']('/conversations/'+_0x1e4365+'/web-resources','POST',{'url':_0x2bc0dc,'attributes':_0x4fa315});return{'getId':async()=>(await _0x3b6296['request'])['json'](),'abortController':_0x3b6296['abortController']};}['getModels'](){const _0x6a3d4c=this['_sendApiRequest']('/models/1','GET');return{'list':async()=>{const _0x53df84=await(await _0x6a3d4c['request'])['json'](),_0x3f4959=_0x53df84['items']['map'](_0x4641a9=>({..._0x4641a9,'description':Yn(this['context']['locale'],'AI_MODEL_DESCRIPTION_'+_0x4641a9['id']['toUpperCase']())}));return{..._0x53df84,'items':_0x3f4959};},'abortController':_0x6a3d4c['abortController']};}['deleteFile'](_0x1fc4d2,_0x351a98){const _0xa41194=this['_sendApiRequest']('/conversations/'+_0x1fc4d2+'/files/'+_0x351a98,'DELETE');return{'execute':async()=>{await _0xa41194['request'];},'abortController':_0xa41194['abortController']};}['deleteDocument'](_0x2a8efe,_0x3b500){const _0x194ae1=this['_sendApiRequest']('/conversations/'+_0x2a8efe+'/documents/'+_0x3b500,'DELETE');return{'execute':async()=>{await _0x194ae1['request'];},'abortController':_0x194ae1['abortController']};}['deleteWebResource'](_0x3d1a10,_0x4d074d){const _0x3645c9=this['_sendApiRequest']('/conversations/'+_0x3d1a10+'/web-resources/'+_0x4d074d,'DELETE');return{'execute':async()=>{await _0x3645c9['request'];},'abortController':_0x3645c9['abortController']};}['callSystemReview']({reviewName:_0x54902,content:_0x34097b,args:_0x2d199f}){const _0x5d3309=this['_sendApiRequest']('/reviews/system/'+_0x54902+'/calls','POST',{'content':[{'type':'text','content':_0x34097b}],'args':_0x2d199f});return{'getStream':async()=>{const _0x61b3d3=(await _0x5d3309['request'])['body'];return this['_getStreamReader'](_0x61b3d3);},'abortController':_0x5d3309['abortController']};}['callCustomReview']({content:_0x27a3b9,prompt:_0x304c8c,model:_0x308617}){const _0x426f60=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x27a3b9}],'prompt':_0x304c8c,'model':_0x308617});return{'getStream':async()=>{const _0x1b0f25=(await _0x426f60['request'])['body'];return this['_getStreamReader'](_0x1b0f25);},'abortController':_0x426f60['abortController']};}['_sendApiRequest'](_0x5ae993,_0x35695d,_0xb2080e){const _0x1b13ce=new AbortController(),_0x3aefc8=_0xb2080e instanceof FormData,_0x369032={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0xb2080e&&!_0x3aefc8&&(_0x369032['Content-Type']='application/json');const _0x4946d7={'method':_0x35695d,'headers':_0x369032,'signal':_0x1b13ce['signal']};return _0xb2080e&&(_0x4946d7['body']=_0x3aefc8?_0xb2080e:JSON['stringify'](_0xb2080e)),{'request':fetch(''+this['_apiUrl']+_0x5ae993,_0x4946d7)['catch'](_0x2d44a9=>{this['_handleError'](_0x2d44a9);})['then'](_0x2dbaa0=>{if(!_0x2dbaa0['ok'])throw new _0x4a8035('ai-request-failed',this);return _0x2dbaa0;}),'abortController':_0x1b13ce};}async*['_getStreamReader'](_0x3bad6b){const _0x56be6f=[],_0x1bb86f=_0x3bad6b['getReader'](),_0x5c79b9=bt({'onError':_0x140fb0=>{this['_handleError'](_0x140fb0);},'onEvent':_0xcf40e2=>{_0xcf40e2['data']=JSON['parse'](_0xcf40e2['data']),_0x56be6f['push'](_0xcf40e2);}});try{let _0x14f101=!0x1;for(;!_0x14f101;){const {done:_0x26fd9e,value:_0x3101aa}=await _0x1bb86f['read']();_0x26fd9e&&(_0x14f101=!0x0),_0x5c79b9['feed'](this['_decoder']['decode'](_0x3101aa,{'stream':!0x0})),yield*_0x56be6f,_0x56be6f['length']=0x0;}}catch(_0x40913b){this['_handleError'](_0x40913b);}finally{_0x1bb86f['releaseLock'](),_0x5c79b9['reset']();}}['_handleError'](_0xbb27b8){if(_0xbb27b8 instanceof _0x4a8035)throw _0xbb27b8;if(_0xbb27b8 instanceof Error&&'AbortError'===_0xbb27b8['name'])throw new _0x4a8035('ai-request-aborted',this,{'originalError':_0xbb27b8});throw new _0x4a8035('ai-request-failed',this,{'originalError':_0xbb27b8});}}function Mi(_0x44b2f0,_0x283c57){const _0x2b5a08=new _0x155a80(_0x44b2f0),_0x56152a=Yn(_0x44b2f0,'AI_TABS_LABEL_MINIMIZE'),_0x584a5f=Yn(_0x44b2f0,'AI_TABS_LABEL_MAXIMIZE');return _0x2b5a08['set']({'withText':!0x1,'icon':_0x148c4b,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary-text'}),_0x2b5a08['bind']('label')['to'](_0x283c57,'isMaximized',_0x5da764=>_0x5da764?_0x56152a:_0x584a5f),_0x2b5a08['bind']('icon')['to'](_0x283c57,'isMaximized',_0x2665d1=>_0x2665d1?_0x5b5f05:_0x148c4b),_0x2b5a08['bind']('isOn')['to'](_0x283c57,'isMaximized'),_0x2b5a08['on']('execute',()=>{_0x283c57['fire']('resizeTabs');}),_0x2b5a08;}function sr(_0x328980){return _0x1d72b0(_0x328980);}function At(_0x9e7e85){return _0xbd2e84(_0x9e7e85);}function vt(_0x140944,_0x3c1f78,_0x478224){const _0x5a91cd=null!==_0x3c1f78?_0x28d85f=>_0x28d85f['attribs'][_0x140944]===_0x3c1f78:_0x489489=>Boolean(_0x489489['attribs'][_0x140944]);return yt(_0x469e52=>_0xc13be1(_0x469e52)&&_0x5a91cd(_0x469e52),_0x478224);}function Ne(_0x239712,_0x544a25,_0x524180){const _0x3b150b=null!==_0x544a25?_0xecd594=>_0xecd594['attribs'][_0x239712]===_0x544a25:_0x182406=>Boolean(_0x182406['attribs'][_0x239712]);return _0x541e0b(_0x4b12f9=>_0xc13be1(_0x4b12f9)&&_0x3b150b(_0x4b12f9),_0x524180);}function Tt(_0x2ebb16,_0x2eec6f){return _0x2ebb16&&_0xc13be1(_0x2ebb16)?_0x2ebb16['attribs'][_0x2eec6f]:null;}function We(_0x563ae3,_0x5087e1,_0x43b51c){_0xc13be1(_0x563ae3)&&(null===_0x43b51c?delete _0x563ae3['attribs'][_0x5087e1]:_0x563ae3['attribs'][_0x5087e1]=_0x43b51c);}function De(_0x240977,_0x4f8b75,_0x3ec499){const _0x18104d=_0x4f8b75['cloneNode'](!0x0);'beforebegin'===_0x3ec499?_0x3a9005(_0x240977,_0x18104d):'afterbegin'===_0x3ec499?to(_0x240977,_0x18104d):'beforeend'===_0x3ec499?_0x2a43bb(_0x240977,_0x18104d):'afterend'===_0x3ec499&&_0x31729b(_0x240977,_0x18104d);}function Fe(_0x15cabe){const _0x4a68aa=[];let _0x44cc51=_0x15cabe;for(;_0x44cc51;)_0x44cc51=_0x5a308c(_0x44cc51),_0x44cc51&&_0x4a68aa['push'](_0x44cc51);return _0x4a68aa;}function Fn(_0x3a4205){return _0x3a4205['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Le(_0x1492f9){let _0x1f6323=0x0;for(;_0x1492f9['parentNode'];)_0x1492f9=_0x1492f9['parentNode'],_0x1f6323++;return _0x1f6323;}function ze(_0x242ce1){const _0x3b3557=[];let _0x192d69=_0x242ce1['nextSibling'];for(;_0x192d69;)_0x3b3557['push'](_0x192d69),_0x192d69=_0x192d69['nextSibling'];_0x3b3557['forEach'](_0x5086b9=>{_0x21776c(_0x5086b9);});}class Me extends/* #__PURE__ -- @preserve */
25
- _0x757adc(){['_m2html'];constructor(){super(),this['_m2html']=new _0xa272fd();}['convertMarkdownToHTML'](_0x3ddb69){const _0x3d4876=this['_m2html']['parse'](_0x3ddb69);return this['parseAndNormalizeHTML'](_0x3d4876);}['parseAndNormalizeHTML'](_0x246b2e){return this['_parseHTML'](_0x246b2e);}['_parseHTML'](_0x253503){const _0xf838be=sr('<dummy>'+_0x253503['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0xf838be['children']=_0xf838be['children'][0x0]['children'],_0xf838be;}}class Ve extends/* #__PURE__ -- @preserve */
26
- _0x757adc(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x515f93){super(),this['_generateUid']=_0x515f93||_0x2458fa;}['merge'](_0x1c5c92,_0x2e9f82,_0x31ad2c){const _0x12056c=_0x1c5c92['cloneNode'](!0x0);if(0x0===_0x2e9f82['childNodes']['length']){const _0x486bb9=[];return Ne('data-id','new-element',_0x12056c)['forEach'](_0x4a3228=>{const _0x151076=this['_generateUid']();We(_0x4a3228,'data-id',_0x151076),_0x486bb9['push'](_0x151076);}),this['_removeSpecialComments'](_0x12056c),{'parsedContent':_0x12056c,'newNodeIds':_0x486bb9,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x31ad2c&&_0x31ad2c['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x12056c),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Ne('data-id',null,_0x2e9f82)['map'](_0x266825=>Tt(_0x266825,'data-id'))['filter'](_0xc14c53=>!!_0xc14c53));let _0x45f279=-0x1,_0x102e2f=!0x1;const _0x3404f7=_0x12056c['childNodes'],_0x5a18e0=Array['from'](_0x3404f7)['filter'](_0x7d4692=>!(0x3===_0x7d4692['nodeType']&&''===At(_0x7d4692)['trim']())),_0x380e77=_0x5a18e0['length'];for(let _0x3336dc=0x0;_0x3336dc<_0x380e77;_0x3336dc++){const _0xef45ff=_0x5a18e0[_0x3336dc],_0xc2ad6d=_0x5a18e0[_0x3336dc+0x1];if(this['_isNewNode'](_0xef45ff)){if(-0x1===_0x45f279&&(_0x45f279=_0x3336dc),this['_markWrappedElements'](_0xef45ff),!this['_isNewNode'](_0xc2ad6d)){const [_0x19dd46,_0x27854e]=this['_findReferenceNode'](_0xef45ff,_0x102e2f,_0x2e9f82);if(_0x19dd46){const _0x3035bf=Array['from'](_0x5a18e0)['slice'](_0x45f279,_0x3336dc+0x1);this['_insertNodes'](_0x19dd46,_0x3035bf,_0x27854e),_0x45f279=-0x1;}}}else{if(this['_isExistingContentComment'](_0xef45ff))_0x102e2f=!0x0;else{if(this['_isExistingNode'](_0xef45ff)){const _0x2c4ea6=Tt(_0xef45ff,'data-id');if(_0x2c4ea6&&this['_existingDataIds']['has'](_0x2c4ea6)){const _0x5da973=vt('data-id',_0x2c4ea6,_0x2e9f82);this['_replaceNode'](_0x5da973,_0xef45ff);}if(this['_touchedNodesState']['removedIds']['includes'](_0x2c4ea6)){const _0x5130d2=this['_touchedNodesState']['removedIds']['indexOf'](_0x2c4ea6);this['_touchedNodesState']['removedIds']['splice'](_0x5130d2,0x1);}}else{if(this['_isDelNode'](_0xef45ff)){const _0x5466a4=Tt(_0xef45ff,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x5466a4)||this['_storeDeletedElementIds'](_0xef45ff);}}}}}for(const _0x1e241e of this['_touchedNodesState']['removedIds']){const _0x25901f=vt('data-id',_0x1e241e,_0x2e9f82);if(_0x25901f){if(_0x31ad2c&&_0x31ad2c['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x1e241e;const _0x44d689=_0x31ad2c['replaceRemovedWith']['cloneNode'](!0x0);We(_0x44d689,'data-id',_0x1e241e),We(_0x44d689,'data-removed','true'),_0x350626(_0x25901f,_0x44d689);}else _0x21776c(_0x25901f);}}if(Ne('data-wrapped-id',null,_0x2e9f82)['forEach'](_0x5827f8=>{const _0x2db6cf=vt('data-id',Tt(_0x5827f8,'data-wrapped-id'),_0x2e9f82);var _0x146735,_0x51b3b4;_0x2db6cf&&(_0x51b3b4=_0x5827f8,_0x21776c(_0x146735=_0x2db6cf),_0x350626(_0x51b3b4,_0x146735));}),Ne('data-id','new-element',_0x2e9f82)['forEach'](_0x396a19=>{const _0x5afd3d=this['_getUid'](_0x396a19);We(_0x396a19,'data-id',_0x5afd3d),this['_touchedNodesState']['newIds']['push'](_0x5afd3d);}),this['_removeSpecialComments'](_0x2e9f82),_0x31ad2c&&_0x31ad2c['markUnstableElements']&&this['_markUnstableElements'](_0x2e9f82,_0x31ad2c['markUnstableElementsDepth']||0x0),_0x31ad2c&&_0x31ad2c['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x10b55d=vt('data-id',this['_touchedNodesState']['lastTouchedId'],_0x2e9f82);for(;_0x10b55d;)ze(_0x10b55d),_0x10b55d=_0x10b55d['parentNode'];}return{'parsedContent':_0x2e9f82,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x1aa1ce,_0x4c3e44,_0x25b223){for(const _0x5cff5c of _0x4c3e44){const _0x37b290=this['_getUid'](_0x5cff5c);We(_0x5cff5c,'data-id',_0x37b290),this['_touchedNodesState']['newIds']['push'](_0x37b290),this['_touchedNodesState']['lastTouchedId']=_0x37b290;}const _0x557646='afterbegin'===_0x25b223||'afterend'===_0x25b223?_0x4c3e44['reverse']():_0x4c3e44;for(const _0x4aef10 of _0x557646)De(_0x1aa1ce,_0x4aef10,_0x25b223);}['_replaceNode'](_0x1fbedf,_0x58f6ee){if(!_0x1fbedf)return;if(_0x414239=_0x58f6ee,Fn(At(_0x1fbedf))===Fn(At(_0x414239)))return;var _0x414239;const _0x3453ca=this['_getUid'](_0x1fbedf);We(_0x58f6ee,'data-id',_0x3453ca),this['_touchedNodesState']['modifiedIds']['push'](_0x3453ca),this['_touchedNodesState']['lastTouchedId']=_0x3453ca,_0x350626(_0x1fbedf,_0x58f6ee['cloneNode'](!0x0));}['_findReferenceNode'](_0x58b250,_0x3d87ab,_0x4a86d1){const _0x14359d=this['_findPrevElementWithDataId'](_0x58b250,!0x1);if(_0x14359d){const _0x36cb25=this['_getNodeDataId'](_0x14359d),_0x3516c5=vt('data-id',_0x36cb25,_0x4a86d1);if(_0x3516c5)return[_0x3516c5,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x36cb25);}const _0x1f6bc2=this['_findNextElementWithDataId'](_0x58b250,!0x1);if(_0x1f6bc2){const _0x4bd47a=this['_getNodeDataId'](_0x1f6bc2),_0x4950ee=vt('data-id',_0x4bd47a,_0x4a86d1);if(_0x4950ee)return[_0x4950ee,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x4bd47a);}return _0x3d87ab?_0x58b250['nextSibling']?this['_findFallbackReferenceNode'](_0x58b250,_0x4a86d1):[_0x4a86d1['childNodes'][_0x4a86d1['childNodes']['length']-0x1],'afterend']:[_0x4a86d1['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x5a3df6,_0x1d6e4c){const _0x4c84b4=[],_0x7a2c1e=this['_findPrevElementWithDataId'](_0x5a3df6,!0x0);if(_0x7a2c1e){const _0x74577b=vt('data-id',this['_getNodeDataId'](_0x7a2c1e),_0x1d6e4c);_0x74577b&&_0x4c84b4['push']([_0x74577b,'afterend']);}const _0x50e5de=this['_findNextElementWithDataId'](_0x5a3df6,!0x0);if(_0x50e5de){const _0x1b58fd=vt('data-id',this['_getNodeDataId'](_0x50e5de),_0x1d6e4c);_0x1b58fd&&_0x4c84b4['push']([_0x1b58fd,'beforebegin']);}if(_0x4c84b4['length']>0x1)return Le(_0x4c84b4[0x0][0x0])<=Le(_0x4c84b4[0x1][0x0])?_0x4c84b4[0x0]:_0x4c84b4[0x1];return 0x1===_0x4c84b4['length']?_0x4c84b4[0x0]:[_0x1d6e4c['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x59b499,_0x326914){let _0x31fc3a=_0x59b499['nextSibling'],_0x10d23e=null,_0x140d61=!0x1;for(;_0x31fc3a;){if(_0x4ff99e(_0x31fc3a)){if(this['_isDelNode'](_0x31fc3a)&&(_0x10d23e=_0x31fc3a),this['_isExistingContentComment'](_0x31fc3a)&&_0x326914&&!_0x140d61){_0x140d61=!0x0,_0x31fc3a=_0x31fc3a['nextSibling'];continue;}break;}const _0x54773e=Tt(_0x31fc3a,'data-id');if(_0x54773e&&'new-element'!==_0x54773e&&this['_existingDataIds']['has'](_0x54773e)){_0x10d23e=_0x31fc3a;break;}_0x31fc3a=_0x31fc3a['nextSibling'];}return _0x10d23e;}['_findPrevElementWithDataId'](_0x4d711f,_0x58ccec){let _0x454dd8=_0x4d711f['previousSibling'],_0xaccfb3=null,_0x4c6d00=!0x1;for(;_0x454dd8;){if(_0x4ff99e(_0x454dd8)){if(this['_isDelNode'](_0x454dd8)&&(_0xaccfb3=_0x454dd8),this['_isExistingContentComment'](_0x454dd8)&&_0x58ccec&&!_0x4c6d00){_0x4c6d00=!0x0,_0x454dd8=_0x454dd8['previousSibling'];continue;}break;}const _0x5bd106=Tt(_0x454dd8,'data-id');if(_0x5bd106&&'new-element'!==_0x5bd106&&this['_existingDataIds']['has'](_0x5bd106)){_0xaccfb3=_0x454dd8;break;}_0x454dd8=_0x454dd8['previousSibling'];}return _0xaccfb3;}['_markWrappedElements'](_0x18d88d){_0xc13be1(_0x18d88d)&&Ne('data-id',null,_0x18d88d)['forEach'](_0x2b65de=>{this['_isExistingNode'](_0x2b65de)&&!this['_hasWrappedParent'](_0x2b65de)&&(We(_0x2b65de,'data-wrapped-id',Tt(_0x2b65de,'data-id')),We(_0x2b65de,'data-id',null));});}['_getNodeDataId'](_0x14992d){if(!_0x14992d)return null;if(_0xc13be1(_0x14992d))return Tt(_0x14992d,'data-id');if(_0x4ff99e(_0x14992d)){const _0x39e784=At(_0x14992d)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x39e784&&_0x39e784[0x1])return _0x39e784[0x1];}return null;}['_storeDeletedElementIds'](_0x31b40d){if(_0x4ff99e(_0x31b40d)){const _0x132637=At(_0x31b40d)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x132637&&_0x132637[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x132637[0x1]);}}['_getUid'](_0x1aaced){return this['_isExistingNode'](_0x1aaced)?Tt(_0x1aaced,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0xee93f4){(function(_0x1244dd){return _0x2e749c(_0x5d881c=>_0x4ff99e(_0x5d881c),_0x1244dd,!0x0,0x1/0x0);}(_0xee93f4)['filter'](_0x3f0927=>this['_isDelNode'](_0x3f0927)||this['_isExistingContentComment'](_0x3f0927))['forEach'](_0x4b89e5=>{_0x21776c(_0x4b89e5);}));}['_markLastTagElementUnstable'](_0x1b25c1){const _0x36fc2a=_0x1b25c1['childNodes'],_0x5d5640=_0x36fc2a[_0x36fc2a['length']-0x1];_0x5d5640&&_0xc13be1(_0x5d5640)&&We(_0x5d5640,'data-unstable','true');}['_markUnstableElements'](_0x4e2aa5,_0x33b95e){const _0x66724a=vt('data-unstable','true',_0x4e2aa5);if(!_0x66724a)return;const _0x440dfb=Fe(_0x66724a)['slice'](0x0,-0x1),_0x1ba16f=_0x440dfb['length'];let _0x21684d=_0x66724a;if(_0x1ba16f>_0x33b95e){let _0x18e824=_0x1ba16f,_0x5b4628=null;for(;_0x18e824>_0x33b95e&&_0x18e824>=0x0;)_0x18e824--,_0x5b4628=_0x440dfb[_0x18e824];_0x5b4628&&(_0x21684d=_0x5b4628,We(_0x66724a,'data-unstable',null),We(_0x5b4628,'data-unstable','true'));}else{if(_0x1ba16f<_0x33b95e){let _0x558083=_0x1ba16f,_0x21e7a0=_0x66724a;for(;_0x558083<_0x33b95e;){const _0x1a63d7=_0x21e7a0['childNodes']['filter'](_0x2f1895=>_0xc13be1(_0x2f1895));if(0x0===_0x1a63d7['length'])break;_0x558083++,_0x21e7a0=_0x1a63d7[_0x1a63d7['length']-0x1];}_0x21e7a0&&(_0x21684d=_0x21e7a0,We(_0x66724a,'data-unstable',null),We(_0x21e7a0,'data-unstable','true'));}}let _0x3e129c=_0x21684d;for(;_0x3e129c;){for(;_0x3e129c['nextSibling'];)_0x3e129c=_0x3e129c['nextSibling'],_0xc13be1(_0x3e129c)&&We(_0x3e129c,'data-unstable','true');_0x3e129c=_0x3e129c['parentNode'];}}['_isNewNode'](_0x415009){return Boolean('new-element'===Tt(_0x415009,'data-id'));}['_isExistingNode'](_0x52f84e){return Boolean((Tt(_0x52f84e,'data-id')||'')['length']>0x0&&'new-element'!==Tt(_0x52f84e,'data-id'));}['_isDelNode'](_0x5c14d3){return!!_0x5c14d3&&Boolean(_0x4ff99e(_0x5c14d3)&&At(_0x5c14d3)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x46690c){let _0x1999d7=_0x46690c['parentNode'];for(;_0x1999d7;){if(Tt(_0x1999d7,'data-wrapped-id'))return!0x0;_0x1999d7=_0x1999d7['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x52c714){return Boolean(_0x4ff99e(_0x52c714)&&At(_0x52c714)['match'](/\s*existing[\s*-](content|document)\s*/g));}}const Wn=['modification-delta','text-delta'],Kn=['reasoning'];class pi extends _0x757adc(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new wt([]);['parsedMergedContent']=new wt([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];constructor({type:_0x3d06a2,content:_0x3c9d59='',isDone:_0x19556c=!0x1,interactionId:_0xdf4843,areActionsDisabled:_0x4d0b6b,documentContextContent:_0x394035,editor:_0x49f6ca}){super(),this['id']=_0x2458fa(),this['interactionId']=_0xdf4843,this['type']=_0x3d06a2,this['areActionsDisabled']=!!_0x4d0b6b,this['editor']=_0x49f6ca,this['aiResponseParser']=new Me(),this['aiResponseApplier']=new Ve(),this['documentContextContent']=sr(_0x394035||''),this['set']('isDone',_0x19556c),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x3c9d59);}['appendContent'](_0x13b329){this['set']('content',this['content']+_0x13b329);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x3f8246,_0x3c9b5b){this['changeGroups'][_0x3f8246]['state']=_0x3c9b5b,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x3f8246,'state':_0x3c9b5b});}['onContentChange'](){if('modification-delta'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0xb2b4a4=this['changeGroups'];this['updateChangeGroups']();const _0x5d3ff3=function(_0x372e72,_0x12bb78){const _0x4c58f3=[];for(const _0x314cc7 of _0x12bb78){const _0x4e8694=_0x372e72[_0x314cc7['index']];_0x4e8694?_0x4e8694['changes']['length']!==_0x314cc7['changes']['length']?_0x4c58f3['push'](_0x314cc7):_0x4e8694['changes']['forEach']((_0x3820fa,_0x1bf573)=>{const _0x821c97=_0x314cc7['changes'][_0x1bf573];_0x3820fa['id']!==_0x821c97['id']&&_0x4c58f3['push'](_0x314cc7);}):_0x4c58f3['push'](_0x314cc7);}return _0x4c58f3;}(_0xb2b4a4,this['changeGroups']);(_0x5d3ff3['length']||this['isDone'])&&this['fire']('replyContentUpdated',this,_0x5d3ff3);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['updateChangeGroups'](){const _0x51da8e=new _0x49ffc0('p',{},[new _0x49ffc0('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x3b69e4('Removed\x20content.\x20Use\x20\x22Show\x20changes\x22\x20to\x20learn\x20more.')])]),_0x4d7a8b=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x51da8e,'cutAfterLastChange':!this['isDone']});if(!_0x4d7a8b['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x4d7a8b['parsedContent'];let _0x1a4c4c=[];if(_0x541e0b(_0x261281=>{const _0x4c1494=Tt(_0x261281,'data-id');if(!_0x4c1494||!_0x40cbee(_0x4c1494))return!0x1;const _0x2cd8b7=[_0x261281,...Fe(_0x261281)]['at'](-0x2);if(_0x261281!=_0x2cd8b7){const _0x4fe2f3=Tt(_0x2cd8b7,'data-id');_0x40cbee(_0x4fe2f3)||(_0x1a4c4c['push']({'node':_0x2cd8b7,'id':_0x4fe2f3,'type':'modified'}),_0x4d7a8b['modifiedNodeIds']['push'](_0x4fe2f3));}else _0x4d7a8b['modifiedNodeIds']['includes'](_0x4c1494)?_0x1a4c4c['push']({'node':_0x261281,'type':'modified','id':_0x4c1494}):_0x4d7a8b['newNodeIds']['includes'](_0x4c1494)?_0x1a4c4c['push']({'node':_0x261281,'type':'new','id':_0x4c1494,'anchorId':Tt(_0x261281['previousSibling'],'data-id')}):_0x1a4c4c['push']({'node':_0x261281,'type':'removed','id':_0x4c1494});return!0x0;},this['parsedMergedContent']),_0x1a4c4c=_0x1a4c4c['filter'](({node:_0x2df83f})=>[...Fe(_0x2df83f),_0x2df83f]['every'](_0x852e5b=>!Tt(_0x852e5b,'data-unstable'))),0x0==_0x1a4c4c['length'])return;const _0x36e0f5=[[_0x1a4c4c[0x0]]];for(let _0x209777=0x1;_0x209777<_0x1a4c4c['length'];_0x209777++){const _0xab5793=_0x36e0f5[_0x36e0f5['length']-0x1],_0x26a2e2=_0xab5793[_0xab5793['length']-0x1];_0x1a4c4c[_0x209777]['node']['previousSibling']==_0x26a2e2['node']&&'modified'!=_0x1a4c4c[_0x209777]['type']&&'modified'!=_0x26a2e2['type']?_0xab5793['push'](_0x1a4c4c[_0x209777]):_0x36e0f5['push']([_0x1a4c4c[_0x209777]]);}for(const _0xdae50b of _0x36e0f5){const _0x528dd8=_0xdae50b[0x0],_0x222add=_0xdae50b[_0xdae50b['length']-0x1],_0x354693=_0x10f192(_0x528dd8['node']['previousSibling']);_0x354693&&_0xdae50b['unshift'](_0x354693);const _0x30c314=_0x10f192(_0x222add['node']['nextSibling']);_0x30c314&&_0xdae50b['push'](_0x30c314);}function _0x40cbee(_0x1c4026){return _0x4d7a8b['modifiedNodeIds']['includes'](_0x1c4026)||_0x4d7a8b['newNodeIds']['includes'](_0x1c4026)||_0x4d7a8b['removedNodeIds']['includes'](_0x1c4026);}function _0x10f192(_0x7bd4c5){if(_0x7bd4c5&&Tt(_0x7bd4c5,'data-id')&&!Tt(_0x7bd4c5,'data-unstable')){const _0x17ac1c=Tt(_0x7bd4c5,'data-id');if(!_0x40cbee(_0x17ac1c))return{'node':_0x7bd4c5,'type':'context','id':_0x17ac1c};}return null;}this['changeGroups']=_0x36e0f5['map']((_0x1f0c7f,_0x4a1c28)=>({'changes':_0x1f0c7f,'state':'pending','index':_0x4a1c28}));}}function Li(_0x303c0c){return Object['values'](Wn)['includes'](_0x303c0c);}function Ni(_0x48e65c){return Kn['includes'](_0x48e65c);}function Pi(_0x1ce3dc){return'conversation-title'===_0x1ce3dc;}function Qi(_0x40abb2){return'source'===_0x40abb2;}const ne=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','error'];class oe extends _0x2f6768(){['id'];['replies']=[];['currentReply'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];constructor({connector:_0x3bc9c7,editor:_0x49884e}){super(),this['id']=_0x2458fa(),this['connector']=_0x3bc9c7,this['isStopped']=!0x0,this['editor']=_0x49884e;}async['start'](){let _0x5c412d;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x4f2bf7=await this['currentRequest']['getStream'](),_0x444ced=[];for await(const _0x11f381 of _0x4f2bf7){if(this['isStopped'])return;Pi(_0x11f381['event'])&&this['setConversationTitle'](_0x11f381['data']['conversationTitle'],!0x0),Qi(_0x11f381['event'])?_0x444ced['push'](_0x11f381['data']['source']):Li(_0x11f381['event'])?(_0x11f381['event']!==_0x5c412d&&(this['currentReply']&&this['currentReply']['done'](),this['currentReply']=this['createReply']({'type':_0x11f381['event'],'interactionId':this['id']}),_0x444ced['length']>0x0&&(this['currentReply']['sources']=_0x444ced['splice'](0x0)),_0x5c412d=_0x11f381['event']),this['currentReply']['appendContent'](_0x11f381['data']['textDelta'])):Ni(_0x11f381['event'])||_0x3a0d50('ai-interaction-invalid-event-type',{'chunk':_0x11f381});}}finally{this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x286e22){return this['replies']['find'](_0x79525=>_0x79525['id']===_0x286e22);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x34730b=>_0x34730b['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x1bcc2f){const _0x341614=new pi({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x1bcc2f});return this['replies']['push'](_0x341614),_0x341614['delegate'](...ne)['to'](this),this['fire']('replyCreated',_0x341614),_0x341614;}['setConversationTitle'](_0x2c0f69,_0x2357ee=!0x1){this['fire']('setConversationTitle',_0x2c0f69,_0x2357ee);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var ce=function(_0x5d9ceb){return _0x5d9ceb['FILE']='file',_0x5d9ceb['DOCUMENT']='document',_0x5d9ceb['URL']='web-resource',_0x5d9ceb['TEXT']='text',_0x5d9ceb['SELECTION']='selection',_0x5d9ceb;}({}),Ie=function(_0x46526e){return _0x46526e['TEXT']='text',_0x46526e['MARKDOWN']='markdown',_0x46526e['HTML']='html',_0x46526e;}({});const qi=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class Di extends _0x757adc(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x5925b7,config:_0x2ef127,ownerId:_0x30bd2a}){super(),this['_connector']=_0x5925b7,this['_config']=_0x2ef127,this['_ownerId']=_0x30bd2a;}['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'](_0x1cfa38){const _0x5a6121=await this['_createContextItemFromContent'](_0x1cfa38);return this['_addToConversationContextItem'](_0x5a6121),'current-document'===_0x5a6121['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x5a6121;}async['_createContextItemFromContent'](_0x2324a3){if(_0x2324a3['type']===ce['DOCUMENT']){const _0x53d6ad=await this['_connector']['fetchDocument'](this['_ownerId'],_0x2324a3['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x2324a3['type'],'content':_0x53d6ad['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x53d6ad['attributes']?.['version'],'sessionId':_0x53d6ad['attributes']?.['sessionId']};}return{'id':_0x2324a3['id'],'uiId':_0x2324a3['id'],'label':_0x2324a3['attributes']?.['label']||_0x2324a3['name']||_0x2324a3['url']||_0x2324a3['id'],'type':_0x2324a3['type'],..._0x2324a3?.['attributes']?.['resourceId']?{'resourceId':_0x2324a3['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x484316){const _0x34e242=this['_pendingContextItems']['get'](_0x484316);_0x34e242?.['isReadOnly']||this['_removeContextItem'](_0x484316);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0xf8b2be of this['_pendingContextItems']['values']())this['_removeContextItem'](_0xf8b2be['uiId']);const _0x2ea5a6=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x2ea5a6&&this['_addContextItem']({..._0x2ea5a6,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x3a1d51){for(const _0x10d996 of _0x3a1d51['values']())this['_addToConversationContextItem'](_0x10d996);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'](_0x483776){return Array['from'](_0x483776['values']())['map'](_0x4e2cf5=>this['_mapContextItemToRequestData'](_0x4e2cf5))['filter'](_0x5101b5=>null!==_0x5101b5);}async['addFilesToContext'](_0x353d72,_0x2779a3,_0x54be07=ce['FILE']){const _0x4cf2b8='files-'+_0x2458fa();this['_startUploadOperation'](_0x4cf2b8);try{await Promise['all'](_0x353d72['map'](async _0x4f86e9=>{const _0x1cc217='file-'+_0x2458fa();try{this['_addContextItem']({'type':_0x54be07,'label':_0x2779a3?.['label']||_0x4f86e9['name'],'uiId':_0x1cc217,'resourceId':_0x2779a3?.['resourceId']},!0x0);const _0x39f4cf=this['_connector']['uploadFile'](this['_ownerId'],_0x4f86e9,_0x2779a3);this['_ongoingUploads']['set'](_0x1cc217,_0x39f4cf['abortController']);const {id:_0x2748d5}=await _0x39f4cf['getId']();this['_ongoingUploads']['delete'](_0x1cc217),this['_finishContextItemLoading']({'type':_0x54be07,'id':_0x2748d5,'label':_0x2779a3?.['label']||_0x4f86e9['name'],'uiId':_0x1cc217,'resourceId':_0x2779a3?.['resourceId']},!0x1);}catch(_0x1095b5){this['_ongoingUploads']['delete'](_0x1cc217);if(!_0x1095b5['message']['startsWith']('ai-request-aborted')){const _0x47496b=new _0x4a8035('ai-chat-file-upload-failed',null,{'fileName':_0x4f86e9['name']});_0x47496b['stack']=_0x1095b5['stack'],this['fire']('error',{'error':_0x47496b,'fileName':_0x4f86e9['name']});}this['_removeContextItem'](_0x1cc217);}}));}finally{this['_finishUploadOperation'](_0x4cf2b8);}}['addCurrentDocumentToContext'](_0x1302c7){if(this['isCurrentDocumentInContext']())return;const _0x4198da={'type':ce['DOCUMENT'],'uiId':'current-document','label':_0x1302c7,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x4198da);}async['updateCurrentDocument'](_0x46c051,_0x4a6837,_0x590c12,_0x20ee45){const _0xaef7cb=this['_pendingContextItems']['get']('current-document');if(_0xaef7cb&&_0x46c051){_0xaef7cb['selection']=_0x20ee45?_0x20ee45['map'](_0x11f496=>({'start':_0x11f496['start'],'end':_0x11f496['end']})):[];try{if(_0xaef7cb['version']===_0x4a6837)return;const {id:_0x575316}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x46c051,{'version':_0x4a6837,'sessionId':_0x590c12})['getId']();_0xaef7cb['id']=_0x575316,_0xaef7cb['content']=_0x46c051,_0xaef7cb['version']=_0x4a6837,_0xaef7cb['sessionId']=_0x590c12;}catch(_0x2a98c9){const _0x39e10b=new _0x4a8035('ai-chat-document-upload-failed',null);_0x39e10b['stack']=_0x2a98c9['stack'],this['fire']('error',{'error':_0x39e10b});}}}['addSelectionToContext'](_0x8705fc){this['_addContextItem']({'type':ce['SELECTION'],'label':_0x8705fc,'uiId':'selection','content':_0x8705fc});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x3cec51,_0x121527){const _0x5add53='url-'+_0x2458fa();this['_startUploadOperation'](_0x5add53);const _0x10f4d6='url-'+_0x2458fa();try{this['_addContextItem']({'type':ce['URL'],'label':_0x121527?.['label']||_0x3cec51,'uiId':_0x10f4d6,'resourceId':_0x121527?.['resourceId']},!0x0);const _0x228317=this['_connector']['uploadUrl'](this['_ownerId'],_0x3cec51,_0x121527);this['_ongoingUploads']['set'](_0x10f4d6,_0x228317['abortController']);const {id:_0x288669}=await _0x228317['getId']();this['_ongoingUploads']['delete'](_0x10f4d6),this['_finishContextItemLoading']({'type':ce['URL'],'id':_0x288669,'label':_0x121527?.['label']||_0x3cec51,'uiId':_0x10f4d6,'resourceId':_0x121527?.['resourceId']},!0x1);}catch(_0x15cc10){this['_ongoingUploads']['delete'](_0x10f4d6),(_0x15cc10['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x4a8035('ai-chat-url-upload-failed',this,{'url':_0x3cec51,'originalError':_0x15cc10}),'url':_0x3cec51}),this['_removeContextItem'](_0x10f4d6));}finally{this['_finishUploadOperation'](_0x5add53);}}async['loadSourceResources'](_0x4dcb72,_0x538e7f,_0xa26538){const _0x47def3=this['_addContextOptionsState']['sources']['find'](_0xaa497=>_0xaa497['id']===_0x4dcb72);if(!_0x47def3)return this['fire']('error',{'error':new _0x4a8035('ai-chat-source-not-found',this,{'sourceId':_0x4dcb72}),'sourceId':_0x4dcb72}),[];try{const _0x612f01=(await _0x47def3['getResources'](_0x538e7f))['map'](_0x341fe2=>{const _0x5a934d=this['_isResourceInContext'](_0x341fe2['id']);return{..._0x341fe2,'isInContext':_0x5a934d};});return _0x47def3['resources']=_0x612f01,this['fire']('sourceResourcesLoaded',{'sourceId':_0x4dcb72,'source':_0x47def3,'resources':_0x612f01,'uid':_0xa26538}),_0x612f01;}catch(_0x23adb8){return this['fire']('error',{'error':new _0x4a8035('ai-chat-source-resources-load-failed',this,{'sourceId':_0x4dcb72,'originalError':_0x23adb8}),'sourceId':_0x4dcb72,'sourceLabel':_0x47def3['label']}),[];}}async['addResourceToContext'](_0x15eab7,_0x585dcd){if(this['_isResourceInContext'](_0x585dcd['id']))return;let _0x3d7364=_0x585dcd['data'];if(!_0x3d7364&&_0x15eab7['getData'])try{_0x3d7364=await _0x15eab7['getData'](_0x585dcd['id']);}catch(_0x1fafe2){return void this['fire']('error',{'error':new _0x4a8035('ai-chat-resource-load-failed',this,{'resourceId':_0x585dcd['id'],'sourceId':_0x15eab7['id'],'originalError':_0x1fafe2}),'resourceId':_0x585dcd['id'],'sourceId':_0x15eab7['id']});}if(_0x3d7364)switch(_0x585dcd['type']){case ce['URL']:if('string'!=typeof _0x3d7364)return void this['fire']('error',{'error':new _0x4a8035('ai-chat-context-invalid-data',this,{'resourceId':_0x585dcd['id'],'sourceId':_0x15eab7['id'],'expectedType':'string','actualType':typeof _0x3d7364}),'resourceId':_0x585dcd['id'],'sourceId':_0x15eab7['id']});await this['addUrlToContext'](_0x3d7364,{'label':_0x585dcd['label'],'resourceId':_0x585dcd['id']});break;case ce['FILE']:if(!(_0x3d7364 instanceof File))return void this['fire']('error',{'error':new _0x4a8035('ai-chat-context-invalid-data',this,{'resourceId':_0x585dcd['id'],'sourceId':_0x15eab7['id'],'expectedType':'File','actualType':typeof _0x3d7364}),'resourceId':_0x585dcd['id'],'sourceId':_0x15eab7['id']});await this['addFilesToContext']([_0x3d7364],{'label':_0x585dcd['label'],'resourceId':_0x585dcd['id']});break;case ce['TEXT']:if('object'!=typeof _0x3d7364||!('content'in _0x3d7364)||!('type'in _0x3d7364))return void this['fire']('error',{'error':new _0x4a8035('ai-chat-context-invalid-data',this,{'resourceId':_0x585dcd['id'],'sourceId':_0x15eab7['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x3d7364}),'resourceId':_0x585dcd['id'],'sourceId':_0x15eab7['id']});_0x3d7364=Di['_convertTextResourceToFile'](_0x3d7364,_0x585dcd['label']),await this['addFilesToContext']([_0x3d7364],{'label':_0x585dcd['label'],'resourceId':_0x585dcd['id']},ce['TEXT']);break;default:this['fire']('error',{'error':new _0x4a8035('ai-chat-context-unsupported-type',this,{'resourceId':_0x585dcd['id'],'sourceId':_0x15eab7['id'],'resourceType':_0x585dcd['type']}),'resourceId':_0x585dcd['id'],'sourceId':_0x15eab7['id']});}else this['fire']('error',{'error':new _0x4a8035('ai-chat-resource-no-data',this,{'resourceId':_0x585dcd['id'],'sourceId':_0x15eab7['id']}),'resourceId':_0x585dcd['id'],'sourceId':_0x15eab7['id']});}static['_convertTextResourceToFile'](_0x4cd250,_0x1f2185){switch(_0x4cd250['type']){case Ie['MARKDOWN']:return new File([_0x4cd250['content']],_0x1f2185,{'type':'text/markdown'});case Ie['HTML']:return new File([_0x4cd250['content']],_0x1f2185,{'type':'text/html'});default:return new File([_0x4cd250['content']],_0x1f2185,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x1e18ed){switch(_0x1e18ed['type']){case ce['FILE']:return{'type':ce['FILE'],'id':_0x1e18ed['id']};case ce['URL']:return{'type':ce['URL'],'id':_0x1e18ed['id']};case ce['DOCUMENT']:return{'type':ce['DOCUMENT'],'id':_0x1e18ed['id'],..._0x1e18ed['selection']?.['length']&&{'selection':_0x1e18ed['selection']}};case ce['TEXT']:return{'type':ce['FILE'],'id':_0x1e18ed['id']};default:return null;}}['_addContextItem'](_0xfaa830,_0x1a5cad=!0x1){if(this['_pendingContextItems']['set'](_0xfaa830['uiId'],_0xfaa830),_0xfaa830['hidden']||this['fire']('contextItemAdded',{'contextItem':_0xfaa830,'isLoading':_0x1a5cad}),'current-document'===_0xfaa830['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0xfaa830['resourceId']){const _0x41cafe=this['_findSourceIdsByResourceId'](_0xfaa830['resourceId']);_0x41cafe&&_0x41cafe['forEach'](_0x2cdc68=>{this['_updateResourceInContextState'](_0x2cdc68,_0xfaa830['resourceId'],!0x0);});}}['_removeContextItem'](_0x18d468){const _0x1ec02d=this['_pendingContextItems']['get'](_0x18d468),_0x41b0a9=this['_ongoingUploads']['get'](_0x18d468);if(_0x41b0a9&&(_0x41b0a9['abort'](),this['_ongoingUploads']['delete'](_0x18d468)),_0x1ec02d?.['resourceId']){const _0x4f12d7=this['_findSourceIdsByResourceId'](_0x1ec02d['resourceId']);_0x4f12d7&&_0x4f12d7['forEach'](_0x4011d8=>{this['_updateResourceInContextState'](_0x4011d8,_0x1ec02d['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x18d468),this['fire']('contextItemRemoved',{'uiId':_0x18d468,'type':_0x1ec02d?.['type']}),'current-document'===_0x18d468&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x36f05b,_0x34bc09){if(this['_pendingContextItems']['has'](_0x36f05b['uiId'])&&(this['_pendingContextItems']['set'](_0x36f05b['uiId'],_0x36f05b),this['fire']('contextItemLoadingEnded',{'contextItem':_0x36f05b,'isLoading':_0x34bc09}),_0x36f05b['resourceId'])){const _0x3243a1=this['_findSourceIdsByResourceId'](_0x36f05b['resourceId']);_0x3243a1&&_0x3243a1['forEach'](_0x4f1017=>{this['_updateResourceInContextState'](_0x4f1017,_0x36f05b['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x3653e2){this['_conversationContextItems']['set'](_0x3653e2['uiId'],_0x3653e2);}['_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'](_0x30f5d2=>({..._0x30f5d2,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x380d37=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x380d37,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x146835){for(const _0x1e278d of this['_pendingContextItems']['values']())if(_0x1e278d['resourceId']===_0x146835)return!0x0;for(const _0x55fd47 of this['_conversationContextItems']['values']())if(_0x55fd47['resourceId']===_0x146835)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0xce6332){const _0x5b348d=[];for(const _0x5d6f9f of this['_addContextOptionsState']['sources']){_0x5d6f9f['resources']['find'](_0x9675=>_0x9675['id']===_0xce6332)&&_0x5b348d['push'](_0x5d6f9f['id']);}return 0x0===_0x5b348d['length']?null:_0x5b348d;}['_updateResourceInContextState'](_0x151e52,_0x1c3753,_0x2f5b51){const _0x54da1d=this['_addContextOptionsState']['sources']['find'](_0x1005a6=>_0x1005a6['id']===_0x151e52);if(!_0x54da1d)return;const _0x587289=_0x54da1d['resources']['find'](_0x5eddb1=>_0x5eddb1['id']===_0x1c3753);_0x587289&&(_0x587289['isInContext']=_0x2f5b51,this['fire']('resourceStateChanged',{'sourceId':_0x151e52,'resourceId':_0x1c3753,'isInContext':_0x2f5b51}));}['_startUploadOperation'](_0x3cf283){this['_ongoingUploadOperations']['set'](_0x3cf283,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x2ddc69){this['_ongoingUploadOperations']['delete'](_0x2ddc69),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const zi=['capabilitiesUpdated'];class Fi extends _0x2f6768(){['_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'](_0x3da93f){const _0x4ea028={};return _0x3da93f&&_0x3da93f['isWebSearchEnabled']&&(_0x4ea028['webSearch']={}),_0x3da93f&&_0x3da93f['isReasoningEnabled']&&(_0x4ea028['reasoning']={}),_0x4ea028;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x2d4579){_0x2d4579!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x2d4579,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x3819d8){_0x3819d8!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x3819d8,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Ui extends oe{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['quickActionData'];constructor(_0x32404c){super(_0x32404c),this['conversationId']=_0x32404c['conversationId'],this['contextItems']=_0x32404c['contextItems'],this['capabilities']=_0x32404c['capabilities'],this['userMessage']=_0x32404c['userMessage'],this['model']=_0x32404c['model'],this['quickActionData']=_0x32404c['quickActionData'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':Di['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Fi['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'quickActionData':this['quickActionData']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class pt extends _0x2f6768(){['id'];['isStarted']=!0x1;['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x4e2685){super(),this['options']=_0x4e2685,this['connector']=_0x4e2685['connector'],this['chatModels']=_0x4e2685['chatModels'],this['id']=_0x4e2685['conversationId'];}async['init'](_0x3796f7){try{this['chatContext']=new Di({'connector':this['connector'],'config':_0x3796f7,'ownerId':this['id']}),this['chatContext']['delegate'](...qi)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Fi(),this['chatCapabilities']['delegate'](...zi)['to'](this),this['chatCapabilities']['init']();const _0x52babb=await this['chatModels']['getAll']();this['fire']('conversationInitialized',{'availableModels':_0x52babb});const _0x4b056b=await this['chatModels']['getDefault'](this['options']['defaultModelId']);_0x4b056b&&await this['setModel'](_0x4b056b);}catch(_0x58eb0a){const _0x3f9e75=new _0x4a8035('ai-chat-conversation-init-failed',null,{'message':_0x58eb0a['message']});_0x3f9e75['stack']=_0x58eb0a['stack'],this['fire']('error',{'error':_0x3f9e75});}}async['start'](){if(this['isStarted'])throw new _0x4a8035('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x4a8035('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x3f90d1}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x3f90d1,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x4679cf){const _0x5547b2=new _0x4a8035('ai-chat-conversation-start-failed',null,{'message':_0x4679cf['message']});_0x5547b2['stack']=_0x4679cf['stack'],this['fire']('error',{'error':_0x5547b2});}}async['load'](_0x4a4f4f,_0x18f8bd){try{const _0x47b6a1=await this['connector']['fetchConversation'](_0x4a4f4f)['getConversation'](),_0xcbaa2a=await this['connector']['fetchConversationMessages'](_0x4a4f4f)['getMessages'](),_0x28a5c9=_0xcbaa2a[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x47b6a1['id'],'title'in _0x47b6a1?this['fire']('setConversationTitle',_0x47b6a1['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x1749aa=(await this['chatModels']['getAll']())['find'](_0x21574a=>_0x21574a['id']['toLowerCase']()===_0x28a5c9['toLowerCase']());return this['selectedModel']=_0x1749aa,this['fire']('modelSelected',{'selectedModel':_0x1749aa,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0xcbaa2a,_0x18f8bd,_0x28a5c9),this['currentInteraction']=void 0x0,this;}catch(_0x418274){const _0x48ead0=new _0x4a8035('ai-chat-conversation-init-from-id-failed',null,{'message':_0x418274['message'],'conversationId':_0x4a4f4f});throw _0x48ead0['stack']=_0x418274['stack'],this['fire']('error',{'error':_0x48ead0}),_0x48ead0;}}async['_processMessagesToInteractions'](_0x4d9d9f,_0x4ffe35,_0x5c75b4){let _0x59527f;for(const _0x10f645 of _0x4d9d9f)if('user'===_0x10f645['role']){const _0x1eccaf=await this['_extractContextItems'](_0x10f645),_0x32c710={'isReasoningEnabled':Object['hasOwn'](_0x10f645['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x10f645['capabilities'],'webSearch')};_0x59527f=this['createInteraction']({'userMessage':_0x10f645['prompt'],'contextItems':_0x1eccaf,'capabilities':_0x32c710,'modelId':_0x5c75b4,'quickActionData':_0x10f645['attributes']?.['quickActionData']}),this['currentInteraction']=_0x59527f,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x10f645['role']&&_0x59527f)for(const _0x5c19da of _0x10f645['content']){const _0x3d287a='text'===_0x5c19da['type']?'text-delta':'modification-delta',_0x21726d=_0x59527f['getDocumentContext']()?.['sessionId']!==_0x4ffe35;_0x59527f['currentReply']=_0x59527f['createReply']({'type':_0x3d287a,'isDone':!0x0,'interactionId':_0x59527f['id'],'areActionsDisabled':_0x21726d}),_0x59527f['currentReply']['appendContent'](_0x5c19da['content']);}}}async['_extractContextItems'](_0x2da4fa){const _0x35a33f=new Map();if(!_0x2da4fa['content'])return _0x35a33f;for(const _0x4fa140 of _0x2da4fa['content']){const _0x6d0a73=await this['chatContext']['populateFromMessage'](_0x4fa140);_0x6d0a73&&_0x35a33f['set'](_0x6d0a73['id'],_0x6d0a73);}return _0x35a33f;}async['handleUserInteraction']({userMessage:_0x3b567c,quickActionData:_0x1e8deb}){if(!this['isStarted'])throw new _0x4a8035('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x4a8035('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x377674=this['chatContext']['getPendingContextItems'](),_0x5e8a00=this['chatCapabilities']['getCapabilitiesConfig'](),_0x16658e=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x3b567c,'contextItems':_0x377674,'capabilities':_0x5e8a00,'modelId':_0x16658e,'quickActionData':_0x1e8deb}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x2dee45){this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x2dee45});}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0xc70762,contextItems:_0x3bf4b0,capabilities:_0x116177,modelId:_0x43fe6a,quickActionData:_0x17183a}){const _0x304ae5=new Ui({'userMessage':_0xc70762,'contextItems':_0x3bf4b0,'capabilities':_0x116177,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x43fe6a,'quickActionData':_0x17183a});return _0x304ae5['delegate'](...ne)['to'](this),this['interactions']['push'](_0x304ae5),this['fire']('interactionCreated',_0x304ae5),_0x304ae5;}['getInteraction'](_0x55d878){return this['interactions']['find'](_0x510263=>_0x510263['id']===_0x55d878);}['removeInteraction'](_0x561b35){const _0x317f78=this['getInteraction'](_0x561b35);_0x317f78&&(_0x317f78['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x317f78),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x118ed5){this['chatContext']['addCurrentDocumentToContext'](_0x118ed5);}async['updateCurrentDocumentInContext']({content:_0x4dbaea,version:_0x1a4f24,sessionId:_0x2b1a1e,selections:_0x521e55}){await this['chatContext']['updateCurrentDocument'](_0x4dbaea,_0x1a4f24,_0x2b1a1e,_0x521e55);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0xa9664c){this['chatContext']['addSelectionToContext'](_0xa9664c);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x56e159){this['chatContext']['addFilesToContext'](_0x56e159);}['addUrlToContext'](_0x46877c){this['chatContext']['addUrlToContext'](_0x46877c);}['addResourceToContext'](_0xdb65a7,_0x411573){this['chatContext']['addResourceToContext'](_0xdb65a7,_0x411573);}['loadSourceResources'](_0x1f6c9d,_0x189007,_0x21f183){return this['chatContext']['loadSourceResources'](_0x1f6c9d,_0x189007,_0x21f183);}['removeFromContext'](_0x2194b0){this['chatContext']['removeFromContext'](_0x2194b0);}['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'](_0x2942bd){if(!_0x2942bd)throw new _0x4a8035('ai-chat-conversation-set-model-null',null,{'conversation':this});if(!0x1===await this['chatModels']['isAvailable'](_0x2942bd))throw new _0x4a8035('ai-chat-conversation-set-model-not-available',null,{'conversation':this,'model':_0x2942bd});_0x2942bd['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x2942bd,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x2942bd}));}}function tt(_0x2b7598){if(_0x2b7598 instanceof dt)return _0x2b7598;if(_0x2b7598?.['editors']&&_0x2b7598['editors']['get'](0x0))return _0x2b7598['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.'),_0x2b7598['editors']['get'](0x0);throw new _0x4a8035('ai-get-editor-from-context-no-editor');}const ut='ai-selection';class a extends _0x316379{['_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 _0x262e94=tt(this['context']),_0x88b43a=_0x262e94['plugins']['has']('RealTimeCollaborationClient')&&_0x262e94['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x88b43a||_0x2458fa();}return this['_sessionId'];}['getDocumentData'](){const _0x393e41=tt(this['context']),_0x31884a=_0x393e41['model'],_0x24cebe=_0x393e41['data']['toView'](_0x31884a['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x112de0=new kt(_0x393e41['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x24cebe,_0x112de0);let _0x4fa24e=_0x393e41['data']['processor']['toData'](_0x24cebe);const _0x4265d4=this['_getMarkersInDocumentOrder'](),_0x4ccfcd=[];for(const _0x4357ff of _0x4265d4){const _0x488274='<'+_0x4357ff['name']+':start></'+_0x4357ff['name']+':start>',_0x1ff5fa=_0x4fa24e['indexOf'](_0x488274);_0x4fa24e=_0x4fa24e['substring'](0x0,_0x1ff5fa)+_0x4fa24e['substring'](_0x1ff5fa+_0x488274['length']);const _0x16b670='<'+_0x4357ff['name']+':end></'+_0x4357ff['name']+':end>',_0x587f1a=_0x4fa24e['indexOf'](_0x16b670);_0x4fa24e=_0x4fa24e['substring'](0x0,_0x587f1a)+_0x4fa24e['substring'](_0x587f1a+_0x16b670['length']),_0x4ccfcd['push']({'markerName':_0x4357ff['name'],'start':_0x1ff5fa,'end':_0x587f1a,'htmlFragment':_0x4fa24e['substring'](_0x1ff5fa,_0x587f1a)});}return{'content':_0x4fa24e,'version':_0x393e41['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x4ccfcd};}async['afterInit'](){this['context']instanceof dt?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x24a7d8,_0x2a9860)=>{_0x2a9860['on']('ready',()=>{this['_integrateEditor'](_0x2a9860);});});}['_integrateEditor'](_0x46bd63){_0x46bd63['conversion']['for']('editingDowncast')['markerToHighlight']({'model':ut,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x46bd63['conversion']['for']('dataDowncast')['markerToElement']({'model':ut,'view':(_0x4b56e4,{writer:_0x1f3b79,options:_0x2dc40e})=>_0x2dc40e['convertAiChatSelectionMarker']?_0x1f3b79['createUIElement'](_0x4b56e4['markerName']+':'+(_0x4b56e4['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x43b6d6,_0x480940,_0x1af0af=!0x1,_0xfcece9=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0xfcece9)return!0x1;this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x480940,this['_displayedFakeSelectionLocked']=_0x1af0af;const _0x104fa6=tt(this['context'])['model'];return _0x104fa6['change'](_0x51e5a1=>{let _0x39cef9=0x0;for(let _0xf3127a of _0x43b6d6){const _0x5ea02c=ut+':'+_0x39cef9;if(_0xf3127a['start']['isAtEnd']){const _0x58372a=_0xf3127a['start']['getLastMatchingPosition'](({item:_0x51ab99})=>!_0x104fa6['schema']['isContent'](_0x51ab99),{'boundaries':_0xf3127a});_0xf3127a=_0x51e5a1['createRange'](_0x58372a,_0xf3127a['end']);}_0x51e5a1['addMarker'](_0x5ea02c,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xf3127a}),_0x39cef9++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x3d77ab){if(this['_displayedFakeSelectionId']!=_0x3d77ab)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x5158b0=tt(this['context']),_0x29354f=_0x5158b0['model']['markers']['getMarkersGroup'](ut);return _0x5158b0['model']['change'](_0x26c9f3=>{for(const _0xb49f5d of _0x29354f)_0x26c9f3['removeMarker'](_0xb49f5d);}),!0x0;}['modelToViewWithIds'](_0x24be5f){const _0x1eda22=tt(this['context']),_0x218cd1=_0x1eda22['data']['toView'](_0x24be5f),_0x1fd97a=new kt(_0x1eda22['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x218cd1,_0x1fd97a),_0x218cd1;}['_setDataIdsOnChildren'](_0x38fc7b,_0x14e40e){let _0x148f44=!0x1;const _0x120d2e=new Set();for(const _0x4a4037 of _0x38fc7b['getChildren']()){const _0x194dfe=_0x4a4037['is']('emptyElement')||_0x4a4037['is']('containerElement');if(!_0x4a4037['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x4a4037,_0x14e40e)||_0x194dfe)&&(_0x14e40e['setAttribute']('data-id',this['_nextDataId'](_0x120d2e),_0x4a4037),_0x148f44=!0x0);}return _0x148f44;}['_nextDataId'](_0x32f745){let _0x43b06e;do{_0x43b06e='';for(let _0x82ade2=0x0;_0x82ade2<0x4;_0x82ade2++)_0x43b06e+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x32f745['has'](_0x43b06e));return _0x32f745['add'](_0x43b06e),_0x43b06e;}['getSelectionText'](){const {model:_0x22f8ef}=tt(this['context']),_0x1e424c=_0x22f8ef['document']['selection'],_0x16f347=_0x22f8ef['getSelectedContent'](_0x1e424c),_0x3fa55e=[],_0x15aef5=_0x22f8ef['createRangeIn'](_0x16f347)['getWalker']();for(const {item:_0x70d3c7}of _0x15aef5)_0x70d3c7['is']('$textProxy')?_0x3fa55e['push'](_0x70d3c7['data']):_0x70d3c7['is']('element')&&_0x3fa55e['length']>0x0&&'\x20'!==_0x3fa55e[_0x3fa55e['length']-0x1]&&_0x3fa55e['push']('\x20');return'\x22'+_0x3fa55e['join']('')['trim']()+'\x22';}['_getMarkersInDocumentOrder'](){const _0x475df4=tt(this['context'])['model'];return Array['from'](_0x475df4['markers']['getMarkersGroup'](ut))['sort']((_0x688a28,_0x4f725d)=>_0x688a28['getStart']()['isBefore'](_0x4f725d['getStart']())?-0x1:_0x688a28['getStart']()['isAfter'](_0x4f725d['getStart']())?0x1:0x0);}}class mt extends _0x2f6768(){['_modelList']=[];['_connector'];constructor({connector:_0x578d31}){super(),this['_connector']=_0x578d31;}async['getAll'](){if(!this['_modelList']['length']){const _0x2943b9=this['_connector']['getModels'](),_0x2d6477=(await _0x2943b9['list']())['items']['sort']((_0x314a28,_0x29edc5)=>{const _0x474e20=Object['values'](_0x314a28['capabilities'])['filter'](_0x3a0faa=>_0x3a0faa['enabled'])['length'];return Object['values'](_0x29edc5['capabilities'])['filter'](_0x3a440e=>_0x3a440e['enabled'])['length']-_0x474e20;});this['_modelList']=_0x2d6477;}return this['_modelList'];}async['getDefault'](_0x55e542){const _0xca9d25=await this['getAll']();if(!_0xca9d25['length'])return null;if(_0x55e542){const _0x5b4d19=_0xca9d25['find'](_0x33d324=>_0x33d324['id']===_0x55e542);if(_0x5b4d19)return _0x5b4d19;_0x3a0d50('ai-chat-default-model-id-unrecognized',{'defaultModelId':_0x55e542,'fallBackModelId':_0xca9d25[0x0]['id']});}return _0xca9d25[0x0];}async['isAvailable'](_0x5bafa9){return(await this['getAll']())['some'](_0x2bf3ae=>_0x2bf3ae['name']===_0x5bafa9['name']&&_0x2bf3ae['provider']===_0x5bafa9['provider']);}}function w({editor:_0x479932,interaction:_0x36b572,reply:_0x3c8ef0,groups:_0x50c49f,transform:_0x3af620,documentCompare:_0x5924c0,documentCompareOptions:_0x437eb5}){const _0x19b916=_0x36b572['getDocumentContext']();if(!_0x19b916)return[];const _0x38e462=_0x19b916['content'],_0x4f06ae=_0x19b916['version'],_0x5e73c3=_0x3c8ef0['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0xae30f6}of _0x50c49f){const _0x16f59b=_0xae30f6['filter'](_0x21b03d=>'new'!=_0x21b03d['type'])['map'](_0x35a3e2=>vt('data-id',_0x35a3e2['id'],_0x5e73c3)),_0x387762=_0xae30f6['filter'](_0xa43e5b=>'removed'!=_0xa43e5b['type'])['map'](_0x3ec8c7=>_0x3ec8c7['node']['cloneNode'](!0x0));let _0x32d4e6=null;if(_0x16f59b['length']){_0x32d4e6=_0x16f59b[0x0]['previousSibling'];for(let _0x39213=0x0;_0x39213<_0x16f59b['length'];_0x39213++)_0x21776c(_0x16f59b[_0x39213]);}if(_0x387762['length']){_0x32d4e6||(_0xae30f6[0x0]['anchorId']?_0x32d4e6=vt('data-id',_0xae30f6[0x0]['anchorId'],_0x5e73c3):(_0x32d4e6=_0x387762['shift'](),to(_0x5e73c3,_0x32d4e6)));for(let _0x4f7a4b=0x0;_0x4f7a4b<_0x387762['length'];_0x4f7a4b++)_0x31729b(_0x32d4e6,_0x387762[_0x4f7a4b]),_0x32d4e6=_0x387762[_0x4f7a4b];}}const _0x58c0a0=At(_0x5e73c3),_0x39b53b=_0x5924c0['getDiff'](_0x38e462,_0x58c0a0,_0x437eb5)['getOperations']();if(_0x3af620){const _0x16bad8=_0x479932['model']['document']['history']['getOperations'](_0x4f06ae),_0x483cf6={'document':_0x479932['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x59f1a9(_0x39b53b,_0x16bad8,_0x483cf6)['operationsA'];}return _0x39b53b;}function d({editor:_0x6d39d6,changeGroups:_0x27a743,documentContextContent:_0x216d4a,showDiff:_0x1c117b,trimUnchanged:_0x2df47e=!0x0}){return _0x27a743['map'](_0x3e64a1=>{const _0x574565=new wt([]),_0x40dd61=new wt([]);for(const _0x413c09 of _0x3e64a1['changes'])if(_0x1c117b&&'removed'==_0x413c09['type']||_0x40dd61['children']['push'](_0x413c09['node']['cloneNode'](!0x0)),'new'!=_0x413c09['type']&&(_0x1c117b||'removed'!=_0x413c09['type'])){const _0x18343b=yt(_0x465b1b=>Tt(_0x465b1b,'data-id')==_0x413c09['id'],_0x216d4a,!0x0);_0x18343b&&_0x574565['children']['push'](_0x18343b['cloneNode'](!0x0));}const _0x339571=function(_0x3c433d,_0x5127a5,_0x14f238,_0x1d7d41,_0x30821b=!0x0){const _0x320fb4=_0x3c433d['plugins']['get']('DocumentCompare'),_0x3672ce=_0x3c433d['plugins']['get']('TrackChangesEditing'),_0x12956f=At(_0x5127a5),_0x14cbf1=At(_0x14f238),_0x40ff9f=_0x3c433d['data']['parse'](_0x12956f,'$root'),_0x5d6ce3=_0x3c433d['model']['createPositionAt'](_0x40ff9f,0x0),_0x3e0d93=_0x320fb4['getDiff'](_0x12956f,_0x14cbf1,{'anchor':_0x5d6ce3,'markDeletions':_0x1d7d41}),_0x11875a=_0x3e0d93['getOperations']();if(0x0==_0x11875a['length'])return null;_0x1d7d41?_0x3672ce['_applyOperationsAsSuggestions'](_0x11875a):_0x3c433d['model']['change'](_0x1c1254=>{for(const _0x345b1b of _0x11875a)if('remove'==_0x345b1b['type']){const _0x5a4d1e=_0x345b1b['sourcePosition'],_0x1c4acc=_0x345b1b['howMany'],_0x2cb409=new It(_0x5a4d1e,_0x1c4acc);_0x1c1254['batch']['addOperation'](_0x2cb409),_0x3c433d['model']['applyOperation'](_0x2cb409);}else _0x345b1b['baseVersion']=null,_0x345b1b['isDocumentOperation']=!0x1,_0x1c1254['batch']['addOperation'](_0x345b1b),_0x3c433d['model']['applyOperation'](_0x345b1b);});if(_0x30821b){const _0x580cd8=_t(_0x3c433d,_0x11875a,_0x40ff9f);Ct(_0x3c433d['model'],_0x580cd8),function(_0x421811,_0x252661){const _0x3cd8b8=_0x252661['getFirstRange']()['start'];let _0x1d0c44=_0x252661['getFirstRange']()['end'];const _0x35023d=_0x3cd8b8['root'];(_0x1d0c44['textNode']||_0x1d0c44['nodeAfter']&&_0x1d0c44['nodeAfter']['is']('$text'))&&(_0x3994a3(_0x1d0c44,'...'),_0x1d0c44=_0x1d0c44['getShiftedBy'](0x3)),(_0x3cd8b8['textNode']||_0x3cd8b8['nodeBefore']&&_0x3cd8b8['nodeBefore']['is']('$text'))&&(_0x3994a3(_0x3cd8b8,'...'),function(_0x36355c,_0x26e393,_0x32ad94){for(let [_0x15954c,_0x215a50]of _0x36355c['markers']){const _0x501b39=_0x215a50['_getTransformedByInsertion'](_0x26e393,_0x32ad94,!0x1);_0x215a50=_0x501b39[0x0],_0x36355c['markers']['set'](_0x15954c,_0x215a50);}}(_0x35023d,_0x3cd8b8,0x3),_0x3cd8b8['parent']==_0x1d0c44['parent']&&(_0x1d0c44=_0x1d0c44['getShiftedBy'](0x3)));const _0x2dd21d=_0x421811['createRange'](_0x421811['createPositionAt'](_0x35023d,0x0),_0x3cd8b8),_0x57ab63=_0x421811['createRange'](_0x1d0c44,_0x421811['createPositionAt'](_0x35023d,'end')),_0x523589=[..._0x2dd21d['getMinimalFlatRanges'](),..._0x57ab63['getMinimalFlatRanges']()];_0x523589['reverse']();for(const _0x2097eb of _0x523589)_0x3a9e1b(_0x2097eb),qn(_0x35023d,_0x2097eb);}(_0x3c433d['model'],_0x580cd8);}const _0x417c38=_0x3c433d['data']['stringify'](_0x40ff9f,{'showSuggestionHighlights':!0x0});return sr(_0x417c38);}(_0x6d39d6,_0x574565,_0x40dd61,_0x1c117b,_0x2df47e);return{'type':_0x3e64a1['changes'][0x0]['type'],'index':_0x3e64a1['index'],'content':_0x339571};});}function _t(_0x308e01,_0x2c3c69,_0x118111){const _0x466718=_0x308e01['plugins']['get']('DocumentCompare');let _0x12bbab=_0x308e01['model']['createPositionAt'](_0x118111,Number['POSITIVE_INFINITY']),_0xe6933=_0x308e01['model']['createPositionAt'](_0x118111,0x0);for(const _0x8b355a of _0x2c3c69){let _0x53798f,_0x58e679;if(_0x466718['isMarkedRemoveOperation'](_0x8b355a))_0x53798f=_0x8b355a['newRange']['start'],_0x58e679=_0x8b355a['newRange']['end'];else switch(_0x8b355a['type']){case'rename':_0x53798f=_0x8b355a['position'],_0x58e679=_0x53798f['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x53798f=_0x8b355a['range']['start'],_0x58e679=_0x8b355a['range']['end'];break;case'insert':_0x53798f=_0x8b355a['position'],_0x58e679=_0x53798f['getShiftedBy'](_0x8b355a['howMany']);break;case'split':_0x53798f=_0x8b355a['splitPosition'],_0x58e679=_0x8b355a['moveTargetPosition'];break;case'merge':{const _0xc87579=_0x8b355a['targetPosition']['path']['slice'](-0x1);_0x53798f=_0x308e01['model']['createPositionFromPath'](_0x118111,_0xc87579),_0x58e679=_0x53798f['getShiftedBy'](0x1);break;}case'remove':{const _0x3af60a=_0x8b355a['howMany'],_0x2756ff=_0x8b355a['sourcePosition']['_getTransformedByInsertion'](_0x8b355a['targetPosition'],_0x3af60a),_0x7ff090=_0x8b355a['getMovedRangeStart']();'remove'==_0x8b355a['type']?(_0x53798f=_0x2756ff,_0x58e679=_0x2756ff):(_0x53798f=_0x7ff090,_0x58e679=_0x7ff090['getShiftedBy'](_0x3af60a));break;}}_0x53798f&&_0x53798f['isBefore'](_0x12bbab)&&(_0x12bbab=_0x53798f),_0x58e679&&_0x58e679['isAfter'](_0xe6933)&&(_0xe6933=_0x58e679);}return _0x308e01['model']['createSelection'](_0x308e01['model']['createRange'](_0x12bbab,_0xe6933));}function Ct(_0x2aaafe,_0x507768){Ke(_0x2aaafe,_0x507768,'forward');const _0x340e50=_0x507768['getFirstRange']();_0x507768['setTo']([]),_0x507768['setTo'](_0x340e50,{'backward':!0x0}),Ke(_0x2aaafe,_0x507768,'backward');}function Ke(_0x7c1b3a,_0x3fb123,_0x4f5d53){let _0x5ae55d=0x14;for(;_0x5ae55d;){_0x7c1b3a['modifySelection'](_0x3fb123,{'unit':'word','direction':_0x4f5d53}),_0x5ae55d--;const _0x43aca6=_0x3fb123['focus']['forward'==_0x4f5d53?'nodeBefore':'nodeAfter'];if(_0x43aca6&&_0x43aca6['is']('element')&&_0x7c1b3a['schema']['isBlock'](_0x43aca6)&&_0x7c1b3a['schema']['isObject'](_0x43aca6))break;}}function qn(_0x3b8917,_0x1b9c65){for(let [_0x21d6d0,_0x1c727f]of _0x3b8917['markers'])_0x1c727f=_0x1c727f['_getTransformedByDeletion'](_0x1b9c65['start'],_0x1b9c65['end']['offset']-_0x1b9c65['start']['offset']),_0x3b8917['markers']['set'](_0x21d6d0,_0x1c727f);}class rh extends _0x24bea5{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x5cd366,_0x3bb92a={},_0x3019e2){super(_0x5cd366),this['set']('isLoading',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x3bb92a};const _0x51e7e2=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x51e7e2?'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'](_0x3019e2),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 _0x155a80(this['locale']),this['likeButton']['set']({'icon':_0x307234,'label':Yn(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x39f5e4=>!_0x39f5e4),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x155a80(this['locale']),this['dislikeButton']['set']({'icon':_0x239612,'label':Yn(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x1ed2f3=>!_0x1ed2f3),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x155a80(this['locale']),this['copyButton']['set']({'icon':_0x12d5ff,'label':Yn(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x3a08e7=>!_0x3a08e7);const _0x25cf57=new _0x29aaa9();_0x25cf57['set']({'content':_0x37c028}),_0x25cf57['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'](_0x25cf57);}['_setupShowChangesButton'](_0x1be15a){this['showChangesButton']=new _0x155a80(this['locale']),this['showChangesButton']['set']({'icon':_0xaffe2e,'label':Yn(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'isOn':_0x1be15a}),this['showChangesButton']['bind']('isEnabled')['to'](this,'isLoading',_0x568d82=>!_0x568d82),this['showChangesButton']['on']('execute',()=>{const _0x4b5525=!this['showChangesButton']['isOn'];this['showChangesButton']['set']({'isOn':_0x4b5525,'icon':_0x4b5525?_0x404179:_0xaffe2e}),this['fire']('toggleShowChanges',_0x4b5525);});}}class ch extends _0x7ecbb5{['showChangesToggleView'];constructor(_0x107f80,_0x1a0561){super(_0x107f80),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new $n(_0x107f80),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle','label':Yn(_0x107f80,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x1a0561['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x2cba40=>_0x2cba40?_0x192c0a:_0x3d9e18),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x43c42c=new _0x29aaa9();_0x43c42c['content']=_0x1a2e5f,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x1a0561['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x43c42c,{'tag':'span','children':[Yn(_0x107f80,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class $n extends _0x155a80{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}class sa{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;constructor(_0x2f9f36){this['options']={'delay':_0x2f9f36['delay']??0x14,'textNodeStyle':_0x2f9f36['textNodeStyle'],'onStreamUpdate':_0x2f9f36['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x4da0af,targetElement:_0x1fe119,abortSignal:_0x5b8a04}){this['isStreaming']&&this['stop'](),_0x5b8a04?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x4da27b(_0x4da0af,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(_0x3a0d50('html-streamer-current-index-out-of-bounds',{'currentIndex':this['currentIndex'],'nodeList':this['nodesList']}),this['currentIndex']=this['nodesList']['length']);for(let _0x28424a=0x0;_0x28424a<this['currentIndex'];_0x28424a++)this['nodesList'][_0x28424a]['shouldBeStreamed']=!0x0;let _0xc7a0ef=0x0;for(let _0x573650=this['currentIndex'];_0x573650<this['nodesList']['length'];_0x573650++){const _0x3de007=Date['now'](),_0x3894b0=this['nodesList'][_0x573650],_0x3d8a1a=_0x3de007-_0xc7a0ef;_0x3894b0['shouldBeStreamed']=!0x0;let _0x536b56=_0x3894b0['parent'];for(;_0x536b56;)_0x536b56['shouldBeStreamed']=!0x0,_0x536b56=_0x536b56['parent'];if(_0x3d8a1a<this['options']['delay'])try{const {promise:_0xf6f386,abortController:_0x116907}=ar(this['options']['delay']-_0x3d8a1a);this['timeoutAbortController']=_0x116907,await _0xf6f386;}catch(_0x38b8b5){return;}_0x706d3a(_0x1fe119,'<'+_0x1fe119['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x1fe119['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']=_0x573650,_0xc7a0ef=Date['now']();}this['isStreaming']=!0x1;}['cleanUpAnimations']({targetElement:_0x323a4f}){Array['from'](_0x323a4f['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x5aadf5=>{_0x5aadf5['replaceWith'](_0x5aadf5['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x2d66f4){let _0x17a96d='';if(function(_0x36db24){return _0x23da46(_0x36db24);}(_0x2d66f4)){for(const _0x547469 of _0x2d66f4['children'])_0x17a96d+=this['renderNode'](_0x547469);}else{if(ur(_0x2d66f4)){if(!_0x2d66f4['shouldBeStreamed'])return'';const _0x23e8bb=_0x2d66f4,_0x4dc080=Object['entries'](_0x23e8bb['attribs'])['map'](([_0x3206ce,_0x455f89])=>_0x3206ce+'=\x22'+_0x455f89+'\x22')['join']('\x20');_0x17a96d+='<'+_0x23e8bb['tagName']+(_0x4dc080?'\x20'+_0x4dc080:'')+'>';for(const _0x310e46 of _0x324aa7(_0x23e8bb))_0x17a96d+=this['renderNode'](_0x310e46);_0x17a96d+='</'+_0x23e8bb['tagName']+'>';}else{if(!lr(_0x2d66f4))return'';if(!_0x2d66f4['shouldBeStreamed'])return'';!function(_0x2ea9d2){if(!_0x2ea9d2['parent']||!ur(_0x2ea9d2['parent']))return!0x1;if(!cr['includes'](_0x2ea9d2['parent']['tagName']))return!0x1;return!_0x1d0859(_0x2ea9d2)['match'](/^\s*[<>]\s*$/);}(_0x2d66f4)?_0x17a96d+=_0xbd2e84(_0x2d66f4):_0x17a96d+=_0xbd2e84(new _0x49ffc0('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x2d66f4]));}}return _0x17a96d;}['getParsedDocumentNodeList'](){const _0x21ebf7=[];return function(_0x46ac79,_0x4ac441){const _0xe53286=_0x158c3b=>{if(_0x4ac441(_0x158c3b),_0x158c3b instanceof _0x51e3e9)for(let _0x201712=0x0;_0x201712<_0x158c3b['children']['length'];_0x201712++){const _0x4ae6e5=_0x158c3b['children'][_0x201712];_0xe53286(_0x4ae6e5);}};for(let _0xe3a33=0x0;_0xe3a33<_0x46ac79['children']['length'];_0xe3a33++)_0xe53286(_0x46ac79['children'][_0xe3a33]);}(this['document'],_0xd02882=>{if(lr(_0xd02882)){const _0x42f471=this['splitTextNodeIntoWordNodes'](_0xd02882);_0x42f471['length']&&_0x21ebf7['push'](..._0x42f471);}_0xd02882['isWordSplitSource']||_0xd02882['isWordSplitResult']||_0x21ebf7['push'](_0xd02882);}),_0x21ebf7;}['splitTextNodeIntoWordNodes'](_0x1b6f0d){if(_0x1b6f0d['isWordSplitSource']||_0x1b6f0d['isWordSplitResult'])return[];const _0x1ba6fa=_0x1d0859(_0x1b6f0d)['match'](/(?:\s*\S+\s*)/g),_0x554ff8=[];if(_0x1ba6fa&&_0x1ba6fa['length']>0x1){for(const _0x308159 of _0x1ba6fa){const _0x443df6=new _0x3b69e4(_0x308159);_0x443df6['isWordSplitResult']=!0x0,_0x3a9005(_0x1b6f0d,_0x443df6),_0x554ff8['push'](_0x443df6);}_0x1b6f0d['isWordSplitSource']=!0x0,_0x21776c(_0x1b6f0d);}return _0x554ff8;}}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 lr(_0x52808f){return tn(_0x52808f);}function ur(_0x3318e8){return _0xc13be1(_0x3318e8);}function ar(_0x5479cb){const _0x4aa11b=new AbortController();return{'promise':new Promise((_0x3e2974,_0x2b3872)=>{const _0x1d94e2=setTimeout(_0x3e2974,_0x5479cb);_0x4aa11b['signal']['addEventListener']('abort',()=>{clearTimeout(_0x1d94e2),_0x2b3872();});}),'abortController':_0x4aa11b};}const Ce=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'];class Ar extends _0x7ecbb5{['htmlStreamer'];['children'];['headerView'];['contentView'];constructor(_0x195bbd,{part:_0x154a99,areActionsDisabled:_0x461781}){super(_0x195bbd),this['set']('partDefinition',_0x154a99),this['set']('state','pending'),this['set']('isVisible',!0x1),this['bind']('isEnabled')['to'](this,'state',_0x2cc983=>'pending'==_0x2cc983&&!_0x461781),this['children']=this['createCollection'](),this['htmlStreamer']=new sa({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['headerView']=new In(_0x195bbd,_0x154a99),this['headerView']['bind']('partDefinition')['to'](this),this['headerView']['bind']('isEnabled')['to'](this),this['headerView']['bind']('state')['to'](this),this['headerView']['delegate'](...Ce)['to'](this);const _0xa72c39=this['bindTemplate'];this['contentView']=new _0x7ecbb5(),this['contentView']['setTemplate']({'tag':'div','attributes':{'class':['ck','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',_0xa72c39['to']('state',_0x462bdb=>'ck-ai-suggestion__body__content-part_'+_0x462bdb),_0xa72c39['to']('isEnabled',_0xaec89c=>_0xaec89c?'ck-ai-suggestion__body__content-part_active':void 0x0),_0xa72c39['if']('isVisible','ck-hidden',_0x42cdbf=>!_0x42cdbf)]},'children':this['children'],'on':{'mouseenter':_0xa72c39['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x154a99['index']});}),'mouseleave':_0xa72c39['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x154a99['index']});})}});}async['updateContent']({part:_0x3adf35,renderingStrategy:_0x5dee61,abortSignal:_0x960e1}){this['partDefinition']=_0x3adf35,this['isVisible']=!!this['partDefinition']['content'],this['partDefinition']['content']&&('streaming'===_0x5dee61?await this['htmlStreamer']['stream']({'document':this['partDefinition']['content'],'targetElement':this['contentView']['element'],'abortSignal':_0x960e1}):this['contentView']['element']['innerHTML']=At(this['partDefinition']['content']));}['toggleHeader'](_0x354807){_0x354807?this['children']['has'](this['headerView'])||this['children']['add'](this['headerView'],0x0):this['children']['has'](this['headerView'])&&this['children']['remove'](this['headerView']);}}class In extends _0x7ecbb5{['children'];['_toolbarView'];['_iconStateAccepted'];['_iconStateRejected'];constructor(_0xf641a1,_0x1ec045){super(_0xf641a1),this['set']('partDefinition',_0x1ec045),this['set']('isEnabled',!0x0),this['set']('state','pending');const _0x2bbcd9=new _0x29aaa9();_0x2bbcd9['content']=_0x5e03fb,_0x2bbcd9['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-title']}});const _0x107ac7=new _0x155a80(_0xf641a1);_0x107ac7['set']({'label':Yn(_0xf641a1,'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT'),'tooltip':!0x0,'withText':!0x1,'icon':_0x4be45b}),_0x107ac7['bind']('isEnabled')['to'](this),_0x107ac7['on']('execute',()=>{this['fire']('showChangeInText',{'index':_0x1ec045['index']});});const _0x303c57=new _0x155a80(_0xf641a1);_0x303c57['set']({'label':Yn(_0xf641a1,'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION'),'tooltip':!0x0,'withText':!0x1,'icon':_0x23df72}),_0x303c57['bind']('isEnabled')['to'](this),_0x303c57['on']('execute',()=>{this['fire']('insertSuggestion',{'index':_0x1ec045['index']});});const _0x57dcc5=new _0x155a80(_0xf641a1);_0x57dcc5['set']({'label':Yn(_0xf641a1,'AI_SUGGESTION_CONTENT_PART_DELETE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x57ec11}),_0x57dcc5['on']('execute',()=>{this['fire']('rejectSuggestion',{'index':_0x1ec045['index']});}),_0x57dcc5['bind']('isEnabled')['to'](this),this['_toolbarView']=new _0x24bea5(_0xf641a1),this['_toolbarView']['items']['addMany']([_0x107ac7,_0x303c57,_0x57dcc5]),this['_iconStateAccepted']=new _0x29aaa9(),this['_iconStateAccepted']['content']=_0x150120,this['_iconStateAccepted']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-accepted'],'data-cke-tooltip-text':Yn(_0xf641a1,'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED'),'data-cke-tooltip-position':'n'}}),this['_iconStateRejected']=new _0x29aaa9(),this['_iconStateRejected']['content']=_0x21baee,this['_iconStateRejected']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-rejected'],'data-cke-tooltip-text':Yn(_0xf641a1,'AI_SUGGESTION_CONTENT_PART_REJECTED'),'data-cke-tooltip-position':'n'}});const _0x4062ef=new _0x7ecbb5(_0xf641a1);_0x4062ef['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[Yn(_0xf641a1,'AI_SUGGESTION_CONTENT_PART_TITLE',(_0x1ec045['index']+0x1)['toString']())]}),this['children']=this['createCollection'](),this['children']['addMany']([_0x2bbcd9,_0x4062ef,this['_toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title']},'children':this['children']}),this['on']('change:state',(_0x46da35,_0x3d7ec2,_0xf4f4c8,_0x5eff8f)=>{switch(_0x5eff8f){case'pending':this['children']['remove'](this['_toolbarView']);break;case'accepted':this['children']['remove'](this['_iconStateAccepted']);break;case'rejected':this['children']['remove'](this['_iconStateRejected']);}switch(_0xf4f4c8){case'pending':this['children']['add'](this['_toolbarView']);break;case'accepted':this['children']['add'](this['_iconStateAccepted']);break;case'rejected':this['children']['add'](this['_iconStateRejected']);}});}}class g extends _0x2f6768(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x102469){const _0xf451ca=this['createTask'](_0x102469);return this['queue']['push'](_0xf451ca),this['_processQueue'](),_0xf451ca['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(_0x31c420=>{this['once']('_queueEmpty',()=>{_0x31c420();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x89f779=this['queue']['shift']();try{await _0x89f779['callback'](this['_abortController']['signal']),_0x89f779['resolve']();}catch(_0x1c8025){_0x89f779['reject'](_0x1c8025);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x2d4342){let _0x5c7a27,_0x223b27;const _0x295af6=new Promise((_0x1832b3,_0x3caca1)=>{_0x5c7a27=_0x1832b3,_0x223b27=_0x3caca1;});return{'callback':_0x2d4342,'resolve':_0x5c7a27,'reject':_0x223b27,'completePromise':_0x295af6};}}class Cr extends _0x7ecbb5{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x16479c){super();const _0x1eef60=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new sa({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0x16479c,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x1eef60['if']('isDone','ck-ai-chat__feed__item_done'),_0x1eef60['if']('isVisible','ck-hidden',_0x21add2=>!_0x21add2),'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'](_0x537901=>{_0x537901['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x590b67,_0xe02849,_0x127bae){await this['htmlStreamer']['stream']({'document':_0x590b67,'targetElement':_0xe02849,'abortSignal':_0x127bae});}}class _e extends Cr{constructor(_0x1a6b17){super(_0x1a6b17),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-error','warning'===_0x1a6b17['level']?'ck-ai-chat-error_warning':'']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x2d09b9){this['element']['innerHTML']=_0x2d09b9;}}class dh extends _0x7ecbb5{['_children'];['_areActionsDisabled'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];constructor(_0x42101d,{areActionsDisabled:_0x5c1d42}){super(_0x42101d),this['_areActionsDisabled']=_0x5c1d42,this['set']('hasPendingParts',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new g(),this['_emptyPartsWarningView']=new _e({'id':'empty-parts-warning','initialContent':Yn(_0x42101d,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-suggestion__body','ck-content']},'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:_0x3c6de0,renderingStrategy:_0x503019,abortSignal:_0x2512ff}){for(const _0x4c784a of _0x3c6de0)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x305337=>{let _0x1875ed=this['_children']['find'](_0xf8968e=>_0xf8968e['partDefinition']['index']==_0x4c784a['index']);_0x1875ed||(_0x1875ed=new Ar(this['locale'],{'part':_0x4c784a,'areActionsDisabled':this['_areActionsDisabled']}),_0x1875ed['delegate'](...Ce)['to'](this),this['_children']['add'](_0x1875ed),this['hasPendingParts']=!0x0),0x2===this['_children']['length']&&this['_children']['first']['toggleHeader'](!0x0),_0x1875ed['toggleHeader'](this['_children']['length']>0x1),await _0x1875ed['updateContent']({'part':_0x4c784a,'renderingStrategy':_0x503019,'abortSignal':_0x305337});});return _0x2512ff?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x5ce862,_0x4e4eaf){this['_children']['get'](_0x5ce862)['state']=_0x4e4eaf,this['hasPendingParts']='pending'==_0x4e4eaf||Array['from'](this['_children'])['some'](_0x2e5878=>'pending'==_0x2e5878['state']);}['getPartView'](_0x19f847){return this['_children']['get'](_0x19f847);}['markAsDone'](){const _0x93d9da=!this['_children']['find'](_0x46c1b9=>!!_0x46c1b9['partDefinition']['content']),_0x3af8c6=!!this['_children']['find'](_0x38af25=>!_0x38af25['partDefinition']['content']);this['_emptyPartsWarningView']['isVisible']=_0x3af8c6,_0x93d9da?this['_emptyPartsWarningView']['setContent'](Yn(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](Yn(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}get['hasNonEmptyParts'](){return!!this['_children']['find'](_0x9d1fe2=>!!_0x9d1fe2['partDefinition']['content']);}}class Si extends _0x4412dd{constructor(_0x2a8b5b=void 0x0){super();const _0x2d1cf5=_0x2a8b5b?'ck-ai-spinner_'+_0x2a8b5b:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x2d1cf5]}});}}class s extends _0x7ecbb5{['bodyView'];['children'];['headerView'];['miniToolbarView'];['loaderView'];['sourcesView'];constructor(_0x309107,{showDiff:_0x5f49b3,areActionsDisabled:_0x20b50f,miniToolbarConfig:_0x2b478c,hideHeader:_0x218f37,showLoader:_0x3d230d}){super(_0x309107),this['set']('areChangesVisible',!0x1),this['set']('isLoaderVisible',!!_0x3d230d),this['set']('isLoading',!0x1),this['children']=this['createCollection'](),_0x218f37||(this['headerView']=new ch(_0x309107,{'showDiff':_0x5f49b3}),this['headerView']['on']('toggleShowChanges',(_0x4f9a05,_0x488d32)=>{this['areChangesVisible']=_0x488d32['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x488d32['isOn']});}),this['children']['add'](this['headerView'])),this['bodyView']=new dh(_0x309107,{'areActionsDisabled':_0x20b50f}),this['bodyView']['delegate'](...Ce)['to'](this),this['bodyView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoaderVisible','ck-hidden')]}}),this['miniToolbarView']=new rh(_0x309107,_0x2b478c,_0x5f49b3),this['miniToolbarView']['delegate'](...Ce)['to'](this),this['miniToolbarView']['on']('toggleShowChanges',(_0x10a005,_0x848f9d)=>{this['areChangesVisible']=_0x848f9d,this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x848f9d});}),this['miniToolbarView']['bind']('isLoading')['to'](this),this['children']['add'](this['bodyView']),this['children']['add'](this['miniToolbarView']),this['sourcesView']=new jr(this['locale']),this['children']['add'](this['sourcesView']),_0x3d230d&&(this['loaderView']=this['_createLoaderView'](),this['children']['add'](this['loaderView'])),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x566ad9){await this['bodyView']['updateContentParts'](_0x566ad9);}['updateSources'](_0x1a43e0){this['sourcesView']['children']['addMany'](_0x1a43e0['map'](_0x31f2fc=>new Sr(this['locale'],_0x31f2fc))),this['sourcesView']['displayHeader']=!0x0;}['showLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x0);}['hideLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x1);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['_createLoaderView'](){const _0x141454=new _0x7ecbb5(this['locale']),_0x315ca8=new Si('small');_0x315ca8['isVisible']=!0x0;const _0x254577=new _0x7ecbb5(this['locale']);return _0x254577['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[Yn(this['locale'],'AI_CHAT_IS_WRITING')]}),_0x141454['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isLoaderVisible','ck-hidden',_0x3dc648=>!_0x3dc648)]},'children':[_0x315ca8,_0x254577]}),_0x141454;}}class jr extends _0x7ecbb5{['children'];constructor(_0x337c80){super(_0x337c80),this['children']=this['createCollection'](),this['set']('displayHeader',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources']},'children':this['children']});const _0x374a2a=new _0x7ecbb5(this['locale']),_0x337191=new _0x29aaa9();_0x337191['content']=_0x125eea,_0x374a2a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header',this['bindTemplate']['if']('displayHeader','ck-hidden',_0x5db6a1=>!_0x5db6a1)]},'children':[_0x337191,{'tag':'span','children':[{'text':'Sources'}]}]}),this['children']['add'](_0x374a2a);}}class Sr extends _0x155a80{constructor(_0x4f9c1c,_0x5c766d){super(_0x4f9c1c),this['set']({'icon':_0x125eea,'label':_0x5c766d['title'],'tooltip':_0x5c766d['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});}}class ls extends _0x24bea5{constructor(_0x5603d7,_0x3493ff=!0x0,_0x307f55=!0x0){super(_0x5603d7),this['set']('isLoading',!0x1),_0x3493ff&&(this['applyButton']=this['_createButton'](Yn(_0x5603d7,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x100454=>!_0x100454),this['items']['add'](this['applyButton'])),_0x307f55&&(this['suggestButton']=this['_createButton'](Yn(_0x5603d7,'AI_BALLOON_SUGGEST_BUTTON'),'ck-ai-button-secondary'),this['suggestButton']['bind']('isEnabled')['to'](this,'isLoading',_0x4ab802=>!_0x4ab802),this['items']['add'](this['suggestButton'])),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['_createButton'](_0xe92983,_0x2c52d7){const _0x14d0d9=new _0x155a80(this['locale']);return _0x14d0d9['set']({'label':_0xe92983,'class':_0x2c52d7||'','isVisible':!0x0,'withText':!0x0}),_0x14d0d9;}}class ds extends _0x7ecbb5{constructor(_0x5e6b66){super(_0x5e6b66),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':Yn(_0x5e6b66,'AI_DISCLAIMER_TEXT')}]}]});}}const X=['applySuggestion','insertSuggestion','showNext','showPrevious'];class Y extends _0x7ecbb5{['focusTracker'];['keystrokes'];['focusCycler'];['_focusables'];constructor(_0x1f068e,_0x3e982b){super(_0x1f068e),this['set']('isLoading',!0x1),this['focusTracker']=new _0x30a616(),this['keystrokes']=new _0xf37da3(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x5883a2({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0xa841d5(),this['_addContentView'](_0x3e982b['mainView']),this['_addDisclaimerView'](),this['_addToolbar'](_0x3e982b['showApplyButton'],_0x3e982b['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']});}['render'](){super['render']();for(const _0x2fbff9 of this['_focusables'])this['focusTracker']['add'](_0x2fbff9['element']);this['keystrokes']['listenTo'](this['element']);}['focus'](_0x253aad){-0x1===_0x253aad?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['setupRotator'](_0xd42028){const _0x197c7d=this['_createNextButtonView'](),_0x4eeaa6=this['_createPreviousButtonView']();_0xd42028['view']['headerView']['children']['add'](_0x197c7d,0x2),_0xd42028['view']['headerView']['children']['add'](_0x4eeaa6,0x0),this['_focusables']['addMany']([_0x197c7d,_0x4eeaa6]),this['focusTracker']['add'](_0x197c7d['element']),this['focusTracker']['add'](_0x4eeaa6['element']);}['_addContentView'](_0x555276){this['_mainView']=_0x555276,this['_dialogContent']['add'](this['_mainView']);}['_addDisclaimerView'](){this['disclaimerView']=new ds(this['locale']),this['_dialogContent']['add'](this['disclaimerView']);}['_addToolbar'](_0x1eae82=!0x0,_0xc92ec3=!0x0){this['toolbar']=new ls(this['locale'],_0x1eae82,_0xc92ec3),this['toolbar']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['toolbar']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_dialogContent']['add'](this['toolbar']);}['_createNextButtonView'](){const _0x3aa31d=new _0x155a80(this['locale']);return _0x3aa31d['set']({'icon':_0x32487b,'tooltip':Yn(this['locale'],'AI_BALLOON_NEXT_TOOLTIP')}),_0x3aa31d['on']('execute',()=>{this['fire']('showNext');}),_0x3aa31d;}['_createPreviousButtonView'](){const _0x38c03e=new _0x155a80(this['locale']);return _0x38c03e['set']({'icon':_0x3454be,'tooltip':Yn(this['locale'],'AI_BALLOON_PREVIOUS_TOOLTIP')}),_0x38c03e['on']('execute',()=>{this['fire']('showPrevious');}),_0x38c03e;}}class m extends _0x316379{static get['requires'](){return[o,a];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_config'];['open'](_0x20b61){const _0x4a0c16=tt(this['context']);this['_config']=_0x20b61,this['balloonView']=new Y(_0x4a0c16['locale'],_0x20b61),this['balloonView']['delegate'](...X)['to'](this),this['_showDialog'](_0x20b61);}['close'](){tt(this['context'])['plugins']['get']('Dialog')['hide']();}['_setupVisualSelection'](_0xeddbb1,_0xb1bbdc){this['context']['plugins']['get'](a)['showFakeVisualSelection'](_0xeddbb1,'ai-balloon-'+_0xb1bbdc,!0x0,!0x0);}['_showDialog'](_0x299f78){const _0x241c2e=tt(this['context']);this['_setupVisualSelection'](_0x299f78['ranges'],_0x299f78['index']),_0x241c2e['plugins']['get']('Dialog')['show']({'title':_0x299f78['title'],'icon':_0x299f78['icon'],'hasCloseButton':!0x0,'id':'aiBalloon','position':this['_calculateDialogPosition']['bind'](this),'className':'ai-balloon'+(_0x299f78['showRotator']?'\x20ai-balloon-rotator':''),'content':this['balloonView'],'onShow':_0x3394ea=>{_0x299f78['showRotator']&&this['balloonView']['setupRotator'](_0x3394ea),this['isOpen']=!0x0;},'onHide':()=>{this['context']['plugins']['get']('AIEditing')['hideFakeVisualSelection']('ai-balloon-'+_0x299f78['index']),this['fire']('dialogClosed'),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x189fc7,_0x391a08){const _0x19e5a7=tt(this['context']);if(!_0x391a08)return{'left':0x0,'top':0x0};const _0x2188e7=_0x19c4e6(_0x19e5a7['editing'],[..._0x19e5a7['model']['markers']['getMarkersGroup']('ai-selection'),..._0x19e5a7['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);if(!_0x2188e7||0x0===_0x2188e7['length'])return{'left':Math['round'](_0x391a08['left']+_0x391a08['width']/0x2-_0x189fc7['width']/0x2),'top':Math['round'](_0x391a08['top']+_0x391a08['height']/0x2-_0x189fc7['height']/0x2)};const _0x418a0d=Math['round'](_0x391a08['left']+_0x391a08['width']/0x2-_0x189fc7['width']/0x2),_0x45b612=_0x2188e7[0x0]['getBoundingClientRect'](),_0x359697=_0x2188e7[_0x2188e7['length']-0x1]['getBoundingClientRect'](),_0xe0fb1e=_0x189fc7['height'],_0x3a3369=this['_config']['showRotator']?0x8:0x0;return{'left':_0x418a0d,'top':this['_calculateOptimalTopPosition'](_0x45b612,_0x359697,_0xe0fb1e,_0x3a3369)};}['_calculateOptimalTopPosition'](_0x4a2e3f,_0x191fab,_0x2b6764,_0x385110=0x0){const _0x425780=_0x191fab['top']+_0x191fab['height'],_0x34033b=_0x4a2e3f['top']-_0x2b6764-_0x385110,_0x202b9c=window['innerHeight']-_0x425780-0xa,_0x5dc65e=_0x4a2e3f['top']-_0x385110-0xa;let _0x5e82c4;if(_0x202b9c>=_0x2b6764)_0x5e82c4=_0x425780+0xa;else{if(_0x5dc65e>=_0x2b6764)_0x5e82c4=_0x34033b-0xa;else _0x5e82c4=_0x4a2e3f['top']+(_0x191fab['top']+_0x191fab['height'])/0x2-(_0x2b6764+_0x385110)/0x2;}return _0x5e82c4;}}class st extends _0x316379{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_batchToChanges']=new Map();['_previewedChangeGroup']=null;['_balloonShowDiff']=!0x1;static get['requires'](){return[o,m,_0x2423ad];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new mt({'connector':this['_aiConnector']});const _0x1b7b4b=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_handleStartConversation']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x4ce512,_0x4f5ba5)=>{this['_handleUIUserMessage']({'userMessage':_0x4f5ba5});}),this['listenTo'](_0x1b7b4b,'resizedTabs',(_0x1723c5,_0x4729d5)=>{this['_setIsMaximized'](_0x4729d5);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x1b7b4b['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['activeConversation']?.['addCurrentDocumentToContext'](Yn(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0xca8a8c,_0x1cb820)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x1cb820));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x289358,_0x165c9e)=>{this['activeConversation']?.['addUrlToContext'](_0x165c9e);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x3a07d9,_0x4e6f94)=>{this['activeConversation']?.['addResourceToContext'](_0x4e6f94['source'],_0x4e6f94['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x4a7cec,_0x4fc738)=>{this['_removeFromContext'](_0x4fc738);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x3af58e,_0x3a95ae)=>{this['activeConversation']?.['loadSourceResources'](_0x3a95ae['sourceId'],_0x3a95ae['query'],_0x3a95ae['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x557d39,_0x2879ff)=>{this['activeConversation']?.['setModel'](_0x2879ff);}),this['listenTo'](this['_aiChatUi'],'like',(_0x1d30cf,{replyId:_0xa27e63})=>{console['log']('Liked\x20response',_0xa27e63);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x1d8531,{replyId:_0x626a8})=>{console['log']('Disliked\x20response',_0x626a8);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x4a874c,_0x28b170)=>{this['context']['plugins']['get'](m)['close'](),this['_insertSuggestion'](_0x28b170);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x377d79,{replyId:_0x4eb9d7,partIndex:_0x569402})=>{this['_balloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x4eb9d7,_0x569402);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x5efa0b,{replyId:_0x25a70b,partIndex:_0x33cd30})=>{const _0x3119df=this['_getDocumentRangeForReplyChanges'](_0x25a70b,_0x33cd30);_0x3119df&&'$graveyard'!=_0x3119df['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x3119df['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x1452c1,_0x2a0d76)=>{this['context']['plugins']['get'](m)['close'](),this['_applySuggestion'](_0x2a0d76);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x11f526,_0x271b2f)=>{const {reply:_0x3964bb}=this['getInteractionAndReplyById'](_0x271b2f['replyId']),_0x308e51=d({'editor':tt(this['context']),'changeGroups':_0x3964bb['changeGroups'],'documentContextContent':_0x3964bb['documentContextContent'],'showDiff':_0x271b2f['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x3964bb['id'],'parts':_0x308e51,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x56953f,{replyId:_0x3461e2,partIndex:_0xed4e3a})=>{this['_previewedChangeGroup']?.['replyId']==_0x3461e2&&this['_previewedChangeGroup']?.['partIndex']==_0xed4e3a&&this['context']['plugins']['get'](m)['close']();const {reply:_0x19a04d}=this['getInteractionAndReplyById'](_0x3461e2);_0x19a04d['setChangeGroupState'](_0xed4e3a,'rejected'),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');});}async['afterInit'](){this['context']instanceof dt?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0xebb25,_0xf7b173)=>{_0xf7b173['on']('ready',()=>{this['_integrateEditor'](_0xf7b173);});}),await this['_handleStartConversation']();}['_insertSuggestion'](_0x5c1154){const _0x248333=tt(this['context']);if(!_0x248333['plugins']['has']('TrackChangesEditing'))return;const _0x2d70bc=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x5dedec,interaction:_0xe8288f}=this['getInteractionAndReplyById'](_0x5c1154['replyId']),_0x40c02c=this['_getDocumentRangeForReplyChanges'](_0x5c1154['replyId'],_0x5c1154['partIndex']),_0x4b61e8=void 0x0!==_0x5c1154['partIndex']?[_0x5dedec['changeGroups'][_0x5c1154['partIndex']]]:_0x5dedec['changeGroups']['filter'](_0x589986=>'pending'==_0x589986['state']),_0x1e963f=_0x4b61e8['map'](_0x29b439=>_0x5dedec['changeGroups']['indexOf'](_0x29b439));_0x1e963f['forEach'](_0x18ef9c=>_0x5dedec['setChangeGroupState'](_0x18ef9c,'accepted'));const _0x5b9b34=w({'editor':_0x248333,'reply':_0x5dedec,'interaction':_0xe8288f,'groups':_0x4b61e8,'transform':!0x0,'documentCompare':_0x2d70bc,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x816e37;_0x40c02c&&this['_scrollToSuggestionRange'](_0x40c02c['range']),_0x248333['model']['change'](_0x9af3b3=>{_0x816e37=_0x9af3b3['batch'],_0x248333['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x5b9b34),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x816e37,{'interactionId':_0xe8288f['id'],'replyId':_0x5dedec['id'],'indexes':_0x1e963f['slice']()});}['_applySuggestion'](_0x24b8a9){const _0x59e810=tt(this['context']),_0x478db8=this['context']['plugins']['get'](_0x2423ad),{reply:_0x2d2768,interaction:_0x646996}=this['getInteractionAndReplyById'](_0x24b8a9['replyId']),_0x119052=this['_getDocumentRangeForReplyChanges'](_0x24b8a9['replyId'],_0x24b8a9['partIndex']),_0x558a77=void 0x0!==_0x24b8a9['partIndex']?[_0x2d2768['changeGroups'][_0x24b8a9['partIndex']]]:_0x2d2768['changeGroups']['filter'](_0x1ce0af=>'pending'==_0x1ce0af['state']),_0x5b03fa=_0x558a77['map'](_0xde12cc=>_0x2d2768['changeGroups']['indexOf'](_0xde12cc));_0x5b03fa['forEach'](_0x1ef694=>_0x2d2768['setChangeGroupState'](_0x1ef694,'accepted'));const _0x10da3e=w({'editor':_0x59e810,'reply':_0x2d2768,'interaction':_0x646996,'groups':_0x558a77,'transform':!0x0,'documentCompare':_0x478db8,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x3af325;_0x119052&&this['_scrollToSuggestionRange'](_0x119052['range']),_0x59e810['model']['change'](_0x46ce39=>{_0x3af325=_0x46ce39['batch'];for(const _0x4a6b5b of _0x10da3e)_0x4a6b5b['baseVersion']=_0x59e810['model']['document']['version'],_0x46ce39['batch']['addOperation'](_0x4a6b5b),_0x59e810['model']['applyOperation'](_0x4a6b5b);}),this['_batchToChanges']['set'](_0x3af325,{'interactionId':_0x646996['id'],'replyId':_0x2d2768['id'],'indexes':_0x5b03fa['slice']()});}['_openBalloonFor'](_0xcdb2ea,_0x3b6665){const _0x57afb9=tt(this['context']),_0x5372ca=this['_getDocumentRangeForReplyChanges'](_0xcdb2ea,_0x3b6665),_0x47a687=this['context']['plugins']['get'](m);if(!_0x5372ca)return void _0x47a687['close']();const {range:_0x253b94,currentIndex:_0x16ee9f,previousIndex:_0x3a6c79,nextIndex:_0x447ad7}=_0x5372ca;if(this['_previewedChangeGroup']?.['replyId']==_0xcdb2ea&&this['_previewedChangeGroup']?.['partIndex']==_0x16ee9f)return;this['_previewedChangeGroup']={'replyId':_0xcdb2ea,'partIndex':_0x16ee9f};const _0x560fc0=new s(_0x57afb9['locale'],{'showDiff':this['_balloonShowDiff'],'areActionsDisabled':!0x1,'miniToolbarConfig':{'showChanges':'full'},'hideHeader':!0x0}),{reply:_0x12eda6}=this['getInteractionAndReplyById'](_0xcdb2ea),_0x3dd0f0=d({'editor':_0x57afb9,'changeGroups':[_0x12eda6['changeGroups'][_0x16ee9f]],'documentContextContent':_0x12eda6['documentContextContent'],'showDiff':this['_balloonShowDiff']});_0x560fc0['updateContent']({'parts':_0x3dd0f0,'renderingStrategy':'static'});const _0xc201ee=_0x16ee9f!==_0x3a6c79;this['_scrollToSuggestionRange'](_0x253b94,!0x0),_0x47a687['open']({'index':_0x16ee9f,'title':'Suggestion\x20'+(_0x16ee9f+0x1),'icon':xt,'mainView':_0x560fc0,'showRotator':_0xc201ee,'showApplyButton':!0x0,'showSuggestButton':!0x0,'ranges':[_0x253b94]}),this['_aiChatUi']['scrollFeedToSuggestion'](_0xcdb2ea,_0x16ee9f),this['listenTo'](_0x560fc0,'toggleSuggestionDisplayMode',(_0x5802bf,{showDiff:_0x341690})=>{this['_balloonShowDiff']=_0x341690;const {reply:_0x2141ef}=this['getInteractionAndReplyById'](_0xcdb2ea),_0x520eee=d({'editor':_0x57afb9,'changeGroups':[_0x2141ef['changeGroups'][_0x16ee9f]],'documentContextContent':_0x2141ef['documentContextContent'],'showDiff':_0x341690});_0x560fc0['updateContent']({'parts':_0x520eee,'renderingStrategy':'static'});}),this['listenTo'](_0x47a687,'applySuggestion',()=>{this['_applySuggestion']({'replyId':_0xcdb2ea,'partIndex':_0x16ee9f}),_0xc201ee?this['_openBalloonFor'](_0xcdb2ea,_0x447ad7):_0x47a687['close']();}),this['listenTo'](_0x47a687,'insertSuggestion',()=>{this['_insertSuggestion']({'replyId':_0xcdb2ea,'partIndex':_0x16ee9f}),_0xc201ee?this['_openBalloonFor'](_0xcdb2ea,_0x447ad7):_0x47a687['close']();}),_0xc201ee&&(this['listenTo'](_0x47a687,'showNext',()=>{this['_openBalloonFor'](_0xcdb2ea,_0x447ad7);}),this['listenTo'](_0x47a687,'showPrevious',()=>{this['_openBalloonFor'](_0xcdb2ea,_0x3a6c79);})),this['listenTo'](_0x47a687,'dialogClosed',()=>{this['stopListening'](_0x47a687),this['stopListening'](_0x560fc0),this['_previewedChangeGroup']=null;});}['_getDocumentRangeForReplyChanges'](_0x520e35,_0x355bf2){const _0x2cd780=tt(this['context']),{reply:_0x434e45,interaction:_0x3313d5}=this['getInteractionAndReplyById'](_0x520e35),_0x1e0559=_0x434e45['changeGroups']['filter'](_0x15280c=>'pending'==_0x15280c['state']),_0x49aef9=_0x1e0559['map'](_0x354c6e=>_0x434e45['changeGroups']['indexOf'](_0x354c6e));void 0x0===_0x355bf2&&(_0x355bf2=_0x49aef9[0x0]);const _0x4aab71=_0x49aef9['indexOf'](_0x355bf2);if(-0x1==_0x4aab71)return null;const _0x2e2385=0x0==_0x4aab71?_0x49aef9[_0x49aef9['length']-0x1]:_0x49aef9[_0x4aab71-0x1],_0x4d14be=_0x4aab71==_0x49aef9['length']-0x1?_0x49aef9[0x0]:_0x49aef9[_0x4aab71+0x1],_0x2f1bc9=_0x1e0559[_0x4aab71],_0x520328=new wt([]),_0x53e08a=new wt([]);for(const _0x32ec20 of _0x2f1bc9['changes'])if('removed'!=_0x32ec20['type']&&_0x53e08a['children']['push'](_0x32ec20['node']['cloneNode'](!0x0)),'new'!=_0x32ec20['type']){const _0x333700=yt(_0x5c6a46=>Tt(_0x5c6a46,'data-id')==_0x32ec20['id'],_0x434e45['documentContextContent'],!0x0);_0x520328['children']['push'](_0x333700['cloneNode'](!0x0));}if(0x0==_0x520328['children']['length']){if(_0x2f1bc9['changes'][0x0]['anchorId']){const _0x482605=vt('data-id',_0x2f1bc9['changes'][0x0]['anchorId'],_0x434e45['documentContextContent']);_0x520328['children']['unshift'](_0x482605['cloneNode'](!0x0)),_0x53e08a['children']['unshift'](_0x482605['cloneNode'](!0x0)),_0x482605['nextSibling']&&(_0x520328['children']['push'](_0x482605['nextSibling']['cloneNode'](!0x0)),_0x53e08a['children']['push'](_0x482605['nextSibling']['cloneNode'](!0x0)));}else{const _0xb2ac56=_0x434e45['documentContextContent']['children'][0x0];if(!_0xb2ac56)return null;_0x520328['children']['push'](_0xb2ac56['cloneNode'](!0x0)),_0x53e08a['children']['push'](_0xb2ac56['cloneNode'](!0x0));}}const _0xe18e6a=_0x3313d5['getDocumentContext'](),_0x55bff1=_0x2cd780['data']['parse'](_0xe18e6a['content']),_0x386f14=At(_0x520328),_0x21bd0d=_0x2cd780['data']['parse'](_0x386f14),_0x5b919f=_0x2cd780['data']['parse'](_0x386f14),_0x5257dd=_0x2cd780['model']['createPositionAt'](_0x21bd0d,0x0),_0x23c50a=At(_0x53e08a),_0x48e5f2={'anchor':_0x5257dd,'markDeletions':!0x1},_0x3d6d5a=_0x2cd780['plugins']['get'](_0x2423ad)['getDiff'](_0x386f14,_0x23c50a,_0x48e5f2)['getOperations']();if(!_0x3d6d5a['length'])return null;_0x2cd780['model']['change'](_0x4eea30=>{for(const _0x5934e3 of _0x3d6d5a)if('remove'==_0x5934e3['type']){const _0x35a470=_0x5934e3['sourcePosition'],_0x3118ba=_0x5934e3['howMany'],_0x3a7d50=new It(_0x35a470,_0x3118ba);_0x4eea30['batch']['addOperation'](_0x3a7d50),_0x2cd780['model']['applyOperation'](_0x3a7d50);}else _0x5934e3['baseVersion']=null,_0x5934e3['isDocumentOperation']=!0x1,_0x4eea30['batch']['addOperation'](_0x5934e3),_0x2cd780['model']['applyOperation'](_0x5934e3);});const _0x21a459=_t(_0x2cd780,_0x3d6d5a,_0x21bd0d);Ct(_0x2cd780['model'],_0x21a459);const _0x501b34=_0x21a459['getFirstRange']()['start']['path']['slice'](),_0x3a45a1=_0x21a459['getFirstRange']()['end']['path']['slice'](),_0x415e7e=[];let _0x33bfc8=_0x21bd0d,_0x4c36a7=_0x5b919f;for(let _0x44c653=0x0;_0x44c653<_0x3a45a1['length'];_0x44c653++){const _0x539cde=_0x33bfc8['maxOffset']-_0x3a45a1[_0x44c653];_0x415e7e[_0x44c653]=_0x4c36a7['maxOffset']-_0x539cde,_0x33bfc8=_0x33bfc8['getChildAtOffset'](_0x3a45a1[_0x44c653]),_0x4c36a7=_0x4c36a7['getChildAtOffset'](_0x415e7e[_0x44c653]);}const _0xd8e30f=_0x2cd780['model']['createRange'](_0x2cd780['model']['createPositionFromPath'](_0x5b919f,_0x501b34),_0x2cd780['model']['createPositionFromPath'](_0x5b919f,_0x415e7e)),_0x3eaaf7=_0x5b919f['getChild'](0x0)['getAttribute'](ft),_0x2e78f3=Array['from'](_0x55bff1['getChildren']())['find'](_0x1a56d2=>_0x1a56d2['getAttribute'](ft)==_0x3eaaf7)['getPath'](),_0x26e34f=_0xd8e30f['start']['path']['slice'](),_0x5d9551=_0xd8e30f['end']['path']['slice']();_0x26e34f[0x0]=_0x2e78f3[0x0]+_0x26e34f[0x0],_0x5d9551[0x0]=_0x2e78f3[0x0]+_0x5d9551[0x0];let _0x5e2a63=_0x2cd780['model']['createRange'](_0x2cd780['model']['createPositionFromPath'](_0x2cd780['model']['document']['getRoot'](),_0x26e34f),_0x2cd780['model']['createPositionFromPath'](_0x2cd780['model']['document']['getRoot'](),_0x5d9551));const _0x3b7cf8=_0x2cd780['model']['document']['history']['getOperations'](_0xe18e6a['version']);for(const _0x2a69ed of _0x3b7cf8)_0x5e2a63=_0xd5274c['_createFromRanges'](_0x5e2a63['getTransformedByOperation'](_0x2a69ed));return{'range':_0x5e2a63,'previousIndex':_0x2e2385,'nextIndex':_0x4d14be,'currentIndex':_0x355bf2};}['_integrateEditor'](_0x447a06){if(!_0x447a06['plugins']['has']('Undo'))return;const _0x2afde5=_0x447a06['commands']['get']('undo'),_0xf3aeb9=_0x447a06['commands']['get']('redo');this['listenTo'](_0x2afde5,'revert',(_0x46b89d,_0x1d8d1b,_0x1f05c5)=>{const _0x3363ae=this['_batchToChanges']['get'](_0x1d8d1b);if(!_0x3363ae)return;const _0x4bc7e2=this['activeConversation']['getInteraction'](_0x3363ae['interactionId'])['getReply'](_0x3363ae['replyId']);_0x3363ae['indexes']['forEach'](_0x1cdbbb=>_0x4bc7e2['setChangeGroupState'](_0x1cdbbb,'pending')),this['_batchToChanges']['delete'](_0x1d8d1b),this['_batchToChanges']['set'](_0x1f05c5,_0x3363ae);}),this['listenTo'](_0xf3aeb9,'revert',(_0x271618,_0xc0eaf5,_0x30571a)=>{const _0x2a9c97=this['_batchToChanges']['get'](_0xc0eaf5);if(!_0x2a9c97)return;const _0x3b681b=this['activeConversation']['getInteraction'](_0x2a9c97['interactionId'])['getReply'](_0x2a9c97['replyId']);_0x2a9c97['indexes']['forEach'](_0x3e4b03=>_0x3b681b['setChangeGroupState'](_0x3e4b03,'accepted')),this['_batchToChanges']['delete'](_0xc0eaf5),this['_batchToChanges']['set'](_0x30571a,_0x2a9c97);});}async['loadConversation'](_0x5ebe4f){this['context']['plugins']['get'](m)['close'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']();try{const _0x515feb=this['context']['plugins']['get'](et);this['updateConversationTitle']('\x20'),_0x515feb['view']['activateTab']('chat'),await this['_handleStartConversation'](_0x5ebe4f);const {sessionId:_0x3b8616}=this['_aiEditing']['getDocumentData']();await this['activeConversation']['load'](_0x5ebe4f,_0x3b8616),this['activeConversation']['isCurrentDocumentInConversation']()&&this['activeConversation']['addCurrentDocumentToContext'](Yn(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}catch(_0x38ff21){console['error']('Failed\x20to\x20load\x20conversation',_0x38ff21);}finally{this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['handleRemovedConversation'](_0x1f5582){this['activeConversation']['id']===_0x1f5582&&this['_handleStartConversation']();}async['addSelectionToChatContext'](){const _0x1224e3=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x1224e3),this['activeConversation']?.['addCurrentDocumentToContext'](Yn(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_handleStartConversation']();}async['sendMessage']({message:_0x1b4378,quickActionData:_0x2b309d}){await this['_handleUIUserMessage']({'userMessage':_0x1b4378,'quickActionData':_0x2b309d});}['getGroupId'](){const _0x382e30=this['context']['config']['get']('collaboration.channelId');if(!_0x382e30)throw new _0x4a8035('ai-chat-missing-channel-id',this);return _0x382e30;}async['_handleStartConversation'](_0x19729b){const _0x4fd5c0=this['context']['plugins']['get'](m);_0x4fd5c0['isOpen']&&_0x4fd5c0['close'](),await this['_stopLastInteraction']();const _0x53c7bb=this['getGroupId'](),_0x406945=_0x19729b||_0x2458fa();this['activeConversation']=new pt({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'defaultModelId':this['context']['config']['get']('ai.chat.models.defaultModelId'),'conversationId':_0x406945,'group':_0x53c7bb,'getEditor':()=>tt(this['context'])}),this['activeConversation']['on']('conversationInitialized',(_0x4da8c4,_0x380877)=>{_0x380877['availableModels']=this['_filterModels'](_0x380877['availableModels'],this['context']['config']['get']('ai.chat.models.displayedModels')),this['_aiChatUi']['createConversation'](_0x380877),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x19729b||(this['_aiChatUi']['resetConversationTitle'](),this['activeConversation']?.['addCurrentDocumentToContext'](Yn(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT')));}),this['activeConversation']['on']('uploadProgressChanged',(_0x1c92ac,_0xa205d2)=>{this['_aiChatUi']['setIsUploadInProgress'](_0xa205d2['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x4911e9,_0x1e90d5)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x1e90d5),this['_aiChatUi']['addFeedInteractionHeader'](_0x1e90d5);}),this['activeConversation']['on']('interactionStarted',(_0x1d19db,_0x11ca0a)=>{this['_aiChatUi']['startInteraction'](_0x11ca0a);}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x34ed09,_0x123020)=>{this['_aiChatUi']['removeFeedInteraction'](_0x123020['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x2163b8,_0x6ac3e1,_0x5d03d4)=>{this['updateConversationTitle'](_0x6ac3e1,_0x5d03d4);}),this['activeConversation']['on']('replyCreated',(_0x11690b,_0x41800a)=>{this['_aiChatUi']['updateFeedInteractionHeader']({'isVisible':!0x0,'id':_0x41800a['interactionId']}),'text-delta'===_0x41800a['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x41800a):this['_aiChatUi']['addFeedItemAISuggestion'](_0x41800a);}),this['activeConversation']['on']('replyContentUpdated',async(_0x33f64e,_0x197df4,_0x26c8d1)=>{await this['_updateReplyContent']({'reply':_0x197df4,'changeGroups':_0x26c8d1});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x25d0dc,{reply:_0x3fc8bc,index:_0x558f85,state:_0x5c2222})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x3fc8bc['id'],'index':_0x558f85,'state':_0x5c2222});}),this['activeConversation']['on']('contextItemAdded',(_0x67b5eb,_0x30d406)=>{if(this['_aiChatUi']['addContextItem'](_0x30d406['contextItem'],_0x30d406['isLoading']),'selection'===_0x30d406['contextItem']['type']){const _0x251e07=[...tt(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x251e07,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x23e13c,_0x30729a)=>{this['_aiChatUi']['removeContextItem'](_0x30729a['uiId']),'current-document'==_0x30729a['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x30729a['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x18f52c,_0xeb3b6d)=>{this['_aiChatUi']['setContextItemLoading'](_0xeb3b6d['contextItem']['uiId'],_0xeb3b6d['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x30cd27,_0x3d117f)=>{this['_aiChatUi']['setConversationContext'](_0x3d117f['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x10baf5,_0x3fef32)=>{this['_aiChatUi']['setAddContextOptions'](_0x3fef32['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x4094cc,_0x5216c6)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x5216c6['sourceId'],_0x5216c6['source'],_0x5216c6['resources'],_0x5216c6['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x56cf63,_0xd25a87)=>{this['_aiChatUi']['updateResourceState'](_0xd25a87['sourceId'],_0xd25a87['resourceId'],_0xd25a87['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x3302eb,_0x5645a9)=>{this['_aiChatUi']['updateCapabilities'](_0x5645a9);}),this['activeConversation']['on']('modelSelected',(_0x447894,_0x443c8a)=>{this['_aiChatUi']['setSelectedModel'](_0x443c8a['selectedModel'],_0x443c8a['isDisabled']);}),this['activeConversation']['on']('error',(_0x5be855,{error:_0x69b2cd,interactionId:_0x4fcac5,fileName:_0x2d865b,url:_0xd46304,sourceId:_0x3c0c77,sourceLabel:_0x457dce})=>{const _0x27a2dd=_0x4fcac5?_0x4fcac5+':'+_0x2458fa():_0x2458fa();_0x69b2cd['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':Yn(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x27a2dd}):_0x69b2cd['message']['startsWith']('ai-chat-conversation-init-failed')||_0x69b2cd['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Yn(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x27a2dd}),this['_logError'](_0x69b2cd)):_0x69b2cd['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Yn(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x2d865b),'id':_0x27a2dd}):_0x69b2cd['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Yn(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0xd46304),'id':_0x27a2dd}):_0x69b2cd['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Yn(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x27a2dd}):_0x69b2cd['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Yn(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x27a2dd}):_0x69b2cd['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x3c0c77&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x3c0c77),this['_aiChatUi']['addFeedItemError']({'errorMessage':Yn(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x457dce||'source'),'id':_0x27a2dd}),this['_logError'](_0x69b2cd)):_0x69b2cd['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Yn(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x27a2dd}),this['_logError'](_0x69b2cd)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':Yn(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x27a2dd}),this['_logError'](_0x69b2cd));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x19729b||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x5da00d,quickActionData:_0x29f9e5}){if(!this['activeConversation'])throw new _0x4a8035('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':_0x5da00d,'quickActionData':_0x29f9e5}),this['_removeAISelectionMarkers']();}['_removeAISelectionMarkers'](){const _0x2723ab=tt(this['context'])['model'],_0x51ab80=Array['from'](_0x2723ab['markers']['getMarkersGroup'](ut));_0x2723ab['change'](_0x53975e=>{_0x51ab80['forEach'](_0x2c10c2=>_0x53975e['removeMarker'](_0x2c10c2));});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x32bfa1){this['_aiChatUi']['setIsMaximized'](_0x32bfa1);}['_logError'](_0x54ddb2){lt(_0x54ddb2['message']);}['_removeFromContext'](_0x19e7ef){this['activeConversation']?.['removeFromContext'](_0x19e7ef);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x3ba6ee){const [_0x275622,_0x1880d3]=_0x3ba6ee['split'](':'),_0x48022b=this['activeConversation']['getInteraction'](_0x275622),_0x3869f6=_0x48022b['getReply'](_0x1880d3);return{'interaction':_0x48022b,'reply':_0x3869f6};}['_scrollToSuggestionRange'](_0x143fa0,_0x43381a=!0x1){const _0x360b60=tt(this['context']),_0x5f37f0={'target':_0x360b60['editing']['view']['domConverter']['viewRangeToDom'](_0x360b60['editing']['mapper']['toViewRange'](_0x143fa0)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x43381a};_0x43381a&&(_0x5f37f0['alignToTop']=!0x0),gt(_0x5f37f0);}['updateConversationTitle'](_0x31301d,_0x21175b=!0x1){this['_aiChatUi']['setConversationTitle'](_0x31301d||Yn(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x21175b);}['_filterModels'](_0x207c42,_0x15b5d2){let _0x1bacca;if(_0x15b5d2){_0x1bacca=[];const _0x506a8f='string'==typeof _0x15b5d2?[_0x15b5d2['toLocaleLowerCase']()]:_0x15b5d2['map'](_0x3c2aac=>_0x3c2aac['toLocaleLowerCase']());for(const _0x194e90 of _0x506a8f)for(const _0x16a7d3 of _0x207c42)(_0x16a7d3['id']['toLocaleLowerCase']()===_0x194e90||_0x16a7d3['name']['toLocaleLowerCase']()===_0x194e90||_0x16a7d3['provider']['toLocaleLowerCase']()===_0x194e90||_0x16a7d3['id']['toLocaleLowerCase']()['startsWith'](_0x194e90))&&_0x1bacca['push'](_0x16a7d3);}else _0x1bacca=_0x207c42;return _0x1bacca;}async['_updateReplyContent']({reply:_0x5c9f30,changeGroups:_0x2787ac,renderingStrategy:_0x88676}){const {id:_0x5d9d1c,isDone:_0x35828d,type:_0x421dc1,parsedContent:_0x150bce}=_0x5c9f30;if('modification-delta'===_0x421dc1){const _0x243c1c=d({'editor':tt(this['context']),'showDiff':this['_aiChatUi']['showDiff'],'changeGroups':_0x2787ac,'documentContextContent':_0x5c9f30['documentContextContent']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x5d9d1c,'parts':_0x243c1c,'renderingStrategy':_0x88676,'isDone':_0x35828d});}else'text-delta'===_0x421dc1&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x5d9d1c,'parsedContent':_0x150bce,'renderingStrategy':_0x88676,'isDone':_0x35828d});_0x35828d&&_0x5c9f30['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x5d9d1c,_0x5c9f30['sources']);}async['_stopLastInteraction'](){const _0x6d5ec9=this['activeConversation']?.['lastInteraction'];_0x6d5ec9&&(_0x6d5ec9['stop'](),this['_aiChatUi']['stopInteraction'](_0x6d5ec9));}async['_flushLastInteractionUI'](){const _0x14871c=this['activeConversation']?.['lastInteraction'];if(_0x14871c){for await(const _0x231524 of _0x14871c['replies'])await this['_updateReplyContent']({'reply':_0x231524,'changeGroups':_0x231524['changeGroups'],'renderingStrategy':'static'});}}}const Ht=[...Ce,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class nh extends _0x7ecbb5{['actionsDropdown'];['children'];['showChangeInTextModel'];['insertSuggestionModel'];constructor(_0x4c90c4){super(_0x4c90c4);const _0x1f5ba4=this['bindTemplate'];this['set']('isEnabled',!0x0),this['set']('isVisible',!0x0),this['showChangeInTextModel']=new _0x1a9d93({'label':Yn(_0x4c90c4,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT'),'icon':_0x4be45b,'withText':!0x0,'type':'button','actionName':'showChangeInText'}),this['insertSuggestionModel']=new _0x1a9d93({'label':Yn(_0x4c90c4,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION'),'icon':_0x23df72,'withText':!0x0,'type':'button','actionName':'insertSuggestion'}),this['actionsDropdown']=new Ko(_0x4c90c4,{'listItemModels':[this['showChangeInTextModel'],this['insertSuggestionModel']]}),this['actionsDropdown']['on']('execute',()=>{this['fire']('applySuggestion');}),this['actionsDropdown']['on']('showChangeInText',()=>{this['fire']('showChangeInText');}),this['actionsDropdown']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion');}),this['actionsDropdown']['set']({'label':'Apply','tooltip':Yn(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP'),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions','balloonPanelClass':'ck-ai-chat__feed__ai-suggestion__actions__balloon'}),this['actionsDropdown']['bind']('isEnabled')['to'](this),this['children']=this['createCollection']([this['actionsDropdown']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x1f5ba4['if']('isVisible','ck-hidden',_0x316a46=>!_0x316a46)]},'children':[this['actionsDropdown']]});}['updateLabels'](_0x2fe363){const _0x49a716=this['locale'];this['actionsDropdown']['set']({'label':Yn(_0x49a716,'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL',_0x2fe363),'tooltip':Yn(_0x49a716,'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP',_0x2fe363)}),this['showChangeInTextModel']['label']=Yn(_0x49a716,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT',_0x2fe363),this['insertSuggestionModel']['label']=Yn(_0x49a716,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION',_0x2fe363);}}class Ko extends _0x419f47{['bodyCollection'];['balloonPanelView'];['listView'];['keystrokeHandler'];constructor(_0x2ef2d7,_0x2d588d){super(_0x2ef2d7),this['balloonPanelView']=new _0x271ec1(this['locale']),this['bodyCollection']=new jt(this['locale']),this['bodyCollection']['attachToDom'](),this['set']('balloonPanelClass',''),this['balloonPanelView']['bind']('class')['to'](this,'balloonPanelClass'),this['listView']=this['_setUpList'](_0x2d588d['listItemModels']),this['bodyCollection']['add'](this['balloonPanelView']),this['balloonPanelView']['content']['add'](this['listView']),this['arrowView']['unbind']('tooltip'),this['arrowView']['set']('tooltip',Yn(this['locale'],'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP')),this['_setUpKeystrokes'](),this['on']('execute',()=>{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']?qo:zo]}),this['listView']['focus']());}),_0x6d5b3a({'emitter':this['balloonPanelView'],'callback':()=>{this['balloonPanelView']['hide']();},'activator':()=>this['balloonPanelView']['isVisible'],'contextElements':()=>[this['element'],this['balloonPanelView']['element']]});}['_setUpList'](_0x1e193c){const _0x2af001=this['locale'],_0x13b476=new _0x5c4336(_0x2af001);for(const _0x537485 of _0x1e193c){const _0x32f94d=new _0x7baab6(_0x2af001),_0x28717c=new _0x416a68(_0x2af001);_0x28717c['bind'](...Object['keys'](_0x537485))['to'](_0x537485),_0x28717c['delegate']('execute')['to'](_0x13b476),_0x32f94d['children']['add'](_0x28717c),_0x13b476['items']['add'](_0x32f94d);}return _0x13b476['items']['delegate']('execute')['to'](this),_0x13b476['on']('execute',_0xe02065=>{const _0x3b82f3=_0xe02065['source'];this['fire'](_0x3b82f3['actionName']),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),_0x13b476;}['_setUpKeystrokes'](){this['keystrokeHandler']=new _0xf37da3(),this['keystrokeHandler']['listenTo'](this['balloonPanelView']['element']),this['keystrokeHandler']['set']('esc',(_0x574fc3,_0xcd578b)=>{this['balloonPanelView']['hide'](),this['arrowView']['focus'](),_0xcd578b();});}['destroy'](){super['destroy'](),this['keystrokeHandler']['destroy'](),this['balloonPanelView']['destroy'](),this['bodyCollection']['detachFromDom']();}}function qo(_0x5a4261){return{'top':_0x5a4261['bottom'],'left':_0x5a4261['left'],'name':'arrowless','config':{'withArrow':!0x1}};}function zo(_0x6e61fa,_0x220fcc){return{'top':_0x6e61fa['bottom'],'left':_0x6e61fa['left']-(_0x220fcc['width']-_0x6e61fa['width']),'name':'arrowless','config':{'withArrow':!0x1}};}class ke extends Cr{['containerView'];['actionsView'];constructor(_0x34ec73,_0x4c0938){super(_0x4c0938),this['containerView']=new s(_0x34ec73,{'showDiff':_0x4c0938['showDiff'],'areActionsDisabled':_0x4c0938['areActionsDisabled']}),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x323fca,_0x28dc80)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x28dc80['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',(_0x239c6e,{index:_0x8a13fe})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x8a13fe});}),this['containerView']['on']('insertSuggestion',(_0x5c983b,{index:_0x3376cc})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3376cc});}),this['containerView']['on']('rejectSuggestion',(_0x4087e2,{index:_0x3331e9})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3331e9});}),this['containerView']['on']('mouseOverSuggestion',(_0x5cd62b,{index:_0x210038})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x210038});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x236d9f,{index:_0x233e97})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x233e97});}),this['actionsView']=new nh(_0x34ec73),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']});}),_0x4c0938['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'](_0xb2e7e){await this['containerView']['updateContent'](_0xb2e7e),this['actionsView']['updateLabels'](this['containerView']['bodyView']['partsCount']);}['updatePartState'](_0x2f3300,_0x4a61af){this['containerView']['bodyView']['updatePartState'](_0x2f3300,_0x4a61af);}['updateSources'](_0x28bd80){this['containerView']['updateSources'](_0x28bd80);}['getPartView'](_0x257451){return this['containerView']['bodyView']['getPartView'](_0x257451);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone'](),this['actionsView']['isVisible']=this['containerView']['bodyView']['hasNonEmptyParts'];}}class Se extends Cr{['replyContainer'];constructor(_0x5c3acb){super(_0x5c3acb),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x7ecbb5(),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':sr(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x21d91b,renderingStrategy:_0x44d395,abortSignal:_0x36a429}){'streaming'===_0x44d395?await this['streamIntoElement'](_0x21d91b,this['replyContainer']['element'],_0x36a429):this['replyContainer']['element']['innerHTML']=_0xbd2e84(_0x21d91b);}['updateSources'](_0x1f3edb){const _0x22ef9e=new jr(this['locale']);_0x22ef9e['children']['addMany'](_0x1f3edb['map'](_0x160469=>new Sr(this['locale'],_0x160469))),_0x22ef9e['displayHeader']=!0x0,this['children']['add'](_0x22ef9e);}}const un={'file':_0x49634e,'document':_0x2025c1,'web-resource':_0xa4bf6f,'text':_0x49634e,'selection':_0x6d029b},Qn='ck-ai-chat-context-chip',Xn='ck-ai-chat-context-chip_wide',zn='ck-ai-chat-context-chip_document',jn='ck-ai-chat-context-chip__label',Jn='ck-ai-chat-context-chip__type-icon',Zn='ck-ai-chat-context-controls__chip-tooltip',En='n';class _o extends _0x155a80{constructor(_0x103995,_0xa5ea26,_0x55f6e5,_0x44a9df,_0x1e1837=!0x1){super(_0x103995),this['_isAnimationOnEnterEnabled']=_0x44a9df,this['_initializeProperties'](_0xa5ea26,_0x55f6e5,_0x1e1837),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'](_0x34db6d,_0x2bc0f6,_0x4a5314){this['set']('label',_0x34db6d['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x34db6d['type']),this['set']('id',_0x34db6d['uiId']),this['set']('readonly',_0x2bc0f6),this['set']('isLoading',_0x4a5314);}['_setupTemplate'](){const _0x2bcdf2=this['_createIconView'](),_0x52e594=this['_createRemoveButton'](),_0x2ef0c2=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x2ef0c2),'children':this['_createTemplateChildren'](_0x2bcdf2,_0x52e594,_0x2ef0c2)});}['_createTemplateAttributes'](_0x4bffb2){return{'class':[Qn,_0x4bffb2['if']('itemType',zn,_0x4e0919=>'document'==_0x4e0919),_0x4bffb2['if']('itemType',Xn,_0x2480c6=>'selection'==_0x2480c6)],'data-cke-tooltip-text':_0x4bffb2['to']('label',fn),'data-cke-tooltip-position':En,'data-cke-tooltip-class':Zn};}['_createTemplateChildren'](_0x20ee24,_0x7b740b,_0x5377ed){const _0x3e3881=this['_createLabelElement'](_0x5377ed),_0x15dd5e=this['_createLoaderIcon']();return this['readonly']?[_0x20ee24,_0x3e3881]:[_0x20ee24,_0x15dd5e,_0x3e3881,_0x7b740b];}['_createLabelElement'](_0x245c4a){return{'tag':'span','attributes':{'class':jn},'children':[{'text':_0x245c4a['to']('label')}]};}['_createRemoveButton'](){const _0x4d0c95=new _0x155a80(this['locale']);return _0x4d0c95['set']({'label':Yn(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x381c0a}),this['_setupRemoveButtonEvent'](_0x4d0c95),_0x4d0c95;}['_setupRemoveButtonEvent'](_0x1d2436){_0x1d2436['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x3fcec2=this['bindTemplate'],_0x3a746e=new _0x29aaa9();return _0x3a746e['content']=un[this['itemType']],_0x3a746e['extendTemplate']({'attributes':{'class':[Jn,_0x3fcec2['if']('isLoading','ck-hidden',_0x399b71=>_0x399b71)]}}),_0x3a746e;}['_handleAnimationEndOnce'](_0x4f1a58,_0x1ef4b7){if(!_0x4f1a58)return;const _0x2b0808=()=>{_0x1ef4b7(),_0x4f1a58['removeEventListener']('animationend',_0x2b0808),_0x4f1a58['removeEventListener']('webkitAnimationEnd',_0x2b0808);};_0x4f1a58['addEventListener']('animationend',_0x2b0808),_0x4f1a58['addEventListener']('webkitAnimationEnd',_0x2b0808);}['_createLoaderIcon'](){const _0x469b9c=new Si('small');return _0x469b9c['bind']('isVisible')['to'](this,'isLoading',_0x1934cb=>_0x1934cb),_0x469b9c;}}function fn(_0x5f05a3){if(!_0x5f05a3)return _0x5f05a3;if(_0x5f05a3['length']<=0x78)return _0x5f05a3;const _0x39ba03=_0x5f05a3['slice'](0x0,0x78),_0x5d375e=_0x39ba03['lastIndexOf']('\x20');return(_0x5d375e>0x0?_0x39ba03['slice'](0x0,_0x5d375e):_0x39ba03)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},ln='300px';class xo{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x1a588f,_0xc092e0,_0x36fe6c,_0xeeb2dc,_0x1acf7c){this['_locale']=_0x1a588f,this['_visibleChips']=_0xc092e0,this['_config']={...hn,..._0x36fe6c,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x36fe6c['cssClasses']}},this['_overflowChips']=new _0x4041f8(),this['_bodyCollection']=_0xeeb2dc,this['_parentView']=_0x1acf7c||null;}['setContainerElement'](_0x9580d9){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x9580d9,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 _0x4c02c=[...this['_visibleChips'],...this['_overflowChips']],_0x27a6f=this['_createCalculationContainer'](),_0x14a065=this['_calculateOverflowInContainer'](_0x27a6f,_0x4c02c),_0x3126dd=_0x27a6f['_ancestorsToRestore'];_0x3126dd&&this['_restoreAncestorVisibility'](_0x3126dd),_0x27a6f['remove'](),this['_applyOverflowResults'](_0x4c02c,_0x14a065);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x6d5b3a({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x45b064=new _0x155a80(this['_locale']);_0x45b064['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x14ec95=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x14ec95['push'](this['_config']['cssClasses']['controlsButton']),_0x45b064['extendTemplate']({'attributes':{'class':_0x14ec95}}),_0x45b064;}['_createShowMoreBalloonPanelView'](){const _0x482715=new _0x271ec1(this['_locale']);return _0x482715['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x482715),_0x482715;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x583e7e=>{_0x583e7e['disableAnimationOnEnter']();});const _0x2ecd61=new _0x7ecbb5(this['_locale']);_0x2ecd61['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x2ecd61);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x25c3f1=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x25c3f1?'':'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'](_0x3cb3dd){const _0x2ce582=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x2da377=this['_containerElement']?.['classList'];if(_0x2da377){const _0x5a48d0=_0x2da377[0x0]||'',_0x68b8cd=_0x3cb3dd['querySelector']('.'+_0x5a48d0),_0x3ca58b=_0x3cb3dd['querySelector'](_0x2ce582);return _0x68b8cd||_0x3ca58b||_0x3cb3dd;}return _0x3cb3dd['querySelector'](_0x2ce582)||_0x3cb3dd;}['_calculateContainerWidth'](){const _0x4a0e6f=this['_parentView']?.['element']||this['_containerElement'];if(!_0x4a0e6f)return ln;const _0x51158f=window['getComputedStyle'](_0x4a0e6f)['width'];if('auto'===_0x51158f||'0px'===_0x51158f||!_0x51158f){const _0x4849fc=_0x4a0e6f['parentElement'];if(_0x4849fc){const _0x774237=window['getComputedStyle'](_0x4849fc);return'auto'!==_0x774237['width']?_0x774237['width']:ln;}return ln;}return _0x51158f;}['_applyCalculationStyles'](_0x325388,_0x3b0c26){this['_config']['cssClasses']['calculationContainer']&&_0x325388['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x325388['style']['width']=_0x3b0c26,_0x325388['style']['position']='absolute',_0x325388['style']['top']='-9999px',_0x325388['style']['left']='-9999px',_0x325388['style']['opacity']='0',_0x325388['style']['pointerEvents']='none',_0x325388['style']['zIndex']='-1',_0x325388['style']['visibility']='visible\x20!important',_0x325388['style']['display']='block\x20!important',_0x325388['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x547aba){_0x547aba['forEach'](({element:_0x3ae125,originalDisplay:_0x383f05,originalVisibility:_0x51697c})=>{_0x3ae125['style']['display']=_0x383f05,_0x3ae125['style']['visibility']=_0x51697c;});}['_makeAncestorsVisible'](_0x4d53a2){const _0x752cdb=[];let _0x1d1f2a=_0x4d53a2;for(;_0x1d1f2a&&_0x1d1f2a!==document['body'];){const _0xdfe02b=window['getComputedStyle'](_0x1d1f2a);'none'!==_0xdfe02b['display']&&'hidden'!==_0xdfe02b['visibility']||(_0x752cdb['push']({'element':_0x1d1f2a,'originalDisplay':_0x1d1f2a['style']['display'],'originalVisibility':_0x1d1f2a['style']['visibility']}),_0x1d1f2a['style']['display']='block',_0x1d1f2a['style']['visibility']='visible'),_0x1d1f2a=_0x1d1f2a['parentElement'];}return _0x752cdb;}['_createContainerElements'](){let _0x3d4eef,_0x1bffea;return this['_parentView']?.['element']?(_0x3d4eef=this['_parentView']['element']['cloneNode'](!0x0),_0x1bffea=this['_findTargetContainer'](_0x3d4eef)):(_0x3d4eef=document['createElement']('div'),_0x1bffea=_0x3d4eef),{'calculationContainer':_0x3d4eef,'targetContainer':_0x1bffea};}['_createCalculationContainer'](){const {calculationContainer:_0x249783,targetContainer:_0x241d1d}=this['_createContainerElements'](),_0x343063=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x249783,_0x343063);const _0x5971b9=this['_parentView']?.['element']||this['_containerElement'],_0x53a2ae=_0x5971b9?.['parentElement'];_0x53a2ae?_0x53a2ae['appendChild'](_0x249783):document['body']['appendChild'](_0x249783),_0x249783['_targetContainer']=_0x241d1d;const _0x1aa7cd=this['_makeAncestorsVisible'](_0x53a2ae||null);return _0x249783['offsetWidth'],_0x249783['_ancestorsToRestore']=_0x1aa7cd,_0x249783;}['_calculateOverflowInContainer'](_0x391400,_0x48da71){const _0xa7071c=_0x391400['_targetContainer']||_0x391400,_0x318ffb=[],{rowCount:_0x4d3902}=this['_renderChipsAndCountRows'](_0xa7071c,_0x48da71);if(_0x4d3902<=this['_config']['maxVisibleRows'])return _0x318ffb;const _0x437654=_0x48da71['slice']();for(;_0x437654['length']>0x0;){if(this['_testButtonFit'](_0x391400,_0xa7071c,_0x437654)){const _0x26831e=_0x48da71['filter'](_0x1eeec6=>!_0x437654['includes'](_0x1eeec6));_0x318ffb['push'](..._0x26831e);break;}if(!_0x437654['pop']())break;}return _0x318ffb;}['_renderChipsAndCountRows'](_0x1442ce,_0x57accd){_0x1442ce['innerHTML']='',_0x57accd['forEach'](_0xc707a0=>{if(_0xc707a0['element']){const _0x3c8e27=_0xc707a0['element']['cloneNode'](!0x0);_0x1442ce['appendChild'](_0x3c8e27);}}),_0x1442ce['offsetWidth'];const _0x47b5a0=_0x1442ce['children'],_0xd2663d=[];return Array['from'](_0x47b5a0)['forEach'](_0x50c4d2=>{const _0x5be883=_0x50c4d2['getBoundingClientRect']()['top'];_0xd2663d['some'](_0xf2979a=>Math['abs'](_0xf2979a-_0x5be883)<this['_config']['rowDetectionTolerance'])||_0xd2663d['push'](_0x5be883);}),{'rowCount':_0xd2663d['length']};}['_createMockButton'](){const _0x236fe3=document['createElement']('button');return _0x236fe3['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x236fe3['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x236fe3['textContent']='+\x201',_0x236fe3;}['_testButtonFit'](_0x43fe14,_0x3b3627,_0x1a134b){this['_renderChipsAndCountRows'](_0x3b3627,_0x1a134b);const _0x22b19c=this['_createMockButton']();_0x43fe14['appendChild'](_0x22b19c),_0x43fe14['offsetWidth'];const _0x1d0d4b=[..._0x3b3627['children'],_0x22b19c],_0xd32209=[];_0x1d0d4b['forEach'](_0x70468b=>{const _0x5e640c=_0x70468b['getBoundingClientRect']()['top'];_0xd32209['some'](_0x21f3ee=>Math['abs'](_0x21f3ee-_0x5e640c)<this['_config']['rowDetectionTolerance'])||_0xd32209['push'](_0x5e640c);});const _0x30421d=_0xd32209['length'];return _0x22b19c['remove'](),_0x30421d<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0xa644a3,_0x1c4947){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0xa644a3['forEach'](_0x5400b2=>{_0x1c4947['includes'](_0x5400b2)?this['_overflowChips']['add'](_0x5400b2):this['_visibleChips']['add'](_0x5400b2);});}['_updateOverflowUI'](_0x130e46){if(_0x130e46>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x130e46>0x0&&this['_showMoreButtonView']){const _0x35825c=''+this['_config']['showMoreLabelPrefix']+(_0x130e46<0x63?_0x130e46:'99');this['_showMoreButtonView']['label']=_0x35825c;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x4a8484,_0x5e3c04){this['_distributeChips'](_0x4a8484,_0x5e3c04),this['_updateOverflowUI'](_0x5e3c04['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x48ad29=>{_0x48ad29[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 _0x4c358a=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x4c358a['width']||0x0===_0x4c358a['height'])return!0x1;const _0x5432b9=window['innerHeight']||document['documentElement']['clientHeight'],_0x3390f5=window['innerWidth']||document['documentElement']['clientWidth'],_0x10e529=0xc8;return _0x4c358a['bottom']>=-0xc8&&_0x4c358a['top']<=_0x5432b9+_0x10e529&&_0x4c358a['right']>=-0xc8&&_0x4c358a['left']<=_0x3390f5+_0x10e529;}}const Nr='ck-ai-chat__feed__context-chips',Pr='ck-ai-chat-context-chips-wrapper',Dr='ck-ai-chat-context-chips-wrapper-balloon',Mr='ck-ai-chat-controls-button',Gr='ck-ai-chat-controls_context_show-more-button',Yr='ck-ai-chat-context-controls__show-more-balloon-panel';class ah extends _0x7ecbb5{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x33cc6b,_0x2626f9,_0x177986){super(_0x33cc6b),this['_bodyCollection']=_0x177986,this['_createContextChips'](_0x2626f9);const _0x42454e={'cssClasses':{'showMoreButton':Gr,'showMoreBalloon':Yr,'overflowContainer':Dr,'controlsButton':Mr}};this['_overflowManager']=new xo(_0x33cc6b,this['_contextChips'],_0x42454e,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Nr,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Pr},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x5af4c2=this['element']['querySelector']('.'+Pr);_0x5af4c2&&(this['_overflowManager']['setContainerElement'](_0x5af4c2),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x5a6efa){for(const _0x3e8bdd of _0x5a6efa){const _0x41ba51=new _o(this['locale'],_0x3e8bdd,!0x0,!0x1);this['_contextChips']['add'](_0x41ba51);}}}class ye extends Cr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x2b14b5,_0x1ac5f7,_0x33486b){super(_0x1ac5f7),this['_locale']=_0x2b14b5,this['_bodyCollection']=_0x33486b,this['_createContextChipsView'](),this['_createMessageContentView'](),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__user-message']}});}['_createContextChipsView'](){this['options']['contextItems']&&this['options']['contextItems']['length']>0x0&&(this['_contextChipsView']=new ah(this['_locale'],this['options']['contextItems']['filter'](_0x47fd0a=>!_0x47fd0a['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x7ecbb5(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 Pt extends Cr{constructor(_0x26c474,_0x2c6fcb){super(_0x2c6fcb);const {isWebSearchEnabled:_0x594f15,isReasoningEnabled:_0x3ac681}=_0x2c6fcb['capabilities'],_0x186911=[];let _0x575572='';_0x594f15&&_0x3ac681?(_0x575572=Yn(_0x26c474,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x186911['push'](e_(_0x125eea)),_0x186911['push'](e_(_0x5e48f1))):_0x594f15?(_0x575572=Yn(_0x26c474,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x186911['push'](e_(_0x125eea))):_0x3ac681&&(_0x575572=Yn(_0x26c474,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x186911['push'](e_(_0x5e48f1))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x575572?'':'ck-hidden']}});const _0x55a475=new _0x7ecbb5();_0x55a475['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x186911,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x575572]}]}),this['children']['add'](_0x55a475);}}function e_(_0x4dbff2){const _0x4f8262=new _0x29aaa9();return _0x4f8262['content']=_0x4dbff2,_0x4f8262;}const ms=['wheel','touchstart','pointerdown','keydown'],ps=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class je{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x2d7695){this['element']=_0x2d7695,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x177cdc of ms){const _0x3ae1ec='keydown'!==_0x177cdc;this['element']['addEventListener'](_0x177cdc,this['_onUserEvent']['bind'](this),{'passive':_0x3ae1ec,'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'](_0x5598d3){if(this['isRunning']){if('keydown'===_0x5598d3['type']){const _0x1045fe=_0x5598d3['key'];if(!ps['includes'](_0x1045fe))return;}_0x5598d3 instanceof WheelEvent?_0x5598d3['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x1afa18,scrollHeight:_0x27a932,clientHeight:_0x1ed941}=this['element'];return _0x27a932-_0x1afa18-_0x1ed941<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class Yi extends _0x7ecbb5{constructor(_0x1385e6,_0x44a2a5){super(_0x1385e6),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x44a2a5)});}['_createSkeletonItems'](_0x41aa5f){const _0xc02c27=['ck','ck-ai-skeleton__item'];return _0x41aa5f['map'](_0xbdbc8b=>{let _0xd6c047='';switch(_0xbdbc8b['attributes']['align']){case'right':_0xd6c047='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0xd6c047='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0xd6c047='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0xbdbc8b['tag'],'attributes':{'class':[..._0xc02c27,_0xbdbc8b['attributes']['class']?_0xbdbc8b['attributes']['class']:''],'style':'width:\x20'+_0xbdbc8b['attributes']['width']+';\x20height:\x20'+_0xbdbc8b['attributes']['height']+';'+_0xd6c047}};});}}const vi={'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(_0x4d3b4b,_0x28779f,_0x9f792e,_0x264642){return new Array(_0x4d3b4b)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x28779f,'height':_0x9f792e,'align':_0x264642}}));}class Bi extends _0x7ecbb5{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x51e777,_0x56a3ae){super(_0x51e777),this['_bodyCollection']=_0x56a3ae,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Ht)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new je(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x1fe77e,_0x578a97){let _0x1cfcda;_0x1cfcda='ai-reply'===_0x1fe77e?new Se(_0x578a97):'ai-suggestion-reply'===_0x1fe77e?new ke(this['locale'],_0x578a97):'user-message'===_0x1fe77e?new ye(this['locale'],_0x578a97,this['_bodyCollection']):'interaction-header'===_0x1fe77e?new Pt(this['locale'],_0x578a97):new _e(_0x578a97),this['children']['add'](_0x1cfcda);}async['updateReplyItem']({id:_0x208a29,parsedContent:_0x302423,renderingStrategy:_0x1564b2,abortSignal:_0x274184}){const _0x2e361a=this['getItemById'](_0x208a29);if(!(_0x2e361a instanceof Se))throw new _0x4a8035('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x2e361a,'id':_0x208a29,'parsedContent':_0x302423});await _0x2e361a['updateContent']({'parsedContent':_0x302423,'renderingStrategy':_0x1564b2,'abortSignal':_0x274184});}async['updateWebSources'](_0x6dcf61,_0x57dc55){const _0x59247b=this['getItemById'](_0x6dcf61);if(_0x59247b instanceof ke)_0x59247b['updateSources'](_0x57dc55);else{if(!(_0x59247b instanceof Se))throw new _0x4a8035('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x59247b,'id':_0x6dcf61,'sources':_0x57dc55});_0x59247b['updateSources'](_0x57dc55);}}async['updateSuggestionItem']({id:_0x5a5244,parts:_0x2d18f8,renderingStrategy:_0x15514e,abortSignal:_0x408eaf}){const _0x36315b=this['getItemById'](_0x5a5244);if(!(_0x36315b instanceof ke))throw new _0x4a8035('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x36315b,'id':_0x5a5244,'parts':_0x2d18f8});await _0x36315b['updateContent']({'parts':_0x2d18f8,'renderingStrategy':_0x15514e,'abortSignal':_0x408eaf});}['updateSuggestionPartState']({id:_0x5d41f6,index:_0x2bc435,state:_0x269020}){const _0x21ca02=this['getItemById'](_0x5d41f6);if(!(_0x21ca02 instanceof ke))throw new _0x4a8035('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x5d41f6});_0x21ca02['updatePartState'](_0x2bc435,_0x269020);}['markItemAsDone'](_0x218368){this['getItemById'](_0x218368)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x123491=>_0x123491['options']['id']);}['removeItem'](_0x28ffb9){this['children']['remove'](this['getItemById'](_0x28ffb9));}['scrollToSuggestion'](_0x3cbad7,_0x186693){const _0x505929=this['getItemById'](_0x3cbad7);if(!(_0x505929 instanceof ke))return void _0x3a0d50('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x3cbad7,'partIndex':_0x186693});const _0x561d4c=_0x505929['getPartView'](_0x186693);_0x561d4c?gt({'target':_0x561d4c['element'],'ancestorOffset':0x14,'alignToTop':!0x0,'forceScroll':!0x0}):_0x3a0d50('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x3cbad7,'partIndex':_0x186693});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x5af7ec=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x5af7ec,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x1e81dd=new Yi(this['locale'],vi['aiFeed']);return _0x1e81dd['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x254c0a=>!_0x254c0a)]}}),_0x1e81dd;}['_createFeedItems'](){const _0xc07853=new _0x7ecbb5(this['locale']);return _0xc07853['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0xc07853;}['_createFeedLoader'](){const _0x370aeb=new _0x7ecbb5(this['locale']);return _0x370aeb['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x156a25=>!_0x156a25)]},'children':this['_createLoaderChildren']()}),_0x370aeb;}['_createLoaderChildren'](){const _0x40667a=new Si();return _0x40667a['isVisible']=!0x0,[_0x40667a,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x520e9d){const _0x4ac379=this['children']['find'](_0x48e39e=>_0x48e39e['options']['id']['includes'](_0x520e9d));if(!_0x4ac379)throw new _0x4a8035('ai-chat-feed-view-item-not-found',this,{'id':_0x520e9d});return _0x4ac379;}['setLoadingMessage'](_0xa568f1){this['set']('loadingMessage',_0xa568f1);}['toggleLoadingSkeleton'](_0x59e80f){this['set']('isLoadingSkeletonVisible',_0x59e80f);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class Ir extends _0x5c4336{['filter'](){let _0x463356=0x0;for(const _0x3a5e2c of this['items'])_0x463356+=_0x3a5e2c['items']['length'];return{'resultsCount':_0x463356,'totalItemsCount':_0x463356};}}class we extends _0x351fe1{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x34a2c2,_0xb90c20){super(_0x34a2c2,{'queryView':{'label':'','creator':_0x39bf80,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new Ir(_0x34a2c2),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0xb90c20,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=we['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=we['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',(_0x48c2c5,_0x1a5c69)=>!_0x48c2c5&&!_0x1a5c69),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x2ceae5,_0x4e6623)=>{this['isUploadInProgress']||this['isEmpty']||_0x2ceae5['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x4e6623());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x237d1e=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x237d1e)return this['queryView']['errorText']=Yn(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1,this['fire']('sendUserMessage',_0x237d1e),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x23f29f){this['queryView']['fieldView']['set']('placeholder',_0x23f29f);}['_createSubmitButton'](){const _0x536bc1=new _0x155a80(this['locale']);return _0x536bc1['set']({'icon':_0x1e3ea1,'label':Yn(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x536bc1['on']('execute',()=>{this['submit']();}),_0x536bc1;}['setIsUploadInProgress'](_0x273fbc){this['isUploadInProgress']=_0x273fbc;}['_setUpAddContextButtonPositioning'](){const _0x23d6d0=this['locale'],_0xbb69bd=()=>{_0x3125c6['window']['requestAnimationFrame'](()=>{if(_0x346d68(this['element'])){const _0x118f3c=new _0x5198ab(this['queryView']['fieldView']['element']),_0x2a665b=new _0x5198ab(this['_addContextButtonView']['element']),_0x21e03c=_0x118f3c['width'],_0x110158='rtl'===_0x23d6d0['uiLanguageDirection']?'right':'left';_0x118f3c['excludeScrollbarsAndBorders']();const _0x21f2f1=_0x21e03c-_0x118f3c['width']+0x1;this['_addContextButtonView']['element']['style'][_0x110158]='calc('+(_0x21e03c-_0x2a665b['width']-_0x21f2f1)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0xbb69bd),this['on']('render',()=>{_0xbb69bd(),this['_queryViewResizeObserver']=new _0x2c3742(this['queryView']['fieldView']['element'],()=>{_0xbb69bd();});});}}const Wr='ck-ai-chat__prompt-capabilities',Kr='ck-ai-chat-controls-button',$r='ck-ai-chat-controls-button--commands',Qr='ck-ai-chat-controls__model-selection',Xr='ck-ai-chat-controls__model-selection__item-name',Jr='ck-ai-chat-controls__model-selection__item-description',Zr='ck-ai-chat-controls__model-selection__item-capabilities',na='n';class xe extends _0x7ecbb5{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x12a203){super(_0x12a203),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelSelectorVisible',!0x0),this['set']('modelSelectorEnabled',!0x0),this['set']('activeModelId',''),this['set']('activeModelName',''),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',_0x44ae42=>_0x44ae42),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x4b9ce0=>_0x4b9ce0?this['_modelSelectionDropdown']['buttonView']['label']:Yn(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x4bce9e=>_0x4bce9e),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x201832=>_0x201832),this['_webSearchButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x52c59a=>!_0x52c59a),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x33d1af=>Yn(this['locale'],_0x33d1af?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x2787e6=>_0x2787e6),this['_reasoningButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0xbc51b=>!_0xbc51b),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x7cdb58=>Yn(this['locale'],_0x7cdb58?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[Wr]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x4041f8(),_0x69c78d(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x402597,_0x398624){if(this['set']('modelSelectorVisible',!(_0x398624&&_0x402597['length']<=0x1)),this['_modelSelectionDropdownItems']['clear'](),_0x402597?.['length'])for(const _0x443418 of _0x402597){const _0x141b90=new _0x1a9d93({'label':_0x443418['name'],'withText':!0x0,'role':'menuitemradio','id':_0x443418['id'],'model':_0x443418});_0x141b90['bind']('isOn')['to'](this,'activeModelId',_0x2e8c11=>_0x2e8c11===_0x443418['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x141b90,'labelView':new Wo(this['locale'],_0x443418)});}}['setWebSearch'](_0x475b65){this['set']('webSearchActive',_0x475b65);}['setReasoning'](_0x4ea2c7){this['set']('reasoningActive',_0x4ea2c7);}['setModel'](_0x1aa03c){if(!_0x1aa03c)return;this['activeModelId']=_0x1aa03c['id'],this['activeModelName']=_0x1aa03c['name']||_0x1aa03c['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x1aa03c['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x1aa03c['name']);const _0x254ef9=_0x1aa03c['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x254ef9),this['_webSearchButton']['set']('isVisible',_0x254ef9);const _0x17f63e=_0x1aa03c['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x17f63e),this['_reasoningButton']['set']('isVisible',_0x17f63e);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0),this['set']('modelSelectorVisible',!0x0);}['disableModelSelector'](_0x7d0367){this['set']('modelSelectorEnabled',!0x1),_0x7d0367&&this['set']('modelSelectorVisible',!0x1);}['_createWebSearchButton'](){const _0x429a68=new _0x155a80();return _0x429a68['set']({'label':Yn(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x125eea,'class':Kr,'isToggleable':!0x0,'tooltipPosition':na}),_0x429a68['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x429a68;}['_createReasoningButton'](){const _0x9a540b=new _0x155a80();return _0x9a540b['set']({'label':Yn(this['locale'],'AI_CHAT_REASONING'),'icon':_0x5e48f1,'class':Kr,'isToggleable':!0x0,'tooltipPosition':na}),_0x9a540b['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x9a540b;}['_createCommandsButton'](){const _0x49a82e=new _0x155a80();return _0x49a82e['set']({'label':Yn(this['locale'],'AI_CHAT_COMMANDS'),'icon':xt,'withText':!0x0,'class':Kr,'isToggleable':!0x0,'tooltip':Yn(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':na}),_0x49a82e['extendTemplate']({'attributes':{'class':[$r]}}),_0x49a82e['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x49a82e;}['_createModelSelectionDropdown'](){const _0x3930f7=_0x30b0b5(this['locale']);return _0x3930f7['set']({'panelPosition':'ne','class':[Qr]}),_0x3930f7['buttonView']['set']({'label':Yn(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':na}),this['listenTo'](_0x3930f7,'execute',_0x2609b7=>{this['fire']('selectModel',_0x2609b7['source']['model']);}),_0x3930f7;}['_createModelNameView'](){const _0x359589=new yo(this['locale']);return _0x359589['bind']('text')['to'](this,'activeModelName',_0x3f02b8=>_0x3f02b8??''),_0x359589['bind']('isVisible')['to'](this,'modelSelectorVisible',this,'activeModelName',(_0xac919c,_0x47b4e9)=>!_0xac919c&&!_0x47b4e9?.['toLowerCase']()['startsWith']('agent')),_0x359589;}}class Wo extends _0x46d8c3{constructor(_0x5a8a00,_0x2abf9a){super();const _0x222f2e=this['bindTemplate'],_0x7fc282=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x222f2e['to']('style'),'id':_0x222f2e['to']('id')},'children':[{'tag':'div','attributes':{'class':[Xr]},'children':[{'text':_0x222f2e['to']('text')}]},{'tag':'div','attributes':{'class':[Jr]},'children':[{'tag':'span','children':[{'text':_0x2abf9a['description']}]}]},{'tag':'div','attributes':{'class':[Zr]},'children':_0x7fc282}]}),_0x7fc282['addMany'](this['_getCapabilityParts'](_0x5a8a00,_0x125eea,'AI_CHAT_SEARCH_WEB',_0x2abf9a['capabilities']['webSearch']?.['enabled']??!0x1)),_0x7fc282['addMany'](this['_getCapabilityParts'](_0x5a8a00,_0x5e48f1,'AI_CHAT_REASONING',_0x2abf9a['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x2f5b68,_0x3b7f6f,_0x63e542,_0x2b11ec){const _0x3e9d04=new _0x29aaa9();_0x3e9d04['content']=_0x3b7f6f;const _0x56c081=new _0x7ecbb5(_0x2f5b68);_0x56c081['setTemplate']({'tag':'span','children':[{'text':Yn(_0x2f5b68,_0x63e542)+':\x20'}]});const _0x121370=new _0x7ecbb5(_0x2f5b68);return _0x121370['setTemplate']({'tag':'span','children':[{'text':Yn(_0x2f5b68,_0x2b11ec?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x3e9d04,_0x56c081,_0x121370];}}class yo extends _0x7ecbb5{constructor(_0x495fca){super(_0x495fca),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x408f74=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x408f74['if']('isVisible','ck-hidden',_0x3061c9=>!_0x3061c9)]},'children':[{'text':_0x408f74['to']('text')}]});}}const ra='ck-ai-chat-context-controls__url-form',oa='ck-ai-chat-context-controls__url-input-section';class Co extends _0x7ecbb5{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x550ffb){super(_0x550ffb),this['focusTracker']=new _0x30a616(),this['keystrokes']=new _0xf37da3(),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 _0x5883a2({'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'](_0x25c034=>{this['focusTracker']['add'](_0x25c034['element']),this['keystrokes']['listenTo'](_0x25c034['element']);}),_0x5b5e3c({'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'](_0x2ed476){this['urlInputField']['errorText']=_0x2ed476,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x3d11b0=new _0x155a80(this['locale']);return _0x3d11b0['set']({'icon':_0x3454be,'tooltip':Yn(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':'ck-button-icon\x20ck-button-back'}),_0x3d11b0;}['_createUrlInputField'](){const _0x3308f6=new th(this['locale'],_0x1b8929);return _0x3308f6['set']({'label':Yn(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x3308f6['fieldView']['set']({'placeholder':Yn(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x3308f6;}['_createConfirmButton'](){const _0x5b40a2=new _0x155a80(this['locale']);return _0x5b40a2['set']({'icon':_0x37c028,'tooltip':Yn(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x5b40a2;}['_setupTemplate'](){const _0x2a30d1=new _0xd9d6ea(this['locale'],{'label':Yn(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x2a30d1['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':ra,'tabindex':'-1'},'children':[_0x2a30d1,{'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',_0x1e5872=>{_0x1e5872['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x528922,_0x2d5cf2)=>{this['clear'](),this['fire']('cancel'),_0x2d5cf2();});}['_handleSubmit'](){const _0x5a05ff=this['getValue']()['trim']();_0x5a05ff?this['_isValidUrl'](_0x5a05ff)?(this['clearError'](),this['fire']('submitUrl',_0x5a05ff)):this['setError'](Yn(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](Yn(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x1ee29a=this['getValue']()['trim'](),_0x48c836=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x1ee29a['length']>0x0&&!_0x48c836;}['_isValidUrl'](_0xa9272a){try{return!!new URL(_0xa9272a);}catch{return!0x1;}}}const aa='ck-ai-chat-resources__item',ha='ck-ai-chat-resources__item--in-context',ca='ck-ai-chat-resources__item-title',la='ck-ai-chat-resources__item__icon';class tc extends _0x7baab6{['resource'];['_titleView'];['_iconView'];constructor(_0x5872e3,_0x3680ad){super(_0x5872e3),this['resource']=_0x3680ad,this['set']('isInContext',!!_0x3680ad['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x2062ea){if(_0x2062ea['isInContext'])return _0x37c028;switch(_0x2062ea['type']){case ce['DOCUMENT']:return _0x2025c1;case ce['URL']:return _0xa4bf6f;case ce['FILE']:case ce['TEXT']:return _0x49634e;default:return _0x6f1c93;}}['highlightText'](_0x34aa6f){if(!_0x34aa6f||''===_0x34aa6f['trim']())return void this['_titleView']['highlightText'](null);const _0xfecc9f=new RegExp(_0x122b7b(_0x34aa6f),'gi');this['_titleView']['highlightText'](_0xfecc9f);}['updateResourceState'](_0x4f7c43){this['resource']['isInContext']=_0x4f7c43,this['isInContext']=_0x4f7c43,this['_updateIcon']();}['_createTitleView'](){const _0x5f4ee2=new _0x19f11c();return _0x5f4ee2['text']=this['resource']['label'],_0x5f4ee2['extendTemplate']({'tag':'span','attributes':{'class':[ca]}}),_0x5f4ee2;}['_createIconView'](){const _0x24384f=new _0x29aaa9();return _0x24384f['content']=this['getResourceIcon'](this['resource']),_0x24384f;}['_setupTemplate'](){const _0x4050c2=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[aa,_0x4050c2['if']('isVisible','ck-hidden',_0xc8a91a=>!_0xc8a91a),_0x4050c2['if']('isInContext',ha)]},'children':[{'tag':'div','attributes':{'class':[la]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x4050c2['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const da='ck-ai-chat-resources__list';class Ur extends _0x5c4336{['_source'];constructor(_0x47c83f,_0x4fcc0d){super(_0x47c83f),this['_source']=_0x4fcc0d,this['extendTemplate']({'attributes':{'class':[da]}});}['setResources'](_0x3472df,_0x20d60f){this['items']['clear']();let _0x28fa2d=_0x3472df;if(this['_source']['useDefaultFiltering']&&_0x20d60f&&''!==_0x20d60f['trim']()){const _0x123a8c=new RegExp(_0x20d60f['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x28fa2d=_0x3472df['filter'](_0x3c4b02=>_0x123a8c['test'](_0x3c4b02['label']));}for(const _0x453900 of _0x28fa2d){const _0x21a819=new tc(this['locale'],_0x453900);_0x21a819['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x453900);}),this['items']['add'](_0x21a819);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x20d60f);}['highlightText'](_0x479901){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x43a7a0=>{_0x43a7a0['highlightText'](_0x479901);});}['updateResourceState'](_0x9c2d,_0x2e3010){for(const _0x4d7c93 of this['items']){const _0x4265bb=_0x4d7c93;_0x4265bb['resource']['id']===_0x9c2d&&_0x4265bb['updateResourceState'](_0x2e3010);}}['_handleResourceSelection'](_0x330abf,_0x4f2832){this['fire']('addResourceToContext',{'source':_0x330abf,'resource':_0x4f2832});}}class zr extends th{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x591b37){const t=_0x591b37['t'],_0x26e811={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x1b8929,'label':Yn(_0x591b37,'AI_CHAT_SEARCH_RESOURCES')};super(_0x591b37,_0x26e811['creator']),this['label']=_0x26e811['label'],this['_viewConfig']=_0x26e811,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x591b37,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x550871){this['fire']('search',_0x550871);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x29aaa9(),this['iconView']['content']=_0x3c6e76,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0xa5a08b,t){this['resetButtonView']=new _0x155a80(_0xa5a08b),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x4916b4,'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',_0x560b07=>!_0x560b07),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 Br extends _0x7ecbb5{['_searchView'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0xcbc49b,_0x2d75a9){super(_0xcbc49b),this['_source']=_0x2d75a9,this['set']('isLoading',!0x0),this['_searchView']=this['_createSearchView']();const _0x2f4e60=this['_createSearchSection']();this['_resourcesListView']=this['_createResourcesListView'](),this['_skeletonLoader']=this['_createSkeletonView'](),this['children']=new _0xa841d5([_0x2f4e60,this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new zr(this['locale']);}['_createSearchSection'](){const _0x3be178=new _0x7ecbb5(this['locale']);return _0x3be178['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x2595d1,_0x57f331)=>{this['loadResources'](_0x57f331),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x57f331);}),_0x3be178;}['_createResourcesListView'](){const _0x46fcd6=new Ur(this['locale'],this['_source']);return _0x46fcd6['delegate']('addResourceToContext')['to'](this),_0x46fcd6['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x46fcd6;}['_createSkeletonView'](){const _0x53449=new Yi(this['locale'],vi['aiChatResources']);return _0x53449['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x18bbd7=>!_0x18bbd7)]}}),_0x53449;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x69ba83){const _0x54064d=_0x2458fa();this['_latestLoadResourcesUid']=_0x54064d,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x69ba83,'uid':_0x54064d}),this['isLoading']=!0x0;}['setResources'](_0x2d019b,_0x4504c5){if(_0x4504c5&&_0x4504c5!==this['_latestLoadResourcesUid'])return;const _0xc2178e=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x2d019b,_0xc2178e),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x157975,_0x51a89c){this['_resourcesListView']['updateResourceState'](_0x157975,_0x51a89c);}}const ua='ck-ai-chat-context-controls__source-balloon-panel',_a='ck-button-icon\x20ck-button-back',Ia='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class mo{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x270360,_0x1078d9,_0x64cd15){this['_locale']=_0x270360,this['_bodyCollection']=_0x1078d9,this['_config']=_0x64cd15;}['showSourceResourcesBalloon'](_0x1d83f0){let _0x5cb4c3=this['_sourceResourceBalloons']['get'](_0x1d83f0['id']);_0x5cb4c3||(_0x5cb4c3=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x1d83f0['id'],_0x5cb4c3),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x5cb4c3)),this['_addSourceResourceContent'](_0x5cb4c3,_0x1d83f0),_0x5cb4c3['show']();const _0x468e7f=this['_config']['getTargetElement']();_0x468e7f&&_0x5cb4c3['pin']({'target':_0x468e7f,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x441569,_0x56af9c,_0x2dd842){const _0x4b0ab9=this['_sourceResourceBalloons']['get'](_0x441569);if(!_0x4b0ab9)return;const _0x2cc22f=this['_getResourcesViewFromBalloon'](_0x4b0ab9);_0x2cc22f&&_0x2cc22f['setResources'](_0x56af9c,_0x2dd842);}['closeSourceResourceBalloon'](_0x768690){const _0x54f01e=this['_sourceResourceBalloons']['get'](_0x768690);_0x54f01e&&requestAnimationFrame(()=>{_0x54f01e['hide'](),this['_sourceResourceBalloons']['delete'](_0x768690),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x5357c7 of this['_sourceResourceBalloons']['values']())if(_0x5357c7['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x1b72b4,_0x46452a,_0x2b6bf8){const _0x3c1b9=this['_sourceResourceBalloons']['get'](_0x1b72b4);if(!_0x3c1b9||!_0x3c1b9['isVisible'])return;const _0x4b4349=this['_config']['getTargetElement']();if(!_0x4b4349)return;_0x3c1b9['pin']({'target':_0x4b4349,'limiter':this['_config']['getLimiterElement']()});const _0x2eebba=this['_getResourcesViewFromBalloon'](_0x3c1b9);_0x2eebba&&_0x2eebba['updateResourceState'](_0x46452a,_0x2b6bf8);}['destroy'](){for(const _0x27d53e of this['_sourceResourceBalloons']['values']())_0x27d53e['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x205c2d=new _0x271ec1(this['_locale']);return _0x205c2d['extendTemplate']({'attributes':{'class':ua}}),this['_bodyCollection']['add'](_0x205c2d),_0x205c2d;}['_addSourceResourceContent'](_0x23859a,_0x428405){_0x23859a['content']['clear']();const _0x147b17=this['_createBalloonHeader'](_0x23859a,_0x428405);_0x23859a['content']['add'](_0x147b17);const _0x4c122b=this['_createBalloonResourcesView'](_0x428405);_0x23859a['content']['add'](_0x4c122b);}['_createBalloonHeader'](_0x47ba68,_0x329b8a){const _0x5cec8e=this['_createBackButton'](_0x47ba68),_0x5e7f19=new _0xd9d6ea(this['_locale'],{'label':_0x329b8a['label'],'class':Ia});return _0x5e7f19['children']['add'](_0x5cec8e,0x0),_0x5e7f19;}['_createBackButton'](_0xcd4598){const _0x681ac1=new _0x155a80(this['_locale']);return _0x681ac1['set']({'icon':_0x3454be,'tooltip':Yn(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':_a}),_0x681ac1['on']('execute',()=>{_0xcd4598['hide'](),this['_config']['onBackToContext']();}),_0x681ac1;}['_createBalloonResourcesView'](_0x2246f5){const _0x41476e=new Br(this['_locale'],_0x2246f5);return _0x41476e['on']('loadSourceResources',(_0x4c5b4b,_0x4f1aff)=>{this['_config']['onLoadSourceResources'](_0x4f1aff);}),_0x41476e['on']('addResourceToContext',(_0xa679a,_0x373286)=>{this['_config']['onResourceSelected'](_0x373286['source'],_0x373286['resource']),this['closeSourceResourceBalloon'](_0x2246f5['id']);}),_0x41476e;}['_getResourcesViewFromBalloon'](_0x191e6b){const _0x5293f3=_0x191e6b['content']['get'](0x1);return _0x5293f3 instanceof Br?_0x5293f3:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x4aa5ee){_0x6d5b3a({'emitter':_0x4aa5ee,'contextElements':[_0x4aa5ee['element']],'callback':()=>{_0x4aa5ee['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x4aa5ee['isVisible']});}}const Pe=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources'],wo='ck-ai-chat-context-controls',po='ck-ai-chat-context-controls__pending-contexts',Bo='ck-ai-chat-context-controls__add-context-balloon-panel',bo='ck-ai-chat-context-controls__add-context-button',To='ck-ai-chat-context-controls__url-balloon-panel',Ao='ck-ai-chat-context-controls__balloon-button',ko='ck-ai-chat-context-controls__balloon-button-source',Eo='ck-ai-chat-controls-button',vo='ck-ai-chat-context-chips-wrapper-balloon',go='ck-ai-chat-controls_context_show-more-button',Vo='ck-ai-chat-context-controls__show-more-balloon-panel',fo='ck-ai-chat',Io=[_0x271ec1['defaultPositions']['northArrowSouthWest'],_0x271ec1['defaultPositions']['northArrowSouth'],_0x271ec1['defaultPositions']['northArrowSouthEast'],_0x271ec1['defaultPositions']['southArrowNorthWest'],_0x271ec1['defaultPositions']['southArrowNorth'],_0x271ec1['defaultPositions']['southArrowNorthEast']];class be extends _0x7ecbb5{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['bodyCollection'];constructor(_0x3f00e0,_0x84baa8){super(_0x3f00e0),this['bodyCollection']=_0x84baa8,this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x3f00e0),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x3f00e0),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x3f00e0),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x3f00e0,_0x84baa8);const _0x2ecf32={'cssClasses':{'showMoreButton':go,'showMoreBalloon':Vo,'overflowContainer':vo,'controlsButton':Eo}};this['_overflowManager']=new xo(_0x3f00e0,this['_currentContextsChips'],_0x2ecf32,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'](_0x48c728,_0x40b347){const _0x473cb6=this['_createContextButton'](_0x48c728,'current',!0x0,_0x40b347);this['_addContextToCollection'](_0x473cb6,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x1146ca){this['_removeContextFromCollection'](_0x1146ca,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x1146ca,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x592c5b,_0x400675){let _0x4b7823=this['_currentContextsChips']['find'](_0x1613d3=>_0x1613d3['id']===_0x592c5b);_0x4b7823||(_0x4b7823=this['_overflowManager']['overflowChips']['find'](_0x6afc31=>_0x6afc31['id']===_0x592c5b)),_0x4b7823&&(_0x4b7823['isLoading']=_0x400675);}['setConversationContext'](_0x3da889){this['_conversationContextsChips']['clear']();for(const _0x2c1db7 of _0x3da889){const _0x4b2a11=this['_createContextButton'](_0x2c1db7,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x4b2a11,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x27f1d2,_0x579899,_0x336108){this['_resourcesBalloonView']['updateResourceState'](_0x27f1d2,_0x579899,_0x336108);}['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'](_0x4b97dd){this['_resourcesBalloonView']['showSourceResourcesBalloon'](_0x4b97dd),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x4c47ca,_0x3b8b40,_0x183d27,_0x56bb6b){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x4c47ca,_0x183d27,_0x56bb6b);}['closeSourceResourceBalloon'](_0x12e00e){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x12e00e),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x1f2b7c){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x1f2b7c),this['_setAddContextButtonEnabled'](_0x1f2b7c);}['_setAddContextButtonEnabled'](_0x5b9dda){const _0x5a97e0=!_0x5b9dda['document']['isHidden']&&_0x5b9dda['document']['enabled'],_0x5a21a4=_0x5b9dda['urls']['enabled'],_0x38c218=_0x5b9dda['files']['enabled'];this['addContextButtonView']['isEnabled']=_0x5a97e0||_0x5a21a4||_0x38c218;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[wo,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':po},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x3c7ab7){const _0x3bfb88=new _0x155a80(_0x3c7ab7);return _0x3bfb88['set']({'label':Yn(_0x3c7ab7,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Eo+'\x20'+bo,'icon':_0x22ac03,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x3bfb88;}['_createAddContextBalloonPanelView'](_0x2c636d){return this['_createBaseBalloonPanel'](_0x2c636d,Bo);}['_createUrlBalloonPanelView'](_0x1722da){const _0x54a90c=this['_createBaseBalloonPanel'](_0x1722da,To);return this['_addUrlContent'](_0x54a90c,_0x1722da),_0x54a90c;}['_createResourcesBalloonView'](_0x4d858c,_0x577333){return new mo(_0x4d858c,_0x577333,{'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Io});},'onResourceSelected':(_0x95d010,_0x40c99c)=>{this['fire']('addResourceToContext',{'source':_0x95d010,'resource':_0x40c99c});},'onLoadSourceResources':_0xcfa38a=>{this['fire']('loadSourceResources',_0xcfa38a);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']});}['_getLimiterElement'](){return this['element']?.['closest']('.'+fo)||document['body'];}['_createBaseBalloonPanel'](_0x2681b7,_0x2c2927){const _0x124e28=new _0x271ec1(_0x2681b7);return _0x124e28['extendTemplate']({'attributes':{'class':_0x2c2927}}),this['bodyCollection']['add'](_0x124e28),_0x124e28;}['_setBalloonPanelContent'](_0x1d6e31,_0x1de111,_0x200e6a){if(_0x1d6e31['content']['clear'](),!_0x200e6a['document']['isHidden']&&_0x200e6a['document']['enabled']){const _0x44efc1=this['_createBalloonButton'](_0x1de111,{'label':Yn(_0x1de111,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x2025c1});_0x44efc1['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x1d6e31['content']['add'](_0x44efc1);}if(_0x200e6a['urls']['enabled']){const _0x99f97=this['_createBalloonButton'](_0x1de111,{'label':Yn(_0x1de111,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0xa4bf6f});_0x99f97['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Io}),this['_urlInputView']['focus']();}),_0x1d6e31['content']['add'](_0x99f97);}if(_0x200e6a['files']['enabled']){const _0x328406=new _0x49c261(_0x1de111);_0x328406['set']({'label':Yn(_0x1de111,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x11aba8,'withText':!0x0,'tooltip':!0x0,'class':Ao,'allowMultipleFiles':!0x0}),_0x328406['on']('done',(_0x259ba7,_0x26673d)=>{this['fire']('addFileToContext',_0x26673d),this['hideAddContextBalloonPanel']();}),_0x328406['tooltip']=!0x0,_0x1d6e31['content']['add'](_0x328406);}for(const _0x4e9614 of _0x200e6a['sources']){const _0x54570e=this['_createBalloonButton'](_0x1de111,{'label':_0x4e9614['label'],'icon':_0x4e9614['icon']||_0x6f1c93,'type':'source'});_0x1d6e31['content']['add'](_0x54570e),_0x54570e['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon'](_0x4e9614);});}}['_addUrlContent'](_0x5a41ce,_0x106f84){this['_urlInputView']=new Co(_0x106f84),this['_urlInputView']['on']('submitUrl',(_0x4b992c,_0x1acfd9)=>{this['_handleUrlSubmit'](_0x1acfd9);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Io});}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Io});}),_0x5a41ce['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x3b26b2,_0x506f75){const _0x5df5a1='source'===_0x506f75['type']?new ga(_0x3b26b2):new _0x155a80(_0x3b26b2);return _0x5df5a1['set']({'label':_0x506f75['label'],'icon':_0x506f75['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Ao}),_0x5df5a1;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x6d5b3a({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x164e53){const _0x2cee9c=this['_addContextBalloonConfig'];_0x2cee9c['buttonView']['isOn']=_0x164e53,_0x164e53?_0x2cee9c['balloonView']['show']():_0x2cee9c['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x58f886,buttonView:_0x86815e,hideMethod:_0x1822fa}=this['_addContextBalloonConfig'];_0x6d5b3a({'emitter':_0x58f886,'contextElements':[_0x58f886['element'],_0x86815e['element']],'callback':()=>{_0x1822fa();},'activator':()=>_0x86815e['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x4ff2df,_0x50a0a6,_0x24b7ab=!0x1,_0xb816ea=!0x1){const _0x3d780a='conversation'===_0x50a0a6||!0x0===_0x4ff2df['isReadOnly'],_0x46f03a=new _o(this['locale'],_0x4ff2df,_0x3d780a,_0x24b7ab,_0xb816ea);return _0x3d780a||_0x46f03a['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x46f03a['id']);}),_0x46f03a;}['_addContextToCollection'](_0x8cf522,_0x572ce3){_0x572ce3['add'](_0x8cf522,0x0);}['_removeContextFromCollection'](_0x5e1f0a,_0x3f081c){const _0x11e07b=_0x3f081c['find'](_0x2444a4=>_0x2444a4['id']===_0x5e1f0a);_0x11e07b&&_0x3f081c['remove'](_0x11e07b);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Io}));}['_handleUrlSubmit'](_0x299f9c){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x299f9c);}}class ga extends _0x155a80{['arrowView'];constructor(_0x58efef){super(_0x58efef),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[ko]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x688385=new _0x29aaa9();return _0x688385['content']=_0x178d87,_0x688385['extendTemplate']({'attributes':{'class':ko+'__arrow'}}),_0x688385;}}class ve extends _0x7ecbb5{['_cancelButtonView'];['_loaderView'];constructor(_0x31d1f0){super(_0x31d1f0),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 _0x593353=new _0x155a80(this['locale']);return _0x593353['set']({'label':Yn(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ai-chat-controls-loader__cancel-button','icon':_0x3a9ce7}),_0x593353['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x593353;}['_createLoaderView'](){const _0x3e613a=new _0x7ecbb5(this['locale']);return _0x3e613a['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':Yn(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x3e613a;}}class Gi extends _0x7ecbb5{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_shouldRestorePromptInputFocus'];constructor(_0x57a8ce,_0x9006c){super(_0x57a8ce),this['_contextPanelView']=this['_createContextPanelView'](_0x57a8ce,_0x9006c),this['_promptInputView']=this['_createPromptInputView'](_0x57a8ce),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x57a8ce),this['_loaderView']=this['_createLoaderView'](_0x57a8ce),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'](...Pe)['to'](this);const _0x1b6b46=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls']},'children':[{'tag':'div','attributes':{'class':[_0x1b6b46['if']('isLoading','ck-hidden')]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x1b6b46['if']('isLoading','ck-hidden',_0x2b00e6=>!_0x2b00e6)]},'children':[this['_loaderView']]}]}),_0x6d5b3a({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x4fd498,_0x5f0cf0){return new be(_0x4fd498,_0x5f0cf0);}['_createPromptInputView'](_0x3f7a5f){return new we(_0x3f7a5f,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x423f21){return new xe(_0x423f21);}['_createLoaderView'](_0x3a2bf9){return new ve(_0x3a2bf9);}['_handlePromptInputFocus'](_0x293ec7,_0x55a123,_0x51e82a){_0x51e82a?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x342231,_0x1232ec){this['_contextPanelView']['addContextItem'](_0x342231,_0x1232ec);}['removeContextItem'](_0x208b11){this['_contextPanelView']['removeContextItem'](_0x208b11);}['setContextItemLoading'](_0x38a054,_0x5d0bf1){this['_contextPanelView']['setContextItemLoading'](_0x38a054,_0x5d0bf1);}['setIsUploadInProgress'](_0x37e8c6){this['_promptInputView']['setIsUploadInProgress'](_0x37e8c6);}['setConversationContext'](_0x26952b){this['_contextPanelView']['setConversationContext'](_0x26952b);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x5eabe6,_0x4438cd,_0x640e4e){this['_contextPanelView']['updateResourceState'](_0x5eabe6,_0x4438cd,_0x640e4e);}['setWebSearch'](_0x105d91){this['_promptCapabilitiesView']['setWebSearch'](_0x105d91);}['setReasoning'](_0xc87922){this['_promptCapabilitiesView']['setReasoning'](_0xc87922);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x993f24){this['_contextPanelView']['setAddContextOptions'](_0x993f24);}['setInputPlaceholder'](_0x217992){this['_promptInputView']['setPlaceholderText'](_0x217992);}['setModelList'](_0x26023e,_0x2da8af){this['_promptCapabilitiesView']['setModelList'](_0x26023e,_0x2da8af);}['setModel'](_0xf908b3){this['_promptCapabilitiesView']['setModel'](_0xf908b3);}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x522d20){this['_promptCapabilitiesView']['disableModelSelector'](_0x522d20);}['populateSourceResourceBalloon'](_0x3d506b,_0x23e5af,_0x48d3e0,_0x565f55){this['_contextPanelView']['populateSourceResourceBalloon'](_0x3d506b,_0x23e5af,_0x48d3e0,_0x565f55);}['closeSourceResourceBalloon'](_0x259f26){this['_contextPanelView']['closeSourceResourceBalloon'](_0x259f26);}['focusPromptInput'](){this['_promptInputView']['focus']();}}class Ji extends _0xd9d6ea{['conversationStartButton'];['resizeButton'];constructor(_0x247e70,_0x1fa353){super(_0x247e70,{'label':Yn(_0x247e70,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':Rt}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x247e70),this['children']['add'](this['conversationStartButton']),_0x1fa353&&(this['resizeButton']=Mi(_0x247e70,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x4a92db){const _0x7393a4=new _0x155a80(_0x4a92db);return _0x7393a4['set']({'label':Yn(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x5f3a3b,'class':'ck-ai-chat__start-conversation'}),_0x7393a4['on']('execute',()=>{this['fire']('startConversation');}),_0x7393a4;}}class Ki extends _0x7ecbb5{constructor(_0x4543b3){super(_0x4543b3),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':Yn(_0x4543b3,'AI_DISCLAIMER_TEXT')}]}]});}}class St extends _0x7ecbb5{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x2fac81,_0x2b7471){super(_0x2fac81),this['_bodyCollection']=new jt(_0x2fac81),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new Ji(_0x2fac81,_0x2b7471),this['chatHeader']['delegate'](...Ht)['to'](this),this['chatFeed']=new Bi(_0x2fac81,this['_bodyCollection']),this['chatFeed']['delegate'](...Ht)['to'](this),this['chatControls']=new Gi(_0x2fac81,this['_bodyCollection']),this['chatControls']['delegate'](...Ht)['to'](this),this['chatDisclaimer']=new Ki(_0x2fac81),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x2fac81['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x20edac,_0x443c98,_0x592144,_0x179511){this['chatControls']['populateSourceResourceBalloon'](_0x20edac,_0x443c98,_0x592144,_0x179511);}['closeSourceResourceBalloon'](_0x4258a6){this['chatControls']['closeSourceResourceBalloon'](_0x4258a6);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class ct extends _0x316379{static get['requires'](){return[et];}['_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;constructor(_0x42c508){super(_0x42c508);const _0xb8bcda=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new g(),this['_view']=new St(this['context']['locale'],_0xb8bcda['showResizeButton']),this['_view']['delegate'](...Ht)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x1ba93a,{showDiff:_0x6ce25})=>{this['showDiff']=_0x6ce25;}),_0xb8bcda['view']['addTab']({'id':'chat','buttonLabel':Yn(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':Rt,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0xce19b=>_0xce19b),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x53a212=>_0x53a212),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x38b92d){this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x38b92d['availableModels'],!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':Yn(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE')});}['addFeedItemStaticMessage']({id:_0x3b87f1,staticMessage:_0x1e5b56}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x3b87f1,'initialContent':'<p>'+_0x1e5b56+'</p>'});}['addFeedItemUserMessage'](_0x30c75a){const _0x3529c0=_0x30c75a['quickActionData']?.['displayedPrompt']||_0x30c75a['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x30c75a['contextItems']['values']()),'initialContent':'<p>'+_0x3529c0+'</p>','id':_0x30c75a['id']});}['addFeedItemError']({errorMessage:_0x529294,id:_0x19a21a}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x529294+'</p>','id':_0x19a21a});}['addFeedItemAIReply'](_0xc98902){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0xc98902['interactionId']+':'+_0xc98902['id']}),this['_view']['chatFeed']['setLoadingMessage']('');});}async['addFeedItemAISuggestion'](_0x29796d){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x29796d['interactionId']+':'+_0x29796d['id'],'areActionsDisabled':_0x29796d['areActionsDisabled'],'showDiff':this['showDiff']}),this['_view']['chatFeed']['setLoadingMessage']('');});}['addFeedInteractionHeader'](_0x178bd9){this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x178bd9['id'],'capabilities':_0x178bd9['capabilities']});}['updateFeedInteractionHeader'](_0x4ba09e){const _0x29cde4=this['_view']['chatFeed']['children']['find'](_0x146ca1=>_0x146ca1['options']['id']==_0x4ba09e['id']&&_0x146ca1 instanceof Pt);_0x29cde4&&_0x29cde4['set']('isVisible',_0x4ba09e['isVisible']);}async['updateFeedItemAIReplyContent'](_0x5c5e9a){const _0x243475=_0x5c5e9a['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x1020b7=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x5c5e9a,'abortSignal':_0x1020b7,'renderingStrategy':_0x243475}),_0x5c5e9a['isDone']&&this['markFeedItemAsDone'](_0x5c5e9a['id']);});}['updateFeedItemAIReplySources'](_0x3cca7e,_0x5e4c74){this['_view']['chatFeed']['updateWebSources'](_0x3cca7e,_0x5e4c74);}async['updateFeedItemAIReplySuggestionContent'](_0x41b1eb){const _0xfc528d=_0x41b1eb['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x3459f7=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x41b1eb,'abortSignal':_0x3459f7,'renderingStrategy':_0xfc528d}),_0x41b1eb['isDone']&&this['markFeedItemAsDone'](_0x41b1eb['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x3adaf9){this['_view']['chatFeed']['updateSuggestionPartState'](_0x3adaf9);}['markFeedItemAsDone'](_0x515590){this['_view']['chatFeed']['markItemAsDone'](_0x515590);}['removeFeedInteraction'](_0x27467d){this['_view']['chatFeed']['getItemIds']()['filter'](_0x172746=>_0x172746['startsWith'](_0x27467d))['forEach'](_0xd58a50=>this['_view']['chatFeed']['removeItem'](_0xd58a50));}['startInteraction'](_0x7080c){this['_view']['chatFeed']['setLoadingMessage'](this['_getLoadingMessage'](_0x7080c)),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x59ca64){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x1b74ac=>_0x1b74ac['startsWith'](_0x59ca64['id']))['forEach'](_0x48e484=>this['markFeedItemAsDone'](_0x48e484)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0xeb8382,_0x313378){this['_view']['chatControls']['addContextItem'](_0xeb8382,_0x313378);}['removeContextItem'](_0x566d3c){this['_view']['chatControls']['removeContextItem'](_0x566d3c);}['setContextItemLoading'](_0x2da858,_0x2be10d){this['_view']['chatControls']['setContextItemLoading'](_0x2da858,_0x2be10d);}['setIsUploadInProgress'](_0x4c128f){this['_view']['chatControls']['setIsUploadInProgress'](_0x4c128f);}['setConversationContext'](_0x29aec5){this['_view']['chatControls']['setConversationContext'](_0x29aec5);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x178709,_0x5b3323,_0x1a5773){this['_view']['chatControls']['updateResourceState'](_0x178709,_0x5b3323,_0x1a5773);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x13bbba){this['_view']['chatControls']['setAddContextOptions'](_0x13bbba);}['updateCapabilities'](_0xe1f717){this['_view']['chatControls']['setWebSearch'](_0xe1f717['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0xe1f717['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0xe1f717));}['setSelectedModel'](_0x26f4ac,_0xe940e6){this['_view']['chatControls']['setModel'](_0x26f4ac),_0xe940e6&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x37d789){this['feedItemRenderingStrategy']=_0x37d789;}['toggleLoadingSkeleton'](_0x1e1c04){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x1e1c04);}['resetConversationTitle'](){this['setConversationTitle'](Yn(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x5ad46d,_0x26a701=!0x1){if(_0x26a701&&!Et()&&_0x5ad46d['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x5ad46d);this['_view']['chatHeader']['label']=_0x5ad46d;}['_animateConversationTitle'](_0x572a1f){let _0x2d780f=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x572a1f[_0x2d780f],_0x2d780f++,_0x2d780f===_0x572a1f['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x125ac6){this['_view']['chatHeader']['isMaximized']=_0x125ac6;}['_getLoadingMessage'](_0x3b1fbe){const _0x2cd6a7=_0x3b1fbe['capabilities'];return _0x2cd6a7['isWebSearchEnabled']&&_0x2cd6a7['isReasoningEnabled']?Yn(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x2cd6a7['isWebSearchEnabled']?Yn(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x2cd6a7['isReasoningEnabled']?Yn(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):Yn(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x1b7f91){return _0x1b7f91?_0x1b7f91['isWebSearchEnabled']&&_0x1b7f91['isReasoningEnabled']?Yn(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x1b7f91['isWebSearchEnabled']?Yn(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x1b7f91['isReasoningEnabled']?Yn(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):Yn(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):Yn(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x2beef4,_0x1dc6a8,_0x3dafb5,_0x2db0ee){this['_view']['populateSourceResourceBalloon'](_0x2beef4,_0x1dc6a8,_0x3dafb5,_0x2db0ee);}['closeSourceResourceBalloon'](_0x19c643){this['_view']['closeSourceResourceBalloon'](_0x19c643);}['focusPromptInput'](){this['_view']['chatControls']['focusPromptInput']();}['scrollFeedToSuggestion'](_0x537e9c,_0x4b2721){this['_view']['chatFeed']['scrollToSuggestion'](_0x537e9c,_0x4b2721);}}class Ei extends _0x5c4336{['sections'];constructor(_0x5b6748,_0x18524d){super(_0x5b6748),this['sections']=_0x18524d,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x4fb85b){let _0x128612=0x0,_0x353bff=0x0;for(const _0xd3c364 of this['sections']){const {resultsCount:_0x1da8ed,totalItemsCount:_0x7b618}=_0xd3c364['filter'](_0x4fb85b);_0x128612+=_0x1da8ed,_0x353bff+=_0x7b618;}return{'resultsCount':_0x128612,'totalItemsCount':_0x353bff};}}class Ri extends _0x7baab6{['title'];['itemsViews'];['_itemsListView'];constructor(_0x185e49,{title:_0x3a585c,items:_0x461003}){super(_0x185e49);const _0x216c2a=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x3a585c,this['itemsViews']=_0x461003;const _0x348abc=new _0x7ecbb5(_0x185e49);_0x348abc['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x5c4336(_0x185e49),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x216c2a['if']('isVisible','ck-hidden',_0x41555f=>!_0x41555f)]},'children':[_0x348abc,this['_itemsListView']]});}['filter'](_0x5c328a){const _0x13444a=this['itemsViews']['length'];let _0x1044f3=0x0;for(const _0x5553b7 of this['itemsViews']){if(_0x5c328a){const _0x12d5ca=_0x5553b7['isMatching'](_0x5c328a);_0x5553b7['isVisible']=!!_0x12d5ca,_0x5553b7['highlightText'](_0x5c328a);}else _0x5553b7['isVisible']=!0x0,_0x5553b7['highlightText'](null);_0x5553b7['isVisible']&&_0x1044f3++;}return this['isVisible']=_0x1044f3>0x0,{'resultsCount':_0x1044f3,'totalItemsCount':_0x13444a};}['getItem'](_0x2a283d){return this['itemsViews']['find'](_0x2691cc=>_0x2691cc['id']===_0x2a283d);}['removeItem'](_0x16401c){const _0x1c951d=this['itemsViews']['indexOf'](_0x16401c);-0x1!==_0x1c951d&&(this['itemsViews']['splice'](_0x1c951d,0x1),this['_itemsListView']['items']['remove'](_0x16401c));}}class ji extends _0x103bd6(_0x7baab6){['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(_0x1f7055,_0x90bbf7){super(_0x1f7055);const _0x4ca442=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x90bbf7['pinned']),this['set']('loadingState',null),this['id']=_0x90bbf7['id'];const {title:_0x6343f6,createdAt:_0x246274,active:_0x2a8f9d=!0x1}=_0x90bbf7;this['_titleView']=new _0x19f11c(),this['_titleView']['text']=_0x6343f6,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x2af7a4=this['_createCheckView'](),_0x3f89a6=this['_createPinButtonView'](_0x1f7055),_0x103692=this['_createMenuDropdownView'](),_0x7ec01a=this['_createEditInputView'](_0x1f7055,_0x6343f6),_0x338750=this['_createAcceptEditButtonView'](_0x1f7055,_0x7ec01a),_0x1af1f7=this['_createCancelEditButtonView'](_0x1f7055,_0x7ec01a);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x3f89a6),this['actions']['add'](_0x103692),this['on']('change:isEdit',(_0x1e1abe,_0x3ca9b0,_0x47a4c5)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x47a4c5?(this['actions']['add'](_0x338750),this['actions']['add'](_0x1af1f7),this['mainContent']['add'](_0x7ec01a),_0x7ec01a['element']['focus']()):(this['actions']['add'](_0x3f89a6),this['actions']['add'](_0x103692),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x2a8f9d?'ck-ai-chat-history__item--active':'',_0x4ca442['if']('isVisible','ck-hidden',_0x1b9d1b=>!_0x1b9d1b),_0x4ca442['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',_0x4ca442['if']('loadingState','ck-hidden',_0x4d38ef=>!!_0x4d38ef)]},'children':_0x2a8f9d?[_0x2af7a4]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x4ca442['if']('loadingState','ck-hidden',_0x1fad44=>!_0x1fad44)]},'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',_0x4ca442['if']('loadingState','ck-hidden',_0x3e817c=>!!_0x3e817c)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x4ca442['if']('loadingState','ck-hidden',_0x55a7b0=>!_0x55a7b0)]},'children':[{'text':_0x4ca442['to']('loadingState',_0xad2afa=>_0xad2afa?Yn(this['locale'],ji['LOADING_LABELS'][_0xad2afa]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x246274]}]},{'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'](_0x4977d9){this['_titleView']['text']=_0x4977d9;}['updateLoadingState'](_0x4b76a4,_0x4014dc){this['set']('loadingState',_0x4014dc?_0x4b76a4:null);}['_createCheckView'](){const _0x2e5ca1=new _0x29aaa9();return _0x2e5ca1['set']({'content':_0x564196}),_0x2e5ca1;}['_createPinButtonView'](_0x35bdea){const _0x3ace53=new _0x155a80(_0x35bdea);return _0x3ace53['set']({'label':Yn(_0x35bdea,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x252a95,'withText':!0x1,'tooltip':!0x0}),_0x3ace53['bind']('isOn')['to'](this,'pinned'),_0x3ace53['on']('execute',()=>{const _0x11de89=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x11de89});}),_0x3ace53;}['_createMenuDropdownView'](){const _0x4a8fc7=_0x30b0b5(this['locale'],_0x3d3f9f),_0x38c8f6=_0x4a8fc7['panelView']['children'];_0x4a8fc7['buttonView']['set']({'label':Yn(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x3944e6}),_0x4a8fc7['panelPosition']='sw';const _0x24ef1e=new _0x155a80(this['locale']);_0x24ef1e['label']=Yn(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x24ef1e['withText']=!0x0,_0x24ef1e['on']('execute',()=>{this['isEdit']=!0x0;});const _0x3bbcfe=new _0x155a80(this['locale']);_0x3bbcfe['label']=Yn(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x3bbcfe['withText']=!0x0,_0x3bbcfe['on']('execute',()=>{this['showConfirm'](Yn(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x42e561=new _0x5c4336(this['locale']),_0x346e19=new _0x7baab6(this['locale']);_0x346e19['children']['add'](_0x24ef1e);const _0x35a67d=new _0x7baab6(this['locale']);return _0x35a67d['children']['add'](_0x3bbcfe),_0x42e561['items']['addMany']([_0x346e19,_0x35a67d]),_0x38c8f6['add'](_0x42e561),_0x4a8fc7;}['_createEditInputView'](_0x3aea96,_0xaf7cd2){const _0x548f0c=new _0x34abd3(_0x3aea96),_0x3a1be3=_0x548f0c['bindTemplate'];return _0x548f0c['value']=_0xaf7cd2,_0x548f0c['extendTemplate']({'on':{'keydown':_0x3a1be3['to'](_0x5d2da1=>{'Enter'==_0x5d2da1['key']&&this['_commitEditInputValue'](_0x548f0c);})}}),_0x548f0c;}['_createAcceptEditButtonView'](_0x4aeda2,_0x134186){const _0x2be11a=new _0x155a80(_0x4aeda2);return _0x2be11a['set']({'icon':_0x564196,'withText':!0x1,'tooltip':Yn(_0x4aeda2,'AI_CHAT_HISTORY_ACCEPT')}),_0x2be11a['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x2be11a['on']('execute',()=>{this['_commitEditInputValue'](_0x134186);}),_0x2be11a;}['_commitEditInputValue'](_0x566962){const _0x356424=_0x566962['element']['value']||'';this['_titleView']['text']=_0x356424,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x356424});}['_createCancelEditButtonView'](_0x3c49fe,_0x2aa099){const _0xc5bde8=new _0x155a80(_0x3c49fe);return _0xc5bde8['set']({'icon':_0x4916b4,'withText':!0x1,'tooltip':Yn(_0x3c49fe,'AI_CHAT_HISTORY_CANCEL')}),_0xc5bde8['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0xc5bde8['on']('execute',()=>{this['isEdit']=!0x1,_0x2aa099['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0xc5bde8;}['_createSpinnerView'](){const _0x59cc37=new Si('tiny');return _0x59cc37['isVisible']=!0x0,_0x59cc37;}['isMatching'](_0x2698b4){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x2698b4)?{'title':!0x0}:null;}['highlightText'](_0x42b0f2){this['_titleView']['highlightText'](_0x42b0f2);}}class at extends _0x7ecbb5{['searchView'];['errorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x3c50f8,_0x1d1bc5){super(_0x3c50f8),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1);const _0x46bd10=new _0xd9d6ea(_0x3c50f8,{'label':Yn(_0x3c50f8,'AI_CHAT_HISTORY_HEADING'),'icon':ot,'class':'ck-ai-header\x20ck-ai-header_history'});_0x1d1bc5&&(this['resizeButton']=Mi(_0x3c50f8,this),_0x46bd10['children']['add'](this['resizeButton'])),this['sectionsView']=new Ei(_0x3c50f8,[]),this['sectionsView']['delegate'](...xi)['to'](this),this['errorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),this['on']('change:isLoading',()=>this['_updateViewVisibility']()),this['on']('change:hasItems',()=>this['_updateViewVisibility']()),this['on']('change:errorMessage',()=>this['_updateViewVisibility']()),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat-history','ck-rounded-corners'],'dir':'ltr'},'children':[_0x46bd10,{'tag':'div','attributes':{'class':['ck-ai-chat-history__content']},'children':[this['skeletonView'],this['errorView'],this['emptyView'],this['searchView']]}]});}['_updateViewVisibility'](){this['isSearchViewVisible']=!this['isLoading']&&this['hasItems']&&!this['errorMessage'],this['isEmptyViewVisible']=!this['isLoading']&&!this['hasItems']&&!this['errorMessage'];}['_createSearchView'](){const _0x1020c3=new _0x459d27(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':Yn(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x5ae5a1=>Yn(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x5ae5a1),'secondary':Yn(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}});return _0x1020c3['on']('render',()=>{this['searchView']['children']['add'](this['errorView'],0x1);}),_0x1020c3['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x331d6c=>!_0x331d6c)]}}),_0x1020c3;}['_createSkeletonView'](){const _0x56231c=new Yi(this['locale'],vi['aiHistory']);return _0x56231c['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x4e1a8c=>!_0x4e1a8c)]}}),_0x56231c;}['_createErrorView'](){const _0x871855=new _0x7ecbb5(this['locale']),_0x14cacd=new _0x155a80(this['locale']);return _0x14cacd['set']({'withText':!0x1,'icon':_0x4916b4,'class':'ck-ai-chat-error__dismiss-button'}),_0x14cacd['bind']('isVisible')['to'](this,'hasItems',_0x1b890a=>!!_0x1b890a),_0x14cacd['on']('execute',()=>{this['errorMessage']='';}),_0x871855['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-error',this['bindTemplate']['if']('errorMessage','ck-hidden',_0x22ce6b=>!_0x22ce6b)]},'children':[{'tag':'p','children':[{'text':this['bindTemplate']['to']('errorMessage')}]},_0x14cacd]}),_0x871855;}['_createEmptyStateView'](){const _0x21821e=new _0x155a80(this['locale']);_0x21821e['set']({'withText':!0x0,'label':Yn(this['locale'],'AI_CHAT_HISTORY_GO_TO_CHAT_BUTTON'),'class':'ck-ai-chat-history__open-chat-button'}),_0x21821e['on']('execute',()=>{this['fire']('openChat');});const _0x3ac6a0=new _0x7ecbb5(this['locale']);return _0x3ac6a0['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x4501ff=>!_0x4501ff)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[Yn(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x21821e]}),_0x3ac6a0;}['_createListItemViews'](_0x3fb67b,_0x2da7f9){const _0x3f6133=[];for(const _0x53b699 of _0x3fb67b){const _0x180ce5=new ji(_0x2da7f9,_0x53b699);_0x180ce5['delegate'](...xi)['to'](this),_0x3f6133['push'](_0x180ce5);}return _0x3f6133;}['updateHistoryItemsWithCategories'](_0x14209f){const _0x4b51df=this['locale']||'en',_0x3574af=[];for(const _0x2b395f of _0x14209f){const _0xbdb6fa=this['_createListItemViews'](_0x2b395f['items'],_0x4b51df);_0x3574af['push'](new Ri(_0x4b51df,{'title':_0x2b395f['title'],'items':_0xbdb6fa}));}this['sectionsView']['sections']=_0x3574af,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x3574af),this['hasItems']=_0x14209f['some'](_0x44683b=>_0x44683b['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x374360){for(const _0x9e12df of this['sectionsView']['sections']){const _0x166bab=_0x9e12df['getItem'](_0x374360);if(_0x166bab){if(_0x9e12df['removeItem'](_0x166bab),0x0===_0x9e12df['itemsViews']['length']){const _0x3b2f65=this['sectionsView']['sections']['indexOf'](_0x9e12df);-0x1!==_0x3b2f65&&(this['sectionsView']['sections']['splice'](_0x3b2f65,0x1),this['sectionsView']['items']['remove'](_0x9e12df));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x28fcc1,_0x1debea){for(const _0x447f99 of this['sectionsView']['sections']){const _0x572649=_0x447f99['getItem'](_0x28fcc1);if(_0x572649){_0x572649['updateTitle'](_0x1debea);break;}}}['updateItemLoadingState'](_0x447428,_0x297b46,_0x29f8ff){for(const _0xb6b93b of this['sectionsView']['sections']){const _0x14bf04=_0xb6b93b['getItem'](_0x447428);if(_0x14bf04){_0x14bf04['updateLoadingState'](_0x297b46,_0x29f8ff);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x3fe1ee=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x3fe1ee);}}}const xi=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class it extends _0x316379{static get['requires'](){return[et];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x28a711){super(_0x28a711);const _0x169b7e=this['context']['plugins']['get']('AITabs');this['_historyView']=new at(this['context']['locale'],_0x169b7e['showResizeButton']),this['_historyView']['delegate'](...xi)['to'](this),_0x169b7e['view']['addTab']({'id':'history','buttonLabel':Yn(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':ot,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x33171a){this['_historyView']['removeHistoryItem'](_0x33171a);}['updateItems'](_0x332903){this['_historyView']['updateHistoryItemsWithCategories'](_0x332903);}['updateItemTitle'](_0x433e1d,_0x369247){this['_historyView']['updateItemTitle'](_0x433e1d,_0x369247);}['updateItemLoadingState'](_0x4d5425,_0x599228,_0x20c7b4){this['_historyView']['updateItemLoadingState'](_0x4d5425,_0x599228,_0x20c7b4);}['setLoadingSkeleton'](_0x32ab3a){this['_historyView']['isLoading']=_0x32ab3a;}['showError'](_0x205725){this['_historyView']['errorMessage']=_0x205725;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x38e3ef){this['_historyView']['isMaximized']=_0x38e3ef;}}class pe extends _0x757adc(){['id'];['createdAt'];constructor({id:_0x2ac23a,title:_0x5ac48e,createdAt:_0x4f0402,updatedAt:_0x59e36d,pinned:_0x4a3c34}){super(),this['id']=_0x2ac23a,this['createdAt']=new Date(_0x4f0402),this['set']('title',_0x5ac48e),this['set']('updatedAt',_0x59e36d?new Date(_0x59e36d):null),this['set']('pinned',_0x4a3c34||!0x1);}['updateTitle'](_0x1e9ef0){this['set']('title',_0x1e9ef0),this['updatedAt']=new Date();}['updatePinned'](_0x30f07b){this['set']('pinned',_0x30f07b),this['updatedAt']=new Date();}}class ht extends _0x2f6768(){['items']=[];['connector'];['group'];constructor({connector:_0x1abe4c,group:_0x1ab0b1}){super(),this['connector']=_0x1abe4c,this['group']=_0x1ab0b1;}async['init'](){try{const _0x348d62=this['connector']['fetchConversations'](this['group']),_0x2f21b4=await _0x348d62['getConversations']();this['loadItems'](_0x2f21b4);}catch(_0x109f94){this['fire']('error',{'error':_0x109f94,'operation':'init'});}}['addItem'](_0x3f1c2a){this['items']['push'](_0x3f1c2a);}async['removeItem'](_0x31b530){const _0x16a05a=this['items']['findIndex'](_0x1254ce=>_0x1254ce['id']===_0x31b530);if(-0x1===_0x16a05a)return!0x1;try{return await this['connector']['deleteConversation'](_0x31b530)['execute'](),this['items']['splice'](_0x16a05a,0x1),this['fire']('itemRemoved',{'itemId':_0x31b530}),!0x0;}catch(_0x1f2b11){return this['fire']('error',{'error':_0x1f2b11,'operation':'removeItem','itemId':_0x31b530}),!0x1;}}['getItem'](_0x4b7304){return this['items']['find'](_0x348a6d=>_0x348a6d['id']===_0x4b7304);}async['updateItemTitle'](_0x7a19cd,_0x43e6f0){const _0x3fe812=this['getItem'](_0x7a19cd);if(!_0x3fe812)return!0x1;try{return await this['connector']['updateConversation'](_0x7a19cd,{'title':_0x43e6f0})['getResult'](),_0x3fe812['updateTitle'](_0x43e6f0),this['fire']('itemUpdated',{'itemId':_0x7a19cd,'updates':{'title':_0x43e6f0}}),!0x0;}catch(_0x5727ef){return this['fire']('error',{'error':_0x5727ef,'operation':'updateItemTitle','itemId':_0x7a19cd}),!0x1;}}async['updateItemPinned'](_0x5fb90f,_0x496ee5){const _0xb30a80=this['getItem'](_0x5fb90f);if(!_0xb30a80)return!0x1;try{return await this['connector']['updateConversation'](_0x5fb90f,{'pinned':_0x496ee5})['getResult'](),_0xb30a80['updatePinned'](_0x496ee5),this['fire']('itemUpdated',{'itemId':_0x5fb90f,'updates':{'pinned':_0x496ee5}}),!0x0;}catch(_0x3d7a33){return this['fire']('error',{'error':_0x3d7a33,'operation':'updateItemPinned','itemId':_0x5fb90f}),!0x1;}}['loadItems'](_0x219159){try{this['items']=[],_0x219159['map'](_0x1e31f0=>{this['addItem'](new pe(_0x1e31f0));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x25a625){this['fire']('error',{'error':_0x25a625,'operation':'loadItems'});}}['getItems'](_0x45052c={}){const _0x318a15=void 0x0!==_0x45052c['pinned']&&_0x45052c['pinned'],_0x455f99=_0x45052c['from']?new Date(_0x45052c['from']['getFullYear'](),_0x45052c['from']['getMonth'](),_0x45052c['from']['getDate']()):null,_0x420cd6=_0x45052c['to']?new Date(_0x45052c['to']['getFullYear'](),_0x45052c['to']['getMonth'](),_0x45052c['to']['getDate']()):null;return this['items']['filter'](_0x386da8=>{if(_0x386da8['pinned']!==_0x318a15)return!0x1;if(_0x420cd6){const _0x5b4887=new Date(_0x386da8['createdAt']['getFullYear'](),_0x386da8['createdAt']['getMonth'](),_0x386da8['createdAt']['getDate']());return _0x455f99?_0x455f99['getTime']()===_0x420cd6['getTime']()?_0x5b4887['getTime']()===_0x455f99['getTime']():_0x5b4887<_0x420cd6&&_0x5b4887>=_0x455f99:_0x5b4887<_0x420cd6;}return!0x0;});}}class rt extends _0x316379{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[o,st,it,et];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](o),this['_aiChatHistoryUi']=this['context']['plugins']['get'](it),this['_aiChatController']=this['context']['plugins']['get'](st);const _0x58428a=this['context']['plugins']['get'](et),_0x3916ad=this['_aiChatController']['getGroupId']();this['history']=new ht({'connector':this['_aiConnector'],'group':_0x3916ad}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x4b8b45,_0x11a2a2)=>{this['_setItemLoading'](_0x11a2a2['id'],'remove'),this['_handleRemove'](_0x11a2a2['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x38af72,_0x4e5307)=>{this['_setItemLoading'](_0x4e5307['id'],'rename'),this['_handleEditTitle'](_0x4e5307['id'],_0x4e5307['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x5bd7a7,_0x8e837d)=>{void 0x0!==_0x8e837d['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x8e837d['itemId'],_0x8e837d['updates']['title']),void 0x0!==_0x8e837d['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x8e837d['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x4f5987,_0x58e570)=>{this['_aiChatController']['handleRemovedConversation'](_0x58e570['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x58e570['itemId']),this['_clearItemLoading'](_0x58e570['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x46e8b3,_0x13fe1f)=>{this['_handleHistoryErrorUI'](_0x13fe1f['error'],_0x13fe1f['operation'],_0x13fe1f['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x44a344,_0x588617)=>{this['_handleSelectConversation'](_0x588617['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x23c792,_0x37f6b9)=>{const _0xb3bac1=_0x37f6b9['pinned']?'pin':'unpin';this['_setItemLoading'](_0x37f6b9['id'],_0xb3bac1),this['_handleTogglePin'](_0x37f6b9['id'],_0x37f6b9['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x58428a['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x58428a['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x58428a,'resizedTabs',(_0x561239,_0x43aa77)=>{this['_setIsMaximized'](_0x43aa77);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x58428a['resize']();});}async['_handleEditTitle'](_0x306d6a,_0x14ff8e){await this['history']['updateItemTitle'](_0x306d6a,_0x14ff8e);}async['_handleTogglePin'](_0x243fef,_0x2c0bb4){await this['history']['updateItemPinned'](_0x243fef,_0x2c0bb4);}async['_handleRemove'](_0x3e61fa){await this['history']['removeItem'](_0x3e61fa);}async['_handleSelectConversation'](_0xaab1fa){await this['_aiChatController']['loadConversation'](_0xaab1fa);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x35ff6e=this['_aiChatController']['activeConversation']?.['id'],_0x46bb92=this['_getCategorizedItems']()['map'](_0x336cc1=>({'title':_0x336cc1['title'],'items':_0x336cc1['items']['map'](_0x16bdd3=>({'id':_0x16bdd3['id'],'title':_0x16bdd3['title']||Yn(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x16bdd3['createdAt'])['toLocaleDateString'](),'active':_0x16bdd3['id']===_0x35ff6e,'pinned':_0x16bdd3['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x46bb92);}['_setItemLoading'](_0x270484,_0x54a75e){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x270484,_0x54a75e,!0x0);}['_clearItemLoading'](_0x1ea1b4){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x1ea1b4,null,!0x1);}['_handleHistoryErrorUI'](_0x12b8dd,_0x5d6db3,_0x36b1ff){const _0x1f47b3=this['_generateErrorMessage'](_0x5d6db3,_0x36b1ff);this['_aiChatHistoryUi']['showError'](_0x1f47b3),_0x36b1ff&&this['_clearItemLoading'](_0x36b1ff),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x386efe,_0x43b1d4){const _0x181d20=_0x43b1d4?this['history']['getItem'](_0x43b1d4):null,_0x316634=_0x181d20?.['title']||Yn(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x386efe){case'updateItemTitle':return Yn(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x316634);case'updateItemPinned':{const _0x2e28af=Yn(this['context']['locale'],_0x181d20?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return Yn(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x2e28af,_0x316634]);}case'removeItem':return Yn(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x316634);case'init':case'loadItems':return Yn(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return Yn(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x13376f=new Date(),_0x4a5cbb=new Date(_0x13376f['getFullYear'](),_0x13376f['getMonth'](),_0x13376f['getDate']()),_0x17f7d5=new Date(_0x4a5cbb);_0x17f7d5['setDate'](_0x17f7d5['getDate']()-0x1);const _0x1f252f=new Date(_0x4a5cbb);_0x1f252f['setDate'](_0x1f252f['getDate']()-0xe);const _0x537fed=this['history']['getItems']({'pinned':!0x0}),_0x1d35aa=this['history']['getItems']({'from':_0x4a5cbb,'to':_0x4a5cbb}),_0x118d46=this['history']['getItems']({'from':_0x17f7d5,'to':_0x17f7d5}),_0x1114ed=this['history']['getItems']({'from':_0x1f252f,'to':_0x17f7d5}),_0xbab3b2=this['history']['getItems']({'to':_0x1f252f}),_0x5e67e4=[];return _0x537fed['length']>0x0&&_0x5e67e4['push']({'title':Yn(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x537fed}),_0x1d35aa['length']>0x0&&_0x5e67e4['push']({'title':Yn(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x1d35aa}),_0x118d46['length']>0x0&&_0x5e67e4['push']({'title':Yn(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x118d46}),_0x1114ed['length']>0x0&&_0x5e67e4['push']({'title':Yn(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x1114ed}),_0xbab3b2['length']>0x0&&_0x5e67e4['push']({'title':Yn(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0xbab3b2}),_0x5e67e4;}['_setIsMaximized'](_0x1c072e){this['_aiChatHistoryUi']['setIsMaximized'](_0x1c072e);}}class nt extends _0x316379{static get['requires'](){return[rt,it];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Aa extends _0x316379{static get['requires'](){return[st,a,ct,nt];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xed787b){super(_0xed787b);const _0x1e1e3d=_0xed787b['config'];_0x1e1e3d['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),_0x1e1e3d['define']('ai.chat.models',{'defaultModelId':void 0x0,'modelSelectorAlwaysVisible':!0x0,'displayedModels':void 0x0});}async['addSelectionToChatContext'](){await this['context']['plugins']['get'](st)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](st)['startConversation']();}async['sendMessage']({message:_0x48e840,quickActionData:_0x421970}){await this['context']['plugins']['get'](st)['sendMessage']({'message':_0x48e840,'quickActionData':_0x421970});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](st)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](st)['focusPromptInput']();}}function ma(_0x1aa037,_0x2743f3,_0x5755f4){const t=_0x1aa037['t'];switch(_0x2743f3){case'AI_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});case'AI_QUICK_ACTIONS_ASK_AI':return t({'id':'AI_QUICK_ACTIONS_ASK_AI','string':'Ask\x20AI'});case'AI_QUICK_ACTIONS_CHAT_COMMANDS':return t({'id':'AI_QUICK_ACTIONS_CHAT_COMMANDS','string':'Chat\x20commands'});case'AI_QUICK_ACTIONS_IMPROVE_WRITING':return t({'id':'AI_QUICK_ACTIONS_IMPROVE_WRITING','string':'Improve\x20writing'});case'AI_QUICK_ACTIONS_CONTINUE_WRITING':return t({'id':'AI_QUICK_ACTIONS_CONTINUE_WRITING','string':'Continue\x20writing'});case'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING':return t({'id':'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING','string':'Fix\x20grammar\x20&\x20spelling'});case'AI_QUICK_ACTIONS_ADJUST_LENGTH':return t({'id':'AI_QUICK_ACTIONS_ADJUST_LENGTH','string':'Adjust\x20length'});case'AI_QUICK_ACTIONS_CHANGE_TONE':return t({'id':'AI_QUICK_ACTIONS_CHANGE_TONE','string':'Change\x20tone'});case'AI_QUICK_ACTIONS_TRANSLATE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE','string':'Translate'});case'AI_QUICK_ACTIONS_EXPLAIN':return t({'id':'AI_QUICK_ACTIONS_EXPLAIN','string':'Explain'});case'AI_QUICK_ACTIONS_SUMMARIZE':return t({'id':'AI_QUICK_ACTIONS_SUMMARIZE','string':'Summarize'});case'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS':return t({'id':'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS','string':'Highlight\x20key\x20points'});case'AI_QUICK_ACTIONS_MAKE_SHORTER':return t({'id':'AI_QUICK_ACTIONS_MAKE_SHORTER','string':'Make\x20shorter'});case'AI_QUICK_ACTIONS_MAKE_LONGER':return t({'id':'AI_QUICK_ACTIONS_MAKE_LONGER','string':'Make\x20longer'});case'AI_QUICK_ACTIONS_MORE_CASUAL':return t({'id':'AI_QUICK_ACTIONS_MORE_CASUAL','string':'More\x20casual'});case'AI_QUICK_ACTIONS_MORE_DIRECT':return t({'id':'AI_QUICK_ACTIONS_MORE_DIRECT','string':'More\x20direct'});case'AI_QUICK_ACTIONS_MORE_FRIENDLY':return t({'id':'AI_QUICK_ACTIONS_MORE_FRIENDLY','string':'More\x20friendly'});case'AI_QUICK_ACTIONS_MORE_CONFIDENT':return t({'id':'AI_QUICK_ACTIONS_MORE_CONFIDENT','string':'More\x20confident'});case'AI_QUICK_ACTIONS_MORE_PROFESSIONAL':return t({'id':'AI_QUICK_ACTIONS_MORE_PROFESSIONAL','string':'More\x20professional'});case'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT':return t({'id':'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT','string':'Adjust\x20based\x20on\x20the\x20rest\x20of\x20the\x20document'});case'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH','string':'English'});case'AI_QUICK_ACTIONS_TRANSLATE_CHINESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_QUICK_ACTIONS_TRANSLATE_FRENCH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_FRENCH','string':'French'});case'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE','string':'Japanese'});case'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE','string':'Portuguese'});case'AI_QUICK_ACTIONS_TRANSLATE_KOREAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_KOREAN','string':'Korean'});case'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN','string':'Italian'});case'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN','string':'Russian'});case'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','string':'%0\x20plugin\x20is\x20required\x20but\x20not\x20found.'},_0x5755f4);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});default:return _0x2743f3;}}function Gt(_0x176a93,_0x2ba3bd,_0x4f5710=!0x1,_0x3a7060=!0x0){return()=>{const _0x627c98=_0x176a93['locale'],_0x47932c=new _0x155a80(_0x627c98),_0x17a653=_0x47932c['bindTemplate'];_0x47932c['extendTemplate']({'on':{'mouseenter':_0x17a653['to'](()=>{_0x47932c['focus']();})}});const _0x262ad4=_0x2ba3bd['icon']??_0x2ba3bd['parent']?.['icon'];return _0x47932c['set']({'label':_0x2ba3bd['displayedPrompt'],'withText':_0x4f5710,'role':'menuitem','icon':_0x3a7060?_0x262ad4??_0x35a1a1:void 0x0,'tooltip':!_0x4f5710}),_0x47932c['on']('execute',()=>{_0x176a93['editing']['view']['focus'](),_0x176a93['commands']['execute']('aiQuickAction',_0x2ba3bd);}),_0x47932c;};}const gs='menu',As='menuitem';class io extends _0x7ecbb5{['_bodyCollection'];['optionsListView'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();constructor(_0x24d9b6,_0x45dce7,_0x2fb7cf,_0x26e0d2){const _0x41de09=_0x24d9b6['locale'];super(_0x41de09),this['_bodyCollection']=_0x26e0d2;const _0x14a82f=this['_createListItems'](_0x24d9b6,_0x45dce7,_0x2fb7cf);this['optionsListView']=new _0x5c4336(_0x41de09),this['optionsListView']['role']=gs,this['optionsListView']['items']['addMany'](_0x14a82f),this['focusTracker']=new _0x30a616(),this['keystrokes']=new _0xf37da3(),this['_focusables']=_0x14a82f,this['focusCycler']=new _0x5883a2({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x41de09['uiLanguageDirection']},'children':[this['optionsListView']]});}['_createListItems'](_0x4207f1,_0xe7b1e0,_0x321e56){const _0x57b106=new _0xa841d5();return _0xe7b1e0['forEach'](_0x470c26=>{'actions'in _0x470c26?_0x57b106['add'](this['_createActionGroupButton'](_0x4207f1,_0x470c26,_0x321e56)):_0x57b106['add'](this['_createActionButton'](_0x4207f1,_0x470c26));}),_0x57b106;}['_createActionButton'](_0x2a367d,_0x5dbc75){const _0x3c5a6a=new _0x7baab6(this['locale']),_0x2e626b=Gt(_0x2a367d,_0x5dbc75,!0x0)();return _0x3c5a6a['children']['add'](_0x2e626b),_0x3c5a6a;}['_createActionGroupButton'](_0x250f48,_0xd4453a,_0x8a5451){const _0x1585a4=new _0x7baab6(this['locale']),_0x38f4e2=new _0x2b0b4e(this['locale']),_0x2fb43d=_0x38f4e2['bindTemplate'],_0xa16a='rtl'===_0x8a5451['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft',_0xad63b4=this['_createGroupActionsList'](_0x250f48,_0xd4453a['actions'],_0x8a5451);_0x38f4e2['set']({'label':_0xd4453a['label'],'withText':!0x0,'role':As,'icon':_0xd4453a['icon']??_0x35a1a1}),_0x38f4e2['extendTemplate']({'on':{'mouseenter':_0x2fb43d['to'](()=>{_0x38f4e2['focus']();})}});const _0x9f4cc0=new _0x271ec1(this['locale']);return _0x9f4cc0['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x2fb43d['to'](_0x11d8e1=>{_0x11d8e1['key']==_0xa16a&&(_0x38f4e2['focus'](),this['_hideNestedPanel'](_0x9f4cc0));})}}),_0x38f4e2['bind']('isOn')['to'](_0x9f4cc0,'isVisible'),this['_bodyCollection']['add'](_0x9f4cc0),_0x9f4cc0['content']['add'](_0xad63b4),this['_setupGroupMenuBehavior'](_0x38f4e2,_0x9f4cc0),_0x1585a4['children']['add'](_0x38f4e2),_0x1585a4;}['_createGroupActionsList'](_0x5c4231,_0x4b3c5f,_0x26d9d2){const _0x54c154=new _0x5c4336(this['locale']);return _0x54c154['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x4b3c5f['forEach'](_0x3a4c28=>{const _0x3599cb=new _0x7baab6(this['locale']),_0x5e637b=Gt(_0x5c4231,_0x3a4c28,!0x0,!0x1)();_0x3599cb['children']['add'](_0x5e637b),_0x26d9d2['focusTracker']['add'](_0x5e637b),_0x54c154['items']['add'](_0x3599cb);}),_0x54c154;}['_setupGroupMenuBehavior'](_0x4234b4,_0x3c5120){const _0x48c6f6=_0x4234b4['bindTemplate'],_0x59a9fa='rtl'===_0x4234b4['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';_0x4234b4['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x48c6f6['to'](()=>{this['_showNestedPanel'](_0x3c5120,_0x4234b4);}),'mouseleave':_0x48c6f6['to'](_0x1222b0=>{const _0x384d89=_0x1222b0['relatedTarget'];this['_isMovingToNestedMenu'](_0x384d89,_0x3c5120)||this['_hideNestedPanel'](_0x3c5120);}),'keydown':_0x48c6f6['to'](_0x4d7c3e=>{_0x4d7c3e['key']==_0x59a9fa&&(this['_showNestedPanel'](_0x3c5120,_0x4234b4),_0x3c5120['content']['get'](0x0)['focus']());})}}),_0x3c5120['on']('render',()=>{_0x3c5120['element']?.['addEventListener']('mouseleave',_0xd5f9fe=>{const _0x5a8cd3=_0xd5f9fe['relatedTarget'];_0x4234b4['element']?.['contains'](_0x5a8cd3)||this['_isMovingToNestedMenu'](_0x5a8cd3,_0x3c5120)||this['_hideNestedPanel'](_0x3c5120);});});}['_showNestedPanel'](_0x42d320,_0x311b07){this['_openNestedPanels']['forEach'](_0x1ed508=>{_0x1ed508!==_0x42d320&&_0x1ed508['isVisible']&&_0x1ed508['hide']();}),_0x42d320['show'](),_0x42d320['pin']({'positions':[_0x1508da['eastSouth']],'target':_0x311b07['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x42d320);}['_hideNestedPanel'](_0x39e576){_0x39e576['hide'](),this['_openNestedPanels']['delete'](_0x39e576);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0xf805e1=>_0xf805e1['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0xd00ac3,_0x27634b){if(!_0xd00ac3)return!0x1;if(_0x27634b['element']?.['contains'](_0xd00ac3))return!0x0;const _0x5ee15c=_0xd00ac3;return _0x5ee15c['closest']&&(null!==_0x5ee15c['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x5ee15c['closest']('.ck-ai-quick-actions-group-list')||null!==_0x5ee15c['closest']('.ck-ai-quick-actions-group-button'));}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['optionsListView']['focus']();}}function qt(_0x3d3ac1,_0x9e2491,_0xb084a4,_0xc431c6){return()=>{const _0x44b624=_0x3d3ac1['locale'],_0x3e0863=_0x30b0b5(_0x44b624);_0x3e0863['buttonView']['set']({'icon':_0xb084a4['icon']??_0x35a1a1,'label':_0xb084a4['label'],'tooltip':!0x0}),_0x3e0863['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x5bed80=new io(_0x3d3ac1,_0x9e2491,_0x3e0863,_0xc431c6);return _0x3e0863['panelView']['children']['add'](_0x5bed80),_0x3e0863;};}const zt='<task>For\x20given\x20selected\x20part\x20of\x20HTML\x20document\x20you\x20must\x20explain\x20the\x20meaning\x20of\x20it\x27s\x20content\x20clearly\x20and\x20in\x20plain\x20language.</task><rules>1.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is:-\x20If\x20it\x20looks\x20like\x20a\x20definition\x20explain\x20the\x20concept\x20in\x20simple\x20terms.-\x20If\x20it\x20looks\x20like\x20a\x20description\x20clarify\x20what\x20it\x20is\x20describing\x20and\x20why\x20it\x20matters.-\x20If\x20it\x20contains\x20technical\x20terms\x20or\x20jargon\x20break\x20them\x20down\x20into\x20everyday\x20language.-\x20If\x20it\x20looks\x20instructional\x20restate\x20as\x20clear\x20steps\x20someone\x20can\x20follow.-\x20If\x20it\x20provides\x20examples\x20explain\x20what\x20the\x20example\x20shows\x20and\x20why\x20it\x27s\x20relevant.-\x20If\x20it\x20presents\x20an\x20argument\x20or\x20claim\x20restate\x20the\x20claim\x20neutrally\x20and\x20explain\x20its\x20purpose.-\x20If\x20it\x20is\x20narrative/story-like\x20explain\x20what\x20event\x20or\x20situation\x20is\x20being\x20described.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20explain\x20what\x20the\x20data\x20indicates.-\x20If\x20it\x20is\x20a\x20quotation\x20explain\x20the\x20meaning\x20of\x20the\x20quote\x20in\x20context.-\x20If\x20it\x20compares/contrasts\x20things\x20explain\x20the\x20key\x20differences\x20or\x20similarities\x20simply.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20give\x20a\x20clear,\x20plain-language\x20explanation\x20of\x20its\x20meaning,\x20focusing\x20on\x20usefulness.2.\x20Provide\x20context\x20if\x20the\x20meaning\x20could\x20be\x20unclear\x20without\x20it.\x20(e.g.,\x20explain\x20where\x20such\x20a\x20term\x20might\x20be\x20used,\x20or\x20why\x20it\x20is\x20important).3.\x20Keep\x20the\x20explanation\x20short\x20but\x20complete\x20(2–5\x20sentences).Avoid\x20overly\x20technical\x20detail\x20unless\x20it\x20is\x20necessary\x20for\x20understanding.4.\x20Do\x20not\x20simply\x20repeat\x20the\x20original\x20text\x20—\x20restate\x20and\x20expand\x20it\x20in\x20plain\x20words.5.\x20If\x20possible,\x20add\x20a\x20short\x20example\x20or\x20analogy\x20to\x20make\x20it\x20easier\x20to\x20understand.6.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20explanation.7.\x20Your\x20explanation\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20explanation.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',Wt='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20summarize\x20its\x20content\x20in\x20a\x20few\x20sentences,\x20keeping\x20only\x20the\x20essential\x20meaning.</task><rules>1.\x20Your\x20summary\x20should\x20be\x20short\x20and\x20clear:-\x20Aim\x20for\x202–4\x20sentences\x20unless\x20the\x20text\x20is\x20extremely\x20short.-\x20Focus\x20on\x20capturing\x20the\x20main\x20idea(s)\x20without\x20unnecessary\x20detail.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20summary\x20style:-\x20If\x20it\x20is\x20descriptive\x20condense\x20the\x20description\x20into\x20its\x20core\x20idea.-\x20If\x20it\x20is\x20argumentative\x20or\x20opinion-based\x20summarize\x20the\x20main\x20claim\x20and\x20reasoning\x20neutrally.-\x20If\x20it\x20is\x20narrative/story-like\x20capture\x20the\x20main\x20event\x20or\x20outcome\x20without\x20side\x20details.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20summarize\x20what\x20the\x20data\x20shows\x20in\x20plain\x20language.-\x20If\x20it\x20is\x20instructional\x20restate\x20the\x20overall\x20purpose\x20of\x20the\x20steps\x20without\x20listing\x20every\x20step.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20provide\x20a\x20general\x20concise\x20summary.3.\x20Provide\x20context\x20if\x20necessary\x20for\x20clarity:-\x20Mention\x20the\x20subject\x20or\x20topic\x20explicitly\x20so\x20the\x20summary\x20can\x20stand\x20alone.4.\x20Do\x20not\x20simply\x20copy\x20sentences\x20from\x20the\x20original\x20text\x20—\x20rephrase\x20in\x20plain\x20language.5.\x20Avoid\x20adding\x20new\x20information\x20or\x20interpretation\x20not\x20present\x20in\x20the\x20text.6.\x20Summarize\x20in\x20a\x20way\x20that\x20would\x20make\x20sense\x20to\x20someone\x20who\x20has\x20not\x20read\x20the\x20original\x20text.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20summary.8.\x20Your\x20summary\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20summary.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',Jt='<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 oi=function(_0xaa5034){return _0xaa5034['CHAT']='CHAT',_0xaa5034['ACTION']='ACTION',_0xaa5034['REVIEW']='REVIEW',_0xaa5034;}({}),pa=function(_0x927d4a){return _0x927d4a['CHAT']='AIChat',_0x927d4a['ACTION']='AIActions',_0x927d4a['REVIEW']='AIReviewMode',_0x927d4a;}({});class ii extends _0x24c1a8{static get['requires'](){return[Ft];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_prepareQuickActionsDefinition'](this['_getDefaultAndCustomActions']()),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x2c8f7c){return function(_0x535839){const _0x2819f0=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x535839['uiLanguage']),_0x39a509=_0x2819f0||'English',_0x3d2a1a=[{'id':'ask-ai','displayedPrompt':ma(_0x535839,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Qt},{'id':'chat-commands','label':ma(_0x535839,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Ut,'actions':[{'id':'explain','displayedPrompt':ma(_0x535839,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':zt['replace']('%0',_0x39a509),'type':'CHAT'},{'id':'summarize','displayedPrompt':ma(_0x535839,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Wt['replace']('%0',_0x39a509),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':ma(_0x535839,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Jt['replace']('%0',_0x39a509),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':ma(_0x535839,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Lt},{'id':'continue-writing','displayedPrompt':ma(_0x535839,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Kt},{'id':'fix-grammar-and-spelling','displayedPrompt':ma(_0x535839,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Mt},{'id':'adjust-length','label':ma(_0x535839,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Nt,'actions':[{'id':'make-shorter','displayedPrompt':ma(_0x535839,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':ma(_0x535839,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':ma(_0x535839,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Ot,'actions':[{'id':'make-tone-casual','displayedPrompt':ma(_0x535839,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':ma(_0x535839,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':ma(_0x535839,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':ma(_0x535839,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':ma(_0x535839,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':ma(_0x535839,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Yt,'actions':[{'id':'translate-to-english','displayedPrompt':ma(_0x535839,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':ma(_0x535839,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-french','displayedPrompt':ma(_0x535839,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':ma(_0x535839,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':ma(_0x535839,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':ma(_0x535839,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':ma(_0x535839,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':ma(_0x535839,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':ma(_0x535839,'AI_QUICK_ACTIONS_OTHER'),'icon':Dt,'actions':[]}];return _0x3d2a1a;}(_0x2c8f7c);}['_getDefaultAndCustomActions'](){const _0x5515ac=ii['getDefaultQuickActions'](this['editor']['locale']),_0x372845=(this['editor']['config']['get']('ai.quickActions.extraCommands')||[])['map'](_0x1b20db=>({..._0x1b20db,'icon':void 0x0}));return _0x5515ac['find'](_0x14bcdc=>'other'===_0x14bcdc['id'])['actions']['push'](..._0x372845),_0x5515ac;}['_initializeQuickActionsComponentsAndCommands'](){const _0x476579=new jt(this['editor']['locale']);_0x476579['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x476579),this['_initializeQuickActionsComponents'](_0x476579);}['_initializeQuickActionsDropdown'](_0x3e46ca){this['editor']['ui']['componentFactory']['add']('aiQuickActions',qt(this['editor'],this['_quickActionsDefinition'],{'icon':_0x35a1a1,'label':ma(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},_0x3e46ca));}['_prepareQuickActionsDefinition'](_0x35f8ee){this['_quickActionsDefinition']=_0x35f8ee['map'](_0x1336fd=>{if('actions'in _0x1336fd){const _0x135c5b=_0x1336fd;return{..._0x135c5b,'actions':_0x135c5b['actions']['map'](_0x38fa2b=>{const {actions:_0x37e1d8,..._0x22274d}=_0x135c5b;return{..._0x38fa2b,'parent':_0x22274d};})['filter'](_0xa3aa5b=>this['_shouldIncludeAction'](_0xa3aa5b))};}return _0x1336fd;})['filter'](_0x1dabe1=>'actions'in _0x1dabe1?_0x1dabe1['actions']['length']>0x0:this['_shouldIncludeAction'](_0x1dabe1));}['_shouldIncludeAction'](_0x5adcca){const _0x583de4=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](pa[_0x5adcca['type']])&&!_0x583de4['includes'](_0x5adcca['id']);}['_initializeQuickActionsComponents'](_0x5c22ed){this['_quickActionsDefinition']['forEach'](_0x3cb7c3=>{if('actions'in _0x3cb7c3){const _0x2da9d6=qt(this['editor'],_0x3cb7c3['actions'],_0x3cb7c3,_0x5c22ed);this['editor']['ui']['componentFactory']['add'](_0x3cb7c3['id'],_0x2da9d6),_0x3cb7c3['actions']['forEach'](_0x20d3eb=>{const _0x114d62=Gt(this['editor'],_0x20d3eb);this['editor']['ui']['componentFactory']['add'](_0x20d3eb['id'],_0x114d62);});}else{const _0x3eb7f3=Gt(this['editor'],_0x3cb7c3);this['editor']['ui']['componentFactory']['add'](_0x3cb7c3['id'],_0x3eb7f3);}});}}class ci extends _0x417d51{['execute'](_0x5278ef){switch(_0x5278ef['type']){case oi['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0xdc47a6=ma(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x4a8035('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0xdc47a6});}this['_handleAIChatAction'](_0x5278ef);break;case oi['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x1eaec2=ma(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x4a8035('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x1eaec2});}this['_handleAIActionsAction'](_0x5278ef);break;case oi['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x4c17ed=ma(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x4a8035('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x4c17ed});}this['_handleAIReviewAction'](_0x5278ef);}}async['_handleAIChatAction'](_0x508b8e){const _0x2f4322=this['editor']['plugins']['get']('AIChat');if('ask-ai'===_0x508b8e['id'])this['_expandSelectionIfCollapsed'](),await _0x2f4322['addSelectionToChatContext'](),_0x2f4322['focusPromptInput']();else await _0x2f4322['startConversation'](),await _0x2f4322['addSelectionToChatContext'](),await _0x2f4322['sendMessage']({'message':_0x508b8e['prompt']||_0x508b8e['displayedPrompt'],'quickActionData':{'id':_0x508b8e['id'],'displayedPrompt':_0x508b8e['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x225c16=this['editor'],_0x395445=_0x225c16['model']['document']['selection'];if(!_0x395445['isCollapsed'])return;const _0x43c80e=_0x3d8d09(_0x395445['getSelectedBlocks']())||_0x225c16['model']['schema']['getLimitElement'](_0x395445);_0x225c16['model']['change'](_0x466598=>{_0x466598['setSelection'](_0x43c80e,'in');});}async['_handleAIActionsAction'](_0x3f5c4a){const _0xd1a670=this['editor']['plugins']['get']('AIActions'),_0x689f95=_0x3f5c4a['prompt']?{'userMessage':_0x3f5c4a['prompt'],'model':_0x3f5c4a['model']}:{'actionName':_0x3f5c4a['actionName']||_0x3f5c4a['id'],'args':_0x3f5c4a['args']};await _0xd1a670['executeAction'](_0x689f95,_0x3f5c4a['displayedPrompt'],_0x3f5c4a['icon']);}async['_handleAIReviewAction'](_0x15b7a6){console['log']('handleAIReviewAction',_0x15b7a6);}}class ti extends _0x24c1a8{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x5dd8c5=this['editor'],_0x27ec6e=new ci(this['editor']);if(_0x5dd8c5['commands']['add']('aiQuickAction',_0x27ec6e),_0x5dd8c5['plugins']['has']('AIChat')){const _0x1285c8=this['editor']['plugins']['get']('AIChat');_0x5dd8c5['model']['document']['selection']['on']('change:range',(_0x2f2dc7,_0x3086db)=>{_0x3086db['directChange']&&_0x1285c8['removeSelectionFromChatContext']();});}}}class Ta extends _0x24c1a8{static get['requires'](){return[ii,ti];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x7001a6){super(_0x7001a6),_0x7001a6['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[]});}}class he extends pi{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),this['parsedContent']['children']['length']>0x0){const _0x239558=[];for(const _0x5d888e of this['parsedContent']['children'])if(_0xc13be1(_0x5d888e)){const _0x5c0851=Tt(_0x5d888e,'data-id');_0x5c0851&&_0x239558['push']({'node':_0x5d888e,'type':'modified','id':_0x5c0851});}_0x239558['length']>0x0?this['changeGroups']=[{'changes':_0x239558,'state':'pending','index':0x0}]:this['changeGroups']=[{'changes':[{'node':this['parsedContent']['children'][0x0],'type':'modified','id':'ai-actions-content'}],'state':'pending','index':0x0}];}else this['changeGroups']=[];}}class c extends oe{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];constructor(_0x51de6f){super(_0x51de6f),this['content']=_0x51de6f['content'],this['version']=_0x51de6f['version'],this['actionName']=_0x51de6f['actionName'],this['args']=_0x51de6f['args'],this['userMessage']=_0x51de6f['userMessage'],this['model']=_0x51de6f['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':ce['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0xc9ac50){const _0x2f996b=new he({'editor':this['editor'],'documentContextContent':this['content'],..._0xc9ac50});return this['replies']['push'](_0x2f996b),_0x2f996b['delegate'](...ne)['to'](this),this['fire']('replyCreated',_0x2f996b),_0x2f996b;}}class wa extends _0x24c1a8{static get['requires'](){return[o,_0x12fc7f,a,m,_0x2423ad];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_previousInteractions']=[];['_currentInteractionParams'];['_balloonShowDiff']=!0x1;['_customViews']=new _0xa841d5();['_promiseQueue'];constructor(_0xa53c7e){super(_0xa53c7e),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new g(),this['_setupCustomViews']();}['stopInteraction'](){this['_stopInteraction']();}get['previousInteractions'](){return this['_previousInteractions'];}async['executeAction'](_0x5493d6,_0x1244ae,_0x25a629){if(this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']())return this['_executeActionOnTable'](_0x5493d6,_0x1244ae,_0x25a629);}return this['_executeActionRegular'](_0x5493d6,_0x1244ae,_0x25a629);}['_executeActionRegular'](_0x52d98b,_0x350b4d,_0x599dde){const _0x59992a=this['editor']['plugins']['get'](a),_0x221737=this['editor']['plugins']['get'](m),_0x21b87b=this['editor']['model']['document']['selection'];if(_0x21b87b['isCollapsed']){const _0x5f405b=_0x3d8d09(_0x21b87b['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x21b87b);this['editor']['model']['change'](_0x2fd829=>{_0x2fd829['setSelection'](_0x5f405b,'in');});}const _0x51bd64=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x21b87b),_0x21b87b),_0x408592=_0x59992a['modelToViewWithIds'](_0x51bd64),_0x135cdd=this['editor']['data']['processor']['toData'](_0x408592),_0x213033=this['editor']['model']['document']['version'],_0x59bfb8=[..._0x21b87b['getRanges']()],_0xad49d7=new s(this['editor']['locale'],{'showDiff':!0x1,'areActionsDisabled':!0x1,'hideHeader':!0x0,'showLoader':!0x0,'miniToolbarConfig':{'showChanges':'icon','customView':this['_customViews']}});_0x221737['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x350b4d,'icon':_0x599dde||_0x35a1a1,'mainView':_0xad49d7,'showRotator':!0x1,'showApplyButton':!0x0,'showSuggestButton':!0x0,'ranges':_0x59bfb8}),this['_setLoadingState'](_0xad49d7,_0x221737);const _0x3bdde5=_0x21b87b['getFirstPosition']();return this['listenTo'](_0x221737,'applySuggestion',()=>{this['_applySuggestion'](_0x3bdde5);}),this['listenTo'](_0x221737,'insertSuggestion',()=>{this['_insertSuggestion'](_0x3bdde5);}),this['listenTo'](_0x221737,'dialogClosed',()=>{this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](_0x221737);}),this['_createInteraction'](_0x135cdd,_0x213033,_0xad49d7,_0x221737,_0x52d98b);}['_executeActionOnTable'](_0x3a1043,_0x3f71c2,_0x5d5aef){const _0x46f95f=this['editor']['plugins']['get'](a),_0x14d02d=this['editor']['plugins']['get'](m),_0x2b22e0=this['editor']['model']['document']['selection'],_0x4747d9=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x3deeda=_0x46f95f['modelToViewWithIds'](_0x4747d9),_0x593829=this['editor']['data']['processor']['toData'](_0x3deeda),_0x560da2=this['editor']['model']['document']['version'],_0x80a9b5=[..._0x2b22e0['getRanges']()],_0x3f2666=new s(this['editor']['locale'],{'showDiff':!0x1,'areActionsDisabled':!0x1,'hideHeader':!0x0,'showLoader':!0x0,'miniToolbarConfig':{'showChanges':'icon','customView':this['_customViews']}});_0x14d02d['open']({'index':0x0,'title':_0x3f71c2,'icon':_0x5d5aef||_0x35a1a1,'mainView':_0x3f2666,'showRotator':!0x1,'showApplyButton':!0x0,'showSuggestButton':!0x0,'ranges':_0x80a9b5}),this['_setLoadingState'](_0x3f2666,_0x14d02d);const _0x338e2c=_0x2b22e0['getFirstPosition']();return this['listenTo'](_0x14d02d,'applySuggestion',()=>{this['_applySuggestion'](_0x338e2c);}),this['listenTo'](_0x14d02d,'insertSuggestion',()=>{this['_insertSuggestion'](_0x338e2c);}),this['listenTo'](_0x14d02d,'dialogClosed',()=>{this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['stopListening'](_0x14d02d);}),this['_createInteraction'](_0x593829,_0x560da2,_0x3f2666,_0x14d02d,_0x3a1043);}['_wrapWithCommonAncestors'](_0x5a2413,_0xc528f3){const _0x615772=_0xc528f3['getFirstRange']()['getCommonAncestor'](),_0x18ad89=_0x615772['is']('documentFragment')?[]:_0x615772['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x18ad89['length']){const _0x1d1efb=_0x18ad89['map'](_0x574663=>_0x574663['_clone'](!0x1));for(let _0x4d848d=0x1;_0x4d848d<_0x1d1efb['length'];_0x4d848d++)_0x1d1efb[_0x4d848d-0x1]['_appendChild'](_0x1d1efb[_0x4d848d]);return _0x1d1efb[_0x1d1efb['length']-0x1]['_appendChild'](_0x5a2413),new _0x576a41(_0x1d1efb[0x0]);}return _0x5a2413;}async['_createInteraction'](_0x2ff47a,_0x5f0c7b,_0x527638,_0x51c6c9,_0x42d6b1){const _0x21f45e=this['editor'];this['_currentInteractionParams']={'action':_0x42d6b1,'content':_0x2ff47a,'version':_0x5f0c7b,'mainView':_0x527638,'aiBalloon':_0x51c6c9},this['_interaction']=new c({'connector':this['_aiConnector'],'editor':_0x21f45e,'content':_0x2ff47a,'version':_0x5f0c7b,..._0x42d6b1});const _0x2f95ae=(_0x27c79d,_0x86d263,_0x51fbfe=this['_balloonShowDiff'],_0x28b35d='streaming')=>this['_promiseQueue']['enqueue'](async _0x5bc9ef=>{try{const _0xb19d75=d({'editor':_0x21f45e,'changeGroups':_0x27c79d['changeGroups'],'documentContextContent':_0x27c79d['documentContextContent'],'showDiff':_0x51fbfe,'trimUnchanged':!0x1});await _0x86d263['updateContent']({'parts':_0xb19d75,'renderingStrategy':_0x28b35d,'abortSignal':_0x5bc9ef});}catch(_0x220ad7){if(this['_isAbortError'](_0x220ad7))return;throw _0x220ad7;}});this['_interaction']['on']('replyCreated',(_0x5f55e6,_0x5daaff)=>{_0x527638['hideLoader'](),_0x2f95ae(_0x5daaff,_0x527638)['catch'](_0x32938e=>{this['_isAbortError'](_0x32938e)||console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x32938e);});}),this['_interaction']['on']('replyContentUpdated',(_0x53ede6,_0x15eebc)=>{_0x2f95ae(_0x15eebc,_0x527638)['catch'](_0x1a86cc=>{this['_isAbortError'](_0x1a86cc)||console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x1a86cc);});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](_0x527638,_0x51c6c9);}catch(_0x2b503d){this['_isAbortError'](_0x2b503d)||console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x2b503d);}}),this['listenTo'](_0x527638,'toggleSuggestionDisplayMode',(_0x2f3765,{showDiff:_0xd91f9c})=>{this['_balloonShowDiff']=_0xd91f9c;const _0x44e7c8=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x44e7c8&&_0x2f95ae(_0x44e7c8,_0x527638,_0xd91f9c,'static')['catch'](_0x3338fb=>{this['_isAbortError'](_0x3338fb)||console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x3338fb);});}),this['_setLoadingState'](_0x527638,_0x51c6c9);try{return await this['_interaction']['start']();}catch(_0x377da9){if(this['_isAbortError'](_0x377da9))return;throw _0x377da9;}}['_insertSuggestion'](_0x23c0a0){const _0x4f7c20=this['editor'],_0x142d25=this['editor']['plugins']['get'](_0x2423ad),_0x4cf87a=this['_interaction'],_0x31f642=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x4aaa61=_0x31f642['changeGroups'],_0x1dd740=w({'editor':_0x4f7c20,'reply':_0x31f642,'interaction':_0x4cf87a,'groups':_0x4aaa61,'transform':!0x1,'documentCompare':_0x142d25,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});for(const _0x411d32 of _0x1dd740)this['_anchorOperation'](_0x23c0a0,_0x411d32);const _0x46214a=_0x4cf87a['getDocumentContext']()['version'],_0x59b586=_0x4f7c20['model']['document']['history']['getOperations'](_0x46214a),_0x19451b={'document':_0x4f7c20['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x4cbce0=_0x59f1a9(_0x1dd740,_0x59b586,_0x19451b)['operationsA'];_0x4f7c20['model']['change'](_0x543680=>{_0x543680['setSelection'](_0x4f7c20['model']['document']['selection']['focus']),_0x4f7c20['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x4cbce0);}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_applySuggestion'](_0x3d5cb0){const _0x188d48=this['editor'],_0xd17055=this['editor']['plugins']['get'](_0x2423ad),_0xcee840=this['_interaction'],_0x112fd0=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x5c6abc=_0x112fd0['changeGroups'],_0x40e8f3=w({'editor':_0x188d48,'reply':_0x112fd0,'interaction':_0xcee840,'groups':_0x5c6abc,'transform':!0x1,'documentCompare':_0xd17055,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});for(const _0x592892 of _0x40e8f3)this['_anchorOperation'](_0x3d5cb0,_0x592892);const _0x4dea4a=_0xcee840['getDocumentContext']()['version'],_0x336aa9=_0x188d48['model']['document']['history']['getOperations'](_0x4dea4a),_0x54a2f9={'document':_0x188d48['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x472870=_0x59f1a9(_0x40e8f3,_0x336aa9,_0x54a2f9)['operationsA'];_0x188d48['model']['change'](_0x362ed7=>{_0x362ed7['setSelection'](_0x188d48['model']['document']['selection']['focus']);for(const _0x31fd01 of _0x472870)_0x31fd01['baseVersion']=_0x188d48['model']['document']['version'],_0x362ed7['batch']['addOperation'](_0x31fd01),_0x188d48['model']['applyOperation'](_0x31fd01);}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_anchorOperation'](_0x46a03e,_0x3ed87c){for(const _0x1c3ce2 in _0x3ed87c){const _0x23b996=_0x3ed87c[_0x1c3ce2];_0x23b996 instanceof _0xd5274c?_0x3ed87c[_0x1c3ce2]=new _0xd5274c(_0x22cf9b(_0x23b996['start']),_0x22cf9b(_0x23b996['end'])):_0x23b996 instanceof _0x5dfdfe&&(_0x3ed87c[_0x1c3ce2]=_0x22cf9b(_0x23b996));}function _0x22cf9b(_0x23d4ae){if(_0x23d4ae['root']!=_0x46a03e['root'])return _0x23d4ae;const _0x28e33e=_0x23d4ae['path']['slice']();for(let _0x32b322=0x0;_0x32b322<_0x46a03e['path']['length']&&_0x32b322<_0x28e33e['length'];_0x32b322++){const _0x2ee170=0x0!=_0x28e33e[_0x32b322];if(_0x28e33e[_0x32b322]+=_0x46a03e['path'][_0x32b322],_0x2ee170)break;}return new _0x5dfdfe(_0x23d4ae['root'],_0x28e33e,_0x23d4ae['stickiness']);}}['_refreshInteraction'](){if(!this['_currentInteractionParams'])return void console['warn']('No\x20current\x20interaction\x20to\x20refresh');this['_interaction']&&(this['_previousInteractions']['push'](this['_interaction']),this['_stopInteraction']());const {action:_0x203bac,content:_0x8867a3,version:_0x27ea63,mainView:_0x7eae35,aiBalloon:_0x4544bd}=this['_currentInteractionParams'];this['_clearSuggestionContent'](_0x7eae35),_0x7eae35['showLoader'](),this['_createInteraction'](_0x8867a3,_0x27ea63,_0x7eae35,_0x4544bd,_0x203bac)['catch'](_0x528c79=>{this['_isAbortError'](_0x528c79)||console['error']('Error\x20refreshing\x20interaction:',_0x528c79);});}['_clearSuggestionContent'](_0x1c4510){const _0x4342a8=_0x1c4510['bodyView']['_children'];for(;_0x4342a8['length']>0x0;)_0x4342a8['remove'](_0x4342a8['first']);_0x1c4510['bodyView']['hasPendingParts']=!0x1;}['_isAbortError'](_0x21fb59){return!!_0x21fb59['message']&&_0x21fb59['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_previousInteractions']=[],this['_currentInteractionParams']=void 0x0;}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1;}['_setupCustomViews'](){const _0x355afb=new _0x155a80(this['editor']['locale']);_0x355afb['set']({'icon':_0x105e96,'label':Yn(this['editor']['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x355afb['bind']('isEnabled')['to'](this,'isBusy',_0x526f01=>!_0x526f01),_0x355afb['on']('execute',()=>{this['_refreshInteraction']();}),this['_customViews']['add'](_0x355afb);}['_setLoadingState'](_0xd27a6,_0x309710){_0xd27a6['setLoading'](),_0x309710['balloonView']['setLoading'](),this['isBusy']=!0x0;}async['_clearLoadingState'](_0x1a001a,_0x1bb574){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,_0x1a001a['clearLoading'](),_0x1bb574['balloonView']['clearLoading']();}}class vs{['id'];['title'];['description'];['isParameterized'];['useArgs'];['options'];constructor({id:_0x4fd62e,title:_0x40793a,description:_0xd3eaa6,isParameterized:_0x4f5a56,useArgs:_0x507acb,options:_0x3c7c0a}){this['id']=_0x4fd62e,this['title']=_0x40793a,this['description']=_0xd3eaa6,this['isParameterized']=_0x4f5a56,this['useArgs']=_0x507acb,this['options']=_0x3c7c0a;}}class ea extends vs{['_models']=[];get['models'](){return this['_models'];}set['models'](_0x2ea63f){this['_models']=_0x2ea63f;}}const ia=[{'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','default':'spanish','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 ei extends _0x757adc(){['_checks'];constructor(){super(),this['_checks']=this['_getAvailableReviewChecks']();}get['checks'](){return this['_checks'];}get['getExpandedChecks'](){return this['_getExpandedReviewChecks']();}['getCheckById'](_0x435439){return this['getExpandedChecks']['find'](_0x1b9fbf=>_0x1b9fbf['id']===_0x435439);}['_getAvailableReviewChecks'](){return ia['map'](_0x19c3e4=>'custom'===_0x19c3e4['id']?new ea(_0x19c3e4):new vs(_0x19c3e4));}['_getExpandedReviewChecks'](){return ia['flatMap'](_0x40de5e=>{if(_0x40de5e?.['useArgs'])return[_0x40de5e];if(_0x40de5e['isParameterized']&&_0x40de5e['options']?.['length']){const _0x26e05b=_0x40de5e['options']['map'](_0x5a63fc=>_0x5a63fc['data']||[]);return _0x26e05b['reduce']((_0x3a1c4b,_0x44859e)=>_0x3a1c4b['flatMap'](_0x3138fc=>_0x44859e['map'](_0x324f90=>[..._0x3138fc,_0x324f90])),[[]])['map'](_0x1f7df4=>{const _0x10702a=_0x1f7df4['map'](_0x4dc8df=>_0x4dc8df['id'])['join']('-'),_0xa82765=_0x1f7df4['map'](_0x308447=>_0x308447['label'])['join'](',\x20');return{..._0x40de5e,'id':_0x40de5e['id']+'-'+_0x10702a,'title':_0x40de5e['title']+':\x20\x0a'+_0xa82765,'selectedOptions':_0x1f7df4};});}return[_0x40de5e];});}}class Cs extends _0x2f6768(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x5419f0,contentNew:_0x321ce4,contentInitial:_0x8eb91c,documentVersion:_0x19f747}){super(),this['id']=_0x5419f0,this['contentNew']=_0x321ce4,this['contentInitial']=_0x8eb91c,this['documentVersion']=_0x19f747;}}class Rs extends _0x757adc(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x562c77,_0x56299f,_0xd161b3){super(),this['id']=_0x562c77,this['parent']=_0xd161b3,this['_data']=_0x56299f,this['set']('status','active');}get['contentDiffed'](){return this['_data']['context']();}get['operations'](){return this['_data']['operations'];}get['operationsIsolated'](){return this['_data']['operationsIsolated'];}}class xs extends _0x757adc(){['id']=_0x2458fa();['_results']=new Map();['_changes']=[];['_documentData'];['_sourceCheck'];['_aiConnector'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];constructor(_0x16e8cd,_0x368826,_0x11149f,_0x25dd48){super(),this['_documentData']=_0x16e8cd,this['_sourceCheck']=_0x368826,this['_aiConnector']=_0x11149f,this['_reviewArgs']=_0x25dd48,this['on']('change:status',(_0x1b4ffb,_0x4f7b94,_0x3afbc4)=>{this['fire']('reviewCheckRunUpdated',{'status':_0x3afbc4,'run':this,'error':this['_currentError']});}),this['set']('status','initialized');}get['documentData'](){return this['_documentData'];}get['processedResultsCount'](){return this['_results']['size'];}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0xf5586e=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x540d7a of _0xf5586e)'unmodified'!==_0x540d7a['data']['operation']&&('error'!==_0x540d7a['data']['operation']?this['_addReviewCheckResult'](_0x540d7a['data']['dataId'],_0x540d7a['data']['textDelta']):this['status']='error-chunk');'error-chunk'!==this['status']&&(this['status']='ready');}catch(_0x1290ff){this['_currentError']=_0x1290ff,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'](_0xbc7352,_0x1aaa91){const _0x4b5a90=this['_results']['get'](_0xbc7352);if(!_0x4b5a90)return;const _0x43571b=[];_0x1aaa91['forEach']((_0x28fd7f,_0x45d586)=>{const _0x4a4b47=new Rs(_0x4b5a90['id']+'-'+_0x45d586,_0x28fd7f,_0x4b5a90);_0x4a4b47['on']('change:status',()=>{'accepted'===_0x4a4b47['status']?this['fire']('reviewCheckResultAccepted',{'change':_0x4a4b47}):'rejected'===_0x4a4b47['status']&&this['fire']('reviewCheckResultRejected',{'change':_0x4a4b47});}),this['_changes']['push'](_0x4a4b47),_0x43571b['push'](_0x4a4b47);}),this['fire']('reviewCheckResultReady',{'changes':_0x43571b,'result':_0x4b5a90,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0xc966bf){const _0x589e0c=this['_changes']['find'](_0xc8bdf6=>_0xc8bdf6['id']===_0xc966bf);return!(!_0x589e0c||'active'!==_0x589e0c['status']);}['getActiveChanges'](){return this['_changes']['filter'](_0x27690b=>'active'===_0x27690b['status']);}['markAllChangesAsAccepted'](){for(const _0x234a26 of this['_changes'])'active'===_0x234a26['status']&&(_0x234a26['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x108e8c){const _0xb0ad75=this['_changes']['find'](_0x390e70=>_0x390e70['id']===_0x108e8c);_0xb0ad75&&'active'===_0xb0ad75['status']&&(_0xb0ad75['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x2b4e19){const _0x3f3a1c=this['_changes']['find'](_0x439983=>_0x439983['id']===_0x2b4e19);_0x3f3a1c&&'active'===_0x3f3a1c['status']&&(_0x3f3a1c['status']='rejected'),this['_checkIfFinished']();}['_addReviewCheckResult'](_0x493e0f,_0x11be19){const _0x35d8bc=this['_documentData']['elements']['get'](_0x493e0f);if(!_0x35d8bc)return;const _0x211cf3=_0x35d8bc['getContent']();if(_0x211cf3===_0x11be19)return;const _0x2eeb12=new Cs({'id':_0x493e0f,'contentInitial':_0x211cf3,'contentNew':_0x11be19,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x2eeb12['id'],_0x2eeb12),this['fire']('reviewCheckResultAdded',{'result':_0x2eeb12,'source':this});}['_checkIfFinished'](){if('ready'!==this['status'])return;0x0===this['_changes']['filter'](_0x25176f=>'active'===_0x25176f['status'])['length']&&(this['status']='finished');}['_createApiRequest'](){throw new Error('Not\x20implemented.');}}class hi extends xs{['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_sourceCheck']['id'],'content':this['_documentData']['content'],'args':this['_reviewArgs']});}}class ri extends xs{['_prompt'];['_model'];constructor(_0x1eedc0,_0x2b29fe,_0x1f12dd,_0x3fd649,_0x5e1fb6){super(_0x1f12dd,_0x3fd649,_0x5e1fb6),this['_prompt']=_0x1eedc0,this['_model']=_0x2b29fe;}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}}class ni extends _0x2f6768(){['_modelList']=[];['_connector'];constructor({connector:_0x807c6b}){super(),this['_connector']=_0x807c6b;}async['getAll'](){if(!this['_modelList']['length'])try{const _0x3d7615=this['_connector']['getModels'](),_0x4a27e9=await _0x3d7615['list']();this['_modelList']=_0x4a27e9['items'];}catch{}return this['_modelList'];}}class ee extends _0x316379{['_aiConnector'];['_aiReviewModeUi'];['_aiReviewModeEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_isDiffOn']=!0x1;static get['requires'](){return[o];}static get['pluginName'](){return'AIReviewModeController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiReviewModeUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewModeEditing']=this['context']['plugins']['get']('AIReviewModeEditing'),this['_aiReviewCheckList']=new ei(),this['listenTo'](this['_aiReviewModeUi'],'getReviewCheckList',async()=>{const _0x288a5a=new ni({'connector':this['_aiConnector']});this['_aiReviewCheckList']['checks']['find'](_0x52723e=>'custom'===_0x52723e['id'])['models']=await _0x288a5a['getAll'](),this['_aiReviewModeUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewModeUi'],'runReviewCheck',async(_0x21f646,_0x3bec6b)=>{const _0x3879b6=this['_aiReviewCheckList']['getCheckById'](_0x3bec6b['id']);if(_0x3879b6){this['_onDiffChange'](this['_isDiffOn']),this['_aiReviewModeUi']['setCheckResultTitle'](_0x3879b6['title']),_0x3bec6b['isCustom']?this['_currentReviewCheckRun']=new ri(_0x3bec6b['args']['prompt'],_0x3bec6b['args']['model'],this['_aiReviewModeEditing']['getDocumentData'](),_0x3879b6,this['_aiConnector']):this['_currentReviewCheckRun']=new hi(this['_aiReviewModeEditing']['getDocumentData'](),_0x3879b6,this['_aiConnector'],_0x3bec6b['args']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x4ce46c,_0x5da121)=>{'data'===_0x5da121['status']||'loading'===_0x5da121['status']?(this['_aiReviewModeEditing']['switchToReadOnly'](),this['_aiReviewModeUi']['showCheckRunResults'](_0x5da121)):'finished'===_0x5da121['status']?this['_aiReviewModeUi']['showReviewCompletedView']():'ready'===_0x5da121['status']?this['_aiReviewModeUi']['showActionsWhenResultIsReady']():'error-general'===_0x5da121['status']?this['_aiReviewModeUi']['showGeneralErrorView']():'error-chunk'===_0x5da121['status']&&this['_aiReviewModeUi']['showChunkErrorView']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x4c9bf9,_0x215a70)=>{if(!this['_currentReviewCheckRun'])throw new _0x4a8035('aireviewmode-no-current-check-run',this);const _0x12074a=this['_aiReviewModeEditing']['diffContent'](_0x215a70['result']['contentInitial'],_0x215a70['result']['contentNew']);_0x215a70['source']['addResultChanges'](_0x215a70['result']['id'],_0x12074a);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x9e3bb8,_0xf5d640)=>{for(const _0x2a9977 of _0xf5d640['changes'])this['_aiReviewModeUi']['showCheckRunResult'](_0x2a9977);this['_aiReviewModeEditing']['markChangePositionInEditorContent'](_0xf5d640['changes'],_0xf5d640['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultAccepted',(_0x5eccb5,_0x16a0d9)=>{this['_aiReviewModeUi']['updateChangeState'](_0x16a0d9['change']['id'],'accepted');}),this['_currentReviewCheckRun']['on']('reviewCheckResultRejected',(_0x497987,_0xc62f26)=>{this['_aiReviewModeUi']['updateChangeState'](_0xc62f26['change']['id'],'rejected');});try{await this['_currentReviewCheckRun']['start']();}catch(_0x1918de){_0x1918de instanceof Error&&_0x1918de['message']['includes']('ai-request-aborted')||(_0x1918de instanceof _0x4a8035?this['_logError'](_0x1918de):this['_logError'](new _0x4a8035('aireviewmode-check-run-failed',this,{'error':_0x1918de})));}}else this['_logError'](new _0x4a8035('aireviewmode-source-check-not-found',this,{'checkId':_0x3bec6b['id']}));}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewMode',()=>{this['_onReviewModeRunLeave']();}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewModeResultList',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'abortReviewStream',async()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'acceptAllChanges',async()=>{if(!this['_currentReviewCheckRun'])return;const _0x530428=this['_currentReviewCheckRun']['getActiveChanges']();if(_0x530428['length']){for(const _0x25ba53 of _0x530428)this['_aiReviewModeEditing']['applyChange'](_0x25ba53['id']);this['_currentReviewCheckRun']['markAllChangesAsAccepted']();}}),this['listenTo'](this['_aiReviewModeUi'],'acceptChange',async(_0x3bc18f,_0x105e77)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x105e77['id'])&&(this['_aiReviewModeEditing']['applyChange'](_0x105e77['id']),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x105e77['id']));}),this['listenTo'](this['_aiReviewModeUi'],'dismissChange',async(_0x18c21e,_0x19ae08)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x19ae08['id'])&&(this['_aiReviewModeEditing']['rejectChange'](_0x19ae08['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x19ae08['id']));}),this['listenTo'](this['_aiReviewModeUi'],'toggleDiff',(_0x14e87a,_0x4c7f7d)=>{this['_isDiffOn']=_0x4c7f7d['on'],this['_onDiffChange'](this['_isDiffOn']);}),this['listenTo'](this['_aiReviewModeUi'],'finishReview',()=>{this['_aiReviewModeUi']['fire']('getReviewCheckList');}),this['listenTo'](this['_aiReviewModeUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['restart']();}),this['listenTo'](this['_aiReviewModeUi'],'scrollToSuggestionInDocument',async(_0x2a85e6,_0x23165a)=>{const {source:_0x2fe06d}=_0x23165a;this['_aiReviewModeUi']['resetActiveStateInResults'](),_0x2fe06d['setItemAsActive'](),this['_aiReviewModeEditing']['scrollToChangeInEditorContent']({'id':_0x23165a['id']});});}['_onReviewModeRunLeave'](_0xb31376=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']=void 0x0),_0xb31376&&this['_aiReviewModeUi']['showReviewCheckList'](),this['_aiReviewModeEditing']['clearAllMarkers'](),this['_aiReviewModeEditing']['switchToEdit']();const _0x6205b7=this['_aiReviewModeEditing']['getContentElement']();_0x6205b7&&(_0x6205b7['classList']['remove']('ck-ai-review-mode-diff'),_0x6205b7['classList']['remove']('ck-ai-review-mode-highlights'));}['_onDiffChange'](_0x3cdb59){const _0x51f1c0=this['_aiReviewModeEditing']['getContentElement']();_0x51f1c0&&(_0x51f1c0['classList']['remove']('ck-ai-review-mode-diff'),_0x51f1c0['classList']['remove']('ck-ai-review-mode-highlights'),_0x51f1c0['classList']['add'](_0x3cdb59?'ck-ai-review-mode-diff':'ck-ai-review-mode-highlights'));}['_logError'](_0x5e4ebb){lt(_0x5e4ebb['message']),this['_aiReviewModeUi']['showGeneralErrorView']();}}class vr extends _0x7ecbb5{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0xddf347,_0x19be7a){super(_0xddf347),this['_defaultValue']=_0x19be7a['default']||(_0x19be7a['data']['length']>0x0?_0x19be7a['data'][0x0]['id']:''),this['_defaultLabel']=_0x19be7a['data']['find'](_0x3b518f=>_0x3b518f['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x30b0b5(this['locale']);const _0x5cc424=this['_prepareListOptions'](_0x19be7a['data']);_0x69c78d(this['_dropdownView'],_0x5cc424,{'role':'menu','ariaLabel':_0x19be7a['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2797ca=>{_0x2797ca['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x139bf2=>{this['formValue']=_0x139bf2['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x139bf2['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'](_0x162f56=[]){const _0x13df28=new _0x4041f8();this['resetToDefault']();for(const _0xc6bb30 of _0x162f56){const _0xe30c81=new _0x1a9d93({'label':_0xc6bb30['label'],'withText':!0x0,'role':'menuitemradio','id':_0xc6bb30['id'],'model':_0xc6bb30});_0xe30c81['bind']('isOn')['to'](this,'formValue',_0x480de1=>_0x480de1===_0xe30c81['id']);const _0x2dfca={'type':'button','model':_0xe30c81};_0x13df28['add'](_0x2dfca);}return _0x13df28;}}class Ps extends _0x7baab6{['_formItem']=null;constructor(_0x3c5d11,_0x29a6a1,_0x5304ed){super(_0x3c5d11),this['argsKey']=_0x29a6a1?.['argsKey'];if('dropdown'===_0x29a6a1['formType'])this['_formItem']=new vr(this['locale'],_0x29a6a1);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x130c25=new _0x28ba79(this['locale'],{'children':[this['_formItem']],'class':[_0x5304ed?'ck-form__row_with-submit':'']});_0x5304ed&&_0x130c25['children']['add'](_0x5304ed),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__form-item','ck-reset_all']},'children':[_0x130c25]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class ys extends _0x3ec2e3{static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x3c115d){super(_0x3c115d),this['set']('isEmpty',!0x0),this['minRows']=ys['MIN_ROWS'],this['maxRows']=ys['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-mode-prompt-input','class':['ck','ck-review-mode__prompt-input']}}),this['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x196dbc=>{_0x196dbc['stopPropagation']();})}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();});}['setPlaceholderText'](_0xc53aaf){this['set']('placeholder',_0xc53aaf);}}class Fs extends _0x7ecbb5{['submitButtonView'];['cancelButtonView'];['promptInputView'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_check'];constructor(_0x3909b6,_0x24fd1e){super(_0x3909b6),this['_check']=_0x24fd1e,this['set']('prompt',''),this['set']('modelId',''),this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),this['promptInputView']=new ys(_0x3909b6),this['promptInputView']['bind']('value')['to'](this,'prompt'),this['promptInputView']['on']('input',()=>{this['prompt']=this['promptInputView']['element']['value'];}),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelSelectionDropdownItems']=new _0x4041f8(),this['_setModelList'](),_0x69c78d(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);const _0x3ab715=new _0x7ecbb5(_0x3909b6);_0x3ab715['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']]}]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions']},'children':[new _0x28ba79(this['locale'],{'children':[this['promptInputView']]}),new _0x28ba79(this['locale'],{'children':[_0x3ab715]})]});}['_createSubmitButtonView'](){const _0xd33387=new _0x155a80(this['locale']);return _0xd33387['set']({'label':'Review','withText':!0x0,'class':'ck-ai-button-primary'}),_0xd33387['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x28cc36=>{_0x28cc36['stopPropagation']();})}}),_0xd33387['on']('execute',()=>{this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0xd33387;}['_createCancelButtonView'](){const _0x4540e3=new _0x155a80(this['locale']);return _0x4540e3['set']({'label':'Cancel','withText':!0x0,'class':'ck-ai-button-tertiary-filled'}),_0x4540e3['on']('execute',()=>{console['log']('Custom\x20check\x20canceled'),this['prompt']='',this['fire']('cancelCustomCheck');}),_0x4540e3;}['_setModelList'](){this['_modelSelectionDropdownItems']['clear']();const _0x12e191=this['_check']['models'];if(_0x12e191?.['length'])for(const _0x1d694e of _0x12e191){const _0x2d2737=new _0x1a9d93({'label':_0x1d694e['name'],'withText':!0x0,'role':'menuitemradio','id':_0x1d694e['id'],'model':_0x1d694e});_0x2d2737['bind']('isOn')['to'](this,'modelId',_0x4f75b9=>_0x4f75b9===_0x1d694e['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x2d2737,'labelView':new _0x46d8c3()});}}['_createModelSelectionDropdown'](){const _0x46b7e1=_0x30b0b5(this['locale']);return _0x46b7e1['set']({'panelPosition':'se'}),_0x46b7e1['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xeb99ff=>{_0xeb99ff['stopPropagation']();})}}),_0x46b7e1['buttonView']['set']({'label':this['_check']['models'][0x0]['name'],'withText':!0x0,'tooltip':!0x0}),this['listenTo'](_0x46b7e1,'execute',_0x1a8cb1=>{this['modelId']=_0x1a8cb1['source']['model']['id'],_0x46b7e1['buttonView']['label']=_0x1a8cb1['source']['label'];}),_0x46b7e1;}}class Ms extends _0x7baab6{['_formItemsCollection']=new _0xa841d5();constructor(_0x5f195c,_0x5f19ae,_0x6a6593){super(_0x5f195c),this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x5f19ae['isParameterized']);const _0x475f19=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',_0x442c53=>_0x442c53),this['bindTemplate']['if']('isListItemRendered','ck-ai-review-mode__check-list-item_rendered',_0x306f15=>_0x306f15)],'style':{'--ck-ai-check-list-item-index':_0x6a6593}},'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':_0x5f19ae['title']}]},_0x475f19]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-description']},'children':[{'text':_0x5f19ae['description']}]}]}]},..._0x5f19ae['isParameterized']?[this['_createParameterizedView'](_0x5f19ae)]:[],...'custom'===_0x5f19ae['id']?[this['_createCustomView'](_0x5f19ae)]:[]]}),this['on']('click',()=>{_0x5f19ae['isParameterized']?this['isParametrizedViewOpen']=!this['isParametrizedViewOpen']:this['fire']('runReviewCheck',{'id':_0x5f19ae['id']});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x6d5b3a({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x809d3d=>{_0x809d3d['resetToDefault']();});}['_createIconView'](){const _0x2954c9=new _0x29aaa9();return _0x2954c9['content']=_0x512627,_0x2954c9['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-title-icon']}}),_0x2954c9;}['_createParameterizedView'](_0x515698){const _0x2cc72e=new _0x7ecbb5(),_0x3f0345=this['_createFormView'](_0x515698);return _0x2cc72e['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x2d5655=>!_0x2d5655)]},'children':[_0x3f0345]}),_0x2cc72e;}['_createFormView'](_0x2e84a6){const _0x51d9f0=new _0x7ecbb5(),_0x434944=Array['isArray'](_0x2e84a6['options'])?_0x2e84a6['options']:[],_0x4b3685=new _0x155a80(this['locale']);_0x4b3685['set']({'label':'Submit','withText':!0x0,'class':'ck-ai-button-primary'}),_0x4b3685['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x433ee8=>{_0x433ee8['stopPropagation']();})}}),_0x4b3685['on']('execute',()=>{const _0x236964=[];let _0x85e74b;this['_formItemsCollection']['forEach'](_0x3bc863=>{_0x236964['push'](_0x3bc863['value']),_0x2e84a6['useArgs']&&_0x2e84a6['options']&&(_0x85e74b={[_0x3bc863['argsKey']]:_0x3bc863['value']});});const _0x23fae8=_0x2e84a6['useArgs']?_0x2e84a6['id']:[_0x2e84a6['id'],..._0x236964]['join']('-');this['fire']('runReviewCheck',{'id':_0x23fae8,'args':_0x85e74b});});const _0x5a3684=_0x434944['length'];return _0x434944['forEach']((_0x5cd4c4,_0x5f1894)=>{const _0x3302b5=_0x5f1894===_0x5a3684-0x1;this['_formItemsCollection']['add'](new Ps(this['locale'],_0x5cd4c4,_0x3302b5?_0x4b3685:null));}),_0x51d9f0['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x51d9f0;}['_createCustomView'](_0x500161){const _0x11a35d=new Fs(this['locale'],_0x500161);return _0x11a35d['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',_0x3e7af1=>!_0x3e7af1)]}}),_0x11a35d['delegate']('runReviewCheck')['to'](this),_0x11a35d['delegate']('cancelCustomCheck')['to'](this),_0x11a35d['delegate']('setCustomCheckModel')['to'](this),_0x11a35d;}}class Gs extends _0x7baab6{['_checkViews'];constructor(_0xef8367){super(_0xef8367),this['_checkViews']=new _0xa841d5();const _0x221b0b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list',_0x221b0b['if']('isVisible','ck-hidden',_0x3c5467=>!_0x3c5467)]},'children':this['_checkViews']});}['setChecks'](_0x5e90ff){this['_checkViews']['clear']();for(const [_0x245bef,_0x31b3b8]of _0x5e90ff['entries']()){const _0x2758f6=new Ms(this['locale'],_0x31b3b8,_0x245bef);_0x2758f6['delegate']('runReviewCheck')['to'](this),_0x2758f6['delegate']('cancelCustomCheck')['to'](this),_0x2758f6['delegate']('setCustomCheckModel')['to'](this),this['_checkViews']['add'](_0x2758f6);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x2dc382 of this['_checkViews'])_0x2dc382 instanceof Ms&&_0x2dc382['resetToDefault']();}}function p(_0x12a04e,_0x1406c5){const {t:t}=_0x12a04e;switch(_0x1406c5){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.\x20You\x20can\x20now\x20return\x20to\x20the\x20command\x20list.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20whole\x20review\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE','string':'Not\x20everything\x20went\x20through,\x20but\x20the\x20completed\x20items\x20are\x20listed\x20below.'});default:return _0x1406c5;}}class Ws extends _0x7ecbb5{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];constructor(_0x4225ef,_0x5146e1){super(_0x4225ef),this['id']=_0x5146e1,this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](_0x5146e1),this['dismissButtonView']=this['_createDismissButtonView'](_0x5146e1),this['infoButtonView']=this['_createInfoButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),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['infoButtonView']]}]}),this['on']('click',()=>{this['fire']('scrollToSuggestionInDocument',{'id':_0x5146e1,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x281f4d=new _0x7ecbb5(this['locale']);return _0x281f4d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-response']}}),_0x281f4d;}['_createAcceptButtonView'](_0x167af9){const _0x3cb0e3=new _0x155a80(this['locale']);return _0x3cb0e3['set']({'label':p(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-result-accept-button'}),_0x3cb0e3['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x42490e=>{this['fire']('acceptChange',{'id':_0x167af9}),_0x42490e['stopPropagation']();})}}),_0x3cb0e3;}['_createDismissButtonView'](_0x8aa08c){const _0x53b7ff=new _0x155a80(this['locale']);return _0x53b7ff['set']({'label':p(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-dismiss-button'}),_0x53b7ff['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5575c5=>{this['fire']('dismissChange',{'id':_0x8aa08c}),_0x5575c5['stopPropagation']();})}}),_0x53b7ff;}['_createInfoButtonView'](){const _0xa624d9=new _0x155a80(this['locale']);return _0xa624d9['set']({'label':p(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x3618e1,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-info-button\x20ck-hidden'}),_0xa624d9['bind']('isOn')['to'](this,'isInfoToggleOn',_0x5dc17f=>_0x5dc17f),_0xa624d9['on']('execute',()=>{console['log']('Toggle\x20info\x20view'),this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0xa624d9;}}class qs extends _0x7baab6{['_resultViews'];['resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];constructor(_0x447a59){super(_0x447a59),this['_resultViews']=new _0xa841d5(),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_acceptAllButtonView']=this['_createAcceptAllButtonView'](),this['_exitReviewButtonView']=this['_createExitReviewButtonView'](),this['_toggleDiffButtonView']=this['_createToggleDiffButtonView'](),this['resultsHeader']=this['_createResultHeaderView'](),this['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new Ki(_0x447a59),this['set']('isLoading',!0x1),this['set']('isToggleDiffOn',!0x1),this['set']('isResultReady',!0x1),this['set']('headerTitle',''),this['set']('isError',!0x1),this['set']('showErrorMessage',!0x1),this['set']('errorType','general');const _0x35ea33=this['_createCombinedSkeletonLoader'](),_0x3f0413=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run',_0x3f0413['if']('isVisible','ck-hidden',_0x29a133=>!_0x29a133)]},'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',_0x35061f=>_0x35061f)]},'children':this['_resultViews']},_0x35ea33]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x132708){const _0x1fca94=new Ws(this['locale'],_0x132708['id']);_0x1fca94['delegate']('acceptChange','dismissChange','scrollToSuggestionInDocument')['to'](this),this['_resultViews']['add'](_0x1fca94),_0x1fca94['resultResponseView']['element']['innerHTML']=_0x132708['contentDiffed'];}['hideResult'](_0x1f40ac){const _0x4739a2=this['_resultViews']['find'](_0x574ace=>_0x574ace['id']===_0x1f40ac);_0x4739a2&&(_0x4739a2['element']?.['classList']['add']('ck-ai-review-mode__check-run-result_removing'),_0x4739a2['element']?.['addEventListener']('animationend',()=>{this['_resultViews']['remove'](_0x4739a2),_0x4739a2['destroy']();},{'once':!0x0}));}['setTitle'](_0x3ba6ec){this['headerTitle']=_0x3ba6ec;}['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 Yi(this['locale'],vi['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x5ed834=new _0x7ecbb5(this['locale']),_0x8fe831=[];for(let _0x522a1c=0x0;_0x522a1c<0x10;_0x522a1c++){const _0x589b37=this['_createSkeletonLoader']();_0x589b37['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-run-skeleton-item']}}),_0x8fe831['push'](_0x589b37);}return _0x5ed834['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x2af3a9=>!_0x2af3a9)]},'children':_0x8fe831}),_0x5ed834;}['_createErrorView'](){const _0x3edcab=new _0x7ecbb5(this['locale']),_0x4af317=new _0x155a80(this['locale']),t=this['locale']['t'];return _0x3edcab['delegate']('retryReview')['to'](this),_0x4af317['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-error-retry-button'}),_0x4af317['on']('execute',()=>{this['fire']('retryReview');}),_0x3edcab['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x215b06=>!_0x215b06),this['bindTemplate']['if']('errorType','ck-ai-review-mode__check-run-error-container_border-bottom',_0x4753a5=>'chunk'===_0x4753a5)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-chat-error','ck-ai-chat-error_full-width','ck-ai-review-mode__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-chat-error_warning',_0x2fdc22=>'chunk'===_0x2fdc22)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0xb13599=>'general'!==_0xb13599)]},'children':[{'text':p(this['locale'],'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}]},{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x5015b5=>'chunk'!==_0x5015b5)]},'children':[{'text':p(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x4af317]}),_0x3edcab;}['_createCancelButtonView'](){const _0x2e7add=new _0x155a80(this['locale']);return _0x2e7add['set']({'label':p(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ai-chat-controls-loader__cancel-button'],'icon':_0x3a9ce7}),_0x2e7add['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x1f0c3f=>_0x1f0c3f)]}}),_0x2e7add['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x2e7add;}['_createToggleDiffButtonView'](){const _0x29765e=new _0x155a80(this['locale']);_0x29765e['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x29765e['bind']('isEnabled')['to'](this,'isError',_0x32dfc2=>!_0x32dfc2),_0x29765e['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x89e184=>!_0x89e184)]}});const _0x45639f=p(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x5641c2=p(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x29765e['bind']('isOn')['to'](this,'isToggleDiffOn',_0x38ea2d=>_0x38ea2d),_0x29765e['bind']('icon')['to'](this,'isToggleDiffOn',_0x20fa5f=>_0x20fa5f?_0x2ae657:_0x30fec7),_0x29765e['bind']('label')['to'](this,'isToggleDiffOn',_0x55d2dc=>_0x55d2dc?_0x45639f:_0x5641c2),_0x29765e['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x29765e;}['_createAcceptAllButtonView'](){const _0x42e429=new _0x155a80(this['locale']);return _0x42e429['set']({'label':p(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x42e429['bind']('isEnabled')['to'](this,'isError',_0x535cea=>!_0x535cea),_0x42e429['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai-review-mode__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x71e796=>!_0x71e796)]}}),_0x42e429['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x42e429;}['_createExitReviewButtonView'](){const _0x2447c8=new _0x155a80(this['locale']);return _0x2447c8['set']({'label':p(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x2447c8['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x14385d=>!_0x14385d)]}}),_0x2447c8['on']('execute',()=>{this['fire']('leaveReviewModeResultList');}),_0x2447c8;}['_createResultHeaderView'](){const _0x1ffb68=new _0x7ecbb5(this['locale']),_0x14f12b=new Si();return _0x14f12b['bind']('isVisible')['to'](this,'isResultReady',_0x191e3a=>!_0x191e3a),_0x1ffb68['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-buttons']},'children':[_0x14f12b,this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView']]}]}),_0x1ffb68;}}class Js extends _0x7baab6{['resultsHeader'];['_finishReviewButtonView'];constructor(_0xd6bc98){super(_0xd6bc98),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['resultsHeader']=this['_createResultHeaderView']();const _0x7a1daa=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed',_0x7a1daa['if']('isVisible','ck-hidden',_0x150708=>!_0x150708)]},'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':p(_0xd6bc98,'AI_REVIEW_MODE_COMPLETED_TEXT')}]}]}]});}['_createFinishReviewButtonView'](){const _0x31e49d=new _0x155a80(this['locale']);return _0x31e49d['set']({'label':p(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x31e49d['on']('execute',()=>{this['fire']('finishReview');}),_0x31e49d;}['_createResultHeaderView'](){const _0x5295cd=new _0x7ecbb5(this['locale']);return _0x5295cd['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':p(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x5295cd;}}class se extends _0x7ecbb5{['reviewModeHeader'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x20c391){super(_0x20c391),this['reviewModeHeader']=new _0xd9d6ea(_0x20c391,{'label':'Review\x20Mode','icon':te,'class':'ck-ai-header\x20ck-ai-header_review-mode'}),this['reviewCheckListView']=new Gs(_0x20c391),this['reviewCheckListView']['delegate'](...Hs)['to'](this),this['reviewCheckResultsView']=new qs(_0x20c391),this['reviewCheckResultsView']['delegate'](...Hs)['to'](this),this['reviewCompletedView']=new Js(_0x20c391),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-content\x20','ck-reset_all','ck-ai-review-mode','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewModeHeader'],this['reviewCheckListView'],this['reviewCheckResultsView'],this['reviewCompletedView']]});}['showReviewCheckListView'](){this['reviewCheckListView']['resetAllParameterizedChecks'](),this['reviewCheckListView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1);}['showReviewCheckResultsView'](){this['hideActionsWhenResultIsReady'](),this['reviewCheckResultsView']['resetErrorState'](),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['clearResults'](),this['reviewCheckResultsView']['set']('isLoading',!0x0);}['addCheckRunResult'](_0x2ff06a){this['reviewCheckResultsView']['addResult'](_0x2ff06a),this['reviewCheckResultsView']['set']('isLoading',!0x1);}['showReviewCompletedView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x0);}['showActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x0;}['hideActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x1;}['showGeneralErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}const Hs=['getReviewCheckList','runReviewCheck','runCustomCheckReview','cancelCustomCheck','setCustomCheckModel','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewModeResultList','scrollToSuggestionInDocument','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ie extends _0x316379{['_reviewModeView'];static get['requires'](){return[et];}static get['pluginName'](){return'AIReviewModeUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2d2bec){super(_0x2d2bec),this['_reviewModeView']=new se(this['context']['locale']),this['_reviewModeView']['delegate'](...Hs)['to'](this);}['init'](){const _0x534ca1=this['context']['plugins']['get']('AITabs');_0x534ca1['view']['on']('activateTab',(_0x428e84,_0x5e98d0)=>{'reviewMode'===_0x5e98d0?this['fire']('getReviewCheckList'):this['fire']('leaveReviewMode');}),_0x534ca1['view']['addTab']({'id':'reviewMode','buttonLabel':'Review\x20Mode','buttonIcon':te,'order':0x0,'content':this['_reviewModeView']});}['setAvailableChecks'](_0x5607fd){this['_reviewModeView']['reviewCheckListView']['hasChecks']()||this['_reviewModeView']['reviewCheckListView']['setChecks'](_0x5607fd),this['_reviewModeView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x5b4d5b){_0x5b4d5b&&('error-general'!==_0x5b4d5b['status']?'error-chunk'!==_0x5b4d5b['status']?this['_reviewModeView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralErrorView']());}['showCheckRunResult'](_0x174196){this['_reviewModeView']['addCheckRunResult'](_0x174196);}['showGeneralErrorView'](){this['_reviewModeView']['showGeneralErrorView']();}['showChunkErrorView'](){this['_reviewModeView']['showChunkErrorView']();}['setCheckResultTitle'](_0x2c9d51){this['_reviewModeView']['reviewCheckResultsView']['setTitle'](_0x2c9d51);}['resetActiveStateInResults'](){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x3e5783=>_0x3e5783['setItemAsInactive']());}['updateChangeState'](_0x108fab,_0x53aa74){'accepted'!==_0x53aa74&&'rejected'!==_0x53aa74||this['_reviewModeView']['reviewCheckResultsView']['hideResult'](_0x108fab);}['showReviewCompletedView'](){this['_reviewModeView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_reviewModeView']['showActionsWhenResultIsReady']();}['hideActionsWhenResultIsReady'](){this['_reviewModeView']['hideActionsWhenResultIsReady']();}}const Zt='reviewmode-';class re extends _0x316379{static get['pluginName'](){return'AIReviewModeEditing';}static get['requires'](){return[_0x1df88e,a];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['afterInit'](){const _0x527c72=tt(this['context']);_0x527c72['conversion']['for']('editingDowncast')['markerToElement']({'model':Zt+'insert','view':(_0x1e5b33,{writer:_0x413f8a})=>{const _0x10ac41=this['_markers']['get'](_0x1e5b33['markerName']);return _0x413f8a['createUIElement']('span',{'class':'ck-ai_review-mode-marker_add'},function(_0x25a644){const _0x195ef8=this['toDomElement'](_0x25a644);return _0x195ef8['innerHTML']=_0x10ac41?.['text']||'',_0x195ef8;});}}),_0x527c72['conversion']['for']('dataDowncast')['markerToElement']({'model':Zt+'suggestion-context','view':(_0x25f195,{writer:_0x17a816})=>_0x17a816['createRawElement']('span',{'class':'ck-ai_review-mode-marker_context-'+(_0x25f195['isOpening']?'start':'end')})}),_0x527c72['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Zt+'remove-only','view':()=>({'classes':'ck-ai_review-mode-marker_strikethrough'})}),_0x527c72['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Zt+'remove-context','view':()=>({'classes':'ck-ai_review-mode-marker_underline'})}),_0x527c72['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Zt+'remove-text','view':()=>({'classes':'ck-ai_review-mode-marker_hide'})}),_0x527c72['conversion']['for']('downcast')['attributeToAttribute']({'model':_0xc2e267,'view':Xt});}['getDocumentData'](){const _0x98fcf5=this['context']['plugins']['get']('AIEditing'),_0x13b3a4=tt(this['context']),_0x3d57b2=_0x13b3a4['model'],_0x3fb287=new _0x576a41();for(const _0x998e76 of _0x3d57b2['document']['getRoot']()['getChildren']()){const _0x5c4dc3=_0x998e76['_clone'](!0x0);_0x3fb287['_appendChild'](_0x5c4dc3);}for(const _0x4359c2 of _0x3d57b2['markers'])_0x3fb287['markers']['set'](_0x4359c2['name'],this['_changeRangeOwnerDocument'](_0x4359c2['getRange']()['clone'](),_0x3fb287));const _0x969a22=new Vt({'ignoreElementEnd':!0x0,'startPosition':_0x3d57b2['createPositionAt'](_0x3fb287,0x0)}),_0x2d18bd=new Set(),_0x30a422=new Map();for(const {item:_0x32a6ae}of _0x969a22){if(!_0x32a6ae['is']('$textProxy'))continue;const _0x6acb05=_0x32a6ae['parent'];if((!_0x6acb05||!_0x6acb05['is']('element','caption'))&&(_0x6acb05&&_0x6acb05['is']('element'))){let _0x1114bd=_0x6acb05['getAttribute'](_0xc2e267);_0x1114bd||(_0x1114bd=_0x98fcf5['_nextDataId'](_0x2d18bd),_0x6acb05['_setAttribute'](_0xc2e267,_0x1114bd)),_0x2d18bd['add'](_0x1114bd);const _0x4f134d=this['_getTopElement'](_0x6acb05);_0x30a422['set'](_0x1114bd,{'path':_0x6acb05['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x4f134d['_clone'](!0x0),_0x1114bd,_0x13b3a4['data'])}),_0x969a22['jumpTo'](_0x3d57b2['createPositionAfter'](_0x6acb05));}}return{'content':_0x13b3a4['data']['processor']['toData'](_0x13b3a4['data']['toView'](_0x3fb287)),'version':_0x13b3a4['model']['document']['version'],'elements':_0x30a422};}['diffContent'](_0x4c50f7,_0x59f17f){const _0x2ace5f=tt(this['context']),_0xaa4331=_0x2ace5f['data']['parse'](_0x4c50f7,'$documentFragment'),_0x5424f6=_0x2ace5f['model']['createPositionAt'](_0xaa4331,0x0),_0xdeba86=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x4c50f7,_0x59f17f,{'anchor':_0x5424f6,'markDeletions':!0x0})['getOperations']()['filter'](_0x2f242f=>'insert'===_0x2f242f['type']||'marker'===_0x2f242f['type']&&_0x2f242f['name']['startsWith']('$markedRemove')),_0x2bd648=this['_groupAdjacentOperations'](_0xdeba86),_0x576896=[];let _0x288659=0x0;return _0x2ace5f['model']['change'](_0x57cdc7=>{for(let _0x265f4b=0x0;_0x265f4b<_0x2bd648['length'];_0x265f4b++){const _0x1f9d87=_0x2bd648[_0x265f4b],_0x378c8e=_0x57cdc7['createDocumentFragment']();for(const _0x1ae567 of _0xaa4331['getChildren']())_0x57cdc7['append'](_0x1ae567['_clone'](!0x0),_0x378c8e);for(const _0x598045 of _0x1f9d87['operationsIsolated'])if('insert'===_0x598045['type']){const _0x578c4a=_0x598045;_0x578c4a['baseVersion']=null,_0x578c4a['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x578c4a,_0x378c8e),_0x57cdc7['batch']['addOperation'](_0x598045),_0x2ace5f['model']['applyOperation'](_0x598045);const _0x2bf9b1='suggestion:insertion:id:authorId:'+_0x288659++,_0x2d4362=_0x2ace5f['model']['createRange'](_0x578c4a['position'],_0x578c4a['position']['getShiftedBy'](_0x578c4a['howMany']));_0x378c8e['markers']['set'](_0x2bf9b1,_0x2d4362);}else{if('marker'===_0x598045['type']&&_0x598045['name']['startsWith']('$markedRemove')){const _0x2009a6=_0x598045,_0x3101a0='suggestion:deletion:id:authorId:'+_0x288659++;this['_changeOperationOwnerDocument'](_0x2009a6,_0x378c8e),_0x378c8e['markers']['set'](_0x3101a0,_0x2009a6['newRange']);}}const _0x2d74ce=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x1f9d87['operationsIsolated'][0x0]),_0x378c8e),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x1f9d87['operationsIsolated'][_0x1f9d87['operationsIsolated']['length']-0x1]),_0x378c8e));_0x378c8e['markers']['set'](Zt+'suggestion-context',new _0xd5274c(_0x2d74ce['start'],_0x2d74ce['end'])),_0x576896['push']({..._0x1f9d87,'context':this['_createGetContextFn'](_0x378c8e,_0x2ace5f['data'],{'ellipsisBefore':_0x2d74ce['hasContentBefore'],'ellipsisAfter':_0x2d74ce['hasContentAfter']}),'content':this['_createGetContentFn'](_0x378c8e,_0x2ace5f['data'])});}}),_0x576896;}['markChangePositionInEditorContent'](_0x388198,_0x81f801){const _0x3a8483=_0x388198[0x0]['parent']['id'],_0x1d3b9b=_0x81f801['elements']['get'](_0x3a8483);if(!_0x1d3b9b)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x3a8483);const _0x3f39aa=_0x1d3b9b['path'],_0x2409e3=tt(this['context']),_0x697102=_0x2409e3['model']['document']['history']['getOperations'](_0x81f801['version']),_0x38afc2=[];for(const _0x5eb41d of _0x388198){const _0x40d7fb=_0x5eb41d['operationsIsolated']['map'](_0x173c4f=>this['_translateOperationToEditorContent'](_0x173c4f,_0x3f39aa,_0x2409e3['model']['document']['getRoots']()[0x0]));if(!_0x40d7fb||!_0x40d7fb['length'])continue;const _0x58b376=_0x40d7fb['every'](_0x1a46a5=>'marker'===_0x1a46a5['type']&&_0x1a46a5['name']['startsWith']('$markedRemove')),_0x377834={'document':_0x2409e3['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x12a22b=_0x59f1a9(_0x40d7fb,_0x697102,_0x377834)['operationsA'];for(const _0x5a04ae of _0x12a22b)if('insert'===_0x5a04ae['type']){const _0x104811=_0x5a04ae,_0x388d85=_0x104811['nodes'];let _0x1c9235='';for(const _0x2b1463 of _0x388d85)_0x2b1463&&_0x2b1463['is']('model:$text')&&(_0x1c9235+=_0x2b1463['data']);_0x38afc2['push']({'start':_0x104811['position'],'end':_0x104811['position'],'type':'insert','groupId':_0x5eb41d['id'],'text':_0x1c9235});}else{if('marker'===_0x5a04ae['type']&&_0x5a04ae['name']['startsWith']('$markedRemove')){const _0x3a2798=_0x5a04ae;let _0x446572='remove-text';if(_0x58b376){const _0x3ba12c=this['_findAdjacentContextDistance'](_0x3a2798['newRange']['start'],'backward',_0x2409e3['model']['schema']),_0x58a081=this['_findAdjacentContextDistance'](_0x3a2798['newRange']['end'],'forward',_0x2409e3['model']['schema']);if(_0x3ba12c||_0x58a081){const _0x30572a=_0x3a2798['newRange']['start']['getShiftedBy'](-_0x3ba12c),_0x23dd08=_0x3a2798['newRange']['end']['getShiftedBy'](_0x58a081);_0x38afc2['push']({'start':_0x30572a,'end':_0x23dd08,'groupId':_0x5eb41d['id'],'type':'remove-context'});}else _0x446572='remove-only';}_0x38afc2['push']({'start':_0x3a2798['newRange']['start'],'end':_0x3a2798['newRange']['end'],'groupId':_0x5eb41d['id'],'type':_0x446572});}}}this['_insertMarkers'](_0x38afc2);}['clearAllMarkers'](){tt(this['context'])['model']['change'](_0x46a9c2=>{for(const _0x9c303e of this['_markers']['keys']())_0x46a9c2['removeMarker'](_0x9c303e);}),this['_markers']['clear']();}['switchToReadOnly'](){tt(this['context'])['enableReadOnlyMode']('ai-review-mode');}['switchToEdit'](){tt(this['context'])['disableReadOnlyMode']('ai-review-mode');}['applyChange'](_0x80e449){const _0x2ced13=tt(this['context']),_0x27f072=_0x2ced13['model'],_0x4b7b3d=this['_getMarkersDataForGroup'](_0x80e449);_0x27f072['change'](_0x2f61eb=>{for(const _0xa6b316 of _0x4b7b3d){const _0x2b1d42=_0x2ced13['model']['markers']['get'](_0xa6b316['id']);_0x2b1d42&&('insert'===_0xa6b316['type']?_0x27f072['insertContent'](_0x2f61eb['createText'](_0xa6b316['text']||''),_0x2b1d42['getRange']()['start']):'remove-text'!==_0xa6b316['type']&&'remove-only'!==_0xa6b316['type']||_0x27f072['deleteContent'](_0x27f072['createSelection'](_0x2b1d42['getRange']())),_0x2f61eb['removeMarker'](_0xa6b316['id']),this['_markers']['delete'](_0xa6b316['id']));}});}['rejectChange'](_0x9d61a5){const _0x14eeaf=tt(this['context']),_0x4e9dba=this['_getMarkersDataForGroup'](_0x9d61a5);_0x14eeaf['model']['change'](_0x5e2a50=>{for(const _0x2a511e of _0x4e9dba)_0x5e2a50['removeMarker'](_0x2a511e['id']),this['_markers']['delete'](_0x2a511e['id']);});}['getContentElement'](){const _0x2b5b1d=tt(this['context']);return _0x2b5b1d&&_0x2b5b1d['ui']&&_0x2b5b1d['ui']['element']?_0x2b5b1d['ui']['element']:null;}['_translateOperationToEditorContent'](_0x250a9b,_0x2ce94b,_0x47145a){if('insert'===_0x250a9b['type']){const _0x5ecac4=_0x250a9b;return new $t(this['_changePosition'](_0x5ecac4['position'],_0x2ce94b['concat'](_0x5ecac4['position']['offset']),_0x47145a),_0x5ecac4['nodes'],_0x5ecac4['baseVersion']);}if('marker'===_0x250a9b['type']&&_0x250a9b['name']['startsWith']('$markedRemove')){const _0x4cb371=_0x250a9b;return new Bt(_0x4cb371['name'],_0x4cb371['oldRange'],this['_changeRange'](_0x4cb371['newRange'],_0x2ce94b['concat'](_0x4cb371['newRange']['start']['offset']),_0x2ce94b['concat'](_0x4cb371['newRange']['end']['offset']),_0x47145a),_0x4cb371['_markers'],_0x4cb371['affectsData'],_0x4cb371['baseVersion']);}return _0x250a9b;}['_groupAdjacentOperations'](_0x1cc1af){if(!_0x1cc1af['length'])return[];const _0x4d3982=[];let _0x18c614=0x0,_0x1293e7=0x0,_0x488bd8=[];for(let _0x243241=0x0;_0x243241<=_0x1cc1af['length'];_0x243241++){const _0xfd8e0=_0x1cc1af[_0x243241],_0x4e6d12=_0x1cc1af[_0x243241-0x1];!_0xfd8e0||_0x4e6d12&&!this['_getOperationEnd'](_0x4e6d12)['isTouching'](this['_getOperationStart'](_0xfd8e0))?(_0x4d3982['push']({'operations':_0x488bd8,'operationsIsolated':_0x488bd8['map'](_0x4c64b5=>this['_shiftOperation'](_0x4c64b5['clone'](),-_0x1293e7)),'groupOffset':_0x18c614}),_0x488bd8=_0xfd8e0?[_0xfd8e0]:[],_0x1293e7+=_0x18c614,_0x18c614=0x0):_0x488bd8['push'](_0xfd8e0),_0xfd8e0&&'insert'===_0xfd8e0['type']&&(_0x18c614+=_0xfd8e0['howMany']);}return _0x4d3982;}['scrollToChangeInEditorContent'](_0x1b9a7d){console['log']('Scroll\x20to\x20change\x20in\x20editor\x20content',_0x1b9a7d['id']);}['_findAdjacentContextDistance'](_0x16e195,_0x4003a2,_0x4e275c,_0x5931ff=0x1){const _0x3e3b10=new Vt({'startPosition':_0x16e195,'direction':_0x4003a2});let _0x423b8a=0x0;for(let _0x113234=0x0;_0x113234<_0x5931ff;_0x113234++){let _0x4bd0d0=0x0,_0xa6fe8c=!0x1,_0x54b912='forward'===_0x4003a2?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x125867}of _0x3e3b10)if(_0x125867['is']('$textProxy')){const _0x417207=_0x54b912['exec'](_0x125867['data']);if(_0x417207&&_0x417207['length']){if(_0x4bd0d0+='forward'===_0x4003a2?_0x417207['index']+_0x417207[0x0]['length']:_0x125867['data']['length']-_0x417207['index'],_0x417207[0x0]['length']!==_0x125867['data']['length'])break;_0xa6fe8c=!0x0,_0x54b912='forward'===_0x4003a2?/^\w+/:/\w+$/;}else{if(_0xa6fe8c)break;_0x4bd0d0+=_0x125867['offsetSize'];}}else{if(_0x125867['is']('element')){_0x4e275c['isInline'](_0x125867)&&!_0xa6fe8c&&(_0x4bd0d0+=0x1);break;}}_0x423b8a+=_0x4bd0d0,_0x3e3b10['jumpTo'](_0x16e195['getShiftedBy']('forward'===_0x4003a2?_0x423b8a:-_0x423b8a));}return _0x423b8a;}['_getChangeContext'](_0x34835c,_0x1d968e){const _0x1aa688=tt(this['context'])['model']['schema'],_0x15cb02=this['_findAdjacentContextDistance'](_0x34835c,'backward',_0x1aa688,0x6),_0x411964=this['_findAdjacentContextDistance'](_0x1d968e,'forward',_0x1aa688,0x6),_0x48e9e7=_0x34835c['getShiftedBy'](-_0x15cb02),_0x520a31=_0x1d968e['getShiftedBy'](_0x411964);return{'start':_0x48e9e7,'end':_0x520a31,'hasContentBefore':!_0x48e9e7['isAtStart'],'hasContentAfter':!_0x520a31['isAtEnd']};}['_insertMarkers'](_0x253161){tt(this['context'])['model']['change'](_0x2c97ea=>{for(const _0x52b023 of _0x253161){const _0x4983ad=''+Zt+_0x52b023['type']+':'+_0x52b023['groupId']+'_'+_0x2458fa();this['_markers']['set'](_0x4983ad,{'id':_0x4983ad,'groupId':_0x52b023['groupId'],'type':_0x52b023['type'],'text':_0x52b023['text']}),_0x2c97ea['addMarker'](_0x4983ad,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2c97ea['createRange'](_0x52b023['start'],_0x52b023['end'])});}});}['_createGetContextFn'](_0x456437,_0x37b1f6,_0x3be52a){let _0x56c99b='';return()=>{if(!_0x56c99b){const _0x19c91d=_0x37b1f6['toView'](_0x456437,{'showSuggestionHighlights':!0x0}),_0x3ece7d=_0x19c91d['getChild'](0x0);if(!_0x3ece7d)return'';let _0xdafa4f=!0x1;const _0xcf6202=[];for(const _0x1c6874 of _0x3ece7d['getChildren']())_0x1c6874['is']('element','span')&&_0x1c6874['hasClass']('ck-ai_review-mode-marker_context-end')&&(_0xdafa4f=!0x1),_0xdafa4f&&_0xcf6202['push'](_0x1c6874),_0x1c6874['is']('element','span')&&_0x1c6874['hasClass']('ck-ai_review-mode-marker_context-start')&&(_0xdafa4f=!0x0);_0x3ece7d['_removeChildren'](0x0,_0x3ece7d['childCount']),_0x3be52a?.['ellipsisBefore']&&_0x3ece7d['_appendChild']('…'),_0x3ece7d['_appendChild'](_0xcf6202),_0x3be52a?.['ellipsisAfter']&&_0x3ece7d['_appendChild']('…');const _0x283d48=_0x37b1f6['htmlProcessor']['domConverter']['viewToDom'](_0x19c91d),_0xcddab4=_0x37b1f6['htmlProcessor']['htmlWriter']['getHtml'](_0x283d48);_0x56c99b=_0xcddab4;}return _0x56c99b;};}['_createGetContentFn'](_0x220150,_0x4249cc){let _0x1120a2='';return()=>(_0x1120a2||(_0x1120a2=_0x4249cc['stringify'](_0x220150,{'showSuggestionHighlights':!0x0})),_0x1120a2);}['_createGetContentUsingDataIdFn'](_0x7e230c,_0x1a6ad6,_0x2f9060){let _0x36e4ff='';return()=>{if(!_0x36e4ff){const _0x5dd6c2=_0x2f9060['toView'](new _0x576a41(_0x7e230c)),_0x32b670=_0x2f9060['htmlProcessor']['domConverter']['viewToDom'](_0x5dd6c2)['querySelector']('[data-id=\x22'+_0x1a6ad6+'\x22]');_0x36e4ff=_0x32b670?.['outerHTML']||'';}return _0x36e4ff;};}['_getMarkersDataForGroup'](_0x364c73){return Array['from'](this['_markers']['values']())['filter'](_0xbaacce=>_0xbaacce['groupId']===_0x364c73);}['_getOperationStart'](_0x428699){return'insert'===_0x428699['type']?_0x428699['position']:_0x428699['newRange']['start'];}['_getOperationEnd'](_0x32f761,_0x17a891=!0x1){return'insert'===_0x32f761['type']?_0x17a891?_0x32f761['position']:_0x32f761['position']['getShiftedBy'](_0x32f761['howMany']):_0x32f761['newRange']['end'];}['_shiftOperation'](_0x558bf6,_0x2c5cac){return'insert'===_0x558bf6['type']?_0x558bf6['position']=_0x558bf6['position']['getShiftedBy'](_0x2c5cac):'marker'===_0x558bf6['type']&&_0x558bf6['newRange']&&(_0x558bf6['newRange']=new _0xd5274c(_0x558bf6['newRange']['start']['getShiftedBy'](_0x2c5cac),_0x558bf6['newRange']['end']['getShiftedBy'](_0x2c5cac))),_0x558bf6;}['_changeOperationOwnerDocument'](_0x55b4f7,_0x55a68a){'insert'===_0x55b4f7['type']?_0x55b4f7['position']=this['_changePositionOwnerDocument'](_0x55b4f7['position'],_0x55a68a):'marker'===_0x55b4f7['type']&&_0x55b4f7['newRange']&&(_0x55b4f7['newRange']=this['_changeRangeOwnerDocument'](_0x55b4f7['newRange'],_0x55a68a));}['_changePositionOwnerDocument'](_0x4e401b,_0x4e4f15){return new _0x5dfdfe(_0x4e4f15,_0x4e401b['path']);}['_changeRangeOwnerDocument'](_0x1fe3e6,_0x5e9804){return new _0xd5274c(this['_changePositionOwnerDocument'](_0x1fe3e6['start'],_0x5e9804),this['_changePositionOwnerDocument'](_0x1fe3e6['end'],_0x5e9804));}['_changePosition'](_0x47907c,_0x4497db,_0x4383b6){return new _0x5dfdfe(_0x4383b6,[..._0x4497db]);}['_changeRange'](_0x26ce9c,_0x1fd9ed,_0x47d542,_0x48b6a1){return new _0xd5274c(this['_changePosition'](_0x26ce9c['start'],_0x1fd9ed,_0x48b6a1),this['_changePosition'](_0x26ce9c['end'],_0x47d542,_0x48b6a1));}['_getTopElement'](_0x27d3bd){let _0x36de6a=_0x27d3bd;for(;_0x36de6a['parent']&&!_0x36de6a['parent']['is']('documentFragment');)_0x36de6a=_0x36de6a['parent'];return _0x36de6a;}}class Ca extends _0x316379{static get['requires'](){return[ee,ie,re];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{wa as AIActions,H as AIAdapter,Un as AIAssistant,b as AIAssistantUI,m as AIBalloon,Aa as AIChat,st as AIChatController,nt as AIChatHistory,rt as AIChatHistoryController,it as AIChatHistoryUI,ct as AIChatUI,o as AIConnector,a as AIEditing,oi as AIQuickActionType,Ta as AIQuickActions,ii as AIQuickActionsUI,tr as AIRequestError,vs as AIReviewCheck,Cs as AIReviewCheckResult,xs as AIReviewCheckRun,Ca as AIReviewMode,ee as AIReviewModeController,re as AIReviewModeEditing,ie as AIReviewModeUI,et as AITabs,ae as AITextAdapter,Bn as AWSTextAdapter,Vn as OpenAITextAdapter,q as ShowAIAssistantCommand,Mi as createResizeButton,Gn as getDefaultAICommands};
23
+ import{Plugin as _0x7bae57,Command as _0x5c5b2b,ContextPlugin as _0x599126,Editor as st}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x17dd7a,IconCheck as _0x5925f3,IconError as _0x533a4a,IconSubmit as _0x52ed9a,IconAIHistory as Ht,IconMagicWand as _0x4363b9,IconRobotPencil as _0x4d2262,IconMaximize as _0xb46797,IconMinimize as _0x5be3af,IconShowChangesOn as _0x2604e8,IconShowChangesOff as _0x1905f2,IconDocument as _0x321efe,IconThreeStars as _0x4e12c0,IconDocumentWithLoupe as _0x181172,IconAddComment as _0x5e145c,IconRemove as _0x9987f2,IconDocumentWithCheckmark as _0x53e681,IconDocumentWithCross as _0xa559ff,IconLoupe as _0x316a56,IconCancel as _0x3e418d,IconStop as _0xb72389,IconAIChat as St,IconPlus as _0x436496,IconPin as _0x5dea9e,IconThreeHorizontalDots as _0x1d338a,IconChevronRight as _0x574689,IconInfo as _0x44e506,IconEye as _0x7ee4b2,IconEyeCrossedOut as _0x3d5ebf,IconAIReview as te}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x91fc81,CKEditorError as _0x1cd47d,ObservableMixin as _0x12a324,global as _0xdf3887,isVisible as _0x337ded,Rect as _0x7011f3,Collection as _0x4b15d8,FocusTracker as _0x394dab,KeystrokeHandler as _0x574245,first as _0x478320,toArray as _0xbff00a,EmitterMixin as _0x595595,logWarning as _0x5c57f7,logError as ot,scrollViewportToShowTarget as nt,ResizeObserver as _0x3f0c89,_isMotionReduced as At}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x4eccef,ButtonView as _0x21c9df,View as _0x2855e5,SpinnerView as _0x2c54b2,IconView as _0x32fdce,AutocompleteView as _0x9fb4bb,ListView as _0x11ab26,ListItemGroupView as _0x20b6e0,ListItemView as _0x522072,ButtonLabelView as _0x32d8ec,FocusCycler as _0x920639,createLabeledTextarea as _0x43f4ed,Dialog as _0x378cc4,createDropdown as _0x372e42,addMenuToDropdown as _0x1e6403,MenuBarMenuView as _0x3154a9,MenuBarMenuListItemButtonView as _0x2cadf2,DialogViewPosition as _0x33ca1e,MenuBarMenuListView as _0x38e1f4,MenuBarMenuListItemView as _0x663667,ViewCollection as _0x1cd988,UIModel as _0x38340d,SplitButtonView as _0x2a87cb,BalloonPanelView as _0x2b3342,BodyCollection as Gt,clickOutsideHandler as _0x4a2e91,ListItemButtonView as _0x654325,addListToDropdown as _0x2c3e65,submitHandler as _0x877d59,LabeledFieldView as th,createLabeledInputText as _0x30a4cf,FormHeaderView as _0x12296e,HighlightedTextView as _0x675684,FileDialogButtonView as _0x56cac2,InputTextView as _0x478267,SearchTextView as _0x1847ad,DropdownMenuButtonView as _0x60226e,DropdownMenuPanelPositioningFunctions as _0x14a127,BalloonToolbar as Ft,FormRowView as _0x179ea8,TextareaView as _0x18b24e}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x371128,ClipboardMarkersUtils as _0x74fda4}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x312164,ViewDataTransfer as _0x3e32f8,ViewUpcastWriter as _0x78b7b1,Matcher as _0x420952,ViewDowncastWriter as kt,transformOperationSets as tt,_DetachOperation as ut,_insertIntoModelNodeList as _0x159c8d,_removeFromModelNodeList as _0x1ac001,ModelRange as _0x27581,ModelDocumentFragment as _0x2ffe67,ModelPosition as _0x5764e0,ModelTreeWalker as Vt,InsertOperation as $t,MarkerOperation as Bt}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x5080fe,escape as _0x5787f6,escapeRegExp as _0x2a9c5e}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x21ad39,InvokeModelWithResponseStreamCommand as _0x57c849,InvokeModelCommand as _0x433d40}from'@aws-sdk/client-bedrock-runtime';import{createParser as wt}from'eventsource-parser';import{parseDocument as _0x597dd1}from'htmlparser2';import{isTag as _0x1d4fa0,findOne as mt,getParent as _0x5c004e,findAll as _0x221490,removeElement as _0x37bdbe,replaceElement as _0x4afbf8,prepend as _0x5c380d,prependChild as to,appendChild as _0x2ef3de,append as _0x533ed6,find as _0x431688,isComment as _0x5bcd8b,getChildren as _0x39c5f5,textContent as _0x5b4ac3}from'domutils';import _0x390fc6 from'dom-serializer';import{Document as _t,Element as _0x450b1b,Text as _0x507fb9,cloneNode as _0x25db6a,isDocument as tn,isText as _0x45a4f5,NodeWithChildren as _0x3a85d9}from'domhandler';import{MarkdownGfmMdToHtml as _0x5a0af8}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{getAllMarkersDomElementsSorted as _0x373e3f,DocumentCompare as _0x49b43e,DATA_ID_MODEL_ATTRIBUTE as lt}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import{IconThumbUp as _0x260ffb,IconThumbDown as _0x257711,IconCopy as _0x1bf67a,IconCheck as _0x110ca0,IconShowChangesOff as _0x134bf2,IconShowChangesOn as _0x5da362,IconWeb as _0x64b6,IconNextArrow as _0x59602d,IconPreviousArrow as _0x582b36,IconAI as yt,IconClose as _0x335422,IconSelection as _0x143e00,IconFileUpload as _0x5e2d28,IconLink as _0x9712c4,IconDocument as _0x6fa3f4,IconBulb as _0x377e6c,IconDocumentOutline as _0x28ce25,IconPaperClip as _0x1b9f37,IconBrowseFiles as _0x515ed8,IconDropdownArrow as _0x353881,IconAIQuickActions as _0x3aa5f2,IconAIAskAI as Qt,IconAIChatCommands as Ut,IconAIImproveWriting as Mt,IconAIContinueWriting as bt,IconAIGrammarCheck as Kt,IconAIAdjustLength as Nt,IconAIChangeTone as Ot,IconAITranslate as Dt,IconAIOther as Lt,IconRefresh as _0x42a35d}from'@ckeditor/ckeditor5-icons/dist/index.js';import _0xe626fc from'morphdom';import{ConfirmMixin as _0x87b2d,LateFocusDropdownButtonView as _0x49a486,DocumentCompare as _0x15d52a,DATA_ID_VIEW_ATTRIBUTE as Xt,DATA_ID_MODEL_ATTRIBUTE as _0x51a6d7}from'ckeditor5-collaboration/dist/index.js';const K='_ungrouppedCommands';function o(_0x7020bf,_0x541058){const _0x348ef6=(0x0,_0x541058['t'])('Other');return _0x7020bf['length']?'groupId'in _0x7020bf[0x0]?_0x7020bf:[{'groupId':K,'groupLabel':_0x348ef6,'order':0x1/0x0,'commands':_0x7020bf}]:[{'groupId':K,'groupLabel':_0x348ef6,'order':0x1/0x0,'commands':[]}];}const Ln=globalThis['DataTransfer'],w='ai-ui';class a extends _0x7bae57{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x2408c5}=this,_0x1b43a3=['ck-fake-ai-selection'];_0x2408c5['config']['get']('ai.assistant.useTheme')&&_0x1b43a3['push']('ck-ai-assistant-ui_theme'),_0x2408c5['conversion']['for']('editingDowncast')['markerToHighlight']({'model':w,'view':{'classes':_0x1b43a3,'priority':0xc}}),_0x2408c5['conversion']['for']('editingDowncast')['markerToElement']({'model':w,'view':(_0x556778,{writer:_0x22e0b0})=>{if(!_0x556778['markerRange']['isCollapsed'])return null;const _0x84057d=_0x22e0b0['createUIElement']('span');return _0x22e0b0['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x84057d),_0x84057d;}});}['afterInit'](){!async function(_0x3b178a){const _0x1e017a=_0x5b7be9([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]),_0x31e322=0x3dffc4e1,_0x378e79=0x3df8b099^_0x31e322,_0x14032a=window[_0x5b7be9([0x44,0x61,0x74,0x65])][_0x5b7be9([0x6e,0x6f,0x77])](),_0x5d0eca=_0x3b178a[_0x5b7be9([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x568d07=new window[(_0x5b7be9([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1038f1=>{_0x5d0eca[_0x5b7be9([0x6f,0x6e,0x63,0x65])](_0x5b7be9([0x72,0x65,0x61,0x64,0x79]),_0x1038f1);}),_0x31af8d={[_0x5b7be9([0x6b,0x74,0x79])]:_0x5b7be9([0x45,0x43]),[_0x5b7be9([0x75,0x73,0x65])]:_0x5b7be9([0x73,0x69,0x67]),[_0x5b7be9([0x63,0x72,0x76])]:_0x5b7be9([0x50,0x2d,0x32,0x35,0x36]),[_0x5b7be9([0x78])]:_0x5b7be9([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]),[_0x5b7be9([0x79])]:_0x5b7be9([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]),[_0x5b7be9([0x61,0x6c,0x67])]:_0x5b7be9([0x45,0x53,0x32,0x35,0x36])},_0x3fb890=_0x5d0eca[_0x5b7be9([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x5b7be9([0x67,0x65,0x74])](_0x5b7be9([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0xc2ff32(){let _0x6b6d0a,_0x4dd8a4=null,_0x1eedb2=null;try{if(_0x3fb890==_0x5b7be9([0x47,0x50,0x4c]))return _0x5b7be9([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x6b6d0a=_0x1185da(),!_0x6b6d0a)return _0x5b7be9([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x6b6d0a[_0x5b7be9([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x1eedb2=_0x24fcf1(_0x6b6d0a[_0x5b7be9([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x6b6d0a[_0x5b7be9([0x6a,0x74,0x69])])),await _0x4a1298()?_0x3ce418()?_0x12704c()?_0x5b7be9([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x477904()?(_0x6b6d0a[_0x5b7be9([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x5b7be9([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x4dd8a4=_0x94b9c9(_0x5b7be9([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x6b6d0a[_0x5b7be9([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x5b7be9([0x74,0x72,0x69,0x61,0x6c])&&(_0x4dd8a4=_0x94b9c9(_0x5b7be9([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x3fa983()):_0x5b7be9([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x5b7be9([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x5b7be9([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x5b7be9([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x12704c(){const _0x4d1ab6=[_0x5b7be9([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x5b7be9([0x74,0x72,0x69,0x61,0x6c])][_0x5b7be9([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x6b6d0a[_0x5b7be9([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x14032a/0x3e8:0xe10*_0x378e79;return _0x6b6d0a[_0x5b7be9([0x65,0x78,0x70])]<_0x4d1ab6;}function _0x3ce418(){const _0x53b6ba=_0x6b6d0a[_0x5b7be9([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x53b6ba&&(!!_0x53b6ba[_0x5b7be9([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5b7be9([0x2a]))||!!_0x53b6ba[_0x5b7be9([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5b7be9([0x41,0x49])));}function _0x477904(){const _0x14260e=_0x6b6d0a[_0x5b7be9([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x14260e||0x0==_0x14260e[_0x5b7be9([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x1001cb}=new URL(window[_0x5b7be9([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x14260e[_0x5b7be9([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1001cb))return!0x0;const _0x171240=_0x1001cb[_0x5b7be9([0x73,0x70,0x6c,0x69,0x74])](_0x5b7be9([0x2e]));return _0x14260e[_0x5b7be9([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x32c81d=>_0x32c81d[_0x5b7be9([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5b7be9([0x2a])))[_0x5b7be9([0x6d,0x61,0x70])](_0x5ae6d4=>_0x5ae6d4[_0x5b7be9([0x73,0x70,0x6c,0x69,0x74])](_0x5b7be9([0x2e])))[_0x5b7be9([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x439a61=>_0x439a61[_0x5b7be9([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x171240[_0x5b7be9([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x5b7be9([0x6d,0x61,0x70])](_0x1c624c=>Array(_0x171240[_0x5b7be9([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x1c624c[_0x5b7be9([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x5b7be9([0x66,0x69,0x6c,0x6c])](_0x1c624c[0x0]===_0x5b7be9([0x2a])?_0x5b7be9([0x2a]):'')[_0x5b7be9([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x1c624c))[_0x5b7be9([0x73,0x6f,0x6d,0x65])](_0x4f9341=>_0x171240[_0x5b7be9([0x65,0x76,0x65,0x72,0x79])]((_0x5201da,_0x5ea687)=>_0x4f9341[_0x5ea687]===_0x5201da||_0x4f9341[_0x5ea687]===_0x5b7be9([0x2a])));}function _0x3fa983(){return _0x4dd8a4&&_0x1eedb2?new window[(_0x5b7be9([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x5b5336,_0x5eb51d)=>{_0x4dd8a4[_0x5b7be9([0x74,0x68,0x65,0x6e])](_0x5b5336,_0x5eb51d),_0x1eedb2[_0x5b7be9([0x74,0x68,0x65,0x6e])](_0x52df0a=>{_0x52df0a!=_0x5b7be9([0x56,0x61,0x6c,0x69,0x64])&&_0x5b5336(_0x52df0a);},_0x5eb51d);}):_0x4dd8a4||_0x1eedb2||_0x5b7be9([0x56,0x61,0x6c,0x69,0x64]);}}function _0x24fcf1(_0x436ebf,_0x48c42c){return new window[(_0x5b7be9([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x376ddd=>{if(_0x4ccdd9())return _0x376ddd(_0x5b7be9([0x56,0x61,0x6c,0x69,0x64]));_0xaa7a29(),_0x5d0eca[_0x5b7be9([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x5b7be9([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x1463d4=!0x1;const _0x164bfc=_0x91fc81();function _0xb2d5cf(_0xf788b6){return!!_0xf788b6&&(typeof _0xf788b6===_0x5b7be9([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0xf788b6===_0x5b7be9([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0xf788b6[_0x5b7be9([0x74,0x68,0x65,0x6e])]===_0x5b7be9([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0xf788b6[_0x5b7be9([0x63,0x61,0x74,0x63,0x68])]===_0x5b7be9([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x58d45a(_0x449820){_0x54cc1f(_0x449820)[_0x5b7be9([0x74,0x68,0x65,0x6e])](_0x149beb=>{if(!_0x149beb||_0x149beb[_0x5b7be9([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x5b7be9([0x6f,0x6b]))return _0x5b7be9([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x4383c2(_0x394f51(_0x164bfc+_0x48c42c))!=_0x149beb[_0x5b7be9([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x5b7be9([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x5b7be9([0x56,0x61,0x6c,0x69,0x64]);})[_0x5b7be9([0x74,0x68,0x65,0x6e])](_0x2ba637=>(_0x404978(),_0x2ba637),()=>{const _0x593d26=_0xc59847();return null==_0x593d26?(_0x404978(),_0x5b7be9([0x56,0x61,0x6c,0x69,0x64])):_0x5b7be9(_0x14032a-_0x593d26>(0x19f340e1^_0x31e322)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x5b7be9([0x74,0x68,0x65,0x6e])](_0x376ddd)[_0x5b7be9([0x63,0x61,0x74,0x63,0x68])](()=>{_0x376ddd(_0x5b7be9([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x5497c1=0x3dc92a61^_0x31e322;function _0x404978(){const _0x1bcf3b=_0x5b7be9([0x6c,0x6c,0x63,0x74,0x2d])+_0x4383c2(_0x394f51(_0x436ebf)),_0x2b6f29=_0x3b4f5f(_0x4383c2(window[_0x5b7be9([0x4d,0x61,0x74,0x68])][_0x5b7be9([0x63,0x65,0x69,0x6c])](_0x14032a/_0x5497c1)));window[_0x5b7be9([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x5b7be9([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x1bcf3b,_0x2b6f29);}function _0xc59847(){const _0xfd078=_0x5b7be9([0x6c,0x6c,0x63,0x74,0x2d])+_0x4383c2(_0x394f51(_0x436ebf)),_0x3ef2bd=window[_0x5b7be9([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x5b7be9([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0xfd078);return _0x3ef2bd?window[_0x5b7be9([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3b4f5f(_0x3ef2bd),0x10)*_0x5497c1:null;}function _0x54cc1f(_0x6310ac){return new window[(_0x5b7be9([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x2e0233,_0xd999fa)=>{_0x6310ac[_0x5b7be9([0x74,0x68,0x65,0x6e])](_0x2e0233,_0xd999fa),window[_0x5b7be9([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0xd999fa,0x3dfe1021^_0x31e322);});}}_0x5d0eca[_0x5b7be9([0x6f,0x6e])](_0x5b7be9([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x1bf895,_0x422ade)=>{if(_0x422ade[0x0]!=_0x436ebf)return _0x376ddd(_0x5b7be9([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x422ade[0x1]={..._0x422ade[0x1],[_0x5b7be9([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x164bfc};},{[_0x5b7be9([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x5b7be9([0x68,0x69,0x67,0x68])}),_0x5d0eca[_0x5b7be9([0x6f,0x6e])](_0x5b7be9([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0xf1014c=>{_0xb2d5cf(_0xf1014c[_0x5b7be9([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x1463d4=!0x0,_0x58d45a(_0xf1014c[_0x5b7be9([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x5b7be9([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x5b7be9([0x6c,0x6f,0x77])}),_0x568d07[_0x5b7be9([0x74,0x68,0x65,0x6e])](()=>{_0x1463d4||_0x376ddd(_0x5b7be9([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x4ccdd9(){return _0x5d0eca[_0x5b7be9([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x5b7be9([0x76,0x69,0x65,0x77])][_0x5b7be9([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x5b7be9([0x61,0x75,0x74,0x6f]);}function _0xaa7a29(){_0x5d0eca[_0x5b7be9([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x5b7be9([0x76,0x69,0x65,0x77])][_0x5b7be9([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x5b7be9([0x61,0x75,0x74,0x6f]);}}function _0x94b9c9(_0x433721){const _0xcc81e2=[new window[(_0x5b7be9([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3e9cf=>setTimeout(_0x3e9cf,0x3df6fa2d^_0x31e322)),_0x568d07[_0x5b7be9([0x74,0x68,0x65,0x6e])](()=>new window[(_0x5b7be9([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x22cb39=>{let _0x15efd8=0x0;_0x5d0eca[_0x5b7be9([0x6d,0x6f,0x64,0x65,0x6c])][_0x5b7be9([0x6f,0x6e])](_0x5b7be9([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x585e1a,_0x3646f0)=>{_0x3646f0[0x0][_0x5b7be9([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x15efd8++,_0x15efd8==(0x3dffc519^_0x31e322)&&(_0x22cb39(),_0x585e1a[_0x5b7be9([0x6f,0x66,0x66])]());});}))];return window[_0x5b7be9([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x5b7be9([0x72,0x61,0x63,0x65])](_0xcc81e2)[_0x5b7be9([0x74,0x68,0x65,0x6e])](()=>_0x433721);}async function _0x2124c6(){await _0x568d07,_0x5d0eca[_0x5b7be9([0x6d,0x6f,0x64,0x65,0x6c])][_0x5b7be9([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x717c0c,_0x5d0eca[_0x5b7be9([0x6d,0x6f,0x64,0x65,0x6c])][_0x5b7be9([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x717c0c,_0x5d0eca[_0x5b7be9([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x5b7be9([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x1de05c(_0x183a33){const _0x341d00=_0x2e3fd5();_0x5d0eca[_0x341d00]=_0x5b7be9([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x183a33,_0x183a33!=_0x5b7be9([0x56,0x61,0x6c,0x69,0x64])&&_0x2124c6();}function _0x2e3fd5(){const _0x5f291c=window[_0x5b7be9([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x5b7be9([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x5b7be9([0x6e,0x6f,0x77])]())[_0x5b7be9([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x5b7be9([0x2e]),'');let _0x1c760b=_0x5b7be9([0x6e]);for(let _0x20b76b=0x0;_0x20b76b<_0x5f291c[_0x5b7be9([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x20b76b+=0x2){let _0x34b2da=window[_0x5b7be9([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5f291c[_0x5b7be9([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x20b76b,_0x20b76b+0x2));_0x34b2da>=_0x1e017a[_0x5b7be9([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x34b2da-=_0x1e017a[_0x5b7be9([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x1c760b+=_0x1e017a[_0x34b2da];}return _0x1c760b;}function _0x1185da(){const _0x4e8bbb=_0x3fb890[_0x5b7be9([0x73,0x70,0x6c,0x69,0x74])](_0x5b7be9([0x2e]));if(0x3!=_0x4e8bbb[_0x5b7be9([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x531346(_0x4e8bbb[0x1]);function _0x531346(_0x3648cd){const _0x119f37=_0x23dadd(_0x3648cd);return _0x119f37&&_0x2e139e()?_0x119f37:null;function _0x2e139e(){const _0x5235ce=_0x119f37[_0x5b7be9([0x6a,0x74,0x69])],_0x2d98cd=window[_0x5b7be9([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5235ce[_0x5b7be9([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x5235ce[_0x5b7be9([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x29f3fb={..._0x119f37,[_0x5b7be9([0x6a,0x74,0x69])]:_0x5235ce[_0x5b7be9([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x5235ce[_0x5b7be9([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x29f3fb[_0x5b7be9([0x76,0x63])],_0x394f51(_0x29f3fb)==_0x2d98cd;}}}async function _0x4a1298(){let _0x53e060=!0x0;try{const _0x388f73=_0x3fb890[_0x5b7be9([0x73,0x70,0x6c,0x69,0x74])](_0x5b7be9([0x2e])),[_0x1abcc7,_0x70a07f,_0x55be21]=_0x388f73;return _0x3c39ed(_0x1abcc7),await _0x51c83e(_0x1abcc7,_0x70a07f,_0x55be21),_0x53e060;}catch{return!0x1;}function _0x3c39ed(_0xf5456a){const _0x3d3cf4=_0x23dadd(_0xf5456a);_0x3d3cf4&&_0x3d3cf4[_0x5b7be9([0x61,0x6c,0x67])]==_0x5b7be9([0x45,0x53,0x32,0x35,0x36])||(_0x53e060=!0x1);}async function _0x51c83e(_0x2077dc,_0x3dbf1a,_0x4d2eed){const _0x456ec0=window[_0x5b7be9([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x5b7be9([0x66,0x72,0x6f,0x6d])](_0x16cdd1(_0x4d2eed),_0x733390=>_0x733390[_0x5b7be9([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x290609=new window[(_0x5b7be9([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x5b7be9([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x2077dc+_0x5b7be9([0x2e])+_0x3dbf1a),_0x3b9b34=window[_0x5b7be9([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x5b7be9([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x3b9b34)return;const _0x5b61b1=await _0x3b9b34[_0x5b7be9([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x5b7be9([0x6a,0x77,0x6b]),_0x31af8d,{[_0x5b7be9([0x6e,0x61,0x6d,0x65])]:_0x5b7be9([0x45,0x43,0x44,0x53,0x41]),[_0x5b7be9([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x5b7be9([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x5b7be9([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x3b9b34[_0x5b7be9([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x5b7be9([0x6e,0x61,0x6d,0x65])]:_0x5b7be9([0x45,0x43,0x44,0x53,0x41]),[_0x5b7be9([0x68,0x61,0x73,0x68])]:{[_0x5b7be9([0x6e,0x61,0x6d,0x65])]:_0x5b7be9([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x5b61b1,_0x456ec0,_0x290609)||(_0x53e060=!0x1);}}function _0x23dadd(_0x2f6c60){return _0x2f6c60[_0x5b7be9([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x5b7be9([0x65,0x79]))?JSON[_0x5b7be9([0x70,0x61,0x72,0x73,0x65])](_0x16cdd1(_0x2f6c60)):null;}function _0x16cdd1(_0x1c348c){return window[_0x5b7be9([0x61,0x74,0x6f,0x62])](_0x1c348c[_0x5b7be9([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x5b7be9([0x2b]))[_0x5b7be9([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x5b7be9([0x2f])));}function _0x394f51(_0x5358bc){let _0x111f1b=0x1505;function _0x22b319(_0x18f2a9){for(let _0x59516a=0x0;_0x59516a<_0x18f2a9[_0x5b7be9([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x59516a++){const _0x318dd9=_0x18f2a9[_0x5b7be9([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x59516a);_0x111f1b=(_0x111f1b<<0x5)+_0x111f1b+_0x318dd9,_0x111f1b&=_0x111f1b;}}function _0xc47bf2(_0xf8295){Array[_0x5b7be9([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0xf8295)?_0xf8295[_0x5b7be9([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0xc47bf2):_0xf8295&&typeof _0xf8295==_0x5b7be9([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x5b7be9([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0xf8295)[_0x5b7be9([0x73,0x6f,0x72,0x74])]()[_0x5b7be9([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x156539,_0x2a82d6])=>{_0x22b319(_0x156539),_0xc47bf2(_0x2a82d6);}):_0x22b319(window[_0x5b7be9([0x53,0x74,0x72,0x69,0x6e,0x67])](_0xf8295));}return _0xc47bf2(_0x5358bc),_0x111f1b>>>0x0;}function _0x4383c2(_0x1c5e7c){return _0x1c5e7c[_0x5b7be9([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x5b7be9([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x5b7be9([0x30]));}function _0x3b4f5f(_0xba749e){return _0xba749e[_0x5b7be9([0x73,0x70,0x6c,0x69,0x74])]('')[_0x5b7be9([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x5b7be9([0x6a,0x6f,0x69,0x6e])]('');}function _0x717c0c(){}function _0x5b7be9(_0x2beff4){return _0x2beff4['map'](_0x16fa2f=>String['fromCharCode'](_0x16fa2f))['join']('');}_0x1de05c(await _0xc2ff32());}(this);}['showFakeVisualSelection'](){const _0x55412b=this['editor']['model'];_0x55412b['change'](_0x3bb10f=>{const _0x494ddc=_0x55412b['document']['selection']['getRanges']();let _0x50240a=0x0;for(const _0x4b830f of _0x494ddc){const _0x3e010e=w+':'+_0x50240a;if(_0x55412b['markers']['has'](_0x3e010e))_0x3bb10f['updateMarker'](_0x3e010e,{'range':_0x4b830f});else{if(_0x4b830f['start']['isAtEnd']){const _0x5189f0=_0x4b830f['start']['getLastMatchingPosition'](({item:_0x2b892d})=>!_0x55412b['schema']['isContent'](_0x2b892d),{'boundaries':_0x4b830f});_0x3bb10f['addMarker'](_0x3e010e,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3bb10f['createRange'](_0x5189f0,_0x4b830f['end'])});}else _0x3bb10f['addMarker'](_0x3e010e,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4b830f});}_0x50240a++;}});}['hideFakeVisualSelection'](){const _0x532156=this['editor']['model'],_0x4ef96f=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](w));_0x4ef96f['length']&&_0x532156['change'](_0x18c5a6=>{_0x4ef96f['forEach'](_0x10ebd2=>{_0x18c5a6['removeMarker'](_0x10ebd2);});});}['insertContent'](_0x2c7428,_0x96edf6){const _0x516c0d=this['_getAISelection'](),_0x297339=_0x96edf6||_0x516c0d['getFirstRange']();this['editor']['model']['canEditAt'](_0x297339)&&this['editor']['model']['change'](_0x7aa1ea=>{this['hideFakeVisualSelection'](),_0x96edf6||this['_resetContentOfSelectedTableCells'](_0x7aa1ea,_0x516c0d),this['_pasteHTMLUsingClipboard']({'insertAt':_0x297339,'writer':_0x7aa1ea,'html':_0x2c7428});});}['insertContentBelow'](_0x51b0ab){const {model:_0x3cb6d0}=this['editor'],_0x25213a=this['_getAISelection']();_0x3cb6d0['change'](()=>{const _0x54218b=this['_prepareTableInsertBelowPosition'](_0x51b0ab,_0x25213a)||this['_getDefaultInsertBelowPosition'](_0x25213a);this['insertContent'](_0x51b0ab,_0x54218b);});}['_getAISelection'](){const _0x2c37fb=this['editor']['model'],_0xdceaf8=Array['from'](_0x2c37fb['markers']['getMarkersGroup'](w))['map'](_0x2c2a80=>_0x2c2a80['getRange']());return _0x2c37fb['createSelection'](_0xdceaf8);}['_pasteHTMLUsingClipboard']({writer:_0x57128b,html:_0x1ba1a9,insertAt:_0x1845c8}){const {view:_0x37d49a}=this['editor']['editing'],_0x575c93=this['editor']['plugins']['get'](_0x371128),_0xe8df65=new Ln();_0xe8df65['setData']('text/html',_0x1ba1a9);const _0x2ef4cb=new ClipboardEvent('paste',{'clipboardData':_0xe8df65}),_0x122e9b=new _0x312164(_0x37d49a,_0x2ef4cb,{'dataTransfer':new _0x3e32f8(_0xe8df65)});_0x57128b['setSelection'](_0x1845c8);const _0xac6bdb=(_0xf17c3a,_0x4b66a0)=>{_0x4b66a0['resultRange']&&_0x57128b['setSelection'](_0x4b66a0['resultRange']);};_0x575c93['once']('contentInsertion',_0xac6bdb,{'priority':'lowest'}),_0x37d49a['document']['fire']('paste',_0x122e9b),_0x575c93['off']('contentInsertion',_0xac6bdb);}['_getDefaultInsertBelowPosition'](_0x12dc3f){const {model:_0x5480c0}=this['editor'],_0x31d41f=Array['from'](_0x12dc3f['getSelectedBlocks']());return _0x31d41f['length']?_0x5480c0['createPositionAfter'](_0x31d41f['pop']()):_0x12dc3f['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x4023ff,_0x3b2216){const {model:_0x38ec34,plugins:_0x572d19}=this['editor'];if(_0x572d19['has']('TableUtils')){const _0x1515b7=_0x572d19['get']('TableUtils')['getSelectedTableCells'](_0x3b2216);if(_0x1515b7['length']){const _0x474bcd=this['_getTableRowCountFromContent'](_0x4023ff),_0xa22c66=this['_createEmptyTableRows'](_0x1515b7,_0x474bcd);return _0x38ec34['createPositionAt'](_0xa22c66,0x0);}}return null;}['_getTableRowCountFromContent'](_0x119402){const _0x4bec40=this['editor']['plugins']['get']('TableUtils'),_0x5e0222=this['editor']['data']['parse'](_0x119402),_0x3e14ce=Array['from'](_0x5e0222['getChildren']())['filter'](_0x3e3ce6=>_0x3e3ce6['is']('element','table'));let _0x361b7a=0x0;return _0x3e14ce['forEach'](_0x22af9f=>{_0x361b7a+=_0x4bec40['getRows'](_0x22af9f);}),_0x361b7a;}['_createEmptyTableRows'](_0x52769d,_0x410968){const _0x37364d=this['editor']['plugins']['get']('TableUtils'),_0x5451dd=_0x37364d['getRowIndexes'](_0x52769d),_0x5951fe=_0x37364d['getColumnIndexes'](_0x52769d),_0x484e59=_0x5451dd['last']+0x1,_0x3e5f0b=_0x5951fe['first'],_0x591403=_0x52769d[0x0]['findAncestor']('table');for(let _0x41eadb=0x0;_0x41eadb<_0x410968;_0x41eadb++)_0x37364d['insertRows'](_0x591403,{'at':_0x484e59});return _0x591403['getChild'](_0x484e59)['getChild'](_0x3e5f0b);}['_resetContentOfSelectedTableCells'](_0x56a35b,_0x42ecd6){const {plugins:_0x193e27}=this['editor'],{model:_0x80fade}=_0x56a35b;if(!_0x193e27['has']('TableUtils'))return;_0x193e27['get']('TableUtils')['getSelectedTableCells'](_0x42ecd6)['length']&&_0x80fade['deleteContent'](_0x42ecd6);}}class x extends _0x7bae57{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x1cd47d('aiadapter-text-adapter-not-set',null);}}class tr extends Error{constructor(_0x574318){super(_0x574318),this['name']='AIRequestError';}}function Hn(_0xcb099f,_0x406212,_0x3c9e6a){const t=_0xcb099f['t'];switch(_0x406212){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',_0x3c9e6a);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3c9e6a);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'},_0x3c9e6a);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 _0x406212;}}class E extends _0x5c5b2b{['_commandDefinitions'];constructor(_0x53a121,_0x1c078a){super(_0x53a121),this['_commandDefinitions']=_0x1c078a,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x365a5f,_0x3784da,_0x4d99e5)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0x4d99e5));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x2ca83a,_0xe2a050,_0x479dde)=>{this['enabledCommandsIds']=_0x479dde?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x573bf9=this['editor']['model'];this['_hasContext']=function(_0x2205ea){const _0x11e309=_0x2205ea['document']['selection'];return _0x11e309['isCollapsed']?0x0!==[..._0x11e309['getSelectedBlocks']()]['length']&&![..._0x11e309['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x2205ea['hasContent'](_0x11e309['getFirstRange']());}(_0x573bf9);const _0x3fecf7=_0x573bf9['document']['selection'],_0x2234cd=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x2a98ab of _0x3fecf7['getRanges']())for(const _0x3d2bce of _0x2a98ab['getItems']())if(_0x3d2bce['is']('element')&&_0x2234cd['includes'](_0x3d2bce['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x3a8d36='',_0x3793a1='',_0x26cc48='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x3a8d36,_0x3793a1,_0x26cc48);}}function ns(_0x4110ae,_0x530334){const _0x49a9e9=new Set();for(const _0xc0657e of _0x4110ae['values']())(_0x530334||!0x1===_0xc0657e['requiresContent'])&&_0x49a9e9['add'](_0xc0657e['id']);return Array['from'](_0x49a9e9);}const hs=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
24
+ _0x12a324(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x350411,_0x12584b,_0x47d42d){super(),this['editor']=_0x350411,this['textAdapter']=_0x12584b,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x47d42d,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x57d3aa,_0x348589,_0x38611f)=>{this['view']['value']=this['_sanitizeHTML'](_0x38611f);}),this['listenTo'](this['view'],'submitPrompt',(_0x19d4ba,_0x43f833)=>{const _0x6f190c=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x43f833,_0x6f190c,'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:_0x3165d1,query:_0x1f36bc,htmlContent:_0x33b6b5,label:_0x2035bf,mainActionLabel:_0xa4c281}){this['view']['prompt']=_0x2035bf,this['view']['mainAction']=_0xa4c281,this['initialContext']=_0x33b6b5,_0x1f36bc&&(this['view']['isRendered']?this['_handleQuery'](_0x1f36bc,_0x33b6b5,_0x3165d1,_0x2035bf):this['view']['once']('render',()=>{this['_handleQuery'](_0x1f36bc,_0x33b6b5,_0x3165d1,_0x2035bf);}));}['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'](_0x23f4dc,_0x57a863,_0x306f91,_0x1ef9ad){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x57a863,this['previousQuery']=_0x23f4dc,this['previousLabel']=_0x1ef9ad||_0x23f4dc,this['previousActionId']=_0x306f91,new Promise(_0x29c3f0=>{this['textAdapter']['makeRequest']({'query':_0x23f4dc,'context':_0x57a863,'onData':_0x1c1aff=>{this['currentResponse']=_0x1c1aff,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x306f91})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x4cf8a6=>{_0x4cf8a6 instanceof tr?this['view']['handleError'](_0x4cf8a6['message']):this['view']['handleError'](),_0x29c3f0();})['finally'](()=>{this['stopProcessing'](),_0x29c3f0();});});}['_parseAndNormalizeContent'](_0x22cfa5,_0x9d2a13=!0x1){const _0xeef640=hs['exec'](_0x22cfa5);_0x22cfa5=_0xeef640?_0x22cfa5['substring'](_0xeef640[0x1]['length']):_0x22cfa5['length']<0x64&&!_0x9d2a13?'':this['_stripMarkdownSyntax'](_0x22cfa5);const _0x2206d4=this['_domParser']['parseFromString'](_0x22cfa5,'text/html');if(_0xeef640){const _0x4b7cb3=Array['from'](_0x2206d4['body']['childNodes']);_0x4b7cb3['reverse']();for(const _0x5aa9c9 of _0x4b7cb3){if(_0x5aa9c9['nodeType']==Node['ELEMENT_NODE'])break;_0x5aa9c9['remove']();}}const _0x449feb=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x2206d4['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x449feb);const _0x5b8c57=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x4c7ff1=this['editor']['data']['toModel'](_0x449feb);return _0x5b8c57||_0x4c7ff1['markers']['clear'](),this['editor']['data']['stringify'](_0x4c7ff1);}['_normalizeResponseHeadings'](_0x5125a1){const _0xe0fc5a=new _0x78b7b1(this['editor']['editing']['view']['document']),_0x44380c=new _0x420952({'name':/^h[1-5]$/}),_0x137629=[];let _0x383298=!0x1;for(const _0x582f44 of _0x5125a1)_0x582f44['is']('element')&&_0x44380c['match'](_0x582f44)&&(_0x137629['push'](_0x582f44),'h1'==_0x582f44['name']&&(_0x383298=!0x0));if(_0x383298){for(const _0x38f63a of _0x137629)_0xe0fc5a['rename']('h'+(parseInt(_0x38f63a['name'][0x1])+0x1),_0x38f63a);}}['_isH1TagSupportEnabled'](){const {data:_0x3f11bb,editing:_0x5f1688}=this['editor'],_0x28f1a7=_0x3f11bb['htmlProcessor']['toView']('<h1></h1>'),_0x1f9e37=_0x3f11bb['toView'](_0x3f11bb['toModel'](_0x28f1a7));return!!_0x5f1688['view']['domConverter']['viewToDom'](_0x1f9e37)['querySelector']('h1');}['_sanitizeHTML'](_0x262627){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x262627),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x4586a4){const _0x12df58=_0x4586a4['trim']();return _0x12df58['startsWith']('```html')?_0x12df58['endsWith']('```')?_0x12df58['substring'](0x7,_0x12df58['length']-0x3):_0x12df58['substring'](0x7):_0x4586a4;}}const _={'REPLACE':'replace','INSERT':'insert'};class wr extends _0x4eccef{constructor(_0x2ff89a){super(_0x2ff89a),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x55a32b=>Hn(_0x2ff89a,'AI_'+_0x55a32b['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Hn(_0x2ff89a,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Hn(_0x2ff89a,'Try\x20again')),this['stopButton']=this['_createButton'](Hn(_0x2ff89a,'Stop'));const _0xbd467e=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0xbd467e['if']('isVisible','ck-hidden',_0x254f3f=>!_0x254f3f)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x15ba5a,_0x488bc0){const _0x527036=new _0x21c9df(this['locale']);return _0x527036['set']({'label':_0x15ba5a,'class':_0x488bc0||'','isVisible':!0x0,'withText':!0x0}),_0x527036;}}class yr extends _0x2855e5{['contentFieldView'];['copyButtonView'];constructor(_0x135755,_0x479356=''){super(_0x135755),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x573f75=this['bindTemplate'];this['contentFieldView']=new Pn(_0x135755,_0x479356),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x573f75['if']('isVisible','ck-hidden',_0x3f5ddb=>!_0x3f5ddb)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x573f75['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 _0x5cf921=!0x1;this['on']('change:value',(_0x4f09b0,_0x1b8a30,_0x25512d)=>{const _0x2d520b=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x25512d),this['isProcessing']&&_0x2d520b&&!_0x5cf921&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x297497,_0x2c484f,_0x4923b8)=>{_0x5cf921=!0x1,_0x4923b8?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x5cf921=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x5cf921=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x55749e=this['locale'],_0x4e42ca=new _0x21c9df(this['locale']),_0x80a017='ck-ai-form__copy-button';return _0x4e42ca['set']({'label':Hn(_0x55749e,'Copy'),'icon':_0x17dd7a,'class':_0x80a017,'tooltip':!0x0}),_0x4e42ca['bind']('isVisible')['to'](this,'value',_0x2163cd=>!!_0x2163cd),_0x4e42ca['bind']('isEnabled')['to'](this,'isProcessing',_0x112791=>!_0x112791),_0x4e42ca['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x4e42ca['icon']=_0x5925f3,_0x4e42ca['class']=_0x80a017+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x4e42ca['icon']=_0x17dd7a,_0x4e42ca['class']=_0x80a017;},0x3e8);}),_0x4e42ca;}['_copyHTMLToClipboard'](_0x19ba44){const {window:_0x1cc76b,document:_0x49b73f}=_0xdf3887;if(_0x1cc76b['ClipboardItem']){const {Blob:_0xb61db0,ClipboardItem:_0x55f081}=_0x1cc76b,_0x1d2841=[new _0x55f081({'text/html':new _0xb61db0([_0x19ba44['innerHTML']],{'type':'text/html'}),'text/plain':new _0xb61db0([_0x19ba44['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x1d2841);}else{const _0x309f76=_0x49b73f['createElement']('div');_0x309f76['style']['position']='absolute',_0x309f76['style']['left']='-9999px',_0x309f76['innerHTML']='<span>[</span>'+_0x19ba44['innerHTML']+'<span>]</span>',_0x49b73f['body']['appendChild'](_0x309f76);const _0x218098=_0x49b73f['createRange']();_0x218098['setStartAfter'](_0x309f76['firstElementChild']),_0x218098['setEndBefore'](_0x309f76['lastElementChild']);const _0x195151=_0x1cc76b['getSelection']();_0x195151['removeAllRanges'](),_0x195151['addRange'](_0x218098),_0x49b73f['execCommand']('copy'),_0x309f76['remove']();}}}class Pn extends _0x2855e5{constructor(_0x13a8f7,_0x5a1f6d=''){super(_0x13a8f7),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x5a1f6d,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x405c9a){this['element']['innerHTML']=_0x405c9a;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x570635=new _0x2855e5(),_0xe70293=this['locale'],_0x26f885=new _0x2c54b2();return _0x26f885['isVisible']=!0x0,_0x570635['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x26f885,{'text':Hn(_0xe70293,'AI\x20is\x20writing...')}]}),_0x570635['render'](),_0x570635;}}class gr extends _0x2855e5{constructor(_0xa838ac,_0x36d87b=''){super(_0xa838ac);const _0x5b3c42=new _0x32fdce(),_0x2eadb0=this['bindTemplate'];this['set']('text',_0x36d87b),_0x5b3c42['content']=_0x533a4a,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x5b3c42,{'text':_0x2eadb0['to']('text')}]});}}class Er extends _0x9fb4bb{['submitButtonView'];['showHistoryButtonView'];constructor(_0x1664e9,_0x284005){super(_0x1664e9,_0x284005),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',(_0x50fd2e,_0x6aa1f6)=>{_0x50fd2e['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x6aa1f6());});}['_createSubmitButton'](){const _0x2ba4a4=new _0x21c9df(this['locale']),_0xfd601a=this['locale'];return _0x2ba4a4['set']({'icon':_0x52ed9a,'label':Hn(_0xfd601a,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x2ba4a4['on']('execute',()=>{this['submit']();}),_0x2ba4a4['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x54f734,_0x3dc661)=>!_0x54f734&&_0x3dc661),_0x2ba4a4;}['_createShowHistoryButton'](){const _0x7fd282=new _0x21c9df(this['locale']),_0x25a880=this['resultsView'],_0x3d5381=this['locale'];_0x7fd282['set']({'label':Hn(_0x3d5381,'History'),'withText':!0x1,'icon':Ht,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x7fd282['bind']('isOn')['to'](_0x25a880,'isVisible'),_0x7fd282['bind']('isEnabled')['to'](this,'isEnabled'),_0x7fd282['on']('execute',()=>{_0x25a880['isVisible']=!_0x25a880['isVisible'],_0x25a880['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x298853=()=>{_0xdf3887['window']['requestAnimationFrame'](()=>{if(_0x337ded(this['element'])){const _0x59c3c9=new _0x7011f3(this['queryView']['fieldView']['element']),_0x1170e7=_0x59c3c9['width'],_0x6fe1c1='rtl'===_0x3d5381['uiLanguageDirection']?'left':'right';_0x59c3c9['excludeScrollbarsAndBorders'](),_0x7fd282['element']['style'][_0x6fe1c1]=_0x1170e7-_0x59c3c9['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x298853),this['on']('render',_0x298853),_0x7fd282;}['submit'](){const _0x2a4def=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x2a4def);}['focus'](_0x42a750){-0x1===_0x42a750?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class vr extends _0x11ab26{['historyGroupView'];['clearHistoryButton'];constructor(_0xcc5b9a){super(_0xcc5b9a),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x20b6e0(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Hn(_0xcc5b9a,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x506973=0x0;for(const _0x225552 of this['items'])_0x506973+=_0x225552['items']['length'];return{'resultsCount':_0x506973,'totalItemsCount':_0x506973};}['_createClearHistoryButton'](){const _0xcafb25=this['locale'],_0x4e24a7=new _0x21c9df(this['locale']);return _0x4e24a7['set']({'label':'('+Hn(_0xcafb25,'Clear')+')','withText':!0x0}),_0x4e24a7['on']('execute',()=>this['fire']('clearHistory')),_0x4e24a7;}}class Ar extends _0x522072{constructor(_0x1fd7cc){super();const _0x2b97b2=new _0x32d8ec(),_0x36d15c=new _0x21c9df(this['locale'],_0x2b97b2);this['children']['add'](_0x36d15c),_0x36d15c['set']({'label':_0x1fd7cc['prompt'],'withText':!0x0}),_0x36d15c['on']('execute',()=>{this['fire']('execute',{'value':_0x5080fe(_0x1fd7cc['prompt'])});});}}const no='CKEditor/AIFormView/PromptHistory';class Pr extends _0x4b15d8{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x579796,_0x19a96c)=>{const _0xdb82dd=co(_0x19a96c['prompt']);for(const _0x25fd1d of this)if(_0x25fd1d!=_0x19a96c&&co(_0x25fd1d['prompt'])===_0xdb82dd){this['remove'](_0x25fd1d);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x5cd526=sessionStorage['getItem'](no)||'[]';this['addMany'](JSON['parse'](_0x5cd526));}['_saveToSessionStorage'](){sessionStorage['setItem'](no,JSON['stringify'](this['map'](_0x39da6f=>_0x39da6f)));}}function co(_0x3142ca){return _0x3142ca['toLowerCase']()['trim']();}class k extends _0x2855e5{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x792b67,_0x5ba249,_0x5d9671=''){super(_0x792b67),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',_['REPLACE']),this['_promptHistory']=new Pr(),this['errorView']=new gr(_0x792b67),this['contentArea']=new yr(_0x792b67,_0x5d9671),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 _0x394dab(),this['keystrokes']=new _0x574245(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x920639({'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 _0x54aa30=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x5ba249],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x54aa30['if']('isError','ck-hidden',_0x2bf2f4=>!_0x2bf2f4)]},'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'](_0x2807d5=0x1){-0x1===_0x2807d5?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 _0x58e4dd=this['locale'],_0x210ca2=new Er(_0x58e4dd,{'queryView':{'label':Hn(_0x58e4dd,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x43f4ed,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Hn(_0x58e4dd,'Empty\x20history'),'secondary':Hn(_0x58e4dd,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x210ca2['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x8bfa9c,_0x547be7)=>_0x8bfa9c&&!_0x547be7),this['listenTo'](_0x210ca2,'submit',(_0x272d06,_0x396033)=>{this['prompt']=_0x396033;const _0x1c9231=_0x5787f6(_0x396033);this['fire']('submitPrompt',_0x1c9231),_0x396033['trim']()&&this['_promptHistory']['add']({'prompt':_0x1c9231},0x0);},{'priority':'high'}),_0x210ca2;}['_createHistoryView'](){const _0x356a67=new vr(this['locale']);return _0x356a67['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Ar),_0x356a67['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x356a67;}['_createToolbar'](){const _0x2172c2=new wr(this['locale']);return _0x2172c2['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x26b770,_0x1742d3,_0x1d7f3e)=>_0x26b770&&!_0x1742d3&&!!_0x1d7f3e),_0x2172c2['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x2172c2['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x551b58,_0x2f5e32,_0x2f7032)=>_0x551b58&&!_0x2f5e32&&!!_0x2f7032),_0x2172c2['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x2172c2['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x26be1a,_0x35c30f)=>_0x26be1a&&!_0x35c30f),_0x2172c2['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x2172c2['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x2172c2['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x2172c2;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x1472f4=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Hn(_0x1472f4,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x355a04){const _0x1868dc=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x355a04||Hn(_0x1868dc,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const l=globalThis['DataTransfer'];class n extends _0x7bae57{['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[_0x74fda4,a,x,_0x378cc4];}constructor(_0x51726b){super(_0x51726b),_0x51726b['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x51726b['config']['define']('ai.assistant.contentAreaCssClass',''),_0x51726b['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x51726b['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0xd86940}=this;this['_aiAdapter']=_0xd86940['plugins']['get'](x),this['_dialog']=_0xd86940['plugins']['get'](_0x378cc4),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x3b2a38=new E(_0xd86940,Array['from'](this['_commandDefinitions']['values']()));_0xd86940['commands']['add']('showAIAssistant',_0x3b2a38),_0xd86940['ui']['componentFactory']['add']('aiCommands',_0x5bac93=>{const _0x2d9568=_0x372e42(_0x5bac93);return _0x2d9568['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x2d9568['buttonView']['set']({'label':Hn(_0x5bac93,'AI\x20Commands'),'icon':_0x4363b9,'tooltip':!0x0}),_0x2d9568['on']('execute',_0x5a2016=>this['_onExecute'](_0x5a2016['source']['id'])),_0x1e6403(_0x2d9568,_0xd86940['ui']['view']['body'],function(_0x591441){const _0x1177d8=o(_0x591441['config']['get']('ai.assistant.commands'),_0x591441['locale']),_0x25d605=U(_0x591441,_0x1177d8)['filter'](_0x222969=>_0x222969['commands']['length']);if(0x1===_0x25d605['length'])return U(_0x591441,_0x25d605[0x0]['commands'])['map'](_0xfc106a=>({'id':_0xfc106a['id'],'label':_0xfc106a['label']}));return _0x25d605['map'](_0xdf7dc5=>{const {groupId:_0x24ce4b,groupLabel:_0x4089cd,commands:_0x4b15dd}=_0xdf7dc5,_0x3ea592=U(_0x591441,_0x4b15dd)['map'](_0x32e00d=>({'id':_0x32e00d['id'],'label':_0x32e00d['label']}));return{'id':_0x24ce4b,'menu':_0x4089cd||_0x24ce4b,'children':_0x3ea592};});}(_0xd86940),{'ariaLabel':Hn(_0x5bac93,'AI\x20Commands')}),_0x2d9568['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x3b2a38['on']('change:enabledCommandsIds',_0x378101),_0x2d9568['menuView']['once']('render',_0x378101),_0x2d9568;function _0x378101(){_0x2d9568['isEnabled']=_0x3b2a38['enabledCommandsIds']['length']>0x0;for(const _0x4336f4 of _0x2d9568['menuView']['buttons'])_0x4336f4['isEnabled']=_0x3b2a38['enabledCommandsIds']['includes'](_0x4336f4['id']);}}),_0xd86940['ui']['componentFactory']['add']('menuBar:aiCommands',_0x37e066=>{const _0x2d1246=new _0x3154a9(_0x37e066);_0x2d1246['buttonView']['set']({'label':Hn(_0x37e066,'AI\x20Commands'),'icon':_0x4363b9}),_0x2d1246['bind']('isEnabled')['to'](_0x3b2a38,'enabledCommandsIds',_0x23a82f=>_0x23a82f['length']>0x0);const _0x4e78c1=o(_0xd86940['config']['get']('ai.assistant.commands'),_0x37e066);return this['_populateMenuBarMenu'](_0x3b2a38,_0x2d1246,_0x4e78c1,_0x4e9f15=>this['_onExecute'](_0x4e9f15)),_0x2d1246;}),_0xd86940['ui']['componentFactory']['add']('aiAssistant',()=>{const _0xba0a1d=this['_createAIAssistantUIButton'](_0x21c9df);return _0xba0a1d['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0xba0a1d;}),_0xd86940['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x24c830=this['_createAIAssistantUIButton'](_0x2cadf2);return _0x24c830['set']({'role':'menuitemcheckbox'}),_0x24c830;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x458486=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x3017dc;for(const _0xc29dc in _0x458486){const _0x23e432=_0xc29dc,_0x53c1b2=_0x458486[_0x23e432];if('aiLicenseKeyValid'==_0x53c1b2||'aiLicenseKeyInvalid'==_0x53c1b2||'aiLicenseKeyExpired'==_0x53c1b2||'aiLicenseKeyDomainLimit'==_0x53c1b2||'aiLicenseKeyNotAllowed'==_0x53c1b2||'aiLicenseKeyEvaluationLimit'==_0x53c1b2||'aiLicenseKeyTrialLimit'==_0x53c1b2||'aiLicenseKeyUsageLimit'==_0x53c1b2){delete _0x458486[_0x23e432],_0x3017dc=_0x53c1b2,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x3017dc&&_0x458486['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x3017dc&&_0x458486['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x3017dc&&_0x458486['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x3017dc&&_0x458486['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x3017dc&&_0x458486['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x3017dc&&_0x458486['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x3017dc&&_0x458486['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x774b9b='',_0x487a77='',_0x47ff80='custom'){const _0xb84469=this['editor'],_0x68317=_0xb84469['editing']['view'],_0x166ef4=_0xb84469['plugins']['get'](a),_0x5d18da=_0xb84469['plugins']['get'](_0x74fda4);_0x166ef4['showFakeVisualSelection']();const _0x252894=new l(),_0x12b731=new ClipboardEvent('copy',{'clipboardData':_0x252894}),_0x3c1c6f=new _0x3e32f8(_0x252894),_0xabbdd2=new _0x312164(_0x68317,_0x12b731,{'dataTransfer':_0x3c1c6f});_0x5d18da['_forceMarkersCopy']('comment',()=>{_0x68317['document']['fire']('copy',_0xabbdd2);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0xb84469,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x55e48b=_0x3c1c6f['getData']('text/html');const _0x4c0590=_0xb84469['model']['document']['selection'],_0x36ff09=Array['from'](_0x4c0590['getRanges']());0x1===_0x36ff09['length']&&_0x36ff09[0x0]['isFlat']&&!_0x4c0590['getSelectedElement']()&&''!==_0x55e48b['replace'](/&nbsp;/g,'')['trim']()&&(_0x55e48b='<p>'+_0x55e48b+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x47ff80,'query':_0x774b9b,'htmlContent':_0x55e48b,'label':_0x487a77,'mainActionLabel':_[_0xb84469['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x4d2262,'title':Hn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x33ca1e['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x166ef4['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x2a96e1=new Map(),_0x4f41d3=o(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x8908 of _0x4f41d3)for(const _0x1592d0 of _0x8908['commands'])_0x2a96e1['set'](_0x1592d0['id'],{..._0x1592d0,'groupId':_0x8908['groupId'],'groupLabel':_0x8908['groupLabel']||_0x8908['groupId']});return _0x2a96e1;}['_createAIAssistantUIButton'](_0x348a09){const _0x4e4c60=this['editor'],_0xf4ba18=_0x4e4c60['commands']['get']('showAIAssistant'),_0x5e9be2=new _0x348a09(_0x4e4c60['locale']);return _0x5e9be2['set']({'label':Hn(_0x4e4c60['locale'],'AI\x20Assistant'),'icon':_0x4d2262,'isToggleable':!0x0}),_0x5e9be2['bind']('isEnabled')['to'](_0xf4ba18),_0x5e9be2['bind']('isOn')['to'](this['_dialog'],'id',_0x381bdb=>'aiAssistant'===_0x381bdb),this['listenTo'](_0x5e9be2,'execute',()=>{_0x5e9be2['isOn']?this['hideUI']():_0xf4ba18['execute']();}),_0x5e9be2;}['_initView'](){const _0x442d84=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',()=>{_0x442d84['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x442d84['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0xee149c,ui:{ariaLiveAnnouncer:_0x27afd8}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x2cc77b,_0x391bc3,_0x17cead)=>{const _0x57c2c2=this['_aiAssistantController']['currentContext'];_0x17cead?_0x27afd8['announce'](Hn(_0xee149c,'AI\x20is\x20writing')):_0x57c2c2&&_0x27afd8['announce'](Hn(_0xee149c,'Generated\x20content:\x20%0',_0x57c2c2),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x5d73be,_0x182486,_0x3782aa)=>{if(_0x3782aa){const _0x12d746=this['_formView']['errorView']['text'];_0x27afd8['announce'](Hn(_0xee149c,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x12d746));}});}['_onExecute'](_0xd0715){const _0x296274=this['_commandDefinitions']['get'](_0xd0715),_0x39c298=this['editor'],_0x1d9df7=_0x39c298['model']['document']['selection'],_0x202912=_0x39c298['commands']['get']('showAIAssistant'),_0x455a72=_0x39c298['plugins']['get'](a),_0x585974=''+(_0x296274['groupId']!==K?_0x296274['groupLabel']+':\x20':'')+_0x296274['label'];if(!0x1!==_0x296274['requiresContent']&&_0x1d9df7['isCollapsed']){const _0x47c10c=_0x478320(_0x1d9df7['getSelectedBlocks']())||_0x39c298['model']['schema']['getLimitElement'](_0x1d9df7);_0x39c298['model']['change'](_0x1ac969=>{_0x1ac969['setSelection'](_0x47c10c,'in');});}_0x455a72['showFakeVisualSelection'](),_0x202912['execute'](_0x296274['prompt'],_0x585974,'command:'+_0xd0715);}['_populateMenuBarMenu'](_0x59323a,_0x425acd,_0x36485d,_0x16a304){const _0x9ab619=this['editor'],_0x3ac61c=_0x9ab619['locale'],_0x38e998=new _0x38e1f4(_0x3ac61c),_0x4da1ca=U(_0x9ab619,_0x36485d)['filter'](_0x5a324a=>_0x5a324a['commands']['length']);0x1===_0x4da1ca['length']?this['_getMenuBarGroupButtons']({'command':_0x59323a,'commands':_0x4da1ca[0x0]['commands'],'parentMenuView':_0x425acd,'onExecute':_0x16a304})['forEach'](_0x2a6bfa=>_0x38e998['items']['add'](_0x2a6bfa)):_0x4da1ca['forEach'](({groupId:_0x179f91,groupLabel:_0x376815,commands:_0x4d0b5c})=>{const _0xe2a42c=new _0x663667(_0x3ac61c,_0x425acd),_0xc63b3a=new _0x3154a9(_0x3ac61c),_0x2485a7=new _0x38e1f4(_0x3ac61c),_0x10ca71=this['_getMenuBarGroupButtons']({'command':_0x59323a,'commands':_0x4d0b5c,'parentMenuView':_0xc63b3a,'onExecute':_0x16a304});_0xc63b3a['buttonView']['set']({'label':_0x376815||_0x179f91}),_0xc63b3a['delegate']('execute')['to'](_0x425acd),_0x2485a7['items']['addMany'](_0x10ca71),_0xc63b3a['panelView']['children']['add'](_0x2485a7),_0xe2a42c['children']['add'](_0xc63b3a),_0x38e998['items']['add'](_0xe2a42c);}),_0x425acd['panelView']['children']['add'](_0x38e998);}['_getMenuBarGroupButtons']({command:_0x3c870c,commands:_0x2de96c,parentMenuView:_0x2a1e58,onExecute:_0x562086}){const _0x280e6d=this['editor'],_0x1a3560=_0x280e6d['locale'];return U(_0x280e6d,_0x2de96c)['map'](_0x122a86=>{const _0x2723a9=new _0x663667(_0x1a3560,_0x2a1e58),_0x5ca5f8=new _0x2cadf2(_0x1a3560);return _0x5ca5f8['set']({'label':_0x122a86['label']}),_0x5ca5f8['delegate']('execute')['to'](_0x2a1e58),_0x5ca5f8['on']('execute',()=>_0x562086(_0x122a86['id'])),_0x5ca5f8['bind']('isEnabled')['to'](_0x3c870c,'enabledCommandsIds',_0x182097=>_0x182097['includes'](_0x122a86['id'])),_0x2723a9['children']['add'](_0x5ca5f8),_0x2723a9;});}}function T(_0x26fbf1,_0x5e901f){return void 0x0!==_0x26fbf1['order']&&void 0x0===_0x5e901f['order']?0x1:void 0x0===_0x26fbf1['order']&&void 0x0!==_0x5e901f['order']?-0x1:void 0x0!==_0x26fbf1['order']&&void 0x0!==_0x5e901f['order']?_0x26fbf1['order']-_0x5e901f['order']:0x0;}function U(_0x50ce14,_0x5ba23f){_0x5ba23f['sort'](T);const _0x543c81={},_0x127ccb=[];for(const _0xc498b4 of _0x5ba23f)if(void 0x0!==_0xc498b4['order']){if(_0xc498b4['order']in _0x543c81)throw new _0x1cd47d('ai-commands-config-order-collision',_0x50ce14,{'conflictingDefinitions':[_0xc498b4,_0x543c81[_0xc498b4['order']]]});_0x543c81[_0xc498b4['order']]=_0xc498b4,_0x127ccb['splice'](_0xc498b4['order'],0x0,_0xc498b4);}else _0x127ccb['push'](_0xc498b4);return _0x127ccb;}class Dn extends _0x7bae57{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x346cad){super(_0x346cad);const _0x3d28e2=_0x346cad['config'],_0x62985f=_0x346cad['locale'];_0x3d28e2['define']('ai.assistant.preserveComments',!0x0),_0x3d28e2['define']('ai.assistant.commands',Mn(_0x62985f)),_0x3d28e2['define']('ai.assistant.extraCommandGroups',[]),_0x3d28e2['define']('ai.assistant.removeCommands',[]);let _0x327356=o(_0x3d28e2['get']('ai.assistant.commands'),_0x62985f);const _0x1c35c4=_0x3d28e2['get']('ai.assistant.extraCommandGroups'),_0x3aa297=_0x3d28e2['get']('ai.assistant.removeCommands');_0x1c35c4['forEach'](_0x1bcfdf=>{const _0x73fa4f=_0x327356['find'](_0x182466=>_0x182466['groupId']===_0x1bcfdf['groupId']);_0x73fa4f?_0x73fa4f['commands']=_0x73fa4f['commands']['concat'](_0x1bcfdf['commands']):_0x327356['push'](_0x1bcfdf);}),_0x327356=_0x327356['filter'](_0x25168e=>!_0x3aa297['includes'](_0x25168e['groupId'])),_0x327356['forEach'](_0x456d33=>{_0x456d33['commands']=_0x456d33['commands']['filter'](_0x1f8698=>!_0x3aa297['includes'](_0x1f8698['id']));}),_0x3d28e2['set']('ai.assistant.commands',_0x327356);}}function Mn(_0x58f89f){return[{'groupId':'editOrReview','groupLabel':Hn(_0x58f89f,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Hn(_0x58f89f,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Hn(_0x58f89f,'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':Hn(_0x58f89f,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Hn(_0x58f89f,'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':Hn(_0x58f89f,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Hn(_0x58f89f,'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':Hn(_0x58f89f,'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':Hn(_0x58f89f,'Change\x20tone'),'commands':[{'id':'professional','label':Hn(_0x58f89f,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Hn(_0x58f89f,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Hn(_0x58f89f,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Hn(_0x58f89f,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Hn(_0x58f89f,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Hn(_0x58f89f,'Change\x20style'),'commands':[{'id':'business','label':Hn(_0x58f89f,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Hn(_0x58f89f,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Hn(_0x58f89f,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Hn(_0x58f89f,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Hn(_0x58f89f,'Translate'),'commands':[{'id':'translateEnglish','label':Hn(_0x58f89f,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Hn(_0x58f89f,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Hn(_0x58f89f,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Hn(_0x58f89f,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Hn(_0x58f89f,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Hn(_0x58f89f,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Hn(_0x58f89f,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Hn(_0x58f89f,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ae extends _0x7bae57{['abortController'];static get['requires'](){return[x];}constructor(_0xddc2fe){super(_0xddc2fe),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](x)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x193472){return this['sendRequest'](_0x193472)['catch'](_0x156ff5=>{if(_0x156ff5 instanceof tr)return Promise['reject'](_0x156ff5);if('AbortError'==_0x156ff5['name'])return Promise['resolve']();throw console['error'](_0x156ff5),new _0x1cd47d('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x55393a,_0x3f9ca3){const _0x32fd4b=this['editor']['locale'],_0x131c80={'Content-Type':'application/json'};if('object'==typeof _0x55393a)Object['assign'](_0x131c80,_0x55393a);else{if(_0x55393a)try{const _0x269c53=await _0x55393a(_0x3f9ca3);Object['assign'](_0x131c80,_0x269c53);}catch{return Promise['reject'](new tr(Hn(_0x32fd4b,'AI_ERROR_GET_HEADERS')));}}return _0x131c80;}async['_prepareRequestParameters'](_0x11e2cf,_0x3ad83a){const _0x523369=this['editor']['locale'];if('object'==typeof _0x11e2cf)return _0x11e2cf;try{return await _0x11e2cf(_0x3ad83a);}catch{return Promise['reject'](new tr(Hn(_0x523369,'AI_ERROR_GET_PARAMETERS')));}}}class Un extends ae{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x46e8d8){super(_0x46e8d8),_0x46e8d8['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x46e8d8['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x46e8d8['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x46e8d8['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x46e8d8['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x46e8d8['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x5e3838,context:_0xe87bde,onData:_0x58c76e,actionId:_0x329e56}){const _0x1d0a6b=this['editor']['locale'],_0x215740=await this['prepareMessages'](_0x5e3838,_0xe87bde,_0x329e56),_0x30b91c=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x329e56),_0x4257ed=await this['_prepareRequestParameters'](this['_requestParameters'],_0x329e56),_0x2ff6d8={'messages':_0x215740,..._0x4257ed},_0x5eae69={'method':'POST','headers':_0x30b91c,'body':JSON['stringify'](_0x2ff6d8),'signal':this['abortController']['signal']},_0x196977=await fetch(this['_apiUrl'],_0x5eae69);if(_0x196977['ok'])return _0x4257ed['stream']?await this['_readStreamableResponse'](_0x196977,_0x58c76e):await this['_readStaticResponse'](_0x196977,_0x58c76e),Promise['resolve']();{const _0x5f1910=await _0x196977['text']();return _0x5f1910['includes']('context_length_exceeded')?Promise['reject'](new tr(Hn(_0x1d0a6b,'AI_ERROR_CONTEXT_LENGTH'))):_0x5f1910['includes']('Moderation')?Promise['reject'](new tr(Hn(_0x1d0a6b,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x5f1910));}}async['prepareMessages'](_0x1fcb68,_0x22b8de,_0x357758){let _0x31dce7,_0x393f3f;return _0x22b8de?(_0x31dce7='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.',_0x393f3f='Instruction:\x0a'+_0x1fcb68+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x22b8de):(_0x31dce7='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.',_0x393f3f=_0x1fcb68),[{'role':'system','content':_0x31dce7},{'role':'user','content':_0x393f3f}];}async['_readStreamableResponse'](_0x4092b6,_0x2a10a2){const _0x51617d=_0x4092b6['body']['getReader'](),_0xb47d1d=new TextDecoder();let _0x5da4da='',_0x10ceea='',_0x1d9359='',_0x446aca=!0x1;for(;!_0x446aca;){const {done:_0x2e05af,value:_0x4e70f1}=await _0x51617d['read'](),_0x503b56=_0x5da4da+_0xb47d1d['decode'](_0x4e70f1);let _0x1cfdc0='';_0x446aca=_0x2e05af;try{_0x1cfdc0=this['_cleanUpData'](_0x503b56),_0x5da4da='';}catch{_0x5da4da=_0x503b56;continue;}_0x10ceea+=_0x1cfdc0,!_0x446aca&&this['_isBufferIncomplete'](_0x10ceea)||_0x10ceea&&(_0x1d9359+=_0x10ceea,_0x10ceea='',_0x2a10a2(_0x1d9359));}return Promise['resolve']();}async['_readStaticResponse'](_0x4010d0,_0x1ff92e){return _0x1ff92e((await _0x4010d0['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x309042){const _0x4f5b7f=_0x309042['split']('<')['length']!==_0x309042['split']('>')['length'],_0x667ed1=_0x309042['length']<0x1e;return _0x4f5b7f&&_0x667ed1;}['_cleanUpData'](_0x5b11cb){return _0x5b11cb['split'](/\n(?![^{]*\})/g)['map'](_0x275dfb=>_0x275dfb['replace']('data:\x20',''))['filter'](_0x3a84bd=>_0x3a84bd&&_0x3a84bd['length']>0x0&&'[DONE]'!==_0x3a84bd)['map'](_0x4b45b1=>{const {choices:_0x5bdb04}=JSON['parse'](_0x4b45b1);if(_0x5bdb04[0x0]?.['delta']?.['content'])return _0x5bdb04[0x0]['delta']['content'];})['filter'](_0x3146fe=>_0x3146fe)['join']('');}}class Vn extends ae{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x22d5e7){super(_0x22d5e7),_0x22d5e7['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x22d5e7['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']=_0x22d5e7['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x22d5e7['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x22d5e7['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x22d5e7['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x4db793,context:_0x3f878f,onData:_0x2d28af,actionId:_0x3b91f1}){const {model:_0x2d555b,stream:_0x51280a,..._0x43b8d6}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x3b91f1),_0x11698f={'prompt':await this['preparePrompt'](_0x4db793,_0x3f878f,_0x2d555b,_0x3b91f1),..._0x43b8d6};this['_apiUrl']?await this['_processProxyRequest'](_0x11698f,_0x2d555b,_0x51280a,_0x2d28af,_0x3b91f1):await this['_processAWSRequest'](_0x11698f,_0x2d555b,_0x51280a,_0x2d28af);}async['preparePrompt'](_0x23f632,_0x2e3d36,_0x4ad99b,_0x37827a){let _0x1a5110,_0x152936;return _0x2e3d36?(_0x1a5110='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.',_0x152936='Instruction:\x0a'+_0x23f632+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x2e3d36):(_0x1a5110='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.',_0x152936=_0x23f632),'meta.llama'==this['getModelFamily'](_0x4ad99b)?'<<SYS>>\x0a'+_0x1a5110+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x152936+'\x0a[/INST]':'Human:\x0a'+_0x1a5110+'\x0a'+_0x152936+'\x0a\x0aAssistant:';}['getModelFamily'](_0x1a16a1){if(/^anthropic\.claude/['test'](_0x1a16a1))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x1a16a1))return'ai21.j2';if(/^cohere\.command/['test'](_0x1a16a1))return'cohere.command';if(/^meta\.llama/['test'](_0x1a16a1))return'meta.llama';throw new tr(Hn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x1a16a1));}async['_processProxyRequest'](_0x2a28fd,_0x571439,_0x3bf939,_0x5203d7,_0x2f8d69){const _0x11f740={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2f8d69),'body':JSON['stringify']({..._0x2a28fd,'model':_0x571439,'stream':_0x3bf939}),'signal':this['abortController']['signal']},_0x12911f=await fetch(this['_apiUrl'],_0x11f740);_0x3bf939?await this['_readStreamableResponse'](_0x12911f,_0x571439,_0x5203d7):await this['_readStaticResponse'](_0x12911f,_0x571439,_0x5203d7);}async['_processAWSRequest'](_0x4a7562,_0x4ab1bf,_0x1d8301,_0x465cc8){const _0x39eb61=new _0x21ad39(this['_bedrockClientConfig']),_0x27432e={'body':JSON['stringify'](_0x4a7562),'contentType':'application/json','accept':'application/json','modelId':_0x4ab1bf};let _0x440a82;if(_0x1d8301){const _0x14ebac=new _0x57c849(_0x27432e);_0x440a82=await _0x39eb61['send'](_0x14ebac,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x440a82,_0x4ab1bf,_0x465cc8);}else{const _0x3959a9=new _0x433d40(_0x27432e);_0x440a82=await _0x39eb61['send'](_0x3959a9,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x440a82,_0x4ab1bf,_0x465cc8);}}async['_readAsyncIterableResponse'](_0x4273ea,_0x2f62cf,_0x392c9e){const _0x8f00a0=_0x4273ea['body'],_0x94d4aa=new TextDecoder('utf-8');let _0x589f5e='';for await(const _0x5ae4f7 of _0x8f00a0)if(_0x5ae4f7['chunk']){const _0x1f6475=_0x94d4aa['decode'](_0x5ae4f7['chunk']['bytes']),_0x5b7b3e=JSON['parse'](_0x1f6475);_0x589f5e+=this['_getGeneratedText'](_0x5b7b3e,_0x2f62cf),_0x392c9e(_0x589f5e);}return Promise['resolve']();}async['_readStreamableResponse'](_0x11c998,_0x1650cf,_0x56e3e5){const _0x3786fa=_0x11c998['body'],_0x330af2=new TextDecoder('utf-8'),_0xebec55=_0x3786fa['getReader']();let _0xdd4f1c='',_0x5c96b1='',_0x3dd70f=!0x1;for(;!_0x3dd70f;){const {done:_0x21fa7d,value:_0x34f205}=await _0xebec55['read']();if(_0x3dd70f=_0x21fa7d,_0x3dd70f)break;const _0x4322e7=(_0xdd4f1c+_0x330af2['decode'](_0x34f205))['split']('\x0a')['map'](_0xcb7ec7=>{try{return _0xdd4f1c='',JSON['parse'](_0xcb7ec7);}catch{return _0xdd4f1c=_0xcb7ec7,null;}})['filter'](_0x344a71=>null!==_0x344a71);_0x4322e7['length']&&(_0x5c96b1+=_0x4322e7['map'](_0xb0177a=>this['_getGeneratedText'](_0xb0177a,_0x1650cf))['join'](''),_0x56e3e5(_0x5c96b1));}return Promise['resolve']();}async['_readStaticResponse'](_0x1e9dea,_0x6ef683,_0xa4c609){let _0x58d55b;return _0x58d55b=_0x1e9dea instanceof Response?await _0x1e9dea['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x1e9dea['body'])),(_0xa4c609(this['_getGeneratedText'](_0x58d55b,_0x6ef683)),Promise['resolve']());}['_getGeneratedText'](_0x5b348b,_0x49ada3){switch(this['getModelFamily'](_0x49ada3)){case'anthropic.claude':return _0x5b348b['completion'];case'ai21.j2':return _0x5b348b['completions'][0x0]['data']['text'];case'cohere.command':return _0x5b348b['generations'][0x0]['text'];case'meta.llama':return _0x5b348b['generation'];}}}class Qs extends _0x21c9df{constructor(_0x8fffc8,_0x570cdf={}){super(_0x8fffc8),this['isToggleable']=!0x0,this['set']('side',_0x570cdf['side']||'top');const _0x17195a=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0xbff00a(_0x570cdf['class']||[]),_0x17195a['to']('side',_0x4ca09e=>'ck-tab-button_'+_0x4ca09e),_0x17195a['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class Us extends _0x2855e5{['children'];constructor(_0x33f3d2,_0x1650b8={}){super(_0x33f3d2);const _0x556ce7=this['bindTemplate'];this['set']('isVisible',!0x1),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0xbff00a(_0x1650b8['class']||[]),_0x556ce7['to']('class'),_0x556ce7['if']('isVisible','ck-hidden',_0x1cdb89=>!_0x1cdb89)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ts extends _0x2855e5{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0xea9469,_0x379335={}){super(_0xea9469),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x379335['side']||'top'),this['set']('isMaximized',!0x1);const _0x1934ea=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0xbff00a(_0x379335['class']||[]),_0x1934ea['to']('side',_0x13eeca=>'ck-tabs_'+_0x13eeca),_0x1934ea['to']('class'),_0x1934ea['to']('isMaximized',_0x69505a=>_0x69505a?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x1934ea['to']('side',_0x48ab47=>'ck-tabs__buttons-container_'+_0x48ab47)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x1934ea['to']('side',_0x23038b=>'ck-tabs__panels-container_'+_0x23038b)]},'children':this['panelViews']},..._0xbff00a(_0x379335['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x517569){const _0x20c5f8=this['_tabs']['get'](_0x517569);return _0x20c5f8||null;}['addTab'](_0x10a291){const _0x146481=this['_setupButton']({'id':_0x10a291['id'],'label':_0x10a291['buttonLabel'],'icon':_0x10a291['buttonIcon'],'order':_0x10a291['order']}),_0x5bb641=new Us(this['locale']);return _0x5bb641['render'](),_0x10a291['content']&&_0x5bb641['children']['add'](_0x10a291['content']),this['panelViews']['add'](_0x5bb641),this['_tabs']['set'](_0x10a291['id'],{'button':_0x146481,'panel':_0x5bb641,'order':void 0x0!==_0x10a291['order']?_0x10a291['order']:null}),this['fire']('addTab:'+_0x10a291['id'],{'id':_0x10a291['id'],'button':_0x146481,'panel':_0x5bb641}),null===this['activeTab']?this['activateTab'](_0x10a291['id']):this['_hidePanel'](_0x10a291['id']),{'button':_0x146481,'panel':_0x5bb641};}['activateTab'](_0x18033d){if(null!==_0x18033d&&!this['getTab'](_0x18033d))throw new _0x1cd47d('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x18033d});this['activeTab']!==_0x18033d&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x18033d,_0x18033d&&this['_showPanel'](_0x18033d),this['fire']('activateTab:'+_0x18033d,_0x18033d));}['showTab'](_0x45a3ba){if(!this['getTab'](_0x45a3ba))throw new _0x1cd47d('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x45a3ba});this['_showPanel'](_0x45a3ba),this['_showButton'](_0x45a3ba),this['fire']('show:'+_0x45a3ba,_0x45a3ba);}['hideTab'](_0x3a08af){if(!this['getTab'](_0x3a08af))throw new _0x1cd47d('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x3a08af});const _0x53fc03=this['activeTab'];this['_hidePanel'](_0x3a08af),this['_hideButton'](_0x3a08af);const _0x36470f=this['getTabIds']();_0x53fc03===_0x3a08af&&_0x36470f['length']>0x1&&this['activateTab'](_0x36470f['find'](_0x4a0486=>_0x4a0486!==_0x3a08af)),this['fire']('hide:'+_0x3a08af,_0x3a08af);}['_getPanel'](_0x41db0b){const _0x1a4089=this['_tabs']['get'](_0x41db0b);return _0x1a4089?_0x1a4089['panel']:null;}['_showPanel'](_0xdb9f63){null!==this['activeTab']&&this['activeTab']!==_0xdb9f63||this['_getPanel'](_0xdb9f63)['show']();}['_hidePanel'](_0x3c06fc){const _0x1d4ff2=this['_getPanel'](_0x3c06fc);_0x1d4ff2['isVisible']&&(this['activeTab']===_0x3c06fc&&(this['activeTab']=null),_0x1d4ff2['hide']());}['_getButton'](_0x11894e){const _0x3f4e11=this['_tabs']['get'](_0x11894e);return _0x3f4e11?_0x3f4e11['button']:null;}['_showButton'](_0x3f55db){this['_getButton'](_0x3f55db)['show']();}['_hideButton'](_0xad8868){this['_getButton'](_0xad8868)['hide']();}['_setupButton'](_0x27b568){const _0x1e009f=new Qs(this['locale'],{'side':this['side']}),_0x42b114=this['buttonViews'];if(_0x1e009f['set']({'label':_0x27b568['label'],'icon':_0x27b568['icon'],'tooltip':!0x0,'withText':!0x0}),_0x1e009f['bind']('isOn')['to'](this,'activeTab',_0xbc8d45=>_0xbc8d45===_0x27b568['id']),_0x1e009f['bind']('side')['to'](this,'side'),_0x27b568['order']){const _0x3df1a0=[...this['_tabs']]['reduce']((_0x2f75fe,_0x124f2f)=>{const _0x3cd987=_0x124f2f[0x0],{order:_0x56ff2c}=_0x124f2f[0x1];return!_0x56ff2c||_0x56ff2c>_0x27b568['order']?_0x2f75fe:_0x56ff2c>=_0x2f75fe['order']?{'id':_0x3cd987,'order':_0x56ff2c}:_0x2f75fe;},{'id':'','order':0x0}),_0x112686=_0x42b114['getIndex'](this['_getButton'](_0x3df1a0['id']));_0x42b114['add'](_0x1e009f,_0x112686+0x1);}else _0x42b114['add'](_0x1e009f);return _0x1e009f['on']('execute',()=>{this['activateTab'](_0x27b568['id']);}),_0x1e009f;}}const pi=['overlay','sidebar','custom'],di=['left','right'];class ui extends ts{constructor(_0xd3ea2a,_0x1c3596={}){super(_0xd3ea2a,_0x1c3596),this['set']('type',_0x1c3596['type']||'sidebar'),this['set']('side',_0x1c3596['side']||'right');const _0x320883=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x320883['if']('type','ck-ai-tabs__overlay',_0x42dfa1=>'overlay'===_0x42dfa1),_0x320883['if']('type','ck-ai-tabs__sidebar',_0x240173=>'sidebar'===_0x240173)]}}),this['buttonViews']['on']('add',(_0x481afc,_0x2d45f3)=>{_0x2d45f3['set']('withText',!0x1);});}}class rt extends _0x599126{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x170b16){super(_0x170b16);const _0x46a8fb=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x46a8fb)throw new _0x1cd47d('ai-tabs-configuration-not-found');if(void 0x0!==_0x46a8fb['showResizeButton']&&(this['showResizeButton']=_0x46a8fb['showResizeButton']),'sidebar'!==_0x46a8fb['type']&&'overlay'!==_0x46a8fb['type']||_0x46a8fb['side']&&(this['side']=_0x46a8fb['side']),'sidebar'===_0x46a8fb['type']){if(this['container']=_0x46a8fb['element'],this['set']('type','sidebar'),!this['container'])throw new _0x1cd47d('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x46a8fb['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new ui(this['context']['locale'],{'side':this['side'],'type':this['type']}),this['view']['render'](),this['view']['bind']('side')['to'](this,'side'),this['view']['bind']('type')['to'](this,'type'),this['container']&&this['container']['appendChild'](this['view']['element']),this['context']instanceof st&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0xe36936){if(_0xe36936&&this['type']!==_0xe36936){if(!pi['includes'](_0xe36936))throw new _0x1cd47d('ai-tabs-unsupported-ui-type');this['type']=_0xe36936;}}['switchSide'](_0x46ee12){if(_0x46ee12&&this['side']!==_0x46ee12){if(!di['includes'](_0x46ee12))throw new _0x1cd47d('ai-tabs-unsupported-ui-side');this['side']=_0x46ee12;}}['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']();}}function Gn(_0x58c2fd,_0x588792,_0x11ccb6){const t=_0x58c2fd['t'];switch(_0x588792){case'AI_SUGGESTION_HEADER_TITLE':return t({'id':'AI_SUGGESTION_HEADER_TITLE','string':'Suggested\x20content'});case'AI_SUGGESTION_BUTTON_SHOW_CHANGES':return t({'id':'AI_SUGGESTION_BUTTON_SHOW_CHANGES','string':'Show\x20changes'});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':'Suggestion\x20%0'},_0x11ccb6);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});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':'Show\x20in\x20the\x20text'});case'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION','string':'Add\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_DELETE':return t({'id':'AI_SUGGESTION_CONTENT_PART_DELETE','string':'Delete'});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':'AI\x20Chat'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi,\x20I\x27m\x20your\x20AI\x20assistant.\x20Think\x20of\x20me\x20as\x20your\x20writing\x20buddy,\x20reviewer,\x20or\x20research\x20partner.\x20I\x20can\x20suggest\x20changes\x20to\x20your\x20document,\x20help\x20generate\x20ideas,\x20offer\x20feedback,\x20discuss\x20attached\x20files,\x20and\x20much\x20more!'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'The\x20request\x20was\x20aborted.'});case'AI_CHAT_GENERIC_ERROR':return t({'id':'AI_CHAT_GENERIC_ERROR','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_START_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_START_CONVERSATION','string':'Unable\x20to\x20start\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE','string':'Failed\x20to\x20upload\x20files:\x20%0.\x20Please\x20try\x20again.'},_0x11ccb6);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.'},_0x11ccb6);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.'},_0x11ccb6);case'AI_CHAT_CONTEXT_INVALID_DATA':return t({'id':'AI_CHAT_CONTEXT_INVALID_DATA','string':'Invalid\x20context\x20data\x20type\x20for\x20the\x20selected\x20resource.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE','string':'Unsupported\x20resource\x20type.\x20Only\x20files\x20and\x20URLs\x20are\x20supported.'});case'AI_CHAT_CONTEXT_URL_EMPTY_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_EMPTY_ERROR','string':'URL\x20cannot\x20be\x20empty.'});case'AI_CHAT_CONTEXT_URL_INVALID_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_INVALID_ERROR','string':'Please\x20enter\x20a\x20valid\x20URL.'});case'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR','string':'AI\x20is\x20preparing\x20a\x20response...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH','string':'AI\x20is\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REASONING','string':'AI\x20is\x20performing\x20deep\x20research\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\x20performing\x20deep\x20research\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':'Thought\x20for\x20a\x20few\x20minutes'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING','string':'Took\x20a\x20moment\x20to\x20think\x20and\x20search\x20the\x20web'});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':'Show\x20change\x20in\x20text','plural':'Show\x20changes\x20in\x20text'},_0x11ccb6);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION','string':'Insert\x20suggestion','plural':'Insert\x20suggestions'},_0x11ccb6);case'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL','string':'Apply','plural':'Apply\x20all'},_0x11ccb6);case'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP','string':'Apply\x20suggestion','plural':'Apply\x20all\x20suggestions'},_0x11ccb6);case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x11ccb6);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\x20a\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_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.'},_0x11ccb6);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\x20is\x20currently\x20empty.\x20After\x20you\x20create\x20some\x20conversations,\x20you\x20will\x20be\x20able\x20to\x20revisit\x20them\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':'Sorry,\x20we\x20couldn\x27t\x20change\x20the\x20\x22%0\x22\x20chat\x20name.\x20Please\x20try\x20again\x20in\x20a\x20moment.'},_0x11ccb6);case'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED':return t({'id':'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED','string':'Sorry,\x20we\x20couldn\x27t\x20%0\x20the\x20\x22%1\x22\x20chat.\x20Please\x20try\x20again\x20in\x20a\x20moment.'},_0x11ccb6);case'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM':return t({'id':'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM','string':'Sorry,\x20we\x20couldn\x27t\x20delete\x20the\x20\x22%0\x22\x20chat.\x20Please\x20try\x20again\x20in\x20a\x20moment.'},_0x11ccb6);case'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS':return t({'id':'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20chat\x20history.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_CHAT_HISTORY_ERROR_GENERIC':return t({'id':'AI_CHAT_HISTORY_ERROR_GENERIC','string':'Something\x20went\x20wrong.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});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_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':'The\x20suggestion\x20can’t\x20be\x20applied\x20to\x20the\x20editor\x20because\x20the\x20system\x20can’t\x20display\x20it\x20correctly..'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20suggestions\x20can’t\x20be\x20applied\x20to\x20the\x20editor\x20because\x20the\x20system\x20can’t\x20display\x20them\x20correctly.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Try\x20again'});case'AI_MODEL_DESCRIPTION_AGENT-1':return t({'id':'AI_MODEL_DESCRIPTION_AGENT-1','string':'Automatically\x20selects\x20the\x20best\x20model\x20for\x20speed,\x20quality,\x20and\x20cost'});case'AI_MODEL_DESCRIPTION_GPT-5':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5','string':'OpenAI\x27s\x20flagship\x20model\x20for\x20advanced\x20reasoning,\x20creativity,\x20and\x20complex\x20tasks'});case'AI_MODEL_DESCRIPTION_GPT-5-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5-MINI','string':'A\x20lightweight\x20version\x20of\x20GPT-5\x20for\x20faster,\x20more\x20cost-efficient\x20responses'});case'AI_MODEL_DESCRIPTION_GPT-4.1':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1','string':'OpenAI\x27s\x20model\x20for\x20reliable\x20reasoning,\x20speed,\x20and\x20versatility'});case'AI_MODEL_DESCRIPTION_GPT-4.1-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1-MINI','string':'A\x20lighter\x20variant\x20of\x20GPT-4.1\x20that\x20balances\x20speed\x20and\x20cost\x20while\x20maintaining\x20solid\x20accuracy'});case'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU','string':'Anthropic\x27s\x20fast,\x20cost-efficient\x20model\x20for\x20simpler\x20tasks'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-SONNET':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-SONNET','string':'Advanced\x20model\x20with\x20strong\x20reasoning\x20and\x20reliability\x20for\x20complex\x20tasks'});case'AI_MODEL_DESCRIPTION_GEMINI-2-5-PRO':return t({'id':'AI_MODEL_DESCRIPTION_GEMINI-2-5-PRO','string':'Google\x27s\x20advanced\x20model\x20for\x20versatile\x20problem-solving\x20and\x20research'});case'AI_MODEL_DESCRIPTION_GEMINI-2-5-FLASH':return t({'id':'AI_MODEL_DESCRIPTION_GEMINI-2-5-FLASH','string':'Lightweight\x20Gemini\x20model\x20for\x20fast,\x20cost-efficient\x20interactions'});case'AI_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.\x20You\x20can\x20now\x20return\x20to\x20the\x20command\x20list.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20whole\x20review\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE','string':'Not\x20everything\x20went\x20through,\x20but\x20the\x20completed\x20items\x20are\x20listed\x20below.'});case'AI_REVIEW_MODE':return t({'id':'AI_REVIEW_MODE','string':'Review\x20Mode'});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':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.'});case'AI_REVIEW_CHECK_CORRECTNESS_TITLE':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_TITLE','string':'Correctness'});case'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION','string':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.'});case'AI_REVIEW_CHECK_CLARITY_TITLE':return t({'id':'AI_REVIEW_CHECK_CLARITY_TITLE','string':'Clarity'});case'AI_REVIEW_CHECK_CLARITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CLARITY_DESCRIPTION','string':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.'});case'AI_REVIEW_CHECK_READABILITY_TITLE':return t({'id':'AI_REVIEW_CHECK_READABILITY_TITLE','string':'Readability'});case'AI_REVIEW_CHECK_READABILITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_READABILITY_DESCRIPTION','string':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.'});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':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.'});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':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.'});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'});default:return _0x588792;}}class N extends _0x599126{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x385a31){super(_0x385a31),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 _0x5e960e=this['context']['plugins']['get']('CloudServices');if(!_0x5e960e['token'])throw new _0x1cd47d('ai-missing-token',this);this['_token']=_0x5e960e['token'];}['startConversation'](_0x53a278,_0x45206d){const _0x1c308e=this['_sendApiRequest']('/conversations','POST',{'id':_0x53a278,'group':_0x45206d});return{'getConversation':async()=>(await _0x1c308e['request'])['json'](),'abortController':_0x1c308e['abortController']};}['queryAssistant']({message:_0x1a9600,conversationId:_0x438e4e,parts:_0x10c55b,capabilities:_0x460e15,model:_0x3bf4d6,quickActionData:_0x172ad4}){const _0x5a2fca={..._0x172ad4&&{'quickActionData':_0x172ad4}},_0x3ad0df={'prompt':_0x1a9600,'content':_0x10c55b,'model':_0x3bf4d6,..._0x460e15&&{'capabilities':_0x460e15},...Object['keys'](_0x5a2fca)['length']>0x0&&{'attributes':_0x5a2fca}},_0x493838=this['_sendApiRequest']('/conversations/'+_0x438e4e+'/messages','POST',_0x3ad0df);return{'getStream':async()=>{const _0x5f184=(await _0x493838['request'])['body'];return this['_getStreamReader'](_0x5f184);},'abortController':_0x493838['abortController']};}['executeCustomAction']({content:_0x3edd54,message:_0x25c927,model:_0x5bbba9,outputFormat:_0x196993}){const _0x5219b6={'content':[{'type':'text','content':_0x3edd54}],'prompt':_0x25c927,'model':_0x5bbba9,'outputFormat':_0x196993},_0x2d0ed4=this['_sendApiRequest']('/actions/custom/calls','POST',_0x5219b6);return{'getStream':async()=>{const _0x4e99cc=(await _0x2d0ed4['request'])['body'];return this['_getStreamReader'](_0x4e99cc);},'abortController':_0x2d0ed4['abortController']};}['executeAction']({actionName:_0x5ac2ac,content:_0x324109,args:_0x4f3cf9}){const _0x52fd1e={'content':[{'type':'text','content':_0x324109}],'args':_0x4f3cf9},_0x12af52=this['_sendApiRequest']('/actions/system/'+_0x5ac2ac+'/calls','POST',_0x52fd1e);return{'getStream':async()=>{const _0x30812f=(await _0x12af52['request'])['body'];return this['_getStreamReader'](_0x30812f);},'abortController':_0x12af52['abortController']};}['uploadFile'](_0x1dea25,_0x4fa828,_0x19f306){const _0x446a41=new FormData();_0x446a41['append']('file',_0x4fa828,_0x4fa828['name']),_0x19f306&&_0x446a41['append']('attributes',JSON['stringify'](_0x19f306));const _0x51cd55=this['_sendApiRequest']('/conversations/'+_0x1dea25+'/files','POST',_0x446a41);return{'getId':async()=>(await _0x51cd55['request'])['json'](),'abortController':_0x51cd55['abortController']};}['fetchDocument'](_0x4468a5,_0x1cbbdc){const _0x285a64=this['_sendApiRequest']('/conversations/'+_0x4468a5+'/documents/'+_0x1cbbdc,'GET');return{'getDocument':async()=>(await _0x285a64['request'])['json'](),'abortController':_0x285a64['abortController']};}['uploadDocument'](_0x566261,_0x14a3d7,_0x3dcfd4){const _0x3ae75b={'content':_0x14a3d7};_0x3dcfd4&&(_0x3ae75b['attributes']=_0x3dcfd4);const _0x1a0671=this['_sendApiRequest']('/conversations/'+_0x566261+'/documents','POST',_0x3ae75b);return{'getId':async()=>(await _0x1a0671['request'])['json'](),'abortController':_0x1a0671['abortController']};}['fetchConversations'](_0x5a25ac,_0x53f1a1){const _0x33b948=new URLSearchParams();_0x33b948['append']('excludeEmpty','true'),_0x33b948['append']('limit','100'),_0x33b948['append']('group',_0x5a25ac),_0x53f1a1&&_0x33b948['append']('search',_0x53f1a1);const _0x54b518=this['_sendApiRequest']('/conversations?'+_0x33b948['toString'](),'GET');return{'getConversations':async()=>{const _0x2f716b=await _0x54b518['request'];return(await _0x2f716b['json']())['items'];},'abortController':_0x54b518['abortController']};}['deleteConversation'](_0x54a207){const _0x3c2fef=this['_sendApiRequest']('/conversations/'+_0x54a207,'DELETE');return{'execute':async()=>{await _0x3c2fef['request'];},'abortController':_0x3c2fef['abortController']};}['updateConversation'](_0x112065,_0x1cb76d){const _0x15cb6a=this['_sendApiRequest']('/conversations/'+_0x112065,'PATCH',_0x1cb76d);return{'getResult':async()=>(await _0x15cb6a['request'],_0x1cb76d),'abortController':_0x15cb6a['abortController']};}['fetchConversation'](_0x27c018){const _0x4af8e2=this['_sendApiRequest']('/conversations/'+_0x27c018,'GET');return{'getConversation':async()=>(await _0x4af8e2['request'])['json'](),'abortController':_0x4af8e2['abortController']};}['fetchConversationMessages'](_0x1e037f){const _0x469d07=this['_sendApiRequest']('/conversations/'+_0x1e037f+'/messages','GET');return{'getMessages':async()=>{const _0x3258c3=await _0x469d07['request'];return(await _0x3258c3['json']())['items'];},'abortController':_0x469d07['abortController']};}['uploadUrl'](_0x33691d,_0xbf584a,_0x55df42){const _0x43bc8a=this['_sendApiRequest']('/conversations/'+_0x33691d+'/web-resources','POST',{'url':_0xbf584a,'attributes':_0x55df42});return{'getId':async()=>(await _0x43bc8a['request'])['json'](),'abortController':_0x43bc8a['abortController']};}['getModels'](){const _0x202c40=this['_sendApiRequest']('/models/1','GET');return{'list':async()=>{const _0x2789bc=await(await _0x202c40['request'])['json'](),_0x331f3d=_0x2789bc['items']['map'](_0x1dd779=>({..._0x1dd779,'description':Gn(this['context']['locale'],'AI_MODEL_DESCRIPTION_'+_0x1dd779['id']['toUpperCase']())}));return{..._0x2789bc,'items':_0x331f3d};},'abortController':_0x202c40['abortController']};}['deleteFile'](_0x542aab,_0x4baabb){const _0x136bc2=this['_sendApiRequest']('/conversations/'+_0x542aab+'/files/'+_0x4baabb,'DELETE');return{'execute':async()=>{await _0x136bc2['request'];},'abortController':_0x136bc2['abortController']};}['deleteDocument'](_0x3228be,_0xb1e660){const _0x22b6fd=this['_sendApiRequest']('/conversations/'+_0x3228be+'/documents/'+_0xb1e660,'DELETE');return{'execute':async()=>{await _0x22b6fd['request'];},'abortController':_0x22b6fd['abortController']};}['deleteWebResource'](_0x3b554c,_0x5cc410){const _0x288c84=this['_sendApiRequest']('/conversations/'+_0x3b554c+'/web-resources/'+_0x5cc410,'DELETE');return{'execute':async()=>{await _0x288c84['request'];},'abortController':_0x288c84['abortController']};}['callSystemReview']({reviewName:_0x58a772,content:_0x4c47a7,args:_0x344dde}){const _0x1e9bc0=this['_sendApiRequest']('/reviews/system/'+_0x58a772+'/calls','POST',{'content':[{'type':'text','content':_0x4c47a7}],'args':_0x344dde});return{'getStream':async()=>{const _0x555ba8=(await _0x1e9bc0['request'])['body'];return this['_getStreamReader'](_0x555ba8);},'abortController':_0x1e9bc0['abortController']};}['callCustomReview']({content:_0x459a83,prompt:_0xa0fb2f,model:_0x8e9408}){const _0x126b28=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x459a83}],'prompt':_0xa0fb2f,'model':_0x8e9408});return{'getStream':async()=>{const _0x5dedb4=(await _0x126b28['request'])['body'];return this['_getStreamReader'](_0x5dedb4);},'abortController':_0x126b28['abortController']};}['_sendApiRequest'](_0x41936d,_0x332ed8,_0x4128e5){const _0x1c2b96=new AbortController(),_0x9dc149=_0x4128e5 instanceof FormData,_0x2d104c={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x4128e5&&!_0x9dc149&&(_0x2d104c['Content-Type']='application/json');const _0x25ab32={'method':_0x332ed8,'headers':_0x2d104c,'signal':_0x1c2b96['signal']};return _0x4128e5&&(_0x25ab32['body']=_0x9dc149?_0x4128e5:JSON['stringify'](_0x4128e5)),{'request':fetch(''+this['_apiUrl']+_0x41936d,_0x25ab32)['catch'](_0x2daf47=>{this['_handleError'](_0x2daf47);})['then'](_0x583f0e=>{if(!_0x583f0e['ok'])throw new _0x1cd47d('ai-request-failed',this);return _0x583f0e;}),'abortController':_0x1c2b96};}async*['_getStreamReader'](_0x1dcbb5){const _0x59742f=[],_0x57c306=_0x1dcbb5['getReader'](),_0x4e9ef4=wt({'onError':_0x3390dd=>{this['_handleError'](_0x3390dd);},'onEvent':_0xd95558=>{_0xd95558['data']=JSON['parse'](_0xd95558['data']),_0x59742f['push'](_0xd95558);}});try{let _0x56ad1d=!0x1;for(;!_0x56ad1d;){const {done:_0x5c535e,value:_0x50c366}=await _0x57c306['read']();_0x5c535e&&(_0x56ad1d=!0x0),_0x4e9ef4['feed'](this['_decoder']['decode'](_0x50c366,{'stream':!0x0})),yield*_0x59742f,_0x59742f['length']=0x0;}}catch(_0x971f94){this['_handleError'](_0x971f94);}finally{_0x57c306['releaseLock'](),_0x4e9ef4['reset']();}}['_handleError'](_0x26385e){if(_0x26385e instanceof _0x1cd47d)throw _0x26385e;if(_0x26385e instanceof Error&&'AbortError'===_0x26385e['name'])throw new _0x1cd47d('ai-request-aborted',this,{'originalError':_0x26385e});throw new _0x1cd47d('ai-request-failed',this,{'originalError':_0x26385e});}}function As(_0x47160d,_0x4e7f82){const _0x7ca9a1=new _0x21c9df(_0x47160d),_0x4011b0=Gn(_0x47160d,'AI_TABS_LABEL_MINIMIZE'),_0x47d71c=Gn(_0x47160d,'AI_TABS_LABEL_MAXIMIZE');return _0x7ca9a1['set']({'withText':!0x1,'icon':_0xb46797,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary-text'}),_0x7ca9a1['bind']('label')['to'](_0x4e7f82,'isMaximized',_0x1817a1=>_0x1817a1?_0x4011b0:_0x47d71c),_0x7ca9a1['bind']('icon')['to'](_0x4e7f82,'isMaximized',_0xa04e14=>_0xa04e14?_0x5be3af:_0xb46797),_0x7ca9a1['bind']('isOn')['to'](_0x4e7f82,'isMaximized'),_0x7ca9a1['on']('execute',()=>{_0x4e7f82['fire']('resizeTabs');}),_0x7ca9a1;}function sr(_0x1a5cb8){return _0x597dd1(_0x1a5cb8);}function Ct(_0x3e9278){return _0x390fc6(_0x3e9278);}function It(_0x57edac,_0x33fe26,_0x52a8da){const _0x48d82a=null!==_0x33fe26?_0xe5b406=>_0xe5b406['attribs'][_0x57edac]===_0x33fe26:_0x5a31ee=>Boolean(_0x5a31ee['attribs'][_0x57edac]);return mt(_0x600a41=>_0x1d4fa0(_0x600a41)&&_0x48d82a(_0x600a41),_0x52a8da);}function Ne(_0x177425,_0x43cab8,_0x2acdf1){const _0x56c6c4=null!==_0x43cab8?_0x3f4702=>_0x3f4702['attribs'][_0x177425]===_0x43cab8:_0x174f5c=>Boolean(_0x174f5c['attribs'][_0x177425]);return _0x221490(_0x271541=>_0x1d4fa0(_0x271541)&&_0x56c6c4(_0x271541),_0x2acdf1);}function ft(_0x598bd1,_0x101627){return _0x598bd1&&_0x1d4fa0(_0x598bd1)?_0x598bd1['attribs'][_0x101627]:null;}function Re(_0x2d1847,_0x413337,_0x3a5c9b){_0x1d4fa0(_0x2d1847)&&(null===_0x3a5c9b?delete _0x2d1847['attribs'][_0x413337]:_0x2d1847['attribs'][_0x413337]=_0x3a5c9b);}function Ae(_0x13af2e,_0x171b3d,_0x5d5857){const _0x510af8=_0x171b3d['cloneNode'](!0x0);'beforebegin'===_0x5d5857?_0x5c380d(_0x13af2e,_0x510af8):'afterbegin'===_0x5d5857?to(_0x13af2e,_0x510af8):'beforeend'===_0x5d5857?_0x2ef3de(_0x13af2e,_0x510af8):'afterend'===_0x5d5857&&_0x533ed6(_0x13af2e,_0x510af8);}function qe(_0x2a7856){const _0x31b835=[];let _0x574b9f=_0x2a7856;for(;_0x574b9f;)_0x574b9f=_0x5c004e(_0x574b9f),_0x574b9f&&_0x31b835['push'](_0x574b9f);return _0x31b835;}function Bn(_0x15b4bd){return _0x15b4bd['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function ze(_0x35f25f){let _0x1b65e0=0x0;for(;_0x35f25f['parentNode'];)_0x35f25f=_0x35f25f['parentNode'],_0x1b65e0++;return _0x1b65e0;}function He(_0x3938a2){const _0x3b09d9=[];let _0xd023a7=_0x3938a2['nextSibling'];for(;_0xd023a7;)_0x3b09d9['push'](_0xd023a7),_0xd023a7=_0xd023a7['nextSibling'];_0x3b09d9['forEach'](_0x1e0c65=>{_0x37bdbe(_0x1e0c65);});}class Je extends/* #__PURE__ -- @preserve */
25
+ _0x12a324(){['_m2html'];constructor(){super(),this['_m2html']=new _0x5a0af8();}['convertMarkdownToHTML'](_0x439c5a){const _0x3d8293=this['_m2html']['parse'](_0x439c5a);return this['parseAndNormalizeHTML'](_0x3d8293);}['parseAndNormalizeHTML'](_0x36d8f6){return this['_parseHTML'](_0x36d8f6);}['_parseHTML'](_0x456f12){const _0x19cd6a=sr('<dummy>'+_0x456f12['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x19cd6a['children']=_0x19cd6a['children'][0x0]['children'],_0x19cd6a;}}class Ke extends/* #__PURE__ -- @preserve */
26
+ _0x12a324(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x4867b3){super(),this['_generateUid']=_0x4867b3||_0x91fc81;}['merge'](_0xef5e5e,_0x318bf9,_0x4aa801){const _0x722e6d=_0xef5e5e['cloneNode'](!0x0);if(0x0===_0x318bf9['childNodes']['length']){const _0x518175=[];return Ne('data-id','new-element',_0x722e6d)['forEach'](_0x3602f2=>{const _0x539bf5=this['_generateUid']();Re(_0x3602f2,'data-id',_0x539bf5),_0x518175['push'](_0x539bf5);}),this['_removeSpecialComments'](_0x722e6d),{'parsedContent':_0x722e6d,'newNodeIds':_0x518175,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x4aa801&&_0x4aa801['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x722e6d),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Ne('data-id',null,_0x318bf9)['map'](_0x159f7b=>ft(_0x159f7b,'data-id'))['filter'](_0x19fc5c=>!!_0x19fc5c));let _0x41ada3=-0x1,_0xe60f7d=!0x1;const _0x4e2d88=_0x722e6d['childNodes'],_0xc3266d=Array['from'](_0x4e2d88)['filter'](_0x18e343=>!(0x3===_0x18e343['nodeType']&&''===Ct(_0x18e343)['trim']())),_0x1cc0ac=_0xc3266d['length'];for(let _0x118e18=0x0;_0x118e18<_0x1cc0ac;_0x118e18++){const _0x561ced=_0xc3266d[_0x118e18],_0x1400cb=_0xc3266d[_0x118e18+0x1];if(this['_isNewNode'](_0x561ced)){if(-0x1===_0x41ada3&&(_0x41ada3=_0x118e18),this['_markWrappedElements'](_0x561ced),!this['_isNewNode'](_0x1400cb)){const [_0x29d638,_0x1be9c7]=this['_findReferenceNode'](_0x561ced,_0xe60f7d,_0x318bf9);if(_0x29d638){const _0x1756c9=Array['from'](_0xc3266d)['slice'](_0x41ada3,_0x118e18+0x1);this['_insertNodes'](_0x29d638,_0x1756c9,_0x1be9c7),_0x41ada3=-0x1;}}}else{if(this['_isExistingContentComment'](_0x561ced))_0xe60f7d=!0x0;else{if(this['_isExistingNode'](_0x561ced)){const _0x3d6b66=ft(_0x561ced,'data-id');if(_0x3d6b66&&this['_existingDataIds']['has'](_0x3d6b66)){const _0x4c734b=It('data-id',_0x3d6b66,_0x318bf9);this['_replaceNode'](_0x4c734b,_0x561ced);}if(this['_touchedNodesState']['removedIds']['includes'](_0x3d6b66)){const _0x61626=this['_touchedNodesState']['removedIds']['indexOf'](_0x3d6b66);this['_touchedNodesState']['removedIds']['splice'](_0x61626,0x1);}}else{if(this['_isDelNode'](_0x561ced)){const _0x292052=ft(_0x561ced,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x292052)||this['_storeDeletedElementIds'](_0x561ced);}}}}}for(const _0x2a309c of this['_touchedNodesState']['removedIds']){const _0x409ae7=It('data-id',_0x2a309c,_0x318bf9);if(_0x409ae7){if(_0x4aa801&&_0x4aa801['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x2a309c;const _0x5e4ff5=_0x4aa801['replaceRemovedWith']['cloneNode'](!0x0);Re(_0x5e4ff5,'data-id',_0x2a309c),Re(_0x5e4ff5,'data-removed','true'),_0x4afbf8(_0x409ae7,_0x5e4ff5);}else _0x37bdbe(_0x409ae7);}}if(Ne('data-wrapped-id',null,_0x318bf9)['forEach'](_0x23f824=>{const _0x17060f=It('data-id',ft(_0x23f824,'data-wrapped-id'),_0x318bf9);var _0x1d08c1,_0x3e98d5;_0x17060f&&(_0x3e98d5=_0x23f824,_0x37bdbe(_0x1d08c1=_0x17060f),_0x4afbf8(_0x3e98d5,_0x1d08c1));}),Ne('data-id','new-element',_0x318bf9)['forEach'](_0x54a736=>{const _0x8cc353=this['_getUid'](_0x54a736);Re(_0x54a736,'data-id',_0x8cc353),this['_touchedNodesState']['newIds']['push'](_0x8cc353);}),this['_removeSpecialComments'](_0x318bf9),_0x4aa801&&_0x4aa801['markUnstableElements']&&this['_markUnstableElements'](_0x318bf9,_0x4aa801['markUnstableElementsDepth']||0x0),_0x4aa801&&_0x4aa801['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x24e1d0=It('data-id',this['_touchedNodesState']['lastTouchedId'],_0x318bf9);for(;_0x24e1d0;)He(_0x24e1d0),_0x24e1d0=_0x24e1d0['parentNode'];}return{'parsedContent':_0x318bf9,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x43a992,_0x22c4d1,_0x5cfd83){for(const _0x58c924 of _0x22c4d1){const _0x36e8f2=this['_getUid'](_0x58c924);Re(_0x58c924,'data-id',_0x36e8f2),this['_touchedNodesState']['newIds']['push'](_0x36e8f2),this['_touchedNodesState']['lastTouchedId']=_0x36e8f2;}const _0x409e91='afterbegin'===_0x5cfd83||'afterend'===_0x5cfd83?_0x22c4d1['reverse']():_0x22c4d1;for(const _0x532a5d of _0x409e91)Ae(_0x43a992,_0x532a5d,_0x5cfd83);}['_replaceNode'](_0x5f2fbc,_0x2527af){if(!_0x5f2fbc)return;if(_0x2d5819=_0x2527af,Bn(Ct(_0x5f2fbc))===Bn(Ct(_0x2d5819)))return;var _0x2d5819;const _0x5889df=this['_getUid'](_0x5f2fbc);Re(_0x2527af,'data-id',_0x5889df),this['_touchedNodesState']['modifiedIds']['push'](_0x5889df),this['_touchedNodesState']['lastTouchedId']=_0x5889df,_0x4afbf8(_0x5f2fbc,_0x2527af['cloneNode'](!0x0));}['_findReferenceNode'](_0x11beea,_0x249b39,_0x1e6b28){const _0x19262d=this['_findPrevElementWithDataId'](_0x11beea,!0x1);if(_0x19262d){const _0x56df15=this['_getNodeDataId'](_0x19262d),_0x4d3335=It('data-id',_0x56df15,_0x1e6b28);if(_0x4d3335)return[_0x4d3335,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x56df15);}const _0x29e33b=this['_findNextElementWithDataId'](_0x11beea,!0x1);if(_0x29e33b){const _0x5990c8=this['_getNodeDataId'](_0x29e33b),_0x226c5b=It('data-id',_0x5990c8,_0x1e6b28);if(_0x226c5b)return[_0x226c5b,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x5990c8);}return _0x249b39?_0x11beea['nextSibling']?this['_findFallbackReferenceNode'](_0x11beea,_0x1e6b28):[_0x1e6b28['childNodes'][_0x1e6b28['childNodes']['length']-0x1],'afterend']:[_0x1e6b28['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x28d40b,_0x5e9d47){const _0x1375dc=[],_0x2f5f61=this['_findPrevElementWithDataId'](_0x28d40b,!0x0);if(_0x2f5f61){const _0x41d669=It('data-id',this['_getNodeDataId'](_0x2f5f61),_0x5e9d47);_0x41d669&&_0x1375dc['push']([_0x41d669,'afterend']);}const _0x4ed7a5=this['_findNextElementWithDataId'](_0x28d40b,!0x0);if(_0x4ed7a5){const _0x107913=It('data-id',this['_getNodeDataId'](_0x4ed7a5),_0x5e9d47);_0x107913&&_0x1375dc['push']([_0x107913,'beforebegin']);}if(_0x1375dc['length']>0x1)return ze(_0x1375dc[0x0][0x0])<=ze(_0x1375dc[0x1][0x0])?_0x1375dc[0x0]:_0x1375dc[0x1];return 0x1===_0x1375dc['length']?_0x1375dc[0x0]:[_0x5e9d47['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x549439,_0x2a2d02){let _0x5197dd=_0x549439['nextSibling'],_0x42d03e=null,_0x36ef61=!0x1;for(;_0x5197dd;){if(_0x5bcd8b(_0x5197dd)){if(this['_isDelNode'](_0x5197dd)&&(_0x42d03e=_0x5197dd),this['_isExistingContentComment'](_0x5197dd)&&_0x2a2d02&&!_0x36ef61){_0x36ef61=!0x0,_0x5197dd=_0x5197dd['nextSibling'];continue;}break;}const _0x177a61=ft(_0x5197dd,'data-id');if(_0x177a61&&'new-element'!==_0x177a61&&this['_existingDataIds']['has'](_0x177a61)){_0x42d03e=_0x5197dd;break;}_0x5197dd=_0x5197dd['nextSibling'];}return _0x42d03e;}['_findPrevElementWithDataId'](_0x440b7f,_0x3d592b){let _0x196552=_0x440b7f['previousSibling'],_0x5975ae=null,_0x10d62c=!0x1;for(;_0x196552;){if(_0x5bcd8b(_0x196552)){if(this['_isDelNode'](_0x196552)&&(_0x5975ae=_0x196552),this['_isExistingContentComment'](_0x196552)&&_0x3d592b&&!_0x10d62c){_0x10d62c=!0x0,_0x196552=_0x196552['previousSibling'];continue;}break;}const _0x4b581a=ft(_0x196552,'data-id');if(_0x4b581a&&'new-element'!==_0x4b581a&&this['_existingDataIds']['has'](_0x4b581a)){_0x5975ae=_0x196552;break;}_0x196552=_0x196552['previousSibling'];}return _0x5975ae;}['_markWrappedElements'](_0x2edb71){_0x1d4fa0(_0x2edb71)&&Ne('data-id',null,_0x2edb71)['forEach'](_0x11149c=>{this['_isExistingNode'](_0x11149c)&&!this['_hasWrappedParent'](_0x11149c)&&(Re(_0x11149c,'data-wrapped-id',ft(_0x11149c,'data-id')),Re(_0x11149c,'data-id',null));});}['_getNodeDataId'](_0x225fa5){if(!_0x225fa5)return null;if(_0x1d4fa0(_0x225fa5))return ft(_0x225fa5,'data-id');if(_0x5bcd8b(_0x225fa5)){const _0x2ceada=Ct(_0x225fa5)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x2ceada&&_0x2ceada[0x1])return _0x2ceada[0x1];}return null;}['_storeDeletedElementIds'](_0x5af867){if(_0x5bcd8b(_0x5af867)){const _0x62b539=Ct(_0x5af867)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x62b539&&_0x62b539[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x62b539[0x1]);}}['_getUid'](_0x385361){return this['_isExistingNode'](_0x385361)?ft(_0x385361,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x5d5f47){(function(_0x351d97){return _0x431688(_0x512e10=>_0x5bcd8b(_0x512e10),_0x351d97,!0x0,0x1/0x0);}(_0x5d5f47)['filter'](_0x14fd5a=>this['_isDelNode'](_0x14fd5a)||this['_isExistingContentComment'](_0x14fd5a))['forEach'](_0x2a3b57=>{_0x37bdbe(_0x2a3b57);}));}['_markLastTagElementUnstable'](_0x4ef550){const _0x3b026b=_0x4ef550['childNodes'],_0x1683f9=_0x3b026b[_0x3b026b['length']-0x1];_0x1683f9&&_0x1d4fa0(_0x1683f9)&&Re(_0x1683f9,'data-unstable','true');}['_markUnstableElements'](_0x2a062a,_0x1c3144){const _0x304827=It('data-unstable','true',_0x2a062a);if(!_0x304827)return;const _0x35675d=qe(_0x304827)['slice'](0x0,-0x1),_0x5b9934=_0x35675d['length'];let _0x3ca36b=_0x304827;if(_0x5b9934>_0x1c3144){let _0x1728d5=_0x5b9934,_0x245336=null;for(;_0x1728d5>_0x1c3144&&_0x1728d5>=0x0;)_0x1728d5--,_0x245336=_0x35675d[_0x1728d5];_0x245336&&(_0x3ca36b=_0x245336,Re(_0x304827,'data-unstable',null),Re(_0x245336,'data-unstable','true'));}else{if(_0x5b9934<_0x1c3144){let _0x5ec3fe=_0x5b9934,_0x3b9bb5=_0x304827;for(;_0x5ec3fe<_0x1c3144;){const _0x472894=_0x3b9bb5['childNodes']['filter'](_0x4f8cd0=>_0x1d4fa0(_0x4f8cd0));if(0x0===_0x472894['length'])break;_0x5ec3fe++,_0x3b9bb5=_0x472894[_0x472894['length']-0x1];}_0x3b9bb5&&(_0x3ca36b=_0x3b9bb5,Re(_0x304827,'data-unstable',null),Re(_0x3b9bb5,'data-unstable','true'));}}let _0x2505aa=_0x3ca36b;for(;_0x2505aa;){for(;_0x2505aa['nextSibling'];)_0x2505aa=_0x2505aa['nextSibling'],_0x1d4fa0(_0x2505aa)&&Re(_0x2505aa,'data-unstable','true');_0x2505aa=_0x2505aa['parentNode'];}}['_isNewNode'](_0x15f6c9){return Boolean('new-element'===ft(_0x15f6c9,'data-id'));}['_isExistingNode'](_0x41c2d9){return Boolean((ft(_0x41c2d9,'data-id')||'')['length']>0x0&&'new-element'!==ft(_0x41c2d9,'data-id'));}['_isDelNode'](_0x4749ae){return!!_0x4749ae&&Boolean(_0x5bcd8b(_0x4749ae)&&Ct(_0x4749ae)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x52e344){let _0x259a52=_0x52e344['parentNode'];for(;_0x259a52;){if(ft(_0x259a52,'data-wrapped-id'))return!0x0;_0x259a52=_0x259a52['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x3e37cc){return Boolean(_0x5bcd8b(_0x3e37cc)&&Ct(_0x3e37cc)['match'](/\s*existing[\s*-](content|document)\s*/g));}}const Kn=['modification-delta','text-delta'],Wn=['reasoning'];class fi extends _0x12a324(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _t([]);['parsedMergedContent']=new _t([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];constructor({type:_0x378ae5,content:_0x22ac3a='',isDone:_0x1fa764=!0x1,interactionId:_0x2b06d8,areActionsDisabled:_0x4127f7,documentContextContent:_0x48923e,editor:_0x21cc19}){super(),this['id']=_0x91fc81(),this['interactionId']=_0x2b06d8,this['type']=_0x378ae5,this['areActionsDisabled']=!!_0x4127f7,this['editor']=_0x21cc19,this['aiResponseParser']=new Je(),this['aiResponseApplier']=new Ke(),this['documentContextContent']=sr(_0x48923e||''),this['set']('isDone',_0x1fa764),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x22ac3a);}['appendContent'](_0x1e879f){this['set']('content',this['content']+_0x1e879f);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x4902fa,_0x46455a){this['changeGroups'][_0x4902fa]['state']=_0x46455a,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x4902fa,'state':_0x46455a});}['onContentChange'](){if('modification-delta'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x64f290=this['changeGroups'];this['updateChangeGroups']();const _0x5c4992=function(_0x3eafb8,_0x19e66c){const _0x4f52f9=[];for(const _0x153f5d of _0x19e66c){const _0x565e61=_0x3eafb8[_0x153f5d['index']];_0x565e61?_0x565e61['changes']['length']!==_0x153f5d['changes']['length']?_0x4f52f9['push'](_0x153f5d):_0x565e61['changes']['forEach']((_0xdb38fa,_0x271c55)=>{const _0x4cd81a=_0x153f5d['changes'][_0x271c55];_0xdb38fa['id']!==_0x4cd81a['id']&&_0x4f52f9['push'](_0x153f5d);}):_0x4f52f9['push'](_0x153f5d);}return _0x4f52f9;}(_0x64f290,this['changeGroups']);(_0x5c4992['length']||this['isDone'])&&this['fire']('replyContentUpdated',this,_0x5c4992);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['updateChangeGroups'](){const _0x3ece7a=new _0x450b1b('p',{},[new _0x450b1b('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x507fb9('Removed\x20content.\x20Use\x20\x22Show\x20changes\x22\x20to\x20learn\x20more.')])]),_0x5b5377=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x3ece7a,'cutAfterLastChange':!this['isDone']});if(!_0x5b5377['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x5b5377['parsedContent'];let _0x1c4c96=[];if(_0x221490(_0x3632c3=>{const _0x133bcd=ft(_0x3632c3,'data-id');if(!_0x133bcd||!_0x13b5c8(_0x133bcd))return!0x1;const _0x35fa5b=[_0x3632c3,...qe(_0x3632c3)]['at'](-0x2);if(_0x3632c3!=_0x35fa5b){const _0x2e2f75=ft(_0x35fa5b,'data-id');_0x13b5c8(_0x2e2f75)||(_0x1c4c96['push']({'node':_0x35fa5b,'id':_0x2e2f75,'type':'modified'}),_0x5b5377['modifiedNodeIds']['push'](_0x2e2f75));}else _0x5b5377['modifiedNodeIds']['includes'](_0x133bcd)?_0x1c4c96['push']({'node':_0x3632c3,'type':'modified','id':_0x133bcd}):_0x5b5377['newNodeIds']['includes'](_0x133bcd)?_0x1c4c96['push']({'node':_0x3632c3,'type':'new','id':_0x133bcd,'anchorId':ft(_0x3632c3['previousSibling'],'data-id')}):_0x1c4c96['push']({'node':_0x3632c3,'type':'removed','id':_0x133bcd});return!0x0;},this['parsedMergedContent']),_0x1c4c96=_0x1c4c96['filter'](({node:_0x34fcd6})=>[...qe(_0x34fcd6),_0x34fcd6]['every'](_0xcb41be=>!ft(_0xcb41be,'data-unstable'))),0x0==_0x1c4c96['length'])return;const _0x5bc009=[[_0x1c4c96[0x0]]];for(let _0x988ec0=0x1;_0x988ec0<_0x1c4c96['length'];_0x988ec0++){const _0x42a244=_0x5bc009[_0x5bc009['length']-0x1],_0x28ff5b=_0x42a244[_0x42a244['length']-0x1];_0x1c4c96[_0x988ec0]['node']['previousSibling']==_0x28ff5b['node']&&'modified'!=_0x1c4c96[_0x988ec0]['type']&&'modified'!=_0x28ff5b['type']?_0x42a244['push'](_0x1c4c96[_0x988ec0]):_0x5bc009['push']([_0x1c4c96[_0x988ec0]]);}for(const _0x3eb913 of _0x5bc009){const _0x487e8d=_0x3eb913[0x0],_0x23f245=_0x3eb913[_0x3eb913['length']-0x1],_0x1e97a5=_0xa896e7(_0x487e8d['node']['previousSibling']);_0x1e97a5&&_0x3eb913['unshift'](_0x1e97a5);const _0x229552=_0xa896e7(_0x23f245['node']['nextSibling']);_0x229552&&_0x3eb913['push'](_0x229552);}function _0x13b5c8(_0x726faf){return _0x5b5377['modifiedNodeIds']['includes'](_0x726faf)||_0x5b5377['newNodeIds']['includes'](_0x726faf)||_0x5b5377['removedNodeIds']['includes'](_0x726faf);}function _0xa896e7(_0x1665b9){if(_0x1665b9&&ft(_0x1665b9,'data-id')&&!ft(_0x1665b9,'data-unstable')){const _0x295341=ft(_0x1665b9,'data-id');if(!_0x13b5c8(_0x295341))return{'node':_0x1665b9,'type':'context','id':_0x295341};}return null;}this['changeGroups']=_0x5bc009['map']((_0x51c835,_0x32b9fd)=>({'changes':_0x51c835,'state':'pending','index':_0x32b9fd}));}}function qi(_0x1ec2d1){return Object['values'](Kn)['includes'](_0x1ec2d1);}function Ui(_0x11291b){return Wn['includes'](_0x11291b);}function Gi(_0x1693a4){return'conversation-title'===_0x1693a4;}function Ji(_0x381810){return'source'===_0x381810;}const me=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','error'];class he extends _0x595595(){['id'];['replies']=[];['currentReply'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];constructor({connector:_0x5b106e,editor:_0x4a16ee}){super(),this['id']=_0x91fc81(),this['connector']=_0x5b106e,this['isStopped']=!0x0,this['editor']=_0x4a16ee;}async['start'](){let _0x45f642;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x3af6e9=await this['currentRequest']['getStream'](),_0x10760e=[];for await(const _0x1e6348 of _0x3af6e9){if(this['isStopped'])return;if('error'===_0x1e6348['event'])return void this['fire']('error',{'error':new _0x1cd47d('ai-chat-interaction-error',this)});Gi(_0x1e6348['event'])&&this['setConversationTitle'](_0x1e6348['data']['conversationTitle'],!0x0),Ji(_0x1e6348['event'])?_0x10760e['push'](_0x1e6348['data']['source']):qi(_0x1e6348['event'])?(_0x1e6348['event']!==_0x45f642&&(this['currentReply']&&this['currentReply']['done'](),this['currentReply']=this['createReply']({'type':_0x1e6348['event'],'interactionId':this['id']}),_0x10760e['length']>0x0&&(this['currentReply']['sources']=_0x10760e['splice'](0x0)),_0x45f642=_0x1e6348['event']),this['currentReply']['appendContent'](_0x1e6348['data']['textDelta'])):Ui(_0x1e6348['event'])||_0x5c57f7('ai-interaction-invalid-event-type',{'chunk':_0x1e6348});}}finally{this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0xaa09e){return this['replies']['find'](_0x59787b=>_0x59787b['id']===_0xaa09e);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x3ac13f=>_0x3ac13f['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x20d29c){const _0x50422d=new fi({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x20d29c});return this['replies']['push'](_0x50422d),_0x50422d['delegate'](...me)['to'](this),this['fire']('replyCreated',_0x50422d),_0x50422d;}['setConversationTitle'](_0x468f92,_0x1d04c4=!0x1){this['fire']('setConversationTitle',_0x468f92,_0x1d04c4);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var ue=function(_0x47facb){return _0x47facb['FILE']='file',_0x47facb['DOCUMENT']='document',_0x47facb['URL']='web-resource',_0x47facb['TEXT']='text',_0x47facb['SELECTION']='selection',_0x47facb;}({}),le=function(_0xd43d1c){return _0xd43d1c['TEXT']='text',_0xd43d1c['MARKDOWN']='markdown',_0xd43d1c['HTML']='html',_0xd43d1c;}({});const Ii=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class vi extends _0x12a324(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0xfbe5d8,config:_0x475a67,ownerId:_0x2fab2d}){super(),this['_connector']=_0xfbe5d8,this['_config']=_0x475a67,this['_ownerId']=_0x2fab2d;}['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'](_0x32384f){const _0x493b36=await this['_createContextItemFromContent'](_0x32384f);return this['_addToConversationContextItem'](_0x493b36),'current-document'===_0x493b36['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x493b36;}async['_createContextItemFromContent'](_0xe52347){if(_0xe52347['type']===ue['DOCUMENT']){const _0xa6e1f8=await this['_connector']['fetchDocument'](this['_ownerId'],_0xe52347['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0xe52347['type'],'content':_0xa6e1f8['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0xa6e1f8['attributes']?.['version'],'sessionId':_0xa6e1f8['attributes']?.['sessionId']};}return{'id':_0xe52347['id'],'uiId':_0xe52347['id'],'label':_0xe52347['attributes']?.['label']||_0xe52347['name']||_0xe52347['url']||_0xe52347['id'],'type':_0xe52347['type'],..._0xe52347?.['attributes']?.['resourceId']?{'resourceId':_0xe52347['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x2458fd){const _0x2b3740=this['_pendingContextItems']['get'](_0x2458fd);_0x2b3740?.['isReadOnly']||this['_removeContextItem'](_0x2458fd);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x17512f of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x17512f['uiId']);const _0x287fbb=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x287fbb&&this['_addContextItem']({..._0x287fbb,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x24d227){for(const _0x508a95 of _0x24d227['values']())this['_addToConversationContextItem'](_0x508a95);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'](_0x356daa){return Array['from'](_0x356daa['values']())['map'](_0x90a133=>this['_mapContextItemToRequestData'](_0x90a133))['filter'](_0x2bd5e5=>null!==_0x2bd5e5);}async['addFilesToContext'](_0x5c891a,_0x1399f3,_0x485a91=ue['FILE']){const _0x63228c='files-'+_0x91fc81();this['_startUploadOperation'](_0x63228c);try{await Promise['all'](_0x5c891a['map'](async _0x387c74=>{const _0xdbec93='file-'+_0x91fc81(),_0x1e5827=_0x5787f6(_0x387c74['name']);try{this['_addContextItem']({'type':_0x485a91,'label':_0x1399f3?.['label']||_0x1e5827,'uiId':_0xdbec93,'resourceId':_0x1399f3?.['resourceId']},!0x0);const _0x266e6c=this['_connector']['uploadFile'](this['_ownerId'],_0x387c74,_0x1399f3);this['_ongoingUploads']['set'](_0xdbec93,_0x266e6c['abortController']);const {id:_0x122c3b}=await _0x266e6c['getId']();this['_ongoingUploads']['delete'](_0xdbec93),this['_finishContextItemLoading']({'type':_0x485a91,'id':_0x122c3b,'label':_0x1399f3?.['label']||_0x1e5827,'uiId':_0xdbec93,'resourceId':_0x1399f3?.['resourceId']},!0x1);}catch(_0x26ddb1){this['_ongoingUploads']['delete'](_0xdbec93);if(!_0x26ddb1['message']['startsWith']('ai-request-aborted')){const _0x25ec2d=new _0x1cd47d('ai-chat-file-upload-failed',null,{'fileName':_0x1e5827});_0x25ec2d['stack']=_0x26ddb1['stack'],this['fire']('error',{'error':_0x25ec2d,'fileName':_0x1e5827});}this['_removeContextItem'](_0xdbec93);}}));}finally{this['_finishUploadOperation'](_0x63228c);}}['addCurrentDocumentToContext'](_0x1a3ebb){if(this['isCurrentDocumentInContext']())return;const _0x4e6208={'type':ue['DOCUMENT'],'uiId':'current-document','label':_0x1a3ebb,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x4e6208);}async['updateCurrentDocument'](_0x4cb4fd,_0x4e4775,_0xf9d4f,_0x298dba){const _0x14c7f5=this['_pendingContextItems']['get']('current-document');if(_0x14c7f5&&_0x4cb4fd){_0x14c7f5['selection']=_0x298dba?_0x298dba['map'](_0x122c5a=>({'start':_0x122c5a['start'],'end':_0x122c5a['end']})):[];try{if(_0x14c7f5['version']===_0x4e4775)return;const {id:_0x308206}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x4cb4fd,{'version':_0x4e4775,'sessionId':_0xf9d4f})['getId']();_0x14c7f5['id']=_0x308206,_0x14c7f5['content']=_0x4cb4fd,_0x14c7f5['version']=_0x4e4775,_0x14c7f5['sessionId']=_0xf9d4f;}catch(_0x4f7936){const _0xc942e2=new _0x1cd47d('ai-chat-document-upload-failed',null);_0xc942e2['stack']=_0x4f7936['stack'],this['fire']('error',{'error':_0xc942e2});}}}['addSelectionToContext'](_0x35ef58){this['_addContextItem']({'type':ue['SELECTION'],'label':_0x35ef58,'uiId':'selection','content':_0x35ef58});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x39c34a,_0x1ab630){const _0x214481='url-'+_0x91fc81();this['_startUploadOperation'](_0x214481);const _0x208ed2='url-'+_0x91fc81();try{this['_addContextItem']({'type':ue['URL'],'label':_0x1ab630?.['label']||_0x39c34a,'uiId':_0x208ed2,'resourceId':_0x1ab630?.['resourceId']},!0x0);const _0x168f9f=this['_connector']['uploadUrl'](this['_ownerId'],_0x39c34a,_0x1ab630);this['_ongoingUploads']['set'](_0x208ed2,_0x168f9f['abortController']);const {id:_0xfc013b}=await _0x168f9f['getId']();this['_ongoingUploads']['delete'](_0x208ed2),this['_finishContextItemLoading']({'type':ue['URL'],'id':_0xfc013b,'label':_0x1ab630?.['label']||_0x39c34a,'uiId':_0x208ed2,'resourceId':_0x1ab630?.['resourceId']},!0x1);}catch(_0x4842dd){this['_ongoingUploads']['delete'](_0x208ed2),(_0x4842dd['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x1cd47d('ai-chat-url-upload-failed',this,{'url':_0x39c34a,'originalError':_0x4842dd}),'url':_0x39c34a}),this['_removeContextItem'](_0x208ed2));}finally{this['_finishUploadOperation'](_0x214481);}}async['loadSourceResources'](_0x2ab884,_0x276586,_0x303568){const _0x44e85c=this['_addContextOptionsState']['sources']['find'](_0x442c0d=>_0x442c0d['id']===_0x2ab884);if(!_0x44e85c)return this['fire']('error',{'error':new _0x1cd47d('ai-chat-source-not-found',this,{'sourceId':_0x2ab884}),'sourceId':_0x2ab884}),[];try{const _0x42ab64=(await _0x44e85c['getResources'](_0x276586))['map'](_0x303ab8=>{const _0x37f3c6=this['_isResourceInContext'](_0x303ab8['id']);return{..._0x303ab8,'isInContext':_0x37f3c6};});return _0x44e85c['resources']=_0x42ab64,this['fire']('sourceResourcesLoaded',{'sourceId':_0x2ab884,'source':_0x44e85c,'resources':_0x42ab64,'uid':_0x303568}),_0x42ab64;}catch(_0x266a6b){return this['fire']('error',{'error':new _0x1cd47d('ai-chat-source-resources-load-failed',this,{'sourceId':_0x2ab884,'originalError':_0x266a6b}),'sourceId':_0x2ab884,'sourceLabel':_0x44e85c['label']}),[];}}async['addResourceToContext'](_0x2d376a,_0x183490){if(this['_isResourceInContext'](_0x183490['id']))return;let _0x306455=_0x183490['data'];if(!_0x306455&&_0x2d376a['getData'])try{_0x306455=await _0x2d376a['getData'](_0x183490['id']);}catch(_0x4585f1){return void this['fire']('error',{'error':new _0x1cd47d('ai-chat-resource-load-failed',this,{'resourceId':_0x183490['id'],'sourceId':_0x2d376a['id'],'originalError':_0x4585f1}),'resourceId':_0x183490['id'],'sourceId':_0x2d376a['id']});}if(_0x306455)switch(_0x183490['type']){case ue['URL']:if('string'!=typeof _0x306455)return void this['fire']('error',{'error':new _0x1cd47d('ai-chat-context-invalid-data',this,{'resourceId':_0x183490['id'],'sourceId':_0x2d376a['id'],'expectedType':'string','actualType':typeof _0x306455}),'resourceId':_0x183490['id'],'sourceId':_0x2d376a['id']});await this['addUrlToContext'](_0x306455,{'label':_0x183490['label'],'resourceId':_0x183490['id']});break;case ue['FILE']:if(!(_0x306455 instanceof File))return void this['fire']('error',{'error':new _0x1cd47d('ai-chat-context-invalid-data',this,{'resourceId':_0x183490['id'],'sourceId':_0x2d376a['id'],'expectedType':'File','actualType':typeof _0x306455}),'resourceId':_0x183490['id'],'sourceId':_0x2d376a['id']});await this['addFilesToContext']([_0x306455],{'label':_0x183490['label'],'resourceId':_0x183490['id']});break;case ue['TEXT']:if('object'!=typeof _0x306455||!('content'in _0x306455)||!('type'in _0x306455))return void this['fire']('error',{'error':new _0x1cd47d('ai-chat-context-invalid-data',this,{'resourceId':_0x183490['id'],'sourceId':_0x2d376a['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x306455}),'resourceId':_0x183490['id'],'sourceId':_0x2d376a['id']});_0x306455=vi['_convertTextResourceToFile'](_0x306455,_0x183490['label']),await this['addFilesToContext']([_0x306455],{'label':_0x183490['label'],'resourceId':_0x183490['id']},ue['TEXT']);break;default:this['fire']('error',{'error':new _0x1cd47d('ai-chat-context-unsupported-type',this,{'resourceId':_0x183490['id'],'sourceId':_0x2d376a['id'],'resourceType':_0x183490['type']}),'resourceId':_0x183490['id'],'sourceId':_0x2d376a['id']});}else this['fire']('error',{'error':new _0x1cd47d('ai-chat-resource-no-data',this,{'resourceId':_0x183490['id'],'sourceId':_0x2d376a['id']}),'resourceId':_0x183490['id'],'sourceId':_0x2d376a['id']});}static['_convertTextResourceToFile'](_0x247847,_0x4e7643){switch(_0x247847['type']){case le['MARKDOWN']:return new File([_0x247847['content']],_0x4e7643,{'type':'text/markdown'});case le['HTML']:return new File([_0x247847['content']],_0x4e7643,{'type':'text/html'});default:return new File([_0x247847['content']],_0x4e7643,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x29a8e2){switch(_0x29a8e2['type']){case ue['FILE']:return{'type':ue['FILE'],'id':_0x29a8e2['id']};case ue['URL']:return{'type':ue['URL'],'id':_0x29a8e2['id']};case ue['DOCUMENT']:return{'type':ue['DOCUMENT'],'id':_0x29a8e2['id'],..._0x29a8e2['selection']?.['length']&&{'selection':_0x29a8e2['selection']}};case ue['TEXT']:return{'type':ue['FILE'],'id':_0x29a8e2['id']};default:return null;}}['_addContextItem'](_0x155b74,_0x5695e4=!0x1){if(this['_pendingContextItems']['set'](_0x155b74['uiId'],_0x155b74),_0x155b74['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x155b74,'isLoading':_0x5695e4}),'current-document'===_0x155b74['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x155b74['resourceId']){const _0x510358=this['_findSourceIdsByResourceId'](_0x155b74['resourceId']);_0x510358&&_0x510358['forEach'](_0x31d66d=>{this['_updateResourceInContextState'](_0x31d66d,_0x155b74['resourceId'],!0x0);});}}['_removeContextItem'](_0x52aafb){const _0x3ffbab=this['_pendingContextItems']['get'](_0x52aafb),_0x2e68f4=this['_ongoingUploads']['get'](_0x52aafb);if(_0x2e68f4&&(_0x2e68f4['abort'](),this['_ongoingUploads']['delete'](_0x52aafb)),_0x3ffbab?.['resourceId']){const _0x217045=this['_findSourceIdsByResourceId'](_0x3ffbab['resourceId']);_0x217045&&_0x217045['forEach'](_0x3b0934=>{this['_updateResourceInContextState'](_0x3b0934,_0x3ffbab['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x52aafb),this['fire']('contextItemRemoved',{'uiId':_0x52aafb,'type':_0x3ffbab?.['type']}),'current-document'===_0x52aafb&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x575fe9,_0x4427d7){if(this['_pendingContextItems']['has'](_0x575fe9['uiId'])&&(this['_pendingContextItems']['set'](_0x575fe9['uiId'],_0x575fe9),this['fire']('contextItemLoadingEnded',{'contextItem':_0x575fe9,'isLoading':_0x4427d7}),_0x575fe9['resourceId'])){const _0x159dff=this['_findSourceIdsByResourceId'](_0x575fe9['resourceId']);_0x159dff&&_0x159dff['forEach'](_0x5de6f8=>{this['_updateResourceInContextState'](_0x5de6f8,_0x575fe9['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x18e781){this['_conversationContextItems']['set'](_0x18e781['uiId'],_0x18e781);}['_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'](_0x3e810f=>({..._0x3e810f,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x124ad7=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x124ad7,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x2e6df8){for(const _0x37ff63 of this['_pendingContextItems']['values']())if(_0x37ff63['resourceId']===_0x2e6df8)return!0x0;for(const _0x1a1f39 of this['_conversationContextItems']['values']())if(_0x1a1f39['resourceId']===_0x2e6df8)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x4b4fd){const _0x30ea6b=[];for(const _0x5644e1 of this['_addContextOptionsState']['sources']){_0x5644e1['resources']['find'](_0x2484ac=>_0x2484ac['id']===_0x4b4fd)&&_0x30ea6b['push'](_0x5644e1['id']);}return 0x0===_0x30ea6b['length']?null:_0x30ea6b;}['_updateResourceInContextState'](_0x1f9285,_0x274940,_0x4a4005){const _0x3bbbb9=this['_addContextOptionsState']['sources']['find'](_0x68325f=>_0x68325f['id']===_0x1f9285);if(!_0x3bbbb9)return;const _0x143c90=_0x3bbbb9['resources']['find'](_0x3b2972=>_0x3b2972['id']===_0x274940);_0x143c90&&(_0x143c90['isInContext']=_0x4a4005,this['fire']('resourceStateChanged',{'sourceId':_0x1f9285,'resourceId':_0x274940,'isInContext':_0x4a4005}));}['_startUploadOperation'](_0x147c88){this['_ongoingUploadOperations']['set'](_0x147c88,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x226359){this['_ongoingUploadOperations']['delete'](_0x226359),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const xi=['capabilitiesUpdated'];class Ci extends _0x595595(){['_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'](_0x30db8a){const _0x33d8b9={};return _0x30db8a&&_0x30db8a['isWebSearchEnabled']&&(_0x33d8b9['webSearch']={}),_0x30db8a&&_0x30db8a['isReasoningEnabled']&&(_0x33d8b9['reasoning']={}),_0x33d8b9;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x23cae2){_0x23cae2!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x23cae2,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x5a0041){_0x5a0041!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x5a0041,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class gi extends he{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['quickActionData'];constructor(_0x3de850){super(_0x3de850),this['conversationId']=_0x3de850['conversationId'],this['contextItems']=_0x3de850['contextItems'],this['capabilities']=_0x3de850['capabilities'],this['userMessage']=_0x3de850['userMessage'],this['model']=_0x3de850['model'],this['quickActionData']=_0x3de850['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 ht extends _0x595595(){['id'];['isStarted']=!0x1;['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x463c84){super(),this['options']=_0x463c84,this['connector']=_0x463c84['connector'],this['chatModels']=_0x463c84['chatModels'],this['id']=_0x463c84['conversationId'];}async['init'](_0x339358){try{this['chatContext']=new vi({'connector':this['connector'],'config':_0x339358,'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 _0x1208a9=await this['chatModels']['getAll']();this['fire']('conversationInitialized',{'availableModels':_0x1208a9});const _0x241e10=await this['chatModels']['getDefault'](this['options']['defaultModelId']);_0x241e10&&await this['setModel'](_0x241e10);}catch(_0x42bd65){const _0x4264ac=new _0x1cd47d('ai-chat-conversation-init-failed',null,{'message':_0x42bd65['message']});_0x4264ac['stack']=_0x42bd65['stack'],this['fire']('error',{'error':_0x4264ac});}}async['start'](){if(this['isStarted'])throw new _0x1cd47d('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x1cd47d('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x1fc9d5}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x1fc9d5,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x3882b3){const _0xc4bfab=new _0x1cd47d('ai-chat-conversation-start-failed',null,{'message':_0x3882b3['message']});_0xc4bfab['stack']=_0x3882b3['stack'],this['fire']('error',{'error':_0xc4bfab});}}async['load'](_0x29d6fc,_0x47699c){try{const _0x27ebc4=await this['connector']['fetchConversation'](_0x29d6fc)['getConversation'](),_0x2a9659=await this['connector']['fetchConversationMessages'](_0x29d6fc)['getMessages'](),_0x8d5794=_0x2a9659[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x27ebc4['id'],'title'in _0x27ebc4?this['fire']('setConversationTitle',_0x27ebc4['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x443b8e=(await this['chatModels']['getAll']())['find'](_0x7e422a=>_0x7e422a['id']['toLowerCase']()===_0x8d5794['toLowerCase']());return this['selectedModel']=_0x443b8e,this['fire']('modelSelected',{'selectedModel':_0x443b8e,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x2a9659,_0x47699c,_0x8d5794),this['currentInteraction']=void 0x0,this;}catch(_0x403021){const _0x27e46e=new _0x1cd47d('ai-chat-conversation-init-from-id-failed',null,{'message':_0x403021['message'],'conversationId':_0x29d6fc});throw _0x27e46e['stack']=_0x403021['stack'],this['fire']('error',{'error':_0x27e46e}),_0x27e46e;}}async['_processMessagesToInteractions'](_0x3ae7b7,_0x1bbcc0,_0x1a67fc){let _0x5447ab;for(const _0x4d27ed of _0x3ae7b7)if('user'===_0x4d27ed['role']){const _0x16ac79=await this['_extractContextItems'](_0x4d27ed),_0x9274b2={'isReasoningEnabled':Object['hasOwn'](_0x4d27ed['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x4d27ed['capabilities'],'webSearch')};_0x5447ab=this['createInteraction']({'userMessage':_0x4d27ed['prompt'],'contextItems':_0x16ac79,'capabilities':_0x9274b2,'modelId':_0x1a67fc,'quickActionData':_0x4d27ed['attributes']?.['quickActionData']}),this['currentInteraction']=_0x5447ab,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x4d27ed['role']&&_0x5447ab)for(const _0x59e0e0 of _0x4d27ed['content']){const _0x33e890='text'===_0x59e0e0['type']?'text-delta':'modification-delta',_0x73474=_0x5447ab['getDocumentContext']()?.['sessionId']!==_0x1bbcc0;_0x5447ab['currentReply']=_0x5447ab['createReply']({'type':_0x33e890,'isDone':!0x0,'interactionId':_0x5447ab['id'],'areActionsDisabled':_0x73474}),_0x5447ab['currentReply']['appendContent'](_0x59e0e0['content']);}}}async['_extractContextItems'](_0x47c441){const _0x19edd4=new Map();if(!_0x47c441['content'])return _0x19edd4;for(const _0x1ccab8 of _0x47c441['content']){const _0x46e6d0=await this['chatContext']['populateFromMessage'](_0x1ccab8);_0x46e6d0&&_0x19edd4['set'](_0x46e6d0['id'],_0x46e6d0);}return _0x19edd4;}async['handleUserInteraction']({userMessage:_0x356791,quickActionData:_0x7ecdc9}){if(!this['isStarted'])throw new _0x1cd47d('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x1cd47d('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x2ae3c0=this['chatContext']['getPendingContextItems'](),_0x4cb729=this['chatCapabilities']['getCapabilitiesConfig'](),_0x2e83d7=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x356791,'contextItems':_0x2ae3c0,'capabilities':_0x4cb729,'modelId':_0x2e83d7,'quickActionData':_0x7ecdc9}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x236d3c){this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x236d3c});}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x534332,contextItems:_0x28072e,capabilities:_0x2fde3c,modelId:_0xb8031d,quickActionData:_0x5b8e88}){const _0x4fa9fc=new gi({'userMessage':_0x534332,'contextItems':_0x28072e,'capabilities':_0x2fde3c,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0xb8031d,'quickActionData':_0x5b8e88});return _0x4fa9fc['delegate'](...me)['to'](this),this['interactions']['push'](_0x4fa9fc),this['fire']('interactionCreated',_0x4fa9fc),_0x4fa9fc;}['getInteraction'](_0xaee6e5){return this['interactions']['find'](_0xb39b05=>_0xb39b05['id']===_0xaee6e5);}['removeInteraction'](_0x580f63){const _0x578884=this['getInteraction'](_0x580f63);_0x578884&&(_0x578884['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x578884),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x32dc1c){this['chatContext']['addCurrentDocumentToContext'](_0x32dc1c);}async['updateCurrentDocumentInContext']({content:_0x41fbbb,version:_0xd61ad4,sessionId:_0xdf302e,selections:_0x4f2516}){await this['chatContext']['updateCurrentDocument'](_0x41fbbb,_0xd61ad4,_0xdf302e,_0x4f2516);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x3036f4){this['chatContext']['addSelectionToContext'](_0x3036f4);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x1fa3bc){this['chatContext']['addFilesToContext'](_0x1fa3bc);}['addUrlToContext'](_0x1da12c){this['chatContext']['addUrlToContext'](_0x1da12c);}['addResourceToContext'](_0x2552af,_0x4be4f4){this['chatContext']['addResourceToContext'](_0x2552af,_0x4be4f4);}['loadSourceResources'](_0x22069d,_0x1cf104,_0x457f15){return this['chatContext']['loadSourceResources'](_0x22069d,_0x1cf104,_0x457f15);}['removeFromContext'](_0x35f4f9){this['chatContext']['removeFromContext'](_0x35f4f9);}['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'](_0x1d6ea7){if(!_0x1d6ea7)throw new _0x1cd47d('ai-chat-conversation-set-model-null',null,{'conversation':this});if(!0x1===await this['chatModels']['isAvailable'](_0x1d6ea7))throw new _0x1cd47d('ai-chat-conversation-set-model-not-available',null,{'conversation':this,'model':_0x1d6ea7});_0x1d6ea7['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x1d6ea7,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x1d6ea7}));}}function V(_0x33376a){if(_0x33376a instanceof st)return _0x33376a;if(_0x33376a?.['editors']&&_0x33376a['editors']['get'](0x0))return _0x33376a['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.'),_0x33376a['editors']['get'](0x0);throw new _0x1cd47d('ai-get-editor-from-context-no-editor');}const ct='ai-selection';class O extends _0x599126{['_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 _0x36d0e2=V(this['context']),_0x3b0232=_0x36d0e2['plugins']['has']('RealTimeCollaborationClient')&&_0x36d0e2['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x3b0232||_0x91fc81();}return this['_sessionId'];}['getDocumentData'](){const _0x44bb81=V(this['context']),_0x4a7609=_0x44bb81['model'],_0x246480=_0x44bb81['data']['toView'](_0x4a7609['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x55be81=new kt(_0x44bb81['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x246480,_0x55be81);let _0x119c3c=_0x44bb81['data']['processor']['toData'](_0x246480);const _0x1a53b0=this['_getMarkersInDocumentOrder'](),_0x4e7c3f=[];for(const _0x29f0ba of _0x1a53b0){const _0x1968b3='<'+_0x29f0ba['name']+':start></'+_0x29f0ba['name']+':start>',_0x4063e1=_0x119c3c['indexOf'](_0x1968b3);_0x119c3c=_0x119c3c['substring'](0x0,_0x4063e1)+_0x119c3c['substring'](_0x4063e1+_0x1968b3['length']);const _0x18b0d5='<'+_0x29f0ba['name']+':end></'+_0x29f0ba['name']+':end>',_0x295e00=_0x119c3c['indexOf'](_0x18b0d5);_0x119c3c=_0x119c3c['substring'](0x0,_0x295e00)+_0x119c3c['substring'](_0x295e00+_0x18b0d5['length']),_0x4e7c3f['push']({'markerName':_0x29f0ba['name'],'start':_0x4063e1,'end':_0x295e00,'htmlFragment':_0x119c3c['substring'](_0x4063e1,_0x295e00)});}return{'content':_0x119c3c,'version':_0x44bb81['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x4e7c3f};}async['afterInit'](){this['context']instanceof st?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x59b43a,_0x4981bc)=>{_0x4981bc['on']('ready',()=>{this['_integrateEditor'](_0x4981bc);});});}['_integrateEditor'](_0x3e4022){_0x3e4022['conversion']['for']('editingDowncast')['markerToHighlight']({'model':ct,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x3e4022['conversion']['for']('dataDowncast')['markerToElement']({'model':ct,'view':(_0x42779e,{writer:_0x301225,options:_0xaad9c2})=>_0xaad9c2['convertAiChatSelectionMarker']?_0x301225['createUIElement'](_0x42779e['markerName']+':'+(_0x42779e['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x1bf13e,_0x2cc3c8,_0x2a27f4=!0x1,_0x4b4b3c=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x4b4b3c)return!0x1;this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x2cc3c8,this['_displayedFakeSelectionLocked']=_0x2a27f4;const _0x39175a=V(this['context'])['model'];return _0x39175a['change'](_0x7cd084=>{let _0x19b407=0x0;for(let _0x312097 of _0x1bf13e){const _0x645dfe=ct+':'+_0x19b407;if(_0x312097['start']['isAtEnd']){const _0x176bc2=_0x312097['start']['getLastMatchingPosition'](({item:_0x874c87})=>!_0x39175a['schema']['isContent'](_0x874c87),{'boundaries':_0x312097});_0x312097=_0x7cd084['createRange'](_0x176bc2,_0x312097['end']);}_0x7cd084['addMarker'](_0x645dfe,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x312097}),_0x19b407++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x11648){if(this['_displayedFakeSelectionId']!=_0x11648)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x191c1a=V(this['context']),_0x156eec=_0x191c1a['model']['markers']['getMarkersGroup'](ct);return _0x191c1a['model']['change'](_0x3eb611=>{for(const _0x253b47 of _0x156eec)_0x3eb611['removeMarker'](_0x253b47);}),!0x0;}['modelToViewWithIds'](_0x501910){const _0x1ed465=V(this['context']),_0x5072e1=_0x1ed465['data']['toView'](_0x501910),_0x40d48e=new kt(_0x1ed465['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x5072e1,_0x40d48e),_0x5072e1;}['_setDataIdsOnChildren'](_0x154d16,_0x2fe830){let _0x221a7a=!0x1;const _0x5c5cbd=new Set();for(const _0x26b2bb of _0x154d16['getChildren']()){const _0x5811f5=_0x26b2bb['is']('emptyElement')||_0x26b2bb['is']('containerElement');if(!_0x26b2bb['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x26b2bb,_0x2fe830)||_0x5811f5)&&(_0x2fe830['setAttribute']('data-id',this['_nextDataId'](_0x5c5cbd),_0x26b2bb),_0x221a7a=!0x0);}return _0x221a7a;}['_nextDataId'](_0x40e9ed){let _0x5eb833;do{_0x5eb833='';for(let _0x491402=0x0;_0x491402<0x4;_0x491402++)_0x5eb833+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x40e9ed['has'](_0x5eb833));return _0x40e9ed['add'](_0x5eb833),_0x5eb833;}['getSelectionText'](){const {model:_0x212629}=V(this['context']),_0x12f4ce=_0x212629['document']['selection'],_0x2c01cc=_0x212629['getSelectedContent'](_0x12f4ce),_0x252e09=[],_0x849f99=_0x212629['createRangeIn'](_0x2c01cc)['getWalker']();for(const {item:_0x34c591}of _0x849f99)_0x34c591['is']('$textProxy')?_0x252e09['push'](_0x34c591['data']):_0x34c591['is']('element')&&_0x252e09['length']>0x0&&'\x20'!==_0x252e09[_0x252e09['length']-0x1]&&_0x252e09['push']('\x20');return'\x22'+_0x252e09['join']('')['trim']()+'\x22';}['_getMarkersInDocumentOrder'](){const _0x1a1ede=V(this['context'])['model'];return Array['from'](_0x1a1ede['markers']['getMarkersGroup'](ct))['sort']((_0x390aba,_0x572bcb)=>_0x390aba['getStart']()['isBefore'](_0x572bcb['getStart']())?-0x1:_0x390aba['getStart']()['isAfter'](_0x572bcb['getStart']())?0x1:0x0);}}class dt extends _0x595595(){['_modelList']=[];['_connector'];constructor({connector:_0x428545}){super(),this['_connector']=_0x428545;}async['getAll'](){if(!this['_modelList']['length']){const _0x5d964b=this['_connector']['getModels'](),_0x4eb4db=(await _0x5d964b['list']())['items']['sort']((_0x49cc6c,_0x35926a)=>{const _0x3afd5a=Object['values'](_0x49cc6c['capabilities'])['filter'](_0xf5cccf=>_0xf5cccf['enabled'])['length'];return Object['values'](_0x35926a['capabilities'])['filter'](_0x51bad8=>_0x51bad8['enabled'])['length']-_0x3afd5a;});this['_modelList']=_0x4eb4db;}return this['_modelList'];}async['getDefault'](_0x4d878f){const _0x178438=await this['getAll']();if(!_0x178438['length'])return null;if(_0x4d878f){const _0x4c0681=_0x178438['find'](_0x2dffed=>_0x2dffed['id']===_0x4d878f);if(_0x4c0681)return _0x4c0681;_0x5c57f7('ai-chat-default-model-id-unrecognized',{'defaultModelId':_0x4d878f,'fallBackModelId':_0x178438[0x0]['id']});}return _0x178438[0x0];}async['isAvailable'](_0x316a3a){return(await this['getAll']())['some'](_0x157d7e=>_0x157d7e['name']===_0x316a3a['name']&&_0x157d7e['provider']===_0x316a3a['provider']);}}function J({editor:_0x47b002,interaction:_0x62b917,reply:_0x118943,groups:_0x59e0c8,transform:_0x14fe60,documentCompare:_0x469a78,documentCompareOptions:_0x2e15be}){const _0x32fed9=_0x62b917['getDocumentContext']();if(!_0x32fed9)return[];const _0x13a7b9=_0x32fed9['content'],_0xee4c60=_0x32fed9['version'],_0xaf494a=_0x118943['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x5f108b}of _0x59e0c8){const _0x3c6e91=_0x5f108b['filter'](_0xfea3d=>'new'!=_0xfea3d['type'])['map'](_0x3ef927=>It('data-id',_0x3ef927['id'],_0xaf494a)),_0x2fcff8=_0x5f108b['filter'](_0x2c8d64=>'removed'!=_0x2c8d64['type'])['map'](_0x1dd5f2=>_0x1dd5f2['node']['cloneNode'](!0x0));let _0x145d7c=null;if(_0x3c6e91['length']){_0x145d7c=_0x3c6e91[0x0]['previousSibling'];for(let _0x187dc8=0x0;_0x187dc8<_0x3c6e91['length'];_0x187dc8++)_0x37bdbe(_0x3c6e91[_0x187dc8]);}if(_0x2fcff8['length']){_0x145d7c||(_0x5f108b[0x0]['anchorId']?_0x145d7c=It('data-id',_0x5f108b[0x0]['anchorId'],_0xaf494a):(_0x145d7c=_0x2fcff8['shift'](),to(_0xaf494a,_0x145d7c)));for(let _0x355910=0x0;_0x355910<_0x2fcff8['length'];_0x355910++)_0x533ed6(_0x145d7c,_0x2fcff8[_0x355910]),_0x145d7c=_0x2fcff8[_0x355910];}}const _0x33500e=Ct(_0xaf494a),_0x27a9b6=_0x469a78['getDiff'](_0x13a7b9,_0x33500e,_0x2e15be)['getOperations']();if(_0x14fe60){const _0x345c8a=_0x47b002['model']['document']['history']['getOperations'](_0xee4c60),_0x28d806={'document':_0x47b002['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return tt(_0x27a9b6,_0x345c8a,_0x28d806)['operationsA'];}return _0x27a9b6;}function Y({editor:_0x4b4de3,changeGroups:_0x59ca34,documentContextContent:_0x24ec20,showDiff:_0x364926,trimUnchanged:_0x5f4b7c=!0x0}){return _0x59ca34['map'](_0x117921=>{const _0x16cc42=new _t([]),_0x543032=new _t([]);for(const _0x13ee41 of _0x117921['changes'])if(_0x364926&&'removed'==_0x13ee41['type']||_0x543032['children']['push'](_0x13ee41['node']['cloneNode'](!0x0)),'new'!=_0x13ee41['type']&&(_0x364926||'removed'!=_0x13ee41['type'])){const _0x41736d=mt(_0x5c1944=>ft(_0x5c1944,'data-id')==_0x13ee41['id'],_0x24ec20,!0x0);_0x41736d&&_0x16cc42['children']['push'](_0x41736d['cloneNode'](!0x0));}const _0x3286d8=function(_0x548342,_0x311248,_0xe453e,_0x538e10,_0x1f030a=!0x0){const _0x2e118d=_0x548342['plugins']['get']('DocumentCompare'),_0x587617=_0x548342['plugins']['get']('TrackChangesEditing'),_0x5073e8=Ct(_0x311248),_0x2f6a0c=Ct(_0xe453e),_0x197c5a=_0x548342['data']['parse'](_0x5073e8,'$root'),_0x563e4c=_0x548342['model']['createPositionAt'](_0x197c5a,0x0),_0x2832c3=_0x2e118d['getDiff'](_0x5073e8,_0x2f6a0c,{'anchor':_0x563e4c,'markDeletions':_0x538e10}),_0x118a76=_0x2832c3['getOperations']();if(0x0==_0x118a76['length'])return null;_0x538e10?_0x587617['_applyOperationsAsSuggestions'](_0x118a76):_0x548342['model']['change'](_0x27c4e0=>{for(const _0x35d8ed of _0x118a76)if('remove'==_0x35d8ed['type']){const _0x54035d=_0x35d8ed['sourcePosition'],_0xc9d71=_0x35d8ed['howMany'],_0x4065cc=new ut(_0x54035d,_0xc9d71);_0x27c4e0['batch']['addOperation'](_0x4065cc),_0x548342['model']['applyOperation'](_0x4065cc);}else _0x35d8ed['baseVersion']=null,_0x35d8ed['isDocumentOperation']=!0x1,_0x27c4e0['batch']['addOperation'](_0x35d8ed),_0x548342['model']['applyOperation'](_0x35d8ed);});if(_0x1f030a){const _0x3db26c=pt(_0x548342,_0x118a76,_0x197c5a);gt(_0x548342['model'],_0x3db26c),function(_0x1c9912,_0xce7311){const _0x41b8dd=_0xce7311['getFirstRange']()['start'];let _0x467c80=_0xce7311['getFirstRange']()['end'];const _0x2a9f32=_0x41b8dd['root'];(_0x467c80['textNode']||_0x467c80['nodeAfter']&&_0x467c80['nodeAfter']['is']('$text'))&&(_0x159c8d(_0x467c80,'...'),_0x467c80=_0x467c80['getShiftedBy'](0x3)),(_0x41b8dd['textNode']||_0x41b8dd['nodeBefore']&&_0x41b8dd['nodeBefore']['is']('$text'))&&(_0x159c8d(_0x41b8dd,'...'),function(_0x17c516,_0x2a2e47,_0xddc206){for(let [_0x29ecd4,_0x3ec091]of _0x17c516['markers']){const _0x177070=_0x3ec091['_getTransformedByInsertion'](_0x2a2e47,_0xddc206,!0x1);_0x3ec091=_0x177070[0x0],_0x17c516['markers']['set'](_0x29ecd4,_0x3ec091);}}(_0x2a9f32,_0x41b8dd,0x3),_0x41b8dd['parent']==_0x467c80['parent']&&(_0x467c80=_0x467c80['getShiftedBy'](0x3)));const _0x1ce5ff=_0x1c9912['createRange'](_0x1c9912['createPositionAt'](_0x2a9f32,0x0),_0x41b8dd),_0x37d290=_0x1c9912['createRange'](_0x467c80,_0x1c9912['createPositionAt'](_0x2a9f32,'end')),_0x2afbcd=[..._0x1ce5ff['getMinimalFlatRanges'](),..._0x37d290['getMinimalFlatRanges']()];_0x2afbcd['reverse']();for(const _0x411056 of _0x2afbcd)_0x1ac001(_0x411056),Yn(_0x2a9f32,_0x411056);}(_0x548342['model'],_0x3db26c);}const _0x46cf47=_0x548342['data']['stringify'](_0x197c5a,{'showSuggestionHighlights':!0x0});return sr(_0x46cf47);}(_0x4b4de3,_0x16cc42,_0x543032,_0x364926,_0x5f4b7c);return{'type':_0x117921['changes'][0x0]['type'],'index':_0x117921['index'],'content':_0x3286d8};});}function pt(_0x1a3e92,_0x4cbb20,_0x1ba8b0){const _0x5e3298=_0x1a3e92['plugins']['get']('DocumentCompare');let _0x2d729f=_0x1a3e92['model']['createPositionAt'](_0x1ba8b0,Number['POSITIVE_INFINITY']),_0x41347b=_0x1a3e92['model']['createPositionAt'](_0x1ba8b0,0x0);for(const _0x3c8cd3 of _0x4cbb20){let _0x59e7ab,_0x3805a3;if(_0x5e3298['isMarkedRemoveOperation'](_0x3c8cd3))_0x59e7ab=_0x3c8cd3['newRange']['start'],_0x3805a3=_0x3c8cd3['newRange']['end'];else switch(_0x3c8cd3['type']){case'rename':_0x59e7ab=_0x3c8cd3['position'],_0x3805a3=_0x59e7ab['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x59e7ab=_0x3c8cd3['range']['start'],_0x3805a3=_0x3c8cd3['range']['end'];break;case'insert':_0x59e7ab=_0x3c8cd3['position'],_0x3805a3=_0x59e7ab['getShiftedBy'](_0x3c8cd3['howMany']);break;case'split':_0x59e7ab=_0x3c8cd3['splitPosition'],_0x3805a3=_0x3c8cd3['moveTargetPosition'];break;case'merge':{const _0x1af2dd=_0x3c8cd3['targetPosition']['path']['slice'](-0x1);_0x59e7ab=_0x1a3e92['model']['createPositionFromPath'](_0x1ba8b0,_0x1af2dd),_0x3805a3=_0x59e7ab['getShiftedBy'](0x1);break;}case'remove':{const _0x3dd3a7=_0x3c8cd3['howMany'],_0x4a2436=_0x3c8cd3['sourcePosition']['_getTransformedByInsertion'](_0x3c8cd3['targetPosition'],_0x3dd3a7),_0x2600db=_0x3c8cd3['getMovedRangeStart']();'remove'==_0x3c8cd3['type']?(_0x59e7ab=_0x4a2436,_0x3805a3=_0x4a2436):(_0x59e7ab=_0x2600db,_0x3805a3=_0x2600db['getShiftedBy'](_0x3dd3a7));break;}}_0x59e7ab&&_0x59e7ab['isBefore'](_0x2d729f)&&(_0x2d729f=_0x59e7ab),_0x3805a3&&_0x3805a3['isAfter'](_0x41347b)&&(_0x41347b=_0x3805a3);}return _0x1a3e92['model']['createSelection'](_0x1a3e92['model']['createRange'](_0x2d729f,_0x41347b));}function gt(_0x118576,_0x1fce44){Ze(_0x118576,_0x1fce44,'forward');const _0x274555=_0x1fce44['getFirstRange']();_0x1fce44['setTo']([]),_0x1fce44['setTo'](_0x274555,{'backward':!0x0}),Ze(_0x118576,_0x1fce44,'backward');}function Ze(_0xe2cbe1,_0x5ee168,_0x28f968){let _0x56d046=0x14;for(;_0x56d046;){_0xe2cbe1['modifySelection'](_0x5ee168,{'unit':'word','direction':_0x28f968}),_0x56d046--;const _0x164411=_0x5ee168['focus']['forward'==_0x28f968?'nodeBefore':'nodeAfter'];if(_0x164411&&_0x164411['is']('element')&&_0xe2cbe1['schema']['isBlock'](_0x164411)&&_0xe2cbe1['schema']['isObject'](_0x164411))break;}}function Yn(_0x43d225,_0x25332c){for(let [_0x5f1b40,_0x3f3f11]of _0x43d225['markers'])_0x3f3f11=_0x3f3f11['_getTransformedByDeletion'](_0x25332c['start'],_0x25332c['end']['offset']-_0x25332c['start']['offset']),_0x43d225['markers']['set'](_0x5f1b40,_0x3f3f11);}class rh extends _0x4eccef{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x2e1fc5,_0x3f5283={},_0x45408b){super(_0x2e1fc5),this['set']('isLoading',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x3f5283};const _0x4f0cc1=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x4f0cc1?'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'](_0x45408b),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 _0x21c9df(this['locale']),this['likeButton']['set']({'icon':_0x260ffb,'label':Gn(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x25ffca=>!_0x25ffca),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x21c9df(this['locale']),this['dislikeButton']['set']({'icon':_0x257711,'label':Gn(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this,'isLoading',_0xc27019=>!_0xc27019),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x21c9df(this['locale']),this['copyButton']['set']({'icon':_0x1bf67a,'label':Gn(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x31ee0e=>!_0x31ee0e);const _0x1cfcf8=new _0x32fdce();_0x1cfcf8['set']({'content':_0x110ca0}),_0x1cfcf8['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'](_0x1cfcf8);}['_setupShowChangesButton'](_0x4a9865){this['showChangesButton']=new _0x21c9df(this['locale']),this['showChangesButton']['set']({'icon':_0x134bf2,'label':Gn(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'isOn':_0x4a9865}),this['showChangesButton']['bind']('isEnabled')['to'](this,'isLoading',_0x57c6f5=>!_0x57c6f5),this['showChangesButton']['on']('execute',()=>{const _0x16ebd8=!this['showChangesButton']['isOn'];this['showChangesButton']['set']({'isOn':_0x16ebd8,'icon':_0x16ebd8?_0x5da362:_0x134bf2}),this['fire']('toggleShowChanges',_0x16ebd8);});}}class dh extends _0x2855e5{['showChangesToggleView'];constructor(_0xf70d33,_0x574ec8){super(_0xf70d33),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Fn(_0xf70d33),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle','label':Gn(_0xf70d33,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x574ec8['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x552622=>_0x552622?_0x2604e8:_0x1905f2),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x5dda77=new _0x32fdce();_0x5dda77['content']=_0x321efe,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x574ec8['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x5dda77,{'tag':'span','children':[Gn(_0xf70d33,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Fn extends _0x21c9df{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}class ta{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;constructor(_0x382672){this['options']={'delay':_0x382672['delay']??0x14,'textNodeStyle':_0x382672['textNodeStyle'],'onStreamUpdate':_0x382672['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x334121,targetElement:_0x1d152f,abortSignal:_0x5f5b81}){this['isStreaming']&&this['stop'](),_0x5f5b81?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x25db6a(_0x334121,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(_0x5c57f7('html-streamer-current-index-out-of-bounds',{'currentIndex':this['currentIndex'],'nodeList':this['nodesList']}),this['currentIndex']=this['nodesList']['length']);for(let _0x239c4c=0x0;_0x239c4c<this['currentIndex'];_0x239c4c++)this['nodesList'][_0x239c4c]['shouldBeStreamed']=!0x0;let _0x48562a=0x0;for(let _0x53524f=this['currentIndex'];_0x53524f<this['nodesList']['length'];_0x53524f++){const _0x4c3f56=Date['now'](),_0x2345ba=this['nodesList'][_0x53524f],_0x11f545=_0x4c3f56-_0x48562a;_0x2345ba['shouldBeStreamed']=!0x0;let _0x34b1ea=_0x2345ba['parent'];for(;_0x34b1ea;)_0x34b1ea['shouldBeStreamed']=!0x0,_0x34b1ea=_0x34b1ea['parent'];if(_0x11f545<this['options']['delay'])try{const {promise:_0x207892,abortController:_0x4fd7a3}=dr(this['options']['delay']-_0x11f545);this['timeoutAbortController']=_0x4fd7a3,await _0x207892;}catch(_0x1c36dc){return;}_0xe626fc(_0x1d152f,'<'+_0x1d152f['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x1d152f['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']=_0x53524f,_0x48562a=Date['now']();}this['isStreaming']=!0x1;}['cleanUpAnimations']({targetElement:_0x3c6ef0}){Array['from'](_0x3c6ef0['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x3dd2bc=>{_0x3dd2bc['replaceWith'](_0x3dd2bc['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x39a058){let _0x531a15='';if(function(_0x581000){return tn(_0x581000);}(_0x39a058)){for(const _0x5a2284 of _0x39a058['children'])_0x531a15+=this['renderNode'](_0x5a2284);}else{if(mr(_0x39a058)){if(!_0x39a058['shouldBeStreamed'])return'';const _0x268720=_0x39a058,_0x542702=Object['entries'](_0x268720['attribs'])['map'](([_0x17ef91,_0x2c36a1])=>_0x17ef91+'=\x22'+_0x2c36a1+'\x22')['join']('\x20');_0x531a15+='<'+_0x268720['tagName']+(_0x542702?'\x20'+_0x542702:'')+'>';for(const _0x1cffc3 of _0x39c5f5(_0x268720))_0x531a15+=this['renderNode'](_0x1cffc3);_0x531a15+='</'+_0x268720['tagName']+'>';}else{if(!ar(_0x39a058))return'';if(!_0x39a058['shouldBeStreamed'])return'';!function(_0x5eb55a){if(!_0x5eb55a['parent']||!mr(_0x5eb55a['parent']))return!0x1;if(!cr['includes'](_0x5eb55a['parent']['tagName']))return!0x1;return!_0x5b4ac3(_0x5eb55a)['match'](/^\s*[<>]\s*$/);}(_0x39a058)?_0x531a15+=_0x390fc6(_0x39a058):_0x531a15+=_0x390fc6(new _0x450b1b('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x39a058]));}}return _0x531a15;}['getParsedDocumentNodeList'](){const _0x1723a2=[];return function(_0x1f8dc0,_0x3e49f7){const _0x4ce845=_0x2bf7bc=>{if(_0x3e49f7(_0x2bf7bc),_0x2bf7bc instanceof _0x3a85d9)for(let _0x2cc276=0x0;_0x2cc276<_0x2bf7bc['children']['length'];_0x2cc276++){const _0x252348=_0x2bf7bc['children'][_0x2cc276];_0x4ce845(_0x252348);}};for(let _0xf369d1=0x0;_0xf369d1<_0x1f8dc0['children']['length'];_0xf369d1++)_0x4ce845(_0x1f8dc0['children'][_0xf369d1]);}(this['document'],_0xb43890=>{if(ar(_0xb43890)){const _0x2f97a2=this['splitTextNodeIntoWordNodes'](_0xb43890);_0x2f97a2['length']&&_0x1723a2['push'](..._0x2f97a2);}_0xb43890['isWordSplitSource']||_0xb43890['isWordSplitResult']||_0x1723a2['push'](_0xb43890);}),_0x1723a2;}['splitTextNodeIntoWordNodes'](_0x5c2aca){if(_0x5c2aca['isWordSplitSource']||_0x5c2aca['isWordSplitResult'])return[];const _0x1990d3=_0x5b4ac3(_0x5c2aca)['match'](/(?:\s*\S+\s*)/g),_0x3f8209=[];if(_0x1990d3&&_0x1990d3['length']>0x1){for(const _0x4bd653 of _0x1990d3){const _0x550311=new _0x507fb9(_0x4bd653);_0x550311['isWordSplitResult']=!0x0,_0x5c380d(_0x5c2aca,_0x550311),_0x3f8209['push'](_0x550311);}_0x5c2aca['isWordSplitSource']=!0x0,_0x37bdbe(_0x5c2aca);}return _0x3f8209;}}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(_0x35e9f2){return _0x45a4f5(_0x35e9f2);}function mr(_0x30ffe4){return _0x1d4fa0(_0x30ffe4);}function dr(_0x53cdea){const _0x470f0a=new AbortController();return{'promise':new Promise((_0x279eab,_0x5bee39)=>{const _0x342496=setTimeout(_0x279eab,_0x53cdea);_0x470f0a['signal']['addEventListener']('abort',()=>{clearTimeout(_0x342496),_0x5bee39();});}),'abortController':_0x470f0a};}const Te=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'];class Nr extends _0x2855e5{['htmlStreamer'];['children'];['headerView'];['contentView'];constructor(_0x2e49a4,{part:_0x558fbd,areActionsDisabled:_0x3846b3}){super(_0x2e49a4),this['set']('partDefinition',_0x558fbd),this['set']('state','pending'),this['set']('isVisible',!0x1),this['bind']('isEnabled')['to'](this,'state',_0x4a14d2=>'pending'==_0x4a14d2&&!_0x3846b3),this['children']=this['createCollection'](),this['htmlStreamer']=new ta({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['headerView']=new An(_0x2e49a4,_0x558fbd),this['headerView']['bind']('partDefinition')['to'](this),this['headerView']['bind']('isEnabled')['to'](this),this['headerView']['bind']('state')['to'](this),this['headerView']['delegate'](...Te)['to'](this);const _0x2b552f=this['bindTemplate'];this['contentView']=new _0x2855e5(),this['contentView']['setTemplate']({'tag':'div','attributes':{'class':['ck','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',_0x2b552f['to']('state',_0x13388d=>'ck-ai-suggestion__body__content-part_'+_0x13388d),_0x2b552f['to']('isEnabled',_0x4ba2d3=>_0x4ba2d3?'ck-ai-suggestion__body__content-part_active':void 0x0),_0x2b552f['if']('isVisible','ck-hidden',_0x202dff=>!_0x202dff)]},'children':this['children'],'on':{'mouseenter':_0x2b552f['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x558fbd['index']});}),'mouseleave':_0x2b552f['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x558fbd['index']});})}});}async['updateContent']({part:_0x371025,renderingStrategy:_0xbf54aa,abortSignal:_0x4f1fda}){this['partDefinition']=_0x371025,this['isVisible']=!!this['partDefinition']['content'],this['partDefinition']['content']&&('streaming'===_0xbf54aa?await this['htmlStreamer']['stream']({'document':this['partDefinition']['content'],'targetElement':this['contentView']['element'],'abortSignal':_0x4f1fda}):this['contentView']['element']['innerHTML']=Ct(this['partDefinition']['content']));}['toggleHeader'](_0x4bf5f1){_0x4bf5f1?this['children']['has'](this['headerView'])||this['children']['add'](this['headerView'],0x0):this['children']['has'](this['headerView'])&&this['children']['remove'](this['headerView']);}}class An extends _0x2855e5{['children'];['_toolbarView'];['_iconStateAccepted'];['_iconStateRejected'];constructor(_0x2f64c5,_0x20c410){super(_0x2f64c5),this['set']('partDefinition',_0x20c410),this['set']('isEnabled',!0x0),this['set']('state','pending');const _0x3d8f78=new _0x32fdce();_0x3d8f78['content']=_0x4e12c0,_0x3d8f78['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-title']}});const _0x5f5c3e=new _0x21c9df(_0x2f64c5);_0x5f5c3e['set']({'label':Gn(_0x2f64c5,'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT'),'tooltip':!0x0,'withText':!0x1,'icon':_0x181172}),_0x5f5c3e['bind']('isEnabled')['to'](this),_0x5f5c3e['on']('execute',()=>{this['fire']('showChangeInText',{'index':_0x20c410['index']});});const _0x37f6ad=new _0x21c9df(_0x2f64c5);_0x37f6ad['set']({'label':Gn(_0x2f64c5,'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION'),'tooltip':!0x0,'withText':!0x1,'icon':_0x5e145c}),_0x37f6ad['bind']('isEnabled')['to'](this),_0x37f6ad['on']('execute',()=>{this['fire']('insertSuggestion',{'index':_0x20c410['index']});});const _0x500049=new _0x21c9df(_0x2f64c5);_0x500049['set']({'label':Gn(_0x2f64c5,'AI_SUGGESTION_CONTENT_PART_DELETE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x9987f2}),_0x500049['on']('execute',()=>{this['fire']('rejectSuggestion',{'index':_0x20c410['index']});}),_0x500049['bind']('isEnabled')['to'](this),this['_toolbarView']=new _0x4eccef(_0x2f64c5),this['_toolbarView']['items']['addMany']([_0x5f5c3e,_0x37f6ad,_0x500049]),this['_iconStateAccepted']=new _0x32fdce(),this['_iconStateAccepted']['content']=_0x53e681,this['_iconStateAccepted']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-accepted'],'data-cke-tooltip-text':Gn(_0x2f64c5,'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED'),'data-cke-tooltip-position':'n'}}),this['_iconStateRejected']=new _0x32fdce(),this['_iconStateRejected']['content']=_0xa559ff,this['_iconStateRejected']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-rejected'],'data-cke-tooltip-text':Gn(_0x2f64c5,'AI_SUGGESTION_CONTENT_PART_REJECTED'),'data-cke-tooltip-position':'n'}});const _0x295bb6=new _0x2855e5(_0x2f64c5);_0x295bb6['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[Gn(_0x2f64c5,'AI_SUGGESTION_CONTENT_PART_TITLE',(_0x20c410['index']+0x1)['toString']())]}),this['children']=this['createCollection'](),this['children']['addMany']([_0x3d8f78,_0x295bb6,this['_toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title']},'children':this['children']}),this['on']('change:state',(_0x3dc9f0,_0x22ed93,_0x26f9c7,_0x28db21)=>{switch(_0x28db21){case'pending':this['children']['remove'](this['_toolbarView']);break;case'accepted':this['children']['remove'](this['_iconStateAccepted']);break;case'rejected':this['children']['remove'](this['_iconStateRejected']);}switch(_0x26f9c7){case'pending':this['children']['add'](this['_toolbarView']);break;case'accepted':this['children']['add'](this['_iconStateAccepted']);break;case'rejected':this['children']['add'](this['_iconStateRejected']);}});}}class Q extends _0x595595(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x322943){const _0xde44d=this['createTask'](_0x322943);return this['queue']['push'](_0xde44d),this['_processQueue'](),_0xde44d['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(_0x599bb9=>{this['once']('_queueEmpty',()=>{_0x599bb9();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x2c292a=this['queue']['shift']();try{await _0x2c292a['callback'](this['_abortController']['signal']),_0x2c292a['resolve']();}catch(_0x58adb8){_0x2c292a['reject'](_0x58adb8);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x40a12e){let _0x3130c0,_0x1cdca3;const _0x5cb259=new Promise((_0x19c933,_0x446148)=>{_0x3130c0=_0x19c933,_0x1cdca3=_0x446148;});return{'callback':_0x40a12e,'resolve':_0x3130c0,'reject':_0x1cdca3,'completePromise':_0x5cb259};}}class jr extends _0x2855e5{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x3e6d8d){super();const _0x12171f=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new ta({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0x3e6d8d,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x12171f['if']('isDone','ck-ai-chat__feed__item_done'),_0x12171f['if']('isVisible','ck-hidden',_0x5d009e=>!_0x5d009e),'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'](_0x5a9c23=>{_0x5a9c23['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x341419,_0x1964b1,_0x125a5a){await this['htmlStreamer']['stream']({'document':_0x341419,'targetElement':_0x1964b1,'abortSignal':_0x125a5a});}}class ye extends jr{constructor(_0x4a47dc){super(_0x4a47dc),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-error','warning'===_0x4a47dc['level']?'ck-ai-chat-error_warning':'']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x406380){this['element']['innerHTML']=_0x406380;}}class lh extends _0x2855e5{['_children'];['_areActionsDisabled'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];constructor(_0x1aa4e5,{areActionsDisabled:_0x17cf74}){super(_0x1aa4e5),this['_areActionsDisabled']=_0x17cf74,this['set']('hasPendingParts',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new Q(),this['_emptyPartsWarningView']=new ye({'id':'empty-parts-warning','initialContent':Gn(_0x1aa4e5,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-suggestion__body','ck-content']},'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:_0x59951b,renderingStrategy:_0x91579c,abortSignal:_0x1c0f03}){for(const _0x3d499c of _0x59951b)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x154748=>{let _0x14d7c9=this['_children']['find'](_0x100b1f=>_0x100b1f['partDefinition']['index']==_0x3d499c['index']);_0x14d7c9||(_0x14d7c9=new Nr(this['locale'],{'part':_0x3d499c,'areActionsDisabled':this['_areActionsDisabled']}),_0x14d7c9['delegate'](...Te)['to'](this),this['_children']['add'](_0x14d7c9),this['hasPendingParts']=!0x0),0x2===this['_children']['length']&&this['_children']['first']['toggleHeader'](!0x0),_0x14d7c9['toggleHeader'](this['_children']['length']>0x1),await _0x14d7c9['updateContent']({'part':_0x3d499c,'renderingStrategy':_0x91579c,'abortSignal':_0x154748});});return _0x1c0f03?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x12a837,_0x3ec69c){this['_children']['get'](_0x12a837)['state']=_0x3ec69c,this['hasPendingParts']='pending'==_0x3ec69c||Array['from'](this['_children'])['some'](_0x4fd2e6=>'pending'==_0x4fd2e6['state']);}['getPartView'](_0x1b37b5){return this['_children']['get'](_0x1b37b5);}['markAsDone'](){const _0xc7de1b=!this['_children']['find'](_0x9ba767=>!!_0x9ba767['partDefinition']['content']),_0x2e74b2=!!this['_children']['find'](_0x16a808=>!_0x16a808['partDefinition']['content']);this['_emptyPartsWarningView']['isVisible']=_0x2e74b2,_0xc7de1b?this['_emptyPartsWarningView']['setContent'](Gn(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](Gn(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}get['hasNonEmptyParts'](){return!!this['_children']['find'](_0x32d65f=>!!_0x32d65f['partDefinition']['content']);}}class Ve extends _0x2c54b2{constructor(_0x4ac8de=void 0x0){super();const _0x40ae74=_0x4ac8de?'ck-ai-spinner_'+_0x4ac8de:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x40ae74]}});}}class R extends _0x2855e5{['bodyView'];['children'];['headerView'];['miniToolbarView'];['loaderView'];['sourcesView'];constructor(_0xbc799f,{showDiff:_0x391aa7,areActionsDisabled:_0x114d52,miniToolbarConfig:_0x9c27f6,hideHeader:_0x4bcfb6,showLoader:_0x16f514}){super(_0xbc799f),this['set']('areChangesVisible',!0x1),this['set']('isLoaderVisible',!!_0x16f514),this['set']('isLoading',!0x1),this['children']=this['createCollection'](),_0x4bcfb6||(this['headerView']=new dh(_0xbc799f,{'showDiff':_0x391aa7}),this['headerView']['on']('toggleShowChanges',(_0xf2e30b,_0x507d28)=>{this['areChangesVisible']=_0x507d28['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x507d28['isOn']});}),this['children']['add'](this['headerView'])),this['bodyView']=new lh(_0xbc799f,{'areActionsDisabled':_0x114d52}),this['bodyView']['delegate'](...Te)['to'](this),this['bodyView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoaderVisible','ck-hidden')]}}),this['miniToolbarView']=new rh(_0xbc799f,_0x9c27f6,_0x391aa7),this['miniToolbarView']['delegate'](...Te)['to'](this),this['miniToolbarView']['on']('toggleShowChanges',(_0x2808c3,_0x533221)=>{this['areChangesVisible']=_0x533221,this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x533221});}),this['miniToolbarView']['bind']('isLoading')['to'](this),this['children']['add'](this['bodyView']),this['children']['add'](this['miniToolbarView']),this['sourcesView']=new Sr(this['locale']),this['children']['add'](this['sourcesView']),_0x16f514&&(this['loaderView']=this['_createLoaderView'](),this['children']['add'](this['loaderView'])),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x22fd75){await this['bodyView']['updateContentParts'](_0x22fd75);}['updateSources'](_0x23738c){this['sourcesView']['children']['addMany'](_0x23738c['map'](_0x12e1d8=>new Fr(this['locale'],_0x12e1d8))),this['sourcesView']['isVisible']=!0x0;}['showLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x0);}['hideLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x1);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['_createLoaderView'](){const _0x14f135=new _0x2855e5(this['locale']),_0x20e3a2=new Ve('small');_0x20e3a2['isVisible']=!0x0;const _0x5f2fb7=new _0x2855e5(this['locale']);return _0x5f2fb7['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[Gn(this['locale'],'AI_CHAT_IS_WRITING')]}),_0x14f135['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isLoaderVisible','ck-hidden',_0x48a5e4=>!_0x48a5e4)]},'children':[_0x20e3a2,_0x5f2fb7]}),_0x14f135;}}class Sr extends _0x2855e5{['children'];constructor(_0x318c44){super(_0x318c44),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',_0x3d9118=>!_0x3d9118)]},'children':this['children']});const _0x16b95a=new _0x2855e5(this['locale']),_0x38fb42=new _0x32fdce();_0x38fb42['content']=_0x64b6,_0x16b95a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x38fb42,{'tag':'span','children':[{'text':'Sources'}]}]}),this['children']['add'](_0x16b95a);}}class Fr extends _0x21c9df{constructor(_0x2f4a79,_0x5c3d86){super(_0x2f4a79),this['set']({'icon':_0x64b6,'label':_0x5c3d86['title'],'tooltip':_0x5c3d86['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});}}class ls extends _0x4eccef{constructor(_0x2c93e6,_0x87bfc4=!0x0,_0x36699a=!0x0){super(_0x2c93e6),this['set']('isLoading',!0x1),_0x87bfc4&&(this['applyButton']=this['_createButton'](Gn(_0x2c93e6,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x38de40=>!_0x38de40),this['items']['add'](this['applyButton'])),_0x36699a&&(this['suggestButton']=this['_createButton'](Gn(_0x2c93e6,'AI_BALLOON_SUGGEST_BUTTON'),'ck-ai-button-secondary'),this['suggestButton']['bind']('isEnabled')['to'](this,'isLoading',_0x3e14f6=>!_0x3e14f6),this['items']['add'](this['suggestButton'])),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['_createButton'](_0x2fddaa,_0x25dd98){const _0x200137=new _0x21c9df(this['locale']);return _0x200137['set']({'label':_0x2fddaa,'class':_0x25dd98||'','isVisible':!0x0,'withText':!0x0}),_0x200137;}}class ds extends _0x2855e5{constructor(_0xe21628){super(_0xe21628),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':Gn(_0xe21628,'AI_DISCLAIMER_TEXT')}]}]});}}const P=['applySuggestion','insertSuggestion','showNext','showPrevious'];class D extends _0x2855e5{['focusTracker'];['keystrokes'];['focusCycler'];['_focusables'];constructor(_0x26f2cb,_0x2b82f9){super(_0x26f2cb),this['set']('isLoading',!0x1),this['focusTracker']=new _0x394dab(),this['keystrokes']=new _0x574245(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x920639({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x1cd988(),this['_addContentView'](_0x2b82f9['mainView']),this['_addDisclaimerView'](),this['_addToolbar'](_0x2b82f9['showApplyButton'],_0x2b82f9['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']});}['render'](){super['render']();for(const _0x399a12 of this['_focusables'])this['focusTracker']['add'](_0x399a12['element']);this['keystrokes']['listenTo'](this['element']);}['focus'](_0x56194e){-0x1===_0x56194e?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['setupRotator'](_0x4fb94c){const _0x5314a5=this['_createNextButtonView'](),_0x5a2a76=this['_createPreviousButtonView']();_0x4fb94c['view']['headerView']['children']['add'](_0x5314a5,0x2),_0x4fb94c['view']['headerView']['children']['add'](_0x5a2a76,0x0),this['_focusables']['addMany']([_0x5314a5,_0x5a2a76]),this['focusTracker']['add'](_0x5314a5['element']),this['focusTracker']['add'](_0x5a2a76['element']);}['_addContentView'](_0x578c7d){this['_mainView']=_0x578c7d,this['_dialogContent']['add'](this['_mainView']);}['_addDisclaimerView'](){this['disclaimerView']=new ds(this['locale']),this['_dialogContent']['add'](this['disclaimerView']);}['_addToolbar'](_0x1b6dcf=!0x0,_0x2dc850=!0x0){this['toolbar']=new ls(this['locale'],_0x1b6dcf,_0x2dc850),this['toolbar']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['toolbar']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_dialogContent']['add'](this['toolbar']);}['_createNextButtonView'](){const _0x118266=new _0x21c9df(this['locale']);return _0x118266['set']({'icon':_0x59602d,'tooltip':Gn(this['locale'],'AI_BALLOON_NEXT_TOOLTIP')}),_0x118266['on']('execute',()=>{this['fire']('showNext');}),_0x118266;}['_createPreviousButtonView'](){const _0x44dd38=new _0x21c9df(this['locale']);return _0x44dd38['set']({'icon':_0x582b36,'tooltip':Gn(this['locale'],'AI_BALLOON_PREVIOUS_TOOLTIP')}),_0x44dd38['on']('execute',()=>{this['fire']('showPrevious');}),_0x44dd38;}}class G extends _0x599126{static get['requires'](){return[N,O];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_config'];['open'](_0x330b65){const _0x54ae73=V(this['context']);this['_config']=_0x330b65,this['balloonView']=new D(_0x54ae73['locale'],_0x330b65),this['balloonView']['delegate'](...P)['to'](this),this['_showDialog'](_0x330b65);}['close'](){V(this['context'])['plugins']['get']('Dialog')['hide']();}['_setupVisualSelection'](_0x19e2ef,_0x49b480){this['context']['plugins']['get'](O)['showFakeVisualSelection'](_0x19e2ef,'ai-balloon-'+_0x49b480,!0x0,!0x0);}['_showDialog'](_0x601373){const _0x532eab=V(this['context']);this['_setupVisualSelection'](_0x601373['ranges'],_0x601373['index']),_0x532eab['plugins']['get']('Dialog')['show']({'title':_0x601373['title'],'icon':_0x601373['icon'],'hasCloseButton':!0x0,'id':'aiBalloon','position':this['_calculateDialogPosition']['bind'](this),'className':'ai-balloon'+(_0x601373['showRotator']?'\x20ai-balloon-rotator':''),'content':this['balloonView'],'onShow':_0x1096c0=>{_0x601373['showRotator']&&this['balloonView']['setupRotator'](_0x1096c0),this['isOpen']=!0x0;},'onHide':()=>{this['context']['plugins']['get']('AIEditing')['hideFakeVisualSelection']('ai-balloon-'+_0x601373['index']),this['fire']('dialogClosed'),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x26c4c3,_0x231d14){const _0xfe239d=V(this['context']);if(!_0x231d14)return{'left':0x0,'top':0x0};const _0x1b52d0=_0x373e3f(_0xfe239d['editing'],[..._0xfe239d['model']['markers']['getMarkersGroup']('ai-selection'),..._0xfe239d['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);if(!_0x1b52d0||0x0===_0x1b52d0['length'])return{'left':Math['round'](_0x231d14['left']+_0x231d14['width']/0x2-_0x26c4c3['width']/0x2),'top':Math['round'](_0x231d14['top']+_0x231d14['height']/0x2-_0x26c4c3['height']/0x2)};const _0xa8dc8d=Math['round'](_0x231d14['left']+_0x231d14['width']/0x2-_0x26c4c3['width']/0x2),_0x2f5f67=_0x1b52d0[0x0]['getBoundingClientRect'](),_0x51385e=_0x1b52d0[_0x1b52d0['length']-0x1]['getBoundingClientRect'](),_0x55def8=_0x26c4c3['height'],_0x4833c8=this['_config']['showRotator']?0x8:0x0;return{'left':_0xa8dc8d,'top':this['_calculateOptimalTopPosition'](_0x2f5f67,_0x51385e,_0x55def8,_0x4833c8)};}['_calculateOptimalTopPosition'](_0x4cd561,_0xcd8c57,_0x1a2c91,_0x155b26=0x0){const _0x3088c4=_0xcd8c57['top']+_0xcd8c57['height'],_0x573bde=_0x4cd561['top']-_0x1a2c91-_0x155b26,_0x1f0e2b=window['innerHeight']-_0x3088c4-0xa,_0x3908d8=_0x4cd561['top']-_0x155b26-0xa;let _0x5cd06b;if(_0x1f0e2b>=_0x1a2c91)_0x5cd06b=_0x3088c4+0xa;else{if(_0x3908d8>=_0x1a2c91)_0x5cd06b=_0x573bde-0xa;else _0x5cd06b=_0x4cd561['top']+(_0xcd8c57['top']+_0xcd8c57['height'])/0x2-(_0x1a2c91+_0x155b26)/0x2;}return _0x5cd06b;}}class et extends _0x599126{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_batchToChanges']=new Map();['_previewedChangeGroup']=null;['_balloonShowDiff']=!0x1;static get['requires'](){return[N,G,_0x49b43e];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new dt({'connector':this['_aiConnector']});const _0x41dcda=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_handleStartConversation']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x58c101,_0x1c81aa)=>{this['_handleUIUserMessage']({'userMessage':_0x1c81aa});}),this['listenTo'](_0x41dcda,'resizedTabs',(_0x54a2a7,_0x533cfd)=>{this['_setIsMaximized'](_0x533cfd);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x41dcda['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['activeConversation']?.['addCurrentDocumentToContext'](Gn(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x7ba88c,_0x1450c9)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x1450c9));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x89e28e,_0x350258)=>{this['activeConversation']?.['addUrlToContext'](_0x350258);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x262a5a,_0xb29555)=>{this['activeConversation']?.['addResourceToContext'](_0xb29555['source'],_0xb29555['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x386c4e,_0x4a6bbe)=>{this['_removeFromContext'](_0x4a6bbe);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x5e474e,_0x485f31)=>{this['activeConversation']?.['loadSourceResources'](_0x485f31['sourceId'],_0x485f31['query'],_0x485f31['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x3536a8,_0x5ce8d5)=>{this['activeConversation']?.['setModel'](_0x5ce8d5);}),this['listenTo'](this['_aiChatUi'],'like',(_0x453310,{replyId:_0x3074af})=>{console['log']('Liked\x20response',_0x3074af);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x46cdac,{replyId:_0x1a1aaa})=>{console['log']('Disliked\x20response',_0x1a1aaa);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x104200,_0x579133)=>{this['context']['plugins']['get'](G)['close'](),this['_insertSuggestion'](_0x579133);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x565fae,{replyId:_0x228009,partIndex:_0x15538b})=>{this['_balloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x228009,_0x15538b);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x5608d5,{replyId:_0x2c9b2e,partIndex:_0x4d8f1d})=>{const _0x172766=this['_getDocumentRangeForReplyChanges'](_0x2c9b2e,_0x4d8f1d);_0x172766&&'$graveyard'!=_0x172766['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x172766['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x23c1e3,_0x822f2c)=>{this['context']['plugins']['get'](G)['close'](),this['_applySuggestion'](_0x822f2c);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x1e9984,_0x263ddc)=>{const {reply:_0x4973c2}=this['getInteractionAndReplyById'](_0x263ddc['replyId']),_0x16ccd0=Y({'editor':V(this['context']),'changeGroups':_0x4973c2['changeGroups'],'documentContextContent':_0x4973c2['documentContextContent'],'showDiff':_0x263ddc['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x4973c2['id'],'parts':_0x16ccd0,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x10f634,{replyId:_0x31c23d,partIndex:_0xec4083})=>{this['_previewedChangeGroup']?.['replyId']==_0x31c23d&&this['_previewedChangeGroup']?.['partIndex']==_0xec4083&&this['context']['plugins']['get'](G)['close']();const {reply:_0x42fb61}=this['getInteractionAndReplyById'](_0x31c23d);_0x42fb61['setChangeGroupState'](_0xec4083,'rejected'),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');});}async['afterInit'](){this['context']instanceof st?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x806beb,_0x1bf11a)=>{_0x1bf11a['on']('ready',()=>{this['_integrateEditor'](_0x1bf11a);});}),await this['_handleStartConversation']();}['_insertSuggestion'](_0x15995f){const _0x4d14be=V(this['context']);if(!_0x4d14be['plugins']['has']('TrackChangesEditing'))return;const _0x37c590=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x2708d5,interaction:_0x5379c9}=this['getInteractionAndReplyById'](_0x15995f['replyId']),_0x585754=this['_getDocumentRangeForReplyChanges'](_0x15995f['replyId'],_0x15995f['partIndex']),_0x4eba32=void 0x0!==_0x15995f['partIndex']?[_0x2708d5['changeGroups'][_0x15995f['partIndex']]]:_0x2708d5['changeGroups']['filter'](_0x51e8ce=>'pending'==_0x51e8ce['state']),_0xf6c638=_0x4eba32['map'](_0x3bf7de=>_0x2708d5['changeGroups']['indexOf'](_0x3bf7de));_0xf6c638['forEach'](_0x2f49a6=>_0x2708d5['setChangeGroupState'](_0x2f49a6,'accepted'));const _0x2c2662=J({'editor':_0x4d14be,'reply':_0x2708d5,'interaction':_0x5379c9,'groups':_0x4eba32,'transform':!0x0,'documentCompare':_0x37c590,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x14aada;_0x585754&&this['_scrollToSuggestionRange'](_0x585754['range']),_0x4d14be['model']['change'](_0xa2b4c=>{_0x14aada=_0xa2b4c['batch'],_0x4d14be['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x2c2662),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x14aada,{'interactionId':_0x5379c9['id'],'replyId':_0x2708d5['id'],'indexes':_0xf6c638['slice']()});}['_applySuggestion'](_0x4c2b3d){const _0x127c66=V(this['context']),_0x15df22=this['context']['plugins']['get'](_0x49b43e),{reply:_0x3faaac,interaction:_0x3a30a6}=this['getInteractionAndReplyById'](_0x4c2b3d['replyId']),_0x8e0b3b=this['_getDocumentRangeForReplyChanges'](_0x4c2b3d['replyId'],_0x4c2b3d['partIndex']),_0x3bac33=void 0x0!==_0x4c2b3d['partIndex']?[_0x3faaac['changeGroups'][_0x4c2b3d['partIndex']]]:_0x3faaac['changeGroups']['filter'](_0x114e3f=>'pending'==_0x114e3f['state']),_0x583129=_0x3bac33['map'](_0x4ccbf8=>_0x3faaac['changeGroups']['indexOf'](_0x4ccbf8));_0x583129['forEach'](_0x57128f=>_0x3faaac['setChangeGroupState'](_0x57128f,'accepted'));const _0x3613a1=J({'editor':_0x127c66,'reply':_0x3faaac,'interaction':_0x3a30a6,'groups':_0x3bac33,'transform':!0x0,'documentCompare':_0x15df22,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x431a68;_0x8e0b3b&&this['_scrollToSuggestionRange'](_0x8e0b3b['range']),_0x127c66['model']['change'](_0x1a0158=>{_0x431a68=_0x1a0158['batch'];for(const _0x10f4c4 of _0x3613a1)_0x10f4c4['baseVersion']=_0x127c66['model']['document']['version'],_0x1a0158['batch']['addOperation'](_0x10f4c4),_0x127c66['model']['applyOperation'](_0x10f4c4);}),this['_batchToChanges']['set'](_0x431a68,{'interactionId':_0x3a30a6['id'],'replyId':_0x3faaac['id'],'indexes':_0x583129['slice']()});}['_openBalloonFor'](_0x2ca7f8,_0x4c8cd2){const _0x57f2f6=V(this['context']),_0x5eff43=this['_getDocumentRangeForReplyChanges'](_0x2ca7f8,_0x4c8cd2),_0x113ff2=this['context']['plugins']['get'](G);if(!_0x5eff43)return void _0x113ff2['close']();const {range:_0x132814,currentIndex:_0x4aecf7,previousIndex:_0x230da9,nextIndex:_0x24520b}=_0x5eff43;if(this['_previewedChangeGroup']?.['replyId']==_0x2ca7f8&&this['_previewedChangeGroup']?.['partIndex']==_0x4aecf7)return;this['_previewedChangeGroup']={'replyId':_0x2ca7f8,'partIndex':_0x4aecf7};const _0x55dda2=new R(_0x57f2f6['locale'],{'showDiff':this['_balloonShowDiff'],'areActionsDisabled':!0x1,'miniToolbarConfig':{'showChanges':'full'},'hideHeader':!0x0}),{reply:_0x4b1afe}=this['getInteractionAndReplyById'](_0x2ca7f8),_0x6e2e69=Y({'editor':_0x57f2f6,'changeGroups':[_0x4b1afe['changeGroups'][_0x4aecf7]],'documentContextContent':_0x4b1afe['documentContextContent'],'showDiff':this['_balloonShowDiff']});_0x55dda2['updateContent']({'parts':_0x6e2e69,'renderingStrategy':'static'});const _0x5ed66a=_0x4aecf7!==_0x230da9;this['_scrollToSuggestionRange'](_0x132814,!0x0),_0x113ff2['open']({'index':_0x4aecf7,'title':'Suggestion\x20'+(_0x4aecf7+0x1),'icon':yt,'mainView':_0x55dda2,'showRotator':_0x5ed66a,'showApplyButton':!0x0,'showSuggestButton':!0x0,'ranges':[_0x132814]}),this['_aiChatUi']['scrollFeedToSuggestion'](_0x2ca7f8,_0x4aecf7),this['listenTo'](_0x55dda2,'toggleSuggestionDisplayMode',(_0x22a0ec,{showDiff:_0x188e03})=>{this['_balloonShowDiff']=_0x188e03;const {reply:_0x3cd75a}=this['getInteractionAndReplyById'](_0x2ca7f8),_0x347f3b=Y({'editor':_0x57f2f6,'changeGroups':[_0x3cd75a['changeGroups'][_0x4aecf7]],'documentContextContent':_0x3cd75a['documentContextContent'],'showDiff':_0x188e03});_0x55dda2['updateContent']({'parts':_0x347f3b,'renderingStrategy':'static'});}),this['listenTo'](_0x113ff2,'applySuggestion',()=>{this['_applySuggestion']({'replyId':_0x2ca7f8,'partIndex':_0x4aecf7}),_0x5ed66a?this['_openBalloonFor'](_0x2ca7f8,_0x24520b):_0x113ff2['close']();}),this['listenTo'](_0x113ff2,'insertSuggestion',()=>{this['_insertSuggestion']({'replyId':_0x2ca7f8,'partIndex':_0x4aecf7}),_0x5ed66a?this['_openBalloonFor'](_0x2ca7f8,_0x24520b):_0x113ff2['close']();}),_0x5ed66a&&(this['listenTo'](_0x113ff2,'showNext',()=>{this['_openBalloonFor'](_0x2ca7f8,_0x24520b);}),this['listenTo'](_0x113ff2,'showPrevious',()=>{this['_openBalloonFor'](_0x2ca7f8,_0x230da9);})),this['listenTo'](_0x113ff2,'dialogClosed',()=>{this['stopListening'](_0x113ff2),this['stopListening'](_0x55dda2),this['_previewedChangeGroup']=null;});}['_getDocumentRangeForReplyChanges'](_0x272a85,_0x10ffb2){const _0x5dcfe4=V(this['context']),{reply:_0x4b9fbe,interaction:_0x316f91}=this['getInteractionAndReplyById'](_0x272a85),_0x503851=_0x4b9fbe['changeGroups']['filter'](_0x4cafce=>'pending'==_0x4cafce['state']),_0x308463=_0x503851['map'](_0x351238=>_0x4b9fbe['changeGroups']['indexOf'](_0x351238));void 0x0===_0x10ffb2&&(_0x10ffb2=_0x308463[0x0]);const _0x29f4d8=_0x308463['indexOf'](_0x10ffb2);if(-0x1==_0x29f4d8)return null;const _0x217a3c=0x0==_0x29f4d8?_0x308463[_0x308463['length']-0x1]:_0x308463[_0x29f4d8-0x1],_0x325211=_0x29f4d8==_0x308463['length']-0x1?_0x308463[0x0]:_0x308463[_0x29f4d8+0x1],_0x21099c=_0x503851[_0x29f4d8],_0x5b5610=new _t([]),_0x13d61d=new _t([]);for(const _0x20df13 of _0x21099c['changes'])if('removed'!=_0x20df13['type']&&_0x13d61d['children']['push'](_0x20df13['node']['cloneNode'](!0x0)),'new'!=_0x20df13['type']){const _0x1a3bc3=mt(_0x89c52b=>ft(_0x89c52b,'data-id')==_0x20df13['id'],_0x4b9fbe['documentContextContent'],!0x0);_0x5b5610['children']['push'](_0x1a3bc3['cloneNode'](!0x0));}if(0x0==_0x5b5610['children']['length']){if(_0x21099c['changes'][0x0]['anchorId']){const _0x2d38b4=It('data-id',_0x21099c['changes'][0x0]['anchorId'],_0x4b9fbe['documentContextContent']);_0x5b5610['children']['unshift'](_0x2d38b4['cloneNode'](!0x0)),_0x13d61d['children']['unshift'](_0x2d38b4['cloneNode'](!0x0)),_0x2d38b4['nextSibling']&&(_0x5b5610['children']['push'](_0x2d38b4['nextSibling']['cloneNode'](!0x0)),_0x13d61d['children']['push'](_0x2d38b4['nextSibling']['cloneNode'](!0x0)));}else{const _0x323dc6=_0x4b9fbe['documentContextContent']['children'][0x0];if(!_0x323dc6)return null;_0x5b5610['children']['push'](_0x323dc6['cloneNode'](!0x0)),_0x13d61d['children']['push'](_0x323dc6['cloneNode'](!0x0));}}const _0x423d24=_0x316f91['getDocumentContext'](),_0x4e18d4=_0x5dcfe4['data']['parse'](_0x423d24['content']),_0xd024b2=Ct(_0x5b5610),_0xace152=_0x5dcfe4['data']['parse'](_0xd024b2),_0x1916cf=_0x5dcfe4['data']['parse'](_0xd024b2),_0x24cf04=_0x5dcfe4['model']['createPositionAt'](_0xace152,0x0),_0x57317e=Ct(_0x13d61d),_0x4e57ea={'anchor':_0x24cf04,'markDeletions':!0x1},_0x582595=_0x5dcfe4['plugins']['get'](_0x49b43e)['getDiff'](_0xd024b2,_0x57317e,_0x4e57ea)['getOperations']();if(!_0x582595['length'])return null;_0x5dcfe4['model']['change'](_0x3824df=>{for(const _0x4d576f of _0x582595)if('remove'==_0x4d576f['type']){const _0x3544c4=_0x4d576f['sourcePosition'],_0x555c03=_0x4d576f['howMany'],_0x34949f=new ut(_0x3544c4,_0x555c03);_0x3824df['batch']['addOperation'](_0x34949f),_0x5dcfe4['model']['applyOperation'](_0x34949f);}else _0x4d576f['baseVersion']=null,_0x4d576f['isDocumentOperation']=!0x1,_0x3824df['batch']['addOperation'](_0x4d576f),_0x5dcfe4['model']['applyOperation'](_0x4d576f);});const _0x332770=pt(_0x5dcfe4,_0x582595,_0xace152);gt(_0x5dcfe4['model'],_0x332770);const _0x3f0156=_0x332770['getFirstRange']()['start']['path']['slice'](),_0x2b05c3=_0x332770['getFirstRange']()['end']['path']['slice'](),_0x6155f7=[];let _0x3d4816=_0xace152,_0x4076f5=_0x1916cf;for(let _0x3b40e9=0x0;_0x3b40e9<_0x2b05c3['length'];_0x3b40e9++){const _0x567742=_0x3d4816['maxOffset']-_0x2b05c3[_0x3b40e9];_0x6155f7[_0x3b40e9]=_0x4076f5['maxOffset']-_0x567742,_0x3d4816=_0x3d4816['getChildAtOffset'](_0x2b05c3[_0x3b40e9]),_0x4076f5=_0x4076f5['getChildAtOffset'](_0x6155f7[_0x3b40e9]);}const _0x128b4f=_0x5dcfe4['model']['createRange'](_0x5dcfe4['model']['createPositionFromPath'](_0x1916cf,_0x3f0156),_0x5dcfe4['model']['createPositionFromPath'](_0x1916cf,_0x6155f7)),_0x55f7e5=_0x1916cf['getChild'](0x0)['getAttribute'](lt),_0x2e359b=Array['from'](_0x4e18d4['getChildren']())['find'](_0x30f08c=>_0x30f08c['getAttribute'](lt)==_0x55f7e5)['getPath'](),_0x3d2417=_0x128b4f['start']['path']['slice'](),_0x22de59=_0x128b4f['end']['path']['slice']();_0x3d2417[0x0]=_0x2e359b[0x0]+_0x3d2417[0x0],_0x22de59[0x0]=_0x2e359b[0x0]+_0x22de59[0x0];let _0x38ebac=_0x5dcfe4['model']['createRange'](_0x5dcfe4['model']['createPositionFromPath'](_0x5dcfe4['model']['document']['getRoot'](),_0x3d2417),_0x5dcfe4['model']['createPositionFromPath'](_0x5dcfe4['model']['document']['getRoot'](),_0x22de59));const _0x150d69=_0x5dcfe4['model']['document']['history']['getOperations'](_0x423d24['version']);for(const _0x10764d of _0x150d69)_0x38ebac=_0x27581['_createFromRanges'](_0x38ebac['getTransformedByOperation'](_0x10764d));return{'range':_0x38ebac,'previousIndex':_0x217a3c,'nextIndex':_0x325211,'currentIndex':_0x10ffb2};}['_integrateEditor'](_0x57b1f4){if(!_0x57b1f4['plugins']['has']('Undo'))return;const _0x7006c5=_0x57b1f4['commands']['get']('undo'),_0x118151=_0x57b1f4['commands']['get']('redo');this['listenTo'](_0x7006c5,'revert',(_0x3d6b95,_0x1b9684,_0x2e8fea)=>{const _0x4c0d2a=this['_batchToChanges']['get'](_0x1b9684);if(!_0x4c0d2a)return;const _0x336593=this['activeConversation']['getInteraction'](_0x4c0d2a['interactionId'])['getReply'](_0x4c0d2a['replyId']);_0x4c0d2a['indexes']['forEach'](_0xf626cb=>_0x336593['setChangeGroupState'](_0xf626cb,'pending')),this['_batchToChanges']['delete'](_0x1b9684),this['_batchToChanges']['set'](_0x2e8fea,_0x4c0d2a);}),this['listenTo'](_0x118151,'revert',(_0x229731,_0x2c352f,_0x40be3e)=>{const _0x235ba5=this['_batchToChanges']['get'](_0x2c352f);if(!_0x235ba5)return;const _0x4f0549=this['activeConversation']['getInteraction'](_0x235ba5['interactionId'])['getReply'](_0x235ba5['replyId']);_0x235ba5['indexes']['forEach'](_0x293770=>_0x4f0549['setChangeGroupState'](_0x293770,'accepted')),this['_batchToChanges']['delete'](_0x2c352f),this['_batchToChanges']['set'](_0x40be3e,_0x235ba5);});}async['loadConversation'](_0x19bf82){this['context']['plugins']['get'](G)['close'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']();try{const _0x26b1d9=this['context']['plugins']['get'](rt);this['updateConversationTitle']('\x20'),_0x26b1d9['view']['activateTab']('chat'),await this['_handleStartConversation'](_0x19bf82);const {sessionId:_0x46eb1e}=this['_aiEditing']['getDocumentData']();await this['activeConversation']['load'](_0x19bf82,_0x46eb1e),this['activeConversation']['isCurrentDocumentInConversation']()&&this['activeConversation']['addCurrentDocumentToContext'](Gn(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}catch(_0x363443){console['error']('Failed\x20to\x20load\x20conversation',_0x363443);}finally{this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['handleRemovedConversation'](_0x2c2dc6){this['activeConversation']['id']===_0x2c2dc6&&this['_handleStartConversation']();}async['addSelectionToChatContext'](){const _0x14c8e4=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x14c8e4),this['activeConversation']?.['addCurrentDocumentToContext'](Gn(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_handleStartConversation']();}async['sendMessage']({message:_0x15e34e,quickActionData:_0x4bcd16}){await this['_handleUIUserMessage']({'userMessage':_0x15e34e,'quickActionData':_0x4bcd16});}['getGroupId'](){const _0x506b5c=this['context']['config']['get']('collaboration.channelId');if(!_0x506b5c)throw new _0x1cd47d('ai-chat-missing-channel-id',this);return _0x506b5c;}async['_handleStartConversation'](_0x2529c4){const _0xc6f2a7=this['context']['plugins']['get'](G);let _0x31f0c4;_0xc6f2a7['isOpen']&&_0xc6f2a7['close'](),_0x31f0c4=_0x2529c4||!this['activeConversation']?this['context']['config']['get']('ai.chat.models.defaultModelId'):this['activeConversation']['selectedModel']['id'],await this['_stopLastInteraction']();const _0x857be3=this['getGroupId'](),_0x2fa552=_0x2529c4||_0x91fc81();this['activeConversation']=new ht({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'defaultModelId':_0x31f0c4,'conversationId':_0x2fa552,'group':_0x857be3,'getEditor':()=>V(this['context'])}),this['activeConversation']['on']('conversationInitialized',(_0x1e5d7a,_0x4d9114)=>{_0x4d9114['availableModels']=this['_filterModels'](_0x4d9114['availableModels'],this['context']['config']['get']('ai.chat.models.displayedModels')),this['_aiChatUi']['createConversation'](_0x4d9114),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x2529c4||(this['_aiChatUi']['resetConversationTitle'](),this['activeConversation']?.['addCurrentDocumentToContext'](Gn(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT')));}),this['activeConversation']['on']('uploadProgressChanged',(_0x4fe3ff,_0x48d128)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x48d128['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x288ebe,_0x39ad11)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x39ad11),this['_aiChatUi']['addFeedInteractionHeader'](_0x39ad11);}),this['activeConversation']['on']('interactionStarted',(_0x283c8e,_0x36f282)=>{this['_aiChatUi']['startInteraction'](_0x36f282);}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x2cade1,_0xdd7c55)=>{this['_aiChatUi']['removeFeedInteraction'](_0xdd7c55['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x218ee8,_0x369dcb,_0x143570)=>{this['updateConversationTitle'](_0x369dcb,_0x143570);}),this['activeConversation']['on']('replyCreated',(_0x44b5d4,_0x309a5e)=>{this['_aiChatUi']['updateFeedInteractionHeader']({'isVisible':!0x0,'id':_0x309a5e['interactionId']}),'text-delta'===_0x309a5e['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x309a5e):this['_aiChatUi']['addFeedItemAISuggestion'](_0x309a5e);}),this['activeConversation']['on']('replyContentUpdated',async(_0x2ee950,_0x5afc10,_0x49647a)=>{await this['_updateReplyContent']({'reply':_0x5afc10,'changeGroups':_0x49647a});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x99b7f8,{reply:_0x131f95,index:_0x30086a,state:_0x42464d})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x131f95['id'],'index':_0x30086a,'state':_0x42464d});}),this['activeConversation']['on']('contextItemAdded',(_0x407e4b,_0x52818f)=>{if(this['_aiChatUi']['addContextItem'](_0x52818f['contextItem'],_0x52818f['isLoading']),'selection'===_0x52818f['contextItem']['type']){const _0xafeb23=[...V(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0xafeb23,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x15a609,_0x3d7c24)=>{this['_aiChatUi']['removeContextItem'](_0x3d7c24['uiId']),'current-document'==_0x3d7c24['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x3d7c24['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x2208ab,_0x1dbea2)=>{this['_aiChatUi']['setContextItemLoading'](_0x1dbea2['contextItem']['uiId'],_0x1dbea2['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x2c7352,_0x8ff9c9)=>{this['_aiChatUi']['setConversationContext'](_0x8ff9c9['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x500473,_0x1eb3b7)=>{this['_aiChatUi']['setAddContextOptions'](_0x1eb3b7['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x4aec49,_0x143ae1)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x143ae1['sourceId'],_0x143ae1['source'],_0x143ae1['resources'],_0x143ae1['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x2bcedf,_0x58f8e3)=>{this['_aiChatUi']['updateResourceState'](_0x58f8e3['sourceId'],_0x58f8e3['resourceId'],_0x58f8e3['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x2b6bac,_0x5286c8)=>{this['_aiChatUi']['updateCapabilities'](_0x5286c8);}),this['activeConversation']['on']('modelSelected',(_0x32706b,_0x241462)=>{this['_aiChatUi']['setSelectedModel'](_0x241462['selectedModel'],_0x241462['isDisabled']);}),this['activeConversation']['on']('error',(_0x2fb651,{error:_0x3df5a9,interactionId:_0x4c0987,fileName:_0x1830a0,url:_0x481657,sourceId:_0x257313,sourceLabel:_0x12c71b})=>{const _0x101376=_0x4c0987?_0x4c0987+':'+_0x91fc81():_0x91fc81();_0x3df5a9['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':Gn(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x101376}):_0x3df5a9['message']['startsWith']('ai-chat-conversation-init-failed')||_0x3df5a9['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Gn(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x101376}),this['_logError'](_0x3df5a9)):_0x3df5a9['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Gn(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x1830a0),'id':_0x101376}):_0x3df5a9['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Gn(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x481657),'id':_0x101376}):_0x3df5a9['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Gn(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x101376}):_0x3df5a9['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Gn(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x101376}):_0x3df5a9['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x257313&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x257313),this['_aiChatUi']['addFeedItemError']({'errorMessage':Gn(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x12c71b||'source'),'id':_0x101376}),this['_logError'](_0x3df5a9)):_0x3df5a9['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Gn(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x101376}),this['_logError'](_0x3df5a9)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':Gn(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x101376}),this['_logError'](_0x3df5a9));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x2529c4||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0xc15733,quickActionData:_0x3b35f6}){if(!this['activeConversation'])throw new _0x1cd47d('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':_0xc15733,'quickActionData':_0x3b35f6}),this['_removeAISelectionMarkers']();}['_removeAISelectionMarkers'](){const _0x329248=V(this['context'])['model'],_0x4caabc=Array['from'](_0x329248['markers']['getMarkersGroup'](ct));_0x329248['change'](_0x31ecf0=>{_0x4caabc['forEach'](_0x43bfc3=>_0x31ecf0['removeMarker'](_0x43bfc3));});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x55e8d4){this['_aiChatUi']['setIsMaximized'](_0x55e8d4);}['_logError'](_0x2d556c){ot(_0x2d556c['message']);}['_removeFromContext'](_0x56eda0){this['activeConversation']?.['removeFromContext'](_0x56eda0);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x239bd3){const [_0x29ef62,_0x2fc772]=_0x239bd3['split'](':'),_0x14e00a=this['activeConversation']['getInteraction'](_0x29ef62),_0x5b12a6=_0x14e00a['getReply'](_0x2fc772);return{'interaction':_0x14e00a,'reply':_0x5b12a6};}['_scrollToSuggestionRange'](_0x7c31e1,_0x3cc45b=!0x1){const _0x3323c9=V(this['context']),_0x3e27f3={'target':_0x3323c9['editing']['view']['domConverter']['viewRangeToDom'](_0x3323c9['editing']['mapper']['toViewRange'](_0x7c31e1)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x3cc45b};_0x3cc45b&&(_0x3e27f3['alignToTop']=!0x0),nt(_0x3e27f3);}['updateConversationTitle'](_0x35a1f7,_0x543c62=!0x1){this['_aiChatUi']['setConversationTitle'](_0x35a1f7||Gn(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x543c62);}['_filterModels'](_0x4673de,_0x23bf2e){let _0x522be5;if(_0x23bf2e){_0x522be5=[];const _0x210e48='string'==typeof _0x23bf2e?[_0x23bf2e['toLocaleLowerCase']()]:_0x23bf2e['map'](_0x1d969a=>_0x1d969a['toLocaleLowerCase']());for(const _0x262a37 of _0x210e48)for(const _0x3210d8 of _0x4673de)(_0x3210d8['id']['toLocaleLowerCase']()===_0x262a37||_0x3210d8['name']['toLocaleLowerCase']()===_0x262a37||_0x3210d8['provider']['toLocaleLowerCase']()===_0x262a37||_0x3210d8['id']['toLocaleLowerCase']()['startsWith'](_0x262a37))&&_0x522be5['push'](_0x3210d8);}else _0x522be5=_0x4673de;return _0x522be5;}async['_updateReplyContent']({reply:_0x2c3f21,changeGroups:_0x146444,renderingStrategy:_0x199edb}){const {id:_0x37a2f3,isDone:_0x276c5c,type:_0x34ad64,parsedContent:_0x13a9cd}=_0x2c3f21;if('modification-delta'===_0x34ad64){const _0x1239ba=Y({'editor':V(this['context']),'showDiff':this['_aiChatUi']['showDiff'],'changeGroups':_0x146444,'documentContextContent':_0x2c3f21['documentContextContent']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x37a2f3,'parts':_0x1239ba,'renderingStrategy':_0x199edb,'isDone':_0x276c5c});}else'text-delta'===_0x34ad64&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x37a2f3,'parsedContent':_0x13a9cd,'renderingStrategy':_0x199edb,'isDone':_0x276c5c});_0x276c5c&&_0x2c3f21['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x37a2f3,_0x2c3f21['sources']);}async['_stopLastInteraction'](){const _0x211d69=this['activeConversation']?.['lastInteraction'];_0x211d69&&(_0x211d69['stop'](),this['_aiChatUi']['stopInteraction'](_0x211d69));}async['_flushLastInteractionUI'](){const _0x10cffb=this['activeConversation']?.['lastInteraction'];if(_0x10cffb){for await(const _0x4328d6 of _0x10cffb['replies'])await this['_updateReplyContent']({'reply':_0x4328d6,'changeGroups':_0x4328d6['changeGroups'],'renderingStrategy':'static'});}}}const Pt=[...Te,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class nh extends _0x2855e5{['actionsDropdown'];['children'];['showChangeInTextModel'];['insertSuggestionModel'];constructor(_0x42395a){super(_0x42395a);const _0x3f7393=this['bindTemplate'];this['set']('isEnabled',!0x0),this['set']('isVisible',!0x0),this['showChangeInTextModel']=new _0x38340d({'label':Gn(_0x42395a,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT'),'icon':_0x181172,'withText':!0x0,'type':'button','actionName':'showChangeInText'}),this['insertSuggestionModel']=new _0x38340d({'label':Gn(_0x42395a,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION'),'icon':_0x5e145c,'withText':!0x0,'type':'button','actionName':'insertSuggestion'}),this['actionsDropdown']=new qo(_0x42395a,{'listItemModels':[this['showChangeInTextModel'],this['insertSuggestionModel']]}),this['actionsDropdown']['on']('execute',()=>{this['fire']('applySuggestion');}),this['actionsDropdown']['on']('showChangeInText',()=>{this['fire']('showChangeInText');}),this['actionsDropdown']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion');}),this['actionsDropdown']['set']({'label':'Apply','tooltip':Gn(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP'),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions','balloonPanelClass':'ck-ai-chat__feed__ai-suggestion__actions__balloon'}),this['actionsDropdown']['bind']('isEnabled')['to'](this),this['children']=this['createCollection']([this['actionsDropdown']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x3f7393['if']('isVisible','ck-hidden',_0xf968e0=>!_0xf968e0)]},'children':[this['actionsDropdown']]});}['updateLabels'](_0x110350){const _0x48678b=this['locale'];this['actionsDropdown']['set']({'label':Gn(_0x48678b,'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL',_0x110350),'tooltip':Gn(_0x48678b,'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP',_0x110350)}),this['showChangeInTextModel']['label']=Gn(_0x48678b,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT',_0x110350),this['insertSuggestionModel']['label']=Gn(_0x48678b,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION',_0x110350);}}class qo extends _0x2a87cb{['bodyCollection'];['balloonPanelView'];['listView'];['keystrokeHandler'];constructor(_0xed20e,_0x3a4484){super(_0xed20e),this['balloonPanelView']=new _0x2b3342(this['locale']),this['bodyCollection']=new Gt(this['locale']),this['bodyCollection']['attachToDom'](),this['set']('balloonPanelClass',''),this['balloonPanelView']['bind']('class')['to'](this,'balloonPanelClass'),this['listView']=this['_setUpList'](_0x3a4484['listItemModels']),this['bodyCollection']['add'](this['balloonPanelView']),this['balloonPanelView']['content']['add'](this['listView']),this['arrowView']['unbind']('tooltip'),this['arrowView']['set']('tooltip',Gn(this['locale'],'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP')),this['_setUpKeystrokes'](),this['on']('execute',()=>{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']?zo:Jo]}),this['listView']['focus']());}),_0x4a2e91({'emitter':this['balloonPanelView'],'callback':()=>{this['balloonPanelView']['hide']();},'activator':()=>this['balloonPanelView']['isVisible'],'contextElements':()=>[this['element'],this['balloonPanelView']['element']]});}['_setUpList'](_0x26c038){const _0x2081a5=this['locale'],_0x358a75=new _0x11ab26(_0x2081a5);for(const _0x42a032 of _0x26c038){const _0x3c540e=new _0x522072(_0x2081a5),_0x350a99=new _0x654325(_0x2081a5);_0x350a99['bind'](...Object['keys'](_0x42a032))['to'](_0x42a032),_0x350a99['delegate']('execute')['to'](_0x358a75),_0x3c540e['children']['add'](_0x350a99),_0x358a75['items']['add'](_0x3c540e);}return _0x358a75['items']['delegate']('execute')['to'](this),_0x358a75['on']('execute',_0x381424=>{const _0x8e75d7=_0x381424['source'];this['fire'](_0x8e75d7['actionName']),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),_0x358a75;}['_setUpKeystrokes'](){this['keystrokeHandler']=new _0x574245(),this['keystrokeHandler']['listenTo'](this['balloonPanelView']['element']),this['keystrokeHandler']['set']('esc',(_0x282e04,_0x3c457f)=>{this['balloonPanelView']['hide'](),this['arrowView']['focus'](),_0x3c457f();});}['destroy'](){super['destroy'](),this['keystrokeHandler']['destroy'](),this['balloonPanelView']['destroy'](),this['bodyCollection']['detachFromDom']();}}function zo(_0x5e5b59){return{'top':_0x5e5b59['bottom'],'left':_0x5e5b59['left'],'name':'arrowless','config':{'withArrow':!0x1}};}function Jo(_0x501253,_0x1321f5){return{'top':_0x501253['bottom'],'left':_0x501253['left']-(_0x1321f5['width']-_0x501253['width']),'name':'arrowless','config':{'withArrow':!0x1}};}class ke extends jr{['containerView'];['actionsView'];constructor(_0x1628ae,_0x390f13){super(_0x390f13),this['containerView']=new R(_0x1628ae,{'showDiff':_0x390f13['showDiff'],'areActionsDisabled':_0x390f13['areActionsDisabled']}),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x5ec422,_0x2408ed)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x2408ed['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',(_0xa88325,{index:_0x336218})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x336218});}),this['containerView']['on']('insertSuggestion',(_0x146256,{index:_0xec9f10})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0xec9f10});}),this['containerView']['on']('rejectSuggestion',(_0x499ed2,{index:_0x3405c5})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3405c5});}),this['containerView']['on']('mouseOverSuggestion',(_0x54bfb6,{index:_0x1b9ccb})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x1b9ccb});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x23abb0,{index:_0x1dbb5f})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x1dbb5f});}),this['actionsView']=new nh(_0x1628ae),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']});}),_0x390f13['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'](_0x58fa3e){await this['containerView']['updateContent'](_0x58fa3e),this['actionsView']['updateLabels'](this['containerView']['bodyView']['partsCount']);}['updatePartState'](_0x57f034,_0x21202c){this['containerView']['bodyView']['updatePartState'](_0x57f034,_0x21202c);}['updateSources'](_0x29598c){this['containerView']['updateSources'](_0x29598c);}['getPartView'](_0x53e3b0){return this['containerView']['bodyView']['getPartView'](_0x53e3b0);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone'](),this['actionsView']['isVisible']=this['containerView']['bodyView']['hasNonEmptyParts'];}}class Se extends jr{['replyContainer'];constructor(_0x1430f4){super(_0x1430f4),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x2855e5(),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':sr(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x3f7edc,renderingStrategy:_0x20b6b1,abortSignal:_0x58288c}){'streaming'===_0x20b6b1?await this['streamIntoElement'](_0x3f7edc,this['replyContainer']['element'],_0x58288c):this['replyContainer']['element']['innerHTML']=_0x390fc6(_0x3f7edc);}['updateSources'](_0x5efe88){const _0x390821=new Sr(this['locale']);_0x390821['children']['addMany'](_0x5efe88['map'](_0x2a573b=>new Fr(this['locale'],_0x2a573b))),_0x390821['isVisible']=!0x0,this['children']['add'](_0x390821);}}const mn={'file':_0x5e2d28,'document':_0x6fa3f4,'web-resource':_0x9712c4,'text':_0x5e2d28,'selection':_0x143e00},qn='ck-ai-chat-context-chip',$n='ck-ai-chat-context-chip_wide',Qn='ck-ai-chat-context-chip_document',Xn='ck-ai-chat-context-chip__label',zn='ck-ai-chat-context-chip__type-icon',jn='ck-ai-chat-context-controls__chip-tooltip',wn='n';class xo extends _0x21c9df{constructor(_0x22cca3,_0x45b798,_0x224b29,_0x41a7ce,_0x1ff6d6=!0x1){super(_0x22cca3),this['_isAnimationOnEnterEnabled']=_0x41a7ce,this['_initializeProperties'](_0x45b798,_0x224b29,_0x1ff6d6),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'](_0x1b3449,_0x3de256,_0x529897){this['set']('label',_0x1b3449['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x1b3449['type']),this['set']('id',_0x1b3449['uiId']),this['set']('readonly',_0x3de256),this['set']('isLoading',_0x529897);}['_setupTemplate'](){const _0xfd343=this['_createIconView'](),_0x5de79a=this['_createRemoveButton'](),_0x1052aa=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x1052aa),'children':this['_createTemplateChildren'](_0xfd343,_0x5de79a,_0x1052aa)});}['_createTemplateAttributes'](_0x5b4e9c){return{'class':[qn,_0x5b4e9c['if']('itemType',Qn,_0x2bbb1c=>'document'==_0x2bbb1c),_0x5b4e9c['if']('itemType',$n,_0x37bc9b=>'selection'==_0x37bc9b)],'data-cke-tooltip-text':_0x5b4e9c['to']('label',Tn),'data-cke-tooltip-position':wn,'data-cke-tooltip-class':jn};}['_createTemplateChildren'](_0x27d646,_0x4f8fd0,_0x45a8bc){const _0x7f6fb7=this['_createLabelElement'](_0x45a8bc),_0x1addad=this['_createLoaderIcon']();return this['readonly']?[_0x27d646,_0x7f6fb7]:[_0x27d646,_0x1addad,_0x7f6fb7,_0x4f8fd0];}['_createLabelElement'](_0x5c7790){return{'tag':'span','attributes':{'class':Xn},'children':[{'text':_0x5c7790['to']('label')}]};}['_createRemoveButton'](){const _0x27d407=new _0x21c9df(this['locale']);return _0x27d407['set']({'label':Gn(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x335422}),this['_setupRemoveButtonEvent'](_0x27d407),_0x27d407;}['_setupRemoveButtonEvent'](_0x13a447){_0x13a447['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x35255e=this['bindTemplate'],_0x26e801=new _0x32fdce();return _0x26e801['content']=mn[this['itemType']],_0x26e801['extendTemplate']({'attributes':{'class':[zn,_0x35255e['if']('isLoading','ck-hidden',_0x11c8a7=>_0x11c8a7)]}}),_0x26e801;}['_handleAnimationEndOnce'](_0xc4b276,_0xfbad3c){if(!_0xc4b276)return;const _0x4bab31=()=>{_0xfbad3c(),_0xc4b276['removeEventListener']('animationend',_0x4bab31),_0xc4b276['removeEventListener']('webkitAnimationEnd',_0x4bab31);};_0xc4b276['addEventListener']('animationend',_0x4bab31),_0xc4b276['addEventListener']('webkitAnimationEnd',_0x4bab31);}['_createLoaderIcon'](){const _0x38ded4=new Ve('small');return _0x38ded4['bind']('isVisible')['to'](this,'isLoading',_0x155e97=>_0x155e97),_0x38ded4;}}function Tn(_0x29b10c){if(!_0x29b10c)return _0x29b10c;if(_0x29b10c['length']<=0x78)return _0x29b10c;const _0x5674e4=_0x29b10c['slice'](0x0,0x78),_0x13ee9d=_0x5674e4['lastIndexOf']('\x20');return(_0x13ee9d>0x0?_0x5674e4['slice'](0x0,_0x13ee9d):_0x5674e4)+'…';}const sn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},hn='300px';class wo{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x5203f4,_0x3a0510,_0x10bc02,_0x353619,_0x2e00e3){this['_locale']=_0x5203f4,this['_visibleChips']=_0x3a0510,this['_config']={...sn,..._0x10bc02,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x10bc02['cssClasses']}},this['_overflowChips']=new _0x4b15d8(),this['_bodyCollection']=_0x353619,this['_parentView']=_0x2e00e3||null;}['setContainerElement'](_0x5a6f15){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x5a6f15,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 _0x184283=[...this['_visibleChips'],...this['_overflowChips']],_0x2351ec=this['_createCalculationContainer'](),_0x2b122d=this['_calculateOverflowInContainer'](_0x2351ec,_0x184283),_0x10bbf9=_0x2351ec['_ancestorsToRestore'];_0x10bbf9&&this['_restoreAncestorVisibility'](_0x10bbf9),_0x2351ec['remove'](),this['_applyOverflowResults'](_0x184283,_0x2b122d);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x4a2e91({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x3cc57d=new _0x21c9df(this['_locale']);_0x3cc57d['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x114dd7=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x114dd7['push'](this['_config']['cssClasses']['controlsButton']),_0x3cc57d['extendTemplate']({'attributes':{'class':_0x114dd7}}),_0x3cc57d;}['_createShowMoreBalloonPanelView'](){const _0x1bd9c4=new _0x2b3342(this['_locale']);return _0x1bd9c4['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x1bd9c4),_0x1bd9c4;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x4f8def=>{_0x4f8def['disableAnimationOnEnter']();});const _0x22bcb6=new _0x2855e5(this['_locale']);_0x22bcb6['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x22bcb6);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x3d66cd=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x3d66cd?'':'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'](_0x4b2635){const _0x3701f8=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x5cedbd=this['_containerElement']?.['classList'];if(_0x5cedbd){const _0x3ead2e=_0x5cedbd[0x0]||'',_0x5ae7d5=_0x4b2635['querySelector']('.'+_0x3ead2e),_0x2bdc71=_0x4b2635['querySelector'](_0x3701f8);return _0x5ae7d5||_0x2bdc71||_0x4b2635;}return _0x4b2635['querySelector'](_0x3701f8)||_0x4b2635;}['_calculateContainerWidth'](){const _0x3fcc63=this['_parentView']?.['element']||this['_containerElement'];if(!_0x3fcc63)return hn;const _0x395a0e=window['getComputedStyle'](_0x3fcc63)['width'];if('auto'===_0x395a0e||'0px'===_0x395a0e||!_0x395a0e){const _0xb2a4d6=_0x3fcc63['parentElement'];if(_0xb2a4d6){const _0x48c51f=window['getComputedStyle'](_0xb2a4d6);return'auto'!==_0x48c51f['width']?_0x48c51f['width']:hn;}return hn;}return _0x395a0e;}['_applyCalculationStyles'](_0x22e1ac,_0x185e83){this['_config']['cssClasses']['calculationContainer']&&_0x22e1ac['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x22e1ac['style']['width']=_0x185e83,_0x22e1ac['style']['position']='absolute',_0x22e1ac['style']['top']='-9999px',_0x22e1ac['style']['left']='-9999px',_0x22e1ac['style']['opacity']='0',_0x22e1ac['style']['pointerEvents']='none',_0x22e1ac['style']['zIndex']='-1',_0x22e1ac['style']['visibility']='visible\x20!important',_0x22e1ac['style']['display']='block\x20!important',_0x22e1ac['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x43e473){_0x43e473['forEach'](({element:_0x4078f1,originalDisplay:_0x3371eb,originalVisibility:_0x30b2c4})=>{_0x4078f1['style']['display']=_0x3371eb,_0x4078f1['style']['visibility']=_0x30b2c4;});}['_makeAncestorsVisible'](_0x3513e3){const _0x169c0a=[];let _0x5ed0f0=_0x3513e3;for(;_0x5ed0f0&&_0x5ed0f0!==document['body'];){const _0x55f2b6=window['getComputedStyle'](_0x5ed0f0);'none'!==_0x55f2b6['display']&&'hidden'!==_0x55f2b6['visibility']||(_0x169c0a['push']({'element':_0x5ed0f0,'originalDisplay':_0x5ed0f0['style']['display'],'originalVisibility':_0x5ed0f0['style']['visibility']}),_0x5ed0f0['style']['display']='block',_0x5ed0f0['style']['visibility']='visible'),_0x5ed0f0=_0x5ed0f0['parentElement'];}return _0x169c0a;}['_createContainerElements'](){let _0x17faf6,_0xbae68a;return this['_parentView']?.['element']?(_0x17faf6=this['_parentView']['element']['cloneNode'](!0x0),_0xbae68a=this['_findTargetContainer'](_0x17faf6)):(_0x17faf6=document['createElement']('div'),_0xbae68a=_0x17faf6),{'calculationContainer':_0x17faf6,'targetContainer':_0xbae68a};}['_createCalculationContainer'](){const {calculationContainer:_0x3a5f93,targetContainer:_0x28feed}=this['_createContainerElements'](),_0x5c1b5c=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x3a5f93,_0x5c1b5c);const _0x713bc4=this['_parentView']?.['element']||this['_containerElement'],_0x30c22d=_0x713bc4?.['parentElement'];_0x30c22d?_0x30c22d['appendChild'](_0x3a5f93):document['body']['appendChild'](_0x3a5f93),_0x3a5f93['_targetContainer']=_0x28feed;const _0x8b6422=this['_makeAncestorsVisible'](_0x30c22d||null);return _0x3a5f93['offsetWidth'],_0x3a5f93['_ancestorsToRestore']=_0x8b6422,_0x3a5f93;}['_calculateOverflowInContainer'](_0x43c986,_0x131799){const _0x4e45a9=_0x43c986['_targetContainer']||_0x43c986,_0x14be2d=[],{rowCount:_0x454fb7}=this['_renderChipsAndCountRows'](_0x4e45a9,_0x131799);if(_0x454fb7<=this['_config']['maxVisibleRows'])return _0x14be2d;const _0x5aed78=_0x131799['slice']();for(;_0x5aed78['length']>0x0;){if(this['_testButtonFit'](_0x43c986,_0x4e45a9,_0x5aed78)){const _0x5ca741=_0x131799['filter'](_0x159075=>!_0x5aed78['includes'](_0x159075));_0x14be2d['push'](..._0x5ca741);break;}if(!_0x5aed78['pop']())break;}return _0x14be2d;}['_renderChipsAndCountRows'](_0x433fef,_0x5d3e57){_0x433fef['innerHTML']='',_0x5d3e57['forEach'](_0x58dc2b=>{if(_0x58dc2b['element']){const _0x2fd1c5=_0x58dc2b['element']['cloneNode'](!0x0);_0x433fef['appendChild'](_0x2fd1c5);}}),_0x433fef['offsetWidth'];const _0x4b6e8d=_0x433fef['children'],_0x800c72=[];return Array['from'](_0x4b6e8d)['forEach'](_0x2c7222=>{const _0x9400e9=_0x2c7222['getBoundingClientRect']()['top'];_0x800c72['some'](_0x3aba43=>Math['abs'](_0x3aba43-_0x9400e9)<this['_config']['rowDetectionTolerance'])||_0x800c72['push'](_0x9400e9);}),{'rowCount':_0x800c72['length']};}['_createMockButton'](){const _0x5d95d3=document['createElement']('button');return _0x5d95d3['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x5d95d3['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x5d95d3['textContent']='+\x201',_0x5d95d3;}['_testButtonFit'](_0x41e632,_0x513a53,_0x5685ac){this['_renderChipsAndCountRows'](_0x513a53,_0x5685ac);const _0x1c437c=this['_createMockButton']();_0x41e632['appendChild'](_0x1c437c),_0x41e632['offsetWidth'];const _0x15daa7=[..._0x513a53['children'],_0x1c437c],_0x19dc0b=[];_0x15daa7['forEach'](_0x54a74a=>{const _0x1f0fc4=_0x54a74a['getBoundingClientRect']()['top'];_0x19dc0b['some'](_0x5d23e3=>Math['abs'](_0x5d23e3-_0x1f0fc4)<this['_config']['rowDetectionTolerance'])||_0x19dc0b['push'](_0x1f0fc4);});const _0x21775c=_0x19dc0b['length'];return _0x1c437c['remove'](),_0x21775c<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x186c7e,_0x576a85){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x186c7e['forEach'](_0x96938e=>{_0x576a85['includes'](_0x96938e)?this['_overflowChips']['add'](_0x96938e):this['_visibleChips']['add'](_0x96938e);});}['_updateOverflowUI'](_0x1ccfba){if(_0x1ccfba>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x1ccfba>0x0&&this['_showMoreButtonView']){const _0x28eb6a=''+this['_config']['showMoreLabelPrefix']+(_0x1ccfba<0x63?_0x1ccfba:'99');this['_showMoreButtonView']['label']=_0x28eb6a;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x3effef,_0x224f82){this['_distributeChips'](_0x3effef,_0x224f82),this['_updateOverflowUI'](_0x224f82['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x2864c2=>{_0x2864c2[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 _0x178bd8=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x178bd8['width']||0x0===_0x178bd8['height'])return!0x1;const _0x26ab5a=window['innerHeight']||document['documentElement']['clientHeight'],_0x28b899=window['innerWidth']||document['documentElement']['clientWidth'],_0x5525ff=0xc8;return _0x178bd8['bottom']>=-0xc8&&_0x178bd8['top']<=_0x26ab5a+_0x5525ff&&_0x178bd8['right']>=-0xc8&&_0x178bd8['left']<=_0x28b899+_0x5525ff;}}const Jn='ck-ai-chat__feed__context-chips',Zn='ck-ai-chat-context-chips-wrapper',Dr='ck-ai-chat-context-chips-wrapper-balloon',Gr='ck-ai-chat-controls-button',Kr='ck-ai-chat-controls_context_show-more-button',Wr='ck-ai-chat-context-controls__show-more-balloon-panel';class ah extends _0x2855e5{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x4be949,_0x3a41f8,_0x4de303){super(_0x4be949),this['_bodyCollection']=_0x4de303,this['_createContextChips'](_0x3a41f8);const _0x43e96f={'cssClasses':{'showMoreButton':Kr,'showMoreBalloon':Wr,'overflowContainer':Dr,'controlsButton':Gr}};this['_overflowManager']=new wo(_0x4be949,this['_contextChips'],_0x43e96f,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Jn,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Zn},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x595912=this['element']['querySelector']('.'+Zn);_0x595912&&(this['_overflowManager']['setContainerElement'](_0x595912),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x56af24){for(const _0x5f552c of _0x56af24){const _0x35f309=new xo(this['locale'],_0x5f552c,!0x0,!0x1);this['_contextChips']['add'](_0x35f309);}}}class ve extends jr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x50f4b3,_0x1555c5,_0x3939aa){super(_0x1555c5),this['_locale']=_0x50f4b3,this['_bodyCollection']=_0x3939aa,this['_createContextChipsView'](),this['_createMessageContentView'](),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__user-message']}});}['_createContextChipsView'](){this['options']['contextItems']&&this['options']['contextItems']['length']>0x0&&(this['_contextChipsView']=new ah(this['_locale'],this['options']['contextItems']['filter'](_0x2fa24b=>!_0x2fa24b['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x2855e5(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 Rt extends jr{constructor(_0x4ad374,_0x3f9b1){super(_0x3f9b1);const {isWebSearchEnabled:_0x5613a6,isReasoningEnabled:_0x485ec5}=_0x3f9b1['capabilities'],_0x547c3c=[];let _0x2d2537='';_0x5613a6&&_0x485ec5?(_0x2d2537=Gn(_0x4ad374,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x547c3c['push'](e_(_0x64b6)),_0x547c3c['push'](e_(_0x377e6c))):_0x5613a6?(_0x2d2537=Gn(_0x4ad374,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x547c3c['push'](e_(_0x64b6))):_0x485ec5&&(_0x2d2537=Gn(_0x4ad374,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x547c3c['push'](e_(_0x377e6c))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x2d2537?'':'ck-hidden']}});const _0x34d51a=new _0x2855e5();_0x34d51a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x547c3c,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x2d2537]}]}),this['children']['add'](_0x34d51a);}}function e_(_0x3a4f30){const _0x196146=new _0x32fdce();return _0x196146['content']=_0x3a4f30,_0x196146;}const ps=['wheel','touchstart','pointerdown','keydown'],ws=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class _e{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x3fa3e9){this['element']=_0x3fa3e9,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x2e7b7f of ps){const _0x5c0754='keydown'!==_0x2e7b7f;this['element']['addEventListener'](_0x2e7b7f,this['_onUserEvent']['bind'](this),{'passive':_0x5c0754,'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'](_0x494e36){if(this['isRunning']){if('keydown'===_0x494e36['type']){const _0x20668f=_0x494e36['key'];if(!ws['includes'](_0x20668f))return;}_0x494e36 instanceof WheelEvent?_0x494e36['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x13afa0,scrollHeight:_0x397fb6,clientHeight:_0x203de8}=this['element'];return _0x397fb6-_0x13afa0-_0x203de8<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class je extends _0x2855e5{constructor(_0x546251,_0x42cf16){super(_0x546251),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x42cf16)});}['_createSkeletonItems'](_0x23b5e8){const _0x2a55d1=['ck','ck-ai-skeleton__item'];return _0x23b5e8['map'](_0x104867=>{let _0x3740a3='';switch(_0x104867['attributes']['align']){case'right':_0x3740a3='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x3740a3='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x3740a3='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x104867['tag'],'attributes':{'class':[..._0x2a55d1,_0x104867['attributes']['class']?_0x104867['attributes']['class']:''],'style':'width:\x20'+_0x104867['attributes']['width']+';\x20height:\x20'+_0x104867['attributes']['height']+';'+_0x3740a3}};});}}const Le={'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':$i(0x5,'100%','44px','right'),'aiChatResources':$i(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 $i(_0x11d434,_0x4db743,_0x67846b,_0x3b862a){return new Array(_0x11d434)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x4db743,'height':_0x67846b,'align':_0x3b862a}}));}class ji extends _0x2855e5{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x4560c8,_0x43e372){super(_0x4560c8),this['_bodyCollection']=_0x43e372,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Pt)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new _e(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x3a6b79,_0x247516){let _0x4b1255;_0x4b1255='ai-reply'===_0x3a6b79?new Se(_0x247516):'ai-suggestion-reply'===_0x3a6b79?new ke(this['locale'],_0x247516):'user-message'===_0x3a6b79?new ve(this['locale'],_0x247516,this['_bodyCollection']):'interaction-header'===_0x3a6b79?new Rt(this['locale'],_0x247516):new ye(_0x247516),this['children']['add'](_0x4b1255);}async['updateReplyItem']({id:_0x16badf,parsedContent:_0x1db4df,renderingStrategy:_0x3c7422,abortSignal:_0x7ba771}){const _0x1f7560=this['getItemById'](_0x16badf);if(!(_0x1f7560 instanceof Se))throw new _0x1cd47d('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x1f7560,'id':_0x16badf,'parsedContent':_0x1db4df});await _0x1f7560['updateContent']({'parsedContent':_0x1db4df,'renderingStrategy':_0x3c7422,'abortSignal':_0x7ba771});}async['updateWebSources'](_0x2a8e34,_0x2fa743){const _0x297880=this['getItemById'](_0x2a8e34);if(_0x297880 instanceof ke)_0x297880['updateSources'](_0x2fa743);else{if(!(_0x297880 instanceof Se))throw new _0x1cd47d('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x297880,'id':_0x2a8e34,'sources':_0x2fa743});_0x297880['updateSources'](_0x2fa743);}}async['updateSuggestionItem']({id:_0x55a29e,parts:_0x18b4da,renderingStrategy:_0x3ad8e8,abortSignal:_0x10c4a4}){const _0x1d3432=this['getItemById'](_0x55a29e);if(!(_0x1d3432 instanceof ke))throw new _0x1cd47d('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x1d3432,'id':_0x55a29e,'parts':_0x18b4da});await _0x1d3432['updateContent']({'parts':_0x18b4da,'renderingStrategy':_0x3ad8e8,'abortSignal':_0x10c4a4});}['updateSuggestionPartState']({id:_0x3dcd61,index:_0x3f83a6,state:_0x116beb}){const _0x34d4bf=this['getItemById'](_0x3dcd61);if(!(_0x34d4bf instanceof ke))throw new _0x1cd47d('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x3dcd61});_0x34d4bf['updatePartState'](_0x3f83a6,_0x116beb);}['markItemAsDone'](_0x420867){this['getItemById'](_0x420867)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x509083=>_0x509083['options']['id']);}['removeItem'](_0x38f047){this['children']['remove'](this['getItemById'](_0x38f047));}['scrollToSuggestion'](_0xe09ee6,_0x1fd622){const _0x157cd9=this['getItemById'](_0xe09ee6);if(!(_0x157cd9 instanceof ke))return void _0x5c57f7('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0xe09ee6,'partIndex':_0x1fd622});const _0x610c0f=_0x157cd9['getPartView'](_0x1fd622);_0x610c0f?nt({'target':_0x610c0f['element'],'ancestorOffset':0x14,'alignToTop':!0x0,'forceScroll':!0x0}):_0x5c57f7('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0xe09ee6,'partIndex':_0x1fd622});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x2d12a2=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x2d12a2,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x39a0d7=new je(this['locale'],Le['aiFeed']);return _0x39a0d7['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x519310=>!_0x519310)]}}),_0x39a0d7;}['_createFeedItems'](){const _0x7db15b=new _0x2855e5(this['locale']);return _0x7db15b['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x7db15b;}['_createFeedLoader'](){const _0x3f3c05=new _0x2855e5(this['locale']);return _0x3f3c05['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x48e1ef=>!_0x48e1ef)]},'children':this['_createLoaderChildren']()}),_0x3f3c05;}['_createLoaderChildren'](){const _0x5f0088=new Ve();return _0x5f0088['isVisible']=!0x0,[_0x5f0088,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x15aa61){const _0xc02211=this['children']['find'](_0x371ed8=>_0x371ed8['options']['id']['includes'](_0x15aa61));if(!_0xc02211)throw new _0x1cd47d('ai-chat-feed-view-item-not-found',this,{'id':_0x15aa61});return _0xc02211;}['setLoadingMessage'](_0x446c61){this['set']('loadingMessage',_0x446c61);}['toggleLoadingSkeleton'](_0x5e2b3b){this['set']('isLoadingSkeletonVisible',_0x5e2b3b);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class Ir extends _0x11ab26{['filter'](){let _0xfa42a6=0x0;for(const _0x4d550a of this['items'])_0xfa42a6+=_0x4d550a['items']['length'];return{'resultsCount':_0xfa42a6,'totalItemsCount':_0xfa42a6};}}class ge extends _0x9fb4bb{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x37e8ee,_0x4b8c74){super(_0x37e8ee,{'queryView':{'label':'','creator':_0x43f4ed,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new Ir(_0x37e8ee),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x4b8c74,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=ge['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=ge['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',(_0x3514de,_0x1c765b)=>!_0x3514de&&!_0x1c765b),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x1196e7,_0x290a3c)=>{this['isUploadInProgress']||this['isEmpty']||_0x1196e7['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x290a3c());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x583a76=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x583a76)return this['queryView']['errorText']=Gn(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x5ceddd=_0x5787f6(_0x583a76);this['fire']('sendUserMessage',_0x5ceddd),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0xab609){this['queryView']['fieldView']['set']('placeholder',_0xab609);}['_createSubmitButton'](){const _0x48b6b8=new _0x21c9df(this['locale']);return _0x48b6b8['set']({'icon':_0x52ed9a,'label':Gn(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x48b6b8['on']('execute',()=>{this['submit']();}),_0x48b6b8;}['setIsUploadInProgress'](_0x3ecf90){this['isUploadInProgress']=_0x3ecf90;}['_setUpAddContextButtonPositioning'](){const _0x3711e1=this['locale'],_0x2f02b3=()=>{_0xdf3887['window']['requestAnimationFrame'](()=>{if(_0x337ded(this['element'])){const _0x485e6f=new _0x7011f3(this['queryView']['fieldView']['element']),_0x2f4bfe=new _0x7011f3(this['_addContextButtonView']['element']),_0x1e685c=_0x485e6f['width'],_0x2c84c5='rtl'===_0x3711e1['uiLanguageDirection']?'right':'left';_0x485e6f['excludeScrollbarsAndBorders']();const _0x4b0ad5=_0x1e685c-_0x485e6f['width']+0x1;this['_addContextButtonView']['element']['style'][_0x2c84c5]='calc('+(_0x1e685c-_0x2f4bfe['width']-_0x4b0ad5)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x2f02b3),this['on']('render',()=>{_0x2f02b3(),this['_queryViewResizeObserver']=new _0x3f0c89(this['queryView']['fieldView']['element'],()=>{_0x2f02b3();});});}}const Yr='ck-ai-chat__prompt-capabilities',$r='ck-ai-chat-controls-button',Qr='ck-ai-chat-controls-button--commands',Jr='ck-ai-chat-controls__model-selection',Zr='ck-ai-chat-controls__model-selection__item-name',ea='ck-ai-chat-controls__model-selection__item-description',ia='ck-ai-chat-controls__model-selection__item-capabilities',sa='n';class we extends _0x2855e5{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x315c5a){super(_0x315c5a),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelSelectorVisible',!0x0),this['set']('modelSelectorEnabled',!0x0),this['set']('activeModelId',''),this['set']('activeModelName',''),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',_0x32953d=>_0x32953d),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x97557d=>_0x97557d?this['_modelSelectionDropdown']['buttonView']['label']:Gn(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x6f7838=>_0x6f7838),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x335328=>_0x335328),this['_webSearchButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x281c47=>!_0x281c47),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0xb3a88=>Gn(this['locale'],_0xb3a88?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x3f243e=>_0x3f243e),this['_reasoningButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x4c5e8d=>!_0x4c5e8d),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x2c9a11=>Gn(this['locale'],_0x2c9a11?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[Yr]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x4b15d8(),_0x2c3e65(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x22358f,_0x19c376){if(this['set']('modelSelectorVisible',!(_0x19c376&&_0x22358f['length']<=0x1)),this['_modelSelectionDropdownItems']['clear'](),_0x22358f?.['length'])for(const _0x56b3ed of _0x22358f){const _0xc14c93=new _0x38340d({'label':_0x56b3ed['name'],'withText':!0x0,'role':'menuitemradio','id':_0x56b3ed['id'],'model':_0x56b3ed});_0xc14c93['bind']('isOn')['to'](this,'activeModelId',_0x29eb8e=>_0x29eb8e===_0x56b3ed['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0xc14c93,'labelView':new na(this['locale'],_0x56b3ed)});}}['setWebSearch'](_0x1a1967){this['set']('webSearchActive',_0x1a1967);}['setReasoning'](_0x3a8862){this['set']('reasoningActive',_0x3a8862);}['setModel'](_0x1b194f){if(!_0x1b194f)return;this['activeModelId']=_0x1b194f['id'],this['activeModelName']=_0x1b194f['name']||_0x1b194f['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x1b194f['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x1b194f['name']);const _0xed7ae4=_0x1b194f['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0xed7ae4),this['_webSearchButton']['set']('isVisible',_0xed7ae4);const _0x1f1fee=_0x1b194f['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x1f1fee),this['_reasoningButton']['set']('isVisible',_0x1f1fee);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0),this['set']('modelSelectorVisible',!0x0);}['disableModelSelector'](_0x3de530){this['set']('modelSelectorEnabled',!0x1),_0x3de530&&this['set']('modelSelectorVisible',!0x1);}['_createWebSearchButton'](){const _0x57188b=new _0x21c9df();return _0x57188b['set']({'label':Gn(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x64b6,'class':$r,'isToggleable':!0x0,'tooltipPosition':sa}),_0x57188b['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x57188b;}['_createReasoningButton'](){const _0x9519c9=new _0x21c9df();return _0x9519c9['set']({'label':Gn(this['locale'],'AI_CHAT_REASONING'),'icon':_0x377e6c,'class':$r,'isToggleable':!0x0,'tooltipPosition':sa}),_0x9519c9['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x9519c9;}['_createCommandsButton'](){const _0x43082f=new _0x21c9df();return _0x43082f['set']({'label':Gn(this['locale'],'AI_CHAT_COMMANDS'),'icon':yt,'withText':!0x0,'class':$r,'isToggleable':!0x0,'tooltip':Gn(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':sa}),_0x43082f['extendTemplate']({'attributes':{'class':[Qr]}}),_0x43082f['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x43082f;}['_createModelSelectionDropdown'](){const _0x1ec5ce=_0x372e42(this['locale']);return _0x1ec5ce['set']({'panelPosition':'ne','class':[Jr]}),_0x1ec5ce['buttonView']['set']({'label':Gn(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':sa}),this['listenTo'](_0x1ec5ce,'execute',_0x1898ff=>{this['fire']('selectModel',_0x1898ff['source']['model']);}),_0x1ec5ce;}['_createModelNameView'](){const _0x166c7b=new Go(this['locale']);return _0x166c7b['bind']('text')['to'](this,'activeModelName',_0x1c4e56=>_0x1c4e56??''),_0x166c7b['bind']('isVisible')['to'](this,'modelSelectorVisible',this,'activeModelName',(_0xfaa04c,_0x37ce97)=>!_0xfaa04c&&!_0x37ce97?.['toLowerCase']()['startsWith']('agent')),_0x166c7b;}}let na=class extends _0x32d8ec{constructor(_0x5a23be,_0x33b2e1){super();const _0x20909f=this['bindTemplate'],_0x191d80=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x20909f['to']('style'),'id':_0x20909f['to']('id')},'children':[{'tag':'div','attributes':{'class':[Zr]},'children':[{'text':_0x20909f['to']('text')}]},{'tag':'div','attributes':{'class':[ea]},'children':[{'tag':'span','children':[{'text':_0x33b2e1['description']}]}]},{'tag':'div','attributes':{'class':[ia]},'children':_0x191d80}]}),_0x191d80['addMany'](this['_getCapabilityParts'](_0x5a23be,_0x64b6,'AI_CHAT_SEARCH_WEB',_0x33b2e1['capabilities']['webSearch']?.['enabled']??!0x1)),_0x191d80['addMany'](this['_getCapabilityParts'](_0x5a23be,_0x377e6c,'AI_CHAT_REASONING',_0x33b2e1['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x4f978a,_0x4ca3e5,_0x4b4006,_0x54ae2a){const _0x3ac05f=new _0x32fdce();_0x3ac05f['content']=_0x4ca3e5;const _0x12bd05=new _0x2855e5(_0x4f978a);_0x12bd05['setTemplate']({'tag':'span','children':[{'text':Gn(_0x4f978a,_0x4b4006)+':\x20'}]});const _0x55ac3d=new _0x2855e5(_0x4f978a);return _0x55ac3d['setTemplate']({'tag':'span','children':[{'text':Gn(_0x4f978a,_0x54ae2a?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x3ac05f,_0x12bd05,_0x55ac3d];}};class Go extends _0x2855e5{constructor(_0x5addeb){super(_0x5addeb),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x25ed3c=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x25ed3c['if']('isVisible','ck-hidden',_0x441f18=>!_0x441f18)]},'children':[{'text':_0x25ed3c['to']('text')}]});}}const ra='ck-ai-chat-context-controls__url-form',oa='ck-ai-chat-context-controls__url-input-section';class mo extends _0x2855e5{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0xf7da41){super(_0xf7da41),this['focusTracker']=new _0x394dab(),this['keystrokes']=new _0x574245(),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 _0x920639({'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'](_0x2cdb4d=>{this['focusTracker']['add'](_0x2cdb4d['element']),this['keystrokes']['listenTo'](_0x2cdb4d['element']);}),_0x877d59({'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'](_0x2fe59a){this['urlInputField']['errorText']=_0x2fe59a,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x204a6a=new _0x21c9df(this['locale']);return _0x204a6a['set']({'icon':_0x582b36,'tooltip':Gn(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':'ck-button-icon\x20ck-button-back'}),_0x204a6a;}['_createUrlInputField'](){const _0x177d83=new th(this['locale'],_0x30a4cf);return _0x177d83['set']({'label':Gn(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x177d83['fieldView']['set']({'placeholder':Gn(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x177d83;}['_createConfirmButton'](){const _0x5d24bf=new _0x21c9df(this['locale']);return _0x5d24bf['set']({'icon':_0x110ca0,'tooltip':Gn(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x5d24bf;}['_setupTemplate'](){const _0x1d8de6=new _0x12296e(this['locale'],{'label':Gn(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x1d8de6['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':ra,'tabindex':'-1'},'children':[_0x1d8de6,{'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',_0x2827d0=>{_0x2827d0['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x3f2f0f,_0x2680f5)=>{this['clear'](),this['fire']('cancel'),_0x2680f5();});}['_handleSubmit'](){const _0x1eaaa2=this['getValue']()['trim']();_0x1eaaa2?this['_isValidUrl'](_0x1eaaa2)?(this['clearError'](),this['fire']('submitUrl',_0x1eaaa2)):this['setError'](Gn(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](Gn(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x209cca=this['getValue']()['trim'](),_0x107486=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x209cca['length']>0x0&&!_0x107486;}['_isValidUrl'](_0x1f1e4b){try{return!!new URL(_0x1f1e4b);}catch{return!0x1;}}}const aa='ck-ai-chat-resources__item',ha='ck-ai-chat-resources__item--in-context',ca='ck-ai-chat-resources__item-title',la='ck-ai-chat-resources__item__icon';class tc extends _0x522072{['resource'];['_titleView'];['_iconView'];constructor(_0x3b11d7,_0x4d3209){super(_0x3b11d7),this['resource']=_0x4d3209,this['set']('isInContext',!!_0x4d3209['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x401125){if(_0x401125['isInContext'])return _0x110ca0;switch(_0x401125['type']){case ue['DOCUMENT']:return _0x6fa3f4;case ue['URL']:return _0x9712c4;case ue['FILE']:case ue['TEXT']:return _0x5e2d28;default:return _0x28ce25;}}['highlightText'](_0x301062){if(!_0x301062||''===_0x301062['trim']())return void this['_titleView']['highlightText'](null);const _0xe9993=new RegExp(_0x2a9c5e(_0x301062),'gi');this['_titleView']['highlightText'](_0xe9993);}['updateResourceState'](_0x3fbd6a){this['resource']['isInContext']=_0x3fbd6a,this['isInContext']=_0x3fbd6a,this['_updateIcon']();}['_createTitleView'](){const _0x441177=new _0x675684();return _0x441177['text']=this['resource']['label'],_0x441177['extendTemplate']({'tag':'span','attributes':{'class':[ca]}}),_0x441177;}['_createIconView'](){const _0x154c3b=new _0x32fdce();return _0x154c3b['content']=this['getResourceIcon'](this['resource']),_0x154c3b;}['_setupTemplate'](){const _0x528db1=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[aa,_0x528db1['if']('isVisible','ck-hidden',_0x29dd15=>!_0x29dd15),_0x528db1['if']('isInContext',ha)]},'children':[{'tag':'div','attributes':{'class':[la]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x528db1['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const da='ck-ai-chat-resources__list';class Ur extends _0x11ab26{['_source'];constructor(_0x18dec9,_0x54702f){super(_0x18dec9),this['_source']=_0x54702f,this['extendTemplate']({'attributes':{'class':[da]}});}['setResources'](_0x575f84,_0x4b54ff){this['items']['clear']();let _0x32d03a=_0x575f84;if(this['_source']['useDefaultFiltering']&&_0x4b54ff&&''!==_0x4b54ff['trim']()){const _0x55c7d1=new RegExp(_0x4b54ff['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x32d03a=_0x575f84['filter'](_0xcd2b16=>_0x55c7d1['test'](_0xcd2b16['label']));}for(const _0x1ed44b of _0x32d03a){const _0x5e2050=new tc(this['locale'],_0x1ed44b);_0x5e2050['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x1ed44b);}),this['items']['add'](_0x5e2050);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x4b54ff);}['highlightText'](_0x40348f){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x232a0f=>{_0x232a0f['highlightText'](_0x40348f);});}['updateResourceState'](_0x489e89,_0x380fd1){for(const _0x416de6 of this['items']){const _0x4a80ae=_0x416de6;_0x4a80ae['resource']['id']===_0x489e89&&_0x4a80ae['updateResourceState'](_0x380fd1);}}['_handleResourceSelection'](_0x490b1c,_0x312d7e){this['fire']('addResourceToContext',{'source':_0x490b1c,'resource':_0x312d7e});}}class zr extends th{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x360c07){const t=_0x360c07['t'],_0xd26758={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x30a4cf,'label':Gn(_0x360c07,'AI_CHAT_SEARCH_RESOURCES')};super(_0x360c07,_0xd26758['creator']),this['label']=_0xd26758['label'],this['_viewConfig']=_0xd26758,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x360c07,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x1f8b60){this['fire']('search',_0x1f8b60);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x32fdce(),this['iconView']['content']=_0x316a56,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x261416,t){this['resetButtonView']=new _0x21c9df(_0x261416),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x3e418d,'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',_0x15f7ba=>!_0x15f7ba),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 Br extends _0x2855e5{['_searchView'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x2b908a,_0x1d3a78){super(_0x2b908a),this['_source']=_0x1d3a78,this['set']('isLoading',!0x0),this['_searchView']=this['_createSearchView']();const _0x44f8d2=this['_createSearchSection']();this['_resourcesListView']=this['_createResourcesListView'](),this['_skeletonLoader']=this['_createSkeletonView'](),this['children']=new _0x1cd988([_0x44f8d2,this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new zr(this['locale']);}['_createSearchSection'](){const _0x2eabcb=new _0x2855e5(this['locale']);return _0x2eabcb['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x243eca,_0x198f16)=>{this['loadResources'](_0x198f16),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x198f16);}),_0x2eabcb;}['_createResourcesListView'](){const _0x30996f=new Ur(this['locale'],this['_source']);return _0x30996f['delegate']('addResourceToContext')['to'](this),_0x30996f['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x30996f;}['_createSkeletonView'](){const _0x29cd69=new je(this['locale'],Le['aiChatResources']);return _0x29cd69['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x1dc95c=>!_0x1dc95c)]}}),_0x29cd69;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x557be7){const _0xb168f0=_0x91fc81();this['_latestLoadResourcesUid']=_0xb168f0,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x557be7,'uid':_0xb168f0}),this['isLoading']=!0x0;}['setResources'](_0x21ec72,_0x22e5da){if(_0x22e5da&&_0x22e5da!==this['_latestLoadResourcesUid'])return;const _0x18bd41=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x21ec72,_0x18bd41),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x1d32a8,_0x33628c){this['_resourcesListView']['updateResourceState'](_0x1d32a8,_0x33628c);}}const ua='ck-ai-chat-context-controls__source-balloon-panel',_a='ck-button-icon\x20ck-button-back',Ia='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class po{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x483009,_0x13e6ba,_0x3bd06e){this['_locale']=_0x483009,this['_bodyCollection']=_0x13e6ba,this['_config']=_0x3bd06e;}['showSourceResourcesBalloon'](_0x123121){let _0x279c54=this['_sourceResourceBalloons']['get'](_0x123121['id']);_0x279c54||(_0x279c54=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x123121['id'],_0x279c54),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x279c54)),this['_addSourceResourceContent'](_0x279c54,_0x123121),_0x279c54['show']();const _0x14dcdf=this['_config']['getTargetElement']();_0x14dcdf&&_0x279c54['pin']({'target':_0x14dcdf,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x5c9a3b,_0x150708,_0x488b04){const _0x460364=this['_sourceResourceBalloons']['get'](_0x5c9a3b);if(!_0x460364)return;const _0x41c94e=this['_getResourcesViewFromBalloon'](_0x460364);_0x41c94e&&_0x41c94e['setResources'](_0x150708,_0x488b04);}['closeSourceResourceBalloon'](_0x5aa1f1){const _0x19c419=this['_sourceResourceBalloons']['get'](_0x5aa1f1);_0x19c419&&requestAnimationFrame(()=>{_0x19c419['hide'](),this['_sourceResourceBalloons']['delete'](_0x5aa1f1),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x1dac53 of this['_sourceResourceBalloons']['values']())if(_0x1dac53['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x4128bc,_0x2f737f,_0x70d751){const _0x324f62=this['_sourceResourceBalloons']['get'](_0x4128bc);if(!_0x324f62||!_0x324f62['isVisible'])return;const _0x52a89a=this['_config']['getTargetElement']();if(!_0x52a89a)return;_0x324f62['pin']({'target':_0x52a89a,'limiter':this['_config']['getLimiterElement']()});const _0x55720b=this['_getResourcesViewFromBalloon'](_0x324f62);_0x55720b&&_0x55720b['updateResourceState'](_0x2f737f,_0x70d751);}['destroy'](){for(const _0x489718 of this['_sourceResourceBalloons']['values']())_0x489718['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x58acbc=new _0x2b3342(this['_locale']);return _0x58acbc['extendTemplate']({'attributes':{'class':ua}}),this['_bodyCollection']['add'](_0x58acbc),_0x58acbc;}['_addSourceResourceContent'](_0xdaec17,_0x5acb88){_0xdaec17['content']['clear']();const _0x101d81=this['_createBalloonHeader'](_0xdaec17,_0x5acb88);_0xdaec17['content']['add'](_0x101d81);const _0x4a80e1=this['_createBalloonResourcesView'](_0x5acb88);_0xdaec17['content']['add'](_0x4a80e1);}['_createBalloonHeader'](_0x1e2b83,_0x579b8a){const _0x424cdb=this['_createBackButton'](_0x1e2b83),_0x253cc5=new _0x12296e(this['_locale'],{'label':_0x579b8a['label'],'class':Ia});return _0x253cc5['children']['add'](_0x424cdb,0x0),_0x253cc5;}['_createBackButton'](_0x3a7676){const _0x44c27c=new _0x21c9df(this['_locale']);return _0x44c27c['set']({'icon':_0x582b36,'tooltip':Gn(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':_a}),_0x44c27c['on']('execute',()=>{_0x3a7676['hide'](),this['_config']['onBackToContext']();}),_0x44c27c;}['_createBalloonResourcesView'](_0x4aaf30){const _0x3cb7c0=new Br(this['_locale'],_0x4aaf30);return _0x3cb7c0['on']('loadSourceResources',(_0x23085e,_0x53b96b)=>{this['_config']['onLoadSourceResources'](_0x53b96b);}),_0x3cb7c0['on']('addResourceToContext',(_0x267ec8,_0x522474)=>{this['_config']['onResourceSelected'](_0x522474['source'],_0x522474['resource']),this['closeSourceResourceBalloon'](_0x4aaf30['id']);}),_0x3cb7c0;}['_getResourcesViewFromBalloon'](_0x3e4d50){const _0x135e7b=_0x3e4d50['content']['get'](0x1);return _0x135e7b instanceof Br?_0x135e7b:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x239cb6){_0x4a2e91({'emitter':_0x239cb6,'contextElements':[_0x239cb6['element']],'callback':()=>{_0x239cb6['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x239cb6['isVisible']});}}const xe=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources'],Bo='ck-ai-chat-context-controls',bo='ck-ai-chat-context-controls__pending-contexts',To='ck-ai-chat-context-controls__add-context-balloon-panel',Ao='ck-ai-chat-context-controls__add-context-button',ko='ck-ai-chat-context-controls__url-balloon-panel',Eo='ck-ai-chat-context-controls__balloon-button',vo='ck-ai-chat-context-controls__balloon-button-source',go='ck-ai-chat-controls-button',Vo='ck-ai-chat-context-chips-wrapper-balloon',fo='ck-ai-chat-controls_context_show-more-button',Io='ck-ai-chat-context-controls__show-more-balloon-panel',Po='ck-ai-chat',Ro=[_0x2b3342['defaultPositions']['northArrowSouthWest'],_0x2b3342['defaultPositions']['northArrowSouth'],_0x2b3342['defaultPositions']['northArrowSouthEast'],_0x2b3342['defaultPositions']['southArrowNorthWest'],_0x2b3342['defaultPositions']['southArrowNorth'],_0x2b3342['defaultPositions']['southArrowNorthEast']];class Ce extends _0x2855e5{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['bodyCollection'];constructor(_0x34db6c,_0x247dae){super(_0x34db6c),this['bodyCollection']=_0x247dae,this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x34db6c),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x34db6c),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x34db6c),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x34db6c,_0x247dae);const _0x4b8e24={'cssClasses':{'showMoreButton':fo,'showMoreBalloon':Io,'overflowContainer':Vo,'controlsButton':go}};this['_overflowManager']=new wo(_0x34db6c,this['_currentContextsChips'],_0x4b8e24,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'](_0x296e89,_0x4a1707){const _0x574a5f=this['_createContextButton'](_0x296e89,'current',!0x0,_0x4a1707);this['_addContextToCollection'](_0x574a5f,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x57a768){this['_removeContextFromCollection'](_0x57a768,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x57a768,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x5c9915,_0x4ce9bb){let _0x4514b6=this['_currentContextsChips']['find'](_0x57b12a=>_0x57b12a['id']===_0x5c9915);_0x4514b6||(_0x4514b6=this['_overflowManager']['overflowChips']['find'](_0x5a42fc=>_0x5a42fc['id']===_0x5c9915)),_0x4514b6&&(_0x4514b6['isLoading']=_0x4ce9bb);}['setConversationContext'](_0x22e3a1){this['_conversationContextsChips']['clear']();for(const _0x4c150e of _0x22e3a1){const _0x270447=this['_createContextButton'](_0x4c150e,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x270447,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x2daf90,_0x52d372,_0x1cd3bf){this['_resourcesBalloonView']['updateResourceState'](_0x2daf90,_0x52d372,_0x1cd3bf);}['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'](_0x4b648f){this['_resourcesBalloonView']['showSourceResourcesBalloon'](_0x4b648f),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x5449ee,_0x5b37dc,_0x1568e1,_0x35b87a){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x5449ee,_0x1568e1,_0x35b87a);}['closeSourceResourceBalloon'](_0x38c084){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x38c084),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0xef7e82){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0xef7e82),this['_setAddContextButtonEnabled'](_0xef7e82);}['_setAddContextButtonEnabled'](_0x150993){const _0x126051=!_0x150993['document']['isHidden']&&_0x150993['document']['enabled'],_0x524058=_0x150993['urls']['enabled'],_0x591584=_0x150993['files']['enabled'];this['addContextButtonView']['isEnabled']=_0x126051||_0x524058||_0x591584;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Bo,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':bo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x5298b7){const _0xeea8b9=new _0x21c9df(_0x5298b7);return _0xeea8b9['set']({'label':Gn(_0x5298b7,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':go+'\x20'+Ao,'icon':_0x1b9f37,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0xeea8b9;}['_createAddContextBalloonPanelView'](_0xc90971){return this['_createBaseBalloonPanel'](_0xc90971,To);}['_createUrlBalloonPanelView'](_0x3f4de8){const _0x1c942a=this['_createBaseBalloonPanel'](_0x3f4de8,ko);return this['_addUrlContent'](_0x1c942a,_0x3f4de8),_0x1c942a;}['_createResourcesBalloonView'](_0x9202ee,_0x5dc679){return new po(_0x9202ee,_0x5dc679,{'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ro});},'onResourceSelected':(_0x2c2751,_0x2ac054)=>{this['fire']('addResourceToContext',{'source':_0x2c2751,'resource':_0x2ac054});},'onLoadSourceResources':_0x5420ac=>{this['fire']('loadSourceResources',_0x5420ac);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']});}['_getLimiterElement'](){return this['element']?.['closest']('.'+Po)||document['body'];}['_createBaseBalloonPanel'](_0x4b66de,_0x528d7d){const _0x469820=new _0x2b3342(_0x4b66de);return _0x469820['extendTemplate']({'attributes':{'class':_0x528d7d}}),this['bodyCollection']['add'](_0x469820),_0x469820;}['_setBalloonPanelContent'](_0x4883c1,_0x5c487e,_0x3312f2){if(_0x4883c1['content']['clear'](),!_0x3312f2['document']['isHidden']&&_0x3312f2['document']['enabled']){const _0x2060bd=this['_createBalloonButton'](_0x5c487e,{'label':Gn(_0x5c487e,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x6fa3f4});_0x2060bd['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x4883c1['content']['add'](_0x2060bd);}if(_0x3312f2['urls']['enabled']){const _0x150808=this['_createBalloonButton'](_0x5c487e,{'label':Gn(_0x5c487e,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x9712c4});_0x150808['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ro}),this['_urlInputView']['focus']();}),_0x4883c1['content']['add'](_0x150808);}if(_0x3312f2['files']['enabled']){const _0x4550e7=new _0x56cac2(_0x5c487e);_0x4550e7['set']({'label':Gn(_0x5c487e,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x515ed8,'withText':!0x0,'tooltip':!0x0,'class':Eo,'allowMultipleFiles':!0x0}),_0x4550e7['on']('done',(_0x3098c4,_0x2465d3)=>{this['fire']('addFileToContext',_0x2465d3),this['hideAddContextBalloonPanel']();}),_0x4550e7['tooltip']=!0x0,_0x4883c1['content']['add'](_0x4550e7);}for(const _0xd77459 of _0x3312f2['sources']){const _0x1cd6c3=this['_createBalloonButton'](_0x5c487e,{'label':_0xd77459['label'],'icon':_0xd77459['icon']||_0x28ce25,'type':'source'});_0x4883c1['content']['add'](_0x1cd6c3),_0x1cd6c3['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon'](_0xd77459);});}}['_addUrlContent'](_0x9ca619,_0x3dbe5e){this['_urlInputView']=new mo(_0x3dbe5e),this['_urlInputView']['on']('submitUrl',(_0x8fc426,_0x30e55f)=>{this['_handleUrlSubmit'](_0x30e55f);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ro});}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ro});}),_0x9ca619['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x240923,_0x2157e3){const _0xfbc43a='source'===_0x2157e3['type']?new Aa(_0x240923):new _0x21c9df(_0x240923);return _0xfbc43a['set']({'label':_0x2157e3['label'],'icon':_0x2157e3['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Eo}),_0xfbc43a;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x4a2e91({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x100c18){const _0xbb0576=this['_addContextBalloonConfig'];_0xbb0576['buttonView']['isOn']=_0x100c18,_0x100c18?_0xbb0576['balloonView']['show']():_0xbb0576['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x5aeabd,buttonView:_0x5d85d5,hideMethod:_0x4328ac}=this['_addContextBalloonConfig'];_0x4a2e91({'emitter':_0x5aeabd,'contextElements':[_0x5aeabd['element'],_0x5d85d5['element']],'callback':()=>{_0x4328ac();},'activator':()=>_0x5d85d5['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x685518,_0x483337,_0x341216=!0x1,_0x4d0a22=!0x1){const _0x5cbcc6='conversation'===_0x483337||!0x0===_0x685518['isReadOnly'],_0x52013f=new xo(this['locale'],_0x685518,_0x5cbcc6,_0x341216,_0x4d0a22);return _0x5cbcc6||_0x52013f['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x52013f['id']);}),_0x52013f;}['_addContextToCollection'](_0x2454c7,_0x1bb7fa){_0x1bb7fa['add'](_0x2454c7,0x0);}['_removeContextFromCollection'](_0x4e43f2,_0x1ab92e){const _0x1bc40d=_0x1ab92e['find'](_0x431bdf=>_0x431bdf['id']===_0x4e43f2);_0x1bc40d&&_0x1ab92e['remove'](_0x1bc40d);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ro}));}['_handleUrlSubmit'](_0x182dd7){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x182dd7);}}class Aa extends _0x21c9df{['arrowView'];constructor(_0x554394){super(_0x554394),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[vo]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x33e2a1=new _0x32fdce();return _0x33e2a1['content']=_0x353881,_0x33e2a1['extendTemplate']({'attributes':{'class':vo+'__arrow'}}),_0x33e2a1;}}class be extends _0x2855e5{['_cancelButtonView'];['_loaderView'];constructor(_0x42c895){super(_0x42c895),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 _0x3cf76c=new _0x21c9df(this['locale']);return _0x3cf76c['set']({'label':Gn(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ai-chat-controls-loader__cancel-button','icon':_0xb72389}),_0x3cf76c['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x3cf76c;}['_createLoaderView'](){const _0x4dd480=new _0x2855e5(this['locale']);return _0x4dd480['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':Gn(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x4dd480;}}class ki extends _0x2855e5{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_shouldRestorePromptInputFocus'];constructor(_0x250922,_0x3160ef){super(_0x250922),this['_contextPanelView']=this['_createContextPanelView'](_0x250922,_0x3160ef),this['_promptInputView']=this['_createPromptInputView'](_0x250922),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x250922),this['_loaderView']=this['_createLoaderView'](_0x250922),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'](...xe)['to'](this);const _0x503bd8=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls']},'children':[{'tag':'div','attributes':{'class':[_0x503bd8['if']('isLoading','ck-hidden')]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x503bd8['if']('isLoading','ck-hidden',_0x1b9296=>!_0x1b9296)]},'children':[this['_loaderView']]}]}),_0x4a2e91({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x4999c8,_0x420fad){return new Ce(_0x4999c8,_0x420fad);}['_createPromptInputView'](_0x1cd759){return new ge(_0x1cd759,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x36ece2){return new we(_0x36ece2);}['_createLoaderView'](_0x12fe26){return new be(_0x12fe26);}['_handlePromptInputFocus'](_0x5a8016,_0x341e4a,_0x38a08f){_0x38a08f?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x26aa27,_0x5337f6){this['_contextPanelView']['addContextItem'](_0x26aa27,_0x5337f6);}['removeContextItem'](_0x5d8eed){this['_contextPanelView']['removeContextItem'](_0x5d8eed);}['setContextItemLoading'](_0x216217,_0x119c8b){this['_contextPanelView']['setContextItemLoading'](_0x216217,_0x119c8b);}['setIsUploadInProgress'](_0x1fad49){this['_promptInputView']['setIsUploadInProgress'](_0x1fad49);}['setConversationContext'](_0x26f900){this['_contextPanelView']['setConversationContext'](_0x26f900);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x2483a7,_0x30d263,_0x266f16){this['_contextPanelView']['updateResourceState'](_0x2483a7,_0x30d263,_0x266f16);}['setWebSearch'](_0x3891c7){this['_promptCapabilitiesView']['setWebSearch'](_0x3891c7);}['setReasoning'](_0x5c2a73){this['_promptCapabilitiesView']['setReasoning'](_0x5c2a73);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x1db2e2){this['_contextPanelView']['setAddContextOptions'](_0x1db2e2);}['setInputPlaceholder'](_0x444018){this['_promptInputView']['setPlaceholderText'](_0x444018);}['setModelList'](_0x30c981,_0x2788d6){this['_promptCapabilitiesView']['setModelList'](_0x30c981,_0x2788d6);}['setModel'](_0x11624b){this['_promptCapabilitiesView']['setModel'](_0x11624b);}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x35ee3b){this['_promptCapabilitiesView']['disableModelSelector'](_0x35ee3b);}['populateSourceResourceBalloon'](_0x50d4dd,_0x2a2718,_0x598c9d,_0x970d66){this['_contextPanelView']['populateSourceResourceBalloon'](_0x50d4dd,_0x2a2718,_0x598c9d,_0x970d66);}['closeSourceResourceBalloon'](_0x4d72d6){this['_contextPanelView']['closeSourceResourceBalloon'](_0x4d72d6);}['focusPromptInput'](){this['_promptInputView']['focus']();}}class yi extends _0x12296e{['conversationStartButton'];['resizeButton'];constructor(_0x7a20db,_0x123557){super(_0x7a20db,{'label':Gn(_0x7a20db,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':St}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x7a20db),this['children']['add'](this['conversationStartButton']),_0x123557&&(this['resizeButton']=As(_0x7a20db,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0xe8d300){const _0x4e35cb=new _0x21c9df(_0xe8d300);return _0x4e35cb['set']({'label':Gn(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x436496,'class':'ck-ai-chat__start-conversation'}),_0x4e35cb['on']('execute',()=>{this['fire']('startConversation');}),_0x4e35cb;}}class Bi extends _0x2855e5{constructor(_0xc0455b){super(_0xc0455b),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':Gn(_0xc0455b,'AI_DISCLAIMER_TEXT')}]}]});}}class Et extends _0x2855e5{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x112fbc,_0x3fa329){super(_0x112fbc),this['_bodyCollection']=new Gt(_0x112fbc),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new yi(_0x112fbc,_0x3fa329),this['chatHeader']['delegate'](...Pt)['to'](this),this['chatFeed']=new ji(_0x112fbc,this['_bodyCollection']),this['chatFeed']['delegate'](...Pt)['to'](this),this['chatControls']=new ki(_0x112fbc,this['_bodyCollection']),this['chatControls']['delegate'](...Pt)['to'](this),this['chatDisclaimer']=new Bi(_0x112fbc),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x112fbc['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x2a49bf,_0x20b7af,_0xa99038,_0x11db84){this['chatControls']['populateSourceResourceBalloon'](_0x2a49bf,_0x20b7af,_0xa99038,_0x11db84);}['closeSourceResourceBalloon'](_0x45e871){this['chatControls']['closeSourceResourceBalloon'](_0x45e871);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class it extends _0x599126{static get['requires'](){return[rt];}['_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;constructor(_0x38e99e){super(_0x38e99e);const _0x5246ba=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new Q(),this['_view']=new Et(this['context']['locale'],_0x5246ba['showResizeButton']),this['_view']['delegate'](...Pt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x2db9f9,{showDiff:_0x57c56b})=>{this['showDiff']=_0x57c56b;}),_0x5246ba['view']['addTab']({'id':'chat','buttonLabel':Gn(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':St,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x22355c=>_0x22355c),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x50aaea=>_0x50aaea),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x4e565f){this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x4e565f['availableModels'],!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':Gn(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE')});}['addFeedItemStaticMessage']({id:_0x70e422,staticMessage:_0x4c9314}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x70e422,'initialContent':'<p>'+_0x4c9314+'</p>'});}['addFeedItemUserMessage'](_0x2dc43c){const _0x13a4fe=_0x2dc43c['quickActionData']?.['displayedPrompt']||_0x2dc43c['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x2dc43c['contextItems']['values']()),'initialContent':'<p>'+_0x13a4fe+'</p>','id':_0x2dc43c['id']});}['addFeedItemError']({errorMessage:_0x7141ca,id:_0x582efd}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x7141ca+'</p>','id':_0x582efd});}['addFeedItemAIReply'](_0xbe26c9){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0xbe26c9['interactionId']+':'+_0xbe26c9['id']}),this['_view']['chatFeed']['setLoadingMessage']('');});}async['addFeedItemAISuggestion'](_0x5b95ae){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x5b95ae['interactionId']+':'+_0x5b95ae['id'],'areActionsDisabled':_0x5b95ae['areActionsDisabled'],'showDiff':this['showDiff']}),this['_view']['chatFeed']['setLoadingMessage']('');});}['addFeedInteractionHeader'](_0xc27eef){this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0xc27eef['id'],'capabilities':_0xc27eef['capabilities']});}['updateFeedInteractionHeader'](_0x27403c){const _0x452bde=this['_view']['chatFeed']['children']['find'](_0x431bbb=>_0x431bbb['options']['id']==_0x27403c['id']&&_0x431bbb instanceof Rt);_0x452bde&&_0x452bde['set']('isVisible',_0x27403c['isVisible']);}async['updateFeedItemAIReplyContent'](_0x4a8f29){const _0xda0016=_0x4a8f29['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x34a164=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x4a8f29,'abortSignal':_0x34a164,'renderingStrategy':_0xda0016}),_0x4a8f29['isDone']&&this['markFeedItemAsDone'](_0x4a8f29['id']);});}['updateFeedItemAIReplySources'](_0x1d1901,_0x33f39d){this['_view']['chatFeed']['updateWebSources'](_0x1d1901,_0x33f39d);}async['updateFeedItemAIReplySuggestionContent'](_0x585a32){const _0x1289d8=_0x585a32['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x14a0e3=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x585a32,'abortSignal':_0x14a0e3,'renderingStrategy':_0x1289d8}),_0x585a32['isDone']&&this['markFeedItemAsDone'](_0x585a32['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x791135){this['_view']['chatFeed']['updateSuggestionPartState'](_0x791135);}['markFeedItemAsDone'](_0x1fc9e){this['_view']['chatFeed']['markItemAsDone'](_0x1fc9e);}['removeFeedInteraction'](_0x391349){this['_view']['chatFeed']['getItemIds']()['filter'](_0x342e0b=>_0x342e0b['startsWith'](_0x391349))['forEach'](_0x511bc7=>this['_view']['chatFeed']['removeItem'](_0x511bc7));}['startInteraction'](_0x4ba91d){this['_view']['chatFeed']['setLoadingMessage'](this['_getLoadingMessage'](_0x4ba91d)),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x3f8bbb){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x56ccc2=>_0x56ccc2['startsWith'](_0x3f8bbb['id']))['forEach'](_0x541270=>this['markFeedItemAsDone'](_0x541270)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x51eba4,_0x2097ff){this['_view']['chatControls']['addContextItem'](_0x51eba4,_0x2097ff);}['removeContextItem'](_0x5c2977){this['_view']['chatControls']['removeContextItem'](_0x5c2977);}['setContextItemLoading'](_0x189e72,_0x42233f){this['_view']['chatControls']['setContextItemLoading'](_0x189e72,_0x42233f);}['setIsUploadInProgress'](_0x37c825){this['_view']['chatControls']['setIsUploadInProgress'](_0x37c825);}['setConversationContext'](_0x1ce54c){this['_view']['chatControls']['setConversationContext'](_0x1ce54c);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x4c2176,_0x34e55b,_0x2e7b42){this['_view']['chatControls']['updateResourceState'](_0x4c2176,_0x34e55b,_0x2e7b42);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x555ce8){this['_view']['chatControls']['setAddContextOptions'](_0x555ce8);}['updateCapabilities'](_0x6dbd90){this['_view']['chatControls']['setWebSearch'](_0x6dbd90['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x6dbd90['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x6dbd90));}['setSelectedModel'](_0x5cd73d,_0x20e198){this['_view']['chatControls']['setModel'](_0x5cd73d),_0x20e198&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x57cbc4){this['feedItemRenderingStrategy']=_0x57cbc4;}['toggleLoadingSkeleton'](_0x265dad){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x265dad);}['resetConversationTitle'](){this['setConversationTitle'](Gn(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x94fd8,_0x451c79=!0x1){if(_0x451c79&&!At()&&_0x94fd8['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x94fd8);this['_view']['chatHeader']['label']=_0x94fd8;}['_animateConversationTitle'](_0x3c3337){let _0x4a8077=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x3c3337[_0x4a8077],_0x4a8077++,_0x4a8077===_0x3c3337['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x2e30db){this['_view']['chatHeader']['isMaximized']=_0x2e30db;}['_getLoadingMessage'](_0x128575){const _0x139d89=_0x128575['capabilities'];return _0x139d89['isWebSearchEnabled']&&_0x139d89['isReasoningEnabled']?Gn(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x139d89['isWebSearchEnabled']?Gn(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x139d89['isReasoningEnabled']?Gn(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):Gn(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x273341){return _0x273341?_0x273341['isWebSearchEnabled']&&_0x273341['isReasoningEnabled']?Gn(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x273341['isWebSearchEnabled']?Gn(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x273341['isReasoningEnabled']?Gn(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):Gn(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):Gn(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x16972b,_0xbbc57a,_0x152274,_0x5bd528){this['_view']['populateSourceResourceBalloon'](_0x16972b,_0xbbc57a,_0x152274,_0x5bd528);}['closeSourceResourceBalloon'](_0xd23688){this['_view']['closeSourceResourceBalloon'](_0xd23688);}['focusPromptInput'](){this['_view']['chatControls']['focusPromptInput']();}['scrollFeedToSuggestion'](_0x24bb77,_0x47439c){this['_view']['chatFeed']['scrollToSuggestion'](_0x24bb77,_0x47439c);}}class Mi extends _0x11ab26{['sections'];constructor(_0x4dfa32,_0x24f124){super(_0x4dfa32),this['sections']=_0x24f124,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x15c7b4){let _0x2aaee4=0x0,_0x1ffc01=0x0;for(const _0x1705cc of this['sections']){const {resultsCount:_0xd85dcd,totalItemsCount:_0x43b8da}=_0x1705cc['filter'](_0x15c7b4);_0x2aaee4+=_0xd85dcd,_0x1ffc01+=_0x43b8da;}return{'resultsCount':_0x2aaee4,'totalItemsCount':_0x1ffc01};}}class Di extends _0x522072{['title'];['itemsViews'];['_itemsListView'];constructor(_0x11a9be,{title:_0x485d78,items:_0xeb39df}){super(_0x11a9be);const _0x334875=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x485d78,this['itemsViews']=_0xeb39df;const _0x2eb090=new _0x2855e5(_0x11a9be);_0x2eb090['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x11ab26(_0x11a9be),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x334875['if']('isVisible','ck-hidden',_0x173b0f=>!_0x173b0f)]},'children':[_0x2eb090,this['_itemsListView']]});}['filter'](_0x2bd351){const _0x3807ac=this['itemsViews']['length'];let _0x246e80=0x0;for(const _0x128af0 of this['itemsViews']){if(_0x2bd351){const _0x1e0ce4=_0x128af0['isMatching'](_0x2bd351);_0x128af0['isVisible']=!!_0x1e0ce4,_0x128af0['highlightText'](_0x2bd351);}else _0x128af0['isVisible']=!0x0,_0x128af0['highlightText'](null);_0x128af0['isVisible']&&_0x246e80++;}return this['isVisible']=_0x246e80>0x0,{'resultsCount':_0x246e80,'totalItemsCount':_0x3807ac};}['getItem'](_0x2be70d){return this['itemsViews']['find'](_0x5c4973=>_0x5c4973['id']===_0x2be70d);}['removeItem'](_0x44c641){const _0x127316=this['itemsViews']['indexOf'](_0x44c641);-0x1!==_0x127316&&(this['itemsViews']['splice'](_0x127316,0x1),this['_itemsListView']['items']['remove'](_0x44c641));}}class zi extends _0x87b2d(_0x522072){['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(_0x4c19c1,_0x468c15){super(_0x4c19c1);const _0xa4cd01=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x468c15['pinned']),this['set']('loadingState',null),this['id']=_0x468c15['id'];const {title:_0x3eeefb,createdAt:_0x2edc47,active:_0x2f26a7=!0x1}=_0x468c15;this['_titleView']=new _0x675684(),this['_titleView']['text']=_0x3eeefb,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x49300f=this['_createCheckView'](),_0x6c40b5=this['_createPinButtonView'](_0x4c19c1),_0x11a9cb=this['_createMenuDropdownView'](),_0x1881f3=this['_createEditInputView'](_0x4c19c1,_0x3eeefb),_0x141396=this['_createAcceptEditButtonView'](_0x4c19c1,_0x1881f3),_0x1184bd=this['_createCancelEditButtonView'](_0x4c19c1,_0x1881f3);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x6c40b5),this['actions']['add'](_0x11a9cb),this['on']('change:isEdit',(_0x486843,_0x50fd2b,_0x1b415)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x1b415?(this['actions']['add'](_0x141396),this['actions']['add'](_0x1184bd),this['mainContent']['add'](_0x1881f3),_0x1881f3['element']['focus']()):(this['actions']['add'](_0x6c40b5),this['actions']['add'](_0x11a9cb),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x2f26a7?'ck-ai-chat-history__item--active':'',_0xa4cd01['if']('isVisible','ck-hidden',_0x17fa52=>!_0x17fa52),_0xa4cd01['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',_0xa4cd01['if']('loadingState','ck-hidden',_0x4066eb=>!!_0x4066eb)]},'children':_0x2f26a7?[_0x49300f]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0xa4cd01['if']('loadingState','ck-hidden',_0x162807=>!_0x162807)]},'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',_0xa4cd01['if']('loadingState','ck-hidden',_0x491843=>!!_0x491843)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0xa4cd01['if']('loadingState','ck-hidden',_0x537da4=>!_0x537da4)]},'children':[{'text':_0xa4cd01['to']('loadingState',_0x1d64a8=>_0x1d64a8?Gn(this['locale'],zi['LOADING_LABELS'][_0x1d64a8]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x2edc47]}]},{'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'](_0x182fde){this['_titleView']['text']=_0x5787f6(_0x182fde);}['updateLoadingState'](_0x8dd15e,_0x438631){this['set']('loadingState',_0x438631?_0x8dd15e:null);}['_createCheckView'](){const _0x565fbe=new _0x32fdce();return _0x565fbe['set']({'content':_0x5925f3}),_0x565fbe;}['_createPinButtonView'](_0x14b6e9){const _0x1967d0=new _0x21c9df(_0x14b6e9);return _0x1967d0['set']({'label':Gn(_0x14b6e9,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x5dea9e,'withText':!0x1,'tooltip':!0x0}),_0x1967d0['bind']('isOn')['to'](this,'pinned'),_0x1967d0['on']('execute',()=>{const _0xa357bf=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0xa357bf});}),_0x1967d0;}['_createMenuDropdownView'](){const _0x320676=_0x372e42(this['locale'],_0x49a486),_0x557286=_0x320676['panelView']['children'];_0x320676['buttonView']['set']({'label':Gn(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x1d338a}),_0x320676['panelPosition']='sw';const _0x1e5b55=new _0x21c9df(this['locale']);_0x1e5b55['label']=Gn(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x1e5b55['withText']=!0x0,_0x1e5b55['on']('execute',()=>{this['isEdit']=!0x0;});const _0x1071e3=new _0x21c9df(this['locale']);_0x1071e3['label']=Gn(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x1071e3['withText']=!0x0,_0x1071e3['on']('execute',()=>{this['showConfirm'](Gn(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x34367d=new _0x11ab26(this['locale']),_0x84839f=new _0x522072(this['locale']);_0x84839f['children']['add'](_0x1e5b55);const _0xbf34dc=new _0x522072(this['locale']);return _0xbf34dc['children']['add'](_0x1071e3),_0x34367d['items']['addMany']([_0x84839f,_0xbf34dc]),_0x557286['add'](_0x34367d),_0x320676;}['_createEditInputView'](_0x19de45,_0x432908){const _0x1b1b0e=new _0x478267(_0x19de45),_0x4f6b06=_0x1b1b0e['bindTemplate'];return _0x1b1b0e['value']=_0x432908,_0x1b1b0e['extendTemplate']({'on':{'keydown':_0x4f6b06['to'](_0x1e729d=>{'Enter'==_0x1e729d['key']&&this['_commitEditInputValue'](_0x1b1b0e);})}}),_0x1b1b0e;}['_createAcceptEditButtonView'](_0x11ede3,_0x2a0991){const _0x58cd9a=new _0x21c9df(_0x11ede3);return _0x58cd9a['set']({'icon':_0x5925f3,'withText':!0x1,'tooltip':Gn(_0x11ede3,'AI_CHAT_HISTORY_ACCEPT')}),_0x58cd9a['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x58cd9a['on']('execute',()=>{this['_commitEditInputValue'](_0x2a0991);}),_0x58cd9a;}['_commitEditInputValue'](_0x444427){const _0x269db8=_0x444427['element']['value']||'';this['_titleView']['text']=_0x269db8,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x269db8});}['_createCancelEditButtonView'](_0x3983ff,_0x20ef72){const _0xa49a86=new _0x21c9df(_0x3983ff);return _0xa49a86['set']({'icon':_0x3e418d,'withText':!0x1,'tooltip':Gn(_0x3983ff,'AI_CHAT_HISTORY_CANCEL')}),_0xa49a86['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0xa49a86['on']('execute',()=>{this['isEdit']=!0x1,_0x20ef72['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0xa49a86;}['_createSpinnerView'](){const _0x1219a5=new Ve('tiny');return _0x1219a5['isVisible']=!0x0,_0x1219a5;}['isMatching'](_0x15fe07){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x15fe07)?{'title':!0x0}:null;}['highlightText'](_0x13e1b1){this['_titleView']['highlightText'](_0x13e1b1);}}class vt extends _0x2855e5{['searchView'];['errorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x1ac937,_0x34cc5b){super(_0x1ac937),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1);const _0x3c413a=new _0x12296e(_0x1ac937,{'label':Gn(_0x1ac937,'AI_CHAT_HISTORY_HEADING'),'icon':Ht,'class':'ck-ai-header\x20ck-ai-header_history'});_0x34cc5b&&(this['resizeButton']=As(_0x1ac937,this),_0x3c413a['children']['add'](this['resizeButton'])),this['sectionsView']=new Mi(_0x1ac937,[]),this['sectionsView']['delegate'](...Fi)['to'](this),this['errorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),this['on']('change:isLoading',()=>this['_updateViewVisibility']()),this['on']('change:hasItems',()=>this['_updateViewVisibility']()),this['on']('change:errorMessage',()=>this['_updateViewVisibility']()),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat-history','ck-rounded-corners'],'dir':'ltr'},'children':[_0x3c413a,{'tag':'div','attributes':{'class':['ck-ai-chat-history__content']},'children':[this['skeletonView'],this['errorView'],this['emptyView'],this['searchView']]}]});}['_updateViewVisibility'](){this['isSearchViewVisible']=!this['isLoading']&&this['hasItems']&&!this['errorMessage'],this['isEmptyViewVisible']=!this['isLoading']&&!this['hasItems']&&!this['errorMessage'];}['_createSearchView'](){const _0x533025=new _0x1847ad(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':Gn(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0xb879b6=>Gn(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0xb879b6),'secondary':Gn(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}});return _0x533025['on']('render',()=>{this['searchView']['children']['add'](this['errorView'],0x1);}),_0x533025['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x29b4f7=>!_0x29b4f7)]}}),_0x533025;}['_createSkeletonView'](){const _0x317a9c=new je(this['locale'],Le['aiHistory']);return _0x317a9c['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x2b6139=>!_0x2b6139)]}}),_0x317a9c;}['_createErrorView'](){const _0x129327=new _0x2855e5(this['locale']),_0x15effe=new _0x21c9df(this['locale']);return _0x15effe['set']({'withText':!0x1,'icon':_0x3e418d,'class':'ck-ai-chat-error__dismiss-button'}),_0x15effe['bind']('isVisible')['to'](this,'hasItems',_0x2e4a57=>!!_0x2e4a57),_0x15effe['on']('execute',()=>{this['errorMessage']='';}),_0x129327['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-error',this['bindTemplate']['if']('errorMessage','ck-hidden',_0x3a6184=>!_0x3a6184)]},'children':[{'tag':'p','children':[{'text':this['bindTemplate']['to']('errorMessage')}]},_0x15effe]}),_0x129327;}['_createEmptyStateView'](){const _0x51b31b=new _0x21c9df(this['locale']);_0x51b31b['set']({'withText':!0x0,'label':Gn(this['locale'],'AI_CHAT_HISTORY_GO_TO_CHAT_BUTTON'),'class':'ck-ai-chat-history__open-chat-button'}),_0x51b31b['on']('execute',()=>{this['fire']('openChat');});const _0x4d13c5=new _0x2855e5(this['locale']);return _0x4d13c5['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x432822=>!_0x432822)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[Gn(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x51b31b]}),_0x4d13c5;}['_createListItemViews'](_0x19a048,_0x1fa57d){const _0x1e484c=[];for(const _0x352482 of _0x19a048){const _0xa05d7a=new zi(_0x1fa57d,_0x352482);_0xa05d7a['delegate'](...Fi)['to'](this),_0x1e484c['push'](_0xa05d7a);}return _0x1e484c;}['updateHistoryItemsWithCategories'](_0x12e8a7){const _0x5c3d12=this['locale']||'en',_0x18e282=[];for(const _0x5e40ac of _0x12e8a7){const _0x2a4cee=this['_createListItemViews'](_0x5e40ac['items'],_0x5c3d12);_0x18e282['push'](new Di(_0x5c3d12,{'title':_0x5e40ac['title'],'items':_0x2a4cee}));}this['sectionsView']['sections']=_0x18e282,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x18e282),this['hasItems']=_0x12e8a7['some'](_0x2d6954=>_0x2d6954['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x312e38){for(const _0x1a0829 of this['sectionsView']['sections']){const _0x2b0623=_0x1a0829['getItem'](_0x312e38);if(_0x2b0623){if(_0x1a0829['removeItem'](_0x2b0623),0x0===_0x1a0829['itemsViews']['length']){const _0x3b2363=this['sectionsView']['sections']['indexOf'](_0x1a0829);-0x1!==_0x3b2363&&(this['sectionsView']['sections']['splice'](_0x3b2363,0x1),this['sectionsView']['items']['remove'](_0x1a0829));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x2e87b4,_0xa4a9a8){for(const _0x5d6d13 of this['sectionsView']['sections']){const _0x4a032f=_0x5d6d13['getItem'](_0x2e87b4);if(_0x4a032f){_0x4a032f['updateTitle'](_0xa4a9a8);break;}}}['updateItemLoadingState'](_0x532cc3,_0x1065f1,_0x3a75f2){for(const _0x59bdf of this['sectionsView']['sections']){const _0xe496c8=_0x59bdf['getItem'](_0x532cc3);if(_0xe496c8){_0xe496c8['updateLoadingState'](_0x1065f1,_0x3a75f2);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x479608=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x479608);}}}const Fi=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class xt extends _0x599126{static get['requires'](){return[rt];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1610fe){super(_0x1610fe);const _0x29c328=this['context']['plugins']['get']('AITabs');this['_historyView']=new vt(this['context']['locale'],_0x29c328['showResizeButton']),this['_historyView']['delegate'](...Fi)['to'](this),_0x29c328['view']['addTab']({'id':'history','buttonLabel':Gn(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Ht,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x31d3b2){this['_historyView']['removeHistoryItem'](_0x31d3b2);}['updateItems'](_0x4d48a5){this['_historyView']['updateHistoryItemsWithCategories'](_0x4d48a5);}['updateItemTitle'](_0x6e9e30,_0x24a6dd){this['_historyView']['updateItemTitle'](_0x6e9e30,_0x24a6dd);}['updateItemLoadingState'](_0x2484d8,_0x5740fe,_0x39d33d){this['_historyView']['updateItemLoadingState'](_0x2484d8,_0x5740fe,_0x39d33d);}['setLoadingSkeleton'](_0x44d85e){this['_historyView']['isLoading']=_0x44d85e;}['showError'](_0x39b6fd){this['_historyView']['errorMessage']=_0x39b6fd;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x25f4e2){this['_historyView']['isMaximized']=_0x25f4e2;}}class De extends _0x12a324(){['id'];['createdAt'];constructor({id:_0x262682,title:_0x83dc55,createdAt:_0xe4c3cb,updatedAt:_0xd34950,pinned:_0x132e2f}){super(),this['id']=_0x262682,this['createdAt']=new Date(_0xe4c3cb),this['set']('title',_0x83dc55),this['set']('updatedAt',_0xd34950?new Date(_0xd34950):null),this['set']('pinned',_0x132e2f||!0x1);}['updateTitle'](_0x38d817){this['set']('title',_0x5787f6(_0x38d817)),this['updatedAt']=new Date();}['updatePinned'](_0xb34649){this['set']('pinned',_0xb34649),this['updatedAt']=new Date();}}class Tt extends _0x595595(){['items']=[];['connector'];['group'];constructor({connector:_0x1975e3,group:_0x4a0e58}){super(),this['connector']=_0x1975e3,this['group']=_0x4a0e58;}async['init'](){try{const _0x253743=this['connector']['fetchConversations'](this['group']),_0x31d947=await _0x253743['getConversations']();this['loadItems'](_0x31d947);}catch(_0x3b3eb3){this['fire']('error',{'error':_0x3b3eb3,'operation':'init'});}}['addItem'](_0x53cf58){this['items']['push'](_0x53cf58);}async['removeItem'](_0x2884e0){const _0x173a77=this['items']['findIndex'](_0x30b9c3=>_0x30b9c3['id']===_0x2884e0);if(-0x1===_0x173a77)return!0x1;try{return await this['connector']['deleteConversation'](_0x2884e0)['execute'](),this['items']['splice'](_0x173a77,0x1),this['fire']('itemRemoved',{'itemId':_0x2884e0}),!0x0;}catch(_0x30f7ef){return this['fire']('error',{'error':_0x30f7ef,'operation':'removeItem','itemId':_0x2884e0}),!0x1;}}['getItem'](_0x44d583){return this['items']['find'](_0x37d388=>_0x37d388['id']===_0x44d583);}async['updateItemTitle'](_0x2f6790,_0x561849){const _0x19d4a8=this['getItem'](_0x2f6790);if(!_0x19d4a8)return!0x1;try{return await this['connector']['updateConversation'](_0x2f6790,{'title':_0x561849})['getResult'](),_0x19d4a8['updateTitle'](_0x561849),this['fire']('itemUpdated',{'itemId':_0x2f6790,'updates':{'title':_0x561849}}),!0x0;}catch(_0x1922ea){return this['fire']('error',{'error':_0x1922ea,'operation':'updateItemTitle','itemId':_0x2f6790}),!0x1;}}async['updateItemPinned'](_0xd66ed8,_0x186cb6){const _0x50bdd7=this['getItem'](_0xd66ed8);if(!_0x50bdd7)return!0x1;try{return await this['connector']['updateConversation'](_0xd66ed8,{'pinned':_0x186cb6})['getResult'](),_0x50bdd7['updatePinned'](_0x186cb6),this['fire']('itemUpdated',{'itemId':_0xd66ed8,'updates':{'pinned':_0x186cb6}}),!0x0;}catch(_0x4cc267){return this['fire']('error',{'error':_0x4cc267,'operation':'updateItemPinned','itemId':_0xd66ed8}),!0x1;}}['loadItems'](_0x4abf8a){try{this['items']=[],_0x4abf8a['map'](_0x4070ed=>{this['addItem'](new De(_0x4070ed));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x7e0008){this['fire']('error',{'error':_0x7e0008,'operation':'loadItems'});}}['getItems'](_0x160c0f={}){const _0x4a5b7c=void 0x0!==_0x160c0f['pinned']&&_0x160c0f['pinned'],_0x3c361a=_0x160c0f['from']?new Date(_0x160c0f['from']['getFullYear'](),_0x160c0f['from']['getMonth'](),_0x160c0f['from']['getDate']()):null,_0x53de9e=_0x160c0f['to']?new Date(_0x160c0f['to']['getFullYear'](),_0x160c0f['to']['getMonth'](),_0x160c0f['to']['getDate']()):null;return this['items']['filter'](_0x13428d=>{if(_0x13428d['pinned']!==_0x4a5b7c)return!0x1;if(_0x53de9e){const _0x1cb27e=new Date(_0x13428d['createdAt']['getFullYear'](),_0x13428d['createdAt']['getMonth'](),_0x13428d['createdAt']['getDate']());return _0x3c361a?_0x3c361a['getTime']()===_0x53de9e['getTime']()?_0x1cb27e['getTime']()===_0x3c361a['getTime']():_0x1cb27e<_0x53de9e&&_0x1cb27e>=_0x3c361a:_0x1cb27e<_0x53de9e;}return!0x0;});}}class jt extends _0x599126{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[N,et,xt,rt];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](N),this['_aiChatHistoryUi']=this['context']['plugins']['get'](xt),this['_aiChatController']=this['context']['plugins']['get'](et);const _0x34232f=this['context']['plugins']['get'](rt),_0x93d2d8=this['_aiChatController']['getGroupId']();this['history']=new Tt({'connector':this['_aiConnector'],'group':_0x93d2d8}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x51ceaa,_0x5c435e)=>{this['_setItemLoading'](_0x5c435e['id'],'remove'),this['_handleRemove'](_0x5c435e['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x125dfb,_0x147c93)=>{this['_setItemLoading'](_0x147c93['id'],'rename'),this['_handleEditTitle'](_0x147c93['id'],_0x147c93['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x1e37cd,_0x24b3b3)=>{void 0x0!==_0x24b3b3['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x24b3b3['itemId'],_0x24b3b3['updates']['title']),void 0x0!==_0x24b3b3['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x24b3b3['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x5df7c2,_0x4b96e4)=>{this['_aiChatController']['handleRemovedConversation'](_0x4b96e4['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x4b96e4['itemId']),this['_clearItemLoading'](_0x4b96e4['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x6787e1,_0x543199)=>{this['_handleHistoryErrorUI'](_0x543199['error'],_0x543199['operation'],_0x543199['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x45009e,_0x1eb591)=>{this['_handleSelectConversation'](_0x1eb591['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x186fe1,_0x3a53a2)=>{const _0x55efd5=_0x3a53a2['pinned']?'pin':'unpin';this['_setItemLoading'](_0x3a53a2['id'],_0x55efd5),this['_handleTogglePin'](_0x3a53a2['id'],_0x3a53a2['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x34232f['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x34232f['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x34232f,'resizedTabs',(_0x2467b6,_0x5aa746)=>{this['_setIsMaximized'](_0x5aa746);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x34232f['resize']();});}async['_handleEditTitle'](_0x24309f,_0x918cab){await this['history']['updateItemTitle'](_0x24309f,_0x918cab);}async['_handleTogglePin'](_0x509b25,_0x154df2){await this['history']['updateItemPinned'](_0x509b25,_0x154df2);}async['_handleRemove'](_0x31deb5){await this['history']['removeItem'](_0x31deb5);}async['_handleSelectConversation'](_0x48b6ce){await this['_aiChatController']['loadConversation'](_0x48b6ce);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0xb07931=this['_aiChatController']['activeConversation']?.['id'],_0x47811e=this['_getCategorizedItems']()['map'](_0x503cc2=>({'title':_0x503cc2['title'],'items':_0x503cc2['items']['map'](_0x23efd8=>({'id':_0x23efd8['id'],'title':_0x23efd8['title']||Gn(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x23efd8['createdAt'])['toLocaleDateString'](),'active':_0x23efd8['id']===_0xb07931,'pinned':_0x23efd8['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x47811e);}['_setItemLoading'](_0x7192f6,_0x31f1e0){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x7192f6,_0x31f1e0,!0x0);}['_clearItemLoading'](_0x397a4b){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x397a4b,null,!0x1);}['_handleHistoryErrorUI'](_0x252daf,_0x20c389,_0x587eb7){const _0x47016a=this['_generateErrorMessage'](_0x20c389,_0x587eb7);this['_aiChatHistoryUi']['showError'](_0x47016a),_0x587eb7&&this['_clearItemLoading'](_0x587eb7),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0xea65b0,_0x4a61e4){const _0x1a1584=_0x4a61e4?this['history']['getItem'](_0x4a61e4):null,_0x4488a2=_0x1a1584?.['title']||Gn(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0xea65b0){case'updateItemTitle':return Gn(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x4488a2);case'updateItemPinned':{const _0x69e616=Gn(this['context']['locale'],_0x1a1584?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return Gn(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x69e616,_0x4488a2]);}case'removeItem':return Gn(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x4488a2);case'init':case'loadItems':return Gn(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return Gn(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x43e886=new Date(),_0x7da7ad=new Date(_0x43e886['getFullYear'](),_0x43e886['getMonth'](),_0x43e886['getDate']()),_0x1761b6=new Date(_0x7da7ad);_0x1761b6['setDate'](_0x1761b6['getDate']()-0x1);const _0x2b93a2=new Date(_0x7da7ad);_0x2b93a2['setDate'](_0x2b93a2['getDate']()-0xe);const _0x4b44b4=this['history']['getItems']({'pinned':!0x0}),_0x413912=this['history']['getItems']({'from':_0x7da7ad,'to':_0x7da7ad}),_0x12bb97=this['history']['getItems']({'from':_0x1761b6,'to':_0x1761b6}),_0x45d369=this['history']['getItems']({'from':_0x2b93a2,'to':_0x1761b6}),_0x205feb=this['history']['getItems']({'to':_0x2b93a2}),_0x448b0f=[];return _0x4b44b4['length']>0x0&&_0x448b0f['push']({'title':Gn(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x4b44b4}),_0x413912['length']>0x0&&_0x448b0f['push']({'title':Gn(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x413912}),_0x12bb97['length']>0x0&&_0x448b0f['push']({'title':Gn(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x12bb97}),_0x45d369['length']>0x0&&_0x448b0f['push']({'title':Gn(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x45d369}),_0x205feb['length']>0x0&&_0x448b0f['push']({'title':Gn(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x205feb}),_0x448b0f;}['_setIsMaximized'](_0x1a728e){this['_aiChatHistoryUi']['setIsMaximized'](_0x1a728e);}}class at extends _0x599126{static get['requires'](){return[jt,xt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class ga extends _0x599126{static get['requires'](){return[et,O,it,at];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x350de0){super(_0x350de0);const _0x37f3a2=_0x350de0['config'];_0x37f3a2['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),_0x37f3a2['define']('ai.chat.models',{'defaultModelId':void 0x0,'modelSelectorAlwaysVisible':!0x0,'displayedModels':void 0x0});}async['addSelectionToChatContext'](){await this['context']['plugins']['get'](et)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](et)['startConversation']();}async['sendMessage']({message:_0x1d2d31,quickActionData:_0x5b3d95}){await this['context']['plugins']['get'](et)['sendMessage']({'message':_0x1d2d31,'quickActionData':_0x5b3d95});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](et)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](et)['focusPromptInput']();}}function i(_0x431235,_0x46d74a,_0x19acdd){const t=_0x431235['t'];switch(_0x46d74a){case'AI_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});case'AI_QUICK_ACTIONS_ASK_AI':return t({'id':'AI_QUICK_ACTIONS_ASK_AI','string':'Ask\x20AI'});case'AI_QUICK_ACTIONS_CHAT_COMMANDS':return t({'id':'AI_QUICK_ACTIONS_CHAT_COMMANDS','string':'Chat\x20commands'});case'AI_QUICK_ACTIONS_IMPROVE_WRITING':return t({'id':'AI_QUICK_ACTIONS_IMPROVE_WRITING','string':'Improve\x20writing'});case'AI_QUICK_ACTIONS_CONTINUE_WRITING':return t({'id':'AI_QUICK_ACTIONS_CONTINUE_WRITING','string':'Continue\x20writing'});case'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING':return t({'id':'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING','string':'Fix\x20grammar\x20&\x20spelling'});case'AI_QUICK_ACTIONS_ADJUST_LENGTH':return t({'id':'AI_QUICK_ACTIONS_ADJUST_LENGTH','string':'Adjust\x20length'});case'AI_QUICK_ACTIONS_CHANGE_TONE':return t({'id':'AI_QUICK_ACTIONS_CHANGE_TONE','string':'Change\x20tone'});case'AI_QUICK_ACTIONS_TRANSLATE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE','string':'Translate'});case'AI_QUICK_ACTIONS_EXPLAIN':return t({'id':'AI_QUICK_ACTIONS_EXPLAIN','string':'Explain'});case'AI_QUICK_ACTIONS_SUMMARIZE':return t({'id':'AI_QUICK_ACTIONS_SUMMARIZE','string':'Summarize'});case'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS':return t({'id':'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS','string':'Highlight\x20key\x20points'});case'AI_QUICK_ACTIONS_MAKE_SHORTER':return t({'id':'AI_QUICK_ACTIONS_MAKE_SHORTER','string':'Make\x20shorter'});case'AI_QUICK_ACTIONS_MAKE_LONGER':return t({'id':'AI_QUICK_ACTIONS_MAKE_LONGER','string':'Make\x20longer'});case'AI_QUICK_ACTIONS_MORE_CASUAL':return t({'id':'AI_QUICK_ACTIONS_MORE_CASUAL','string':'More\x20casual'});case'AI_QUICK_ACTIONS_MORE_DIRECT':return t({'id':'AI_QUICK_ACTIONS_MORE_DIRECT','string':'More\x20direct'});case'AI_QUICK_ACTIONS_MORE_FRIENDLY':return t({'id':'AI_QUICK_ACTIONS_MORE_FRIENDLY','string':'More\x20friendly'});case'AI_QUICK_ACTIONS_MORE_CONFIDENT':return t({'id':'AI_QUICK_ACTIONS_MORE_CONFIDENT','string':'More\x20confident'});case'AI_QUICK_ACTIONS_MORE_PROFESSIONAL':return t({'id':'AI_QUICK_ACTIONS_MORE_PROFESSIONAL','string':'More\x20professional'});case'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT':return t({'id':'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT','string':'Adjust\x20based\x20on\x20the\x20rest\x20of\x20the\x20document'});case'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH','string':'English'});case'AI_QUICK_ACTIONS_TRANSLATE_CHINESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_QUICK_ACTIONS_TRANSLATE_FRENCH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_FRENCH','string':'French'});case'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE','string':'Japanese'});case'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE','string':'Portuguese'});case'AI_QUICK_ACTIONS_TRANSLATE_KOREAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_KOREAN','string':'Korean'});case'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN','string':'Italian'});case'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN','string':'Russian'});case'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','string':'%0\x20plugin\x20is\x20required\x20but\x20not\x20found.'},_0x19acdd);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});default:return _0x46d74a;}}function qt(_0x4eca3b,_0x346681,_0x180d80=!0x1,_0x7c9664=!0x0){return()=>{const _0x9b18d1=_0x4eca3b['locale'],_0x3366cf=new _0x21c9df(_0x9b18d1),_0x31c58a=_0x3366cf['bindTemplate'];_0x3366cf['extendTemplate']({'on':{'mouseenter':_0x31c58a['to'](()=>{_0x3366cf['focus']();})}});const _0x53cf1a=_0x346681['icon']??_0x346681['parent']?.['icon'];return _0x3366cf['set']({'label':_0x346681['displayedPrompt'],'withText':_0x180d80,'role':'menuitem','icon':_0x7c9664?_0x53cf1a??_0x3aa5f2:void 0x0,'tooltip':!_0x180d80}),_0x3366cf['on']('execute',()=>{_0x4eca3b['editing']['view']['focus'](),_0x4eca3b['commands']['execute']('aiQuickAction',_0x346681);}),_0x3366cf;};}const qs='menu',ys='menuitem';class io extends _0x2855e5{['_bodyCollection'];['optionsListView'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();constructor(_0x55b082,_0x2a9308,_0x4dd2ff,_0x79b0e){const _0xcfc1f2=_0x55b082['locale'];super(_0xcfc1f2),this['_bodyCollection']=_0x79b0e;const _0x336b5c=this['_createListItems'](_0x55b082,_0x2a9308,_0x4dd2ff);this['optionsListView']=new _0x11ab26(_0xcfc1f2),this['optionsListView']['role']=qs,this['optionsListView']['items']['addMany'](_0x336b5c),this['focusTracker']=new _0x394dab(),this['keystrokes']=new _0x574245(),this['_focusables']=_0x336b5c,this['focusCycler']=new _0x920639({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0xcfc1f2['uiLanguageDirection']},'children':[this['optionsListView']]});}['_createListItems'](_0x575ae1,_0x10b40a,_0x1235fa){const _0x5ce552=new _0x1cd988();return _0x10b40a['forEach'](_0xc49832=>{'actions'in _0xc49832?_0x5ce552['add'](this['_createActionGroupButton'](_0x575ae1,_0xc49832,_0x1235fa)):_0x5ce552['add'](this['_createActionButton'](_0x575ae1,_0xc49832));}),_0x5ce552;}['_createActionButton'](_0xa112b,_0x1e15c1){const _0x6e5870=new _0x522072(this['locale']),_0x54ae50=qt(_0xa112b,_0x1e15c1,!0x0)();return _0x6e5870['children']['add'](_0x54ae50),_0x6e5870;}['_createActionGroupButton'](_0x51c7c3,_0x5a41a6,_0x3879e4){const _0x4bb941=new _0x522072(this['locale']),_0x29c421=new _0x60226e(this['locale']),_0x2257b1=_0x29c421['bindTemplate'],_0x34d7b5='rtl'===_0x3879e4['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft',_0x1fc651=this['_createGroupActionsList'](_0x51c7c3,_0x5a41a6['actions'],_0x3879e4);_0x29c421['set']({'label':_0x5a41a6['label'],'withText':!0x0,'role':ys,'icon':_0x5a41a6['icon']??_0x3aa5f2}),_0x29c421['extendTemplate']({'on':{'mouseenter':_0x2257b1['to'](()=>{_0x29c421['focus']();})}});const _0xda317d=new _0x2b3342(this['locale']);return _0xda317d['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x2257b1['to'](_0x13aba6=>{_0x13aba6['key']==_0x34d7b5&&(_0x29c421['focus'](),this['_hideNestedPanel'](_0xda317d));})}}),_0x29c421['bind']('isOn')['to'](_0xda317d,'isVisible'),this['_bodyCollection']['add'](_0xda317d),_0xda317d['content']['add'](_0x1fc651),this['_setupGroupMenuBehavior'](_0x29c421,_0xda317d),_0x4bb941['children']['add'](_0x29c421),_0x4bb941;}['_createGroupActionsList'](_0xcf08c9,_0x4ffea2,_0xf733f6){const _0x1c7538=new _0x11ab26(this['locale']);return _0x1c7538['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x4ffea2['forEach'](_0x18ade5=>{const _0x5c876c=new _0x522072(this['locale']),_0x25930b=qt(_0xcf08c9,_0x18ade5,!0x0,!0x1)();_0x5c876c['children']['add'](_0x25930b),_0xf733f6['focusTracker']['add'](_0x25930b),_0x1c7538['items']['add'](_0x5c876c);}),_0x1c7538;}['_setupGroupMenuBehavior'](_0x5933e6,_0x16ec75){const _0x6eaf67=_0x5933e6['bindTemplate'],_0x1ea48e='rtl'===_0x5933e6['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';_0x5933e6['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x6eaf67['to'](()=>{this['_showNestedPanel'](_0x16ec75,_0x5933e6);}),'mouseleave':_0x6eaf67['to'](_0x3d235e=>{const _0x20781c=_0x3d235e['relatedTarget'];this['_isMovingToNestedMenu'](_0x20781c,_0x16ec75)||this['_hideNestedPanel'](_0x16ec75);}),'keydown':_0x6eaf67['to'](_0x10af19=>{_0x10af19['key']==_0x1ea48e&&(this['_showNestedPanel'](_0x16ec75,_0x5933e6),_0x16ec75['content']['get'](0x0)['focus']());})}}),_0x16ec75['on']('render',()=>{_0x16ec75['element']?.['addEventListener']('mouseleave',_0x17be01=>{const _0x3ee8da=_0x17be01['relatedTarget'];_0x5933e6['element']?.['contains'](_0x3ee8da)||this['_isMovingToNestedMenu'](_0x3ee8da,_0x16ec75)||this['_hideNestedPanel'](_0x16ec75);});});}['_showNestedPanel'](_0x324997,_0xf48af9){this['_openNestedPanels']['forEach'](_0x497a5b=>{_0x497a5b!==_0x324997&&_0x497a5b['isVisible']&&_0x497a5b['hide']();}),_0x324997['show'](),_0x324997['pin']({'positions':[_0x14a127['eastSouth']],'target':_0xf48af9['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x324997);}['_hideNestedPanel'](_0xac04e0){_0xac04e0['hide'](),this['_openNestedPanels']['delete'](_0xac04e0);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x26ae7a=>_0x26ae7a['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x504ff9,_0x5d3f7f){if(!_0x504ff9)return!0x1;if(_0x5d3f7f['element']?.['contains'](_0x504ff9))return!0x0;const _0x42cbeb=_0x504ff9;return _0x42cbeb['closest']&&(null!==_0x42cbeb['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x42cbeb['closest']('.ck-ai-quick-actions-group-list')||null!==_0x42cbeb['closest']('.ck-ai-quick-actions-group-button'));}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['optionsListView']['focus']();}}function Yt(_0x1c63c1,_0x35eaa6,_0x21cfa4,_0x2b136c){return()=>{const _0x58ae92=_0x1c63c1['locale'],_0x42ccda=_0x372e42(_0x58ae92);_0x42ccda['buttonView']['set']({'icon':_0x21cfa4['icon']??_0x3aa5f2,'label':_0x21cfa4['label'],'tooltip':!0x0}),_0x42ccda['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x1dc889=new io(_0x1c63c1,_0x35eaa6,_0x42ccda,_0x2b136c);return _0x42ccda['panelView']['children']['add'](_0x1dc889),_0x42ccda;};}const zt='<task>For\x20given\x20selected\x20part\x20of\x20HTML\x20document\x20you\x20must\x20explain\x20the\x20meaning\x20of\x20it\x27s\x20content\x20clearly\x20and\x20in\x20plain\x20language.</task><rules>1.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is:-\x20If\x20it\x20looks\x20like\x20a\x20definition\x20explain\x20the\x20concept\x20in\x20simple\x20terms.-\x20If\x20it\x20looks\x20like\x20a\x20description\x20clarify\x20what\x20it\x20is\x20describing\x20and\x20why\x20it\x20matters.-\x20If\x20it\x20contains\x20technical\x20terms\x20or\x20jargon\x20break\x20them\x20down\x20into\x20everyday\x20language.-\x20If\x20it\x20looks\x20instructional\x20restate\x20as\x20clear\x20steps\x20someone\x20can\x20follow.-\x20If\x20it\x20provides\x20examples\x20explain\x20what\x20the\x20example\x20shows\x20and\x20why\x20it\x27s\x20relevant.-\x20If\x20it\x20presents\x20an\x20argument\x20or\x20claim\x20restate\x20the\x20claim\x20neutrally\x20and\x20explain\x20its\x20purpose.-\x20If\x20it\x20is\x20narrative/story-like\x20explain\x20what\x20event\x20or\x20situation\x20is\x20being\x20described.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20explain\x20what\x20the\x20data\x20indicates.-\x20If\x20it\x20is\x20a\x20quotation\x20explain\x20the\x20meaning\x20of\x20the\x20quote\x20in\x20context.-\x20If\x20it\x20compares/contrasts\x20things\x20explain\x20the\x20key\x20differences\x20or\x20similarities\x20simply.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20give\x20a\x20clear,\x20plain-language\x20explanation\x20of\x20its\x20meaning,\x20focusing\x20on\x20usefulness.2.\x20Provide\x20context\x20if\x20the\x20meaning\x20could\x20be\x20unclear\x20without\x20it.\x20(e.g.,\x20explain\x20where\x20such\x20a\x20term\x20might\x20be\x20used,\x20or\x20why\x20it\x20is\x20important).3.\x20Keep\x20the\x20explanation\x20short\x20but\x20complete\x20(2–5\x20sentences).Avoid\x20overly\x20technical\x20detail\x20unless\x20it\x20is\x20necessary\x20for\x20understanding.4.\x20Do\x20not\x20simply\x20repeat\x20the\x20original\x20text\x20—\x20restate\x20and\x20expand\x20it\x20in\x20plain\x20words.5.\x20If\x20possible,\x20add\x20a\x20short\x20example\x20or\x20analogy\x20to\x20make\x20it\x20easier\x20to\x20understand.6.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20explanation.7.\x20Your\x20explanation\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20explanation.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',Wt='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20summarize\x20its\x20content\x20in\x20a\x20few\x20sentences,\x20keeping\x20only\x20the\x20essential\x20meaning.</task><rules>1.\x20Your\x20summary\x20should\x20be\x20short\x20and\x20clear:-\x20Aim\x20for\x202–4\x20sentences\x20unless\x20the\x20text\x20is\x20extremely\x20short.-\x20Focus\x20on\x20capturing\x20the\x20main\x20idea(s)\x20without\x20unnecessary\x20detail.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20summary\x20style:-\x20If\x20it\x20is\x20descriptive\x20condense\x20the\x20description\x20into\x20its\x20core\x20idea.-\x20If\x20it\x20is\x20argumentative\x20or\x20opinion-based\x20summarize\x20the\x20main\x20claim\x20and\x20reasoning\x20neutrally.-\x20If\x20it\x20is\x20narrative/story-like\x20capture\x20the\x20main\x20event\x20or\x20outcome\x20without\x20side\x20details.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20summarize\x20what\x20the\x20data\x20shows\x20in\x20plain\x20language.-\x20If\x20it\x20is\x20instructional\x20restate\x20the\x20overall\x20purpose\x20of\x20the\x20steps\x20without\x20listing\x20every\x20step.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20provide\x20a\x20general\x20concise\x20summary.3.\x20Provide\x20context\x20if\x20necessary\x20for\x20clarity:-\x20Mention\x20the\x20subject\x20or\x20topic\x20explicitly\x20so\x20the\x20summary\x20can\x20stand\x20alone.4.\x20Do\x20not\x20simply\x20copy\x20sentences\x20from\x20the\x20original\x20text\x20—\x20rephrase\x20in\x20plain\x20language.5.\x20Avoid\x20adding\x20new\x20information\x20or\x20interpretation\x20not\x20present\x20in\x20the\x20text.6.\x20Summarize\x20in\x20a\x20way\x20that\x20would\x20make\x20sense\x20to\x20someone\x20who\x20has\x20not\x20read\x20the\x20original\x20text.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20summary.8.\x20Your\x20summary\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20summary.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',Jt='<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 oi=function(_0x268fc4){return _0x268fc4['CHAT']='CHAT',_0x268fc4['ACTION']='ACTION',_0x268fc4['REVIEW']='REVIEW',_0x268fc4;}({}),ma=function(_0x55d4f9){return _0x55d4f9['CHAT']='AIChat',_0x55d4f9['ACTION']='AIActions',_0x55d4f9['REVIEW']='AIReviewMode',_0x55d4f9;}({});class ii extends _0x7bae57{static get['requires'](){return[Ft];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_prepareQuickActionsDefinition'](this['_getDefaultAndCustomActions']()),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x5d6374){return function(_0x193560){const _0x3ce190=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x193560['uiLanguage']),_0xde2ffa=_0x3ce190||'English',_0x477888=[{'id':'ask-ai','displayedPrompt':i(_0x193560,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Qt},{'id':'chat-commands','label':i(_0x193560,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Ut,'actions':[{'id':'explain','displayedPrompt':i(_0x193560,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':zt['replace']('%0',_0xde2ffa),'type':'CHAT'},{'id':'summarize','displayedPrompt':i(_0x193560,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Wt['replace']('%0',_0xde2ffa),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':i(_0x193560,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Jt['replace']('%0',_0xde2ffa),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':i(_0x193560,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Mt},{'id':'continue','displayedPrompt':i(_0x193560,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':bt},{'id':'fix-grammar','displayedPrompt':i(_0x193560,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Kt},{'id':'adjust-length','label':i(_0x193560,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Nt,'actions':[{'id':'make-shorter','displayedPrompt':i(_0x193560,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':i(_0x193560,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':i(_0x193560,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Ot,'actions':[{'id':'make-tone-casual','displayedPrompt':i(_0x193560,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':i(_0x193560,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':i(_0x193560,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':i(_0x193560,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':i(_0x193560,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':i(_0x193560,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Dt,'actions':[{'id':'translate-to-english','displayedPrompt':i(_0x193560,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':i(_0x193560,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-french','displayedPrompt':i(_0x193560,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':i(_0x193560,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':i(_0x193560,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':i(_0x193560,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':i(_0x193560,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':i(_0x193560,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':i(_0x193560,'AI_QUICK_ACTIONS_OTHER'),'icon':Lt,'actions':[]}];return _0x477888;}(_0x5d6374);}['_getDefaultAndCustomActions'](){const _0x37570a=ii['getDefaultQuickActions'](this['editor']['locale']),_0x3b523f=(this['editor']['config']['get']('ai.quickActions.extraCommands')||[])['map'](_0x51f265=>({..._0x51f265,'icon':void 0x0}));return _0x37570a['find'](_0x2f1566=>'other'===_0x2f1566['id'])['actions']['push'](..._0x3b523f),_0x37570a;}['_initializeQuickActionsComponentsAndCommands'](){const _0x2849c7=new Gt(this['editor']['locale']);_0x2849c7['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x2849c7),this['_initializeQuickActionsComponents'](_0x2849c7);}['_initializeQuickActionsDropdown'](_0x25681c){this['editor']['ui']['componentFactory']['add']('aiQuickActions',Yt(this['editor'],this['_quickActionsDefinition'],{'icon':_0x3aa5f2,'label':i(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},_0x25681c));}['_prepareQuickActionsDefinition'](_0x41b4b1){this['_quickActionsDefinition']=_0x41b4b1['map'](_0xa91640=>{if('actions'in _0xa91640){const _0xcaea38=_0xa91640;return{..._0xcaea38,'actions':_0xcaea38['actions']['map'](_0x290723=>{const {actions:_0x2bce31,..._0x28c619}=_0xcaea38;return{..._0x290723,'parent':_0x28c619};})['filter'](_0x5de9f6=>this['_shouldIncludeAction'](_0x5de9f6))};}return _0xa91640;})['filter'](_0x129bda=>'actions'in _0x129bda?_0x129bda['actions']['length']>0x0:this['_shouldIncludeAction'](_0x129bda));}['_shouldIncludeAction'](_0x354cac){const _0x157c74=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](ma[_0x354cac['type']])&&!_0x157c74['includes'](_0x354cac['id']);}['_initializeQuickActionsComponents'](_0x6ec199){this['_quickActionsDefinition']['forEach'](_0x4f96d1=>{if('actions'in _0x4f96d1){const _0x325ee7=Yt(this['editor'],_0x4f96d1['actions'],_0x4f96d1,_0x6ec199);this['editor']['ui']['componentFactory']['add'](_0x4f96d1['id'],_0x325ee7),_0x4f96d1['actions']['forEach'](_0x443f91=>{const _0x4e7e44=qt(this['editor'],_0x443f91);this['editor']['ui']['componentFactory']['add'](_0x443f91['id'],_0x4e7e44);});}else{const _0x5c0f35=qt(this['editor'],_0x4f96d1);this['editor']['ui']['componentFactory']['add'](_0x4f96d1['id'],_0x5c0f35);}});}}class ci extends _0x5c5b2b{['execute'](_0x2978c5){switch(_0x2978c5['type']){case oi['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x430acb=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x1cd47d('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x430acb});}this['_handleAIChatAction'](_0x2978c5);break;case oi['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x7d6a4a=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x1cd47d('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x7d6a4a});}this['_handleAIActionsAction'](_0x2978c5);break;case oi['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x158abb=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x1cd47d('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x158abb});}this['_handleAIReviewAction'](_0x2978c5);}}async['_handleAIChatAction'](_0x4c2f42){const _0x41f11d=this['editor']['plugins']['get']('AIChat'),_0x212ade=this['editor']['plugins']['get']('AIChatController');if(this['editor']['plugins']['get']('AITabs')['view']['activateTab']('chat'),'ask-ai'===_0x4c2f42['id'])_0x212ade['removeSelectionFromChatContext'](),this['_expandSelectionIfCollapsed'](),await _0x41f11d['addSelectionToChatContext'](),_0x41f11d['focusPromptInput']();else await _0x41f11d['startConversation'](),await _0x41f11d['addSelectionToChatContext'](),await _0x41f11d['sendMessage']({'message':_0x4c2f42['prompt']||_0x4c2f42['displayedPrompt'],'quickActionData':{'id':_0x4c2f42['id'],'displayedPrompt':_0x4c2f42['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x3f6dfa=this['editor'],_0x236f03=_0x3f6dfa['model']['document']['selection'];if(!_0x236f03['isCollapsed'])return;const _0x2e9b7d=_0x478320(_0x236f03['getSelectedBlocks']())||_0x3f6dfa['model']['schema']['getLimitElement'](_0x236f03);_0x3f6dfa['model']['change'](_0x3adce6=>{_0x3adce6['setSelection'](_0x2e9b7d,'in');});}async['_handleAIActionsAction'](_0x30fb82){const _0x163590=this['editor']['plugins']['get']('AIActions'),_0x545cca=_0x30fb82['prompt']?{'userMessage':_0x30fb82['prompt'],'model':_0x30fb82['model']}:{'actionName':_0x30fb82['actionName']||_0x30fb82['id'],'args':_0x30fb82['args']};await _0x163590['executeAction'](_0x545cca,_0x30fb82['displayedPrompt'],_0x30fb82['icon']);}async['_handleAIReviewAction'](_0xe7093e){console['log']('handleAIReviewAction',_0xe7093e);}}class ti extends _0x7bae57{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x213306=this['editor'],_0x54780c=new ci(this['editor']);if(_0x213306['commands']['add']('aiQuickAction',_0x54780c),_0x213306['plugins']['has']('AIChat')){const _0x443cbb=this['editor']['plugins']['get']('AIChat');_0x213306['model']['document']['selection']['on']('change:range',(_0x4377c9,_0x514889)=>{_0x514889['directChange']&&_0x443cbb['removeSelectionFromChatContext']();});}}}class pa extends _0x7bae57{static get['requires'](){return[ii,ti];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4c568f){super(_0x4c568f),_0x4c568f['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[]});}}class de extends fi{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),this['parsedContent']['children']['length']>0x0){const _0x1378e9=[];for(const _0x1cdf3d of this['parsedContent']['children'])if(_0x1d4fa0(_0x1cdf3d)){const _0x552b85=ft(_0x1cdf3d,'data-id');_0x552b85&&_0x1378e9['push']({'node':_0x1cdf3d,'type':'modified','id':_0x552b85});}_0x1378e9['length']>0x0?this['changeGroups']=[{'changes':_0x1378e9,'state':'pending','index':0x0}]:this['changeGroups']=[{'changes':[{'node':this['parsedContent']['children'][0x0],'type':'modified','id':'ai-actions-content'}],'state':'pending','index':0x0}];}else this['changeGroups']=[];}}class F extends he{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];constructor(_0x434940){super(_0x434940),this['content']=_0x434940['content'],this['version']=_0x434940['version'],this['actionName']=_0x434940['actionName'],this['args']=_0x434940['args'],this['userMessage']=_0x434940['userMessage'],this['model']=_0x434940['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':ue['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x168104){const _0x3e8e35=new de({'editor':this['editor'],'documentContextContent':this['content'],..._0x168104});return this['replies']['push'](_0x3e8e35),_0x3e8e35['delegate'](...me)['to'](this),this['fire']('replyCreated',_0x3e8e35),_0x3e8e35;}}class Ta extends _0x7bae57{static get['requires'](){return[N,_0x378cc4,O,G,_0x49b43e];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_previousInteractions']=[];['_currentInteractionParams'];['_balloonShowDiff']=!0x1;['_customViews']=new _0x1cd988();['_promiseQueue'];constructor(_0x2d655b){super(_0x2d655b),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new Q(),this['_setupCustomViews']();}['stopInteraction'](){this['_stopInteraction']();}get['previousInteractions'](){return this['_previousInteractions'];}async['executeAction'](_0x135048,_0x4f4a93,_0x5bb550){if(this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']())return this['_executeActionOnTable'](_0x135048,_0x4f4a93,_0x5bb550);}return this['_executeActionRegular'](_0x135048,_0x4f4a93,_0x5bb550);}['_executeActionRegular'](_0x5eada2,_0x233811,_0x122a0b){const _0x671b0b=this['editor']['plugins']['get'](O),_0x56f141=this['editor']['plugins']['get'](G),_0x36e49d=this['editor']['model']['document']['selection'];if(_0x36e49d['isCollapsed']){const _0x243709=_0x478320(_0x36e49d['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x36e49d);this['editor']['model']['change'](_0x484d07=>{_0x484d07['setSelection'](_0x243709,'in');});}const _0x2b2eaf=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x36e49d),_0x36e49d),_0x22df0f=_0x671b0b['modelToViewWithIds'](_0x2b2eaf),_0x174ab8=this['editor']['data']['processor']['toData'](_0x22df0f),_0x287856=this['editor']['model']['document']['version'],_0x26882e=[..._0x36e49d['getRanges']()],_0x2811f6=new R(this['editor']['locale'],{'showDiff':!0x1,'areActionsDisabled':!0x1,'hideHeader':!0x0,'showLoader':!0x0,'miniToolbarConfig':{'showChanges':'icon','customView':this['_customViews']}});_0x56f141['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x233811,'icon':_0x122a0b||_0x3aa5f2,'mainView':_0x2811f6,'showRotator':!0x1,'showApplyButton':!0x0,'showSuggestButton':!0x0,'ranges':_0x26882e}),this['_setLoadingState'](_0x2811f6,_0x56f141);const _0x1e3584=_0x36e49d['getFirstPosition']();return this['listenTo'](_0x56f141,'applySuggestion',()=>{this['_applySuggestion'](_0x1e3584);}),this['listenTo'](_0x56f141,'insertSuggestion',()=>{this['_insertSuggestion'](_0x1e3584);}),this['listenTo'](_0x56f141,'dialogClosed',()=>{this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](_0x56f141);}),this['_createInteraction'](_0x174ab8,_0x287856,_0x2811f6,_0x56f141,_0x5eada2);}['_executeActionOnTable'](_0x5a5700,_0x3e3f30,_0x5a6262){const _0x43fee5=this['editor']['plugins']['get'](O),_0x4eac72=this['editor']['plugins']['get'](G),_0x1ee904=this['editor']['model']['document']['selection'],_0x213d05=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x1a4755=_0x43fee5['modelToViewWithIds'](_0x213d05),_0x203a3c=this['editor']['data']['processor']['toData'](_0x1a4755),_0x3d2741=this['editor']['model']['document']['version'],_0x704f2=[..._0x1ee904['getRanges']()],_0x308710=new R(this['editor']['locale'],{'showDiff':!0x1,'areActionsDisabled':!0x1,'hideHeader':!0x0,'showLoader':!0x0,'miniToolbarConfig':{'showChanges':'icon','customView':this['_customViews']}});_0x4eac72['open']({'index':0x0,'title':_0x3e3f30,'icon':_0x5a6262||_0x3aa5f2,'mainView':_0x308710,'showRotator':!0x1,'showApplyButton':!0x0,'showSuggestButton':!0x0,'ranges':_0x704f2}),this['_setLoadingState'](_0x308710,_0x4eac72);const _0x1492a7=_0x1ee904['getFirstPosition']();return this['listenTo'](_0x4eac72,'applySuggestion',()=>{this['_applySuggestion'](_0x1492a7);}),this['listenTo'](_0x4eac72,'insertSuggestion',()=>{this['_insertSuggestion'](_0x1492a7);}),this['listenTo'](_0x4eac72,'dialogClosed',()=>{this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['stopListening'](_0x4eac72);}),this['_createInteraction'](_0x203a3c,_0x3d2741,_0x308710,_0x4eac72,_0x5a5700);}['_wrapWithCommonAncestors'](_0x1389a2,_0x308b08){const _0x57856a=_0x308b08['getFirstRange']()['getCommonAncestor'](),_0x3ac64a=_0x57856a['is']('documentFragment')?[]:_0x57856a['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x3ac64a['length']){const _0x29b451=_0x3ac64a['map'](_0x21c5fc=>_0x21c5fc['_clone'](!0x1));for(let _0x1dc9e4=0x1;_0x1dc9e4<_0x29b451['length'];_0x1dc9e4++)_0x29b451[_0x1dc9e4-0x1]['_appendChild'](_0x29b451[_0x1dc9e4]);return _0x29b451[_0x29b451['length']-0x1]['_appendChild'](_0x1389a2),new _0x2ffe67(_0x29b451[0x0]);}return _0x1389a2;}async['_createInteraction'](_0x2c91a1,_0x3b4e9e,_0xe37aca,_0x30f744,_0x1826bd){const _0x8d1c87=this['editor'];this['_currentInteractionParams']={'action':_0x1826bd,'content':_0x2c91a1,'version':_0x3b4e9e,'mainView':_0xe37aca,'aiBalloon':_0x30f744},this['_interaction']=new F({'connector':this['_aiConnector'],'editor':_0x8d1c87,'content':_0x2c91a1,'version':_0x3b4e9e,..._0x1826bd});const _0x5affb3=(_0x47a64e,_0x4afbc9,_0x20ec3e=!0x1,_0xbb0f61='streaming')=>this['_promiseQueue']['enqueue'](async _0x28967f=>{try{const _0x3ef834=Y({'editor':_0x8d1c87,'changeGroups':_0x47a64e['changeGroups'],'documentContextContent':_0x47a64e['documentContextContent'],'showDiff':_0x20ec3e,'trimUnchanged':!0x1});await _0x4afbc9['updateContent']({'parts':_0x3ef834,'renderingStrategy':_0xbb0f61,'abortSignal':_0x28967f});}catch(_0x564b6c){if(this['_isAbortError'](_0x564b6c))return;throw _0x564b6c;}});this['_interaction']['on']('replyCreated',(_0x884510,_0x100c20)=>{_0xe37aca['hideLoader'](),_0x5affb3(_0x100c20,_0xe37aca)['catch'](_0x276d8c=>{this['_isAbortError'](_0x276d8c)||console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x276d8c);});}),this['_interaction']['on']('replyContentUpdated',(_0xa237e1,_0xa84f10)=>{_0x5affb3(_0xa84f10,_0xe37aca)['catch'](_0x465760=>{this['_isAbortError'](_0x465760)||console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x465760);});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](_0xe37aca,_0x30f744);}catch(_0x5ab33b){this['_isAbortError'](_0x5ab33b)||console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x5ab33b);}}),this['listenTo'](_0xe37aca,'toggleSuggestionDisplayMode',(_0x7c01d3,{showDiff:_0x244b2b})=>{this['_balloonShowDiff']=_0x244b2b;const _0x3057a0=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x3057a0&&_0x5affb3(_0x3057a0,_0xe37aca,_0x244b2b,'static')['catch'](_0x64b44=>{this['_isAbortError'](_0x64b44)||console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x64b44);});}),this['_setLoadingState'](_0xe37aca,_0x30f744);try{return await this['_interaction']['start']();}catch(_0x42bf4b){if(this['_isAbortError'](_0x42bf4b))return;throw _0x42bf4b;}}['_insertSuggestion'](_0x214852){const _0x57500b=this['editor'],_0x2523de=this['editor']['plugins']['get'](_0x49b43e),_0x5a7fe9=this['_interaction'],_0x579934=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x1c7de0=_0x579934['changeGroups'],_0x135526=J({'editor':_0x57500b,'reply':_0x579934,'interaction':_0x5a7fe9,'groups':_0x1c7de0,'transform':!0x1,'documentCompare':_0x2523de,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});for(const _0x1d97bd of _0x135526)this['_anchorOperation'](_0x214852,_0x1d97bd);const _0x59619c=_0x5a7fe9['getDocumentContext']()['version'],_0x8d8f80=_0x57500b['model']['document']['history']['getOperations'](_0x59619c),_0x131220={'document':_0x57500b['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x28bb92=tt(_0x135526,_0x8d8f80,_0x131220)['operationsA'];_0x57500b['model']['change'](_0x554e45=>{_0x554e45['setSelection'](_0x57500b['model']['document']['selection']['focus']),_0x57500b['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x28bb92);}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_applySuggestion'](_0x5a9e4d){const _0x46333d=this['editor'],_0x36ccf3=this['editor']['plugins']['get'](_0x49b43e),_0x5d069a=this['_interaction'],_0x278380=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x41288f=_0x278380['changeGroups'],_0x5c3398=J({'editor':_0x46333d,'reply':_0x278380,'interaction':_0x5d069a,'groups':_0x41288f,'transform':!0x1,'documentCompare':_0x36ccf3,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});for(const _0xd81272 of _0x5c3398)this['_anchorOperation'](_0x5a9e4d,_0xd81272);const _0x64742c=_0x5d069a['getDocumentContext']()['version'],_0x5cb843=_0x46333d['model']['document']['history']['getOperations'](_0x64742c),_0x362f6d={'document':_0x46333d['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x1dc33b=tt(_0x5c3398,_0x5cb843,_0x362f6d)['operationsA'];_0x46333d['model']['change'](_0x470a81=>{_0x470a81['setSelection'](_0x46333d['model']['document']['selection']['focus']);for(const _0x1065d8 of _0x1dc33b)_0x1065d8['baseVersion']=_0x46333d['model']['document']['version'],_0x470a81['batch']['addOperation'](_0x1065d8),_0x46333d['model']['applyOperation'](_0x1065d8);}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_anchorOperation'](_0x4b1d60,_0x52610b){for(const _0x433e04 in _0x52610b){const _0x12bc76=_0x52610b[_0x433e04];_0x12bc76 instanceof _0x27581?_0x52610b[_0x433e04]=new _0x27581(_0x52e93f(_0x12bc76['start']),_0x52e93f(_0x12bc76['end'])):_0x12bc76 instanceof _0x5764e0&&(_0x52610b[_0x433e04]=_0x52e93f(_0x12bc76));}function _0x52e93f(_0x3f4b4d){if(_0x3f4b4d['root']!=_0x4b1d60['root'])return _0x3f4b4d;const _0x4a85a9=_0x3f4b4d['path']['slice']();for(let _0x416ff5=0x0;_0x416ff5<_0x4b1d60['path']['length']&&_0x416ff5<_0x4a85a9['length'];_0x416ff5++){const _0x286c12=0x0!=_0x4a85a9[_0x416ff5];if(_0x4a85a9[_0x416ff5]+=_0x4b1d60['path'][_0x416ff5],_0x286c12)break;}return new _0x5764e0(_0x3f4b4d['root'],_0x4a85a9,_0x3f4b4d['stickiness']);}}['_refreshInteraction'](){if(!this['_currentInteractionParams'])return void console['warn']('No\x20current\x20interaction\x20to\x20refresh');this['_interaction']&&(this['_previousInteractions']['push'](this['_interaction']),this['_stopInteraction']());const {action:_0x2cafaa,content:_0x591c14,version:_0x3462c2,mainView:_0x332d3f,aiBalloon:_0x2a442b}=this['_currentInteractionParams'];this['_clearSuggestionContent'](_0x332d3f),_0x332d3f['showLoader'](),this['_createInteraction'](_0x591c14,_0x3462c2,_0x332d3f,_0x2a442b,_0x2cafaa)['catch'](_0x205d64=>{this['_isAbortError'](_0x205d64)||console['error']('Error\x20refreshing\x20interaction:',_0x205d64);});}['_clearSuggestionContent'](_0x29d340){const _0x5d851c=_0x29d340['bodyView']['_children'];for(;_0x5d851c['length']>0x0;)_0x5d851c['remove'](_0x5d851c['first']);_0x29d340['bodyView']['hasPendingParts']=!0x1;}['_isAbortError'](_0x1ba715){return!!_0x1ba715['message']&&_0x1ba715['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_previousInteractions']=[],this['_currentInteractionParams']=void 0x0;}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1;}['_setupCustomViews'](){const _0x160bc9=new _0x21c9df(this['editor']['locale']);_0x160bc9['set']({'icon':_0x42a35d,'label':Gn(this['editor']['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x160bc9['bind']('isEnabled')['to'](this,'isBusy',_0x309621=>!_0x309621),_0x160bc9['on']('execute',()=>{this['_refreshInteraction']();}),this['_customViews']['add'](_0x160bc9);}['_setLoadingState'](_0x5dd651,_0x20e205){_0x5dd651['setLoading'](),_0x20e205['balloonView']['setLoading'](),this['isBusy']=!0x0;}async['_clearLoadingState'](_0x3e921e,_0x1ec52f){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,_0x3e921e['clearLoading'](),_0x1ec52f['balloonView']['clearLoading']();}}class vs{['id'];['title'];['description'];['isParameterized'];['useArgs'];['options'];constructor({id:_0x44af5c,title:_0x114542,description:_0x33fd35,isParameterized:_0x12e976,useArgs:_0x1e2baa,options:_0x1042f5}){this['id']=_0x44af5c,this['title']=_0x114542,this['description']=_0x33fd35,this['isParameterized']=_0x12e976,this['useArgs']=_0x1e2baa,this['options']=_0x1042f5;}}class kr extends vs{['_models']=[];get['models'](){return this['_models'];}set['models'](_0x36c4b2){this['_models']=_0x36c4b2;}}class ei extends _0x12a324(){['_checks'];constructor(_0xad67b6){super(),this['_checks']=this['_mapCheckDefinitions'](_0xad67b6);}get['checks'](){return this['_checks'];}['getCheckById'](_0xfebb2d){return this['checks']['find'](_0x1b8242=>_0x1b8242['id']===_0xfebb2d);}['_mapCheckDefinitions'](_0xb4a2c5){return _0xb4a2c5['map'](_0x206dd8=>'custom'===_0x206dd8['id']?new kr(_0x206dd8):new vs(_0x206dd8));}}class Rs extends _0x595595(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x4a0ecf,contentNew:_0x438f98,contentInitial:_0x4e0cc1,documentVersion:_0x1c07c4}){super(),this['id']=_0x4a0ecf,this['contentNew']=_0x438f98,this['contentInitial']=_0x4e0cc1,this['documentVersion']=_0x1c07c4;}}class Cs extends _0x12a324(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x136d31,_0x76cc05,_0x305816){super(),this['id']=_0x136d31,this['parent']=_0x305816,this['_data']=_0x76cc05,this['set']('status','active');}get['contentDiffed'](){return this['_data']['context']();}get['operations'](){return this['_data']['operations'];}get['operationsIsolated'](){return this['_data']['operationsIsolated'];}}class pr extends _0x12a324(){['id']=_0x91fc81();['_results']=new Map();['_changes']=[];['_documentData'];['_sourceCheck'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];constructor(_0x2be8d8,_0xbaf16d,_0x1b71ef,_0x49641c,_0x1b3569){super(),this['_documentData']=_0x2be8d8,this['_sourceCheck']=_0xbaf16d,this['_aiConnector']=_0x1b71ef,this['_reviewParams']=_0x49641c,this['_reviewArgs']=_0x1b3569,this['on']('change:status',(_0x52d869,_0x2ec41f,_0x477f67)=>{this['fire']('reviewCheckRunUpdated',{'status':_0x477f67,'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'];}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x59bf97=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x45a9de of _0x59bf97)'unmodified'!==_0x45a9de['data']['operation']&&('error'!==_0x45a9de['data']['operation']?this['_addReviewCheckResult'](_0x45a9de['data']['dataId'],_0x45a9de['data']['textDelta']):this['status']='error-chunk');'error-chunk'!==this['status']&&(this['status']='ready');}catch(_0x2a15a6){this['_currentError']=_0x2a15a6,_0x2a15a6 instanceof Error&&_0x2a15a6['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'](_0x2513cb,_0x3b0be4){const _0x116562=this['_results']['get'](_0x2513cb);if(!_0x116562)return;const _0x824a34=[];_0x3b0be4['forEach']((_0x260cfb,_0x39c9ee)=>{const _0x1c9083=new Cs(_0x116562['id']+'-'+_0x39c9ee,_0x260cfb,_0x116562);_0x1c9083['on']('change:status',()=>{'accepted'===_0x1c9083['status']?this['fire']('reviewCheckResultAccepted',{'change':_0x1c9083}):'rejected'===_0x1c9083['status']&&this['fire']('reviewCheckResultRejected',{'change':_0x1c9083});}),this['_changes']['push'](_0x1c9083),_0x824a34['push'](_0x1c9083);}),this['fire']('reviewCheckResultReady',{'changes':_0x824a34,'result':_0x116562,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x3ee226){const _0x21b514=this['_changes']['find'](_0xd88b2a=>_0xd88b2a['id']===_0x3ee226);return!(!_0x21b514||'active'!==_0x21b514['status']);}['getActiveChanges'](){return this['_changes']['filter'](_0x2b442b=>'active'===_0x2b442b['status']);}['markAllChangesAsAccepted'](){for(const _0x40220a of this['_changes'])'active'===_0x40220a['status']&&(_0x40220a['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x5dc320){const _0x2ac34e=this['_changes']['find'](_0x4adfdd=>_0x4adfdd['id']===_0x5dc320);_0x2ac34e&&'active'===_0x2ac34e['status']&&(_0x2ac34e['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x5a3e04){const _0x4edbb9=this['_changes']['find'](_0x31d52c=>_0x31d52c['id']===_0x5a3e04);_0x4edbb9&&'active'===_0x4edbb9['status']&&(_0x4edbb9['status']='rejected'),this['_checkIfFinished']();}['forceReadyState'](){this['status']='ready';}['_addReviewCheckResult'](_0x4b2bd5,_0x3b0718){const _0x53f85c=this['_documentData']['elements']['get'](_0x4b2bd5);if(!_0x53f85c)return;const _0x51ba63=_0x53f85c['getContent']();if(_0x51ba63===_0x3b0718)return;const _0x924835=new Rs({'id':_0x4b2bd5,'contentInitial':_0x51ba63,'contentNew':_0x3b0718,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x924835['id'],_0x924835),this['fire']('reviewCheckResultAdded',{'result':_0x924835,'source':this});}['_checkIfFinished'](){if('ready'!==this['status'])return;0x0===this['_changes']['filter'](_0xa852f5=>'active'===_0xa852f5['status'])['length']&&(this['status']='finished');}['_createApiRequest'](){throw new Error('Not\x20implemented.');}}class hi extends pr{get['title'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs'])return this['_sourceCheck']['title'];const _0x443387=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x3a4518=0x0;_0x3a4518<this['_reviewParams']['length'];_0x3a4518++){if(!this['_reviewParams'][_0x3a4518]||!this['_sourceCheck']['options'][_0x3a4518])continue;const _0x18fc12=this['_sourceCheck']['options'][_0x3a4518],_0x150e11=_0x18fc12['data']?.['find'](_0x3c0f13=>_0x3c0f13['id']===this['_reviewParams'][_0x3a4518]);_0x150e11&&_0x443387['push'](_0x150e11['label']);}return this['_sourceCheck']['title']+':\x20'+_0x443387['join'](',\x20');}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['id']:[this['_sourceCheck']['id'],...this['_reviewParams']]['join']('-');}}class ri extends pr{['_prompt'];['_model'];constructor(_0x8dadc5,_0x419f63,_0x46b58e,_0x1960b8,_0x161537){super(_0x46b58e,_0x1960b8,_0x161537),this['_prompt']=_0x8dadc5,this['_model']=_0x419f63;}get['title'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}}class ni extends _0x595595(){['_modelList']=[];['_connector'];constructor({connector:_0x36cdce}){super(),this['_connector']=_0x36cdce;}async['getAll'](){if(!this['_modelList']['length'])try{const _0x3d71d2=this['_connector']['getModels'](),_0x326b33=await _0x3d71d2['list']();this['_modelList']=_0x326b33['items'];}catch{}return this['_modelList'];}}const ai=[{'id':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]},{'id':'translate','title':'Translate','description':'Translate\x20the\x20text\x20into\x20another\x20language.','isParameterized':!0x0,'useArgs':!0x0,'options':[{'formType':'dropdown','label':'Select\x20language','argsKey':'language','data':[{'label':'English','id':'english'},{'label':'Spanish','id':'spanish'},{'label':'French','id':'french'},{'label':'German','id':'german'},{'label':'Chinese\x20(Simplified)','id':'chinese'},{'label':'Japanese','id':'japanese'},{'label':'Russian','id':'russian'},{'label':'Portuguese','id':'portuguese'},{'label':'Korean','id':'korean'},{'label':'Italian','id':'italian'}]}]}];class ee extends _0x599126{['_aiConnector'];['_aiReviewModeUi'];['_aiReviewModeEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_isDiffOn']=!0x1;static get['requires'](){return[N];}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 _0x54d8f8=this['context']['config']['get']('ai.reviewMode.translations');if(_0x54d8f8){for(const _0x12b1fc of ai)'translate'===_0x12b1fc['id']&&(_0x12b1fc['options'][0x0]['data']=_0x54d8f8);}const _0x14d3bf=this['_translateReviewChecks'](ai);this['_aiReviewCheckList']=new ei(_0x14d3bf);const _0x188878=this['_aiReviewCheckList']['checks']['find'](_0x58c1b6=>'custom'===_0x58c1b6['id']);if(_0x188878){const _0x5b06bb=await new ni({'connector':this['_aiConnector']})['getAll']();_0x188878['models']=_0x5b06bb['map'](_0x15671c=>({..._0x15671c,'description':this['_getTranslationWithDefault']('AI_MODEL_DESCRIPTION_'+_0x15671c['id']['toUpperCase'](),_0x15671c['description'])}));}this['listenTo'](this['_aiReviewModeUi'],'getReviewCheckList',()=>{this['_aiReviewModeUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewModeUi'],'runReviewCheck',async(_0x1c427a,_0x3cdb3c)=>{const _0x139d4c=this['_aiReviewCheckList']['getCheckById'](_0x3cdb3c['id']);if(_0x139d4c){this['_onDiffChange'](this['_isDiffOn']),_0x3cdb3c['isCustom']?this['_currentReviewCheckRun']=new ri(_0x3cdb3c['args']['prompt'],_0x3cdb3c['args']['model'],this['_aiReviewModeEditing']['getDocumentData'](),_0x139d4c,this['_aiConnector']):this['_currentReviewCheckRun']=new hi(this['_aiReviewModeEditing']['getDocumentData'](),_0x139d4c,this['_aiConnector'],_0x3cdb3c['params'],_0x3cdb3c['args']),this['_aiReviewModeUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x738a4f,_0x819fca)=>{'data'===_0x819fca['status']||'loading'===_0x819fca['status']?(this['_aiReviewModeEditing']['switchToReadOnly'](),this['_aiReviewModeUi']['showCheckRunResults'](_0x819fca)):'finished'===_0x819fca['status']?this['_aiReviewModeUi']['showReviewCompletedView']():'ready'===_0x819fca['status']?this['_aiReviewModeUi']['showActionsWhenResultIsReady']():'error-general'===_0x819fca['status']?this['_aiReviewModeUi']['showGeneralErrorView']():'error-chunk'===_0x819fca['status']?this['_aiReviewModeUi']['showChunkErrorView']():'aborted'===_0x819fca['status']&&(this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewModeRunLeave'](!0x0));}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x44c4e6,_0x4488dd)=>{if(!this['_currentReviewCheckRun'])throw new _0x1cd47d('aireviewmode-no-current-check-run',this);const _0xbd3997=this['_aiReviewModeEditing']['diffContent'](_0x4488dd['result']['contentInitial'],_0x4488dd['result']['contentNew']);_0x4488dd['source']['addResultChanges'](_0x4488dd['result']['id'],_0xbd3997);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x3457ef,_0x3e738e)=>{for(const _0x99576b of _0x3e738e['changes'])this['_aiReviewModeUi']['showCheckRunResult'](_0x99576b);this['_aiReviewModeEditing']['markChangePositionInEditorContent'](_0x3e738e['changes'],_0x3e738e['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultAccepted',(_0x275b6e,_0x112e33)=>{this['_aiReviewModeUi']['updateChangeState'](_0x112e33['change']['id'],'accepted');}),this['_currentReviewCheckRun']['on']('reviewCheckResultRejected',(_0x2a0cec,_0xaa5714)=>{this['_aiReviewModeUi']['updateChangeState'](_0xaa5714['change']['id'],'rejected');});try{await this['_currentReviewCheckRun']['start']();}catch(_0x232319){_0x232319 instanceof Error&&_0x232319['message']['includes']('ai-request-aborted')||(_0x232319 instanceof _0x1cd47d?this['_logError'](_0x232319):this['_logError'](new _0x1cd47d('aireviewmode-check-run-failed',this,{'error':_0x232319})));}}else this['_logError'](new _0x1cd47d('aireviewmode-source-check-not-found',this,{'checkId':_0x3cdb3c['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 _0x38fd16=this['_currentReviewCheckRun']['getActiveChanges']();_0x38fd16['length']&&(this['_aiReviewModeEditing']['applyChange'](_0x38fd16['map'](_0x5c2940=>_0x5c2940['id'])),this['_currentReviewCheckRun']['markAllChangesAsAccepted']());}),this['listenTo'](this['_aiReviewModeUi'],'acceptChange',(_0x447987,_0x1d680a)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x1d680a['id'])&&(this['_aiReviewModeEditing']['applyChange']([_0x1d680a['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x1d680a['id']));}),this['listenTo'](this['_aiReviewModeUi'],'dismissChange',(_0x177135,_0x48662a)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x48662a['id'])&&(this['_aiReviewModeEditing']['rejectChange'](_0x48662a['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x48662a['id']));}),this['listenTo'](this['_aiReviewModeUi'],'toggleDiff',(_0x50c79c,_0x80f395)=>{this['_isDiffOn']=_0x80f395['on'],this['_onDiffChange'](this['_isDiffOn']);}),this['listenTo'](this['_aiReviewModeUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&await this['_currentReviewCheckRun']['restart']();}),this['listenTo'](this['_aiReviewModeUi'],'scrollToSuggestionInDocument',async(_0x3e0e8b,_0x167943)=>{const {source:_0x3b5977}=_0x167943;this['_aiReviewModeUi']['resetActiveStateInResults'](),_0x3b5977['setItemAsActive'](),this['_aiReviewModeEditing']['scrollToChangeInEditorContent']({'id':_0x167943['id']});});}['_onReviewModeRunLeave'](_0x456357=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']=void 0x0),_0x456357&&this['_aiReviewModeUi']['showReviewCheckList'](),this['_aiReviewModeEditing']['clearAllMarkers'](),this['_aiReviewModeEditing']['switchToEdit']();const _0x33d7c7=this['_aiReviewModeEditing']['getContentElement']();_0x33d7c7&&(_0x33d7c7['classList']['remove']('ck-ai-review-mode-diff'),_0x33d7c7['classList']['remove']('ck-ai-review-mode-highlights'));}['_onDiffChange'](_0x564382){const _0x265551=this['_aiReviewModeEditing']['getContentElement']();_0x265551&&(_0x265551['classList']['remove']('ck-ai-review-mode-diff'),_0x265551['classList']['remove']('ck-ai-review-mode-highlights'),_0x265551['classList']['add'](_0x564382?'ck-ai-review-mode-diff':'ck-ai-review-mode-highlights'));}['_translateReviewChecks'](_0x4a58a3){return _0x4a58a3['map'](_0x3c9aa4=>{const _0x2b883c='AI_REVIEW_CHECK_'+_0x3c9aa4['id']['toUpperCase']()['replaceAll']('-','_'),_0x14a3dc={..._0x3c9aa4,'title':this['_getTranslationWithDefault'](_0x2b883c+'_TITLE',_0x3c9aa4['title']),'description':this['_getTranslationWithDefault'](_0x2b883c+'_DESCRIPTION',_0x3c9aa4['description'])};return _0x3c9aa4['options']&&(_0x14a3dc['options']=_0x3c9aa4['options']['map'](_0x1f7c5b=>({..._0x1f7c5b,'label':this['_getTranslationWithDefault'](_0x2b883c+'_OPTIONS_LABEL',_0x1f7c5b['label']||''),'data':_0x1f7c5b['data']?_0x1f7c5b['data']['map'](_0x3bf8be=>({..._0x3bf8be,'label':this['_getTranslationWithDefault'](_0x2b883c+'_OPTIONS_DATA_'+_0x3bf8be['id']['toUpperCase'](),_0x3bf8be['label'])})):void 0x0}))),_0x14a3dc;});}['_getTranslationWithDefault'](_0x2eb5a9,_0x39fff9){const _0x1bdb2=Gn(this['context']['locale'],_0x2eb5a9);return _0x1bdb2===_0x2eb5a9?_0x39fff9:_0x1bdb2;}['_logError'](_0x3194a1){ot(_0x3194a1['message']),this['_aiReviewModeUi']['showGeneralErrorView']();}}class Mr extends _0x2855e5{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x427225,_0x5dce49){super(_0x427225),this['_defaultValue']=_0x5dce49['default']||(_0x5dce49['data']['length']>0x0?_0x5dce49['data'][0x0]['id']:''),this['_defaultLabel']=_0x5dce49['data']['find'](_0x2192b6=>_0x2192b6['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x372e42(this['locale']);const _0x5e5c54=this['_prepareListOptions'](_0x5dce49['data']);_0x2c3e65(this['_dropdownView'],_0x5e5c54,{'role':'menu','ariaLabel':_0x5dce49['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5955b9=>{_0x5955b9['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x5a5c12=>{this['formValue']=_0x5a5c12['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x5a5c12['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'](_0x2612b5=[]){const _0x4042c5=new _0x4b15d8();this['resetToDefault']();for(const _0x359eb0 of _0x2612b5){const _0x55985b=new _0x38340d({'label':_0x359eb0['label'],'withText':!0x0,'role':'menuitemradio','id':_0x359eb0['id'],'model':_0x359eb0});_0x55985b['bind']('isOn')['to'](this,'formValue',_0x5e736f=>_0x5e736f===_0x55985b['id']);const _0x423124={'type':'button','model':_0x55985b};_0x4042c5['add'](_0x423124);}return _0x4042c5;}}class Fs extends _0x522072{['_formItem']=null;constructor(_0x5ebf11,_0x28e703,_0x176a1e){super(_0x5ebf11),this['argsKey']=_0x28e703?.['argsKey'];if('dropdown'===_0x28e703['formType'])this['_formItem']=new Mr(this['locale'],_0x28e703);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x5efef0=new _0x179ea8(this['locale'],{'children':[this['_formItem']],'class':[_0x176a1e?'ck-form__row_with-submit':'']});_0x176a1e&&_0x5efef0['children']['add'](_0x176a1e),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__form-item','ck-reset_all']},'children':[_0x5efef0]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class Ds extends _0x18b24e{static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x824b1){super(_0x824b1),this['set']('isEmpty',!0x0),this['minRows']=Ds['MIN_ROWS'],this['maxRows']=Ds['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-mode-prompt-input','class':['ck','ck-review-mode__prompt-input']}}),this['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x560d1f=>{_0x560d1f['stopPropagation']();})}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();});}['setPlaceholderText'](_0x52d9c0){this['set']('placeholder',_0x52d9c0);}}class Gs extends _0x2855e5{['submitButtonView'];['cancelButtonView'];['promptInputView'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x4a4e92,_0x27709d){super(_0x4a4e92),this['_check']=_0x27709d,this['set']('prompt',''),this['set']('modelId',''),this['_defaultValue']=_0x27709d['models']&&_0x27709d['models']['length']>0x0?_0x27709d['models'][0x0]['id']:'',this['_defaultLabel']=_0x27709d['models']&&_0x27709d['models']['length']>0x0?_0x27709d['models'][0x0]['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),this['promptInputView']=new Ds(_0x4a4e92),this['promptInputView']['bind']('value')['to'](this,'prompt'),this['promptInputView']['on']('input',()=>{this['prompt']=this['promptInputView']['element']['value'];}),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelSelectionDropdownItems']=new _0x4b15d8(),this['_setModelList'](),_0x2c3e65(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);const _0x5d056d=new _0x2855e5(_0x4a4e92);_0x5d056d['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']]}]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions']},'children':[new _0x179ea8(this['locale'],{'children':[this['promptInputView']]}),new _0x179ea8(this['locale'],{'children':[_0x5d056d]})]});}['resetToDefault'](){this['prompt']='',this['modelId']=this['_defaultValue'],this['_modelSelectionDropdown']['buttonView']['label']=this['_defaultLabel'];}['_createSubmitButtonView'](){const _0x59f43f=new _0x21c9df(this['locale']),t=this['locale']['t'];return _0x59f43f['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x59f43f['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x23eba7=>{_0x23eba7['stopPropagation']();})}}),_0x59f43f['on']('execute',()=>{this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x59f43f;}['_createCancelButtonView'](){const _0x346444=new _0x21c9df(this['locale']),t=this['locale']['t'];return _0x346444['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled'}),_0x346444['on']('execute',()=>{this['resetToDefault']();}),_0x346444;}['_setModelList'](){this['_modelSelectionDropdownItems']['clear']();const _0xf01c70=this['_check']['models'];if(this['resetToDefault'](),_0xf01c70?.['length'])for(const _0x4b8065 of _0xf01c70){const _0x402ec8=new _0x38340d({'label':_0x4b8065['name'],'withText':!0x0,'role':'menuitemradio','id':_0x4b8065['id'],'model':_0x4b8065});_0x402ec8['bind']('isOn')['to'](this,'modelId',_0x10eb7d=>_0x10eb7d===_0x4b8065['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x402ec8,'labelView':new js(this['locale'],_0x4b8065)});}}['_createModelSelectionDropdown'](){const _0x11d602=_0x372e42(this['locale']);return _0x11d602['set']({'panelPosition':'se','class':'ck-ai-review-mode__check-list-item-model-dropdown'}),_0x11d602['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xec4b84=>{_0xec4b84['stopPropagation']();})}}),_0x11d602['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),this['listenTo'](_0x11d602,'execute',_0x484a6e=>{this['modelId']=_0x484a6e['source']['model']['id'],_0x11d602['buttonView']['label']=_0x484a6e['source']['label'];}),_0x11d602;}}class js extends _0x32d8ec{constructor(_0x3a84b8,_0x3da3be){super();const _0xe0bf3d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0xe0bf3d['to']('style'),'id':_0xe0bf3d['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-name']},'children':[{'text':_0xe0bf3d['to']('text')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[{'text':_0x3da3be['description']}]}]}]});}}class zs extends _0x522072{['_formItemsCollection']=new _0x1cd988();['_customCheckView']=null;constructor(_0x2a0c72,_0x4717ae,_0x4f663d){super(_0x2a0c72),this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x4717ae['isParameterized']);const _0x1fb521=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',_0x1fabf4=>_0x1fabf4),this['bindTemplate']['if']('isListItemRendered','ck-ai-review-mode__check-list-item_rendered',_0x27407c=>_0x27407c)],'style':{'--ck-ai-check-list-item-index':_0x4f663d}},'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':_0x4717ae['title']}]},_0x1fb521]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-description']},'children':[{'text':_0x4717ae['description']}]}]}]},..._0x4717ae['isParameterized']?[this['_createParameterizedView'](_0x4717ae)]:[],...'custom'===_0x4717ae['id']?[this['_createCustomView'](_0x4717ae)]:[]]}),this['on']('click',()=>{_0x4717ae['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x4717ae['id']});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x4a2e91({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x4c0c30=>{_0x4c0c30['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x5f2afe=new _0x32fdce();return _0x5f2afe['content']=_0x574689,_0x5f2afe['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-title-icon']}}),_0x5f2afe;}['_createParameterizedView'](_0x2694cf){const _0x455242=new _0x2855e5(),_0x5ee5a2=this['_createFormView'](_0x2694cf);return _0x455242['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x1535b7=>!_0x1535b7)]},'children':[_0x5ee5a2]}),_0x455242;}['_createFormView'](_0x945536){const _0x209a4c=new _0x2855e5(),_0x3eb71d=Array['isArray'](_0x945536['options'])?_0x945536['options']:[],_0x3d4011=new _0x21c9df(this['locale']),t=this['locale']['t'];_0x3d4011['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x3d4011['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x4ec7c4=>{_0x4ec7c4['stopPropagation']();})}}),_0x3d4011['on']('execute',()=>{const _0x3db2b1=[],_0x234fa4={};this['_formItemsCollection']['forEach'](_0x47e8cf=>{_0x3db2b1['push'](_0x47e8cf['value']),_0x945536['useArgs']&&_0x945536['options']&&(_0x234fa4[_0x47e8cf['argsKey']]=_0x47e8cf['value']);}),this['fire']('runReviewCheck',{'id':_0x945536['id'],'params':_0x3db2b1['length']?_0x3db2b1:void 0x0,'args':Object['keys'](_0x234fa4)['length']?_0x234fa4:void 0x0});});const _0x2ccd00=_0x3eb71d['length'];return _0x3eb71d['forEach']((_0x59717d,_0x1d72d5)=>{const _0x2417ce=_0x1d72d5===_0x2ccd00-0x1;this['_formItemsCollection']['add'](new Fs(this['locale'],_0x59717d,_0x2417ce?_0x3d4011:null));}),_0x209a4c['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x209a4c;}['_createCustomView'](_0x46b96d){return this['_customCheckView']=new Gs(this['locale'],_0x46b96d),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',_0x116899=>!_0x116899)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['_customCheckView'];}}class Hs extends _0x522072{['_checkViews'];constructor(_0x7ea3ce){super(_0x7ea3ce),this['_checkViews']=new _0x1cd988();const _0x3fc2b4=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list',_0x3fc2b4['if']('isVisible','ck-hidden',_0xf7656d=>!_0xf7656d)]},'children':this['_checkViews']});}['setChecks'](_0x186b0a){this['_checkViews']['clear']();for(const [_0x103380,_0x1484c3]of _0x186b0a['entries']()){const _0x45ded1=new zs(this['locale'],_0x1484c3,_0x103380);_0x45ded1['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x45ded1);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x5588b0 of this['_checkViews'])_0x5588b0 instanceof zs&&_0x5588b0['resetToDefault']();}}class Ws extends _0x2855e5{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];constructor(_0x202671,_0x33fe31){super(_0x202671),this['id']=_0x33fe31,this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](_0x33fe31),this['dismissButtonView']=this['_createDismissButtonView'](_0x33fe31),this['infoButtonView']=this['_createInfoButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),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['infoButtonView']]}]}),this['on']('click',()=>{this['fire']('scrollToSuggestionInDocument',{'id':_0x33fe31,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x1b4fe1=new _0x2855e5(this['locale']);return _0x1b4fe1['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-response']}}),_0x1b4fe1;}['_createAcceptButtonView'](_0x588d41){const _0xbfc51d=new _0x21c9df(this['locale']);return _0xbfc51d['set']({'label':Gn(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-result-accept-button'}),_0xbfc51d['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2cc74d=>{this['fire']('acceptChange',{'id':_0x588d41}),_0x2cc74d['stopPropagation']();})}}),_0xbfc51d;}['_createDismissButtonView'](_0x24b6f6){const _0x19e8ed=new _0x21c9df(this['locale']);return _0x19e8ed['set']({'label':Gn(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-dismiss-button'}),_0x19e8ed['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x4b19b7=>{this['fire']('dismissChange',{'id':_0x24b6f6}),_0x4b19b7['stopPropagation']();})}}),_0x19e8ed;}['_createInfoButtonView'](){const _0x151b89=new _0x21c9df(this['locale']);return _0x151b89['set']({'label':Gn(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x44e506,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-info-button\x20ck-hidden'}),_0x151b89['bind']('isOn')['to'](this,'isInfoToggleOn',_0x156855=>_0x156855),_0x151b89['on']('execute',()=>{console['log']('Toggle\x20info\x20view'),this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x151b89;}}class Ks extends _0x522072{['_resultViews'];['resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];constructor(_0x17cb9a){super(_0x17cb9a),this['_resultViews']=new _0x1cd988(),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_acceptAllButtonView']=this['_createAcceptAllButtonView'](),this['_exitReviewButtonView']=this['_createExitReviewButtonView'](),this['_toggleDiffButtonView']=this['_createToggleDiffButtonView'](),this['resultsHeader']=this['_createResultHeaderView'](),this['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new Bi(_0x17cb9a),this['set']('isLoading',!0x1),this['set']('isToggleDiffOn',!0x1),this['set']('isResultReady',!0x1),this['set']('headerTitle',''),this['set']('isError',!0x1),this['set']('showErrorMessage',!0x1),this['set']('errorType','general');const _0x3ffe98=this['_createCombinedSkeletonLoader'](),_0xb736eb=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run',_0xb736eb['if']('isVisible','ck-hidden',_0x48004e=>!_0x48004e)]},'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',_0xbdaaae=>_0xbdaaae)]},'children':this['_resultViews']},_0x3ffe98]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x33b09b){const _0x36844e=new Ws(this['locale'],_0x33b09b['id']);_0x36844e['delegate']('acceptChange','dismissChange','scrollToSuggestionInDocument')['to'](this),this['_resultViews']['add'](_0x36844e),_0x36844e['resultResponseView']['element']['innerHTML']=_0x33b09b['contentDiffed'];}['hideResult'](_0x1c5a9a){const _0x1f6ba8=this['_resultViews']['find'](_0x23fbbf=>_0x23fbbf['id']===_0x1c5a9a);_0x1f6ba8&&(_0x1f6ba8['element']?.['classList']['add']('ck-ai-review-mode__check-run-result_removing'),_0x1f6ba8['element']?.['addEventListener']('animationend',()=>{this['_resultViews']['remove'](_0x1f6ba8),_0x1f6ba8['destroy']();},{'once':!0x0}));}['setTitle'](_0x3d6b4a){this['headerTitle']=_0x3d6b4a;}['showChunkErrorMessage'](){this['errorType']='chunk',this['showErrorMessage']=!0x0;}['showGeneralErrorMessage'](){this['isError']=!0x0,this['errorType']='general',this['showErrorMessage']=!0x0;}['resetErrorState'](){this['isError']=!0x1,this['errorType']='general',this['showErrorMessage']=!0x1;}['_createSkeletonLoader'](){return new je(this['locale'],Le['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x4a7fe3=new _0x2855e5(this['locale']),_0x3162b7=[];for(let _0x458330=0x0;_0x458330<0x10;_0x458330++){const _0x5d80ae=this['_createSkeletonLoader']();_0x5d80ae['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-run-skeleton-item']}}),_0x3162b7['push'](_0x5d80ae);}return _0x4a7fe3['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x18870c=>!_0x18870c)]},'children':_0x3162b7}),_0x4a7fe3;}['_createErrorView'](){const _0x42e1f0=new _0x2855e5(this['locale']),_0x459e2e=new _0x21c9df(this['locale']),t=this['locale']['t'];return _0x42e1f0['delegate']('retryReview')['to'](this),_0x459e2e['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-error-retry-button'}),_0x459e2e['on']('execute',()=>{this['fire']('retryReview');}),_0x42e1f0['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x33ba33=>!_0x33ba33),this['bindTemplate']['if']('errorType','ck-ai-review-mode__check-run-error-container_border-bottom',_0x5c4e10=>'chunk'===_0x5c4e10)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-chat-error','ck-ai-chat-error_full-width','ck-ai-review-mode__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-chat-error_warning',_0x1d516e=>'chunk'===_0x1d516e)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x463add=>'general'!==_0x463add)]},'children':[{'text':Gn(this['locale'],'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}]},{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x3997ca=>'chunk'!==_0x3997ca)]},'children':[{'text':Gn(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x459e2e]}),_0x42e1f0;}['_createCancelButtonView'](){const _0x380269=new _0x21c9df(this['locale']);return _0x380269['set']({'label':Gn(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ai-chat-controls-loader__cancel-button'],'icon':_0xb72389}),_0x380269['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x2fb9f1=>_0x2fb9f1)]}}),_0x380269['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x380269;}['_createToggleDiffButtonView'](){const _0x1bad95=new _0x21c9df(this['locale']);_0x1bad95['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x1bad95['bind']('isEnabled')['to'](this,'isError',_0x80f324=>!_0x80f324),_0x1bad95['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x57f1bb=>!_0x57f1bb)]}});const _0x58f2e9=Gn(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x7c5174=Gn(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x1bad95['bind']('isOn')['to'](this,'isToggleDiffOn',_0x2f2f4b=>_0x2f2f4b),_0x1bad95['bind']('icon')['to'](this,'isToggleDiffOn',_0x23fa0a=>_0x23fa0a?_0x7ee4b2:_0x3d5ebf),_0x1bad95['bind']('label')['to'](this,'isToggleDiffOn',_0x4f1a93=>_0x4f1a93?_0x58f2e9:_0x7c5174),_0x1bad95['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x1bad95;}['_createAcceptAllButtonView'](){const _0x131c5d=new _0x21c9df(this['locale']);return _0x131c5d['set']({'label':Gn(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x131c5d['bind']('isEnabled')['to'](this,'isError',_0x20a027=>!_0x20a027),_0x131c5d['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai-review-mode__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x27d042=>!_0x27d042)]}}),_0x131c5d['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x131c5d;}['_createExitReviewButtonView'](){const _0xfb7a4f=new _0x21c9df(this['locale']);return _0xfb7a4f['set']({'label':Gn(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0xfb7a4f['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x45bfb2=>!_0x45bfb2)]}}),_0xfb7a4f['on']('execute',()=>{this['fire']('leaveReviewModeResultList');}),_0xfb7a4f;}['_createResultHeaderView'](){const _0x31c3b6=new _0x2855e5(this['locale']),_0x4484b=new Ve();return _0x4484b['bind']('isVisible')['to'](this,'isResultReady',_0x4d72b0=>!_0x4d72b0),_0x31c3b6['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-buttons']},'children':[_0x4484b,this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView']]}]}),_0x31c3b6;}}class Ns extends _0x522072{['resultsHeader'];['_finishReviewButtonView'];constructor(_0x17bea5){super(_0x17bea5),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['resultsHeader']=this['_createResultHeaderView']();const _0x3df11c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed',_0x3df11c['if']('isVisible','ck-hidden',_0x1f121e=>!_0x1f121e)]},'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':Gn(_0x17bea5,'AI_REVIEW_MODE_COMPLETED_TEXT')}]}]}]});}['_createFinishReviewButtonView'](){const _0x3f333b=new _0x21c9df(this['locale']);return _0x3f333b['set']({'label':Gn(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x3f333b['on']('execute',()=>{this['fire']('finishReview');}),_0x3f333b;}['_createResultHeaderView'](){const _0x5d63ca=new _0x2855e5(this['locale']);return _0x5d63ca['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':Gn(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x5d63ca;}}class se extends _0x2855e5{['reviewModeHeader'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x123816){super(_0x123816),this['reviewModeHeader']=new _0x12296e(_0x123816,{'label':Gn(_0x123816,'AI_REVIEW_MODE'),'icon':te,'class':'ck-ai-header\x20ck-ai-header_review-mode'}),this['reviewCheckListView']=new Hs(_0x123816),this['reviewCheckListView']['delegate'](...Js)['to'](this),this['reviewCheckResultsView']=new Ks(_0x123816),this['reviewCheckResultsView']['delegate'](...Js)['to'](this),this['reviewCompletedView']=new Ns(_0x123816),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-content\x20','ck-reset_all','ck-ai-review-mode','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewModeHeader'],this['reviewCheckListView'],this['reviewCheckResultsView'],this['reviewCompletedView']]});}['showReviewCheckListView'](){this['reviewCheckListView']['resetAllParameterizedChecks'](),this['reviewCheckListView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1);}['showReviewCheckResultsView'](){this['hideActionsWhenResultIsReady'](),this['reviewCheckResultsView']['resetErrorState'](),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['clearResults'](),this['reviewCheckResultsView']['set']('isLoading',!0x0);}['addCheckRunResult'](_0x5cc758){this['reviewCheckResultsView']['addResult'](_0x5cc758),this['reviewCheckResultsView']['set']('isLoading',!0x1);}['showReviewCompletedView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x0);}['showActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x0;}['hideActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x1;}['showGeneralErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}const Js=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewModeResultList','scrollToSuggestionInDocument','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ie extends _0x599126{['_reviewModeView'];static get['requires'](){return[rt];}static get['pluginName'](){return'AIReviewModeUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x181134){super(_0x181134),this['_reviewModeView']=new se(this['context']['locale']),this['_reviewModeView']['delegate'](...Js)['to'](this);}['init'](){const _0x1e2ec6=this['context']['plugins']['get']('AITabs');_0x1e2ec6['view']['on']('activateTab',(_0x192468,_0x506202)=>{'reviewMode'===_0x506202?this['fire']('getReviewCheckList'):this['fire']('leaveReviewMode');}),_0x1e2ec6['view']['addTab']({'id':'reviewMode','buttonLabel':Gn(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':te,'order':0x0,'content':this['_reviewModeView']});}['setAvailableChecks'](_0x2d606c){this['_reviewModeView']['reviewCheckListView']['hasChecks']()||this['_reviewModeView']['reviewCheckListView']['setChecks'](_0x2d606c),this['_reviewModeView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x22b208){_0x22b208&&('error-general'!==_0x22b208['status']?'error-chunk'!==_0x22b208['status']?this['_reviewModeView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralErrorView']());}['showCheckRunResult'](_0x5d4b0d){this['_reviewModeView']['addCheckRunResult'](_0x5d4b0d);}['showGeneralErrorView'](){this['_reviewModeView']['showGeneralErrorView']();}['showChunkErrorView'](){this['_reviewModeView']['showChunkErrorView']();}['setCheckResultTitle'](_0x493c2c){this['_reviewModeView']['reviewCheckResultsView']['setTitle'](_0x493c2c);}['resetActiveStateInResults'](){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x7ef1f1=>_0x7ef1f1['setItemAsInactive']());}['updateChangeState'](_0x928416,_0x2f0ac7){'accepted'!==_0x2f0ac7&&'rejected'!==_0x2f0ac7||this['_reviewModeView']['reviewCheckResultsView']['hideResult'](_0x928416);}['showReviewCompletedView'](){this['_reviewModeView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_reviewModeView']['showActionsWhenResultIsReady']();}['hideActionsWhenResultIsReady'](){this['_reviewModeView']['hideActionsWhenResultIsReady']();}}const Zt='reviewmode-';class re extends _0x599126{static get['pluginName'](){return'AIReviewModeEditing';}static get['requires'](){return[_0x15d52a,O];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['afterInit'](){const _0x1f5db5=V(this['context']);_0x1f5db5['conversion']['for']('editingDowncast')['markerToElement']({'model':Zt+'insert','view':(_0x2ec306,{writer:_0x1350e4})=>{const _0x4ec7df=this['_markers']['get'](_0x2ec306['markerName']);return _0x1350e4['createUIElement']('span',{'class':'ck-ai_review-mode-marker_add'},function(_0x588bd9){const _0x29d968=this['toDomElement'](_0x588bd9);return _0x29d968['innerHTML']=_0x4ec7df?.['text']||'',_0x29d968;});}}),_0x1f5db5['conversion']['for']('dataDowncast')['markerToElement']({'model':Zt+'suggestion-context','view':(_0x1b1c5e,{writer:_0x2bcec8})=>_0x2bcec8['createRawElement']('span',{'class':'ck-ai_review-mode-marker_context-'+(_0x1b1c5e['isOpening']?'start':'end')})}),_0x1f5db5['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Zt+'remove-only','view':()=>({'classes':'ck-ai_review-mode-marker_strikethrough'})}),_0x1f5db5['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Zt+'remove-context','view':()=>({'classes':'ck-ai_review-mode-marker_underline'})}),_0x1f5db5['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Zt+'remove-text','view':()=>({'classes':'ck-ai_review-mode-marker_hide'})}),_0x1f5db5['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x51a6d7,'view':Xt});}['getDocumentData'](){const _0x286720=this['context']['plugins']['get']('AIEditing'),_0x134dab=V(this['context']),_0x2e61fe=_0x134dab['model'],_0x2defa5=new _0x2ffe67();for(const _0x4abcba of _0x2e61fe['document']['getRoot']()['getChildren']()){const _0x4e7beb=_0x4abcba['_clone'](!0x0);_0x2defa5['_appendChild'](_0x4e7beb);}for(const _0x23d50a of _0x2e61fe['markers'])_0x2defa5['markers']['set'](_0x23d50a['name'],this['_changeRangeOwnerDocument'](_0x23d50a['getRange']()['clone'](),_0x2defa5));const _0x1d9c2b=new Vt({'ignoreElementEnd':!0x0,'startPosition':_0x2e61fe['createPositionAt'](_0x2defa5,0x0)}),_0x2da54b=new Set(),_0x1932b4=new Map();for(const {item:_0x9b0cb1}of _0x1d9c2b){if(!_0x9b0cb1['is']('$textProxy'))continue;const _0x51f2fc=_0x9b0cb1['parent'];if((!_0x51f2fc||!_0x51f2fc['is']('element','caption'))&&(_0x51f2fc&&_0x51f2fc['is']('element'))){let _0x5ea893=_0x51f2fc['getAttribute'](_0x51a6d7);_0x5ea893||(_0x5ea893=_0x286720['_nextDataId'](_0x2da54b),_0x51f2fc['_setAttribute'](_0x51a6d7,_0x5ea893)),_0x2da54b['add'](_0x5ea893);const _0x520d82=this['_getTopElement'](_0x51f2fc);_0x1932b4['set'](_0x5ea893,{'path':_0x51f2fc['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x520d82['_clone'](!0x0),_0x5ea893,_0x134dab['data'])}),_0x1d9c2b['jumpTo'](_0x2e61fe['createPositionAfter'](_0x51f2fc));}}return{'content':_0x134dab['data']['processor']['toData'](_0x134dab['data']['toView'](_0x2defa5)),'version':_0x134dab['model']['document']['version'],'elements':_0x1932b4};}['diffContent'](_0x5a5408,_0x2b28c7){const _0x2b3e1a=V(this['context']),_0x4ce380=_0x2b3e1a['data']['parse'](_0x5a5408,'$documentFragment'),_0x3b8ced=_0x2b3e1a['model']['createPositionAt'](_0x4ce380,0x0),_0x32d8ce=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x5a5408,_0x2b28c7,{'anchor':_0x3b8ced,'markDeletions':!0x0})['getOperations']()['filter'](_0x207ba2=>'insert'===_0x207ba2['type']||'marker'===_0x207ba2['type']&&_0x207ba2['name']['startsWith']('$markedRemove')),_0x49e4ba=this['_groupAdjacentOperations'](_0x32d8ce),_0x1fd3c8=[];let _0x1c045f=0x0;return _0x2b3e1a['model']['change'](_0x2df1a0=>{for(let _0x280cad=0x0;_0x280cad<_0x49e4ba['length'];_0x280cad++){const _0x47261f=_0x49e4ba[_0x280cad],_0x3074ba=_0x2df1a0['createDocumentFragment']();for(const _0x5544b5 of _0x4ce380['getChildren']())_0x2df1a0['append'](_0x5544b5['_clone'](!0x0),_0x3074ba);for(const _0x20c565 of _0x47261f['operationsIsolated'])if('insert'===_0x20c565['type']){const _0x534137=_0x20c565;_0x534137['baseVersion']=null,_0x534137['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x534137,_0x3074ba),_0x2df1a0['batch']['addOperation'](_0x20c565),_0x2b3e1a['model']['applyOperation'](_0x20c565);const _0xd2feb6='suggestion:insertion:id:authorId:'+_0x1c045f++,_0x15b874=_0x2b3e1a['model']['createRange'](_0x534137['position'],_0x534137['position']['getShiftedBy'](_0x534137['howMany']));_0x3074ba['markers']['set'](_0xd2feb6,_0x15b874);}else{if('marker'===_0x20c565['type']&&_0x20c565['name']['startsWith']('$markedRemove')){const _0x5c8cd7=_0x20c565,_0x36ac3d='suggestion:deletion:id:authorId:'+_0x1c045f++;this['_changeOperationOwnerDocument'](_0x5c8cd7,_0x3074ba),_0x3074ba['markers']['set'](_0x36ac3d,_0x5c8cd7['newRange']);}}const _0xf63cdc=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x47261f['operationsIsolated'][0x0]),_0x3074ba),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x47261f['operationsIsolated'][_0x47261f['operationsIsolated']['length']-0x1]),_0x3074ba));_0x3074ba['markers']['set'](Zt+'suggestion-context',new _0x27581(_0xf63cdc['start'],_0xf63cdc['end'])),_0x1fd3c8['push']({..._0x47261f,'context':this['_createGetContextFn'](_0x3074ba,_0x2b3e1a['data'],{'ellipsisBefore':_0xf63cdc['hasContentBefore'],'ellipsisAfter':_0xf63cdc['hasContentAfter']}),'content':this['_createGetContentFn'](_0x3074ba,_0x2b3e1a['data'])});}}),_0x1fd3c8;}['markChangePositionInEditorContent'](_0x3ca0d5,_0x3c7cec){const _0x11a02a=_0x3ca0d5[0x0]['parent']['id'],_0x50387f=_0x3c7cec['elements']['get'](_0x11a02a);if(!_0x50387f)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x11a02a);const _0x257213=_0x50387f['path'],_0x117946=V(this['context']),_0x15e3da=_0x117946['model']['document']['history']['getOperations'](_0x3c7cec['version']),_0x1616a8=[];for(const _0x5c506f of _0x3ca0d5){const _0x2a8c81=_0x5c506f['operationsIsolated']['map'](_0x149c33=>this['_translateOperationToEditorContent'](_0x149c33,_0x257213,_0x117946['model']['document']['getRoots']()[0x0]));if(!_0x2a8c81||!_0x2a8c81['length'])continue;const _0x467088=_0x2a8c81['every'](_0x18d0f1=>'marker'===_0x18d0f1['type']&&_0x18d0f1['name']['startsWith']('$markedRemove')),_0x584523={'document':_0x117946['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x4d1782=tt(_0x2a8c81,_0x15e3da,_0x584523)['operationsA'];for(const _0x4ee7f7 of _0x4d1782)if('insert'===_0x4ee7f7['type']){const _0x374c1e=_0x4ee7f7,_0x39bdae=_0x374c1e['nodes'];let _0x10ee6e='';for(const _0x513ff4 of _0x39bdae)_0x513ff4&&_0x513ff4['is']('model:$text')&&(_0x10ee6e+=_0x513ff4['data']);_0x1616a8['push']({'start':_0x374c1e['position'],'end':_0x374c1e['position'],'type':'insert','groupId':_0x5c506f['id'],'text':_0x10ee6e});}else{if('marker'===_0x4ee7f7['type']&&_0x4ee7f7['name']['startsWith']('$markedRemove')){const _0xef1243=_0x4ee7f7;let _0x53b48b='remove-text';if(_0x467088){const _0x19389d=this['_findAdjacentContextDistance'](_0xef1243['newRange']['start'],'backward',_0x117946['model']['schema']),_0x305212=this['_findAdjacentContextDistance'](_0xef1243['newRange']['end'],'forward',_0x117946['model']['schema']);if(_0x19389d||_0x305212){const _0x574962=_0xef1243['newRange']['start']['getShiftedBy'](-_0x19389d),_0x247927=_0xef1243['newRange']['end']['getShiftedBy'](_0x305212);_0x1616a8['push']({'start':_0x574962,'end':_0x247927,'groupId':_0x5c506f['id'],'type':'remove-context'});}else _0x53b48b='remove-only';}_0x1616a8['push']({'start':_0xef1243['newRange']['start'],'end':_0xef1243['newRange']['end'],'groupId':_0x5c506f['id'],'type':_0x53b48b});}}}this['_insertMarkers'](_0x1616a8);}['clearAllMarkers'](){V(this['context'])['model']['change'](_0x2f396e=>{for(const _0x2858c4 of this['_markers']['keys']())_0x2f396e['removeMarker'](_0x2858c4);}),this['_markers']['clear']();}['switchToReadOnly'](){V(this['context'])['enableReadOnlyMode']('ai-review-mode');}['switchToEdit'](){V(this['context'])['disableReadOnlyMode']('ai-review-mode');}['applyChange'](_0x3a47ba){const _0x53e792=V(this['context']),_0x40c8f2=_0x53e792['model'],_0x16c542=_0x3a47ba['map'](_0x5075ba=>this['_getMarkersDataForGroup'](_0x5075ba))['flat']();_0x40c8f2['change'](_0x165b0d=>{for(const _0x4ed148 of _0x16c542){const _0x3d5ff4=_0x53e792['model']['markers']['get'](_0x4ed148['id']);_0x3d5ff4&&('insert'===_0x4ed148['type']?_0x40c8f2['insertContent'](_0x165b0d['createText'](_0x4ed148['text']||''),_0x3d5ff4['getRange']()['start']):'remove-text'!==_0x4ed148['type']&&'remove-only'!==_0x4ed148['type']||_0x40c8f2['deleteContent'](_0x40c8f2['createSelection'](_0x3d5ff4['getRange']())),_0x165b0d['removeMarker'](_0x4ed148['id']),this['_markers']['delete'](_0x4ed148['id']));}});}['rejectChange'](_0xc8e9ae){const _0x2833b7=V(this['context']),_0x497d8c=this['_getMarkersDataForGroup'](_0xc8e9ae);_0x2833b7['model']['change'](_0x100a62=>{for(const _0x115278 of _0x497d8c)_0x100a62['removeMarker'](_0x115278['id']),this['_markers']['delete'](_0x115278['id']);});}['getContentElement'](){const _0xb6064b=V(this['context']);return _0xb6064b&&_0xb6064b['ui']&&_0xb6064b['ui']['element']?_0xb6064b['ui']['element']:null;}['_translateOperationToEditorContent'](_0xa08f2d,_0x40888e,_0x4196c7){if('insert'===_0xa08f2d['type']){const _0x506d57=_0xa08f2d;return new $t(this['_changePosition'](_0x506d57['position'],_0x40888e['concat'](_0x506d57['position']['offset']),_0x4196c7),_0x506d57['nodes'],_0x506d57['baseVersion']);}if('marker'===_0xa08f2d['type']&&_0xa08f2d['name']['startsWith']('$markedRemove')){const _0x3dd066=_0xa08f2d;return new Bt(_0x3dd066['name'],_0x3dd066['oldRange'],this['_changeRange'](_0x3dd066['newRange'],_0x40888e['concat'](_0x3dd066['newRange']['start']['offset']),_0x40888e['concat'](_0x3dd066['newRange']['end']['offset']),_0x4196c7),_0x3dd066['_markers'],_0x3dd066['affectsData'],_0x3dd066['baseVersion']);}return _0xa08f2d;}['_groupAdjacentOperations'](_0x15f1d1){if(!_0x15f1d1['length'])return[];const _0x189e4b=[];let _0x4a564d=0x0,_0x3f5602=0x0,_0x2dd969=[];for(let _0x3360dc=0x0;_0x3360dc<=_0x15f1d1['length'];_0x3360dc++){const _0x1d58bc=_0x15f1d1[_0x3360dc],_0xe9bb06=_0x15f1d1[_0x3360dc-0x1];!_0x1d58bc||_0xe9bb06&&!this['_getOperationEnd'](_0xe9bb06)['isTouching'](this['_getOperationStart'](_0x1d58bc))?(_0x189e4b['push']({'operations':_0x2dd969,'operationsIsolated':_0x2dd969['map'](_0x4799df=>this['_shiftOperation'](_0x4799df['clone'](),-_0x3f5602)),'groupOffset':_0x4a564d}),_0x2dd969=_0x1d58bc?[_0x1d58bc]:[],_0x3f5602+=_0x4a564d,_0x4a564d=0x0):_0x2dd969['push'](_0x1d58bc),_0x1d58bc&&'insert'===_0x1d58bc['type']&&(_0x4a564d+=_0x1d58bc['howMany']);}return _0x189e4b;}['scrollToChangeInEditorContent'](_0x17d6fd){console['log']('Scroll\x20to\x20change\x20in\x20editor\x20content',_0x17d6fd['id']);}['_findAdjacentContextDistance'](_0x121dbc,_0x1185d3,_0x519aad,_0x16d68c=0x1){const _0x11c334=new Vt({'startPosition':_0x121dbc,'direction':_0x1185d3});let _0x11e0cc=0x0;for(let _0x286c1d=0x0;_0x286c1d<_0x16d68c;_0x286c1d++){let _0x2b4de4=0x0,_0x53afa6=!0x1,_0x1330e0='forward'===_0x1185d3?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x5e819e}of _0x11c334)if(_0x5e819e['is']('$textProxy')){const _0x5c67e6=_0x1330e0['exec'](_0x5e819e['data']);if(_0x5c67e6&&_0x5c67e6['length']){if(_0x2b4de4+='forward'===_0x1185d3?_0x5c67e6['index']+_0x5c67e6[0x0]['length']:_0x5e819e['data']['length']-_0x5c67e6['index'],_0x5c67e6[0x0]['length']!==_0x5e819e['data']['length'])break;_0x53afa6=!0x0,_0x1330e0='forward'===_0x1185d3?/^\w+/:/\w+$/;}else{if(_0x53afa6)break;_0x2b4de4+=_0x5e819e['offsetSize'];}}else{if(_0x5e819e['is']('element')){_0x519aad['isInline'](_0x5e819e)&&!_0x53afa6&&(_0x2b4de4+=0x1);break;}}_0x11e0cc+=_0x2b4de4,_0x11c334['jumpTo'](_0x121dbc['getShiftedBy']('forward'===_0x1185d3?_0x11e0cc:-_0x11e0cc));}return _0x11e0cc;}['_getChangeContext'](_0x24835a,_0xa4b8c4){const _0x2c7fab=V(this['context'])['model']['schema'],_0x2aabfc=this['_findAdjacentContextDistance'](_0x24835a,'backward',_0x2c7fab,0x6),_0x10ff85=this['_findAdjacentContextDistance'](_0xa4b8c4,'forward',_0x2c7fab,0x6),_0xa12af8=_0x24835a['getShiftedBy'](-_0x2aabfc),_0x2c3930=_0xa4b8c4['getShiftedBy'](_0x10ff85);return{'start':_0xa12af8,'end':_0x2c3930,'hasContentBefore':!_0xa12af8['isAtStart'],'hasContentAfter':!_0x2c3930['isAtEnd']};}['_insertMarkers'](_0xf5a65c){V(this['context'])['model']['change'](_0x26a697=>{for(const _0x2ec84c of _0xf5a65c){const _0x286d25=''+Zt+_0x2ec84c['type']+':'+_0x2ec84c['groupId']+'_'+_0x91fc81();this['_markers']['set'](_0x286d25,{'id':_0x286d25,'groupId':_0x2ec84c['groupId'],'type':_0x2ec84c['type'],'text':_0x2ec84c['text']}),_0x26a697['addMarker'](_0x286d25,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x26a697['createRange'](_0x2ec84c['start'],_0x2ec84c['end'])});}});}['_createGetContextFn'](_0x406784,_0x39f4bb,_0x352895){let _0x280095='';return()=>{if(!_0x280095){const _0x138a95=_0x39f4bb['toView'](_0x406784,{'showSuggestionHighlights':!0x0}),_0x4204ec=_0x138a95['getChild'](0x0);if(!_0x4204ec)return'';let _0x54074b=!0x1;const _0x40795c=[];for(const _0x2947fa of _0x4204ec['getChildren']())_0x2947fa['is']('element','span')&&_0x2947fa['hasClass']('ck-ai_review-mode-marker_context-end')&&(_0x54074b=!0x1),_0x54074b&&_0x40795c['push'](_0x2947fa),_0x2947fa['is']('element','span')&&_0x2947fa['hasClass']('ck-ai_review-mode-marker_context-start')&&(_0x54074b=!0x0);_0x4204ec['_removeChildren'](0x0,_0x4204ec['childCount']),_0x352895?.['ellipsisBefore']&&_0x4204ec['_appendChild']('…'),_0x4204ec['_appendChild'](_0x40795c),_0x352895?.['ellipsisAfter']&&_0x4204ec['_appendChild']('…');const _0x5c83b9=_0x39f4bb['htmlProcessor']['domConverter']['viewToDom'](_0x138a95),_0x42f5fd=_0x39f4bb['htmlProcessor']['htmlWriter']['getHtml'](_0x5c83b9);_0x280095=_0x42f5fd;}return _0x280095;};}['_createGetContentFn'](_0x542f71,_0x405eca){let _0x5b2fe7='';return()=>(_0x5b2fe7||(_0x5b2fe7=_0x405eca['stringify'](_0x542f71,{'showSuggestionHighlights':!0x0})),_0x5b2fe7);}['_createGetContentUsingDataIdFn'](_0x3415fb,_0x3eda94,_0x1d7e9a){let _0x27d5e1='';return()=>{if(!_0x27d5e1){const _0x40a9ea=_0x1d7e9a['toView'](new _0x2ffe67(_0x3415fb)),_0x4d860e=_0x1d7e9a['htmlProcessor']['domConverter']['viewToDom'](_0x40a9ea)['querySelector']('[data-id=\x22'+_0x3eda94+'\x22]');_0x27d5e1=_0x4d860e?.['outerHTML']||'';}return _0x27d5e1;};}['_getMarkersDataForGroup'](_0x43633d){return Array['from'](this['_markers']['values']())['filter'](_0x3f6763=>_0x3f6763['groupId']===_0x43633d);}['_getOperationStart'](_0x2dee25){return'insert'===_0x2dee25['type']?_0x2dee25['position']:_0x2dee25['newRange']['start'];}['_getOperationEnd'](_0x5e9a77,_0x2dd538=!0x1){return'insert'===_0x5e9a77['type']?_0x2dd538?_0x5e9a77['position']:_0x5e9a77['position']['getShiftedBy'](_0x5e9a77['howMany']):_0x5e9a77['newRange']['end'];}['_shiftOperation'](_0x569ee6,_0x336e75){return'insert'===_0x569ee6['type']?_0x569ee6['position']=_0x569ee6['position']['getShiftedBy'](_0x336e75):'marker'===_0x569ee6['type']&&_0x569ee6['newRange']&&(_0x569ee6['newRange']=new _0x27581(_0x569ee6['newRange']['start']['getShiftedBy'](_0x336e75),_0x569ee6['newRange']['end']['getShiftedBy'](_0x336e75))),_0x569ee6;}['_changeOperationOwnerDocument'](_0x13111e,_0x365adf){'insert'===_0x13111e['type']?_0x13111e['position']=this['_changePositionOwnerDocument'](_0x13111e['position'],_0x365adf):'marker'===_0x13111e['type']&&_0x13111e['newRange']&&(_0x13111e['newRange']=this['_changeRangeOwnerDocument'](_0x13111e['newRange'],_0x365adf));}['_changePositionOwnerDocument'](_0x493608,_0x333903){return new _0x5764e0(_0x333903,_0x493608['path']);}['_changeRangeOwnerDocument'](_0x13ae6d,_0x3834c8){return new _0x27581(this['_changePositionOwnerDocument'](_0x13ae6d['start'],_0x3834c8),this['_changePositionOwnerDocument'](_0x13ae6d['end'],_0x3834c8));}['_changePosition'](_0x381954,_0x2ba8d6,_0x403f82){return new _0x5764e0(_0x403f82,[..._0x2ba8d6]);}['_changeRange'](_0x3625cc,_0x432c20,_0x2e033e,_0x50de15){return new _0x27581(this['_changePosition'](_0x3625cc['start'],_0x432c20,_0x50de15),this['_changePosition'](_0x3625cc['end'],_0x2e033e,_0x50de15));}['_getTopElement'](_0x5237fa){let _0x25f85a=_0x5237fa;for(;_0x25f85a['parent']&&!_0x25f85a['parent']['is']('documentFragment');)_0x25f85a=_0x25f85a['parent'];return _0x25f85a;}}class Ea extends _0x599126{static get['requires'](){return[ee,ie,re];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{Ta as AIActions,x as AIAdapter,Dn as AIAssistant,n as AIAssistantUI,G as AIBalloon,ga as AIChat,et as AIChatController,at as AIChatHistory,jt as AIChatHistoryController,xt as AIChatHistoryUI,it as AIChatUI,N as AIConnector,O as AIEditing,oi as AIQuickActionType,pa as AIQuickActions,ii as AIQuickActionsUI,tr as AIRequestError,vs as AIReviewCheck,Rs as AIReviewCheckResult,pr as AIReviewCheckRun,Ea as AIReviewMode,ee as AIReviewModeController,re as AIReviewModeEditing,ie as AIReviewModeUI,rt as AITabs,ae as AITextAdapter,Vn as AWSTextAdapter,Un as OpenAITextAdapter,E as ShowAIAssistantCommand,As as createResizeButton,Mn as getDefaultAICommands};