@ckeditor/ckeditor5-ai 47.0.0-alpha.5 → 47.0.0-alpha.7

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 (327) hide show
  1. package/LICENSE.md +4 -0
  2. package/build/ai.js +1 -1
  3. package/ckeditor5-metadata.json +14 -0
  4. package/dist/index-editor.css +70 -19
  5. package/dist/index.css +80 -19
  6. package/dist/index.js +4 -4
  7. package/dist/translations/af.js +1 -1
  8. package/dist/translations/af.umd.js +1 -1
  9. package/dist/translations/ar.js +1 -1
  10. package/dist/translations/ar.umd.js +1 -1
  11. package/dist/translations/ast.js +1 -1
  12. package/dist/translations/ast.umd.js +1 -1
  13. package/dist/translations/az.js +1 -1
  14. package/dist/translations/az.umd.js +1 -1
  15. package/dist/translations/be.js +1 -1
  16. package/dist/translations/be.umd.js +1 -1
  17. package/dist/translations/bg.js +1 -1
  18. package/dist/translations/bg.umd.js +1 -1
  19. package/dist/translations/bn.js +1 -1
  20. package/dist/translations/bn.umd.js +1 -1
  21. package/dist/translations/bs.js +1 -1
  22. package/dist/translations/bs.umd.js +1 -1
  23. package/dist/translations/ca.js +1 -1
  24. package/dist/translations/ca.umd.js +1 -1
  25. package/dist/translations/cs.js +1 -1
  26. package/dist/translations/cs.umd.js +1 -1
  27. package/dist/translations/da.js +1 -1
  28. package/dist/translations/da.umd.js +1 -1
  29. package/dist/translations/de-ch.js +1 -1
  30. package/dist/translations/de-ch.umd.js +1 -1
  31. package/dist/translations/de.js +1 -1
  32. package/dist/translations/de.umd.js +1 -1
  33. package/dist/translations/el.js +1 -1
  34. package/dist/translations/el.umd.js +1 -1
  35. package/dist/translations/en-au.js +1 -1
  36. package/dist/translations/en-au.umd.js +1 -1
  37. package/dist/translations/en-gb.js +1 -1
  38. package/dist/translations/en-gb.umd.js +1 -1
  39. package/dist/translations/en.js +1 -1
  40. package/dist/translations/en.umd.js +1 -1
  41. package/dist/translations/eo.js +1 -1
  42. package/dist/translations/eo.umd.js +1 -1
  43. package/dist/translations/es-co.js +1 -1
  44. package/dist/translations/es-co.umd.js +1 -1
  45. package/dist/translations/es.js +1 -1
  46. package/dist/translations/es.umd.js +1 -1
  47. package/dist/translations/et.js +1 -1
  48. package/dist/translations/et.umd.js +1 -1
  49. package/dist/translations/eu.js +1 -1
  50. package/dist/translations/eu.umd.js +1 -1
  51. package/dist/translations/fa.js +1 -1
  52. package/dist/translations/fa.umd.js +1 -1
  53. package/dist/translations/fi.js +1 -1
  54. package/dist/translations/fi.umd.js +1 -1
  55. package/dist/translations/fr.js +1 -1
  56. package/dist/translations/fr.umd.js +1 -1
  57. package/dist/translations/gl.js +1 -1
  58. package/dist/translations/gl.umd.js +1 -1
  59. package/dist/translations/gu.js +1 -1
  60. package/dist/translations/gu.umd.js +1 -1
  61. package/dist/translations/he.js +1 -1
  62. package/dist/translations/he.umd.js +1 -1
  63. package/dist/translations/hi.js +1 -1
  64. package/dist/translations/hi.umd.js +1 -1
  65. package/dist/translations/hr.js +1 -1
  66. package/dist/translations/hr.umd.js +1 -1
  67. package/dist/translations/hu.js +1 -1
  68. package/dist/translations/hu.umd.js +1 -1
  69. package/dist/translations/hy.js +1 -1
  70. package/dist/translations/hy.umd.js +1 -1
  71. package/dist/translations/id.js +1 -1
  72. package/dist/translations/id.umd.js +1 -1
  73. package/dist/translations/it.js +1 -1
  74. package/dist/translations/it.umd.js +1 -1
  75. package/dist/translations/ja.js +1 -1
  76. package/dist/translations/ja.umd.js +1 -1
  77. package/dist/translations/jv.js +1 -1
  78. package/dist/translations/jv.umd.js +1 -1
  79. package/dist/translations/kk.js +1 -1
  80. package/dist/translations/kk.umd.js +1 -1
  81. package/dist/translations/km.js +1 -1
  82. package/dist/translations/km.umd.js +1 -1
  83. package/dist/translations/kn.js +1 -1
  84. package/dist/translations/kn.umd.js +1 -1
  85. package/dist/translations/ko.js +1 -1
  86. package/dist/translations/ko.umd.js +1 -1
  87. package/dist/translations/ku.js +1 -1
  88. package/dist/translations/ku.umd.js +1 -1
  89. package/dist/translations/lt.js +1 -1
  90. package/dist/translations/lt.umd.js +1 -1
  91. package/dist/translations/lv.js +1 -1
  92. package/dist/translations/lv.umd.js +1 -1
  93. package/dist/translations/ms.js +1 -1
  94. package/dist/translations/ms.umd.js +1 -1
  95. package/dist/translations/nb.js +1 -1
  96. package/dist/translations/nb.umd.js +1 -1
  97. package/dist/translations/ne.js +1 -1
  98. package/dist/translations/ne.umd.js +1 -1
  99. package/dist/translations/nl.js +1 -1
  100. package/dist/translations/nl.umd.js +1 -1
  101. package/dist/translations/no.js +1 -1
  102. package/dist/translations/no.umd.js +1 -1
  103. package/dist/translations/oc.js +1 -1
  104. package/dist/translations/oc.umd.js +1 -1
  105. package/dist/translations/pl.js +1 -1
  106. package/dist/translations/pl.umd.js +1 -1
  107. package/dist/translations/pt-br.js +1 -1
  108. package/dist/translations/pt-br.umd.js +1 -1
  109. package/dist/translations/pt.js +1 -1
  110. package/dist/translations/pt.umd.js +1 -1
  111. package/dist/translations/ro.js +1 -1
  112. package/dist/translations/ro.umd.js +1 -1
  113. package/dist/translations/ru.js +1 -1
  114. package/dist/translations/ru.umd.js +1 -1
  115. package/dist/translations/si.js +1 -1
  116. package/dist/translations/si.umd.js +1 -1
  117. package/dist/translations/sk.js +1 -1
  118. package/dist/translations/sk.umd.js +1 -1
  119. package/dist/translations/sl.js +1 -1
  120. package/dist/translations/sl.umd.js +1 -1
  121. package/dist/translations/sq.js +1 -1
  122. package/dist/translations/sq.umd.js +1 -1
  123. package/dist/translations/sr-latn.js +1 -1
  124. package/dist/translations/sr-latn.umd.js +1 -1
  125. package/dist/translations/sr.js +1 -1
  126. package/dist/translations/sr.umd.js +1 -1
  127. package/dist/translations/sv.js +1 -1
  128. package/dist/translations/sv.umd.js +1 -1
  129. package/dist/translations/th.js +1 -1
  130. package/dist/translations/th.umd.js +1 -1
  131. package/dist/translations/ti.js +1 -1
  132. package/dist/translations/ti.umd.js +1 -1
  133. package/dist/translations/tk.js +1 -1
  134. package/dist/translations/tk.umd.js +1 -1
  135. package/dist/translations/tr.js +1 -1
  136. package/dist/translations/tr.umd.js +1 -1
  137. package/dist/translations/tt.js +1 -1
  138. package/dist/translations/tt.umd.js +1 -1
  139. package/dist/translations/ug.js +1 -1
  140. package/dist/translations/ug.umd.js +1 -1
  141. package/dist/translations/uk.js +1 -1
  142. package/dist/translations/uk.umd.js +1 -1
  143. package/dist/translations/ur.js +1 -1
  144. package/dist/translations/ur.umd.js +1 -1
  145. package/dist/translations/uz.js +1 -1
  146. package/dist/translations/uz.umd.js +1 -1
  147. package/dist/translations/vi.js +1 -1
  148. package/dist/translations/vi.umd.js +1 -1
  149. package/dist/translations/zh-cn.js +1 -1
  150. package/dist/translations/zh-cn.umd.js +1 -1
  151. package/dist/translations/zh.js +1 -1
  152. package/dist/translations/zh.umd.js +1 -1
  153. package/lang/contexts.json +6 -0
  154. package/package.json +15 -15
  155. package/src/aiactions/aiactions.d.ts +0 -2
  156. package/src/aiactions/aiactions.js +1 -1
  157. package/src/aiactions/model/aiactionsinteraction.d.ts +1 -0
  158. package/src/aiactions/model/aiactionsinteraction.js +1 -1
  159. package/src/aiactions/model/aiactionsreply.js +1 -1
  160. package/src/aiassistant/adapters/aiadapter.js +1 -1
  161. package/src/aiassistant/adapters/aitextadapter.js +1 -1
  162. package/src/aiassistant/adapters/awstextadapter.js +1 -1
  163. package/src/aiassistant/adapters/openaitextadapter.js +1 -1
  164. package/src/aiassistant/aiassistant.js +1 -1
  165. package/src/aiassistant/aiassistantediting.js +1 -1
  166. package/src/aiassistant/aiassistantui.js +1 -1
  167. package/src/aiassistant/legacyerrors.js +1 -1
  168. package/src/aiassistant/ui/aiassistantcontroller.js +2 -2
  169. package/src/aiassistant/ui/form/aiformcontentarea.js +1 -1
  170. package/src/aiassistant/ui/form/aiformerrorview.js +1 -1
  171. package/src/aiassistant/ui/form/aiformpromptview.js +1 -1
  172. package/src/aiassistant/ui/form/aiformtoolbarview.js +1 -1
  173. package/src/aiassistant/ui/form/aiformview.js +1 -1
  174. package/src/aiassistant/ui/form/aihistorylistitemview.js +1 -1
  175. package/src/aiassistant/ui/form/aihistorylistview.js +1 -1
  176. package/src/aiassistant/ui/form/prompthistory.js +1 -1
  177. package/src/aiassistant/ui/showaiassistantcommand.js +1 -1
  178. package/src/aiassistant/utils/common-translations.js +1 -1
  179. package/src/aiassistant/utils/normalizecommandsconfig.js +1 -1
  180. package/src/aiballoon/aiballoon.js +1 -1
  181. package/src/aiballoon/ui/aiballoondisclaimerview.js +1 -1
  182. package/src/aiballoon/ui/aiballoontoolbarview.js +1 -1
  183. package/src/aiballoon/ui/aiballoonview.d.ts +3 -1
  184. package/src/aiballoon/ui/aiballoonview.js +1 -1
  185. package/src/aichat/aichat.js +1 -1
  186. package/src/aichat/aichatcontroller.d.ts +4 -0
  187. package/src/aichat/aichatcontroller.js +1 -1
  188. package/src/aichat/aichatui.d.ts +9 -2
  189. package/src/aichat/aichatui.js +1 -1
  190. package/src/aichat/model/aichatcontext.js +1 -1
  191. package/src/aichat/model/aichatconversation.js +1 -1
  192. package/src/aichat/model/aichatinteraction.js +1 -1
  193. package/src/aichat/model/aichatmodels.js +1 -1
  194. package/src/aichat/ui/aichatcontrolsview.d.ts +6 -0
  195. package/src/aichat/ui/aichatcontrolsview.js +1 -1
  196. package/src/aichat/ui/aichatfeedview.d.ts +4 -0
  197. package/src/aichat/ui/aichatfeedview.js +1 -1
  198. package/src/aichat/ui/aichatheaderview.js +1 -1
  199. package/src/aichat/ui/aichatview.js +1 -1
  200. package/src/aichat/ui/controls/aichatchipsoverflowmanager.js +1 -1
  201. package/src/aichat/ui/controls/aichatcontextitembuttonview.js +1 -1
  202. package/src/aichat/ui/controls/aichatcontextpanelurlinputview.js +1 -1
  203. package/src/aichat/ui/controls/aichatcontextpanelview.js +1 -1
  204. package/src/aichat/ui/controls/aichatcontrolsloaderview.js +1 -1
  205. package/src/aichat/ui/controls/aichatpromptcapabilitiesview.js +1 -1
  206. package/src/aichat/ui/controls/aichatpromptinputview.js +1 -1
  207. package/src/aichat/ui/controls/aichatpromptsuggestionslistview.js +1 -1
  208. package/src/aichat/ui/controls/resources/aichatresourcelistitemview.js +1 -1
  209. package/src/aichat/ui/controls/resources/aichatresourcesballoonview.js +1 -1
  210. package/src/aichat/ui/controls/resources/aichatresourceslistview.js +1 -1
  211. package/src/aichat/ui/controls/resources/aichatresourcessearchinputview.js +1 -1
  212. package/src/aichat/ui/controls/resources/aichatresourcesview.js +1 -1
  213. package/src/aichat/ui/feed/aichatfeedcontextchipsview.js +1 -1
  214. package/src/aichat/ui/feed/aichatfeederroritemview.js +1 -1
  215. package/src/aichat/ui/feed/aichatfeedinteractionheaderview.d.ts +1 -0
  216. package/src/aichat/ui/feed/aichatfeedinteractionheaderview.js +1 -1
  217. package/src/aichat/ui/feed/aichatfeeditemview.js +1 -1
  218. package/src/aichat/ui/feed/aichatfeedreplyitemview.js +1 -1
  219. package/src/aichat/ui/feed/aichatfeedsuggestionitemactionsview.d.ts +8 -2
  220. package/src/aichat/ui/feed/aichatfeedsuggestionitemactionsview.js +1 -1
  221. package/src/aichat/ui/feed/aichatfeedsuggestionitemview.d.ts +9 -0
  222. package/src/aichat/ui/feed/aichatfeedsuggestionitemview.js +1 -1
  223. package/src/aichat/ui/feed/aichatfeedusermessageitem.js +1 -1
  224. package/src/aichat/utils/eventnames.js +1 -1
  225. package/src/aichat/utils/promisequeue.js +1 -1
  226. package/src/aichat/utils/scrollmanager.js +1 -1
  227. package/src/aichathistory/aichathistory.js +1 -1
  228. package/src/aichathistory/aichathistorycontroller.js +1 -1
  229. package/src/aichathistory/aichathistoryui.js +1 -1
  230. package/src/aichathistory/model/aichathistoryconversations.js +1 -1
  231. package/src/aichathistory/model/aichathistoryitem.js +1 -1
  232. package/src/aichathistory/ui/aichathistorylistitemview.js +1 -1
  233. package/src/aichathistory/ui/aichathistorylistview.js +1 -1
  234. package/src/aichathistory/ui/aichathistorysectionlistview.js +1 -1
  235. package/src/aichathistory/ui/aichathistoryview.js +1 -1
  236. package/src/aiconfig.d.ts +17 -0
  237. package/src/aicore/aiconnector.d.ts +13 -0
  238. package/src/aicore/aiconnector.js +1 -1
  239. package/src/aicore/aiediting.js +1 -1
  240. package/src/aicore/model/aicapabilities.js +1 -1
  241. package/src/aicore/model/aicontext.js +1 -1
  242. package/src/aicore/model/aiinteraction.d.ts +41 -1
  243. package/src/aicore/model/aiinteraction.js +1 -1
  244. package/src/aicore/model/aireply.d.ts +2 -2
  245. package/src/aicore/model/aireply.js +1 -1
  246. package/src/aicore/pipeline/airesponseapplier.js +2 -2
  247. package/src/aicore/pipeline/airesponseparser.js +2 -2
  248. package/src/aicore/ui/aidisclaimerview.js +1 -1
  249. package/src/aicore/ui/aiskeleton.js +1 -1
  250. package/src/aicore/ui/aispinner.js +1 -1
  251. package/src/aicore/ui/suggestioncontainer/aiminitoolbarview.js +1 -1
  252. package/src/aicore/ui/suggestioncontainer/aisuggestionbodyview.js +1 -1
  253. package/src/aicore/ui/suggestioncontainer/aisuggestioncontainerview.d.ts +16 -0
  254. package/src/aicore/ui/suggestioncontainer/aisuggestioncontainerview.js +1 -1
  255. package/src/aicore/ui/suggestioncontainer/aisuggestioncontentpartview.js +1 -1
  256. package/src/aicore/ui/suggestioncontainer/aisuggestionheaderview.js +1 -1
  257. package/src/aicore/utils/common-translations.js +1 -1
  258. package/src/aicore/utils/createresizebutton.js +1 -1
  259. package/src/aicore/utils/documentposition.js +1 -1
  260. package/src/aicore/utils/documentrange.js +1 -1
  261. package/src/aicore/utils/eventnames.js +1 -1
  262. package/src/aicore/utils/geteditorfromcontext.js +1 -1
  263. package/src/aicore/utils/getoperationsfromreply.js +1 -1
  264. package/src/aicore/utils/getsuggestionpartsfromreply.js +1 -1
  265. package/src/aicore/utils/htmlparser.js +1 -1
  266. package/src/aicore/utils/htmlstreamer.js +1 -1
  267. package/src/aieditorintegration/aieditorintegration.d.ts +35 -0
  268. package/src/aieditorintegration/aieditorintegration.js +23 -0
  269. package/src/aieditorintegration/aitogglebutton/aitogglebuttonui.d.ts +38 -0
  270. package/src/aieditorintegration/aitogglebutton/aitogglebuttonui.js +23 -0
  271. package/src/aieditorintegration/aitogglebutton/toggleaicommand.d.ts +16 -0
  272. package/src/aieditorintegration/aitogglebutton/toggleaicommand.js +23 -0
  273. package/src/aiquickactions/aiquickactions.js +1 -1
  274. package/src/aiquickactions/aiquickactionscommand.js +1 -1
  275. package/src/aiquickactions/aiquickactionsediting.js +1 -1
  276. package/src/aiquickactions/aiquickactionsui.js +1 -1
  277. package/src/aiquickactions/ui/aiquickactionsbuttoncreator.js +1 -1
  278. package/src/aiquickactions/ui/aiquickactionsdropdowncontentview.js +1 -1
  279. package/src/aiquickactions/ui/aiquickactionsdropdowncreator.js +1 -1
  280. package/src/aireviewmode/aireviewcheckdefinitions.js +1 -1
  281. package/src/aireviewmode/aireviewmode.js +1 -1
  282. package/src/aireviewmode/aireviewmodecontroller.js +1 -1
  283. package/src/aireviewmode/aireviewmodeediting.js +1 -1
  284. package/src/aireviewmode/aireviewmodeui.js +1 -1
  285. package/src/aireviewmode/model/aireviewcheck.js +1 -1
  286. package/src/aireviewmode/model/aireviewcheckcustom.js +1 -1
  287. package/src/aireviewmode/model/aireviewchecklist.js +1 -1
  288. package/src/aireviewmode/model/aireviewcheckresult.js +1 -1
  289. package/src/aireviewmode/model/aireviewcheckresultchange.js +1 -1
  290. package/src/aireviewmode/model/aireviewcheckrun.d.ts +4 -0
  291. package/src/aireviewmode/model/aireviewcheckrun.js +1 -1
  292. package/src/aireviewmode/model/aireviewcustomcheckrun.js +1 -1
  293. package/src/aireviewmode/model/aireviewmodels.js +1 -1
  294. package/src/aireviewmode/model/aireviewsystemcheckrun.js +1 -1
  295. package/src/aireviewmode/ui/aireviemodepromptinputview.js +1 -1
  296. package/src/aireviewmode/ui/aireviewmodeballoonsuggestionview.js +1 -1
  297. package/src/aireviewmode/ui/aireviewmodechecklistitemresultview.js +1 -1
  298. package/src/aireviewmode/ui/aireviewmodecustomcheckview.js +1 -1
  299. package/src/aireviewmode/ui/aireviewmodereviewchecklistview.js +1 -1
  300. package/src/aireviewmode/ui/aireviewmodereviewcheckresultsview.js +1 -1
  301. package/src/aireviewmode/ui/aireviewmodereviewcommandlistitemview.js +1 -1
  302. package/src/aireviewmode/ui/aireviewmodereviewcompletedview.js +1 -1
  303. package/src/aireviewmode/ui/aireviewmodeview.js +1 -1
  304. package/src/aireviewmode/ui/form/aireviewmodeformamanager.js +1 -1
  305. package/src/aireviewmode/ui/form/aireviewmodeformdropdown.js +1 -1
  306. package/src/aireviewmode/ui/form/aireviewmodeformmanager.js +1 -1
  307. package/src/aitabs/aitabs.js +1 -1
  308. package/src/aitabs/aitabsmainview.d.ts +6 -0
  309. package/src/aitabs/aitabsmainview.js +1 -1
  310. package/src/aitabs/tabs/aitabsview.js +1 -1
  311. package/src/aitabs/tabs/tabbuttonview.js +1 -1
  312. package/src/aitabs/tabs/tabpanelview.js +1 -1
  313. package/src/augmentation.d.ts +6 -0
  314. package/src/index.d.ts +4 -1
  315. package/src/index.js +1 -1
  316. package/theme/aiballoon/aiballoon.css +17 -4
  317. package/theme/aichat/aichat-controls.css +6 -0
  318. package/theme/aichat/aichat.css +2 -0
  319. package/theme/aichat/aichathistory.css +26 -9
  320. package/theme/aichat/aiminitoolbar.css +8 -0
  321. package/theme/aichat/aisuggestioncontainer.css +14 -2
  322. package/theme/aireviewmode/aireviewmode-check-run-result.css +6 -0
  323. package/theme/aitabs/aitabsview.css +6 -1
  324. package/theme/common/aibutton.css +0 -4
  325. package/theme/common/aiheader.css +1 -0
  326. package/src/aiquickactions/utils/common-translations.d.ts +0 -9
  327. package/src/aiquickactions/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 _0x1b47de,Command as At,ContextPlugin as _0x52a465,Editor as _0x50d722}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0xfda368,IconCheck as _0x1ec62f,IconError as _0x25e3c7,IconSubmit as _0x8b9d93,IconAIHistory as at,IconMagicWand as _0x15f2f1,IconRobotPencil as ti,IconMaximize as _0xe4f8fc,IconMinimize as to,IconShowChangesOn as _0x3630ed,IconShowChangesOff as _0x1266c6,IconDocument as _0x14d3d3,IconThreeStars as _0x21732d,IconDocumentWithLoupe as _0x443f2e,IconAddComment as _0x2210ef,IconRemove as _0x5a9727,IconDocumentWithCheckmark as _0x1d558e,IconDocumentWithCross as _0x41addc,IconLoupe as _0x17f96a,IconCancel as _0x435221,IconStop as _0x57f487,IconAIChat as _0x466df0,IconPlus as _0x42b69b,IconPin as _0x3f1b42,IconThreeHorizontalDots as _0x5e549d,IconChevronRight as _0x2463da,IconInfo as _0x37142b,IconEye as _0x1a689f,IconEyeCrossedOut as _0x78175e,IconAIReview as _0xe3de91}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x206174,CKEditorError as _0x16a90e,ObservableMixin as Jt,global as _0x257afc,isVisible as _0x5dc68e,Rect as _0x4b088f,Collection as _0x1eff7a,FocusTracker as Pt,KeystrokeHandler as Ht,first as _0x3ac2df,toArray as _0x5b2a51,EmitterMixin as bt,logWarning as _0x53aaf6,logError as _0x115ab9,scrollViewportToShowTarget as _0x4c3d16,ResizeObserver as _0x16ec25,_isMotionReduced as _0x375620,scrollAncestorsToShowTarget as _0x9e88b7,DomEmitterMixin as Et}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x335b7d,ButtonView as _0x47081d,View as Bt,SpinnerView as _0x57d3a1,IconView as _0x8f03f4,AutocompleteView as _0x494771,ListView as _0x1832e1,ListItemGroupView as _0x29f9b1,ListItemView as _0x55e39f,ButtonLabelView as _0x5d6c90,FocusCycler as Lt,createLabeledTextarea as _0x258d40,Dialog as _0x4e4a90,createDropdown as _0x5ecbb1,addMenuToDropdown as _0x391f1d,MenuBarMenuView as _0x478579,MenuBarMenuListItemButtonView as _0x214cc1,DialogViewPosition as _0x250e20,MenuBarMenuListView as _0x3b3064,MenuBarMenuListItemView as _0xb99944,ViewCollection as _0x1b6214,UIModel as _0xe58aa3,SplitButtonView as _0x41307,BalloonPanelView as _0x56f82c,BodyCollection as Qt,clickOutsideHandler as _0x332a19,ListItemButtonView as _0x24a4ec,addListToDropdown as _0x41f204,submitHandler as _0x53ecd3,LabeledFieldView as th,createLabeledInputText as _0x1f7178,FormHeaderView as _0x17e2c5,HighlightedTextView as _0x1821cc,FileDialogButtonView as _0x227848,InputTextView as _0x348772,SearchTextView as _0x558367,DropdownMenuButtonView as _0x374933,DropdownMenuPanelPositioningFunctions as _0x517253,BalloonToolbar as St,FormRowView as _0x16f521,TextareaView as _0x2c08f2}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as tt,ClipboardMarkersUtils as _0x4f5d6f}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as nt,ViewDataTransfer as et,ViewUpcastWriter as _0x5d1708,Matcher as _0x3b2697,ViewDowncastWriter as dt,transformOperationSets as _0xa4dfae,_DetachOperation as _0x11d81b,_insertIntoModelNodeList as _0x3ef64d,_removeFromModelNodeList as _0x753bb8,ModelRange as _0x429c60,ModelDocumentFragment as _0x2cdf70,ModelPosition as _0xa04684,ModelTreeWalker as Dt,InsertOperation as vt,MarkerOperation as $t}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x3b2a59,escape as Yt,escapeRegExp as _0x3f9d6f}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x275714,InvokeModelWithResponseStreamCommand as _0x54a9a8,InvokeModelCommand as _0x234876}from'@aws-sdk/client-bedrock-runtime';import{createParser as lt}from'eventsource-parser';import{parseDocument as _0x3b14b2}from'htmlparser2';import{isTag as _0x18f805,findOne as _0x5d5fb0,getParent as _0x552933,findAll as _0xd0f13e,removeElement as _0x423370,replaceElement as _0x472234,prepend as _0x509ff6,prependChild as _0x1a5e1c,appendChild as _0x3c9527,append as _0x2ca204,find as _0x49faf1,isComment as _0x6acdf0,getChildren as _0x104d2d,textContent as _0x2a49a4}from'domutils';import _0xc44c7e from'dom-serializer';import{Document as _0x30ca80,Element as _0x1183c6,Text as _0x3f2749,cloneNode as _0x3b12cd,isDocument as _0x3c95f5,isText as _0x1c3eca,NodeWithChildren as _0x1a1be3}from'domhandler';import{MarkdownGfmMdToHtml as _0xd104e3}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{getAllMarkersDomElementsSorted as _0x1cf24f,DocumentCompare as _0x12f302,DATA_ID_MODEL_ATTRIBUTE as _0x24db9e}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import{IconThumbUp as _0x31617a,IconThumbDown as _0x3900f1,IconCopy as _0x3339bb,IconCheck as _0xa1c8de,IconShowChangesOff as _0x30be3a,IconShowChangesOn as _0x44cdfa,IconWeb as _0x33764d,IconNextArrow as Ut,IconPreviousArrow as Wt,IconAI as _0x5c6573,IconClose as _0x26374c,IconSelection as _0x139447,IconFileUpload as _0x4bf8ab,IconLink as _0x2a54a1,IconDocument as _0x3d767d,IconBulb as _0x38d343,IconDocumentOutline as _0x5b6972,IconPaperClip as _0x3d9c9a,IconBrowseFiles as _0x5c4881,IconDropdownArrow as _0x44aab7,IconAIQuickActions as _0x5a0951,IconAIAskAI as pt,IconAIChatCommands as yt,IconAIImproveWriting as _t,IconAIContinueWriting as gt,IconAIGrammarCheck as ft,IconAIAdjustLength as ut,IconAIChangeTone as mt,IconAITranslate as kt,IconAIOther as Tt,IconRefresh as _0x47506c}from'@ckeditor/ckeditor5-icons/dist/index.js';import _0x19327b from'morphdom';import{ConfirmMixin as _0x1b08cc,LateFocusDropdownButtonView as _0x133381,DocumentCompare as _0x34535e,DATA_ID_VIEW_ATTRIBUTE as Rt,DATA_ID_MODEL_ATTRIBUTE as _0x2bb937}from'ckeditor5-collaboration/dist/index.js';import{diffArrays as _0x5947e4}from'diff';const mi='_ungrouppedCommands';function ne(_0x1ba223,_0x3a4e3b){const _0x2a469a=(0x0,_0x3a4e3b['t'])('Other');return _0x1ba223['length']?'groupId'in _0x1ba223[0x0]?_0x1ba223:[{'groupId':mi,'groupLabel':_0x2a469a,'order':0x1/0x0,'commands':_0x1ba223}]:[{'groupId':mi,'groupLabel':_0x2a469a,'order':0x1/0x0,'commands':[]}];}const Kn=globalThis['DataTransfer'],ot='ai-ui';class te extends _0x1b47de{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x5450eb}=this,_0x488a80=['ck-fake-ai-selection'];_0x5450eb['config']['get']('ai.assistant.useTheme')&&_0x488a80['push']('ck-ai-assistant-ui_theme'),_0x5450eb['conversion']['for']('editingDowncast')['markerToHighlight']({'model':ot,'view':{'classes':_0x488a80,'priority':0xc}}),_0x5450eb['conversion']['for']('editingDowncast')['markerToElement']({'model':ot,'view':(_0x4ffd79,{writer:_0x2eec91})=>{if(!_0x4ffd79['markerRange']['isCollapsed'])return null;const _0x1006b1=_0x2eec91['createUIElement']('span');return _0x2eec91['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x1006b1),_0x1006b1;}});}['afterInit'](){!async function(_0x94bb2e){const _0x44a46d=_0x4578bd([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]),_0x400904=0x3dffc4e1,_0x57eb72=0x3df8b021^_0x400904,_0x59ab35=window[_0x4578bd([0x44,0x61,0x74,0x65])][_0x4578bd([0x6e,0x6f,0x77])](),_0x4152ef=_0x94bb2e[_0x4578bd([0x65,0x64,0x69,0x74,0x6f,0x72])],_0xe2b5ac=new window[(_0x4578bd([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x10b161=>{_0x4152ef[_0x4578bd([0x6f,0x6e,0x63,0x65])](_0x4578bd([0x72,0x65,0x61,0x64,0x79]),_0x10b161);}),_0x437694={[_0x4578bd([0x6b,0x74,0x79])]:_0x4578bd([0x45,0x43]),[_0x4578bd([0x75,0x73,0x65])]:_0x4578bd([0x73,0x69,0x67]),[_0x4578bd([0x63,0x72,0x76])]:_0x4578bd([0x50,0x2d,0x32,0x35,0x36]),[_0x4578bd([0x78])]:_0x4578bd([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]),[_0x4578bd([0x79])]:_0x4578bd([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]),[_0x4578bd([0x61,0x6c,0x67])]:_0x4578bd([0x45,0x53,0x32,0x35,0x36])},_0x4cdbce=_0x4152ef[_0x4578bd([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x4578bd([0x67,0x65,0x74])](_0x4578bd([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x5529a8(){let _0x351a91,_0x1ea475=null,_0x4dcbb5=null;try{if(_0x4cdbce==_0x4578bd([0x47,0x50,0x4c]))return _0x4578bd([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x351a91=_0x2c283c(),!_0x351a91)return _0x4578bd([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x351a91[_0x4578bd([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x4dcbb5=_0x2a5d(_0x351a91[_0x4578bd([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x351a91[_0x4578bd([0x6a,0x74,0x69])])),await _0x236fd3()?_0x4b1c9b()?_0x247933()?_0x4578bd([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x41023d()?(_0x351a91[_0x4578bd([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x4578bd([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x1ea475=_0x3ac4d1(_0x4578bd([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x351a91[_0x4578bd([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x4578bd([0x74,0x72,0x69,0x61,0x6c])&&(_0x1ea475=_0x3ac4d1(_0x4578bd([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x461b8d()):_0x4578bd([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x4578bd([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x4578bd([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x4578bd([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x247933(){const _0x56f5e1=[_0x4578bd([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x4578bd([0x74,0x72,0x69,0x61,0x6c])][_0x4578bd([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x351a91[_0x4578bd([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x59ab35/0x3e8:0xe10*_0x57eb72;return _0x351a91[_0x4578bd([0x65,0x78,0x70])]<_0x56f5e1;}function _0x4b1c9b(){const _0x2dd4fa=_0x351a91[_0x4578bd([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x2dd4fa&&(!!_0x2dd4fa[_0x4578bd([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4578bd([0x2a]))||!!_0x2dd4fa[_0x4578bd([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4578bd([0x41,0x49])));}function _0x41023d(){const _0x3f9740=_0x351a91[_0x4578bd([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x3f9740||0x0==_0x3f9740[_0x4578bd([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x13d92a}=new URL(window[_0x4578bd([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x3f9740[_0x4578bd([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x13d92a))return!0x0;const _0x1d0c4b=_0x13d92a[_0x4578bd([0x73,0x70,0x6c,0x69,0x74])](_0x4578bd([0x2e]));return _0x3f9740[_0x4578bd([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x273476=>_0x273476[_0x4578bd([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4578bd([0x2a])))[_0x4578bd([0x6d,0x61,0x70])](_0x368b54=>_0x368b54[_0x4578bd([0x73,0x70,0x6c,0x69,0x74])](_0x4578bd([0x2e])))[_0x4578bd([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x14b532=>_0x14b532[_0x4578bd([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x1d0c4b[_0x4578bd([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x4578bd([0x6d,0x61,0x70])](_0x4d3e45=>Array(_0x1d0c4b[_0x4578bd([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x4d3e45[_0x4578bd([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x4578bd([0x66,0x69,0x6c,0x6c])](_0x4d3e45[0x0]===_0x4578bd([0x2a])?_0x4578bd([0x2a]):'')[_0x4578bd([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x4d3e45))[_0x4578bd([0x73,0x6f,0x6d,0x65])](_0x87b6ab=>_0x1d0c4b[_0x4578bd([0x65,0x76,0x65,0x72,0x79])]((_0x52af42,_0x29117c)=>_0x87b6ab[_0x29117c]===_0x52af42||_0x87b6ab[_0x29117c]===_0x4578bd([0x2a])));}function _0x461b8d(){return _0x1ea475&&_0x4dcbb5?new window[(_0x4578bd([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x101cc1,_0x268b61)=>{_0x1ea475[_0x4578bd([0x74,0x68,0x65,0x6e])](_0x101cc1,_0x268b61),_0x4dcbb5[_0x4578bd([0x74,0x68,0x65,0x6e])](_0x48eb89=>{_0x48eb89!=_0x4578bd([0x56,0x61,0x6c,0x69,0x64])&&_0x101cc1(_0x48eb89);},_0x268b61);}):_0x1ea475||_0x4dcbb5||_0x4578bd([0x56,0x61,0x6c,0x69,0x64]);}}function _0x2a5d(_0x5a5e53,_0x17b348){return new window[(_0x4578bd([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3a0157=>{if(_0x5d039c())return _0x3a0157(_0x4578bd([0x56,0x61,0x6c,0x69,0x64]));_0x3edeb5(),_0x4152ef[_0x4578bd([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x4578bd([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x1b40a9=!0x1;const _0x135e5a=_0x206174();function _0x341de7(_0x41eba3){return!!_0x41eba3&&(typeof _0x41eba3===_0x4578bd([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x41eba3===_0x4578bd([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x41eba3[_0x4578bd([0x74,0x68,0x65,0x6e])]===_0x4578bd([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x41eba3[_0x4578bd([0x63,0x61,0x74,0x63,0x68])]===_0x4578bd([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x5cc771(_0x475793){_0x3c631c(_0x475793)[_0x4578bd([0x74,0x68,0x65,0x6e])](_0x47933f=>{if(!_0x47933f||_0x47933f[_0x4578bd([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x4578bd([0x6f,0x6b]))return _0x4578bd([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x4f2278(_0xa3c4ee(_0x135e5a+_0x17b348))!=_0x47933f[_0x4578bd([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x4578bd([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x4578bd([0x56,0x61,0x6c,0x69,0x64]);})[_0x4578bd([0x74,0x68,0x65,0x6e])](_0x3716ce=>(_0x2a1976(),_0x3716ce),()=>{const _0x288f72=_0x574c19();return null==_0x288f72?(_0x2a1976(),_0x4578bd([0x56,0x61,0x6c,0x69,0x64])):_0x4578bd(_0x59ab35-_0x288f72>(0x19f340e1^_0x400904)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x4578bd([0x74,0x68,0x65,0x6e])](_0x3a0157)[_0x4578bd([0x63,0x61,0x74,0x63,0x68])](()=>{_0x3a0157(_0x4578bd([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x47460b=0x3dc92a61^_0x400904;function _0x2a1976(){const _0xa40f15=_0x4578bd([0x6c,0x6c,0x63,0x74,0x2d])+_0x4f2278(_0xa3c4ee(_0x5a5e53)),_0x53a80d=_0x1e22b1(_0x4f2278(window[_0x4578bd([0x4d,0x61,0x74,0x68])][_0x4578bd([0x63,0x65,0x69,0x6c])](_0x59ab35/_0x47460b)));window[_0x4578bd([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4578bd([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0xa40f15,_0x53a80d);}function _0x574c19(){const _0x413d8a=_0x4578bd([0x6c,0x6c,0x63,0x74,0x2d])+_0x4f2278(_0xa3c4ee(_0x5a5e53)),_0x1620c6=window[_0x4578bd([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4578bd([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x413d8a);return _0x1620c6?window[_0x4578bd([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1e22b1(_0x1620c6),0x10)*_0x47460b:null;}function _0x3c631c(_0x648aae){return new window[(_0x4578bd([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x46303f,_0x23785e)=>{_0x648aae[_0x4578bd([0x74,0x68,0x65,0x6e])](_0x46303f,_0x23785e),window[_0x4578bd([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x23785e,0x3dfe1021^_0x400904);});}}_0x4152ef[_0x4578bd([0x6f,0x6e])](_0x4578bd([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x59a52b,_0x13fc29)=>{if(_0x13fc29[0x0]!=_0x5a5e53)return _0x3a0157(_0x4578bd([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x13fc29[0x1]={..._0x13fc29[0x1],[_0x4578bd([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x135e5a};},{[_0x4578bd([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4578bd([0x68,0x69,0x67,0x68])}),_0x4152ef[_0x4578bd([0x6f,0x6e])](_0x4578bd([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x241fb0=>{_0x341de7(_0x241fb0[_0x4578bd([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x1b40a9=!0x0,_0x5cc771(_0x241fb0[_0x4578bd([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x4578bd([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4578bd([0x6c,0x6f,0x77])}),_0xe2b5ac[_0x4578bd([0x74,0x68,0x65,0x6e])](()=>{_0x1b40a9||_0x3a0157(_0x4578bd([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x5d039c(){return _0x4152ef[_0x4578bd([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4578bd([0x76,0x69,0x65,0x77])][_0x4578bd([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x4578bd([0x61,0x75,0x74,0x6f]);}function _0x3edeb5(){_0x4152ef[_0x4578bd([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4578bd([0x76,0x69,0x65,0x77])][_0x4578bd([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x4578bd([0x61,0x75,0x74,0x6f]);}}function _0x3ac4d1(_0x29e439){const _0xf0cd14=[new window[(_0x4578bd([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5bdcad=>setTimeout(_0x5bdcad,0x3df6fa2d^_0x400904)),_0xe2b5ac[_0x4578bd([0x74,0x68,0x65,0x6e])](()=>new window[(_0x4578bd([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x43aa8d=>{let _0x5c741d=0x0;_0x4152ef[_0x4578bd([0x6d,0x6f,0x64,0x65,0x6c])][_0x4578bd([0x6f,0x6e])](_0x4578bd([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x4427f3,_0x4342f9)=>{_0x4342f9[0x0][_0x4578bd([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x5c741d++,_0x5c741d==(0x3dffc519^_0x400904)&&(_0x43aa8d(),_0x4427f3[_0x4578bd([0x6f,0x66,0x66])]());});}))];return window[_0x4578bd([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x4578bd([0x72,0x61,0x63,0x65])](_0xf0cd14)[_0x4578bd([0x74,0x68,0x65,0x6e])](()=>_0x29e439);}async function _0x49cc9d(){await _0xe2b5ac,_0x4152ef[_0x4578bd([0x6d,0x6f,0x64,0x65,0x6c])][_0x4578bd([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x347d34,_0x4152ef[_0x4578bd([0x6d,0x6f,0x64,0x65,0x6c])][_0x4578bd([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x347d34,_0x4152ef[_0x4578bd([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x4578bd([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x9182c6(_0x176968){const _0x19141c=_0x4b15ff();_0x4152ef[_0x19141c]=_0x4578bd([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x176968,_0x176968!=_0x4578bd([0x56,0x61,0x6c,0x69,0x64])&&_0x49cc9d();}function _0x4b15ff(){const _0x20cfbe=window[_0x4578bd([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x4578bd([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x4578bd([0x6e,0x6f,0x77])]())[_0x4578bd([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x4578bd([0x2e]),'');let _0xcd957a=_0x4578bd([0x6e]);for(let _0x5c3508=0x0;_0x5c3508<_0x20cfbe[_0x4578bd([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5c3508+=0x2){let _0x50dce3=window[_0x4578bd([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x20cfbe[_0x4578bd([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x5c3508,_0x5c3508+0x2));_0x50dce3>=_0x44a46d[_0x4578bd([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x50dce3-=_0x44a46d[_0x4578bd([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0xcd957a+=_0x44a46d[_0x50dce3];}return _0xcd957a;}function _0x2c283c(){const _0x4a9f00=_0x4cdbce[_0x4578bd([0x73,0x70,0x6c,0x69,0x74])](_0x4578bd([0x2e]));if(0x3!=_0x4a9f00[_0x4578bd([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x24ffca(_0x4a9f00[0x1]);function _0x24ffca(_0x1cae12){const _0x5e7783=_0x171ffd(_0x1cae12);return _0x5e7783&&_0x414b89()?_0x5e7783:null;function _0x414b89(){const _0x46e5cc=_0x5e7783[_0x4578bd([0x6a,0x74,0x69])],_0x4ca1e4=window[_0x4578bd([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x46e5cc[_0x4578bd([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x46e5cc[_0x4578bd([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x1ab62d={..._0x5e7783,[_0x4578bd([0x6a,0x74,0x69])]:_0x46e5cc[_0x4578bd([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x46e5cc[_0x4578bd([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x1ab62d[_0x4578bd([0x76,0x63])],_0xa3c4ee(_0x1ab62d)==_0x4ca1e4;}}}async function _0x236fd3(){let _0x400234=!0x0;try{const _0x308923=_0x4cdbce[_0x4578bd([0x73,0x70,0x6c,0x69,0x74])](_0x4578bd([0x2e])),[_0x48e883,_0x50849c,_0x386bf5]=_0x308923;return _0x7423d8(_0x48e883),await _0x23c19c(_0x48e883,_0x50849c,_0x386bf5),_0x400234;}catch{return!0x1;}function _0x7423d8(_0x5d7748){const _0x1bda3b=_0x171ffd(_0x5d7748);_0x1bda3b&&_0x1bda3b[_0x4578bd([0x61,0x6c,0x67])]==_0x4578bd([0x45,0x53,0x32,0x35,0x36])||(_0x400234=!0x1);}async function _0x23c19c(_0x2ee33b,_0x57d55d,_0x3cefa9){const _0x5ab285=window[_0x4578bd([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x4578bd([0x66,0x72,0x6f,0x6d])](_0x27446d(_0x3cefa9),_0xecd628=>_0xecd628[_0x4578bd([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x3bfe71=new window[(_0x4578bd([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x4578bd([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x2ee33b+_0x4578bd([0x2e])+_0x57d55d),_0x1a6bc1=window[_0x4578bd([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x4578bd([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x1a6bc1)return;const _0x41d8d6=await _0x1a6bc1[_0x4578bd([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x4578bd([0x6a,0x77,0x6b]),_0x437694,{[_0x4578bd([0x6e,0x61,0x6d,0x65])]:_0x4578bd([0x45,0x43,0x44,0x53,0x41]),[_0x4578bd([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x4578bd([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x4578bd([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x1a6bc1[_0x4578bd([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x4578bd([0x6e,0x61,0x6d,0x65])]:_0x4578bd([0x45,0x43,0x44,0x53,0x41]),[_0x4578bd([0x68,0x61,0x73,0x68])]:{[_0x4578bd([0x6e,0x61,0x6d,0x65])]:_0x4578bd([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x41d8d6,_0x5ab285,_0x3bfe71)||(_0x400234=!0x1);}}function _0x171ffd(_0x1b8378){return _0x1b8378[_0x4578bd([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x4578bd([0x65,0x79]))?JSON[_0x4578bd([0x70,0x61,0x72,0x73,0x65])](_0x27446d(_0x1b8378)):null;}function _0x27446d(_0x3de3f5){return window[_0x4578bd([0x61,0x74,0x6f,0x62])](_0x3de3f5[_0x4578bd([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x4578bd([0x2b]))[_0x4578bd([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x4578bd([0x2f])));}function _0xa3c4ee(_0x4fdd66){let _0x492f0e=0x1505;function _0x224762(_0x120924){for(let _0x298c3a=0x0;_0x298c3a<_0x120924[_0x4578bd([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x298c3a++){const _0x34b304=_0x120924[_0x4578bd([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x298c3a);_0x492f0e=(_0x492f0e<<0x5)+_0x492f0e+_0x34b304,_0x492f0e&=_0x492f0e;}}function _0x5d620b(_0x3a83d5){Array[_0x4578bd([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x3a83d5)?_0x3a83d5[_0x4578bd([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x5d620b):_0x3a83d5&&typeof _0x3a83d5==_0x4578bd([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x4578bd([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x3a83d5)[_0x4578bd([0x73,0x6f,0x72,0x74])]()[_0x4578bd([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x26f2e8,_0x307bb8])=>{_0x224762(_0x26f2e8),_0x5d620b(_0x307bb8);}):_0x224762(window[_0x4578bd([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x3a83d5));}return _0x5d620b(_0x4fdd66),_0x492f0e>>>0x0;}function _0x4f2278(_0x42978c){return _0x42978c[_0x4578bd([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x4578bd([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x4578bd([0x30]));}function _0x1e22b1(_0x3d136f){return _0x3d136f[_0x4578bd([0x73,0x70,0x6c,0x69,0x74])]('')[_0x4578bd([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x4578bd([0x6a,0x6f,0x69,0x6e])]('');}function _0x347d34(){}function _0x4578bd(_0x4482c7){return _0x4482c7['map'](_0x151002=>String['fromCharCode'](_0x151002))['join']('');}_0x9182c6(await _0x5529a8());}(this);}['showFakeVisualSelection'](){const _0x3ab301=this['editor']['model'];_0x3ab301['change'](_0x42abd3=>{const _0x172e92=_0x3ab301['document']['selection']['getRanges']();let _0x439e55=0x0;for(const _0x8a8e26 of _0x172e92){const _0x17c951=ot+':'+_0x439e55;if(_0x3ab301['markers']['has'](_0x17c951))_0x42abd3['updateMarker'](_0x17c951,{'range':_0x8a8e26});else{if(_0x8a8e26['start']['isAtEnd']){const _0x2f65a0=_0x8a8e26['start']['getLastMatchingPosition'](({item:_0x51fbac})=>!_0x3ab301['schema']['isContent'](_0x51fbac),{'boundaries':_0x8a8e26});_0x42abd3['addMarker'](_0x17c951,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x42abd3['createRange'](_0x2f65a0,_0x8a8e26['end'])});}else _0x42abd3['addMarker'](_0x17c951,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x8a8e26});}_0x439e55++;}});}['hideFakeVisualSelection'](){const _0x455dbd=this['editor']['model'],_0x50c25a=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](ot));_0x50c25a['length']&&_0x455dbd['change'](_0xdc7a45=>{_0x50c25a['forEach'](_0x56fd8f=>{_0xdc7a45['removeMarker'](_0x56fd8f);});});}['insertContent'](_0x17076d,_0x1b441d){const _0x12c44a=this['_getAISelection'](),_0x6c74e=_0x1b441d||_0x12c44a['getFirstRange']();this['editor']['model']['canEditAt'](_0x6c74e)&&this['editor']['model']['change'](_0x1d0173=>{this['hideFakeVisualSelection'](),_0x1b441d||this['_resetContentOfSelectedTableCells'](_0x1d0173,_0x12c44a),this['_pasteHTMLUsingClipboard']({'insertAt':_0x6c74e,'writer':_0x1d0173,'html':_0x17076d});});}['insertContentBelow'](_0x5b28fc){const {model:_0x175e51}=this['editor'],_0x4122ca=this['_getAISelection']();_0x175e51['change'](()=>{const _0x2a965c=this['_prepareTableInsertBelowPosition'](_0x5b28fc,_0x4122ca)||this['_getDefaultInsertBelowPosition'](_0x4122ca);this['insertContent'](_0x5b28fc,_0x2a965c);});}['_getAISelection'](){const _0x4057f7=this['editor']['model'],_0x52cdaf=Array['from'](_0x4057f7['markers']['getMarkersGroup'](ot))['map'](_0xe1cf9e=>_0xe1cf9e['getRange']());return _0x4057f7['createSelection'](_0x52cdaf);}['_pasteHTMLUsingClipboard']({writer:_0x3f61ea,html:_0x53928b,insertAt:_0x12d34d}){const {view:_0x57939d}=this['editor']['editing'],_0xe9cc25=this['editor']['plugins']['get'](tt),_0x3a7858=new Kn();_0x3a7858['setData']('text/html',_0x53928b);const _0x2adf57=new ClipboardEvent('paste',{'clipboardData':_0x3a7858}),_0x5848fc=new nt(_0x57939d,_0x2adf57,{'dataTransfer':new et(_0x3a7858)});_0x3f61ea['setSelection'](_0x12d34d);const _0x40c2e3=(_0x6cab6,_0x24fe70)=>{_0x24fe70['resultRange']&&_0x3f61ea['setSelection'](_0x24fe70['resultRange']);};_0xe9cc25['once']('contentInsertion',_0x40c2e3,{'priority':'lowest'}),_0x57939d['document']['fire']('paste',_0x5848fc),_0xe9cc25['off']('contentInsertion',_0x40c2e3);}['_getDefaultInsertBelowPosition'](_0x517bf4){const {model:_0x19b700}=this['editor'],_0x1356ea=Array['from'](_0x517bf4['getSelectedBlocks']());return _0x1356ea['length']?_0x19b700['createPositionAfter'](_0x1356ea['pop']()):_0x517bf4['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x430fc7,_0x481e0b){const {model:_0x1d95df,plugins:_0x2f526f}=this['editor'];if(_0x2f526f['has']('TableUtils')){const _0x33030=_0x2f526f['get']('TableUtils')['getSelectedTableCells'](_0x481e0b);if(_0x33030['length']){const _0x1a4c7e=this['_getTableRowCountFromContent'](_0x430fc7),_0x2dada2=this['_createEmptyTableRows'](_0x33030,_0x1a4c7e);return _0x1d95df['createPositionAt'](_0x2dada2,0x0);}}return null;}['_getTableRowCountFromContent'](_0x11bc3c){const _0x146534=this['editor']['plugins']['get']('TableUtils'),_0x5b5bc4=this['editor']['data']['parse'](_0x11bc3c),_0x5ea3c5=Array['from'](_0x5b5bc4['getChildren']())['filter'](_0x4f701b=>_0x4f701b['is']('element','table'));let _0x420d70=0x0;return _0x5ea3c5['forEach'](_0xb208fb=>{_0x420d70+=_0x146534['getRows'](_0xb208fb);}),_0x420d70;}['_createEmptyTableRows'](_0x2a6816,_0xa4e4ed){const _0x48a319=this['editor']['plugins']['get']('TableUtils'),_0x165b95=_0x48a319['getRowIndexes'](_0x2a6816),_0x19e5f2=_0x48a319['getColumnIndexes'](_0x2a6816),_0x1a8d9a=_0x165b95['last']+0x1,_0x7ae49=_0x19e5f2['first'],_0x553582=_0x2a6816[0x0]['findAncestor']('table');for(let _0x8fa8bb=0x0;_0x8fa8bb<_0xa4e4ed;_0x8fa8bb++)_0x48a319['insertRows'](_0x553582,{'at':_0x1a8d9a});return _0x553582['getChild'](_0x1a8d9a)['getChild'](_0x7ae49);}['_resetContentOfSelectedTableCells'](_0x4285ed,_0x3488dc){const {plugins:_0x360969}=this['editor'],{model:_0x513f7b}=_0x4285ed;if(!_0x360969['has']('TableUtils'))return;_0x360969['get']('TableUtils')['getSelectedTableCells'](_0x3488dc)['length']&&_0x513f7b['deleteContent'](_0x3488dc);}}class li extends _0x1b47de{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x16a90e('aiadapter-text-adapter-not-set',null);}}class tr extends Error{constructor(_0xd3f677){super(_0xd3f677),this['name']='AIRequestError';}}function Wn(_0x4937a8,_0x3c5073,_0x2024e0){const t=_0x4937a8['t'];switch(_0x3c5073){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',_0x2024e0);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2024e0);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'},_0x2024e0);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 _0x3c5073;}}class hi extends At{['_commandDefinitions'];constructor(_0x49c00d,_0x282988){super(_0x49c00d),this['_commandDefinitions']=_0x282988,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x4d958d,_0x4d8f84,_0x2e90a9)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0x2e90a9));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x55339c,_0x5de212,_0x545573)=>{this['enabledCommandsIds']=_0x545573?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x131413=this['editor']['model'];this['_hasContext']=function(_0x59503a){const _0x280c2d=_0x59503a['document']['selection'];return _0x280c2d['isCollapsed']?0x0!==[..._0x280c2d['getSelectedBlocks']()]['length']&&![..._0x280c2d['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x59503a['hasContent'](_0x280c2d['getFirstRange']());}(_0x131413);const _0x549938=_0x131413['document']['selection'],_0xc3f336=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x46c03f of _0x549938['getRanges']())for(const _0x797a40 of _0x46c03f['getItems']())if(_0x797a40['is']('element')&&_0xc3f336['includes'](_0x797a40['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x859833='',_0x11367f='',_0x1e6861='custom'){this['editor']['plugins']['get'](ee)['showUI'](_0x859833,_0x11367f,_0x1e6861);}}function ns(_0x4a42a5,_0x3e9a79){const _0x586db3=new Set();for(const _0x42f339 of _0x4a42a5['values']())(_0x3e9a79||!0x1===_0x42f339['requiresContent'])&&_0x586db3['add'](_0x42f339['id']);return Array['from'](_0x586db3);}const hs=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class di extends/* #__PURE__ -- @preserve */
24
- Jt(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x34def4,_0x22910a,_0x2fcec3){super(),this['editor']=_0x34def4,this['textAdapter']=_0x22910a,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x2fcec3,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x1849f7,_0x513f54,_0x202e69)=>{this['view']['value']=this['_sanitizeHTML'](_0x202e69);}),this['listenTo'](this['view'],'submitPrompt',(_0xcceeb5,_0x3c67cd)=>{const _0x35573e=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x3c67cd,_0x35573e,'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:_0x416b56,query:_0x3c5be2,htmlContent:_0x1451e5,label:_0x508e1a,mainActionLabel:_0x83260a}){this['view']['prompt']=_0x508e1a,this['view']['mainAction']=_0x83260a,this['initialContext']=_0x1451e5,_0x3c5be2&&(this['view']['isRendered']?this['_handleQuery'](_0x3c5be2,_0x1451e5,_0x416b56,_0x508e1a):this['view']['once']('render',()=>{this['_handleQuery'](_0x3c5be2,_0x1451e5,_0x416b56,_0x508e1a);}));}['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'](_0x49b4c6,_0x31b132,_0x33d189,_0x16cea4){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x31b132,this['previousQuery']=_0x49b4c6,this['previousLabel']=_0x16cea4||_0x49b4c6,this['previousActionId']=_0x33d189,new Promise(_0x2eadc9=>{this['textAdapter']['makeRequest']({'query':_0x49b4c6,'context':_0x31b132,'onData':_0x24fd49=>{this['currentResponse']=_0x24fd49,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x33d189})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x132948=>{_0x132948 instanceof tr?this['view']['handleError'](_0x132948['message']):this['view']['handleError'](),_0x2eadc9();})['finally'](()=>{this['stopProcessing'](),_0x2eadc9();});});}['_parseAndNormalizeContent'](_0x5f5bf3,_0x1b09b4=!0x1){const _0x43c373=hs['exec'](_0x5f5bf3);_0x5f5bf3=_0x43c373?_0x5f5bf3['substring'](_0x43c373[0x1]['length']):_0x5f5bf3['length']<0x64&&!_0x1b09b4?'':this['_stripMarkdownSyntax'](_0x5f5bf3);const _0x53b34b=this['_domParser']['parseFromString'](_0x5f5bf3,'text/html');if(_0x43c373){const _0x51c6f1=Array['from'](_0x53b34b['body']['childNodes']);_0x51c6f1['reverse']();for(const _0x1d70c5 of _0x51c6f1){if(_0x1d70c5['nodeType']==Node['ELEMENT_NODE'])break;_0x1d70c5['remove']();}}const _0x2ac56b=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x53b34b['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x2ac56b);const _0x51bb89=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x5603e3=this['editor']['data']['toModel'](_0x2ac56b);return _0x51bb89||_0x5603e3['markers']['clear'](),this['editor']['data']['stringify'](_0x5603e3);}['_normalizeResponseHeadings'](_0x2b924c){const _0x7ecc98=new _0x5d1708(this['editor']['editing']['view']['document']),_0xae7684=new _0x3b2697({'name':/^h[1-5]$/}),_0x462236=[];let _0x17d2a9=!0x1;for(const _0x43a4b1 of _0x2b924c)_0x43a4b1['is']('element')&&_0xae7684['match'](_0x43a4b1)&&(_0x462236['push'](_0x43a4b1),'h1'==_0x43a4b1['name']&&(_0x17d2a9=!0x0));if(_0x17d2a9){for(const _0x249f6a of _0x462236)_0x7ecc98['rename']('h'+(parseInt(_0x249f6a['name'][0x1])+0x1),_0x249f6a);}}['_isH1TagSupportEnabled'](){const {data:_0xf3d9a4,editing:_0x417d62}=this['editor'],_0x56a6c7=_0xf3d9a4['htmlProcessor']['toView']('<h1></h1>'),_0x2919c3=_0xf3d9a4['toView'](_0xf3d9a4['toModel'](_0x56a6c7));return!!_0x417d62['view']['domConverter']['viewToDom'](_0x2919c3)['querySelector']('h1');}['_sanitizeHTML'](_0x3bd7d5){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x3bd7d5),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x5c1a57){const _0x21f05b=_0x5c1a57['trim']();return _0x21f05b['startsWith']('```html')?_0x21f05b['endsWith']('```')?_0x21f05b['substring'](0x7,_0x21f05b['length']-0x3):_0x21f05b['substring'](0x7):_0x5c1a57;}}const pi={'REPLACE':'replace','INSERT':'insert'};class Us extends _0x335b7d{constructor(_0x1341c0){super(_0x1341c0),this['set']('isVisible',!0x1),this['set']('mainAction',pi['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x47e245=>Wn(_0x1341c0,'AI_'+_0x47e245['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Wn(_0x1341c0,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Wn(_0x1341c0,'Try\x20again')),this['stopButton']=this['_createButton'](Wn(_0x1341c0,'Stop'));const _0x3a9615=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x3a9615['if']('isVisible','ck-hidden',_0x4d6af7=>!_0x4d6af7)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x26a1b7,_0x54e2de){const _0x4ab5b0=new _0x47081d(this['locale']);return _0x4ab5b0['set']({'label':_0x26a1b7,'class':_0x54e2de||'','isVisible':!0x0,'withText':!0x0}),_0x4ab5b0;}}class Xs extends Bt{['contentFieldView'];['copyButtonView'];constructor(_0x49e1fc,_0x376c08=''){super(_0x49e1fc),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x52e876=this['bindTemplate'];this['contentFieldView']=new Fn(_0x49e1fc,_0x376c08),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x52e876['if']('isVisible','ck-hidden',_0x3cc354=>!_0x3cc354)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x52e876['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 _0x1e8161=!0x1;this['on']('change:value',(_0x248a20,_0x5a659d,_0x753ed6)=>{const _0x219de1=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x753ed6),this['isProcessing']&&_0x219de1&&!_0x1e8161&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x45aa0c,_0x39f44f,_0x237742)=>{_0x1e8161=!0x1,_0x237742?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x1e8161=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x1e8161=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x1ddce5=this['locale'],_0x1afe5d=new _0x47081d(this['locale']),_0x3f45f5='ck-ai-form__copy-button';return _0x1afe5d['set']({'label':Wn(_0x1ddce5,'Copy'),'icon':_0xfda368,'class':_0x3f45f5,'tooltip':!0x0}),_0x1afe5d['bind']('isVisible')['to'](this,'value',_0x529331=>!!_0x529331),_0x1afe5d['bind']('isEnabled')['to'](this,'isProcessing',_0x4b6309=>!_0x4b6309),_0x1afe5d['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x1afe5d['icon']=_0x1ec62f,_0x1afe5d['class']=_0x3f45f5+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x1afe5d['icon']=_0xfda368,_0x1afe5d['class']=_0x3f45f5;},0x3e8);}),_0x1afe5d;}['_copyHTMLToClipboard'](_0x5c35e3){const {window:_0x3cc9c1,document:_0x3f3a65}=_0x257afc;if(_0x3cc9c1['ClipboardItem']){const {Blob:_0x5c3374,ClipboardItem:_0x4337fd}=_0x3cc9c1,_0x3c311c=[new _0x4337fd({'text/html':new _0x5c3374([_0x5c35e3['innerHTML']],{'type':'text/html'}),'text/plain':new _0x5c3374([_0x5c35e3['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x3c311c);}else{const _0x9c2350=_0x3f3a65['createElement']('div');_0x9c2350['style']['position']='absolute',_0x9c2350['style']['left']='-9999px',_0x9c2350['innerHTML']='<span>[</span>'+_0x5c35e3['innerHTML']+'<span>]</span>',_0x3f3a65['body']['appendChild'](_0x9c2350);const _0x36fc82=_0x3f3a65['createRange']();_0x36fc82['setStartAfter'](_0x9c2350['firstElementChild']),_0x36fc82['setEndBefore'](_0x9c2350['lastElementChild']);const _0x2b8566=_0x3cc9c1['getSelection']();_0x2b8566['removeAllRanges'](),_0x2b8566['addRange'](_0x36fc82),_0x3f3a65['execCommand']('copy'),_0x9c2350['remove']();}}}class Fn extends Bt{constructor(_0x5973de,_0x13a64a=''){super(_0x5973de),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x13a64a,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x1feb81){this['element']['innerHTML']=_0x1feb81;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x50cf87=new Bt(),_0xae0d22=this['locale'],_0x18b4e3=new _0x57d3a1();return _0x18b4e3['isVisible']=!0x0,_0x50cf87['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x18b4e3,{'text':Wn(_0xae0d22,'AI\x20is\x20writing...')}]}),_0x50cf87['render'](),_0x50cf87;}}class Ys extends Bt{constructor(_0x31d37b,_0x42ec1f=''){super(_0x31d37b);const _0x2a44ba=new _0x8f03f4(),_0x3b841a=this['bindTemplate'];this['set']('text',_0x42ec1f),_0x2a44ba['content']=_0x25e3c7,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x2a44ba,{'text':_0x3b841a['to']('text')}]});}}class Zs extends _0x494771{['submitButtonView'];['showHistoryButtonView'];constructor(_0x2344ac,_0x50b537){super(_0x2344ac,_0x50b537),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',(_0x446a4c,_0x475a39)=>{_0x446a4c['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x475a39());});}['_createSubmitButton'](){const _0x560ce3=new _0x47081d(this['locale']),_0x1c1b51=this['locale'];return _0x560ce3['set']({'icon':_0x8b9d93,'label':Wn(_0x1c1b51,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x560ce3['on']('execute',()=>{this['submit']();}),_0x560ce3['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x591f11,_0x1827b4)=>!_0x591f11&&_0x1827b4),_0x560ce3;}['_createShowHistoryButton'](){const _0xf47ba6=new _0x47081d(this['locale']),_0x53195a=this['resultsView'],_0x380b4d=this['locale'];_0xf47ba6['set']({'label':Wn(_0x380b4d,'History'),'withText':!0x1,'icon':at,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0xf47ba6['bind']('isOn')['to'](_0x53195a,'isVisible'),_0xf47ba6['bind']('isEnabled')['to'](this,'isEnabled'),_0xf47ba6['on']('execute',()=>{_0x53195a['isVisible']=!_0x53195a['isVisible'],_0x53195a['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x39c978=()=>{_0x257afc['window']['requestAnimationFrame'](()=>{if(_0x5dc68e(this['element'])){const _0x718a15=new _0x4b088f(this['queryView']['fieldView']['element']),_0x4abeeb=_0x718a15['width'],_0x157936='rtl'===_0x380b4d['uiLanguageDirection']?'left':'right';_0x718a15['excludeScrollbarsAndBorders'](),_0xf47ba6['element']['style'][_0x157936]=_0x4abeeb-_0x718a15['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x39c978),this['on']('render',_0x39c978),_0xf47ba6;}['submit'](){const _0x1b8e84=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x1b8e84);}['focus'](_0x816bce){-0x1===_0x816bce?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class br extends _0x1832e1{['historyGroupView'];['clearHistoryButton'];constructor(_0x2ebf13){super(_0x2ebf13),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x29f9b1(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Wn(_0x2ebf13,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x4bc919=0x0;for(const _0x55381c of this['items'])_0x4bc919+=_0x55381c['items']['length'];return{'resultsCount':_0x4bc919,'totalItemsCount':_0x4bc919};}['_createClearHistoryButton'](){const _0x2db7e0=this['locale'],_0x5f5c85=new _0x47081d(this['locale']);return _0x5f5c85['set']({'label':'('+Wn(_0x2db7e0,'Clear')+')','withText':!0x0}),_0x5f5c85['on']('execute',()=>this['fire']('clearHistory')),_0x5f5c85;}}class wr extends _0x55e39f{constructor(_0x17f7a7){super();const _0x321522=new _0x5d6c90(),_0x587957=new _0x47081d(this['locale'],_0x321522);this['children']['add'](_0x587957),_0x587957['set']({'label':_0x17f7a7['prompt'],'withText':!0x0}),_0x587957['on']('execute',()=>{this['fire']('execute',{'value':_0x3b2a59(_0x17f7a7['prompt'])});});}}const so='CKEditor/AIFormView/PromptHistory';class yr extends _0x1eff7a{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x200e8b,_0xeff411)=>{const _0x36c969=no(_0xeff411['prompt']);for(const _0x417e56 of this)if(_0x417e56!=_0xeff411&&no(_0x417e56['prompt'])===_0x36c969){this['remove'](_0x417e56);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x323da5=sessionStorage['getItem'](so)||'[]';this['addMany'](JSON['parse'](_0x323da5));}['_saveToSessionStorage'](){sessionStorage['setItem'](so,JSON['stringify'](this['map'](_0x15027d=>_0x15027d)));}}function no(_0x32dd3f){return _0x32dd3f['toLowerCase']()['trim']();}class ui extends Bt{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x1906e5,_0x333cbe,_0x586d96=''){super(_0x1906e5),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',pi['REPLACE']),this['_promptHistory']=new yr(),this['errorView']=new Ys(_0x1906e5),this['contentArea']=new Xs(_0x1906e5,_0x586d96),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 Pt(),this['keystrokes']=new Ht(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new Lt({'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 _0x45b871=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x333cbe],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x45b871['if']('isError','ck-hidden',_0x5ccd35=>!_0x5ccd35)]},'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'](_0x2eb36a=0x1){-0x1===_0x2eb36a?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 _0x1bf0ed=this['locale'],_0x2e5d05=new Zs(_0x1bf0ed,{'queryView':{'label':Wn(_0x1bf0ed,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x258d40,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Wn(_0x1bf0ed,'Empty\x20history'),'secondary':Wn(_0x1bf0ed,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x2e5d05['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x1aae0d,_0x7fb343)=>_0x1aae0d&&!_0x7fb343),this['listenTo'](_0x2e5d05,'submit',(_0x187fdc,_0x41fcc3)=>{this['prompt']=_0x41fcc3;const _0x19fee1=Yt(_0x41fcc3);this['fire']('submitPrompt',_0x19fee1),_0x41fcc3['trim']()&&this['_promptHistory']['add']({'prompt':_0x19fee1},0x0);},{'priority':'high'}),_0x2e5d05;}['_createHistoryView'](){const _0x20fb0a=new br(this['locale']);return _0x20fb0a['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](wr),_0x20fb0a['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x20fb0a;}['_createToolbar'](){const _0x4cb85a=new Us(this['locale']);return _0x4cb85a['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x379e77,_0x327586,_0x52a67a)=>_0x379e77&&!_0x327586&&!!_0x52a67a),_0x4cb85a['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x4cb85a['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x1d01bc,_0x2e25d5,_0x477b6a)=>_0x1d01bc&&!_0x2e25d5&&!!_0x477b6a),_0x4cb85a['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x4cb85a['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x366f0f,_0x3b707e)=>_0x366f0f&&!_0x3b707e),_0x4cb85a['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x4cb85a['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x4cb85a['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x4cb85a;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x564858=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Wn(_0x564858,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x56eace){const _0x40d1b0=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x56eace||Wn(_0x40d1b0,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const it=globalThis['DataTransfer'];class ee extends _0x1b47de{['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[_0x4f5d6f,te,li,_0x4e4a90];}constructor(_0x20eaba){super(_0x20eaba),_0x20eaba['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x20eaba['config']['define']('ai.assistant.contentAreaCssClass',''),_0x20eaba['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x20eaba['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x3642dd}=this;this['_aiAdapter']=_0x3642dd['plugins']['get'](li),this['_dialog']=_0x3642dd['plugins']['get'](_0x4e4a90),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x53eec8=new hi(_0x3642dd,Array['from'](this['_commandDefinitions']['values']()));_0x3642dd['commands']['add']('showAIAssistant',_0x53eec8),_0x3642dd['ui']['componentFactory']['add']('aiCommands',_0x514f81=>{const _0x131099=_0x5ecbb1(_0x514f81);return _0x131099['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x131099['buttonView']['set']({'label':Wn(_0x514f81,'AI\x20Commands'),'icon':_0x15f2f1,'tooltip':!0x0}),_0x131099['on']('execute',_0x3066da=>this['_onExecute'](_0x3066da['source']['id'])),_0x391f1d(_0x131099,_0x3642dd['ui']['view']['body'],function(_0x4f50b8){const _0x2c4293=ne(_0x4f50b8['config']['get']('ai.assistant.commands'),_0x4f50b8['locale']),_0x238394=wi(_0x4f50b8,_0x2c4293)['filter'](_0xbb9e0e=>_0xbb9e0e['commands']['length']);if(0x1===_0x238394['length'])return wi(_0x4f50b8,_0x238394[0x0]['commands'])['map'](_0x179b1f=>({'id':_0x179b1f['id'],'label':_0x179b1f['label']}));return _0x238394['map'](_0x44324e=>{const {groupId:_0x41fd22,groupLabel:_0x426134,commands:_0x3bb057}=_0x44324e,_0x26f336=wi(_0x4f50b8,_0x3bb057)['map'](_0x48da1c=>({'id':_0x48da1c['id'],'label':_0x48da1c['label']}));return{'id':_0x41fd22,'menu':_0x426134||_0x41fd22,'children':_0x26f336};});}(_0x3642dd),{'ariaLabel':Wn(_0x514f81,'AI\x20Commands')}),_0x131099['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x53eec8['on']('change:enabledCommandsIds',_0x4414f6),_0x131099['menuView']['once']('render',_0x4414f6),_0x131099;function _0x4414f6(){_0x131099['isEnabled']=_0x53eec8['enabledCommandsIds']['length']>0x0;for(const _0x421aa4 of _0x131099['menuView']['buttons'])_0x421aa4['isEnabled']=_0x53eec8['enabledCommandsIds']['includes'](_0x421aa4['id']);}}),_0x3642dd['ui']['componentFactory']['add']('menuBar:aiCommands',_0x3147a1=>{const _0x5cd0e9=new _0x478579(_0x3147a1);_0x5cd0e9['buttonView']['set']({'label':Wn(_0x3147a1,'AI\x20Commands'),'icon':_0x15f2f1}),_0x5cd0e9['bind']('isEnabled')['to'](_0x53eec8,'enabledCommandsIds',_0x3dc56f=>_0x3dc56f['length']>0x0);const _0xafd30e=ne(_0x3642dd['config']['get']('ai.assistant.commands'),_0x3147a1);return this['_populateMenuBarMenu'](_0x53eec8,_0x5cd0e9,_0xafd30e,_0x15eabf=>this['_onExecute'](_0x15eabf)),_0x5cd0e9;}),_0x3642dd['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x365e9e=this['_createAIAssistantUIButton'](_0x47081d);return _0x365e9e['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x365e9e;}),_0x3642dd['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x59c343=this['_createAIAssistantUIButton'](_0x214cc1);return _0x59c343['set']({'role':'menuitemcheckbox'}),_0x59c343;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x3e4d77=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x27f149;for(const _0x5a79dc in _0x3e4d77){const _0x33ff63=_0x5a79dc,_0x4bcbd0=_0x3e4d77[_0x33ff63];if('aiLicenseKeyValid'==_0x4bcbd0||'aiLicenseKeyInvalid'==_0x4bcbd0||'aiLicenseKeyExpired'==_0x4bcbd0||'aiLicenseKeyDomainLimit'==_0x4bcbd0||'aiLicenseKeyNotAllowed'==_0x4bcbd0||'aiLicenseKeyEvaluationLimit'==_0x4bcbd0||'aiLicenseKeyTrialLimit'==_0x4bcbd0||'aiLicenseKeyUsageLimit'==_0x4bcbd0){delete _0x3e4d77[_0x33ff63],_0x27f149=_0x4bcbd0,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x27f149&&_0x3e4d77['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x27f149&&_0x3e4d77['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x27f149&&_0x3e4d77['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x27f149&&_0x3e4d77['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x27f149&&_0x3e4d77['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x27f149&&_0x3e4d77['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x27f149&&_0x3e4d77['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x225f71='',_0x272ea4='',_0x55ac94='custom'){const _0xd71d73=this['editor'],_0x3360a8=_0xd71d73['editing']['view'],_0x50512c=_0xd71d73['plugins']['get'](te),_0x258529=_0xd71d73['plugins']['get'](_0x4f5d6f);_0x50512c['showFakeVisualSelection']();const _0x140a5e=new it(),_0xf01c4f=new ClipboardEvent('copy',{'clipboardData':_0x140a5e}),_0x4d3480=new et(_0x140a5e),_0x300a6c=new nt(_0x3360a8,_0xf01c4f,{'dataTransfer':_0x4d3480});_0x258529['_forceMarkersCopy']('comment',()=>{_0x3360a8['document']['fire']('copy',_0x300a6c);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new di(_0xd71d73,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x38bb03=_0x4d3480['getData']('text/html');const _0x1455c8=_0xd71d73['model']['document']['selection'],_0x557deb=Array['from'](_0x1455c8['getRanges']());0x1===_0x557deb['length']&&_0x557deb[0x0]['isFlat']&&!_0x1455c8['getSelectedElement']()&&''!==_0x38bb03['replace'](/&nbsp;/g,'')['trim']()&&(_0x38bb03='<p>'+_0x38bb03+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x55ac94,'query':_0x225f71,'htmlContent':_0x38bb03,'label':_0x272ea4,'mainActionLabel':pi[_0xd71d73['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':ti,'title':Wn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x250e20['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x50512c['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x18ddc9=new Map(),_0x194c8c=ne(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x4fc70d of _0x194c8c)for(const _0x3d6467 of _0x4fc70d['commands'])_0x18ddc9['set'](_0x3d6467['id'],{..._0x3d6467,'groupId':_0x4fc70d['groupId'],'groupLabel':_0x4fc70d['groupLabel']||_0x4fc70d['groupId']});return _0x18ddc9;}['_createAIAssistantUIButton'](_0x4efcd6){const _0x18d34b=this['editor'],_0x3bb30c=_0x18d34b['commands']['get']('showAIAssistant'),_0x2fdcc2=new _0x4efcd6(_0x18d34b['locale']);return _0x2fdcc2['set']({'label':Wn(_0x18d34b['locale'],'AI\x20Assistant'),'icon':ti,'isToggleable':!0x0}),_0x2fdcc2['bind']('isEnabled')['to'](_0x3bb30c),_0x2fdcc2['bind']('isOn')['to'](this['_dialog'],'id',_0x383b0c=>'aiAssistant'===_0x383b0c),this['listenTo'](_0x2fdcc2,'execute',()=>{_0x2fdcc2['isOn']?this['hideUI']():_0x3bb30c['execute']();}),_0x2fdcc2;}['_initView'](){const _0x15a9da=this['editor']['plugins']['get'](te);this['_formView']=new ui(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',()=>{_0x15a9da['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x15a9da['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x287fee,ui:{ariaLiveAnnouncer:_0x5cef6b}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x53a05d,_0x1c47a0,_0x5d0d45)=>{const _0x3feb12=this['_aiAssistantController']['currentContext'];_0x5d0d45?_0x5cef6b['announce'](Wn(_0x287fee,'AI\x20is\x20writing')):_0x3feb12&&_0x5cef6b['announce'](Wn(_0x287fee,'Generated\x20content:\x20%0',_0x3feb12),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x50eac4,_0x4ea80c,_0x4cc44a)=>{if(_0x4cc44a){const _0x4c2ff5=this['_formView']['errorView']['text'];_0x5cef6b['announce'](Wn(_0x287fee,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x4c2ff5));}});}['_onExecute'](_0x1ebf77){const _0x3cb73b=this['_commandDefinitions']['get'](_0x1ebf77),_0x51831d=this['editor'],_0x2312a8=_0x51831d['model']['document']['selection'],_0x46807c=_0x51831d['commands']['get']('showAIAssistant'),_0x35d052=_0x51831d['plugins']['get'](te),_0x33cfe7=''+(_0x3cb73b['groupId']!==mi?_0x3cb73b['groupLabel']+':\x20':'')+_0x3cb73b['label'];if(!0x1!==_0x3cb73b['requiresContent']&&_0x2312a8['isCollapsed']){const _0x35dfe7=_0x3ac2df(_0x2312a8['getSelectedBlocks']())||_0x51831d['model']['schema']['getLimitElement'](_0x2312a8);_0x51831d['model']['change'](_0x4093ef=>{_0x4093ef['setSelection'](_0x35dfe7,'in');});}_0x35d052['showFakeVisualSelection'](),_0x46807c['execute'](_0x3cb73b['prompt'],_0x33cfe7,'command:'+_0x1ebf77);}['_populateMenuBarMenu'](_0x5e2135,_0x34f685,_0x252edb,_0x50b01b){const _0x491cd8=this['editor'],_0x16bbd1=_0x491cd8['locale'],_0xb06f49=new _0x3b3064(_0x16bbd1),_0x15929c=wi(_0x491cd8,_0x252edb)['filter'](_0x2c4153=>_0x2c4153['commands']['length']);0x1===_0x15929c['length']?this['_getMenuBarGroupButtons']({'command':_0x5e2135,'commands':_0x15929c[0x0]['commands'],'parentMenuView':_0x34f685,'onExecute':_0x50b01b})['forEach'](_0x28a438=>_0xb06f49['items']['add'](_0x28a438)):_0x15929c['forEach'](({groupId:_0x25b549,groupLabel:_0x2f392d,commands:_0x1a357e})=>{const _0x3ceb78=new _0xb99944(_0x16bbd1,_0x34f685),_0x2cdfae=new _0x478579(_0x16bbd1),_0x53d0eb=new _0x3b3064(_0x16bbd1),_0x3de3ff=this['_getMenuBarGroupButtons']({'command':_0x5e2135,'commands':_0x1a357e,'parentMenuView':_0x2cdfae,'onExecute':_0x50b01b});_0x2cdfae['buttonView']['set']({'label':_0x2f392d||_0x25b549}),_0x2cdfae['delegate']('execute')['to'](_0x34f685),_0x53d0eb['items']['addMany'](_0x3de3ff),_0x2cdfae['panelView']['children']['add'](_0x53d0eb),_0x3ceb78['children']['add'](_0x2cdfae),_0xb06f49['items']['add'](_0x3ceb78);}),_0x34f685['panelView']['children']['add'](_0xb06f49);}['_getMenuBarGroupButtons']({command:_0x447e13,commands:_0x40e1bc,parentMenuView:_0x288fb3,onExecute:_0x3e4fe6}){const _0x146652=this['editor'],_0x20588f=_0x146652['locale'];return wi(_0x146652,_0x40e1bc)['map'](_0x2a8ca9=>{const _0xe3e0c9=new _0xb99944(_0x20588f,_0x288fb3),_0x11e69b=new _0x214cc1(_0x20588f);return _0x11e69b['set']({'label':_0x2a8ca9['label']}),_0x11e69b['delegate']('execute')['to'](_0x288fb3),_0x11e69b['on']('execute',()=>_0x3e4fe6(_0x2a8ca9['id'])),_0x11e69b['bind']('isEnabled')['to'](_0x447e13,'enabledCommandsIds',_0x13d2dc=>_0x13d2dc['includes'](_0x2a8ca9['id'])),_0xe3e0c9['children']['add'](_0x11e69b),_0xe3e0c9;});}}function Ai(_0x13bb86,_0x408a3f){return void 0x0!==_0x13bb86['order']&&void 0x0===_0x408a3f['order']?0x1:void 0x0===_0x13bb86['order']&&void 0x0!==_0x408a3f['order']?-0x1:void 0x0!==_0x13bb86['order']&&void 0x0!==_0x408a3f['order']?_0x13bb86['order']-_0x408a3f['order']:0x0;}function wi(_0x297a48,_0xa7f4e3){_0xa7f4e3['sort'](Ai);const _0x482a90={},_0x43ed7d=[];for(const _0x355838 of _0xa7f4e3)if(void 0x0!==_0x355838['order']){if(_0x355838['order']in _0x482a90)throw new _0x16a90e('ai-commands-config-order-collision',_0x297a48,{'conflictingDefinitions':[_0x355838,_0x482a90[_0x355838['order']]]});_0x482a90[_0x355838['order']]=_0x355838,_0x43ed7d['splice'](_0x355838['order'],0x0,_0x355838);}else _0x43ed7d['push'](_0x355838);return _0x43ed7d;}class Yn extends _0x1b47de{static get['requires'](){return[ee,te];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5c1eb8){super(_0x5c1eb8);const _0x5251da=_0x5c1eb8['config'],_0x368942=_0x5c1eb8['locale'];_0x5251da['define']('ai.assistant.preserveComments',!0x0),_0x5251da['define']('ai.assistant.commands',$n(_0x368942)),_0x5251da['define']('ai.assistant.extraCommandGroups',[]),_0x5251da['define']('ai.assistant.removeCommands',[]);let _0x4285a8=ne(_0x5251da['get']('ai.assistant.commands'),_0x368942);const _0x456cc4=_0x5251da['get']('ai.assistant.extraCommandGroups'),_0x104b40=_0x5251da['get']('ai.assistant.removeCommands');_0x456cc4['forEach'](_0x426ab8=>{const _0x49972e=_0x4285a8['find'](_0x1995da=>_0x1995da['groupId']===_0x426ab8['groupId']);_0x49972e?_0x49972e['commands']=_0x49972e['commands']['concat'](_0x426ab8['commands']):_0x4285a8['push'](_0x426ab8);}),_0x4285a8=_0x4285a8['filter'](_0x4e60a8=>!_0x104b40['includes'](_0x4e60a8['groupId'])),_0x4285a8['forEach'](_0x4a23d9=>{_0x4a23d9['commands']=_0x4a23d9['commands']['filter'](_0x480bcd=>!_0x104b40['includes'](_0x480bcd['id']));}),_0x5251da['set']('ai.assistant.commands',_0x4285a8);}}function $n(_0x257e87){return[{'groupId':'editOrReview','groupLabel':Wn(_0x257e87,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Wn(_0x257e87,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Wn(_0x257e87,'Make\x20shorter'),'prompt':'Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.'},{'id':'makeLonger','label':Wn(_0x257e87,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Wn(_0x257e87,'Simplify\x20language'),'prompt':'Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.'}]},{'groupId':'generate','groupLabel':Wn(_0x257e87,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Wn(_0x257e87,'Summarize'),'prompt':'Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.'},{'id':'continue','label':Wn(_0x257e87,'Continue'),'prompt':'Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.'}]},{'groupId':'changeTone','groupLabel':Wn(_0x257e87,'Change\x20tone'),'commands':[{'id':'professional','label':Wn(_0x257e87,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Wn(_0x257e87,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Wn(_0x257e87,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Wn(_0x257e87,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Wn(_0x257e87,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Wn(_0x257e87,'Change\x20style'),'commands':[{'id':'business','label':Wn(_0x257e87,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Wn(_0x257e87,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Wn(_0x257e87,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Wn(_0x257e87,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Wn(_0x257e87,'Translate'),'commands':[{'id':'translateEnglish','label':Wn(_0x257e87,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Wn(_0x257e87,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Wn(_0x257e87,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Wn(_0x257e87,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Wn(_0x257e87,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Wn(_0x257e87,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Wn(_0x257e87,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Wn(_0x257e87,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ue extends _0x1b47de{['abortController'];static get['requires'](){return[li];}constructor(_0x565db7){super(_0x565db7),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](li)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x230d69){return this['sendRequest'](_0x230d69)['catch'](_0x6e074f=>{if(_0x6e074f instanceof tr)return Promise['reject'](_0x6e074f);if('AbortError'==_0x6e074f['name'])return Promise['resolve']();throw console['error'](_0x6e074f),new _0x16a90e('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x200e17,_0xf0709){const _0x3fe27c=this['editor']['locale'],_0x2a30c3={'Content-Type':'application/json'};if('object'==typeof _0x200e17)Object['assign'](_0x2a30c3,_0x200e17);else{if(_0x200e17)try{const _0x1fcfdb=await _0x200e17(_0xf0709);Object['assign'](_0x2a30c3,_0x1fcfdb);}catch{return Promise['reject'](new tr(Wn(_0x3fe27c,'AI_ERROR_GET_HEADERS')));}}return _0x2a30c3;}async['_prepareRequestParameters'](_0x4b54e8,_0x52393a){const _0x4a3299=this['editor']['locale'];if('object'==typeof _0x4b54e8)return _0x4b54e8;try{return await _0x4b54e8(_0x52393a);}catch{return Promise['reject'](new tr(Wn(_0x4a3299,'AI_ERROR_GET_PARAMETERS')));}}}class qn extends ue{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x12209d){super(_0x12209d),_0x12209d['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x12209d['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x12209d['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x12209d['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x12209d['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x12209d['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x5ccfa0,context:_0x538f1e,onData:_0x4fe236,actionId:_0x109a19}){const _0x36a0a5=this['editor']['locale'],_0xbd4bf3=await this['prepareMessages'](_0x5ccfa0,_0x538f1e,_0x109a19),_0x45746c=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x109a19),_0x320c92=await this['_prepareRequestParameters'](this['_requestParameters'],_0x109a19),_0x28c2f1={'messages':_0xbd4bf3,..._0x320c92},_0x3f96d0={'method':'POST','headers':_0x45746c,'body':JSON['stringify'](_0x28c2f1),'signal':this['abortController']['signal']},_0x20d0cd=await fetch(this['_apiUrl'],_0x3f96d0);if(_0x20d0cd['ok'])return _0x320c92['stream']?await this['_readStreamableResponse'](_0x20d0cd,_0x4fe236):await this['_readStaticResponse'](_0x20d0cd,_0x4fe236),Promise['resolve']();{const _0x106785=await _0x20d0cd['text']();return _0x106785['includes']('context_length_exceeded')?Promise['reject'](new tr(Wn(_0x36a0a5,'AI_ERROR_CONTEXT_LENGTH'))):_0x106785['includes']('Moderation')?Promise['reject'](new tr(Wn(_0x36a0a5,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x106785));}}async['prepareMessages'](_0x819076,_0x5a6055,_0x30feec){let _0x3f3202,_0x43a448;return _0x5a6055?(_0x3f3202='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.',_0x43a448='Instruction:\x0a'+_0x819076+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x5a6055):(_0x3f3202='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.',_0x43a448=_0x819076),[{'role':'system','content':_0x3f3202},{'role':'user','content':_0x43a448}];}async['_readStreamableResponse'](_0x3a6e26,_0x540ec5){const _0x524796=_0x3a6e26['body']['getReader'](),_0x514fd8=new TextDecoder();let _0x606d1d='',_0x339ef9='',_0x1c0cda='',_0x2ce278=!0x1;for(;!_0x2ce278;){const {done:_0x3e317d,value:_0x4602ee}=await _0x524796['read'](),_0x137c82=_0x606d1d+_0x514fd8['decode'](_0x4602ee);let _0x417f59='';_0x2ce278=_0x3e317d;try{_0x417f59=this['_cleanUpData'](_0x137c82),_0x606d1d='';}catch{_0x606d1d=_0x137c82;continue;}_0x339ef9+=_0x417f59,!_0x2ce278&&this['_isBufferIncomplete'](_0x339ef9)||_0x339ef9&&(_0x1c0cda+=_0x339ef9,_0x339ef9='',_0x540ec5(_0x1c0cda));}return Promise['resolve']();}async['_readStaticResponse'](_0x5b121a,_0x2a8859){return _0x2a8859((await _0x5b121a['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x359716){const _0x1f575c=_0x359716['split']('<')['length']!==_0x359716['split']('>')['length'],_0x38ad4b=_0x359716['length']<0x1e;return _0x1f575c&&_0x38ad4b;}['_cleanUpData'](_0xa74708){return _0xa74708['split'](/\n(?![^{]*\})/g)['map'](_0x12e981=>_0x12e981['replace']('data:\x20',''))['filter'](_0x3d26a4=>_0x3d26a4&&_0x3d26a4['length']>0x0&&'[DONE]'!==_0x3d26a4)['map'](_0x51a168=>{const {choices:_0x210e24}=JSON['parse'](_0x51a168);if(_0x210e24[0x0]?.['delta']?.['content'])return _0x210e24[0x0]['delta']['content'];})['filter'](_0x5ef9dd=>_0x5ef9dd)['join']('');}}class Qn extends ue{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x29c257){super(_0x29c257),_0x29c257['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x29c257['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']=_0x29c257['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x29c257['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x29c257['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x29c257['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x1cea62,context:_0x10612f,onData:_0x136eee,actionId:_0x116391}){const {model:_0x2b7f88,stream:_0x34fd6d,..._0x388335}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x116391),_0x57f664={'prompt':await this['preparePrompt'](_0x1cea62,_0x10612f,_0x2b7f88,_0x116391),..._0x388335};this['_apiUrl']?await this['_processProxyRequest'](_0x57f664,_0x2b7f88,_0x34fd6d,_0x136eee,_0x116391):await this['_processAWSRequest'](_0x57f664,_0x2b7f88,_0x34fd6d,_0x136eee);}async['preparePrompt'](_0x386f2c,_0x59c86f,_0x1924f6,_0x5c4dc2){let _0x2b8040,_0xc14e77;return _0x59c86f?(_0x2b8040='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.',_0xc14e77='Instruction:\x0a'+_0x386f2c+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x59c86f):(_0x2b8040='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.',_0xc14e77=_0x386f2c),'meta.llama'==this['getModelFamily'](_0x1924f6)?'<<SYS>>\x0a'+_0x2b8040+'\x0a<</SYS>>\x0a[INST]\x0a'+_0xc14e77+'\x0a[/INST]':'Human:\x0a'+_0x2b8040+'\x0a'+_0xc14e77+'\x0a\x0aAssistant:';}['getModelFamily'](_0x3a5865){if(/^anthropic\.claude/['test'](_0x3a5865))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x3a5865))return'ai21.j2';if(/^cohere\.command/['test'](_0x3a5865))return'cohere.command';if(/^meta\.llama/['test'](_0x3a5865))return'meta.llama';throw new tr(Wn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x3a5865));}async['_processProxyRequest'](_0x14f90b,_0x555819,_0xc07f62,_0x8f9122,_0x32e663){const _0x4a3589={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x32e663),'body':JSON['stringify']({..._0x14f90b,'model':_0x555819,'stream':_0xc07f62}),'signal':this['abortController']['signal']},_0x215d3d=await fetch(this['_apiUrl'],_0x4a3589);_0xc07f62?await this['_readStreamableResponse'](_0x215d3d,_0x555819,_0x8f9122):await this['_readStaticResponse'](_0x215d3d,_0x555819,_0x8f9122);}async['_processAWSRequest'](_0x239446,_0x24c6b4,_0x409775,_0x33bce2){const _0x10d3eb=new _0x275714(this['_bedrockClientConfig']),_0x13aee5={'body':JSON['stringify'](_0x239446),'contentType':'application/json','accept':'application/json','modelId':_0x24c6b4};let _0x20d940;if(_0x409775){const _0x55193f=new _0x54a9a8(_0x13aee5);_0x20d940=await _0x10d3eb['send'](_0x55193f,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x20d940,_0x24c6b4,_0x33bce2);}else{const _0x3fef40=new _0x234876(_0x13aee5);_0x20d940=await _0x10d3eb['send'](_0x3fef40,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x20d940,_0x24c6b4,_0x33bce2);}}async['_readAsyncIterableResponse'](_0x57e6aa,_0x29366d,_0x187202){const _0x1b6bf5=_0x57e6aa['body'],_0x34ebcb=new TextDecoder('utf-8');let _0x43ba71='';for await(const _0x410f55 of _0x1b6bf5)if(_0x410f55['chunk']){const _0x39330a=_0x34ebcb['decode'](_0x410f55['chunk']['bytes']),_0xf6ae94=JSON['parse'](_0x39330a);_0x43ba71+=this['_getGeneratedText'](_0xf6ae94,_0x29366d),_0x187202(_0x43ba71);}return Promise['resolve']();}async['_readStreamableResponse'](_0x3d4453,_0x3139fc,_0x368cc0){const _0x4bf264=_0x3d4453['body'],_0x10c229=new TextDecoder('utf-8'),_0x197fd6=_0x4bf264['getReader']();let _0x25473f='',_0x347ee9='',_0x2d1f83=!0x1;for(;!_0x2d1f83;){const {done:_0x5379a7,value:_0x3b6f6a}=await _0x197fd6['read']();if(_0x2d1f83=_0x5379a7,_0x2d1f83)break;const _0x54b1ff=(_0x25473f+_0x10c229['decode'](_0x3b6f6a))['split']('\x0a')['map'](_0x4b5acb=>{try{return _0x25473f='',JSON['parse'](_0x4b5acb);}catch{return _0x25473f=_0x4b5acb,null;}})['filter'](_0xa452a6=>null!==_0xa452a6);_0x54b1ff['length']&&(_0x347ee9+=_0x54b1ff['map'](_0x29de1f=>this['_getGeneratedText'](_0x29de1f,_0x3139fc))['join'](''),_0x368cc0(_0x347ee9));}return Promise['resolve']();}async['_readStaticResponse'](_0x3f196c,_0x233bf8,_0x3d9d35){let _0x2d12e4;return _0x2d12e4=_0x3f196c instanceof Response?await _0x3f196c['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x3f196c['body'])),(_0x3d9d35(this['_getGeneratedText'](_0x2d12e4,_0x233bf8)),Promise['resolve']());}['_getGeneratedText'](_0x129992,_0x4432d9){switch(this['getModelFamily'](_0x4432d9)){case'anthropic.claude':return _0x129992['completion'];case'ai21.j2':return _0x129992['completions'][0x0]['data']['text'];case'cohere.command':return _0x129992['generations'][0x0]['text'];case'meta.llama':return _0x129992['generation'];}}}class Bs extends _0x47081d{constructor(_0x38549a,_0x59e3d1={}){super(_0x38549a),this['isToggleable']=!0x0,this['set']('side',_0x59e3d1['side']||'top');const _0x2fe7e3=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x5b2a51(_0x59e3d1['class']||[]),_0x2fe7e3['to']('side',_0x1a3b42=>'ck-tab-button_'+_0x1a3b42),_0x2fe7e3['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class Os extends Bt{['children'];constructor(_0x1c5eca,_0x52ed0e={}){super(_0x1c5eca);const _0x52a339=this['bindTemplate'];this['set']('isVisible',!0x1),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x5b2a51(_0x52ed0e['class']||[]),_0x52a339['to']('class'),_0x52a339['if']('isVisible','ck-hidden',_0x3187c2=>!_0x3187c2)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class Vt extends Bt{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x1b1e2f,_0x2561e4={}){super(_0x1b1e2f),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x2561e4['side']||'top'),this['set']('isMaximized',!0x1);const _0x3d43f0=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x5b2a51(_0x2561e4['class']||[]),_0x3d43f0['to']('side',_0x341f19=>'ck-tabs_'+_0x341f19),_0x3d43f0['to']('class'),_0x3d43f0['to']('isMaximized',_0x167f63=>_0x167f63?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x3d43f0['to']('side',_0xbe4668=>'ck-tabs__buttons-container_'+_0xbe4668)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x3d43f0['to']('side',_0x5bea30=>'ck-tabs__panels-container_'+_0x5bea30)]},'children':this['panelViews']},..._0x5b2a51(_0x2561e4['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x1d379e){const _0x1467c9=this['_tabs']['get'](_0x1d379e);return _0x1467c9||null;}['addTab'](_0x5d1234){const _0x35f100=this['_setupButton']({'id':_0x5d1234['id'],'label':_0x5d1234['buttonLabel'],'icon':_0x5d1234['buttonIcon'],'order':_0x5d1234['order']}),_0x5d3416=new Os(this['locale']);return _0x5d3416['render'](),_0x5d1234['content']&&_0x5d3416['children']['add'](_0x5d1234['content']),this['panelViews']['add'](_0x5d3416),this['_tabs']['set'](_0x5d1234['id'],{'button':_0x35f100,'panel':_0x5d3416,'order':void 0x0!==_0x5d1234['order']?_0x5d1234['order']:null}),this['fire']('addTab:'+_0x5d1234['id'],{'id':_0x5d1234['id'],'button':_0x35f100,'panel':_0x5d3416}),null===this['activeTab']?this['activateTab'](_0x5d1234['id']):this['_hidePanel'](_0x5d1234['id']),{'button':_0x35f100,'panel':_0x5d3416};}['activateTab'](_0x36dbc4){if(null!==_0x36dbc4&&!this['getTab'](_0x36dbc4))throw new _0x16a90e('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x36dbc4});this['activeTab']!==_0x36dbc4&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x36dbc4,_0x36dbc4&&this['_showPanel'](_0x36dbc4),this['fire']('activateTab:'+_0x36dbc4,_0x36dbc4));}['showTab'](_0x18e79f){if(!this['getTab'](_0x18e79f))throw new _0x16a90e('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x18e79f});this['_showPanel'](_0x18e79f),this['_showButton'](_0x18e79f),this['fire']('show:'+_0x18e79f,_0x18e79f);}['hideTab'](_0x13e6ed){if(!this['getTab'](_0x13e6ed))throw new _0x16a90e('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x13e6ed});const _0x5e6aa0=this['activeTab'];this['_hidePanel'](_0x13e6ed),this['_hideButton'](_0x13e6ed);const _0x42037d=this['getTabIds']();_0x5e6aa0===_0x13e6ed&&_0x42037d['length']>0x1&&this['activateTab'](_0x42037d['find'](_0x1f365e=>_0x1f365e!==_0x13e6ed)),this['fire']('hide:'+_0x13e6ed,_0x13e6ed);}['_getPanel'](_0x42e714){const _0x2ea02c=this['_tabs']['get'](_0x42e714);return _0x2ea02c?_0x2ea02c['panel']:null;}['_showPanel'](_0x13cc65){null!==this['activeTab']&&this['activeTab']!==_0x13cc65||this['_getPanel'](_0x13cc65)['show']();}['_hidePanel'](_0x4bc56f){const _0x4f42e9=this['_getPanel'](_0x4bc56f);_0x4f42e9['isVisible']&&(this['activeTab']===_0x4bc56f&&(this['activeTab']=null),_0x4f42e9['hide']());}['_getButton'](_0xc0c860){const _0x5ae7f0=this['_tabs']['get'](_0xc0c860);return _0x5ae7f0?_0x5ae7f0['button']:null;}['_showButton'](_0x2fc093){this['_getButton'](_0x2fc093)['show']();}['_hideButton'](_0x197e92){this['_getButton'](_0x197e92)['hide']();}['_setupButton'](_0x4f848e){const _0x95b473=new Bs(this['locale'],{'side':this['side']}),_0x249bf4=this['buttonViews'];if(_0x95b473['set']({'label':_0x4f848e['label'],'icon':_0x4f848e['icon'],'tooltip':!0x0,'withText':!0x0}),_0x95b473['bind']('isOn')['to'](this,'activeTab',_0x413fb4=>_0x413fb4===_0x4f848e['id']),_0x95b473['bind']('side')['to'](this,'side'),_0x4f848e['order']){const _0x1af687=[...this['_tabs']]['reduce']((_0x40d1e4,_0x4087eb)=>{const _0x28de79=_0x4087eb[0x0],{order:_0x1ec467}=_0x4087eb[0x1];return!_0x1ec467||_0x1ec467>_0x4f848e['order']?_0x40d1e4:_0x1ec467>=_0x40d1e4['order']?{'id':_0x28de79,'order':_0x1ec467}:_0x40d1e4;},{'id':'','order':0x0}),_0xe8d8b2=_0x249bf4['getIndex'](this['_getButton'](_0x1af687['id']));_0x249bf4['add'](_0x95b473,_0xe8d8b2+0x1);}else _0x249bf4['add'](_0x95b473);return _0x95b473['on']('execute',()=>{this['activateTab'](_0x4f848e['id']);}),_0x95b473;}}const Ti=['overlay','sidebar','custom'],yi=['left','right'];class bi extends Vt{constructor(_0x5c4a89,_0x51a6b7={}){super(_0x5c4a89,_0x51a6b7),this['set']('type',_0x51a6b7['type']||'sidebar'),this['set']('side',_0x51a6b7['side']||'right');const _0x589c06=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x589c06['if']('type','ck-ai-tabs__overlay',_0x16c8d2=>'overlay'===_0x16c8d2),_0x589c06['if']('type','ck-ai-tabs__sidebar',_0x394132=>'sidebar'===_0x394132)]}}),this['buttonViews']['on']('add',(_0x1ca584,_0x5215cc)=>{_0x5215cc['set']('withText',!0x1);});}}class M extends _0x52a465{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2b5883){super(_0x2b5883);const _0x49ae7b=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x49ae7b)throw new _0x16a90e('ai-tabs-configuration-not-found');if(void 0x0!==_0x49ae7b['showResizeButton']&&(this['showResizeButton']=_0x49ae7b['showResizeButton']),'sidebar'!==_0x49ae7b['type']&&'overlay'!==_0x49ae7b['type']||_0x49ae7b['side']&&(this['side']=_0x49ae7b['side']),'sidebar'===_0x49ae7b['type']){if(this['container']=_0x49ae7b['element'],this['set']('type','sidebar'),!this['container'])throw new _0x16a90e('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x49ae7b['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new bi(this['context']['locale'],{'side':this['side'],'type':this['type']}),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 _0x50d722&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x4e0566){if(_0x4e0566&&this['type']!==_0x4e0566){if(!Ti['includes'](_0x4e0566))throw new _0x16a90e('ai-tabs-unsupported-ui-type');this['type']=_0x4e0566;}}['switchSide'](_0x1eaa80){if(_0x1eaa80&&this['side']!==_0x1eaa80){if(!yi['includes'](_0x1eaa80))throw new _0x16a90e('ai-tabs-unsupported-ui-side');this['side']=_0x1eaa80;}}['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 Xn(_0x48f632,_0x2be9e0,_0x3a45b7){const t=_0x48f632['t'];switch(_0x2be9e0){case'AI_SUGGESTION_HEADER_TITLE':return t({'id':'AI_SUGGESTION_HEADER_TITLE','string':'Proposed\x20changes'});case'AI_SUGGESTION_BUTTON_SHOW_CHANGES':return t({'id':'AI_SUGGESTION_BUTTON_SHOW_CHANGES','string':'Show\x20details'});case'AI_MINI_TOOLBAR_LIKE':return t({'id':'AI_MINI_TOOLBAR_LIKE','string':'I\x20like\x20this\x20response'});case'AI_MINI_TOOLBAR_DISLIKE':return t({'id':'AI_MINI_TOOLBAR_DISLIKE','string':'I\x20don\x27t\x20like\x20this\x20response'});case'AI_MINI_TOOLBAR_COPY':return t({'id':'AI_MINI_TOOLBAR_COPY','string':'Copy\x20to\x20clipboard'});case'AI_SUGGESTION_CONTENT_PART_TITLE':return t({'id':'AI_SUGGESTION_CONTENT_PART_TITLE','string':'Change\x20%0'},_0x3a45b7);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':'Preview'});case'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION','string':'Insert\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_DELETE':return t({'id':'AI_SUGGESTION_CONTENT_PART_DELETE','string':'Reject'});case'AI_DISCLAIMER_TEXT':return t({'id':'AI_DISCLAIMER_TEXT','string':'AI\x20can\x20make\x20mistakes.\x20Please\x20double-check\x20responses.'});case'AI_TABS_LABEL_MAXIMIZE':return t({'id':'AI_TABS_LABEL_MAXIMIZE','string':'Maximize'});case'AI_TABS_LABEL_MINIMIZE':return t({'id':'AI_TABS_LABEL_MINIMIZE','string':'Minimize'});case'AI_CHAT_HEADING':return t({'id':'AI_CHAT_HEADING','string':'Chat'});case'AI_CHAT_SOURCES_HEADER':return t({'id':'AI_CHAT_SOURCES_HEADER','string':'Sources'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi,\x20I\x27m\x20your\x20AI\x20assistant.\x20Think\x20of\x20me\x20as\x20your\x20writing\x20buddy,\x20reviewer,\x20or\x20research\x20partner.\x20I\x20can\x20suggest\x20changes\x20to\x20your\x20document,\x20help\x20generate\x20ideas,\x20offer\x20feedback,\x20discuss\x20attached\x20files,\x20and\x20much\x20more!'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'The\x20request\x20was\x20aborted.'});case'AI_CHAT_GENERIC_ERROR':return t({'id':'AI_CHAT_GENERIC_ERROR','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_START_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_START_CONVERSATION','string':'Unable\x20to\x20start\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE','string':'Failed\x20to\x20upload\x20files:\x20%0.\x20Please\x20try\x20again.'},_0x3a45b7);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.'},_0x3a45b7);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.'},_0x3a45b7);case'AI_CHAT_CONTEXT_INVALID_DATA':return t({'id':'AI_CHAT_CONTEXT_INVALID_DATA','string':'Invalid\x20context\x20data\x20type\x20for\x20the\x20selected\x20resource.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE','string':'Unsupported\x20resource\x20type.\x20Only\x20files\x20and\x20URLs\x20are\x20supported.'});case'AI_CHAT_CONTEXT_URL_EMPTY_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_EMPTY_ERROR','string':'URL\x20cannot\x20be\x20empty.'});case'AI_CHAT_CONTEXT_URL_INVALID_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_INVALID_ERROR','string':'Please\x20enter\x20a\x20valid\x20URL.'});case'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR','string':'AI\x20is\x20preparing\x20a\x20response...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH','string':'AI\x20is\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REASONING','string':'AI\x20is\x20using\x20reasoning\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING','string':'AI\x20is\x20using\x20reasoning\x20and\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH','string':'Scanned\x20the\x20internet\x20for\x20insights'});case'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING','string':'AI\x20used\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING','string':'AI\x20used\x20search\x20and\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR','string':'Ask\x20AI\x20anything...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH','string':'Ask\x20AI\x20anything\x20(web\x20search\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING','string':'Ask\x20AI\x20anything\x20(reasoning\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING','string':'Ask\x20AI\x20anything\x20(web\x20search\x20and\x20reasoning\x20enabled)...'});case'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT','string':'Preview','plural':'Preview'},_0x3a45b7);case'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP','string':'Show\x20change\x20in\x20the\x20document','plural':'Show\x20changes\x20in\x20the\x20document'},_0x3a45b7);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION','string':'Suggest','plural':'Suggest'},_0x3a45b7);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP','string':'Insert\x20change\x20as\x20suggestion','plural':'Insert\x20changes\x20as\x20suggestions'},_0x3a45b7);case'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL','string':'Apply','plural':'Apply\x20all'},_0x3a45b7);case'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP','string':'Apply\x20changes\x20immediately','plural':'Apply\x20all\x20changes\x20immediately'},_0x3a45b7);case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x3a45b7);case'AI_CHAT_MODEL_SELECTOR_GROUP':return t({'id':'AI_CHAT_MODEL_SELECTOR_GROUP','string':'Models'});case'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP':return t({'id':'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP','string':'Select\x20a\x20model'});case'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP':return t({'id':'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP','string':'Start\x20a\x20new\x20conversation\x20to\x20change\x20the\x20model'});case'AI_CHAT_CAPABILITIES_YES':return t({'id':'AI_CHAT_CAPABILITIES_YES','string':'Yes'});case'AI_CHAT_CAPABILITIES_NO':return t({'id':'AI_CHAT_CAPABILITIES_NO','string':'No'});case'AI_CHAT_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.'},_0x3a45b7);case'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY':return t({'id':'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY','string':'Please\x20try\x20a\x20different\x20phrase\x20or\x20check\x20the\x20spelling.'});case'AI_CHAT_HISTORY_EMPTY_MESSAGE':return t({'id':'AI_CHAT_HISTORY_EMPTY_MESSAGE','string':'Your\x20chat\x20history\x20for\x20current\x20document\x20will\x20appear\x20here.'});case'AI_CHAT_HISTORY_GO_TO_CHAT_BUTTON':return t({'id':'AI_CHAT_HISTORY_GO_TO_CHAT_BUTTON','string':'Go\x20to\x20chat'});case'AI_CHAT_HISTORY_PIN_BUTTON':return t({'id':'AI_CHAT_HISTORY_PIN_BUTTON','string':'Pin'});case'AI_CHAT_HISTORY_SHOW_MORE_ITEMS':return t({'id':'AI_CHAT_HISTORY_SHOW_MORE_ITEMS','string':'Show\x20more\x20items'});case'AI_CHAT_HISTORY_EDIT_NAME':return t({'id':'AI_CHAT_HISTORY_EDIT_NAME','string':'Edit\x20name'});case'AI_CHAT_HISTORY_REMOVE':return t({'id':'AI_CHAT_HISTORY_REMOVE','string':'Remove'});case'AI_CHAT_HISTORY_REMOVE_CONFIRM':return t({'id':'AI_CHAT_HISTORY_REMOVE_CONFIRM','string':'Do\x20you\x20want\x20to\x20remove\x20this\x20chat?'});case'AI_CHAT_HISTORY_ACCEPT':return t({'id':'AI_CHAT_HISTORY_ACCEPT','string':'Accept'});case'AI_CHAT_HISTORY_CANCEL':return t({'id':'AI_CHAT_HISTORY_CANCEL','string':'Cancel'});case'AI_CHAT_HISTORY_LOADING_REMOVING':return t({'id':'AI_CHAT_HISTORY_LOADING_REMOVING','string':'Removing\x20the\x20chat...'});case'AI_CHAT_HISTORY_LOADING_RENAMING':return t({'id':'AI_CHAT_HISTORY_LOADING_RENAMING','string':'Renaming\x20the\x20chat...'});case'AI_CHAT_HISTORY_LOADING_PINNING':return t({'id':'AI_CHAT_HISTORY_LOADING_PINNING','string':'Pinning\x20the\x20chat...'});case'AI_CHAT_HISTORY_LOADING_UNPINNING':return t({'id':'AI_CHAT_HISTORY_LOADING_UNPINNING','string':'Unpinning\x20the\x20chat...'});case'AI_CHAT_HISTORY_CATEGORY_PINNED':return t({'id':'AI_CHAT_HISTORY_CATEGORY_PINNED','string':'Pinned'});case'AI_CHAT_HISTORY_CATEGORY_TODAY':return t({'id':'AI_CHAT_HISTORY_CATEGORY_TODAY','string':'Today'});case'AI_CHAT_HISTORY_CATEGORY_YESTERDAY':return t({'id':'AI_CHAT_HISTORY_CATEGORY_YESTERDAY','string':'Yesterday'});case'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS':return t({'id':'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS','string':'Last\x2014\x20days'});case'AI_CHAT_HISTORY_CATEGORY_LATER':return t({'id':'AI_CHAT_HISTORY_CATEGORY_LATER','string':'Later'});case'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE':return t({'id':'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE','string':'Failed\x20to\x20change\x20the\x20\x22%0\x22\x20chat\x20name.\x20Please\x20try\x20again\x20later.'},_0x3a45b7);case'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED':return t({'id':'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED','string':'Failed\x20to\x20%0\x20the\x20\x22%1\x22\x20chat.\x20Please\x20try\x20again\x20later.'},_0x3a45b7);case'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM':return t({'id':'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM','string':'Failed\x20to\x20delete\x20the\x20\x22%0\x22\x20chat.\x20Please\x20try\x20again\x20later.'},_0x3a45b7);case'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS':return t({'id':'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS','string':'Failed\x20to\x20load\x20the\x20chat\x20history.\x20Please\x20try\x20again\x20later.'});case'AI_CHAT_HISTORY_ERROR_GENERIC':return t({'id':'AI_CHAT_HISTORY_ERROR_GENERIC','string':'Something\x20went\x20wrong.\x20Please\x20try\x20again\x20later.'});case'AI_CHAT_HISTORY_PIN_ACTION':return t({'id':'AI_CHAT_HISTORY_PIN_ACTION','string':'pin'});case'AI_CHAT_HISTORY_UNPIN_ACTION':return t({'id':'AI_CHAT_HISTORY_UNPIN_ACTION','string':'unpin'});case'AI_BALLOON_HEADER_TITLE':return t({'id':'AI_BALLOON_HEADER_TITLE','string':'Change\x20%0'},_0x3a45b7);case'AI_BALLOON_APPLY_BUTTON':return t({'id':'AI_BALLOON_APPLY_BUTTON','string':'Apply'});case'AI_BALLOON_SUGGEST_BUTTON':return t({'id':'AI_BALLOON_SUGGEST_BUTTON','string':'Suggest'});case'AI_BALLOON_NEXT_TOOLTIP':return t({'id':'AI_BALLOON_NEXT_TOOLTIP','string':'Next'});case'AI_BALLOON_PREVIOUS_TOOLTIP':return t({'id':'AI_BALLOON_PREVIOUS_TOOLTIP','string':'Previous'});case'AI_SUGGESTION_NO_PARTS_WARNING':return t({'id':'AI_SUGGESTION_NO_PARTS_WARNING','string':'This\x20change\x20is\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20of\x20the\x20changes\x20are\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Retry'});case'AI_MODEL_DESCRIPTION_AGENT-1':return t({'id':'AI_MODEL_DESCRIPTION_AGENT-1','string':'Automatically\x20selects\x20best\x20model\x20for\x20speed,\x20quality,\x20and\x20cost.'});case'AI_MODEL_DESCRIPTION_GPT-5':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5','string':'OpenAI\x27s\x20flagship\x20model\x20for\x20advanced\x20reasoning,\x20creativity,\x20and\x20complex\x20tasks'});case'AI_MODEL_DESCRIPTION_GPT-5-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5-MINI','string':'A\x20lightweight\x20version\x20of\x20GPT-5\x20-\x20faster,\x20more\x20cost-efficient'});case'AI_MODEL_DESCRIPTION_GPT-4.1':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1','string':'OpenAI\x27s\x20model\x20for\x20reliable\x20reasoning,\x20speed,\x20and\x20versatility'});case'AI_MODEL_DESCRIPTION_GPT-4.1-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1-MINI','string':'A\x20lighter\x20variant\x20of\x20GPT-4.1\x20that\x20balances\x20speed\x20and\x20cost\x20while\x20maintaining\x20solid\x20accuracy'});case'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU','string':'Anthropic\x27s\x20fast,\x20cost-efficient\x20model\x20for\x20simpler\x20tasks'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-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.'});case'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT':return t({'id':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20changes\x20to\x20suggest.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20whole\x20review\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE','string':'Not\x20everything\x20went\x20through,\x20but\x20the\x20completed\x20items\x20are\x20listed\x20below.'});case'AI_REVIEW_MODE':return t({'id':'AI_REVIEW_MODE','string':'Review'});case'AI_REVIEW_CHECK_CUSTOM_TITLE':return t({'id':'AI_REVIEW_CHECK_CUSTOM_TITLE','string':'Custom\x20command'});case'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION','string':'Enter\x20a\x20custom\x20command\x20for\x20a\x20specific\x20review.'});case'AI_REVIEW_CHECK_CORRECTNESS_TITLE':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_TITLE','string':'Proofread'});case'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION','string':'Check\x20the\x20text\x20for\x20errors\x20in\x20grammar,\x20spelling,\x20and\x20punctuation.'});case'AI_REVIEW_CHECK_CLARITY_TITLE':return t({'id':'AI_REVIEW_CHECK_CLARITY_TITLE','string':'Improve\x20clarity'});case'AI_REVIEW_CHECK_CLARITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CLARITY_DESCRIPTION','string':'Improve\x20the\x20logical\x20structure\x20and\x20precision\x20for\x20clearer\x20message.'});case'AI_REVIEW_CHECK_READABILITY_TITLE':return t({'id':'AI_REVIEW_CHECK_READABILITY_TITLE','string':'Improve\x20readability'});case'AI_REVIEW_CHECK_READABILITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_READABILITY_DESCRIPTION','string':'Adjust\x20sentence\x20structure\x20and\x20word\x20choice\x20for\x20an\x20easier\x20read.'});case'AI_REVIEW_CHECK_MAKE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TITLE','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_DESCRIPTION','string':'Shorten\x20or\x20lengthen\x20the\x20text\x20as\x20needed.'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER','string':'Longer'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER','string':'Shorter'});case'AI_REVIEW_CHECK_MAKE_TONE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_TITLE','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION','string':'Modify\x20the\x20text\x20to\x20a\x20desired\x20tone\x20and\x20style.'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL','string':'Casual'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT','string':'Direct'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY','string':'Friendly'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT','string':'Confident'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL','string':'Professional'});case'AI_REVIEW_CHECK_TRANSLATE_TITLE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_TITLE','string':'Translate'});case'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION','string':'Translate\x20the\x20text\x20into\x20another\x20language.'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL','string':'Select\x20language'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH','string':'English'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH','string':'Spanish'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH','string':'French'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN','string':'German'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE','string':'Japanese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN','string':'Russian'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE','string':'Portuguese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN','string':'Korean'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN','string':'Italian'});default:return _0x2be9e0;}}class e extends _0x52a465{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x529054){super(_0x529054),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 _0x52b5ba=this['context']['plugins']['get']('CloudServices');if(!_0x52b5ba['token'])throw new _0x16a90e('ai-missing-token',this);this['_token']=_0x52b5ba['token'];}['startConversation'](_0x32ff66,_0x2dc1b4){const _0x515b9e=this['_sendApiRequest']('/conversations','POST',{'id':_0x32ff66,'group':_0x2dc1b4});return{'getConversation':async()=>(await _0x515b9e['request'])['json'](),'abortController':_0x515b9e['abortController']};}['queryAssistant']({message:_0x51d1b9,conversationId:_0x18ce12,parts:_0x177e17,capabilities:_0x5aba8c,model:_0xc1c012,quickActionData:_0x4a14d3}){const _0x2df7af={..._0x4a14d3&&{'quickActionData':_0x4a14d3}},_0x464d63={'prompt':_0x51d1b9,'content':_0x177e17,'model':_0xc1c012,..._0x5aba8c&&{'capabilities':_0x5aba8c},...Object['keys'](_0x2df7af)['length']>0x0&&{'attributes':_0x2df7af}},_0x117e7c=this['_sendApiRequest']('/conversations/'+_0x18ce12+'/messages','POST',_0x464d63);return{'getStream':async()=>{const _0x315980=(await _0x117e7c['request'])['body'];return this['_getStreamReader'](_0x315980);},'abortController':_0x117e7c['abortController']};}['executeCustomAction']({content:_0x54c08b,message:_0x508553,model:_0x58e21d,outputFormat:_0x850a80}){const _0x260c0f={'content':[{'type':'text','content':_0x54c08b}],'prompt':_0x508553,'model':_0x58e21d,'outputFormat':_0x850a80},_0x4440c9=this['_sendApiRequest']('/actions/custom/calls','POST',_0x260c0f);return{'getStream':async()=>{const _0x5ce527=(await _0x4440c9['request'])['body'];return this['_getStreamReader'](_0x5ce527);},'abortController':_0x4440c9['abortController']};}['executeAction']({actionName:_0x461ff1,content:_0x28d372,args:_0x5a1493}){const _0x376ca0={'content':[{'type':'text','content':_0x28d372}],'args':_0x5a1493},_0x1e65ec=this['_sendApiRequest']('/actions/system/'+_0x461ff1+'/calls','POST',_0x376ca0);return{'getStream':async()=>{const _0x2f6117=(await _0x1e65ec['request'])['body'];return this['_getStreamReader'](_0x2f6117);},'abortController':_0x1e65ec['abortController']};}['uploadFile'](_0x3819eb,_0x4d1441,_0x432bae){const _0x302a53=new FormData();_0x302a53['append']('file',_0x4d1441,_0x4d1441['name']),_0x432bae&&_0x302a53['append']('attributes',JSON['stringify'](_0x432bae));const _0x4b7412=this['_sendApiRequest']('/conversations/'+_0x3819eb+'/files','POST',_0x302a53);return{'getId':async()=>(await _0x4b7412['request'])['json'](),'abortController':_0x4b7412['abortController']};}['fetchDocument'](_0x2ea566,_0x47ffdb){const _0x2c9257=this['_sendApiRequest']('/conversations/'+_0x2ea566+'/documents/'+_0x47ffdb,'GET');return{'getDocument':async()=>(await _0x2c9257['request'])['json'](),'abortController':_0x2c9257['abortController']};}['uploadDocument'](_0x29c015,_0x393d37,_0x3f416b){const _0x117f55={'content':_0x393d37};_0x3f416b&&(_0x117f55['attributes']=_0x3f416b);const _0x48c83f=this['_sendApiRequest']('/conversations/'+_0x29c015+'/documents','POST',_0x117f55);return{'getId':async()=>(await _0x48c83f['request'])['json'](),'abortController':_0x48c83f['abortController']};}['fetchConversations'](_0x2986f2,_0x197dbf){const _0x3876ea=new URLSearchParams();_0x3876ea['append']('excludeEmpty','true'),_0x3876ea['append']('limit','100'),_0x3876ea['append']('group',_0x2986f2),_0x197dbf&&_0x3876ea['append']('search',_0x197dbf);const _0x4ac013=this['_sendApiRequest']('/conversations?'+_0x3876ea['toString'](),'GET');return{'getConversations':async()=>{const _0x1808db=await _0x4ac013['request'];return(await _0x1808db['json']())['items'];},'abortController':_0x4ac013['abortController']};}['deleteConversation'](_0x154677){const _0x446633=this['_sendApiRequest']('/conversations/'+_0x154677,'DELETE');return{'execute':async()=>{await _0x446633['request'];},'abortController':_0x446633['abortController']};}['updateConversation'](_0x6d4019,_0x3e67ac){const _0x469502=this['_sendApiRequest']('/conversations/'+_0x6d4019,'PATCH',_0x3e67ac);return{'getResult':async()=>(await _0x469502['request'],_0x3e67ac),'abortController':_0x469502['abortController']};}['fetchConversation'](_0x417ad3){const _0x5e020b=this['_sendApiRequest']('/conversations/'+_0x417ad3,'GET');return{'getConversation':async()=>(await _0x5e020b['request'])['json'](),'abortController':_0x5e020b['abortController']};}['fetchConversationMessages'](_0x305cfa){const _0x41ef94=this['_sendApiRequest']('/conversations/'+_0x305cfa+'/messages','GET');return{'getMessages':async()=>{const _0x5389f5=await _0x41ef94['request'];return(await _0x5389f5['json']())['items'];},'abortController':_0x41ef94['abortController']};}['uploadUrl'](_0x456590,_0x4d6a68,_0x4219e7){const _0x455d41=this['_sendApiRequest']('/conversations/'+_0x456590+'/web-resources','POST',{'url':_0x4d6a68,'attributes':_0x4219e7});return{'getId':async()=>(await _0x455d41['request'])['json'](),'abortController':_0x455d41['abortController']};}['getModels'](){const _0x354db8=this['_sendApiRequest']('/models/1','GET');return{'list':async()=>{const _0x2b10fa=await(await _0x354db8['request'])['json'](),_0x1ab4b4=_0x2b10fa['items']['map'](_0x1bcae3=>({..._0x1bcae3,'description':Xn(this['context']['locale'],'AI_MODEL_DESCRIPTION_'+_0x1bcae3['id']['toUpperCase']())}));return{..._0x2b10fa,'items':_0x1ab4b4};},'abortController':_0x354db8['abortController']};}['deleteFile'](_0x5bebdd,_0x500da4){const _0x23b221=this['_sendApiRequest']('/conversations/'+_0x5bebdd+'/files/'+_0x500da4,'DELETE');return{'execute':async()=>{await _0x23b221['request'];},'abortController':_0x23b221['abortController']};}['deleteDocument'](_0x228968,_0x3bd4df){const _0x225a44=this['_sendApiRequest']('/conversations/'+_0x228968+'/documents/'+_0x3bd4df,'DELETE');return{'execute':async()=>{await _0x225a44['request'];},'abortController':_0x225a44['abortController']};}['deleteWebResource'](_0x2f0801,_0x52e098){const _0x4b84b7=this['_sendApiRequest']('/conversations/'+_0x2f0801+'/web-resources/'+_0x52e098,'DELETE');return{'execute':async()=>{await _0x4b84b7['request'];},'abortController':_0x4b84b7['abortController']};}['callSystemReview']({reviewName:_0x263e9a,content:_0x385a25,args:_0x2fbffe}){const _0x429207=this['_sendApiRequest']('/reviews/system/'+_0x263e9a+'/calls','POST',{'content':[{'type':'text','content':_0x385a25}],'args':_0x2fbffe});return{'getStream':async()=>{const _0x4de285=(await _0x429207['request'])['body'];return this['_getStreamReader'](_0x4de285);},'abortController':_0x429207['abortController']};}['callCustomReview']({content:_0x12ff51,prompt:_0x25bdbb,model:_0x27e37f}){const _0x5cd4a2=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x12ff51}],'prompt':_0x25bdbb,'model':_0x27e37f});return{'getStream':async()=>{const _0xbcc62f=(await _0x5cd4a2['request'])['body'];return this['_getStreamReader'](_0xbcc62f);},'abortController':_0x5cd4a2['abortController']};}['_sendApiRequest'](_0x262323,_0x470029,_0x5d7ad4){const _0x2fc2de=new AbortController(),_0x21036e=_0x5d7ad4 instanceof FormData,_0x47de62={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x5d7ad4&&!_0x21036e&&(_0x47de62['Content-Type']='application/json');const _0x23ea8b={'method':_0x470029,'headers':_0x47de62,'signal':_0x2fc2de['signal']};return _0x5d7ad4&&(_0x23ea8b['body']=_0x21036e?_0x5d7ad4:JSON['stringify'](_0x5d7ad4)),{'request':fetch(''+this['_apiUrl']+_0x262323,_0x23ea8b)['catch'](_0x2ef657=>{this['_handleError'](_0x2ef657);})['then'](_0x5e0b8a=>{if(!_0x5e0b8a['ok'])throw new _0x16a90e('ai-request-failed',this);return _0x5e0b8a;}),'abortController':_0x2fc2de};}async*['_getStreamReader'](_0x310d90){const _0x4cfb39=[],_0x2626b8=_0x310d90['getReader'](),_0x344571=lt({'onError':_0x5c288c=>{this['_handleError'](_0x5c288c);},'onEvent':_0x219b03=>{_0x219b03['data']=JSON['parse'](_0x219b03['data']),_0x4cfb39['push'](_0x219b03);}});try{let _0x4195bb=!0x1;for(;!_0x4195bb;){const {done:_0x3f37e4,value:_0x3d6df1}=await _0x2626b8['read']();_0x3f37e4&&(_0x4195bb=!0x0),_0x344571['feed'](this['_decoder']['decode'](_0x3d6df1,{'stream':!0x0})),yield*_0x4cfb39,_0x4cfb39['length']=0x0;}}catch(_0x1c93dd){this['_handleError'](_0x1c93dd);}finally{_0x2626b8['releaseLock'](),_0x344571['reset']();}}['_handleError'](_0x51d7bf){if(_0x51d7bf instanceof _0x16a90e)throw _0x51d7bf;if(_0x51d7bf instanceof Error&&'AbortError'===_0x51d7bf['name'])throw new _0x16a90e('ai-request-aborted',this,{'originalError':_0x51d7bf});throw new _0x16a90e('ai-request-failed',this,{'originalError':_0x51d7bf});}}function as(_0x2614c0,_0x2be9bc){const _0x2f7a46=new _0x47081d(_0x2614c0),_0x430fa9=Xn(_0x2614c0,'AI_TABS_LABEL_MINIMIZE'),_0x341be6=Xn(_0x2614c0,'AI_TABS_LABEL_MAXIMIZE');return _0x2f7a46['set']({'withText':!0x1,'icon':_0xe4f8fc,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary-text'}),_0x2f7a46['bind']('label')['to'](_0x2be9bc,'isMaximized',_0x376c7a=>_0x376c7a?_0x430fa9:_0x341be6),_0x2f7a46['bind']('icon')['to'](_0x2be9bc,'isMaximized',_0x5f2d8e=>_0x5f2d8e?to:_0xe4f8fc),_0x2f7a46['bind']('isOn')['to'](_0x2be9bc,'isMaximized'),_0x2f7a46['on']('execute',()=>{_0x2be9bc['fire']('resizeTabs');}),_0x2f7a46;}function sr(_0x2a5129){return _0x3b14b2(_0x2a5129);}function V(_0x32210a){return _0xc44c7e(_0x32210a);}function z(_0x47be96,_0x4c2753,_0x2a3c4a){const _0x32922c=null!==_0x4c2753?_0x267123=>_0x267123['attribs'][_0x47be96]===_0x4c2753:_0x4ca36e=>Boolean(_0x4ca36e['attribs'][_0x47be96]);return _0x5d5fb0(_0x5c90ca=>_0x18f805(_0x5c90ca)&&_0x32922c(_0x5c90ca),_0x2a3c4a);}function Ne(_0x3d9c84,_0x43a74b,_0x481e5a){const _0x444e65=null!==_0x43a74b?_0x1722e1=>_0x1722e1['attribs'][_0x3d9c84]===_0x43a74b:_0x3d7ec7=>Boolean(_0x3d7ec7['attribs'][_0x3d9c84]);return _0xd0f13e(_0x17a779=>_0x18f805(_0x17a779)&&_0x444e65(_0x17a779),_0x481e5a);}function q(_0x386633,_0x29037c){return _0x386633&&_0x18f805(_0x386633)?_0x386633['attribs'][_0x29037c]:null;}function Te(_0x16ed72,_0xcd0f3c,_0x1baea2){_0x18f805(_0x16ed72)&&(null===_0x1baea2?delete _0x16ed72['attribs'][_0xcd0f3c]:_0x16ed72['attribs'][_0xcd0f3c]=_0x1baea2);}function Be(_0x3ddc6a,_0x3246bd,_0xd681fc){const _0x4e2503=_0x3246bd['cloneNode'](!0x0);'beforebegin'===_0xd681fc?_0x509ff6(_0x3ddc6a,_0x4e2503):'afterbegin'===_0xd681fc?_0x1a5e1c(_0x3ddc6a,_0x4e2503):'beforeend'===_0xd681fc?_0x3c9527(_0x3ddc6a,_0x4e2503):'afterend'===_0xd681fc&&_0x2ca204(_0x3ddc6a,_0x4e2503);}function ze(_0x28010f){const _0x5a40a6=[];let _0x50a2b3=_0x28010f;for(;_0x50a2b3;)_0x50a2b3=_0x552933(_0x50a2b3),_0x50a2b3&&_0x5a40a6['push'](_0x50a2b3);return _0x5a40a6;}function zn(_0x981cbf){return _0x981cbf['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Ge(_0x3292c6){let _0x157f69=0x0;for(;_0x3292c6['parentNode'];)_0x3292c6=_0x3292c6['parentNode'],_0x157f69++;return _0x157f69;}function Je(_0x436917){const _0x314aa7=[];let _0x4e9b86=_0x436917['nextSibling'];for(;_0x4e9b86;)_0x314aa7['push'](_0x4e9b86),_0x4e9b86=_0x4e9b86['nextSibling'];_0x314aa7['forEach'](_0x48ca5a=>{_0x423370(_0x48ca5a);});}class tn extends/* #__PURE__ -- @preserve */
25
- Jt(){['_m2html'];constructor(){super(),this['_m2html']=new _0xd104e3();}['convertMarkdownToHTML'](_0x5267d9){const _0x2c2801=this['_m2html']['parse'](_0x5267d9);return this['parseAndNormalizeHTML'](_0x2c2801);}['parseAndNormalizeHTML'](_0x2ae4fd){return this['_parseHTML'](_0x2ae4fd);}['_parseHTML'](_0x4e87f6){const _0x4b71de=sr('<dummy>'+_0x4e87f6['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x4b71de['children']=_0x4b71de['children'][0x0]['children'],_0x4b71de;}}class en extends/* #__PURE__ -- @preserve */
26
- Jt(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x39f534){super(),this['_generateUid']=_0x39f534||_0x206174;}['merge'](_0x39b786,_0x47e5e4,_0x2e5e88){const _0x4336cd=_0x39b786['cloneNode'](!0x0);if(0x0===_0x47e5e4['childNodes']['length']){const _0x1dc90f=[];return Ne('data-id','new-element',_0x4336cd)['forEach'](_0x523917=>{const _0x235f2e=this['_generateUid']();Te(_0x523917,'data-id',_0x235f2e),_0x1dc90f['push'](_0x235f2e);}),this['_removeSpecialComments'](_0x4336cd),{'parsedContent':_0x4336cd,'newNodeIds':_0x1dc90f,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x2e5e88&&_0x2e5e88['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x4336cd),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Ne('data-id',null,_0x47e5e4)['map'](_0x231bfc=>q(_0x231bfc,'data-id'))['filter'](_0x1a7a13=>!!_0x1a7a13));let _0x5728e4=-0x1,_0x420f17=!0x1;const _0x52648a=_0x4336cd['childNodes'],_0x3e5db0=Array['from'](_0x52648a)['filter'](_0x1ca5b9=>!(0x3===_0x1ca5b9['nodeType']&&''===V(_0x1ca5b9)['trim']())),_0x516cbc=_0x3e5db0['length'];for(let _0x5e8916=0x0;_0x5e8916<_0x516cbc;_0x5e8916++){const _0x30f8e8=_0x3e5db0[_0x5e8916],_0x21f710=_0x3e5db0[_0x5e8916+0x1];if(this['_isNewNode'](_0x30f8e8)){if(-0x1===_0x5728e4&&(_0x5728e4=_0x5e8916),this['_markWrappedElements'](_0x30f8e8),!this['_isNewNode'](_0x21f710)){const [_0x5eece9,_0x4da8d4]=this['_findReferenceNode'](_0x30f8e8,_0x420f17,_0x47e5e4);if(_0x5eece9){const _0x40fcdf=Array['from'](_0x3e5db0)['slice'](_0x5728e4,_0x5e8916+0x1);this['_insertNodes'](_0x5eece9,_0x40fcdf,_0x4da8d4),_0x5728e4=-0x1;}}}else{if(this['_isExistingContentComment'](_0x30f8e8))_0x420f17=!0x0;else{if(this['_isExistingNode'](_0x30f8e8)){const _0x1a1f7d=q(_0x30f8e8,'data-id');if(_0x1a1f7d&&this['_existingDataIds']['has'](_0x1a1f7d)){const _0x4dcfc9=z('data-id',_0x1a1f7d,_0x47e5e4);this['_replaceNode'](_0x4dcfc9,_0x30f8e8);}if(this['_touchedNodesState']['removedIds']['includes'](_0x1a1f7d)){const _0x571bc8=this['_touchedNodesState']['removedIds']['indexOf'](_0x1a1f7d);this['_touchedNodesState']['removedIds']['splice'](_0x571bc8,0x1);}}else{if(this['_isDelNode'](_0x30f8e8)){const _0x1ad723=q(_0x30f8e8,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x1ad723)||this['_storeDeletedElementIds'](_0x30f8e8);}}}}}for(const _0x4540e5 of this['_touchedNodesState']['removedIds']){const _0x1150bb=z('data-id',_0x4540e5,_0x47e5e4);if(_0x1150bb){if(_0x2e5e88&&_0x2e5e88['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x4540e5;const _0x596e3e=_0x2e5e88['replaceRemovedWith']['cloneNode'](!0x0);Te(_0x596e3e,'data-id',_0x4540e5),Te(_0x596e3e,'data-removed','true'),_0x472234(_0x1150bb,_0x596e3e);}else _0x423370(_0x1150bb);}}if(Ne('data-wrapped-id',null,_0x47e5e4)['forEach'](_0x2af24b=>{const _0xa7cedc=z('data-id',q(_0x2af24b,'data-wrapped-id'),_0x47e5e4);var _0x5855be,_0x14b7ae;_0xa7cedc&&(_0x14b7ae=_0x2af24b,_0x423370(_0x5855be=_0xa7cedc),_0x472234(_0x14b7ae,_0x5855be));}),Ne('data-id','new-element',_0x47e5e4)['forEach'](_0x94a653=>{const _0x418acb=this['_getUid'](_0x94a653);Te(_0x94a653,'data-id',_0x418acb),this['_touchedNodesState']['newIds']['push'](_0x418acb);}),this['_removeSpecialComments'](_0x47e5e4),_0x2e5e88&&_0x2e5e88['markUnstableElements']&&this['_markUnstableElements'](_0x47e5e4,_0x2e5e88['markUnstableElementsDepth']||0x0),_0x2e5e88&&_0x2e5e88['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x53dd04=z('data-id',this['_touchedNodesState']['lastTouchedId'],_0x47e5e4);for(;_0x53dd04;)Je(_0x53dd04),_0x53dd04=_0x53dd04['parentNode'];}return{'parsedContent':_0x47e5e4,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x195354,_0x514860,_0x2c5cb4){for(const _0xffa886 of _0x514860){const _0x2dc2f6=this['_getUid'](_0xffa886);Te(_0xffa886,'data-id',_0x2dc2f6),this['_touchedNodesState']['newIds']['push'](_0x2dc2f6),this['_touchedNodesState']['lastTouchedId']=_0x2dc2f6;}const _0x3ecb87='afterbegin'===_0x2c5cb4||'afterend'===_0x2c5cb4?_0x514860['reverse']():_0x514860;for(const _0x28f750 of _0x3ecb87)Be(_0x195354,_0x28f750,_0x2c5cb4);}['_replaceNode'](_0x1db9cf,_0x31909d){if(!_0x1db9cf)return;if(_0x43d76b=_0x31909d,zn(V(_0x1db9cf))===zn(V(_0x43d76b)))return;var _0x43d76b;const _0x48c42a=this['_getUid'](_0x1db9cf);Te(_0x31909d,'data-id',_0x48c42a),this['_touchedNodesState']['modifiedIds']['push'](_0x48c42a),this['_touchedNodesState']['lastTouchedId']=_0x48c42a,_0x472234(_0x1db9cf,_0x31909d['cloneNode'](!0x0));}['_findReferenceNode'](_0x3c6a11,_0x2e2f1f,_0x50d59c){const _0x4860e9=this['_findPrevElementWithDataId'](_0x3c6a11,!0x1);if(_0x4860e9){const _0x1c5ed7=this['_getNodeDataId'](_0x4860e9),_0x538796=z('data-id',_0x1c5ed7,_0x50d59c);if(_0x538796)return[_0x538796,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x1c5ed7);}const _0x5c1584=this['_findNextElementWithDataId'](_0x3c6a11,!0x1);if(_0x5c1584){const _0x1e88ab=this['_getNodeDataId'](_0x5c1584),_0x38d0f1=z('data-id',_0x1e88ab,_0x50d59c);if(_0x38d0f1)return[_0x38d0f1,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x1e88ab);}return _0x2e2f1f?_0x3c6a11['nextSibling']?this['_findFallbackReferenceNode'](_0x3c6a11,_0x50d59c):[_0x50d59c['childNodes'][_0x50d59c['childNodes']['length']-0x1],'afterend']:[_0x50d59c['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x2f4aef,_0x3d8267){const _0x1622c6=[],_0x592b08=this['_findPrevElementWithDataId'](_0x2f4aef,!0x0);if(_0x592b08){const _0x4380af=z('data-id',this['_getNodeDataId'](_0x592b08),_0x3d8267);_0x4380af&&_0x1622c6['push']([_0x4380af,'afterend']);}const _0x1ee5e2=this['_findNextElementWithDataId'](_0x2f4aef,!0x0);if(_0x1ee5e2){const _0x342c23=z('data-id',this['_getNodeDataId'](_0x1ee5e2),_0x3d8267);_0x342c23&&_0x1622c6['push']([_0x342c23,'beforebegin']);}if(_0x1622c6['length']>0x1)return Ge(_0x1622c6[0x0][0x0])<=Ge(_0x1622c6[0x1][0x0])?_0x1622c6[0x0]:_0x1622c6[0x1];return 0x1===_0x1622c6['length']?_0x1622c6[0x0]:[_0x3d8267['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x50118e,_0x397e18){let _0x4704e3=_0x50118e['nextSibling'],_0x553c29=null,_0x16a368=!0x1;for(;_0x4704e3;){if(_0x6acdf0(_0x4704e3)){if(this['_isDelNode'](_0x4704e3)&&(_0x553c29=_0x4704e3),this['_isExistingContentComment'](_0x4704e3)&&_0x397e18&&!_0x16a368){_0x16a368=!0x0,_0x4704e3=_0x4704e3['nextSibling'];continue;}break;}const _0x2260f7=q(_0x4704e3,'data-id');if(_0x2260f7&&'new-element'!==_0x2260f7&&this['_existingDataIds']['has'](_0x2260f7)){_0x553c29=_0x4704e3;break;}_0x4704e3=_0x4704e3['nextSibling'];}return _0x553c29;}['_findPrevElementWithDataId'](_0x625da0,_0xa56740){let _0x5b5e56=_0x625da0['previousSibling'],_0x124090=null,_0x31bbca=!0x1;for(;_0x5b5e56;){if(_0x6acdf0(_0x5b5e56)){if(this['_isDelNode'](_0x5b5e56)&&(_0x124090=_0x5b5e56),this['_isExistingContentComment'](_0x5b5e56)&&_0xa56740&&!_0x31bbca){_0x31bbca=!0x0,_0x5b5e56=_0x5b5e56['previousSibling'];continue;}break;}const _0x39bb15=q(_0x5b5e56,'data-id');if(_0x39bb15&&'new-element'!==_0x39bb15&&this['_existingDataIds']['has'](_0x39bb15)){_0x124090=_0x5b5e56;break;}_0x5b5e56=_0x5b5e56['previousSibling'];}return _0x124090;}['_markWrappedElements'](_0x4e8b21){_0x18f805(_0x4e8b21)&&Ne('data-id',null,_0x4e8b21)['forEach'](_0x1b1e34=>{this['_isExistingNode'](_0x1b1e34)&&!this['_hasWrappedParent'](_0x1b1e34)&&(Te(_0x1b1e34,'data-wrapped-id',q(_0x1b1e34,'data-id')),Te(_0x1b1e34,'data-id',null));});}['_getNodeDataId'](_0x2fef24){if(!_0x2fef24)return null;if(_0x18f805(_0x2fef24))return q(_0x2fef24,'data-id');if(_0x6acdf0(_0x2fef24)){const _0x1b6678=V(_0x2fef24)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x1b6678&&_0x1b6678[0x1])return _0x1b6678[0x1];}return null;}['_storeDeletedElementIds'](_0x41ca25){if(_0x6acdf0(_0x41ca25)){const _0x32ff8a=V(_0x41ca25)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x32ff8a&&_0x32ff8a[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x32ff8a[0x1]);}}['_getUid'](_0x20c211){return this['_isExistingNode'](_0x20c211)?q(_0x20c211,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x5989bd){(function(_0x3641f4){return _0x49faf1(_0x3f2b3e=>_0x6acdf0(_0x3f2b3e),_0x3641f4,!0x0,0x1/0x0);}(_0x5989bd)['filter'](_0x21fa3c=>this['_isDelNode'](_0x21fa3c)||this['_isExistingContentComment'](_0x21fa3c))['forEach'](_0x2bce43=>{_0x423370(_0x2bce43);}));}['_markLastTagElementUnstable'](_0x58025d){const _0x2e55a3=_0x58025d['childNodes'],_0x3f4a55=_0x2e55a3[_0x2e55a3['length']-0x1];_0x3f4a55&&_0x18f805(_0x3f4a55)&&Te(_0x3f4a55,'data-unstable','true');}['_markUnstableElements'](_0x5f414e,_0x4852ba){const _0x3ad66c=z('data-unstable','true',_0x5f414e);if(!_0x3ad66c)return;const _0x3e1cf8=ze(_0x3ad66c)['slice'](0x0,-0x1),_0x4600fa=_0x3e1cf8['length'];let _0x504db0=_0x3ad66c;if(_0x4600fa>_0x4852ba){let _0x507b6f=_0x4600fa,_0x13dc5c=null;for(;_0x507b6f>_0x4852ba&&_0x507b6f>=0x0;)_0x507b6f--,_0x13dc5c=_0x3e1cf8[_0x507b6f];_0x13dc5c&&(_0x504db0=_0x13dc5c,Te(_0x3ad66c,'data-unstable',null),Te(_0x13dc5c,'data-unstable','true'));}else{if(_0x4600fa<_0x4852ba){let _0x107a3b=_0x4600fa,_0xadd191=_0x3ad66c;for(;_0x107a3b<_0x4852ba;){const _0x412da0=_0xadd191['childNodes']['filter'](_0x2b0261=>_0x18f805(_0x2b0261));if(0x0===_0x412da0['length'])break;_0x107a3b++,_0xadd191=_0x412da0[_0x412da0['length']-0x1];}_0xadd191&&(_0x504db0=_0xadd191,Te(_0x3ad66c,'data-unstable',null),Te(_0xadd191,'data-unstable','true'));}}let _0x2ee470=_0x504db0;for(;_0x2ee470;){for(;_0x2ee470['nextSibling'];)_0x2ee470=_0x2ee470['nextSibling'],_0x18f805(_0x2ee470)&&Te(_0x2ee470,'data-unstable','true');_0x2ee470=_0x2ee470['parentNode'];}}['_isNewNode'](_0x30ff53){return Boolean('new-element'===q(_0x30ff53,'data-id'));}['_isExistingNode'](_0x1a4229){return Boolean((q(_0x1a4229,'data-id')||'')['length']>0x0&&'new-element'!==q(_0x1a4229,'data-id'));}['_isDelNode'](_0x155e1b){return!!_0x155e1b&&Boolean(_0x6acdf0(_0x155e1b)&&V(_0x155e1b)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x366138){let _0x2649f2=_0x366138['parentNode'];for(;_0x2649f2;){if(q(_0x2649f2,'data-wrapped-id'))return!0x0;_0x2649f2=_0x2649f2['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x48aed0){return Boolean(_0x6acdf0(_0x48aed0)&&V(_0x48aed0)['match'](/\s*existing[\s*-](content|document)\s*/g));}}const Jn=['modification-delta','text-delta'],Zn=['reasoning'];class de extends Jt(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _0x30ca80([]);['parsedMergedContent']=new _0x30ca80([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];constructor({type:_0x5f4a6f,content:_0x1a5261='',isDone:_0x3382b1=!0x1,interactionId:_0x216154,areActionsDisabled:_0x1bcace,documentContextContent:_0x250e89,editor:_0x317c7a}){super(),this['id']=_0x206174(),this['interactionId']=_0x216154,this['type']=_0x5f4a6f,this['areActionsDisabled']=!!_0x1bcace,this['editor']=_0x317c7a,this['aiResponseParser']=new tn(),this['aiResponseApplier']=new en(),this['documentContextContent']=sr(_0x250e89||''),this['set']('isDone',_0x3382b1),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x1a5261);}['appendContent'](_0x3bc83e){this['set']('content',this['content']+_0x3bc83e);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x548044,_0xe5c80f){this['changeGroups'][_0x548044]['state']=_0xe5c80f,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x548044,'state':_0xe5c80f});}['onContentChange'](){if('modification-delta'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x1f2798=this['changeGroups'];this['updateChangeGroups']();const _0x28be1d=this['_getDifferentChangeGroups'](_0x1f2798,this['changeGroups']);(_0x28be1d['length']||this['isDone'])&&this['fire']('replyContentUpdated',this,_0x28be1d);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0xba5c0,_0x3901de){const _0x5553da=[];for(const _0x27e62d of _0x3901de){const _0x2471f4=_0xba5c0[_0x27e62d['index']];_0x2471f4?_0x2471f4['changes']['length']!==_0x27e62d['changes']['length']?_0x5553da['push'](_0x27e62d):_0x2471f4['changes']['forEach']((_0x3f7b38,_0x21dd32)=>{const _0x1d3c09=_0x27e62d['changes'][_0x21dd32];_0x3f7b38['id']!==_0x1d3c09['id']&&_0x5553da['push'](_0x27e62d);}):_0x5553da['push'](_0x27e62d);}return _0x5553da;}['updateChangeGroups'](){const _0x28241c=new _0x1183c6('p',{},[new _0x1183c6('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x3f2749('Removed\x20content.\x20Use\x20\x22Show\x20changes\x22\x20to\x20learn\x20more.')])]),_0x23aa17=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x28241c,'cutAfterLastChange':!this['isDone']});if(!_0x23aa17['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x23aa17['parsedContent'];let _0x5d847b=[];if(_0xd0f13e(_0xbd61eb=>{const _0x1f45c0=q(_0xbd61eb,'data-id');if(!_0x1f45c0||!_0x3784ed(_0x1f45c0))return!0x1;const _0x175228=[_0xbd61eb,...ze(_0xbd61eb)]['at'](-0x2);if(_0xbd61eb!=_0x175228){const _0x1a64a9=q(_0x175228,'data-id');_0x3784ed(_0x1a64a9)||(_0x5d847b['push']({'node':_0x175228,'id':_0x1a64a9,'type':'modified'}),_0x23aa17['modifiedNodeIds']['push'](_0x1a64a9));}else _0x23aa17['modifiedNodeIds']['includes'](_0x1f45c0)?_0x5d847b['push']({'node':_0xbd61eb,'type':'modified','id':_0x1f45c0}):_0x23aa17['newNodeIds']['includes'](_0x1f45c0)?_0x5d847b['push']({'node':_0xbd61eb,'type':'new','id':_0x1f45c0,'anchorId':q(_0xbd61eb['previousSibling'],'data-id')}):_0x5d847b['push']({'node':_0xbd61eb,'type':'removed','id':_0x1f45c0});return!0x0;},this['parsedMergedContent']),_0x5d847b=_0x5d847b['filter'](({node:_0x308ac1})=>[...ze(_0x308ac1),_0x308ac1]['every'](_0x472e2f=>!q(_0x472e2f,'data-unstable'))),0x0==_0x5d847b['length'])return;const _0x309878=[[_0x5d847b[0x0]]];for(let _0x4f4320=0x1;_0x4f4320<_0x5d847b['length'];_0x4f4320++){const _0x4d3cd0=_0x309878[_0x309878['length']-0x1],_0x4af3d3=_0x4d3cd0[_0x4d3cd0['length']-0x1];_0x5d847b[_0x4f4320]['node']['previousSibling']==_0x4af3d3['node']&&'modified'!=_0x5d847b[_0x4f4320]['type']&&'modified'!=_0x4af3d3['type']?_0x4d3cd0['push'](_0x5d847b[_0x4f4320]):_0x309878['push']([_0x5d847b[_0x4f4320]]);}for(const _0x346c49 of _0x309878){const _0x481411=_0x346c49[0x0],_0x371257=_0x346c49[_0x346c49['length']-0x1],_0x55eb65=_0x3ae692(_0x481411['node']['previousSibling']);_0x55eb65&&_0x346c49['unshift'](_0x55eb65);const _0x434dc0=_0x3ae692(_0x371257['node']['nextSibling']);_0x434dc0&&_0x346c49['push'](_0x434dc0);}function _0x3784ed(_0x28c543){return _0x23aa17['modifiedNodeIds']['includes'](_0x28c543)||_0x23aa17['newNodeIds']['includes'](_0x28c543)||_0x23aa17['removedNodeIds']['includes'](_0x28c543);}function _0x3ae692(_0x52f415){if(_0x52f415&&q(_0x52f415,'data-id')&&!q(_0x52f415,'data-unstable')){const _0x23f632=q(_0x52f415,'data-id');if(!_0x3784ed(_0x23f632))return{'node':_0x52f415,'type':'context','id':_0x23f632};}return null;}this['changeGroups']=_0x309878['map']((_0x3f7a82,_0x1be526)=>({'changes':_0x3f7a82,'state':'pending','index':_0x1be526}));}}function Oe(_0x52115d){return Object['values'](Jn)['includes'](_0x52115d);}function Me(_0x18eed2){return Zn['includes'](_0x18eed2);}function Ke(_0x5b766a){return'conversation-title'===_0x5b766a;}function Qe(_0x22c3f9){return'source'===_0x22c3f9;}const qt=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','error'];class jt extends bt(){['id'];['replies']=[];['currentReply'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];constructor({connector:_0x43dde6,editor:_0x18b32a}){super(),this['id']=_0x206174(),this['connector']=_0x43dde6,this['isStopped']=!0x0,this['editor']=_0x18b32a;}async['start'](){let _0x51c7a4;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x46ba90=await this['currentRequest']['getStream'](),_0x34ed44=[];for await(const _0x1d3543 of _0x46ba90){if(this['isStopped'])return;if('error'===_0x1d3543['event'])return void this['fire']('error',{'error':new _0x16a90e('ai-chat-interaction-error',this)});Ke(_0x1d3543['event'])&&this['setConversationTitle'](_0x1d3543['data']['conversationTitle'],!0x0),Qe(_0x1d3543['event'])?_0x34ed44['push'](_0x1d3543['data']['source']):Oe(_0x1d3543['event'])?(_0x1d3543['event']!==_0x51c7a4&&(this['currentReply']&&this['currentReply']['done'](),this['currentReply']=this['createReply']({'type':_0x1d3543['event'],'interactionId':this['id']}),_0x34ed44['length']>0x0&&(this['currentReply']['sources']=_0x34ed44['splice'](0x0)),_0x51c7a4=_0x1d3543['event']),this['currentReply']['appendContent'](_0x1d3543['data']['textDelta'])):Me(_0x1d3543['event'])||_0x53aaf6('ai-interaction-invalid-event-type',{'chunk':_0x1d3543});}}finally{this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x40dc10){return this['replies']['find'](_0x2cf911=>_0x2cf911['id']===_0x40dc10);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x29d09d=>_0x29d09d['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x38e314){const _0x4a6d0b=new de({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x38e314});return this['replies']['push'](_0x4a6d0b),_0x4a6d0b['delegate'](...qt)['to'](this),this['fire']('replyCreated',_0x4a6d0b),_0x4a6d0b;}['setConversationTitle'](_0xa52765,_0x8229e2=!0x1){this['fire']('setConversationTitle',_0xa52765,_0x8229e2);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var Ft=function(_0x11ab19){return _0x11ab19['FILE']='file',_0x11ab19['DOCUMENT']='document',_0x11ab19['URL']='web-resource',_0x11ab19['TEXT']='text',_0x11ab19['SELECTION']='selection',_0x11ab19;}({}),Kt=function(_0x5b9121){return _0x5b9121['TEXT']='text',_0x5b9121['MARKDOWN']='markdown',_0x5b9121['HTML']='html',_0x5b9121;}({});const xi=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class Zt extends Jt(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x21871e,config:_0x10776b,ownerId:_0x5d4be2}){super(),this['_connector']=_0x21871e,this['_config']=_0x10776b,this['_ownerId']=_0x5d4be2;}['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'](_0x1eea05){const _0x331944=await this['_createContextItemFromContent'](_0x1eea05);return this['_addToConversationContextItem'](_0x331944),'current-document'===_0x331944['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x331944;}async['_createContextItemFromContent'](_0x3599ab){if(_0x3599ab['type']===Ft['DOCUMENT']){const _0x4361d8=await this['_connector']['fetchDocument'](this['_ownerId'],_0x3599ab['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x3599ab['type'],'content':_0x4361d8['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x4361d8['attributes']?.['version'],'sessionId':_0x4361d8['attributes']?.['sessionId']};}return{'id':_0x3599ab['id'],'uiId':_0x3599ab['id'],'label':_0x3599ab['attributes']?.['label']||_0x3599ab['name']||_0x3599ab['url']||_0x3599ab['id'],'type':_0x3599ab['type'],..._0x3599ab?.['attributes']?.['resourceId']?{'resourceId':_0x3599ab['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x827934){const _0x59e67d=this['_pendingContextItems']['get'](_0x827934);_0x59e67d?.['isReadOnly']||this['_removeContextItem'](_0x827934);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x52fbab of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x52fbab['uiId']);const _0x537ed0=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x537ed0&&this['_addContextItem']({..._0x537ed0,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x36268b){for(const _0x592d56 of _0x36268b['values']())this['_addToConversationContextItem'](_0x592d56);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'](_0x34469d){return Array['from'](_0x34469d['values']())['map'](_0x36c6de=>this['_mapContextItemToRequestData'](_0x36c6de))['filter'](_0x1b03cc=>null!==_0x1b03cc);}async['addFilesToContext'](_0xd644bf,_0x5bbff5,_0x142479=Ft['FILE']){const _0x15d233='files-'+_0x206174();this['_startUploadOperation'](_0x15d233);try{await Promise['all'](_0xd644bf['map'](async _0x5bbdd0=>{const _0x565e09='file-'+_0x206174(),_0x254915=Yt(_0x5bbdd0['name']);try{this['_addContextItem']({'type':_0x142479,'label':_0x5bbff5?.['label']||_0x254915,'uiId':_0x565e09,'resourceId':_0x5bbff5?.['resourceId']},!0x0);const _0x122c8f=this['_connector']['uploadFile'](this['_ownerId'],_0x5bbdd0,_0x5bbff5);this['_ongoingUploads']['set'](_0x565e09,_0x122c8f['abortController']);const {id:_0x547dc1}=await _0x122c8f['getId']();this['_ongoingUploads']['delete'](_0x565e09),this['_finishContextItemLoading']({'type':_0x142479,'id':_0x547dc1,'label':_0x5bbff5?.['label']||_0x254915,'uiId':_0x565e09,'resourceId':_0x5bbff5?.['resourceId']},!0x1);}catch(_0x3cd4d7){this['_ongoingUploads']['delete'](_0x565e09);if(!_0x3cd4d7['message']['startsWith']('ai-request-aborted')){const _0x1e5850=new _0x16a90e('ai-chat-file-upload-failed',null,{'fileName':_0x254915});_0x1e5850['stack']=_0x3cd4d7['stack'],this['fire']('error',{'error':_0x1e5850,'fileName':_0x254915});}this['_removeContextItem'](_0x565e09);}}));}finally{this['_finishUploadOperation'](_0x15d233);}}['addCurrentDocumentToContext'](_0x3e21d7){if(this['isCurrentDocumentInContext']())return;const _0x2a78e9={'type':Ft['DOCUMENT'],'uiId':'current-document','label':_0x3e21d7,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x2a78e9);}async['updateCurrentDocument'](_0x449b54,_0x3a5f28,_0x3830b8,_0x48c500){const _0x57eb14=this['_pendingContextItems']['get']('current-document');if(_0x57eb14&&_0x449b54){_0x57eb14['selection']=_0x48c500?_0x48c500['map'](_0x495096=>({'start':_0x495096['start'],'end':_0x495096['end']})):[];try{if(_0x57eb14['version']===_0x3a5f28)return;const {id:_0x5a5bca}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x449b54,{'version':_0x3a5f28,'sessionId':_0x3830b8})['getId']();_0x57eb14['id']=_0x5a5bca,_0x57eb14['content']=_0x449b54,_0x57eb14['version']=_0x3a5f28,_0x57eb14['sessionId']=_0x3830b8;}catch(_0x3245c2){const _0x38e217=new _0x16a90e('ai-chat-document-upload-failed',null);_0x38e217['stack']=_0x3245c2['stack'],this['fire']('error',{'error':_0x38e217});}}}['addSelectionToContext'](_0x9dece5){this['_addContextItem']({'type':Ft['SELECTION'],'label':_0x9dece5,'uiId':'selection','content':_0x9dece5});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x4a56af,_0x1ee83e){const _0x27a765='url-'+_0x206174();this['_startUploadOperation'](_0x27a765);const _0xf8502d='url-'+_0x206174();try{this['_addContextItem']({'type':Ft['URL'],'label':_0x1ee83e?.['label']||_0x4a56af,'uiId':_0xf8502d,'resourceId':_0x1ee83e?.['resourceId']},!0x0);const _0x1a8603=this['_connector']['uploadUrl'](this['_ownerId'],_0x4a56af,_0x1ee83e);this['_ongoingUploads']['set'](_0xf8502d,_0x1a8603['abortController']);const {id:_0xfdc8cd}=await _0x1a8603['getId']();this['_ongoingUploads']['delete'](_0xf8502d),this['_finishContextItemLoading']({'type':Ft['URL'],'id':_0xfdc8cd,'label':_0x1ee83e?.['label']||_0x4a56af,'uiId':_0xf8502d,'resourceId':_0x1ee83e?.['resourceId']},!0x1);}catch(_0x2cfc3d){this['_ongoingUploads']['delete'](_0xf8502d),(_0x2cfc3d['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x16a90e('ai-chat-url-upload-failed',this,{'url':_0x4a56af,'originalError':_0x2cfc3d}),'url':_0x4a56af}),this['_removeContextItem'](_0xf8502d));}finally{this['_finishUploadOperation'](_0x27a765);}}async['loadSourceResources'](_0x2f2dd6,_0x3ac862,_0x246dda){const _0x4f12b2=this['_addContextOptionsState']['sources']['find'](_0x5df010=>_0x5df010['id']===_0x2f2dd6);if(!_0x4f12b2)return this['fire']('error',{'error':new _0x16a90e('ai-chat-source-not-found',this,{'sourceId':_0x2f2dd6}),'sourceId':_0x2f2dd6}),[];try{const _0x329cf4=(await _0x4f12b2['getResources'](_0x3ac862))['map'](_0x48e7c9=>{const _0xca82b0=this['_isResourceInContext'](_0x48e7c9['id']);return{..._0x48e7c9,'isInContext':_0xca82b0};});return _0x4f12b2['resources']=_0x329cf4,this['fire']('sourceResourcesLoaded',{'sourceId':_0x2f2dd6,'source':_0x4f12b2,'resources':_0x329cf4,'uid':_0x246dda}),_0x329cf4;}catch(_0x43252c){return this['fire']('error',{'error':new _0x16a90e('ai-chat-source-resources-load-failed',this,{'sourceId':_0x2f2dd6,'originalError':_0x43252c}),'sourceId':_0x2f2dd6,'sourceLabel':_0x4f12b2['label']}),[];}}async['addResourceToContext'](_0x2daa67,_0x31431e){if(this['_isResourceInContext'](_0x31431e['id']))return;let _0x2a7cd6=_0x31431e['data'];if(!_0x2a7cd6&&_0x2daa67['getData'])try{_0x2a7cd6=await _0x2daa67['getData'](_0x31431e['id']);}catch(_0x2b5bbc){return void this['fire']('error',{'error':new _0x16a90e('ai-chat-resource-load-failed',this,{'resourceId':_0x31431e['id'],'sourceId':_0x2daa67['id'],'originalError':_0x2b5bbc}),'resourceId':_0x31431e['id'],'sourceId':_0x2daa67['id']});}if(_0x2a7cd6)switch(_0x31431e['type']){case Ft['URL']:if('string'!=typeof _0x2a7cd6)return void this['fire']('error',{'error':new _0x16a90e('ai-chat-context-invalid-data',this,{'resourceId':_0x31431e['id'],'sourceId':_0x2daa67['id'],'expectedType':'string','actualType':typeof _0x2a7cd6}),'resourceId':_0x31431e['id'],'sourceId':_0x2daa67['id']});await this['addUrlToContext'](_0x2a7cd6,{'label':_0x31431e['label'],'resourceId':_0x31431e['id']});break;case Ft['FILE']:if(!(_0x2a7cd6 instanceof File))return void this['fire']('error',{'error':new _0x16a90e('ai-chat-context-invalid-data',this,{'resourceId':_0x31431e['id'],'sourceId':_0x2daa67['id'],'expectedType':'File','actualType':typeof _0x2a7cd6}),'resourceId':_0x31431e['id'],'sourceId':_0x2daa67['id']});await this['addFilesToContext']([_0x2a7cd6],{'label':_0x31431e['label'],'resourceId':_0x31431e['id']});break;case Ft['TEXT']:if('object'!=typeof _0x2a7cd6||!('content'in _0x2a7cd6)||!('type'in _0x2a7cd6))return void this['fire']('error',{'error':new _0x16a90e('ai-chat-context-invalid-data',this,{'resourceId':_0x31431e['id'],'sourceId':_0x2daa67['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x2a7cd6}),'resourceId':_0x31431e['id'],'sourceId':_0x2daa67['id']});_0x2a7cd6=Zt['_convertTextResourceToFile'](_0x2a7cd6,_0x31431e['label']),await this['addFilesToContext']([_0x2a7cd6],{'label':_0x31431e['label'],'resourceId':_0x31431e['id']},Ft['TEXT']);break;default:this['fire']('error',{'error':new _0x16a90e('ai-chat-context-unsupported-type',this,{'resourceId':_0x31431e['id'],'sourceId':_0x2daa67['id'],'resourceType':_0x31431e['type']}),'resourceId':_0x31431e['id'],'sourceId':_0x2daa67['id']});}else this['fire']('error',{'error':new _0x16a90e('ai-chat-resource-no-data',this,{'resourceId':_0x31431e['id'],'sourceId':_0x2daa67['id']}),'resourceId':_0x31431e['id'],'sourceId':_0x2daa67['id']});}static['_convertTextResourceToFile'](_0x271374,_0x55e213){switch(_0x271374['type']){case Kt['MARKDOWN']:return new File([_0x271374['content']],_0x55e213,{'type':'text/markdown'});case Kt['HTML']:return new File([_0x271374['content']],_0x55e213,{'type':'text/html'});default:return new File([_0x271374['content']],_0x55e213,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x38e08e){switch(_0x38e08e['type']){case Ft['FILE']:return{'type':Ft['FILE'],'id':_0x38e08e['id']};case Ft['URL']:return{'type':Ft['URL'],'id':_0x38e08e['id']};case Ft['DOCUMENT']:return{'type':Ft['DOCUMENT'],'id':_0x38e08e['id'],..._0x38e08e['selection']?.['length']&&{'selection':_0x38e08e['selection']}};case Ft['TEXT']:return{'type':Ft['FILE'],'id':_0x38e08e['id']};default:return null;}}['_addContextItem'](_0x20adec,_0x3bf9c1=!0x1){if(this['_pendingContextItems']['set'](_0x20adec['uiId'],_0x20adec),_0x20adec['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x20adec,'isLoading':_0x3bf9c1}),'current-document'===_0x20adec['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x20adec['resourceId']){const _0x18c764=this['_findSourceIdsByResourceId'](_0x20adec['resourceId']);_0x18c764&&_0x18c764['forEach'](_0x409429=>{this['_updateResourceInContextState'](_0x409429,_0x20adec['resourceId'],!0x0);});}}['_removeContextItem'](_0x297b91){const _0x49d3c9=this['_pendingContextItems']['get'](_0x297b91),_0x886c6e=this['_ongoingUploads']['get'](_0x297b91);if(_0x886c6e&&(_0x886c6e['abort'](),this['_ongoingUploads']['delete'](_0x297b91)),_0x49d3c9?.['resourceId']){const _0x49ebad=this['_findSourceIdsByResourceId'](_0x49d3c9['resourceId']);_0x49ebad&&_0x49ebad['forEach'](_0x4770b1=>{this['_updateResourceInContextState'](_0x4770b1,_0x49d3c9['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x297b91),this['fire']('contextItemRemoved',{'uiId':_0x297b91,'type':_0x49d3c9?.['type']}),'current-document'===_0x297b91&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x32951f,_0x23a250){if(this['_pendingContextItems']['has'](_0x32951f['uiId'])&&(this['_pendingContextItems']['set'](_0x32951f['uiId'],_0x32951f),this['fire']('contextItemLoadingEnded',{'contextItem':_0x32951f,'isLoading':_0x23a250}),_0x32951f['resourceId'])){const _0x2de1ff=this['_findSourceIdsByResourceId'](_0x32951f['resourceId']);_0x2de1ff&&_0x2de1ff['forEach'](_0x476048=>{this['_updateResourceInContextState'](_0x476048,_0x32951f['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x54317e){this['_conversationContextItems']['set'](_0x54317e['uiId'],_0x54317e);}['_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'](_0x1fc6b3=>({..._0x1fc6b3,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x227e62=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x227e62,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x178f17){for(const _0x35bc15 of this['_pendingContextItems']['values']())if(_0x35bc15['resourceId']===_0x178f17)return!0x0;for(const _0x3f793c of this['_conversationContextItems']['values']())if(_0x3f793c['resourceId']===_0x178f17)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x513faa){const _0x8a1e3f=[];for(const _0x48b711 of this['_addContextOptionsState']['sources']){_0x48b711['resources']['find'](_0x41b819=>_0x41b819['id']===_0x513faa)&&_0x8a1e3f['push'](_0x48b711['id']);}return 0x0===_0x8a1e3f['length']?null:_0x8a1e3f;}['_updateResourceInContextState'](_0x1138bf,_0x5335c3,_0xe7ae3b){const _0x1ff489=this['_addContextOptionsState']['sources']['find'](_0x2112f6=>_0x2112f6['id']===_0x1138bf);if(!_0x1ff489)return;const _0x427ab5=_0x1ff489['resources']['find'](_0x3a8f4d=>_0x3a8f4d['id']===_0x5335c3);_0x427ab5&&(_0x427ab5['isInContext']=_0xe7ae3b,this['fire']('resourceStateChanged',{'sourceId':_0x1138bf,'resourceId':_0x5335c3,'isInContext':_0xe7ae3b}));}['_startUploadOperation'](_0x4a0016){this['_ongoingUploadOperations']['set'](_0x4a0016,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0xced1fe){this['_ongoingUploadOperations']['delete'](_0xced1fe),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Si=['capabilitiesUpdated'];class Di extends bt(){['_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'](_0xad6658){const _0x2bafd1={};return _0xad6658&&_0xad6658['isWebSearchEnabled']&&(_0x2bafd1['webSearch']={}),_0xad6658&&_0xad6658['isReasoningEnabled']&&(_0x2bafd1['reasoning']={}),_0x2bafd1;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0xe82ede){_0xe82ede!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0xe82ede,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x14c1c8){_0x14c1c8!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x14c1c8,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class ji extends jt{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['quickActionData'];constructor(_0x3e32eb){super(_0x3e32eb),this['conversationId']=_0x3e32eb['conversationId'],this['contextItems']=_0x3e32eb['contextItems'],this['capabilities']=_0x3e32eb['capabilities'],this['userMessage']=_0x3e32eb['userMessage'],this['model']=_0x3e32eb['model'],this['quickActionData']=_0x3e32eb['quickActionData'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':Zt['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Di['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'quickActionData':this['quickActionData']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class U extends bt(){['id'];['isStarted']=!0x1;['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x17a1d3){super(),this['options']=_0x17a1d3,this['connector']=_0x17a1d3['connector'],this['chatModels']=_0x17a1d3['chatModels'],this['id']=_0x17a1d3['conversationId'];}async['init'](_0x478f5a){try{this['chatContext']=new Zt({'connector':this['connector'],'config':_0x478f5a,'ownerId':this['id']}),this['chatContext']['delegate'](...xi)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Di(),this['chatCapabilities']['delegate'](...Si)['to'](this),this['chatCapabilities']['init']();const _0x5fbd6c=await this['chatModels']['getAll']();this['fire']('conversationInitialized',{'availableModels':_0x5fbd6c});const _0x4369c0=await this['chatModels']['getDefault'](this['options']['defaultModelId']);_0x4369c0&&await this['setModel'](_0x4369c0);}catch(_0x478f0c){const _0x1561ff=new _0x16a90e('ai-chat-conversation-init-failed',null,{'message':_0x478f0c['message']});_0x1561ff['stack']=_0x478f0c['stack'],this['fire']('error',{'error':_0x1561ff});}}async['start'](){if(this['isStarted'])throw new _0x16a90e('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x16a90e('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x58fb8f}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x58fb8f,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x12d1af){const _0x4e5e87=new _0x16a90e('ai-chat-conversation-start-failed',null,{'message':_0x12d1af['message']});_0x4e5e87['stack']=_0x12d1af['stack'],this['fire']('error',{'error':_0x4e5e87});}}async['load'](_0xda7600,_0x3566b7){try{const _0xbdbb3a=await this['connector']['fetchConversation'](_0xda7600)['getConversation'](),_0x565ef4=await this['connector']['fetchConversationMessages'](_0xda7600)['getMessages'](),_0x349157=_0x565ef4[0x0]['model'];this['isStarted']=!0x0,this['id']=_0xbdbb3a['id'],'title'in _0xbdbb3a?this['fire']('setConversationTitle',_0xbdbb3a['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x4e95d5=(await this['chatModels']['getAll']())['find'](_0x340318=>_0x340318['id']['toLowerCase']()===_0x349157['toLowerCase']());return this['selectedModel']=_0x4e95d5,this['fire']('modelSelected',{'selectedModel':_0x4e95d5,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x565ef4,_0x3566b7,_0x349157),this['currentInteraction']=void 0x0,this;}catch(_0x29a1a8){const _0x5d9f89=new _0x16a90e('ai-chat-conversation-init-from-id-failed',null,{'message':_0x29a1a8['message'],'conversationId':_0xda7600});throw _0x5d9f89['stack']=_0x29a1a8['stack'],this['fire']('error',{'error':_0x5d9f89}),_0x5d9f89;}}async['_processMessagesToInteractions'](_0xf945a9,_0x55a797,_0x3c819d){let _0x506b77;for(const _0x240f40 of _0xf945a9)if('user'===_0x240f40['role']){const _0x1c6e71=await this['_extractContextItems'](_0x240f40),_0x1ff9ce={'isReasoningEnabled':Object['hasOwn'](_0x240f40['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x240f40['capabilities'],'webSearch')};_0x506b77=this['createInteraction']({'userMessage':_0x240f40['prompt'],'contextItems':_0x1c6e71,'capabilities':_0x1ff9ce,'modelId':_0x3c819d,'quickActionData':_0x240f40['attributes']?.['quickActionData']}),this['currentInteraction']=_0x506b77,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x240f40['role']&&_0x506b77)for(const _0x404745 of _0x240f40['content']){const _0x196f16='text'===_0x404745['type']?'text-delta':'modification-delta',_0x6886aa=_0x506b77['getDocumentContext']()?.['sessionId']!==_0x55a797;_0x506b77['currentReply']=_0x506b77['createReply']({'type':_0x196f16,'isDone':!0x0,'interactionId':_0x506b77['id'],'areActionsDisabled':_0x6886aa}),_0x506b77['currentReply']['appendContent'](_0x404745['content']);}}}async['_extractContextItems'](_0x7d2092){const _0x2707db=new Map();if(!_0x7d2092['content'])return _0x2707db;for(const _0x248396 of _0x7d2092['content']){const _0x41ea70=await this['chatContext']['populateFromMessage'](_0x248396);_0x41ea70&&_0x2707db['set'](_0x41ea70['id'],_0x41ea70);}return _0x2707db;}async['handleUserInteraction']({userMessage:_0x6b0a38,quickActionData:_0x461dd4}){if(!this['isStarted'])throw new _0x16a90e('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x16a90e('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x4c0e69=this['chatContext']['getPendingContextItems'](),_0x3e6973=this['chatCapabilities']['getCapabilitiesConfig'](),_0x3eb3f8=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x6b0a38,'contextItems':_0x4c0e69,'capabilities':_0x3e6973,'modelId':_0x3eb3f8,'quickActionData':_0x461dd4}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x223e59){this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x223e59});}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0xd6e0ed,contextItems:_0x47d864,capabilities:_0x4812e7,modelId:_0x387823,quickActionData:_0x256fb9}){const _0x1668bb=new ji({'userMessage':_0xd6e0ed,'contextItems':_0x47d864,'capabilities':_0x4812e7,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x387823,'quickActionData':_0x256fb9});return _0x1668bb['delegate'](...qt)['to'](this),this['interactions']['push'](_0x1668bb),this['fire']('interactionCreated',_0x1668bb),_0x1668bb;}['getInteraction'](_0xee0de5){return this['interactions']['find'](_0x18803a=>_0x18803a['id']===_0xee0de5);}['removeInteraction'](_0x59c0cc){const _0x2a7851=this['getInteraction'](_0x59c0cc);_0x2a7851&&(_0x2a7851['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x2a7851),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x13ee92){this['chatContext']['addCurrentDocumentToContext'](_0x13ee92);}async['updateCurrentDocumentInContext']({content:_0x561c6e,version:_0xcd008a,sessionId:_0x11b5a0,selections:_0x5322c0}){await this['chatContext']['updateCurrentDocument'](_0x561c6e,_0xcd008a,_0x11b5a0,_0x5322c0);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x54f3fc){this['chatContext']['addSelectionToContext'](_0x54f3fc);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0xa7e5e){this['chatContext']['addFilesToContext'](_0xa7e5e);}['addUrlToContext'](_0x593ceb){this['chatContext']['addUrlToContext'](_0x593ceb);}['addResourceToContext'](_0x4359bd,_0x217b03){this['chatContext']['addResourceToContext'](_0x4359bd,_0x217b03);}['loadSourceResources'](_0x506898,_0x2cfa97,_0x41ab17){return this['chatContext']['loadSourceResources'](_0x506898,_0x2cfa97,_0x41ab17);}['removeFromContext'](_0x2f5764){this['chatContext']['removeFromContext'](_0x2f5764);}['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'](_0x32871d){if(!_0x32871d)throw new _0x16a90e('ai-chat-conversation-set-model-null',null,{'conversation':this});if(!0x1===await this['chatModels']['isAvailable'](_0x32871d))throw new _0x16a90e('ai-chat-conversation-set-model-not-available',null,{'conversation':this,'model':_0x32871d});_0x32871d['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x32871d,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x32871d}));}}function P(_0x4c1713){if(_0x4c1713 instanceof _0x50d722)return _0x4c1713;if(_0x4c1713?.['editors']&&_0x4c1713['editors']['get'](0x0))return _0x4c1713['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.'),_0x4c1713['editors']['get'](0x0);throw new _0x16a90e('ai-get-editor-from-context-no-editor');}const L='ai-selection';class a extends _0x52a465{['_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 _0x5d658c=P(this['context']),_0x32ed13=_0x5d658c['plugins']['has']('RealTimeCollaborationClient')&&_0x5d658c['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x32ed13||_0x206174();}return this['_sessionId'];}['getDocumentData'](){const _0x5dce0c=P(this['context']),_0x100432=_0x5dce0c['model'],_0x333e7a=_0x5dce0c['data']['toView'](_0x100432['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x171ed2=new dt(_0x5dce0c['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x333e7a,_0x171ed2);let _0x4da046=_0x5dce0c['data']['processor']['toData'](_0x333e7a);const _0x137007=this['_getMarkersInDocumentOrder'](),_0x298a5a=[];for(const _0x231a93 of _0x137007){const _0x3987b0='<'+_0x231a93['name']+':start></'+_0x231a93['name']+':start>',_0x2e44df=_0x4da046['indexOf'](_0x3987b0);_0x4da046=_0x4da046['substring'](0x0,_0x2e44df)+_0x4da046['substring'](_0x2e44df+_0x3987b0['length']);const _0x4583e4='<'+_0x231a93['name']+':end></'+_0x231a93['name']+':end>',_0x1bc959=_0x4da046['indexOf'](_0x4583e4);_0x4da046=_0x4da046['substring'](0x0,_0x1bc959)+_0x4da046['substring'](_0x1bc959+_0x4583e4['length']),_0x298a5a['push']({'markerName':_0x231a93['name'],'start':_0x2e44df,'end':_0x1bc959,'htmlFragment':_0x4da046['substring'](_0x2e44df,_0x1bc959)});}return{'content':_0x4da046,'version':_0x5dce0c['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x298a5a};}async['afterInit'](){this['context']instanceof _0x50d722?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x58de8b,_0x579002)=>{_0x579002['on']('ready',()=>{this['_integrateEditor'](_0x579002);});});}['_integrateEditor'](_0x42f995){_0x42f995['conversion']['for']('editingDowncast')['markerToHighlight']({'model':L,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x42f995['conversion']['for']('dataDowncast')['markerToElement']({'model':L,'view':(_0x298aaa,{writer:_0x27f0da,options:_0x46c910})=>_0x46c910['convertAiChatSelectionMarker']?_0x27f0da['createUIElement'](_0x298aaa['markerName']+':'+(_0x298aaa['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x2af77f,_0x23e104,_0x25b8f7=!0x1,_0x55783b=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x55783b)return!0x1;this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x23e104,this['_displayedFakeSelectionLocked']=_0x25b8f7;const _0x247a62=P(this['context'])['model'];return _0x247a62['change'](_0x17a1ad=>{let _0x4a0900=0x0;for(let _0x45611f of _0x2af77f){const _0x53c628=L+':'+_0x4a0900;if(_0x45611f['start']['isAtEnd']){const _0xb527fa=_0x45611f['start']['getLastMatchingPosition'](({item:_0x325153})=>!_0x247a62['schema']['isContent'](_0x325153),{'boundaries':_0x45611f});_0x45611f=_0x17a1ad['createRange'](_0xb527fa,_0x45611f['end']);}_0x17a1ad['addMarker'](_0x53c628,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x45611f}),_0x4a0900++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x243501){if(this['_displayedFakeSelectionId']!=_0x243501)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x2caa4d=P(this['context']),_0x45f1ec=_0x2caa4d['model']['markers']['getMarkersGroup'](L);return _0x2caa4d['model']['change'](_0x17a371=>{for(const _0x40101a of _0x45f1ec)_0x17a371['removeMarker'](_0x40101a);}),!0x0;}['modelToViewWithIds'](_0x98a397){const _0x88dc2b=P(this['context']),_0x499d7f=_0x88dc2b['data']['toView'](_0x98a397),_0x4ef658=new dt(_0x88dc2b['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x499d7f,_0x4ef658),_0x499d7f;}['_setDataIdsOnChildren'](_0x5af627,_0x38bea9){let _0x16a816=!0x1;const _0xef60fa=new Set();for(const _0x21629f of _0x5af627['getChildren']()){const _0x4dbe66=_0x21629f['is']('emptyElement')||_0x21629f['is']('containerElement');if(!_0x21629f['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x21629f,_0x38bea9)||_0x4dbe66)&&(_0x38bea9['setAttribute']('data-id',this['_nextDataId'](_0xef60fa),_0x21629f),_0x16a816=!0x0);}return _0x16a816;}['_nextDataId'](_0x31d926){let _0x10b3d8;do{_0x10b3d8='';for(let _0x1d1417=0x0;_0x1d1417<0x4;_0x1d1417++)_0x10b3d8+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x31d926['has'](_0x10b3d8));return _0x31d926['add'](_0x10b3d8),_0x10b3d8;}['getSelectionText'](){const {model:_0x7e8718}=P(this['context']),_0x1c8c4a=_0x7e8718['document']['selection'],_0xe7d385=_0x7e8718['getSelectedContent'](_0x1c8c4a),_0x59f8b5=[],_0x16fce1=_0x7e8718['createRangeIn'](_0xe7d385)['getWalker']();for(const {item:_0x2d4d06}of _0x16fce1)_0x2d4d06['is']('$textProxy')?_0x59f8b5['push'](_0x2d4d06['data']):_0x2d4d06['is']('element')&&_0x59f8b5['length']>0x0&&'\x20'!==_0x59f8b5[_0x59f8b5['length']-0x1]&&_0x59f8b5['push']('\x20');return'\x22'+_0x59f8b5['join']('')['trim']()+'\x22';}['_getMarkersInDocumentOrder'](){const _0x1f024b=P(this['context'])['model'];return Array['from'](_0x1f024b['markers']['getMarkersGroup'](L))['sort']((_0x41551a,_0x265af8)=>_0x41551a['getStart']()['isBefore'](_0x265af8['getStart']())?-0x1:_0x41551a['getStart']()['isAfter'](_0x265af8['getStart']())?0x1:0x0);}}class k extends bt(){['_modelList']=[];['_connector'];constructor({connector:_0x55bead}){super(),this['_connector']=_0x55bead;}async['getAll'](){if(!this['_modelList']['length']){const _0x46e915=this['_connector']['getModels'](),_0x1f0341=(await _0x46e915['list']())['items']['sort']((_0x4cfa69,_0x526ad6)=>{const _0x588cee=Object['values'](_0x4cfa69['capabilities'])['filter'](_0x5931b7=>_0x5931b7['enabled'])['length'];return Object['values'](_0x526ad6['capabilities'])['filter'](_0x4e950a=>_0x4e950a['enabled'])['length']-_0x588cee;});this['_modelList']=_0x1f0341;}return this['_modelList'];}async['getDefault'](_0x60a5de){const _0x261dc9=await this['getAll']();if(!_0x261dc9['length'])return null;if(_0x60a5de){const _0x5e0fce=_0x261dc9['find'](_0x2eb454=>_0x2eb454['id']===_0x60a5de);if(_0x5e0fce)return _0x5e0fce;_0x53aaf6('ai-chat-default-model-id-unrecognized',{'defaultModelId':_0x60a5de,'fallBackModelId':_0x261dc9[0x0]['id']});}return _0x261dc9[0x0];}async['isAvailable'](_0x43c38){return(await this['getAll']())['some'](_0xd803ac=>_0xd803ac['name']===_0x43c38['name']&&_0xd803ac['provider']===_0x43c38['provider']);}}function w({editor:_0x3337b1,interaction:_0xd72b36,reply:_0x580867,groups:_0x38dde6,transform:_0x80e4ab,documentCompare:_0x5c5965,documentCompareOptions:_0x4ec160}){const _0x14752=_0xd72b36['getDocumentContext']();if(!_0x14752)return[];const _0x1cfa57=_0x14752['content'],_0x111f82=_0x14752['version'],_0x4c2c64=_0x580867['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x2cd25c}of _0x38dde6){const _0x5b4195=_0x2cd25c['filter'](_0x2e87db=>'new'!=_0x2e87db['type'])['map'](_0x27d73b=>z('data-id',_0x27d73b['id'],_0x4c2c64)),_0x47f390=_0x2cd25c['filter'](_0x3fad7c=>'removed'!=_0x3fad7c['type'])['map'](_0x2b3ea1=>_0x2b3ea1['node']['cloneNode'](!0x0));let _0x1e4db9=null;if(_0x5b4195['length']){_0x1e4db9=_0x5b4195[0x0]['previousSibling'];for(let _0xf5d9d5=0x0;_0xf5d9d5<_0x5b4195['length'];_0xf5d9d5++)_0x423370(_0x5b4195[_0xf5d9d5]);}if(_0x47f390['length']){_0x1e4db9||(_0x2cd25c[0x0]['anchorId']?_0x1e4db9=z('data-id',_0x2cd25c[0x0]['anchorId'],_0x4c2c64):(_0x1e4db9=_0x47f390['shift'](),_0x1a5e1c(_0x4c2c64,_0x1e4db9)));for(let _0x263501=0x0;_0x263501<_0x47f390['length'];_0x263501++)_0x2ca204(_0x1e4db9,_0x47f390[_0x263501]),_0x1e4db9=_0x47f390[_0x263501];}}const _0x338e22=V(_0x4c2c64),_0x5dc180=_0x5c5965['getDiff'](_0x1cfa57,_0x338e22,_0x4ec160)['getOperations']();if(_0x80e4ab){const _0x6011e5=_0x3337b1['model']['document']['history']['getOperations'](_0x111f82),_0x498bf5={'document':_0x3337b1['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0xa4dfae(_0x5dc180,_0x6011e5,_0x498bf5)['operationsA'];}return _0x5dc180;}function p({editor:_0x975523,changeGroups:_0x5cf6f4,documentContextContent:_0x3e2683,showDiff:_0xd287cf,trimUnchanged:_0x3e01c6=!0x0}){return _0x5cf6f4['map'](_0xc051ad=>{const _0x24ad96=new _0x30ca80([]),_0x4c588e=new _0x30ca80([]);for(const _0x392f14 of _0xc051ad['changes'])if(_0xd287cf&&'removed'==_0x392f14['type']||_0x4c588e['children']['push'](_0x392f14['node']['cloneNode'](!0x0)),'new'!=_0x392f14['type']&&(_0xd287cf||'removed'!=_0x392f14['type'])){const _0x21710a=_0x5d5fb0(_0x21c619=>q(_0x21c619,'data-id')==_0x392f14['id'],_0x3e2683,!0x0);_0x21710a&&_0x24ad96['children']['push'](_0x21710a['cloneNode'](!0x0));}const {content:_0x95ecf8,hasChanges:_0x2c8f51}=function(_0x21adbf,_0x19ff11,_0xb41a3f,_0x34bdf0,_0x47a133=!0x0){const _0x1a3ec0=_0x21adbf['plugins']['get']('DocumentCompare'),_0x4d6ac3=_0x21adbf['plugins']['get']('TrackChangesEditing'),_0x2f251c=V(_0x19ff11),_0x417c32=V(_0xb41a3f),_0x368957=_0x21adbf['data']['parse'](_0x2f251c,'$root'),_0x29cce7=_0x21adbf['model']['createPositionAt'](_0x368957,0x0),_0x3b7e4a=_0x1a3ec0['getDiff'](_0x2f251c,_0x417c32,{'anchor':_0x29cce7,'markDeletions':_0x34bdf0}),_0x5266be=_0x3b7e4a['getOperations']();if(0x0==_0x5266be['length'])return{'content':_0x19ff11['cloneNode'](!0x0),'hasChanges':!0x1};_0x34bdf0?_0x4d6ac3['_applyOperationsAsSuggestions'](_0x5266be):_0x21adbf['model']['change'](_0x2f983f=>{for(const _0x42ed48 of _0x5266be)if('remove'==_0x42ed48['type']){const _0x490771=_0x42ed48['sourcePosition'],_0x420ca3=_0x42ed48['howMany'],_0xff2c5f=new _0x11d81b(_0x490771,_0x420ca3);_0x2f983f['batch']['addOperation'](_0xff2c5f),_0x21adbf['model']['applyOperation'](_0xff2c5f);}else _0x42ed48['baseVersion']=null,_0x42ed48['isDocumentOperation']=!0x1,_0x2f983f['batch']['addOperation'](_0x42ed48),_0x21adbf['model']['applyOperation'](_0x42ed48);});if(_0x47a133){const _0x1185d2=F(_0x21adbf,_0x5266be,_0x368957);G(_0x21adbf['model'],_0x1185d2),function(_0x45666f,_0x510c08){const _0x1aaf7d=_0x510c08['getFirstRange']()['start'];let _0x167c4c=_0x510c08['getFirstRange']()['end'];const _0x56c245=_0x1aaf7d['root'];(_0x167c4c['textNode']||_0x167c4c['nodeAfter']&&_0x167c4c['nodeAfter']['is']('$text'))&&(_0x3ef64d(_0x167c4c,'...'),_0x167c4c=_0x167c4c['getShiftedBy'](0x3)),(_0x1aaf7d['textNode']||_0x1aaf7d['nodeBefore']&&_0x1aaf7d['nodeBefore']['is']('$text'))&&(_0x3ef64d(_0x1aaf7d,'...'),function(_0x521efe,_0x1568aa,_0x51dc32){for(let [_0x5f4aa8,_0x43127a]of _0x521efe['markers']){const _0x23e707=_0x43127a['_getTransformedByInsertion'](_0x1568aa,_0x51dc32,!0x1);_0x43127a=_0x23e707[0x0],_0x521efe['markers']['set'](_0x5f4aa8,_0x43127a);}}(_0x56c245,_0x1aaf7d,0x3),_0x1aaf7d['parent']==_0x167c4c['parent']&&(_0x167c4c=_0x167c4c['getShiftedBy'](0x3)));const _0x32f069=_0x45666f['createRange'](_0x45666f['createPositionAt'](_0x56c245,0x0),_0x1aaf7d),_0x4cc315=_0x45666f['createRange'](_0x167c4c,_0x45666f['createPositionAt'](_0x56c245,'end')),_0x10c231=[..._0x32f069['getMinimalFlatRanges'](),..._0x4cc315['getMinimalFlatRanges']()];_0x10c231['reverse']();for(const _0x50c584 of _0x10c231)_0x753bb8(_0x50c584),Nr(_0x56c245,_0x50c584);}(_0x21adbf['model'],_0x1185d2);}const _0xd6da89=_0x21adbf['data']['stringify'](_0x368957,{'showSuggestionHighlights':!0x0});return{'content':sr(_0xd6da89),'hasChanges':!0x0};}(_0x975523,_0x24ad96,_0x4c588e,_0xd287cf,_0x3e01c6);return{'type':_0xc051ad['changes'][0x0]['type'],'index':_0xc051ad['index'],'content':_0x95ecf8,'hasChanges':_0x2c8f51};});}function F(_0x68b810,_0x4986c1,_0x4b0193){const _0x3ba066=_0x68b810['plugins']['get']('DocumentCompare');let _0x53c4cb=_0x68b810['model']['createPositionAt'](_0x4b0193,Number['POSITIVE_INFINITY']),_0x2caf3a=_0x68b810['model']['createPositionAt'](_0x4b0193,0x0);for(const _0x45fd60 of _0x4986c1){let _0x218853,_0x41ed48;if(_0x3ba066['isMarkedRemoveOperation'](_0x45fd60))_0x218853=_0x45fd60['newRange']['start'],_0x41ed48=_0x45fd60['newRange']['end'];else switch(_0x45fd60['type']){case'rename':_0x218853=_0x45fd60['position'],_0x41ed48=_0x218853['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x218853=_0x45fd60['range']['start'],_0x41ed48=_0x45fd60['range']['end'];break;case'insert':_0x218853=_0x45fd60['position'],_0x41ed48=_0x218853['getShiftedBy'](_0x45fd60['howMany']);break;case'split':_0x218853=_0x45fd60['splitPosition'],_0x41ed48=_0x45fd60['moveTargetPosition'];break;case'merge':{const _0x2a96fb=_0x45fd60['targetPosition']['path']['slice'](-0x1);_0x218853=_0x68b810['model']['createPositionFromPath'](_0x4b0193,_0x2a96fb),_0x41ed48=_0x218853['getShiftedBy'](0x1);break;}case'remove':{const _0x4b0248=_0x45fd60['howMany'],_0x4a1ad7=_0x45fd60['sourcePosition']['_getTransformedByInsertion'](_0x45fd60['targetPosition'],_0x4b0248),_0x5765a5=_0x45fd60['getMovedRangeStart']();'remove'==_0x45fd60['type']?(_0x218853=_0x4a1ad7,_0x41ed48=_0x4a1ad7):(_0x218853=_0x5765a5,_0x41ed48=_0x5765a5['getShiftedBy'](_0x4b0248));break;}}_0x218853&&_0x218853['isBefore'](_0x53c4cb)&&(_0x53c4cb=_0x218853),_0x41ed48&&_0x41ed48['isAfter'](_0x2caf3a)&&(_0x2caf3a=_0x41ed48);}return _0x68b810['model']['createSelection'](_0x68b810['model']['createRange'](_0x53c4cb,_0x2caf3a));}function G(_0xe13fae,_0x287cd8){dn(_0xe13fae,_0x287cd8,'forward');const _0x3ca084=_0x287cd8['getFirstRange']();_0x287cd8['setTo']([]),_0x287cd8['setTo'](_0x3ca084,{'backward':!0x0}),dn(_0xe13fae,_0x287cd8,'backward');}function dn(_0x23f6ed,_0x425a07,_0x38b8bc){let _0x489fc5=0x14;for(;_0x489fc5;){_0x23f6ed['modifySelection'](_0x425a07,{'unit':'word','direction':_0x38b8bc}),_0x489fc5--;const _0x2288cd=_0x425a07['focus']['forward'==_0x38b8bc?'nodeBefore':'nodeAfter'];if(_0x2288cd&&_0x2288cd['is']('element')&&_0x23f6ed['schema']['isBlock'](_0x2288cd)&&_0x23f6ed['schema']['isObject'](_0x2288cd))break;}}function Nr(_0x4e0cc0,_0x30d728){for(let [_0x3f6190,_0x40811b]of _0x4e0cc0['markers'])_0x40811b=_0x40811b['_getTransformedByDeletion'](_0x30d728['start'],_0x30d728['end']['offset']-_0x30d728['start']['offset']),_0x4e0cc0['markers']['set'](_0x3f6190,_0x40811b);}class rh extends _0x335b7d{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x130aac,_0x3409b5={},_0x52898b){super(_0x130aac),this['set']('isLoading',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x3409b5};const _0x7fb82e=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x7fb82e?'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'](_0x52898b),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 _0x47081d(this['locale']),this['likeButton']['set']({'icon':_0x31617a,'label':Xn(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this,'isLoading',_0xcb3b59=>!_0xcb3b59),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x47081d(this['locale']),this['dislikeButton']['set']({'icon':_0x3900f1,'label':Xn(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x3de654=>!_0x3de654),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x47081d(this['locale']),this['copyButton']['set']({'icon':_0x3339bb,'label':Xn(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x1c2397=>!_0x1c2397);const _0x407c9a=new _0x8f03f4();_0x407c9a['set']({'content':_0xa1c8de}),_0x407c9a['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'](_0x407c9a);}['_setupShowChangesButton'](_0x20224d){this['showChangesButton']=new _0x47081d(this['locale']),this['showChangesButton']['set']({'icon':_0x30be3a,'label':Xn(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'isOn':_0x20224d}),this['showChangesButton']['bind']('isEnabled')['to'](this,'isLoading',_0x485400=>!_0x485400),this['showChangesButton']['on']('execute',()=>{const _0xd8436f=!this['showChangesButton']['isOn'];this['showChangesButton']['set']({'isOn':_0xd8436f,'icon':_0xd8436f?_0x44cdfa:_0x30be3a}),this['fire']('toggleShowChanges',_0xd8436f);});}}class ch extends Bt{['showChangesToggleView'];constructor(_0x294724,_0x207e00){super(_0x294724),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Dr(_0x294724),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle','label':Xn(_0x294724,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x207e00['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x9bda76=>_0x9bda76?_0x3630ed:_0x1266c6),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x4be757=new _0x8f03f4();_0x4be757['content']=_0x14d3d3,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x207e00['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x4be757,{'tag':'span','children':[Xn(_0x294724,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Dr extends _0x47081d{['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(_0x18effe){this['options']={'delay':_0x18effe['delay']??0x14,'textNodeStyle':_0x18effe['textNodeStyle'],'onStreamUpdate':_0x18effe['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x4a3e6b,targetElement:_0x36945f,abortSignal:_0x45690d}){this['isStreaming']&&this['stop'](),_0x45690d?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x3b12cd(_0x4a3e6b,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(_0x53aaf6('html-streamer-current-index-out-of-bounds',{'currentIndex':this['currentIndex'],'nodeList':this['nodesList']}),this['currentIndex']=this['nodesList']['length']);for(let _0x4b51ec=0x0;_0x4b51ec<this['currentIndex'];_0x4b51ec++)this['nodesList'][_0x4b51ec]['shouldBeStreamed']=!0x0;let _0x9e81cd=0x0;for(let _0x1d1949=this['currentIndex'];_0x1d1949<this['nodesList']['length'];_0x1d1949++){const _0x374fff=Date['now'](),_0x364558=this['nodesList'][_0x1d1949],_0x400cc9=_0x374fff-_0x9e81cd;_0x364558['shouldBeStreamed']=!0x0;let _0x1e4982=_0x364558['parent'];for(;_0x1e4982;)_0x1e4982['shouldBeStreamed']=!0x0,_0x1e4982=_0x1e4982['parent'];if(_0x400cc9<this['options']['delay'])try{const {promise:_0xe9ee6b,abortController:_0x4a7a82}=dr(this['options']['delay']-_0x400cc9);this['timeoutAbortController']=_0x4a7a82,await _0xe9ee6b;}catch(_0x3cd122){return;}_0x19327b(_0x36945f,'<'+_0x36945f['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x36945f['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']=_0x1d1949,_0x9e81cd=Date['now']();}this['isStreaming']=!0x1;}['cleanUpAnimations']({targetElement:_0x34d963}){Array['from'](_0x34d963['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x5bf223=>{_0x5bf223['replaceWith'](_0x5bf223['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x2c6e61){let _0x20a4d8='';if(function(_0x57ac0e){return _0x3c95f5(_0x57ac0e);}(_0x2c6e61)){for(const _0x61c3aa of _0x2c6e61['children'])_0x20a4d8+=this['renderNode'](_0x61c3aa);}else{if(mr(_0x2c6e61)){if(!_0x2c6e61['shouldBeStreamed'])return'';const _0x238fdb=_0x2c6e61,_0x2f3c26=Object['entries'](_0x238fdb['attribs'])['map'](([_0x4c05e5,_0x910658])=>_0x4c05e5+'=\x22'+_0x910658+'\x22')['join']('\x20');_0x20a4d8+='<'+_0x238fdb['tagName']+(_0x2f3c26?'\x20'+_0x2f3c26:'')+'>';for(const _0x1ed477 of _0x104d2d(_0x238fdb))_0x20a4d8+=this['renderNode'](_0x1ed477);_0x20a4d8+='</'+_0x238fdb['tagName']+'>';}else{if(!ar(_0x2c6e61))return'';if(!_0x2c6e61['shouldBeStreamed'])return'';!function(_0x403eb2){if(!_0x403eb2['parent']||!mr(_0x403eb2['parent']))return!0x1;if(!cr['includes'](_0x403eb2['parent']['tagName']))return!0x1;return!_0x2a49a4(_0x403eb2)['match'](/^\s*[<>]\s*$/);}(_0x2c6e61)?_0x20a4d8+=_0xc44c7e(_0x2c6e61):_0x20a4d8+=_0xc44c7e(new _0x1183c6('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x2c6e61]));}}return _0x20a4d8;}['getParsedDocumentNodeList'](){const _0x150346=[];return function(_0x2c59aa,_0x10ed73){const _0x483a75=_0x489bda=>{if(_0x10ed73(_0x489bda),_0x489bda instanceof _0x1a1be3)for(let _0x4d19b8=0x0;_0x4d19b8<_0x489bda['children']['length'];_0x4d19b8++){const _0x5165f3=_0x489bda['children'][_0x4d19b8];_0x483a75(_0x5165f3);}};for(let _0x1baad5=0x0;_0x1baad5<_0x2c59aa['children']['length'];_0x1baad5++)_0x483a75(_0x2c59aa['children'][_0x1baad5]);}(this['document'],_0x3429f2=>{if(ar(_0x3429f2)){const _0x228193=this['splitTextNodeIntoWordNodes'](_0x3429f2);_0x228193['length']&&_0x150346['push'](..._0x228193);}_0x3429f2['isWordSplitSource']||_0x3429f2['isWordSplitResult']||_0x150346['push'](_0x3429f2);}),_0x150346;}['splitTextNodeIntoWordNodes'](_0x27785c){if(_0x27785c['isWordSplitSource']||_0x27785c['isWordSplitResult'])return[];const _0x5ceb25=_0x2a49a4(_0x27785c)['match'](/(?:\s*\S+\s*)/g),_0x22c5bc=[];if(_0x5ceb25&&_0x5ceb25['length']>0x1){for(const _0x416d56 of _0x5ceb25){const _0xe210c1=new _0x3f2749(_0x416d56);_0xe210c1['isWordSplitResult']=!0x0,_0x509ff6(_0x27785c,_0xe210c1),_0x22c5bc['push'](_0xe210c1);}_0x27785c['isWordSplitSource']=!0x0,_0x423370(_0x27785c);}return _0x22c5bc;}}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(_0x3eac7e){return _0x1c3eca(_0x3eac7e);}function mr(_0x46f5f7){return _0x18f805(_0x46f5f7);}function dr(_0x295e08){const _0x16cf3a=new AbortController();return{'promise':new Promise((_0x2507e4,_0x1699c7)=>{const _0x59084f=setTimeout(_0x2507e4,_0x295e08);_0x16cf3a['signal']['addEventListener']('abort',()=>{clearTimeout(_0x59084f),_0x1699c7();});}),'abortController':_0x16cf3a};}const le=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'];class Pr extends Bt{['htmlStreamer'];['children'];['headerView'];['contentView'];constructor(_0x3f2c41,{part:_0x1479a5,areActionsDisabled:_0x169273}){super(_0x3f2c41),this['set']('partDefinition',_0x1479a5),this['set']('state','pending'),this['set']('isVisible',!0x1),this['bind']('isEnabled')['to'](this,'state',_0x2dc8ba=>'pending'==_0x2dc8ba&&!_0x169273),this['children']=this['createCollection'](),this['htmlStreamer']=new ta({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['headerView']=new Dn(_0x3f2c41,_0x1479a5),this['headerView']['bind']('partDefinition')['to'](this),this['headerView']['bind']('isEnabled')['to'](this),this['headerView']['bind']('state')['to'](this),this['headerView']['delegate'](...le)['to'](this);const _0x52edd3=this['bindTemplate'];this['contentView']=new Bt(),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',_0x52edd3['to']('state',_0x5ec782=>'ck-ai-suggestion__body__content-part_'+_0x5ec782),_0x52edd3['to']('isEnabled',_0x2023a4=>_0x2023a4?'ck-ai-suggestion__body__content-part_active':void 0x0),_0x52edd3['if']('isVisible','ck-hidden',_0x2c0368=>!_0x2c0368)]},'children':this['children'],'on':{'mouseenter':_0x52edd3['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x1479a5['index']});}),'mouseleave':_0x52edd3['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x1479a5['index']});})}});}async['updateContent']({part:_0x247e1b,renderingStrategy:_0x1e2ab2,showUnchangedParts:_0x2c6b96=!0x1,abortSignal:_0xff805d}){this['partDefinition']=_0x247e1b,this['isVisible']=this['partDefinition']['hasChanges']||_0x2c6b96,this['isVisible']&&('streaming'===_0x1e2ab2?await this['htmlStreamer']['stream']({'document':this['partDefinition']['content'],'targetElement':this['contentView']['element'],'abortSignal':_0xff805d}):this['contentView']['element']['innerHTML']=V(this['partDefinition']['content']));}['toggleHeader'](_0x5a3149){_0x5a3149?this['children']['has'](this['headerView'])||this['children']['add'](this['headerView'],0x0):this['children']['has'](this['headerView'])&&this['children']['remove'](this['headerView']);}}class Dn extends Bt{['children'];['_toolbarView'];['_iconStateAccepted'];['_iconStateRejected'];constructor(_0x3e69df,_0x22b4db){super(_0x3e69df),this['set']('partDefinition',_0x22b4db),this['set']('isEnabled',!0x0),this['set']('state','pending');const _0xfde258=new _0x8f03f4();_0xfde258['content']=_0x21732d,_0xfde258['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-title']}});const _0x33352c=new _0x47081d(_0x3e69df);_0x33352c['set']({'label':Xn(_0x3e69df,'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT'),'tooltip':!0x0,'withText':!0x1,'icon':_0x443f2e}),_0x33352c['bind']('isEnabled')['to'](this),_0x33352c['on']('execute',()=>{this['fire']('showChangeInText',{'index':_0x22b4db['index']});});const _0x80fd75=new _0x47081d(_0x3e69df);_0x80fd75['set']({'label':Xn(_0x3e69df,'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION'),'tooltip':!0x0,'withText':!0x1,'icon':_0x2210ef}),_0x80fd75['bind']('isEnabled')['to'](this),_0x80fd75['on']('execute',()=>{this['fire']('insertSuggestion',{'index':_0x22b4db['index']});});const _0x55a1eb=new _0x47081d(_0x3e69df);_0x55a1eb['set']({'label':Xn(_0x3e69df,'AI_SUGGESTION_CONTENT_PART_DELETE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x5a9727}),_0x55a1eb['on']('execute',()=>{this['fire']('rejectSuggestion',{'index':_0x22b4db['index']});}),_0x55a1eb['bind']('isEnabled')['to'](this),this['_toolbarView']=new _0x335b7d(_0x3e69df),this['_toolbarView']['items']['addMany']([_0x33352c,_0x80fd75,_0x55a1eb]),this['_iconStateAccepted']=new _0x8f03f4(),this['_iconStateAccepted']['content']=_0x1d558e,this['_iconStateAccepted']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-accepted'],'data-cke-tooltip-text':Xn(_0x3e69df,'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED'),'data-cke-tooltip-position':'n'}}),this['_iconStateRejected']=new _0x8f03f4(),this['_iconStateRejected']['content']=_0x41addc,this['_iconStateRejected']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-rejected'],'data-cke-tooltip-text':Xn(_0x3e69df,'AI_SUGGESTION_CONTENT_PART_REJECTED'),'data-cke-tooltip-position':'n'}});const _0xddba85=new Bt(_0x3e69df);_0xddba85['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[Xn(_0x3e69df,'AI_SUGGESTION_CONTENT_PART_TITLE',(_0x22b4db['index']+0x1)['toString']())]}),this['children']=this['createCollection'](),this['children']['addMany']([_0xfde258,_0xddba85,this['_toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title']},'children':this['children']}),this['on']('change:state',(_0x45625c,_0x439053,_0x416672,_0x36af6e)=>{switch(_0x36af6e){case'pending':this['children']['remove'](this['_toolbarView']);break;case'accepted':this['children']['remove'](this['_iconStateAccepted']);break;case'rejected':this['children']['remove'](this['_iconStateRejected']);}switch(_0x416672){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 bt(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x2dc0d7){const _0x1434b2=this['createTask'](_0x2dc0d7);return this['queue']['push'](_0x1434b2),this['_processQueue'](),_0x1434b2['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(_0x21cf81=>{this['once']('_queueEmpty',()=>{_0x21cf81();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0xca7aa9=this['queue']['shift']();try{await _0xca7aa9['callback'](this['_abortController']['signal']),_0xca7aa9['resolve']();}catch(_0x406b56){_0xca7aa9['reject'](_0x406b56);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x3c4926){let _0x438cde,_0x5e4824;const _0x5983df=new Promise((_0x47add7,_0x34fa60)=>{_0x438cde=_0x47add7,_0x5e4824=_0x34fa60;});return{'callback':_0x3c4926,'resolve':_0x438cde,'reject':_0x5e4824,'completePromise':_0x5983df};}}class gr extends Bt{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x279367){super();const _0x479eec=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']=_0x279367,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x479eec['if']('isDone','ck-ai-chat__feed__item_done'),_0x479eec['if']('isVisible','ck-hidden',_0x96b7b6=>!_0x96b7b6),'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'](_0x45c27d=>{_0x45c27d['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x496a6e,_0x29ab42,_0x1d80d5){await this['htmlStreamer']['stream']({'document':_0x496a6e,'targetElement':_0x29ab42,'abortSignal':_0x1d80d5});}}class ye extends gr{constructor(_0x5d44e9){super(_0x5d44e9),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-error','warning'===_0x5d44e9['level']?'ck-ai-chat-error_warning':'']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x2fde7b){this['element']['innerHTML']=_0x2fde7b;}}class dh extends Bt{['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];constructor(_0x30bfb4,{areActionsDisabled:_0x177927,showUnchangedParts:_0x16a577}){super(_0x30bfb4),this['_areActionsDisabled']=_0x177927,this['_showUnchangedParts']=_0x16a577,this['set']('hasPendingParts',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new g(),this['_emptyPartsWarningView']=new ye({'id':'empty-parts-warning','initialContent':Xn(_0x30bfb4,'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:_0x3a83e7,renderingStrategy:_0x580fd2,abortSignal:_0x396f61}){for(const _0x11309f of _0x3a83e7)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x3ec6f9=>{let _0x545f9d=this['_children']['find'](_0x31493c=>_0x31493c['partDefinition']['index']==_0x11309f['index']);_0x545f9d||(_0x545f9d=new Pr(this['locale'],{'part':_0x11309f,'areActionsDisabled':this['_areActionsDisabled']}),_0x545f9d['delegate'](...le)['to'](this),this['_children']['add'](_0x545f9d),this['hasPendingParts']=!0x0),0x2===this['_children']['length']&&this['_children']['first']['toggleHeader'](!0x0),_0x545f9d['toggleHeader'](this['_children']['length']>0x1),await _0x545f9d['updateContent']({'part':_0x11309f,'renderingStrategy':_0x580fd2,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x3ec6f9});});return _0x396f61?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x239860,_0xdd3075){this['_children']['get'](_0x239860)['state']=_0xdd3075,this['hasPendingParts']='pending'==_0xdd3075||Array['from'](this['_children'])['some'](_0x51818b=>'pending'==_0x51818b['state']);}['getPartView'](_0x5628c8){return this['_children']['get'](_0x5628c8);}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x265ec6=!this['_children']['find'](_0x4537cb=>_0x4537cb['partDefinition']['hasChanges']),_0x3582ea=!!this['_children']['find'](_0x599376=>!_0x599376['partDefinition']['hasChanges']);this['_emptyPartsWarningView']['isVisible']=_0x3582ea,_0x265ec6?this['_emptyPartsWarningView']['setContent'](Xn(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](Xn(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}}get['hasNonEmptyParts'](){return!!this['_children']['find'](_0x13d4d9=>_0x13d4d9['partDefinition']['hasChanges']);}}class Ve extends _0x57d3a1{constructor(_0x33c868=void 0x0){super();const _0x59fd28=_0x33c868?'ck-ai-spinner_'+_0x33c868:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x59fd28]}});}}class o extends Bt{['bodyView'];['children'];['headerView'];['miniToolbarView'];['loaderView'];['sourcesView'];constructor(_0x39430,{showDiff:_0x54b37e,areActionsDisabled:_0x527083,miniToolbarConfig:_0x1b4e6c,hideHeader:_0x2ca67f,showLoader:_0x22724e,showUnchangedParts:_0x1f844e}){super(_0x39430),this['set']('areChangesVisible',!0x1),this['set']('isLoaderVisible',!!_0x22724e),this['set']('isLoading',!0x1),this['children']=this['createCollection'](),_0x2ca67f||(this['headerView']=new ch(_0x39430,{'showDiff':_0x54b37e}),this['headerView']['on']('toggleShowChanges',(_0x1e1e2e,_0x1c562b)=>{this['areChangesVisible']=_0x1c562b['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x1c562b['isOn']});}),this['children']['add'](this['headerView'])),this['bodyView']=new dh(_0x39430,{'areActionsDisabled':_0x527083,'showUnchangedParts':!!_0x1f844e}),this['bodyView']['delegate'](...le)['to'](this),this['bodyView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoaderVisible','ck-hidden')]}}),this['miniToolbarView']=new rh(_0x39430,_0x1b4e6c,_0x54b37e),this['miniToolbarView']['delegate'](...le)['to'](this),this['miniToolbarView']['on']('toggleShowChanges',(_0xb9478e,_0x4003a0)=>{this['areChangesVisible']=_0x4003a0,this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x4003a0});}),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']),_0x22724e&&(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'](_0x595cb5){await this['bodyView']['updateContentParts'](_0x595cb5);}['updateSources'](_0x5e8499){this['sourcesView']['children']['addMany'](_0x5e8499['map'](_0x190066=>new Sr(this['locale'],_0x190066))),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 _0x3b4e10=new Bt(this['locale']),_0x4024d2=new Ve('small');_0x4024d2['isVisible']=!0x0;const _0x695e7a=new Bt(this['locale']);return _0x695e7a['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[Xn(this['locale'],'AI_CHAT_IS_WRITING')]}),_0x3b4e10['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isLoaderVisible','ck-hidden',_0x11934b=>!_0x11934b)]},'children':[_0x4024d2,_0x695e7a]}),_0x3b4e10;}}class jr extends Bt{['children'];constructor(_0x47b769){super(_0x47b769),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',_0x4118a4=>!_0x4118a4)]},'children':this['children']});const _0x525840=new Bt(this['locale']),_0x11adb4=new _0x8f03f4();_0x11adb4['content']=_0x33764d,_0x525840['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x11adb4,{'tag':'span','children':[{'text':Xn(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x525840);}}class Sr extends _0x47081d{constructor(_0x18bd62,_0x59465f){super(_0x18bd62),this['set']({'label':_0x59465f['title'],'tooltip':_0x59465f['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x54be8a=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x54be8a['to'](()=>{window['open'](_0x59465f['url'],'_blank');})}}),_0x59465f['favicon']){const _0x1614b4=new Bt(_0x18bd62);_0x1614b4['setTemplate']({'tag':'img','attributes':{'src':_0x59465f['favicon']||_0x33764d,'alt':_0x59465f['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x1614b4);}else this['set']('icon',_0x33764d);}}class Xt extends _0x335b7d{constructor(_0x4f56c8,_0x1dcc07=!0x0,_0x33b9de=!0x0){super(_0x4f56c8),this['set']('isLoading',!0x1),_0x1dcc07&&(this['applyButton']=this['_createButton'](Xn(_0x4f56c8,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x59478a=>!_0x59478a),this['items']['add'](this['applyButton'])),_0x33b9de&&(this['suggestButton']=this['_createButton'](Xn(_0x4f56c8,'AI_BALLOON_SUGGEST_BUTTON'),'ck-ai-button-secondary'),this['suggestButton']['bind']('isEnabled')['to'](this,'isLoading',_0x5d74a4=>!_0x5d74a4),this['items']['add'](this['suggestButton'])),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['_createButton'](_0x326612,_0x33573b){const _0x1b6117=new _0x47081d(this['locale']);return _0x1b6117['set']({'label':_0x326612,'class':_0x33573b||'','isVisible':!0x0,'withText':!0x0}),_0x1b6117;}}class Gt extends Bt{constructor(_0x4abc44){super(_0x4abc44),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':Xn(_0x4abc44,'AI_DISCLAIMER_TEXT')}]}]});}}const B=['applySuggestion','insertSuggestion','showNext','showPrevious'];class N extends Bt{['focusTracker'];['keystrokes'];['focusCycler'];['_focusables'];constructor(_0x7a00e7,_0x20f42d){super(_0x7a00e7),this['set']('isLoading',!0x1),this['focusTracker']=new Pt(),this['keystrokes']=new Ht(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Lt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x1b6214(),this['_addContentView'](_0x20f42d['mainView']),this['_addDisclaimerView'](),this['_addToolbar'](_0x20f42d['showApplyButton'],_0x20f42d['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 _0x5c6259 of this['_focusables'])this['focusTracker']['add'](_0x5c6259['element']);this['keystrokes']['listenTo'](this['element']);}['focus'](_0x246303){-0x1===_0x246303?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['setupRotator'](_0x5cacae){const _0xad668c=this['_createNextButtonView'](),_0x5eadd6=this['_createPreviousButtonView']();_0x5cacae['view']['headerView']['children']['add'](_0xad668c,0x2),_0x5cacae['view']['headerView']['children']['add'](_0x5eadd6,0x0),this['_focusables']['addMany']([_0xad668c,_0x5eadd6]),this['focusTracker']['add'](_0xad668c['element']),this['focusTracker']['add'](_0x5eadd6['element']);}['_addContentView'](_0xff441a){this['_mainView']=_0xff441a,this['_dialogContent']['add'](this['_mainView']);}['_addDisclaimerView'](){this['disclaimerView']=new Gt(this['locale']),this['_dialogContent']['add'](this['disclaimerView']);}['_addToolbar'](_0xefccde=!0x0,_0x319e54=!0x0){this['toolbar']=new Xt(this['locale'],_0xefccde,_0x319e54),this['toolbar']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['toolbar']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_dialogContent']['add'](this['toolbar']);}['_createNextButtonView'](){const _0x1f25db=new _0x47081d(this['locale']);return _0x1f25db['set']({'icon':Ut,'tooltip':Xn(this['locale'],'AI_BALLOON_NEXT_TOOLTIP')}),_0x1f25db['on']('execute',()=>{this['fire']('showNext');}),_0x1f25db;}['_createPreviousButtonView'](){const _0xa14ef=new _0x47081d(this['locale']);return _0xa14ef['set']({'icon':Wt,'tooltip':Xn(this['locale'],'AI_BALLOON_PREVIOUS_TOOLTIP')}),_0xa14ef['on']('execute',()=>{this['fire']('showPrevious');}),_0xa14ef;}}class m extends _0x52a465{static get['requires'](){return[e,a];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_config'];['open'](_0x4a0e19){const _0x38d08d=P(this['context']);this['_config']=_0x4a0e19,this['balloonView']=new N(_0x38d08d['locale'],_0x4a0e19),this['balloonView']['delegate'](...B)['to'](this),this['_showDialog'](_0x4a0e19);}['close'](){P(this['context'])['plugins']['get']('Dialog')['hide']();}['_setupVisualSelection'](_0x6c280f,_0x26679b){this['context']['plugins']['get'](a)['showFakeVisualSelection'](_0x6c280f,'ai-balloon-'+_0x26679b,!0x0,!0x0);}['_showDialog'](_0x58fc9a){const _0xea0cc8=P(this['context']);this['_setupVisualSelection'](_0x58fc9a['ranges'],_0x58fc9a['index']),_0xea0cc8['plugins']['get']('Dialog')['show']({'title':_0x58fc9a['title'],'icon':_0x58fc9a['icon'],'hasCloseButton':!0x0,'id':'aiBalloon','position':this['_calculateDialogPosition']['bind'](this),'className':'ai-balloon'+(_0x58fc9a['showRotator']?'\x20ai-balloon-rotator':''),'content':this['balloonView'],'onShow':_0x507921=>{_0x58fc9a['showRotator']&&this['balloonView']['setupRotator'](_0x507921),this['isOpen']=!0x0;},'onHide':()=>{this['context']['plugins']['get']('AIEditing')['hideFakeVisualSelection']('ai-balloon-'+_0x58fc9a['index']),this['fire']('dialogClosed'),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x1e0996,_0x393417){const _0x12f647=P(this['context']);if(!_0x393417)return null;const _0x1f938b=_0x1cf24f(_0x12f647['editing'],[..._0x12f647['model']['markers']['getMarkersGroup']('ai-selection'),..._0x12f647['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);if(!_0x1f938b||0x0===_0x1f938b['length'])return{'left':Math['round'](_0x393417['left']+_0x393417['width']/0x2-_0x1e0996['width']/0x2),'top':Math['round'](_0x393417['top']+_0x393417['height']/0x2-_0x1e0996['height']/0x2)};const _0xbb34fc=Math['round'](_0x393417['left']+_0x393417['width']/0x2-_0x1e0996['width']/0x2),_0x2e9383=_0x1f938b[0x0]['getBoundingClientRect'](),_0x5746cb=_0x1f938b[_0x1f938b['length']-0x1]['getBoundingClientRect'](),_0x731977=_0x1e0996['height'],_0x5cacc4=this['_config']['showRotator']?0x8:0x0;return{'left':_0xbb34fc,'top':this['_calculateOptimalTopPosition'](_0x2e9383,_0x5746cb,_0x731977,_0x5cacc4)};}['_calculateOptimalTopPosition'](_0xcd3477,_0x57d4e4,_0xcdf0ff,_0xde8cc6=0x0){const _0x19ce4b=_0x57d4e4['top']+_0x57d4e4['height'],_0x3fd439=_0xcd3477['top']-_0xcdf0ff-_0xde8cc6,_0x5c66b3=window['innerHeight']-_0x19ce4b-0xa,_0x4bfdda=_0xcd3477['top']-_0xde8cc6-0xa;let _0xf54f8a;if(_0x5c66b3>=_0xcdf0ff)_0xf54f8a=_0x19ce4b+0xa;else{if(_0x4bfdda>=_0xcdf0ff)_0xf54f8a=_0x3fd439-0xa;else _0xf54f8a=_0xcd3477['top']+(_0x57d4e4['top']+_0x57d4e4['height'])/0x2-(_0xcdf0ff+_0xde8cc6)/0x2;}return _0xf54f8a;}}class x extends _0x52a465{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_batchToChanges']=new Map();['_previewedChangeGroup']=null;['_balloonShowDiff']=!0x1;static get['requires'](){return[e,m,_0x12f302];}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 k({'connector':this['_aiConnector']});const _0x1ae6e0=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_handleStartConversation']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x53095b,_0x220a80)=>{this['_handleUIUserMessage']({'userMessage':_0x220a80});}),this['listenTo'](_0x1ae6e0,'resizedTabs',(_0x428047,_0x2e4a7f)=>{this['_setIsMaximized'](_0x2e4a7f);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x1ae6e0['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['activeConversation']?.['addCurrentDocumentToContext'](Xn(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x2f247c,_0x2a99c3)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x2a99c3));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x28b7a4,_0x5a93c2)=>{this['activeConversation']?.['addUrlToContext'](_0x5a93c2);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x372fd4,_0x34f4ed)=>{this['activeConversation']?.['addResourceToContext'](_0x34f4ed['source'],_0x34f4ed['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x2101c0,_0x5533a5)=>{this['_removeFromContext'](_0x5533a5);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x3247da,_0x27f4e0)=>{this['activeConversation']?.['loadSourceResources'](_0x27f4e0['sourceId'],_0x27f4e0['query'],_0x27f4e0['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x211ada,_0x54634a)=>{this['activeConversation']?.['setModel'](_0x54634a);}),this['listenTo'](this['_aiChatUi'],'like',(_0x200de3,{replyId:_0x15cd26})=>{console['log']('Liked\x20response',_0x15cd26);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x4aba26,{replyId:_0x342618})=>{console['log']('Disliked\x20response',_0x342618);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x3fe317,_0x3a5cc6)=>{this['context']['plugins']['get'](m)['close'](),this['_insertSuggestion'](_0x3a5cc6);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x402792,{replyId:_0x5a66b6,partIndex:_0x303b6f})=>{this['_balloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x5a66b6,_0x303b6f);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x4f3bd2,{replyId:_0x7598dc,partIndex:_0x418830})=>{const _0x16168d=this['_getDocumentRangeForReplyChanges'](_0x7598dc,_0x418830);_0x16168d&&'$graveyard'!=_0x16168d['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x16168d['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x3cc9ce,_0x45f774)=>{this['context']['plugins']['get'](m)['close'](),this['_applySuggestion'](_0x45f774);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0xae911c,_0x48ecdf)=>{const {reply:_0x5e2af6}=this['getInteractionAndReplyById'](_0x48ecdf['replyId']),_0x4b05ce=p({'editor':P(this['context']),'changeGroups':_0x5e2af6['changeGroups'],'documentContextContent':_0x5e2af6['documentContextContent'],'showDiff':_0x48ecdf['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x5e2af6['id'],'parts':_0x4b05ce,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x3a4644,{replyId:_0x3b8e15,partIndex:_0x3c0335})=>{this['_previewedChangeGroup']?.['replyId']==_0x3b8e15&&this['_previewedChangeGroup']?.['partIndex']==_0x3c0335&&this['context']['plugins']['get'](m)['close']();const {reply:_0xbc61bf}=this['getInteractionAndReplyById'](_0x3b8e15);_0xbc61bf['setChangeGroupState'](_0x3c0335,'rejected'),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');});}async['afterInit'](){this['context']instanceof _0x50d722?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x46ea0d,_0x5272fd)=>{_0x5272fd['on']('ready',()=>{this['_integrateEditor'](_0x5272fd);});}),await this['_handleStartConversation']();}['_insertSuggestion'](_0x2d38fc){const _0x47c13c=P(this['context']);if(!_0x47c13c['plugins']['has']('TrackChangesEditing'))return;const _0x3b1d41=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x3a8abc,interaction:_0xbbb2db}=this['getInteractionAndReplyById'](_0x2d38fc['replyId']),_0x50589c=this['_getDocumentRangeForReplyChanges'](_0x2d38fc['replyId'],_0x2d38fc['partIndex']),_0x245264=void 0x0!==_0x2d38fc['partIndex']?[_0x3a8abc['changeGroups'][_0x2d38fc['partIndex']]]:_0x3a8abc['changeGroups']['filter'](_0x239afa=>'pending'==_0x239afa['state']),_0x5043d9=_0x245264['map'](_0x16f0f2=>_0x3a8abc['changeGroups']['indexOf'](_0x16f0f2));_0x5043d9['forEach'](_0x286891=>_0x3a8abc['setChangeGroupState'](_0x286891,'accepted'));const _0x3720bb=w({'editor':_0x47c13c,'reply':_0x3a8abc,'interaction':_0xbbb2db,'groups':_0x245264,'transform':!0x0,'documentCompare':_0x3b1d41,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x3a855a;_0x50589c&&this['_scrollToSuggestionRange'](_0x50589c['range']),_0x47c13c['model']['change'](_0x2b12c5=>{_0x3a855a=_0x2b12c5['batch'],_0x47c13c['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x3720bb),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x3a855a,{'interactionId':_0xbbb2db['id'],'replyId':_0x3a8abc['id'],'indexes':_0x5043d9['slice']()});}['_applySuggestion'](_0x430eab){const _0x564eb7=P(this['context']),_0x3e6fad=this['context']['plugins']['get'](_0x12f302),{reply:_0x4a48b4,interaction:_0x3b03ce}=this['getInteractionAndReplyById'](_0x430eab['replyId']),_0x1af383=this['_getDocumentRangeForReplyChanges'](_0x430eab['replyId'],_0x430eab['partIndex']),_0x99454c=void 0x0!==_0x430eab['partIndex']?[_0x4a48b4['changeGroups'][_0x430eab['partIndex']]]:_0x4a48b4['changeGroups']['filter'](_0x4a1ec8=>'pending'==_0x4a1ec8['state']),_0x20ff3c=_0x99454c['map'](_0x2e39f0=>_0x4a48b4['changeGroups']['indexOf'](_0x2e39f0));_0x20ff3c['forEach'](_0x18b371=>_0x4a48b4['setChangeGroupState'](_0x18b371,'accepted'));const _0x3c58fc=w({'editor':_0x564eb7,'reply':_0x4a48b4,'interaction':_0x3b03ce,'groups':_0x99454c,'transform':!0x0,'documentCompare':_0x3e6fad,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x52c965;_0x1af383&&this['_scrollToSuggestionRange'](_0x1af383['range']),_0x564eb7['model']['change'](_0x76f0f7=>{_0x52c965=_0x76f0f7['batch'];for(const _0x5bba94 of _0x3c58fc)_0x5bba94['baseVersion']=_0x564eb7['model']['document']['version'],_0x76f0f7['batch']['addOperation'](_0x5bba94),_0x564eb7['model']['applyOperation'](_0x5bba94);}),this['_batchToChanges']['set'](_0x52c965,{'interactionId':_0x3b03ce['id'],'replyId':_0x4a48b4['id'],'indexes':_0x20ff3c['slice']()});}['_openBalloonFor'](_0x237573,_0x19f507){const _0x446fc9=P(this['context']),_0x4dbcf0=this['_getDocumentRangeForReplyChanges'](_0x237573,_0x19f507),_0x4e02ab=this['context']['plugins']['get'](m);if(!_0x4dbcf0)return void _0x4e02ab['close']();const {range:_0x25c5de,currentIndex:_0x298467,previousIndex:_0x86180a,nextIndex:_0x40374f}=_0x4dbcf0;if(this['_previewedChangeGroup']?.['replyId']==_0x237573&&this['_previewedChangeGroup']?.['partIndex']==_0x298467)return;this['_previewedChangeGroup']={'replyId':_0x237573,'partIndex':_0x298467};const _0x155036=new o(_0x446fc9['locale'],{'showDiff':this['_balloonShowDiff'],'areActionsDisabled':!0x1,'miniToolbarConfig':{'showChanges':'full'},'hideHeader':!0x0}),{reply:_0xd535b7}=this['getInteractionAndReplyById'](_0x237573),_0x985e24=p({'editor':_0x446fc9,'changeGroups':[_0xd535b7['changeGroups'][_0x298467]],'documentContextContent':_0xd535b7['documentContextContent'],'showDiff':this['_balloonShowDiff']});_0x155036['updateContent']({'parts':_0x985e24,'renderingStrategy':'static'});const _0x10cf1b=_0x298467!==_0x86180a;this['_scrollToSuggestionRange'](_0x25c5de,!0x0),_0x4e02ab['open']({'index':_0x298467,'title':Xn(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x298467+0x1)['toString']()),'icon':_0x5c6573,'mainView':_0x155036,'showRotator':_0x10cf1b,'showApplyButton':!0x0,'showSuggestButton':!0x0,'ranges':[_0x25c5de]}),this['_aiChatUi']['scrollFeedToSuggestion'](_0x237573,_0x298467),this['listenTo'](_0x155036,'toggleSuggestionDisplayMode',(_0x305c03,{showDiff:_0x55394a})=>{this['_balloonShowDiff']=_0x55394a;const {reply:_0x4dea60}=this['getInteractionAndReplyById'](_0x237573),_0xff575f=p({'editor':_0x446fc9,'changeGroups':[_0x4dea60['changeGroups'][_0x298467]],'documentContextContent':_0x4dea60['documentContextContent'],'showDiff':_0x55394a});_0x155036['updateContent']({'parts':_0xff575f,'renderingStrategy':'static'});}),this['listenTo'](_0x4e02ab,'applySuggestion',()=>{this['_applySuggestion']({'replyId':_0x237573,'partIndex':_0x298467}),_0x10cf1b?this['_openBalloonFor'](_0x237573,_0x40374f):_0x4e02ab['close']();}),this['listenTo'](_0x4e02ab,'insertSuggestion',()=>{this['_insertSuggestion']({'replyId':_0x237573,'partIndex':_0x298467}),_0x10cf1b?this['_openBalloonFor'](_0x237573,_0x40374f):_0x4e02ab['close']();}),_0x10cf1b&&(this['listenTo'](_0x4e02ab,'showNext',()=>{this['_openBalloonFor'](_0x237573,_0x40374f);}),this['listenTo'](_0x4e02ab,'showPrevious',()=>{this['_openBalloonFor'](_0x237573,_0x86180a);})),this['listenTo'](_0x4e02ab,'dialogClosed',()=>{this['stopListening'](_0x4e02ab),this['stopListening'](_0x155036),this['_previewedChangeGroup']=null;});}['_getDocumentRangeForReplyChanges'](_0x1d8c8e,_0x748b98){const _0x1880a7=P(this['context']),{reply:_0x120c52,interaction:_0x3b97e8}=this['getInteractionAndReplyById'](_0x1d8c8e),_0x48051d=_0x120c52['changeGroups']['filter'](_0x19301e=>'pending'==_0x19301e['state']),_0x564c4c=_0x48051d['map'](_0x413fa9=>_0x120c52['changeGroups']['indexOf'](_0x413fa9));void 0x0===_0x748b98&&(_0x748b98=_0x564c4c[0x0]);const _0x961a24=_0x564c4c['indexOf'](_0x748b98);if(-0x1==_0x961a24)return null;const _0x3a85fc=0x0==_0x961a24?_0x564c4c[_0x564c4c['length']-0x1]:_0x564c4c[_0x961a24-0x1],_0x951ddb=_0x961a24==_0x564c4c['length']-0x1?_0x564c4c[0x0]:_0x564c4c[_0x961a24+0x1],_0x3c5ff5=_0x48051d[_0x961a24],_0x595eda=new _0x30ca80([]),_0xdef2da=new _0x30ca80([]);for(const _0x1f64ef of _0x3c5ff5['changes'])if('removed'!=_0x1f64ef['type']&&_0xdef2da['children']['push'](_0x1f64ef['node']['cloneNode'](!0x0)),'new'!=_0x1f64ef['type']){const _0x589211=_0x5d5fb0(_0x39111a=>q(_0x39111a,'data-id')==_0x1f64ef['id'],_0x120c52['documentContextContent'],!0x0);_0x595eda['children']['push'](_0x589211['cloneNode'](!0x0));}if(0x0==_0x595eda['children']['length']){if(_0x3c5ff5['changes'][0x0]['anchorId']){const _0xe606d0=z('data-id',_0x3c5ff5['changes'][0x0]['anchorId'],_0x120c52['documentContextContent']);_0x595eda['children']['unshift'](_0xe606d0['cloneNode'](!0x0)),_0xdef2da['children']['unshift'](_0xe606d0['cloneNode'](!0x0)),_0xe606d0['nextSibling']&&(_0x595eda['children']['push'](_0xe606d0['nextSibling']['cloneNode'](!0x0)),_0xdef2da['children']['push'](_0xe606d0['nextSibling']['cloneNode'](!0x0)));}else{const _0x82bdf7=_0x120c52['documentContextContent']['children'][0x0];if(!_0x82bdf7)return null;_0x595eda['children']['push'](_0x82bdf7['cloneNode'](!0x0)),_0xdef2da['children']['push'](_0x82bdf7['cloneNode'](!0x0));}}const _0x312964=_0x3b97e8['getDocumentContext'](),_0x7c8eb5=_0x1880a7['data']['parse'](_0x312964['content']),_0x3025b9=V(_0x595eda),_0x5192ac=_0x1880a7['data']['parse'](_0x3025b9),_0x1caa92=_0x1880a7['data']['parse'](_0x3025b9),_0x1ba218=_0x1880a7['model']['createPositionAt'](_0x5192ac,0x0),_0x1e9309=V(_0xdef2da),_0x5dc20e={'anchor':_0x1ba218,'markDeletions':!0x1},_0x356614=_0x1880a7['plugins']['get'](_0x12f302)['getDiff'](_0x3025b9,_0x1e9309,_0x5dc20e)['getOperations']();if(!_0x356614['length'])return null;_0x1880a7['model']['change'](_0x15871b=>{for(const _0x20101d of _0x356614)if('remove'==_0x20101d['type']){const _0x14dc91=_0x20101d['sourcePosition'],_0x12a7a0=_0x20101d['howMany'],_0xb5756d=new _0x11d81b(_0x14dc91,_0x12a7a0);_0x15871b['batch']['addOperation'](_0xb5756d),_0x1880a7['model']['applyOperation'](_0xb5756d);}else _0x20101d['baseVersion']=null,_0x20101d['isDocumentOperation']=!0x1,_0x15871b['batch']['addOperation'](_0x20101d),_0x1880a7['model']['applyOperation'](_0x20101d);});const _0x4c351f=F(_0x1880a7,_0x356614,_0x5192ac);G(_0x1880a7['model'],_0x4c351f);const _0x4fff3e=_0x4c351f['getFirstRange']()['start']['path']['slice'](),_0x2b4ce4=_0x4c351f['getFirstRange']()['end']['path']['slice'](),_0x2b0fea=[];let _0x3b9ad0=_0x5192ac,_0x230beb=_0x1caa92;for(let _0x395efa=0x0;_0x395efa<_0x2b4ce4['length'];_0x395efa++){const _0x1c63ef=_0x3b9ad0['maxOffset']-_0x2b4ce4[_0x395efa];_0x2b0fea[_0x395efa]=_0x230beb['maxOffset']-_0x1c63ef,_0x3b9ad0=_0x3b9ad0['getChildAtOffset'](_0x2b4ce4[_0x395efa]),_0x230beb=_0x230beb['getChildAtOffset'](_0x2b0fea[_0x395efa]);}const _0x4a946a=_0x1880a7['model']['createRange'](_0x1880a7['model']['createPositionFromPath'](_0x1caa92,_0x4fff3e),_0x1880a7['model']['createPositionFromPath'](_0x1caa92,_0x2b0fea)),_0x15845b=_0x1caa92['getChild'](0x0)['getAttribute'](_0x24db9e),_0x1c99e5=Array['from'](_0x7c8eb5['getChildren']())['find'](_0x359685=>_0x359685['getAttribute'](_0x24db9e)==_0x15845b)['getPath'](),_0x4de379=_0x4a946a['start']['path']['slice'](),_0x4cfa2a=_0x4a946a['end']['path']['slice']();_0x4de379[0x0]=_0x1c99e5[0x0]+_0x4de379[0x0],_0x4cfa2a[0x0]=_0x1c99e5[0x0]+_0x4cfa2a[0x0];let _0x5e5cd0=_0x1880a7['model']['createRange'](_0x1880a7['model']['createPositionFromPath'](_0x1880a7['model']['document']['getRoot'](),_0x4de379),_0x1880a7['model']['createPositionFromPath'](_0x1880a7['model']['document']['getRoot'](),_0x4cfa2a));const _0x4ec42e=_0x1880a7['model']['document']['history']['getOperations'](_0x312964['version']);for(const _0x464c46 of _0x4ec42e)_0x5e5cd0=_0x429c60['_createFromRanges'](_0x5e5cd0['getTransformedByOperation'](_0x464c46));return{'range':_0x5e5cd0,'previousIndex':_0x3a85fc,'nextIndex':_0x951ddb,'currentIndex':_0x748b98};}['_integrateEditor'](_0x550183){if(!_0x550183['plugins']['has']('Undo'))return;const _0x5b107a=_0x550183['commands']['get']('undo'),_0x386f6a=_0x550183['commands']['get']('redo');this['listenTo'](_0x5b107a,'revert',(_0x4b232a,_0x3af197,_0x3f3c9a)=>{const _0x23f0b6=this['_batchToChanges']['get'](_0x3af197);if(!_0x23f0b6)return;const _0x438823=this['activeConversation']['getInteraction'](_0x23f0b6['interactionId'])['getReply'](_0x23f0b6['replyId']);_0x23f0b6['indexes']['forEach'](_0x962306=>_0x438823['setChangeGroupState'](_0x962306,'pending')),this['_batchToChanges']['delete'](_0x3af197),this['_batchToChanges']['set'](_0x3f3c9a,_0x23f0b6);}),this['listenTo'](_0x386f6a,'revert',(_0x8f98af,_0x4bd2b6,_0xeadb21)=>{const _0x53544b=this['_batchToChanges']['get'](_0x4bd2b6);if(!_0x53544b)return;const _0x443056=this['activeConversation']['getInteraction'](_0x53544b['interactionId'])['getReply'](_0x53544b['replyId']);_0x53544b['indexes']['forEach'](_0x1571d0=>_0x443056['setChangeGroupState'](_0x1571d0,'accepted')),this['_batchToChanges']['delete'](_0x4bd2b6),this['_batchToChanges']['set'](_0xeadb21,_0x53544b);});}async['loadConversation'](_0x34df66){this['context']['plugins']['get'](m)['close'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']();try{const _0x173bf3=this['context']['plugins']['get'](M);this['updateConversationTitle']('\x20'),_0x173bf3['view']['activateTab']('chat'),await this['_handleStartConversation'](_0x34df66);const {sessionId:_0x2cbc68}=this['_aiEditing']['getDocumentData']();await this['activeConversation']['load'](_0x34df66,_0x2cbc68),this['activeConversation']['isCurrentDocumentInConversation']()&&this['activeConversation']['addCurrentDocumentToContext'](Xn(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}catch(_0x57213d){console['error']('Failed\x20to\x20load\x20conversation',_0x57213d);}finally{this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['handleRemovedConversation'](_0x22631f){this['activeConversation']['id']===_0x22631f&&this['_handleStartConversation']();}async['addSelectionToChatContext'](){const _0x10b367=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x10b367),this['activeConversation']?.['addCurrentDocumentToContext'](Xn(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_handleStartConversation']();}async['sendMessage']({message:_0x312880,quickActionData:_0x35597c}){await this['_handleUIUserMessage']({'userMessage':_0x312880,'quickActionData':_0x35597c});}['getGroupId'](){const _0x2e6fd9=this['context']['config']['get']('collaboration.channelId');if(!_0x2e6fd9)throw new _0x16a90e('ai-chat-missing-channel-id',this);return _0x2e6fd9;}async['_handleStartConversation'](_0x56ba3c){const _0x539ebc=this['context']['plugins']['get'](m);let _0x6b21ec;_0x539ebc['isOpen']&&_0x539ebc['close'](),_0x6b21ec=_0x56ba3c||!this['activeConversation']?this['context']['config']['get']('ai.chat.models.defaultModelId'):this['activeConversation']['selectedModel']['id'],await this['_stopLastInteraction']();const _0x1ea890=this['getGroupId'](),_0x1cec01=_0x56ba3c||_0x206174();this['activeConversation']=new U({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'defaultModelId':_0x6b21ec,'conversationId':_0x1cec01,'group':_0x1ea890,'getEditor':()=>P(this['context'])}),this['activeConversation']['on']('conversationInitialized',(_0x390497,_0xa8526f)=>{_0xa8526f['availableModels']=this['_filterModels'](_0xa8526f['availableModels'],this['context']['config']['get']('ai.chat.models.displayedModels')),this['_aiChatUi']['createConversation'](_0xa8526f),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x56ba3c||(this['_aiChatUi']['resetConversationTitle'](),this['activeConversation']?.['addCurrentDocumentToContext'](Xn(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT')));}),this['activeConversation']['on']('uploadProgressChanged',(_0x2f728e,_0x1a2da3)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x1a2da3['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x5a3f5d,_0x5d5e6f)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x5d5e6f),this['_aiChatUi']['addFeedInteractionHeader'](_0x5d5e6f);}),this['activeConversation']['on']('interactionStarted',(_0x495346,_0x2a70d1)=>{this['_aiChatUi']['startInteraction'](_0x2a70d1);}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x590ab1,_0x2c8ce3)=>{this['_aiChatUi']['removeFeedInteraction'](_0x2c8ce3['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x50fe8d,_0x56d719,_0x393d04)=>{this['updateConversationTitle'](_0x56d719,_0x393d04);}),this['activeConversation']['on']('replyCreated',(_0x3cc1c6,_0x17a246)=>{this['_aiChatUi']['updateFeedInteractionHeader']({'isVisible':!0x0,'id':_0x17a246['interactionId']}),'text-delta'===_0x17a246['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x17a246):this['_aiChatUi']['addFeedItemAISuggestion'](_0x17a246);}),this['activeConversation']['on']('replyContentUpdated',async(_0x941646,_0x4c3eaf,_0x273f4a)=>{await this['_updateReplyContent']({'reply':_0x4c3eaf,'changeGroups':_0x273f4a});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x58d831,{reply:_0x56d54a,index:_0x1e6df5,state:_0x426744})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x56d54a['id'],'index':_0x1e6df5,'state':_0x426744});}),this['activeConversation']['on']('contextItemAdded',(_0x160775,_0x3d7fe3)=>{if(this['_aiChatUi']['addContextItem'](_0x3d7fe3['contextItem'],_0x3d7fe3['isLoading']),'selection'===_0x3d7fe3['contextItem']['type']){const _0x39e502=[...P(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x39e502,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x4ecd46,_0x355a36)=>{this['_aiChatUi']['removeContextItem'](_0x355a36['uiId']),'current-document'==_0x355a36['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x355a36['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x4dfce8,_0x1e96b6)=>{this['_aiChatUi']['setContextItemLoading'](_0x1e96b6['contextItem']['uiId'],_0x1e96b6['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x96e76e,_0x7048de)=>{this['_aiChatUi']['setConversationContext'](_0x7048de['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0xac4455,_0xd15c7f)=>{this['_aiChatUi']['setAddContextOptions'](_0xd15c7f['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0xb64150,_0x38644e)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x38644e['sourceId'],_0x38644e['source'],_0x38644e['resources'],_0x38644e['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x5e3da7,_0x53d782)=>{this['_aiChatUi']['updateResourceState'](_0x53d782['sourceId'],_0x53d782['resourceId'],_0x53d782['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x368ddd,_0x325068)=>{this['_aiChatUi']['updateCapabilities'](_0x325068);}),this['activeConversation']['on']('modelSelected',(_0x3c97ba,_0x276a9d)=>{this['_aiChatUi']['setSelectedModel'](_0x276a9d['selectedModel'],_0x276a9d['isDisabled']);}),this['activeConversation']['on']('error',(_0x4b2e2a,{error:_0x26dc12,interactionId:_0x3b7ed0,fileName:_0x3b1bca,url:_0x170871,sourceId:_0x48d3cd,sourceLabel:_0x187f46})=>{const _0x980deb=_0x3b7ed0?_0x3b7ed0+':'+_0x206174():_0x206174();_0x26dc12['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':Xn(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x980deb}):_0x26dc12['message']['startsWith']('ai-chat-conversation-init-failed')||_0x26dc12['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Xn(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x980deb}),this['_logError'](_0x26dc12)):_0x26dc12['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Xn(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x3b1bca),'id':_0x980deb}):_0x26dc12['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Xn(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x170871),'id':_0x980deb}):_0x26dc12['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Xn(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x980deb}):_0x26dc12['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Xn(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x980deb}):_0x26dc12['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x48d3cd&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x48d3cd),this['_aiChatUi']['addFeedItemError']({'errorMessage':Xn(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x187f46||'source'),'id':_0x980deb}),this['_logError'](_0x26dc12)):_0x26dc12['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Xn(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x980deb}),this['_logError'](_0x26dc12)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':Xn(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x980deb}),this['_logError'](_0x26dc12));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x56ba3c||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x2c819d,quickActionData:_0x3df743}){if(!this['activeConversation'])throw new _0x16a90e('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':_0x2c819d,'quickActionData':_0x3df743}),this['_removeAISelectionMarkers']();}['_removeAISelectionMarkers'](){const _0x233463=P(this['context'])['model'],_0x48cec0=Array['from'](_0x233463['markers']['getMarkersGroup'](L));_0x233463['change'](_0x27b2da=>{_0x48cec0['forEach'](_0x524ab1=>_0x27b2da['removeMarker'](_0x524ab1));});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x3821e5){this['_aiChatUi']['setIsMaximized'](_0x3821e5);}['_logError'](_0x2158aa){_0x115ab9(_0x2158aa['message']);}['_removeFromContext'](_0xe41ea){this['activeConversation']?.['removeFromContext'](_0xe41ea);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x24558c){const [_0x4e8b8c,_0x193d4a]=_0x24558c['split'](':'),_0x3ae07b=this['activeConversation']['getInteraction'](_0x4e8b8c),_0x17abc7=_0x3ae07b['getReply'](_0x193d4a);return{'interaction':_0x3ae07b,'reply':_0x17abc7};}['_scrollToSuggestionRange'](_0x3c1ed9,_0x50ef2c=!0x1){const _0x203992=P(this['context']),_0x4d30a8={'target':_0x203992['editing']['view']['domConverter']['viewRangeToDom'](_0x203992['editing']['mapper']['toViewRange'](_0x3c1ed9)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x50ef2c};_0x50ef2c&&(_0x4d30a8['alignToTop']=!0x0),_0x4c3d16(_0x4d30a8);}['updateConversationTitle'](_0x30190c,_0x4873de=!0x1){this['_aiChatUi']['setConversationTitle'](_0x30190c||Xn(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x4873de);}['_filterModels'](_0x594cf9,_0x377655){let _0x326903;if(_0x377655){_0x326903=[];const _0x45c750='string'==typeof _0x377655?[_0x377655['toLocaleLowerCase']()]:_0x377655['map'](_0x10f4e6=>_0x10f4e6['toLocaleLowerCase']());for(const _0x18c10a of _0x45c750)for(const _0x488c4e of _0x594cf9)(_0x488c4e['id']['toLocaleLowerCase']()===_0x18c10a||_0x488c4e['name']['toLocaleLowerCase']()===_0x18c10a||_0x488c4e['provider']['toLocaleLowerCase']()===_0x18c10a||_0x488c4e['id']['toLocaleLowerCase']()['startsWith'](_0x18c10a))&&_0x326903['push'](_0x488c4e);}else _0x326903=_0x594cf9;return _0x326903;}async['_updateReplyContent']({reply:_0x24118b,changeGroups:_0x507819,renderingStrategy:_0x4983ea}){const {id:_0x535925,isDone:_0x2c7fd1,type:_0x478ea6,parsedContent:_0x40369f}=_0x24118b;if('modification-delta'===_0x478ea6){const _0xb54ab8=p({'editor':P(this['context']),'showDiff':this['_aiChatUi']['showDiff'],'changeGroups':_0x507819,'documentContextContent':_0x24118b['documentContextContent']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x535925,'parts':_0xb54ab8,'renderingStrategy':_0x4983ea,'isDone':_0x2c7fd1});}else'text-delta'===_0x478ea6&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x535925,'parsedContent':_0x40369f,'renderingStrategy':_0x4983ea,'isDone':_0x2c7fd1});_0x2c7fd1&&_0x24118b['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x535925,_0x24118b['sources']);}async['_stopLastInteraction'](){const _0x23bad7=this['activeConversation']?.['lastInteraction'];_0x23bad7&&(_0x23bad7['stop'](),this['_aiChatUi']['stopInteraction'](_0x23bad7));}async['_flushLastInteractionUI'](){const _0x20ab7d=this['activeConversation']?.['lastInteraction'];if(_0x20ab7d){for await(const _0x41cd87 of _0x20ab7d['replies'])await this['_updateReplyContent']({'reply':_0x41cd87,'changeGroups':_0x41cd87['changeGroups'],'renderingStrategy':'static'});}}}const Z=[...le,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class nh extends Bt{['actionsDropdown'];['children'];['showChangeInTextModel'];['insertSuggestionModel'];constructor(_0x397c1f){super(_0x397c1f);const _0x3f5ff6=this['bindTemplate'];this['set']('isEnabled',!0x0),this['set']('isVisible',!0x0),this['showChangeInTextModel']=new _0xe58aa3({'label':Xn(_0x397c1f,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT'),'icon':_0x443f2e,'withText':!0x0,'type':'button','actionName':'showChangeInText'}),this['insertSuggestionModel']=new _0xe58aa3({'label':Xn(_0x397c1f,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION'),'icon':_0x2210ef,'withText':!0x0,'type':'button','actionName':'insertSuggestion'}),this['actionsDropdown']=new Ko(_0x397c1f,{'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':Xn(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',_0x3f5ff6['if']('isVisible','ck-hidden',_0x41bcfb=>!_0x41bcfb)]},'children':[this['actionsDropdown']]});}['updateLabels'](_0x5fb8db){const _0x1a1deb=this['locale'];this['actionsDropdown']['set']({'label':Xn(_0x1a1deb,'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL',_0x5fb8db),'tooltip':Xn(_0x1a1deb,'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP',_0x5fb8db)}),this['showChangeInTextModel']['label']=Xn(_0x1a1deb,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT',_0x5fb8db),this['insertSuggestionModel']['label']=Xn(_0x1a1deb,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION',_0x5fb8db);}}class Ko extends _0x41307{['bodyCollection'];['balloonPanelView'];['listView'];['keystrokeHandler'];constructor(_0x2a85c4,_0x33b4d1){super(_0x2a85c4),this['balloonPanelView']=new _0x56f82c(this['locale']),this['bodyCollection']=new Qt(this['locale']),this['bodyCollection']['attachToDom'](),this['set']('balloonPanelClass',''),this['balloonPanelView']['bind']('class')['to'](this,'balloonPanelClass'),this['listView']=this['_setUpList'](_0x33b4d1['listItemModels']),this['bodyCollection']['add'](this['balloonPanelView']),this['balloonPanelView']['content']['add'](this['listView']),this['arrowView']['unbind']('tooltip'),this['arrowView']['set']('tooltip',Xn(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']());}),_0x332a19({'emitter':this['balloonPanelView'],'callback':()=>{this['balloonPanelView']['hide']();},'activator':()=>this['balloonPanelView']['isVisible'],'contextElements':()=>[this['element'],this['balloonPanelView']['element']]});}['_setUpList'](_0x488b8c){const _0x1063ec=this['locale'],_0x2ede48=new _0x1832e1(_0x1063ec);for(const _0x2feef0 of _0x488b8c){const _0x9a62d4=new _0x55e39f(_0x1063ec),_0xdb7181=new _0x24a4ec(_0x1063ec);_0xdb7181['bind'](...Object['keys'](_0x2feef0))['to'](_0x2feef0),_0xdb7181['delegate']('execute')['to'](_0x2ede48),_0x9a62d4['children']['add'](_0xdb7181),_0x2ede48['items']['add'](_0x9a62d4);}return _0x2ede48['items']['delegate']('execute')['to'](this),_0x2ede48['on']('execute',_0x347d09=>{const _0x57d3a7=_0x347d09['source'];this['fire'](_0x57d3a7['actionName']),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),_0x2ede48;}['_setUpKeystrokes'](){this['keystrokeHandler']=new Ht(),this['keystrokeHandler']['listenTo'](this['balloonPanelView']['element']),this['keystrokeHandler']['set']('esc',(_0x206fc0,_0x5a3219)=>{this['balloonPanelView']['hide'](),this['arrowView']['focus'](),_0x5a3219();});}['destroy'](){super['destroy'](),this['keystrokeHandler']['destroy'](),this['balloonPanelView']['destroy'](),this['bodyCollection']['detachFromDom']();}}function qo(_0x574502){return{'top':_0x574502['bottom'],'left':_0x574502['left'],'name':'arrowless','config':{'withArrow':!0x1}};}function zo(_0x5511fa,_0x1aa186){return{'top':_0x5511fa['bottom'],'left':_0x5511fa['left']-(_0x1aa186['width']-_0x5511fa['width']),'name':'arrowless','config':{'withArrow':!0x1}};}class ke extends gr{['containerView'];['actionsView'];constructor(_0x2a2751,_0x98fdf4){super(_0x98fdf4),this['containerView']=new o(_0x2a2751,{'showDiff':_0x98fdf4['showDiff'],'areActionsDisabled':_0x98fdf4['areActionsDisabled']}),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x1533e3,_0x736441)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x736441['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',(_0x16d795,{index:_0x481382})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x481382});}),this['containerView']['on']('insertSuggestion',(_0x381081,{index:_0x1760f8})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x1760f8});}),this['containerView']['on']('rejectSuggestion',(_0x1556fc,{index:_0x6842c8})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x6842c8});}),this['containerView']['on']('mouseOverSuggestion',(_0x3487c9,{index:_0x2d73e1})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x2d73e1});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x4bb0d3,{index:_0x456d5e})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x456d5e});}),this['actionsView']=new nh(_0x2a2751),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']});}),_0x98fdf4['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'](_0x2da065){await this['containerView']['updateContent'](_0x2da065),this['actionsView']['updateLabels'](this['containerView']['bodyView']['partsCount']);}['updatePartState'](_0x5886b7,_0x450ba0){this['containerView']['bodyView']['updatePartState'](_0x5886b7,_0x450ba0);}['updateSources'](_0x350dd6){this['containerView']['updateSources'](_0x350dd6);}['getPartView'](_0x3a6e1b){return this['containerView']['bodyView']['getPartView'](_0x3a6e1b);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone'](),this['actionsView']['isVisible']=this['containerView']['bodyView']['hasNonEmptyParts'];}}class Se extends gr{['replyContainer'];constructor(_0x37f7f5,_0x23aee0){super(_0x23aee0),this['locale']=_0x37f7f5,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new Bt(),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:_0x52ff2d,renderingStrategy:_0x479374,abortSignal:_0xc755b6}){'streaming'===_0x479374?await this['streamIntoElement'](_0x52ff2d,this['replyContainer']['element'],_0xc755b6):this['replyContainer']['element']['innerHTML']=_0xc44c7e(_0x52ff2d);}['updateSources'](_0x101fa3){const _0x255321=new jr(this['locale']);_0x255321['children']['addMany'](_0x101fa3['map'](_0x45b885=>new Sr(this['locale'],_0x45b885))),_0x255321['isVisible']=!0x0,this['children']['add'](_0x255321);}}const En={'file':_0x4bf8ab,'document':_0x3d767d,'web-resource':_0x2a54a1,'text':_0x4bf8ab,'selection':_0x139447},Mr='ck-ai-chat-context-chip',Ur='ck-ai-chat-context-chip_wide',Gr='ck-ai-chat-context-chip_document',Kr='ck-ai-chat-context-chip__label',Wr='ck-ai-chat-context-chip__type-icon',Yr='ck-ai-chat-context-controls__chip-tooltip',yn='n';class Co extends _0x47081d{constructor(_0x157925,_0x1a27bf,_0x25a798,_0x3ff4c4,_0xa26cb7=!0x1){super(_0x157925),this['_isAnimationOnEnterEnabled']=_0x3ff4c4,this['_initializeProperties'](_0x1a27bf,_0x25a798,_0xa26cb7),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'](_0x450829,_0x573b67,_0x3d6b39){this['set']('label',_0x450829['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x450829['type']),this['set']('id',_0x450829['uiId']),this['set']('readonly',_0x573b67),this['set']('isLoading',_0x3d6b39);}['_setupTemplate'](){const _0x19be10=this['_createIconView'](),_0xdd6ba1=this['_createRemoveButton'](),_0x2f769d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x2f769d),'children':this['_createTemplateChildren'](_0x19be10,_0xdd6ba1,_0x2f769d)});}['_createTemplateAttributes'](_0x1040f3){return{'class':[Mr,_0x1040f3['if']('itemType',Gr,_0x23cf5a=>'document'==_0x23cf5a),_0x1040f3['if']('itemType',Ur,_0x489f6c=>'selection'==_0x489f6c)],'data-cke-tooltip-text':_0x1040f3['to']('label',Ln),'data-cke-tooltip-position':yn,'data-cke-tooltip-class':Yr};}['_createTemplateChildren'](_0x415603,_0x5bef6a,_0x4c11cc){const _0x545c48=this['_createLabelElement'](_0x4c11cc),_0x325393=this['_createLoaderIcon']();return this['readonly']?[_0x415603,_0x545c48]:[_0x415603,_0x325393,_0x545c48,_0x5bef6a];}['_createLabelElement'](_0x1dbda8){return{'tag':'span','attributes':{'class':Kr},'children':[{'text':_0x1dbda8['to']('label')}]};}['_createRemoveButton'](){const _0x47ed05=new _0x47081d(this['locale']);return _0x47ed05['set']({'label':Xn(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x26374c}),this['_setupRemoveButtonEvent'](_0x47ed05),_0x47ed05;}['_setupRemoveButtonEvent'](_0x19dd06){_0x19dd06['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x1528ee=this['bindTemplate'],_0x1bed29=new _0x8f03f4();return _0x1bed29['content']=En[this['itemType']],_0x1bed29['extendTemplate']({'attributes':{'class':[Wr,_0x1528ee['if']('isLoading','ck-hidden',_0x66ba63=>_0x66ba63)]}}),_0x1bed29;}['_handleAnimationEndOnce'](_0x30fe1f,_0x51ec9e){if(!_0x30fe1f)return;const _0x1113f7=()=>{_0x51ec9e(),_0x30fe1f['removeEventListener']('animationend',_0x1113f7),_0x30fe1f['removeEventListener']('webkitAnimationEnd',_0x1113f7);};_0x30fe1f['addEventListener']('animationend',_0x1113f7),_0x30fe1f['addEventListener']('webkitAnimationEnd',_0x1113f7);}['_createLoaderIcon'](){const _0x5ea30c=new Ve('small');return _0x5ea30c['bind']('isVisible')['to'](this,'isLoading',_0x427066=>_0x427066),_0x5ea30c;}}function Ln(_0xda1b58){if(!_0xda1b58)return _0xda1b58;if(_0xda1b58['length']<=0x78)return _0xda1b58;const _0x4a2438=_0xda1b58['slice'](0x0,0x78),_0x5bda65=_0x4a2438['lastIndexOf']('\x20');return(_0x5bda65>0x0?_0x4a2438['slice'](0x0,_0x5bda65):_0x4a2438)+'…';}const wn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},_n='300px';class mo{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x342154,_0x3d9de2,_0x56eeca,_0x112904,_0x4ce40e){this['_locale']=_0x342154,this['_visibleChips']=_0x3d9de2,this['_config']={...wn,..._0x56eeca,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x56eeca['cssClasses']}},this['_overflowChips']=new _0x1eff7a(),this['_bodyCollection']=_0x112904,this['_parentView']=_0x4ce40e||null;}['setContainerElement'](_0x34a527){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x34a527,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 _0x310e86=[...this['_visibleChips'],...this['_overflowChips']],_0x3dc8a6=this['_createCalculationContainer'](),_0x2e0c7f=this['_calculateOverflowInContainer'](_0x3dc8a6,_0x310e86),_0x2cea51=_0x3dc8a6['_ancestorsToRestore'];_0x2cea51&&this['_restoreAncestorVisibility'](_0x2cea51),_0x3dc8a6['remove'](),this['_applyOverflowResults'](_0x310e86,_0x2e0c7f);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x332a19({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x164a10=new _0x47081d(this['_locale']);_0x164a10['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x1a7eea=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x1a7eea['push'](this['_config']['cssClasses']['controlsButton']),_0x164a10['extendTemplate']({'attributes':{'class':_0x1a7eea}}),_0x164a10;}['_createShowMoreBalloonPanelView'](){const _0x2a2744=new _0x56f82c(this['_locale']);return _0x2a2744['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x2a2744),_0x2a2744;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x26f5b5=>{_0x26f5b5['disableAnimationOnEnter']();});const _0x2db0cc=new Bt(this['_locale']);_0x2db0cc['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x2db0cc);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x53398d=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x53398d?'':'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'](_0x49b88d){const _0x3b47ca=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x5780cf=this['_containerElement']?.['classList'];if(_0x5780cf){const _0x42396b=_0x5780cf[0x0]||'',_0x541900=_0x49b88d['querySelector']('.'+_0x42396b),_0x104636=_0x49b88d['querySelector'](_0x3b47ca);return _0x541900||_0x104636||_0x49b88d;}return _0x49b88d['querySelector'](_0x3b47ca)||_0x49b88d;}['_calculateContainerWidth'](){const _0x38799f=this['_parentView']?.['element']||this['_containerElement'];if(!_0x38799f)return _n;const _0x525f66=window['getComputedStyle'](_0x38799f)['width'];if('auto'===_0x525f66||'0px'===_0x525f66||!_0x525f66){const _0x35798e=_0x38799f['parentElement'];if(_0x35798e){const _0x26dc7f=window['getComputedStyle'](_0x35798e);return'auto'!==_0x26dc7f['width']?_0x26dc7f['width']:_n;}return _n;}return _0x525f66;}['_applyCalculationStyles'](_0x578161,_0x2b56b1){this['_config']['cssClasses']['calculationContainer']&&_0x578161['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x578161['style']['width']=_0x2b56b1,_0x578161['style']['position']='absolute',_0x578161['style']['top']='-9999px',_0x578161['style']['left']='-9999px',_0x578161['style']['opacity']='0',_0x578161['style']['pointerEvents']='none',_0x578161['style']['zIndex']='-1',_0x578161['style']['visibility']='visible\x20!important',_0x578161['style']['display']='block\x20!important',_0x578161['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x274c8f){_0x274c8f['forEach'](({element:_0x37774f,originalDisplay:_0x336038,originalVisibility:_0x50437a})=>{_0x37774f['style']['display']=_0x336038,_0x37774f['style']['visibility']=_0x50437a;});}['_makeAncestorsVisible'](_0x364eb5){const _0x541b04=[];let _0x383918=_0x364eb5;for(;_0x383918&&_0x383918!==document['body'];){const _0x5815b7=window['getComputedStyle'](_0x383918);'none'!==_0x5815b7['display']&&'hidden'!==_0x5815b7['visibility']||(_0x541b04['push']({'element':_0x383918,'originalDisplay':_0x383918['style']['display'],'originalVisibility':_0x383918['style']['visibility']}),_0x383918['style']['display']='block',_0x383918['style']['visibility']='visible'),_0x383918=_0x383918['parentElement'];}return _0x541b04;}['_createContainerElements'](){let _0x337f19,_0x1905f8;return this['_parentView']?.['element']?(_0x337f19=this['_parentView']['element']['cloneNode'](!0x0),_0x1905f8=this['_findTargetContainer'](_0x337f19)):(_0x337f19=document['createElement']('div'),_0x1905f8=_0x337f19),{'calculationContainer':_0x337f19,'targetContainer':_0x1905f8};}['_createCalculationContainer'](){const {calculationContainer:_0x251586,targetContainer:_0x3a227e}=this['_createContainerElements'](),_0x38349e=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x251586,_0x38349e);const _0x17f3ba=this['_parentView']?.['element']||this['_containerElement'],_0x310464=_0x17f3ba?.['parentElement'];_0x310464?_0x310464['appendChild'](_0x251586):document['body']['appendChild'](_0x251586),_0x251586['_targetContainer']=_0x3a227e;const _0xc39c10=this['_makeAncestorsVisible'](_0x310464||null);return _0x251586['offsetWidth'],_0x251586['_ancestorsToRestore']=_0xc39c10,_0x251586;}['_calculateOverflowInContainer'](_0x35ad37,_0x3ae6c1){const _0x1c42d0=_0x35ad37['_targetContainer']||_0x35ad37,_0x6c1e4e=[],{rowCount:_0x150543}=this['_renderChipsAndCountRows'](_0x1c42d0,_0x3ae6c1);if(_0x150543<=this['_config']['maxVisibleRows'])return _0x6c1e4e;const _0x2219cb=_0x3ae6c1['slice']();for(;_0x2219cb['length']>0x0;){if(this['_testButtonFit'](_0x35ad37,_0x1c42d0,_0x2219cb)){const _0x1012fb=_0x3ae6c1['filter'](_0x2a15a0=>!_0x2219cb['includes'](_0x2a15a0));_0x6c1e4e['push'](..._0x1012fb);break;}if(!_0x2219cb['pop']())break;}return _0x6c1e4e;}['_renderChipsAndCountRows'](_0x541f3b,_0xe87295){_0x541f3b['innerHTML']='',_0xe87295['forEach'](_0x273c1e=>{if(_0x273c1e['element']){const _0x188d0d=_0x273c1e['element']['cloneNode'](!0x0);_0x541f3b['appendChild'](_0x188d0d);}}),_0x541f3b['offsetWidth'];const _0x2cf646=_0x541f3b['children'],_0x26ae2d=[];return Array['from'](_0x2cf646)['forEach'](_0x596efe=>{const _0x2a237a=_0x596efe['getBoundingClientRect']()['top'];_0x26ae2d['some'](_0x111c03=>Math['abs'](_0x111c03-_0x2a237a)<this['_config']['rowDetectionTolerance'])||_0x26ae2d['push'](_0x2a237a);}),{'rowCount':_0x26ae2d['length']};}['_createMockButton'](){const _0x358416=document['createElement']('button');return _0x358416['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x358416['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x358416['textContent']='+\x201',_0x358416;}['_testButtonFit'](_0x4f51c0,_0x3bd4ac,_0x2ffc30){this['_renderChipsAndCountRows'](_0x3bd4ac,_0x2ffc30);const _0x2ac59c=this['_createMockButton']();_0x4f51c0['appendChild'](_0x2ac59c),_0x4f51c0['offsetWidth'];const _0x57c615=[..._0x3bd4ac['children'],_0x2ac59c],_0x47b9d6=[];_0x57c615['forEach'](_0x9d1075=>{const _0x4a46a2=_0x9d1075['getBoundingClientRect']()['top'];_0x47b9d6['some'](_0x58f702=>Math['abs'](_0x58f702-_0x4a46a2)<this['_config']['rowDetectionTolerance'])||_0x47b9d6['push'](_0x4a46a2);});const _0x5da58f=_0x47b9d6['length'];return _0x2ac59c['remove'](),_0x5da58f<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x115df8,_0x5652b4){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x115df8['forEach'](_0x489551=>{_0x5652b4['includes'](_0x489551)?this['_overflowChips']['add'](_0x489551):this['_visibleChips']['add'](_0x489551);});}['_updateOverflowUI'](_0x590529){if(_0x590529>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x590529>0x0&&this['_showMoreButtonView']){const _0x1db6ec=''+this['_config']['showMoreLabelPrefix']+(_0x590529<0x63?_0x590529:'99');this['_showMoreButtonView']['label']=_0x1db6ec;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x265c53,_0x5dedab){this['_distributeChips'](_0x265c53,_0x5dedab),this['_updateOverflowUI'](_0x5dedab['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x48da68=>{_0x48da68[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 _0x2b9caf=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x2b9caf['width']||0x0===_0x2b9caf['height'])return!0x1;const _0x29def2=window['innerHeight']||document['documentElement']['clientHeight'],_0x22d18e=window['innerWidth']||document['documentElement']['clientWidth'],_0x118288=0xc8;return _0x2b9caf['bottom']>=-0xc8&&_0x2b9caf['top']<=_0x29def2+_0x118288&&_0x2b9caf['right']>=-0xc8&&_0x2b9caf['left']<=_0x22d18e+_0x118288;}}const $r='ck-ai-chat__feed__context-chips',Qr='ck-ai-chat-context-chips-wrapper',Xr='ck-ai-chat-context-chips-wrapper-balloon',zr='ck-ai-chat-controls-button',Jr='ck-ai-chat-controls_context_show-more-button',Zr='ck-ai-chat-context-controls__show-more-balloon-panel';class ah extends Bt{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x5ab3a5,_0x40a51c,_0x5c17d9){super(_0x5ab3a5),this['_bodyCollection']=_0x5c17d9,this['_createContextChips'](_0x40a51c);const _0x2809b5={'cssClasses':{'showMoreButton':Jr,'showMoreBalloon':Zr,'overflowContainer':Xr,'controlsButton':zr}};this['_overflowManager']=new mo(_0x5ab3a5,this['_contextChips'],_0x2809b5,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[$r,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Qr},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x393bf5=this['element']['querySelector']('.'+Qr);_0x393bf5&&(this['_overflowManager']['setContainerElement'](_0x393bf5),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x38ca38){for(const _0x17f099 of _0x38ca38){const _0x317423=new Co(this['locale'],_0x17f099,!0x0,!0x1);this['_contextChips']['add'](_0x317423);}}}class ve extends gr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x48a51c,_0xbbf3d5,_0x193246){super(_0xbbf3d5),this['_locale']=_0x48a51c,this['_bodyCollection']=_0x193246,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'](_0x4a4550=>!_0x4a4550['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new Bt(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 Y extends gr{constructor(_0x2b8206,_0x3c0656){super(_0x3c0656);const {isWebSearchEnabled:_0x530228,isReasoningEnabled:_0x2643c5}=_0x3c0656['capabilities'],_0x14931d=[];let _0x502833='';_0x530228&&_0x2643c5?(_0x502833=Xn(_0x2b8206,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x14931d['push'](e_(_0x33764d)),_0x14931d['push'](e_(_0x38d343))):_0x530228?(_0x502833=Xn(_0x2b8206,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x14931d['push'](e_(_0x33764d))):_0x2643c5&&(_0x502833=Xn(_0x2b8206,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x14931d['push'](e_(_0x38d343))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x502833?'':'ck-hidden']}});const _0x2df1a9=new Bt();_0x2df1a9['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x14931d,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x502833]}]}),this['children']['add'](_0x2df1a9);}}function e_(_0x577ba9){const _0x3a314f=new _0x8f03f4();return _0x3a314f['content']=_0x577ba9,_0x3a314f;}const ts=['wheel','touchstart','pointerdown','keydown'],ss=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class _e{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x19cd63){this['element']=_0x19cd63,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x3ed0ef of ts){const _0x5e7185='keydown'!==_0x3ed0ef;this['element']['addEventListener'](_0x3ed0ef,this['_onUserEvent']['bind'](this),{'passive':_0x5e7185,'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'](_0x246ce2){if(this['isRunning']){if('keydown'===_0x246ce2['type']){const _0x523bf3=_0x246ce2['key'];if(!ss['includes'](_0x523bf3))return;}_0x246ce2 instanceof WheelEvent?_0x246ce2['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x4279df,scrollHeight:_0x1575d2,clientHeight:_0x58c931}=this['element'];return _0x1575d2-_0x4279df-_0x58c931<=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 Bt{constructor(_0x4153ee,_0x2bea92){super(_0x4153ee),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x2bea92)});}['_createSkeletonItems'](_0x1d9984){const _0x5c3d0c=['ck','ck-ai-skeleton__item'];return _0x1d9984['map'](_0x4561b5=>{let _0x29469e='';switch(_0x4561b5['attributes']['align']){case'right':_0x29469e='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x29469e='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x29469e='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x4561b5['tag'],'attributes':{'class':[..._0x5c3d0c,_0x4561b5['attributes']['class']?_0x4561b5['attributes']['class']:''],'style':'width:\x20'+_0x4561b5['attributes']['width']+';\x20height:\x20'+_0x4561b5['attributes']['height']+';'+_0x29469e}};});}}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':$e(0x5,'100%','44px','right'),'aiChatResources':$e(0x8,'100%','24px','right'),'aiReviewChecks':[{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}}]};function $e(_0x19ed9f,_0x5391c6,_0xad608a,_0x3122c2){return new Array(_0x19ed9f)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x5391c6,'height':_0xad608a,'align':_0x3122c2}}));}class Bi extends Bt{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x299aae,_0x2968d2){super(_0x299aae),this['_bodyCollection']=_0x2968d2,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Z)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new _e(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x4abc97,_0x1a7371){let _0x16031a;_0x16031a='ai-reply'===_0x4abc97?new Se(this['locale'],_0x1a7371):'ai-suggestion-reply'===_0x4abc97?new ke(this['locale'],_0x1a7371):'user-message'===_0x4abc97?new ve(this['locale'],_0x1a7371,this['_bodyCollection']):'interaction-header'===_0x4abc97?new Y(this['locale'],_0x1a7371):new ye(_0x1a7371),this['children']['add'](_0x16031a);}async['updateReplyItem']({id:_0x52fd56,parsedContent:_0x2a30e2,renderingStrategy:_0x2dc5f9,abortSignal:_0x250746}){const _0x298292=this['getItemById'](_0x52fd56);if(!(_0x298292 instanceof Se))throw new _0x16a90e('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x298292,'id':_0x52fd56,'parsedContent':_0x2a30e2});await _0x298292['updateContent']({'parsedContent':_0x2a30e2,'renderingStrategy':_0x2dc5f9,'abortSignal':_0x250746});}async['updateWebSources'](_0x5ceaae,_0x25cd17){const _0x4be581=this['getItemById'](_0x5ceaae);if(_0x4be581 instanceof ke)_0x4be581['updateSources'](_0x25cd17);else{if(!(_0x4be581 instanceof Se))throw new _0x16a90e('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x4be581,'id':_0x5ceaae,'sources':_0x25cd17});_0x4be581['updateSources'](_0x25cd17);}}async['updateSuggestionItem']({id:_0x3458a7,parts:_0x2b2b12,renderingStrategy:_0x1dbaac,abortSignal:_0x3eb156}){const _0x36d8d5=this['getItemById'](_0x3458a7);if(!(_0x36d8d5 instanceof ke))throw new _0x16a90e('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x36d8d5,'id':_0x3458a7,'parts':_0x2b2b12});await _0x36d8d5['updateContent']({'parts':_0x2b2b12,'renderingStrategy':_0x1dbaac,'abortSignal':_0x3eb156});}['updateSuggestionPartState']({id:_0x20c94c,index:_0x936571,state:_0x4bd7f5}){const _0x24b5bf=this['getItemById'](_0x20c94c);if(!(_0x24b5bf instanceof ke))throw new _0x16a90e('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x20c94c});_0x24b5bf['updatePartState'](_0x936571,_0x4bd7f5);}['markItemAsDone'](_0x8b66d0){this['getItemById'](_0x8b66d0)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x3a85d4=>_0x3a85d4['options']['id']);}['removeItem'](_0x9a290a){this['children']['remove'](this['getItemById'](_0x9a290a));}['scrollToSuggestion'](_0x37366f,_0x5c51f8){const _0x308662=this['getItemById'](_0x37366f);if(!(_0x308662 instanceof ke))return void _0x53aaf6('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x37366f,'partIndex':_0x5c51f8});const _0x3873df=_0x308662['getPartView'](_0x5c51f8);_0x3873df?_0x4c3d16({'target':_0x3873df['element'],'ancestorOffset':0x14,'alignToTop':!0x0,'forceScroll':!0x0}):_0x53aaf6('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x37366f,'partIndex':_0x5c51f8});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x10cbf4=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x10cbf4,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x40d22a=new je(this['locale'],Le['aiFeed']);return _0x40d22a['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x3f6a89=>!_0x3f6a89)]}}),_0x40d22a;}['_createFeedItems'](){const _0x40919a=new Bt(this['locale']);return _0x40919a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x40919a;}['_createFeedLoader'](){const _0x4fc645=new Bt(this['locale']);return _0x4fc645['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x30a7f2=>!_0x30a7f2)]},'children':this['_createLoaderChildren']()}),_0x4fc645;}['_createLoaderChildren'](){const _0x55c3eb=new Ve();return _0x55c3eb['isVisible']=!0x0,[_0x55c3eb,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x253cab){const _0x1726c8=this['children']['find'](_0x3e462b=>_0x3e462b['options']['id']['includes'](_0x253cab));if(!_0x1726c8)throw new _0x16a90e('ai-chat-feed-view-item-not-found',this,{'id':_0x253cab});return _0x1726c8;}['setLoadingMessage'](_0x1ea350){this['set']('loadingMessage',_0x1ea350);}['toggleLoadingSkeleton'](_0x156db1){this['set']('isLoadingSkeletonVisible',_0x156db1);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class Ir extends _0x1832e1{['filter'](){let _0x5890de=0x0;for(const _0x37c4b2 of this['items'])_0x5890de+=_0x37c4b2['items']['length'];return{'resultsCount':_0x5890de,'totalItemsCount':_0x5890de};}}class Ie extends _0x494771{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x387852,_0x15b535){super(_0x387852,{'queryView':{'label':'','creator':_0x258d40,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new Ir(_0x387852),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x15b535,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=Ie['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=Ie['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',(_0x3f2b01,_0x2565f6)=>!_0x3f2b01&&!_0x2565f6),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x3b12b2,_0x1a55a3)=>{this['isUploadInProgress']||this['isEmpty']||_0x3b12b2['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x1a55a3());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x379da4=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x379da4)return this['queryView']['errorText']=Xn(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x16a5ec=Yt(_0x379da4);this['fire']('sendUserMessage',_0x16a5ec),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0xea500e){this['queryView']['fieldView']['set']('placeholder',_0xea500e);}['_createSubmitButton'](){const _0x2516f8=new _0x47081d(this['locale']);return _0x2516f8['set']({'icon':_0x8b9d93,'label':Xn(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x2516f8['on']('execute',()=>{this['submit']();}),_0x2516f8;}['setIsUploadInProgress'](_0x24b7bd){this['isUploadInProgress']=_0x24b7bd;}['_setUpAddContextButtonPositioning'](){const _0x4d9986=this['locale'],_0x42aed3=()=>{_0x257afc['window']['requestAnimationFrame'](()=>{if(_0x5dc68e(this['element'])){const _0x36f6a0=new _0x4b088f(this['queryView']['fieldView']['element']),_0x504f0d=new _0x4b088f(this['_addContextButtonView']['element']),_0x47ec64=_0x36f6a0['width'],_0x5508e9='rtl'===_0x4d9986['uiLanguageDirection']?'right':'left';_0x36f6a0['excludeScrollbarsAndBorders']();const _0x5c8d68=_0x47ec64-_0x36f6a0['width']+0x1;this['_addContextButtonView']['element']['style'][_0x5508e9]='calc('+(_0x47ec64-_0x504f0d['width']-_0x5c8d68)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x42aed3),this['on']('render',()=>{_0x42aed3(),this['_queryViewResizeObserver']=new _0x16ec25(this['queryView']['fieldView']['element'],()=>{_0x42aed3();});});}}const ea='ck-ai-chat__prompt-capabilities',ia='ck-ai-chat-controls-button',sa='ck-ai-chat-controls-button--commands',na='ck-ai-chat-controls__model-selection',ra='ck-ai-chat-controls__model-selection__item-name',oa='ck-ai-chat-controls__model-selection__item-description',aa='ck-ai-chat-controls__model-selection__item-capabilities',ha='n';class Ce extends Bt{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x3fb9c4){super(_0x3fb9c4),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',_0x121953=>_0x121953),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x2c87f5=>_0x2c87f5?this['_modelSelectionDropdown']['buttonView']['label']:Xn(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x2ddc47=>_0x2ddc47),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x4de773=>_0x4de773),this['_webSearchButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x253cb1=>!_0x253cb1),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x72f637=>Xn(this['locale'],_0x72f637?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x45ff9d=>_0x45ff9d),this['_reasoningButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x41e32e=>!_0x41e32e),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x21ca6b=>Xn(this['locale'],_0x21ca6b?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[ea]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x1eff7a(),_0x41f204(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0xee09e9,_0x43c8f2){if(this['set']('modelSelectorVisible',!(_0x43c8f2&&_0xee09e9['length']<=0x1)),this['_modelSelectionDropdownItems']['clear'](),_0xee09e9?.['length'])for(const _0x2a94fb of _0xee09e9){const _0x129291=new _0xe58aa3({'label':_0x2a94fb['name'],'withText':!0x0,'role':'menuitemradio','id':_0x2a94fb['id'],'model':_0x2a94fb});_0x129291['bind']('isOn')['to'](this,'activeModelId',_0x49101b=>_0x49101b===_0x2a94fb['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x129291,'labelView':new ca(this['locale'],_0x2a94fb)});}}['setWebSearch'](_0x262aa3){this['set']('webSearchActive',_0x262aa3);}['setReasoning'](_0x235cc9){this['set']('reasoningActive',_0x235cc9);}['setModel'](_0xb80d35){if(!_0xb80d35)return;this['activeModelId']=_0xb80d35['id'],this['activeModelName']=_0xb80d35['name']||_0xb80d35['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0xb80d35['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0xb80d35['name']);const _0x565d2e=_0xb80d35['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x565d2e),this['_webSearchButton']['set']('isVisible',_0x565d2e);const _0xcbb99a=_0xb80d35['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0xcbb99a),this['_reasoningButton']['set']('isVisible',_0xcbb99a);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0),this['set']('modelSelectorVisible',!0x0);}['disableModelSelector'](_0x4d3dd7){this['set']('modelSelectorEnabled',!0x1),_0x4d3dd7&&this['set']('modelSelectorVisible',!0x1);}['_createWebSearchButton'](){const _0x10f5d0=new _0x47081d();return _0x10f5d0['set']({'label':Xn(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x33764d,'class':ia,'isToggleable':!0x0,'tooltipPosition':ha}),_0x10f5d0['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x10f5d0;}['_createReasoningButton'](){const _0xfb2644=new _0x47081d();return _0xfb2644['set']({'label':Xn(this['locale'],'AI_CHAT_REASONING'),'icon':_0x38d343,'class':ia,'isToggleable':!0x0,'tooltipPosition':ha}),_0xfb2644['on']('execute',()=>{this['fire']('toggleReasoning');}),_0xfb2644;}['_createCommandsButton'](){const _0x27cafc=new _0x47081d();return _0x27cafc['set']({'label':Xn(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x5c6573,'withText':!0x0,'class':ia,'isToggleable':!0x0,'tooltip':Xn(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':ha}),_0x27cafc['extendTemplate']({'attributes':{'class':[sa]}}),_0x27cafc['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x27cafc;}['_createModelSelectionDropdown'](){const _0x96f4b9=_0x5ecbb1(this['locale']);return _0x96f4b9['set']({'panelPosition':'ne','class':[na]}),_0x96f4b9['buttonView']['set']({'label':Xn(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':ha}),this['listenTo'](_0x96f4b9,'execute',_0x272183=>{this['fire']('selectModel',_0x272183['source']['model']);}),_0x96f4b9;}['_createModelNameView'](){const _0x10b0f9=new yo(this['locale']);return _0x10b0f9['bind']('text')['to'](this,'activeModelName',_0x5c3646=>_0x5c3646??''),_0x10b0f9['bind']('isVisible')['to'](this,'modelSelectorVisible',this,'activeModelName',(_0x5aecae,_0x4c0efd)=>!_0x5aecae&&!_0x4c0efd?.['toLowerCase']()['startsWith']('agent')),_0x10b0f9;}}let ca=class extends _0x5d6c90{constructor(_0x3a2e8e,_0x13db17){super();const _0x357da2=this['bindTemplate'],_0x4a544d=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x357da2['to']('style'),'id':_0x357da2['to']('id')},'children':[{'tag':'div','attributes':{'class':[ra]},'children':[{'text':_0x357da2['to']('text')}]},{'tag':'div','attributes':{'class':[oa]},'children':[{'tag':'span','children':[{'text':_0x13db17['description']}]}]},{'tag':'div','attributes':{'class':[aa]},'children':_0x4a544d}]}),_0x4a544d['addMany'](this['_getCapabilityParts'](_0x3a2e8e,_0x33764d,'AI_CHAT_SEARCH_WEB',_0x13db17['capabilities']['webSearch']?.['enabled']??!0x1)),_0x4a544d['addMany'](this['_getCapabilityParts'](_0x3a2e8e,_0x38d343,'AI_CHAT_REASONING',_0x13db17['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x8be14e,_0x120d24,_0x3f6670,_0xb0ea8d){const _0x4a182e=new _0x8f03f4();_0x4a182e['content']=_0x120d24;const _0x6a3efd=new Bt(_0x8be14e);_0x6a3efd['setTemplate']({'tag':'span','children':[{'text':Xn(_0x8be14e,_0x3f6670)+':\x20'}]});const _0x321581=new Bt(_0x8be14e);return _0x321581['setTemplate']({'tag':'span','children':[{'text':Xn(_0x8be14e,_0xb0ea8d?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x4a182e,_0x6a3efd,_0x321581];}};class yo extends Bt{constructor(_0x21ae2e){super(_0x21ae2e),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0xf40b5e=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0xf40b5e['if']('isVisible','ck-hidden',_0x4df1b0=>!_0x4df1b0)]},'children':[{'text':_0xf40b5e['to']('text')}]});}}const la='ck-ai-chat-context-controls__url-form',da='ck-ai-chat-context-controls__url-input-section';class xo extends Bt{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x42ec41){super(_0x42ec41),this['focusTracker']=new Pt(),this['keystrokes']=new Ht(),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 Lt({'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'](_0x5f1a9a=>{this['focusTracker']['add'](_0x5f1a9a['element']),this['keystrokes']['listenTo'](_0x5f1a9a['element']);}),_0x53ecd3({'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'](_0x3bd231){this['urlInputField']['errorText']=_0x3bd231,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x343424=new _0x47081d(this['locale']);return _0x343424['set']({'icon':Wt,'tooltip':Xn(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':'ck-button-icon\x20ck-button-back'}),_0x343424;}['_createUrlInputField'](){const _0x5c44f6=new th(this['locale'],_0x1f7178);return _0x5c44f6['set']({'label':Xn(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x5c44f6['fieldView']['set']({'placeholder':Xn(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x5c44f6;}['_createConfirmButton'](){const _0x16d4f9=new _0x47081d(this['locale']);return _0x16d4f9['set']({'icon':_0xa1c8de,'tooltip':Xn(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x16d4f9;}['_setupTemplate'](){const _0x48a680=new _0x17e2c5(this['locale'],{'label':Xn(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x48a680['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':la,'tabindex':'-1'},'children':[_0x48a680,{'tag':'div','attributes':{'class':da},'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',_0x94ec3f=>{_0x94ec3f['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x983848,_0x897379)=>{this['clear'](),this['fire']('cancel'),_0x897379();});}['_handleSubmit'](){const _0xd894de=this['getValue']()['trim']();_0xd894de?this['_isValidUrl'](_0xd894de)?(this['clearError'](),this['fire']('submitUrl',_0xd894de)):this['setError'](Xn(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](Xn(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x510f91=this['getValue']()['trim'](),_0x100a0c=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x510f91['length']>0x0&&!_0x100a0c;}['_isValidUrl'](_0x2c5bcc){try{return!!new URL(_0x2c5bcc);}catch{return!0x1;}}}const ua='ck-ai-chat-resources__item',_a='ck-ai-chat-resources__item--in-context',Ia='ck-ai-chat-resources__item-title',Aa='ck-ai-chat-resources__item__icon';class tc extends _0x55e39f{['resource'];['_titleView'];['_iconView'];constructor(_0x4570f2,_0x4cc840){super(_0x4570f2),this['resource']=_0x4cc840,this['set']('isInContext',!!_0x4cc840['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x4b455c){if(_0x4b455c['isInContext'])return _0xa1c8de;switch(_0x4b455c['type']){case Ft['DOCUMENT']:return _0x3d767d;case Ft['URL']:return _0x2a54a1;case Ft['FILE']:case Ft['TEXT']:return _0x4bf8ab;default:return _0x5b6972;}}['highlightText'](_0x9f8d3f){if(!_0x9f8d3f||''===_0x9f8d3f['trim']())return void this['_titleView']['highlightText'](null);const _0x62c784=new RegExp(_0x3f9d6f(_0x9f8d3f),'gi');this['_titleView']['highlightText'](_0x62c784);}['updateResourceState'](_0x559bb4){this['resource']['isInContext']=_0x559bb4,this['isInContext']=_0x559bb4,this['_updateIcon']();}['_createTitleView'](){const _0x58548b=new _0x1821cc();return _0x58548b['text']=this['resource']['label'],_0x58548b['extendTemplate']({'tag':'span','attributes':{'class':[Ia]}}),_0x58548b;}['_createIconView'](){const _0x149404=new _0x8f03f4();return _0x149404['content']=this['getResourceIcon'](this['resource']),_0x149404;}['_setupTemplate'](){const _0x6a96f2=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[ua,_0x6a96f2['if']('isVisible','ck-hidden',_0x44f0bd=>!_0x44f0bd),_0x6a96f2['if']('isInContext',_a)]},'children':[{'tag':'div','attributes':{'class':[Aa]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x6a96f2['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const ga='ck-ai-chat-resources__list';class Lr extends _0x1832e1{['_source'];constructor(_0x372cab,_0xbb0ec8){super(_0x372cab),this['_source']=_0xbb0ec8,this['extendTemplate']({'attributes':{'class':[ga]}});}['setResources'](_0x37a6a8,_0x426c2e){this['items']['clear']();let _0x38f214=_0x37a6a8;if(this['_source']['useDefaultFiltering']&&_0x426c2e&&''!==_0x426c2e['trim']()){const _0x25f672=new RegExp(_0x426c2e['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x38f214=_0x37a6a8['filter'](_0x496079=>_0x25f672['test'](_0x496079['label']));}for(const _0xda4745 of _0x38f214){const _0x3c58ee=new tc(this['locale'],_0xda4745);_0x3c58ee['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0xda4745);}),this['items']['add'](_0x3c58ee);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x426c2e);}['highlightText'](_0x13efdd){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x4cd81a=>{_0x4cd81a['highlightText'](_0x13efdd);});}['updateResourceState'](_0x5819a0,_0x29f6d5){for(const _0x49b9df of this['items']){const _0x36b848=_0x49b9df;_0x36b848['resource']['id']===_0x5819a0&&_0x36b848['updateResourceState'](_0x29f6d5);}}['_handleResourceSelection'](_0x2bc96e,_0x5b86d1){this['fire']('addResourceToContext',{'source':_0x2bc96e,'resource':_0x5b86d1});}}class qr extends th{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x5816da){const t=_0x5816da['t'],_0x5be4a6={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x1f7178,'label':Xn(_0x5816da,'AI_CHAT_SEARCH_RESOURCES')};super(_0x5816da,_0x5be4a6['creator']),this['label']=_0x5be4a6['label'],this['_viewConfig']=_0x5be4a6,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x5816da,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0xbf4111){this['fire']('search',_0xbf4111);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x8f03f4(),this['iconView']['content']=_0x17f96a,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x4b6f93,t){this['resetButtonView']=new _0x47081d(_0x4b6f93),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x435221,'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',_0x26c87d=>!_0x26c87d),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 Bt{['_searchView'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x1447d7,_0x5a3073){super(_0x1447d7),this['_source']=_0x5a3073,this['set']('isLoading',!0x0),this['_searchView']=this['_createSearchView']();const _0x18e046=this['_createSearchSection']();this['_resourcesListView']=this['_createResourcesListView'](),this['_skeletonLoader']=this['_createSkeletonView'](),this['children']=new _0x1b6214([_0x18e046,this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new qr(this['locale']);}['_createSearchSection'](){const _0x571f90=new Bt(this['locale']);return _0x571f90['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x53886b,_0x518b93)=>{this['loadResources'](_0x518b93),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x518b93);}),_0x571f90;}['_createResourcesListView'](){const _0xe6b66d=new Lr(this['locale'],this['_source']);return _0xe6b66d['delegate']('addResourceToContext')['to'](this),_0xe6b66d['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0xe6b66d;}['_createSkeletonView'](){const _0x28b728=new je(this['locale'],Le['aiChatResources']);return _0x28b728['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x253ddb=>!_0x253ddb)]}}),_0x28b728;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x4e699f){const _0x267ba9=_0x206174();this['_latestLoadResourcesUid']=_0x267ba9,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x4e699f,'uid':_0x267ba9}),this['isLoading']=!0x0;}['setResources'](_0x4dd162,_0x4a4a79){if(_0x4a4a79&&_0x4a4a79!==this['_latestLoadResourcesUid'])return;const _0x1818b1=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x4dd162,_0x1818b1),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x5ae692,_0x1b4bb6){this['_resourcesListView']['updateResourceState'](_0x5ae692,_0x1b4bb6);}}const ma='ck-ai-chat-context-controls__source-balloon-panel',pa='ck-button-icon\x20ck-button-back',Ta='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class wo{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x17d923,_0x2b6f7e,_0x2624f8){this['_locale']=_0x17d923,this['_bodyCollection']=_0x2b6f7e,this['_config']=_0x2624f8;}['showSourceResourcesBalloon'](_0x39530b){let _0x46b406=this['_sourceResourceBalloons']['get'](_0x39530b['id']);_0x46b406||(_0x46b406=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x39530b['id'],_0x46b406),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x46b406)),this['_addSourceResourceContent'](_0x46b406,_0x39530b),_0x46b406['show']();const _0x4ecc33=this['_config']['getTargetElement']();_0x4ecc33&&_0x46b406['pin']({'target':_0x4ecc33,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x38c513,_0x3ef790,_0x34093f){const _0x1239e0=this['_sourceResourceBalloons']['get'](_0x38c513);if(!_0x1239e0)return;const _0x3d2124=this['_getResourcesViewFromBalloon'](_0x1239e0);_0x3d2124&&_0x3d2124['setResources'](_0x3ef790,_0x34093f);}['closeSourceResourceBalloon'](_0x419f1c){const _0x5d4373=this['_sourceResourceBalloons']['get'](_0x419f1c);_0x5d4373&&requestAnimationFrame(()=>{_0x5d4373['hide'](),this['_sourceResourceBalloons']['delete'](_0x419f1c),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x340b68 of this['_sourceResourceBalloons']['values']())if(_0x340b68['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x49fdae,_0x2d73aa,_0x59168a){const _0x4b94e0=this['_sourceResourceBalloons']['get'](_0x49fdae);if(!_0x4b94e0||!_0x4b94e0['isVisible'])return;const _0x655fc=this['_config']['getTargetElement']();if(!_0x655fc)return;_0x4b94e0['pin']({'target':_0x655fc,'limiter':this['_config']['getLimiterElement']()});const _0x129c5e=this['_getResourcesViewFromBalloon'](_0x4b94e0);_0x129c5e&&_0x129c5e['updateResourceState'](_0x2d73aa,_0x59168a);}['destroy'](){for(const _0x7efb9e of this['_sourceResourceBalloons']['values']())_0x7efb9e['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x3a2e19=new _0x56f82c(this['_locale']);return _0x3a2e19['extendTemplate']({'attributes':{'class':ma}}),this['_bodyCollection']['add'](_0x3a2e19),_0x3a2e19;}['_addSourceResourceContent'](_0x129741,_0x33cf6a){_0x129741['content']['clear']();const _0x6a4ef7=this['_createBalloonHeader'](_0x129741,_0x33cf6a);_0x129741['content']['add'](_0x6a4ef7);const _0x159d8d=this['_createBalloonResourcesView'](_0x33cf6a);_0x129741['content']['add'](_0x159d8d);}['_createBalloonHeader'](_0x1c9e9c,_0x3e0752){const _0x386428=this['_createBackButton'](_0x1c9e9c),_0x4fbe0c=new _0x17e2c5(this['_locale'],{'label':_0x3e0752['label'],'class':Ta});return _0x4fbe0c['children']['add'](_0x386428,0x0),_0x4fbe0c;}['_createBackButton'](_0xe8870e){const _0x46da74=new _0x47081d(this['_locale']);return _0x46da74['set']({'icon':Wt,'tooltip':Xn(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':pa}),_0x46da74['on']('execute',()=>{_0xe8870e['hide'](),this['_config']['onBackToContext']();}),_0x46da74;}['_createBalloonResourcesView'](_0x4cdb12){const _0x38dafa=new Br(this['_locale'],_0x4cdb12);return _0x38dafa['on']('loadSourceResources',(_0x4c42c4,_0x11b5bd)=>{this['_config']['onLoadSourceResources'](_0x11b5bd);}),_0x38dafa['on']('addResourceToContext',(_0x1ddcc8,_0x3e89ef)=>{this['_config']['onResourceSelected'](_0x3e89ef['source'],_0x3e89ef['resource']),this['closeSourceResourceBalloon'](_0x4cdb12['id']);}),_0x38dafa;}['_getResourcesViewFromBalloon'](_0x4d1bcb){const _0x966ace=_0x4d1bcb['content']['get'](0x1);return _0x966ace instanceof Br?_0x966ace:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x283f30){_0x332a19({'emitter':_0x283f30,'contextElements':[_0x283f30['element']],'callback':()=>{_0x283f30['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x283f30['isVisible']});}}const be=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources'],po='ck-ai-chat-context-controls',Bo='ck-ai-chat-context-controls__pending-contexts',bo='ck-ai-chat-context-controls__add-context-balloon-panel',To='ck-ai-chat-context-controls__add-context-button',Ao='ck-ai-chat-context-controls__url-balloon-panel',ko='ck-ai-chat-context-controls__balloon-button',Eo='ck-ai-chat-context-controls__balloon-button-source',vo='ck-ai-chat-controls-button',go='ck-ai-chat-context-chips-wrapper-balloon',Vo='ck-ai-chat-controls_context_show-more-button',fo='ck-ai-chat-context-controls__show-more-balloon-panel',Io='ck-ai-chat',Po=[_0x56f82c['defaultPositions']['northArrowSouthWest'],_0x56f82c['defaultPositions']['northArrowSouth'],_0x56f82c['defaultPositions']['northArrowSouthEast'],_0x56f82c['defaultPositions']['southArrowNorthWest'],_0x56f82c['defaultPositions']['southArrowNorth'],_0x56f82c['defaultPositions']['southArrowNorthEast']];class xe extends Bt{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['bodyCollection'];constructor(_0x5096ba,_0x1be00e){super(_0x5096ba),this['bodyCollection']=_0x1be00e,this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x5096ba),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x5096ba),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x5096ba),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x5096ba,_0x1be00e);const _0x2feb3b={'cssClasses':{'showMoreButton':Vo,'showMoreBalloon':fo,'overflowContainer':go,'controlsButton':vo}};this['_overflowManager']=new mo(_0x5096ba,this['_currentContextsChips'],_0x2feb3b,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'](_0x36e8e4,_0x579fb9){const _0x569cb7=this['_createContextButton'](_0x36e8e4,'current',!0x0,_0x579fb9);this['_addContextToCollection'](_0x569cb7,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x1cee41){this['_removeContextFromCollection'](_0x1cee41,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x1cee41,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x110793,_0x132825){let _0x5fdcec=this['_currentContextsChips']['find'](_0x394d1a=>_0x394d1a['id']===_0x110793);_0x5fdcec||(_0x5fdcec=this['_overflowManager']['overflowChips']['find'](_0x4b8dbc=>_0x4b8dbc['id']===_0x110793)),_0x5fdcec&&(_0x5fdcec['isLoading']=_0x132825);}['setConversationContext'](_0x412e22){this['_conversationContextsChips']['clear']();for(const _0x4c3cbe of _0x412e22){const _0x5d92d9=this['_createContextButton'](_0x4c3cbe,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x5d92d9,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x309d65,_0x649c9b,_0x37c512){this['_resourcesBalloonView']['updateResourceState'](_0x309d65,_0x649c9b,_0x37c512);}['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'](_0x23968a){this['_resourcesBalloonView']['showSourceResourcesBalloon'](_0x23968a),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x26fa09,_0x51821e,_0x2b3870,_0x323e3b){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x26fa09,_0x2b3870,_0x323e3b);}['closeSourceResourceBalloon'](_0x2ee037){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x2ee037),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x336d46){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x336d46),this['_setAddContextButtonEnabled'](_0x336d46);}['_setAddContextButtonEnabled'](_0x40bf52){const _0x3c2b18=!_0x40bf52['document']['isHidden']&&_0x40bf52['document']['enabled'],_0xa87623=_0x40bf52['urls']['enabled'],_0x99646=_0x40bf52['files']['enabled'];this['addContextButtonView']['isEnabled']=_0x3c2b18||_0xa87623||_0x99646;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[po,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Bo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0xc72ea9){const _0x3167a9=new _0x47081d(_0xc72ea9);return _0x3167a9['set']({'label':Xn(_0xc72ea9,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':vo+'\x20'+To,'icon':_0x3d9c9a,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x3167a9;}['_createAddContextBalloonPanelView'](_0x2c7529){return this['_createBaseBalloonPanel'](_0x2c7529,bo);}['_createUrlBalloonPanelView'](_0x5d7a20){const _0x3d2f56=this['_createBaseBalloonPanel'](_0x5d7a20,Ao);return this['_addUrlContent'](_0x3d2f56,_0x5d7a20),_0x3d2f56;}['_createResourcesBalloonView'](_0x2c5ee2,_0x21e077){return new wo(_0x2c5ee2,_0x21e077,{'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Po});},'onResourceSelected':(_0x242363,_0x57cae4)=>{this['fire']('addResourceToContext',{'source':_0x242363,'resource':_0x57cae4});},'onLoadSourceResources':_0x12fbc1=>{this['fire']('loadSourceResources',_0x12fbc1);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']});}['_getLimiterElement'](){return this['element']?.['closest']('.'+Io)||document['body'];}['_createBaseBalloonPanel'](_0x2670b8,_0x2c07d5){const _0xf55fd=new _0x56f82c(_0x2670b8);return _0xf55fd['extendTemplate']({'attributes':{'class':_0x2c07d5}}),this['bodyCollection']['add'](_0xf55fd),_0xf55fd;}['_setBalloonPanelContent'](_0x1b6aeb,_0x468652,_0x106052){if(_0x1b6aeb['content']['clear'](),!_0x106052['document']['isHidden']&&_0x106052['document']['enabled']){const _0x249e5b=this['_createBalloonButton'](_0x468652,{'label':Xn(_0x468652,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x3d767d});_0x249e5b['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x1b6aeb['content']['add'](_0x249e5b);}if(_0x106052['urls']['enabled']){const _0x47ce90=this['_createBalloonButton'](_0x468652,{'label':Xn(_0x468652,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x2a54a1});_0x47ce90['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Po}),this['_urlInputView']['focus']();}),_0x1b6aeb['content']['add'](_0x47ce90);}if(_0x106052['files']['enabled']){const _0x25f11d=new _0x227848(_0x468652);_0x25f11d['set']({'label':Xn(_0x468652,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x5c4881,'withText':!0x0,'tooltip':!0x0,'class':ko,'allowMultipleFiles':!0x0}),_0x25f11d['on']('done',(_0x3292a9,_0x426f37)=>{this['fire']('addFileToContext',_0x426f37),this['hideAddContextBalloonPanel']();}),_0x25f11d['tooltip']=!0x0,_0x1b6aeb['content']['add'](_0x25f11d);}for(const _0x173769 of _0x106052['sources']){const _0x4d94e2=this['_createBalloonButton'](_0x468652,{'label':_0x173769['label'],'icon':_0x173769['icon']||_0x5b6972,'type':'source'});_0x1b6aeb['content']['add'](_0x4d94e2),_0x4d94e2['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon'](_0x173769);});}}['_addUrlContent'](_0xe1b657,_0x4eed46){this['_urlInputView']=new xo(_0x4eed46),this['_urlInputView']['on']('submitUrl',(_0x3a2408,_0x1c4947)=>{this['_handleUrlSubmit'](_0x1c4947);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Po});}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Po});}),_0xe1b657['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x5a3572,_0x553f5e){const _0x5129be='source'===_0x553f5e['type']?new Ea(_0x5a3572):new _0x47081d(_0x5a3572);return _0x5129be['set']({'label':_0x553f5e['label'],'icon':_0x553f5e['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':ko}),_0x5129be;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x332a19({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x61f433){const _0x12e4cb=this['_addContextBalloonConfig'];_0x12e4cb['buttonView']['isOn']=_0x61f433,_0x61f433?_0x12e4cb['balloonView']['show']():_0x12e4cb['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0xef6346,buttonView:_0x4ca785,hideMethod:_0x9196ec}=this['_addContextBalloonConfig'];_0x332a19({'emitter':_0xef6346,'contextElements':[_0xef6346['element'],_0x4ca785['element']],'callback':()=>{_0x9196ec();},'activator':()=>_0x4ca785['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x3cfb2c,_0x457924,_0x4580f2=!0x1,_0xea40b1=!0x1){const _0x57ab49='conversation'===_0x457924||!0x0===_0x3cfb2c['isReadOnly'],_0x14f73e=new Co(this['locale'],_0x3cfb2c,_0x57ab49,_0x4580f2,_0xea40b1);return _0x57ab49||_0x14f73e['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x14f73e['id']);}),_0x14f73e;}['_addContextToCollection'](_0x499f4a,_0x3a29fb){_0x3a29fb['add'](_0x499f4a,0x0);}['_removeContextFromCollection'](_0x1b8254,_0x5b90b4){const _0x5c3ec1=_0x5b90b4['find'](_0x1b18da=>_0x1b18da['id']===_0x1b8254);_0x5c3ec1&&_0x5b90b4['remove'](_0x5c3ec1);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Po}));}['_handleUrlSubmit'](_0x424aa4){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x424aa4);}}class Ea extends _0x47081d{['arrowView'];constructor(_0x34e30b){super(_0x34e30b),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Eo]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x421225=new _0x8f03f4();return _0x421225['content']=_0x44aab7,_0x421225['extendTemplate']({'attributes':{'class':Eo+'__arrow'}}),_0x421225;}}class Pe extends Bt{['_cancelButtonView'];['_loaderView'];constructor(_0x5ba7f7){super(_0x5ba7f7),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 _0x2633db=new _0x47081d(this['locale']);return _0x2633db['set']({'label':Xn(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ai-chat-controls-loader__cancel-button','icon':_0x57f487}),_0x2633db['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x2633db;}['_createLoaderView'](){const _0xb151a4=new Bt(this['locale']);return _0xb151a4['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':Xn(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0xb151a4;}}class Fi extends Bt{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_shouldRestorePromptInputFocus'];constructor(_0x59361c,_0x470925){super(_0x59361c),this['_contextPanelView']=this['_createContextPanelView'](_0x59361c,_0x470925),this['_promptInputView']=this['_createPromptInputView'](_0x59361c),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x59361c),this['_loaderView']=this['_createLoaderView'](_0x59361c),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'](...be)['to'](this);const _0x4330e4=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls']},'children':[{'tag':'div','attributes':{'class':[_0x4330e4['if']('isLoading','ck-hidden')]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x4330e4['if']('isLoading','ck-hidden',_0x2b158a=>!_0x2b158a)]},'children':[this['_loaderView']]}]}),_0x332a19({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x33ffa2,_0x4227f3){return new xe(_0x33ffa2,_0x4227f3);}['_createPromptInputView'](_0x355070){return new Ie(_0x355070,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x201b6c){return new Ce(_0x201b6c);}['_createLoaderView'](_0xa62460){return new Pe(_0xa62460);}['_handlePromptInputFocus'](_0x6a0bc8,_0xa4b27,_0x1613a5){_0x1613a5?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x1e18d7,_0x215793){this['_contextPanelView']['addContextItem'](_0x1e18d7,_0x215793);}['removeContextItem'](_0x49166b){this['_contextPanelView']['removeContextItem'](_0x49166b);}['setContextItemLoading'](_0x3a8644,_0x504401){this['_contextPanelView']['setContextItemLoading'](_0x3a8644,_0x504401);}['setIsUploadInProgress'](_0x5984d8){this['_promptInputView']['setIsUploadInProgress'](_0x5984d8);}['setConversationContext'](_0x55af61){this['_contextPanelView']['setConversationContext'](_0x55af61);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x35f703,_0x4aabf0,_0x527b51){this['_contextPanelView']['updateResourceState'](_0x35f703,_0x4aabf0,_0x527b51);}['setWebSearch'](_0x22e0ea){this['_promptCapabilitiesView']['setWebSearch'](_0x22e0ea);}['setReasoning'](_0x110fe3){this['_promptCapabilitiesView']['setReasoning'](_0x110fe3);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x267576){this['_contextPanelView']['setAddContextOptions'](_0x267576);}['setInputPlaceholder'](_0x2af2a3){this['_promptInputView']['setPlaceholderText'](_0x2af2a3);}['setModelList'](_0x562d4d,_0x275888){this['_promptCapabilitiesView']['setModelList'](_0x562d4d,_0x275888);}['setModel'](_0x324e29){this['_promptCapabilitiesView']['setModel'](_0x324e29);}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x29e90c){this['_promptCapabilitiesView']['disableModelSelector'](_0x29e90c);}['populateSourceResourceBalloon'](_0x4798ea,_0x1a27d9,_0x17f9e5,_0x3fbe43){this['_contextPanelView']['populateSourceResourceBalloon'](_0x4798ea,_0x1a27d9,_0x17f9e5,_0x3fbe43);}['closeSourceResourceBalloon'](_0x15cd80){this['_contextPanelView']['closeSourceResourceBalloon'](_0x15cd80);}['focusPromptInput'](){this['_promptInputView']['focus']();}}class Hi extends _0x17e2c5{['conversationStartButton'];['resizeButton'];constructor(_0x5150ea,_0x1c4034){super(_0x5150ea,{'label':Xn(_0x5150ea,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':_0x466df0}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x5150ea),this['children']['add'](this['conversationStartButton']),_0x1c4034&&(this['resizeButton']=as(_0x5150ea,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x3dfb2f){const _0x1fa3ba=new _0x47081d(_0x3dfb2f);return _0x1fa3ba['set']({'label':Xn(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x42b69b,'class':'ck-ai-chat__start-conversation'}),_0x1fa3ba['on']('execute',()=>{this['fire']('startConversation');}),_0x1fa3ba;}}class Vi extends Bt{constructor(_0x5ede35){super(_0x5ede35),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':Xn(_0x5ede35,'AI_DISCLAIMER_TEXT')}]}]});}}class J extends Bt{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x3264e0,_0x5c0214){super(_0x3264e0),this['_bodyCollection']=new Qt(_0x3264e0),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new Hi(_0x3264e0,_0x5c0214),this['chatHeader']['delegate'](...Z)['to'](this),this['chatFeed']=new Bi(_0x3264e0,this['_bodyCollection']),this['chatFeed']['delegate'](...Z)['to'](this),this['chatControls']=new Fi(_0x3264e0,this['_bodyCollection']),this['chatControls']['delegate'](...Z)['to'](this),this['chatDisclaimer']=new Vi(_0x3264e0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x3264e0['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x31e31f,_0x4caabb,_0xe9f3c1,_0x3ff669){this['chatControls']['populateSourceResourceBalloon'](_0x31e31f,_0x4caabb,_0xe9f3c1,_0x3ff669);}['closeSourceResourceBalloon'](_0x4af234){this['chatControls']['closeSourceResourceBalloon'](_0x4af234);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class v extends _0x52a465{static get['requires'](){return[M];}['_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(_0x550ce0){super(_0x550ce0);const _0x45a2aa=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new g(),this['_view']=new J(this['context']['locale'],_0x45a2aa['showResizeButton']),this['_view']['delegate'](...Z)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x2728a6,{showDiff:_0x2ef61d})=>{this['showDiff']=_0x2ef61d;}),_0x45a2aa['view']['addTab']({'id':'chat','buttonLabel':Xn(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x466df0,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x4f22f6=>_0x4f22f6),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x1c50a1=>_0x1c50a1),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x18486f){this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x18486f['availableModels'],!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':Xn(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE')});}['addFeedItemStaticMessage']({id:_0x10a97a,staticMessage:_0x5a4edd}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x10a97a,'initialContent':'<p>'+_0x5a4edd+'</p>'});}['addFeedItemUserMessage'](_0x2d1004){const _0x5431ac=_0x2d1004['quickActionData']?.['displayedPrompt']||_0x2d1004['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x2d1004['contextItems']['values']()),'initialContent':'<p>'+_0x5431ac+'</p>','id':_0x2d1004['id']});}['addFeedItemError']({errorMessage:_0x2669d1,id:_0x5a69c3}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x2669d1+'</p>','id':_0x5a69c3});}['addFeedItemAIReply'](_0xb637fc){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0xb637fc['interactionId']+':'+_0xb637fc['id']}),this['_view']['chatFeed']['setLoadingMessage']('');});}async['addFeedItemAISuggestion'](_0x535878){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x535878['interactionId']+':'+_0x535878['id'],'areActionsDisabled':_0x535878['areActionsDisabled'],'showDiff':this['showDiff']}),this['_view']['chatFeed']['setLoadingMessage']('');});}['addFeedInteractionHeader'](_0x12ca67){this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x12ca67['id'],'capabilities':_0x12ca67['capabilities']});}['updateFeedInteractionHeader'](_0x50bb22){const _0x5db437=this['_view']['chatFeed']['children']['find'](_0x9e36ab=>_0x9e36ab['options']['id']==_0x50bb22['id']&&_0x9e36ab instanceof Y);_0x5db437&&_0x5db437['set']('isVisible',_0x50bb22['isVisible']);}async['updateFeedItemAIReplyContent'](_0x3f0dec){const _0x42025d=_0x3f0dec['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x1c325d=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x3f0dec,'abortSignal':_0x1c325d,'renderingStrategy':_0x42025d}),_0x3f0dec['isDone']&&this['markFeedItemAsDone'](_0x3f0dec['id']);});}['updateFeedItemAIReplySources'](_0x4d4f99,_0x3d9772){this['_view']['chatFeed']['updateWebSources'](_0x4d4f99,_0x3d9772);}async['updateFeedItemAIReplySuggestionContent'](_0x48cf5e){const _0x570114=_0x48cf5e['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x237266=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x48cf5e,'abortSignal':_0x237266,'renderingStrategy':_0x570114}),_0x48cf5e['isDone']&&this['markFeedItemAsDone'](_0x48cf5e['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x579649){this['_view']['chatFeed']['updateSuggestionPartState'](_0x579649);}['markFeedItemAsDone'](_0x537563){this['_view']['chatFeed']['markItemAsDone'](_0x537563);}['removeFeedInteraction'](_0x11b854){this['_view']['chatFeed']['getItemIds']()['filter'](_0x4537e3=>_0x4537e3['startsWith'](_0x11b854))['forEach'](_0x252efd=>this['_view']['chatFeed']['removeItem'](_0x252efd));}['startInteraction'](_0x2611de){this['_view']['chatFeed']['setLoadingMessage'](this['_getLoadingMessage'](_0x2611de)),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x442e2f){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x431d48=>_0x431d48['startsWith'](_0x442e2f['id']))['forEach'](_0x26738f=>this['markFeedItemAsDone'](_0x26738f)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x207bf6,_0x14e630){this['_view']['chatControls']['addContextItem'](_0x207bf6,_0x14e630);}['removeContextItem'](_0xb00a3c){this['_view']['chatControls']['removeContextItem'](_0xb00a3c);}['setContextItemLoading'](_0x3b6123,_0x1d4ba6){this['_view']['chatControls']['setContextItemLoading'](_0x3b6123,_0x1d4ba6);}['setIsUploadInProgress'](_0x49fb8a){this['_view']['chatControls']['setIsUploadInProgress'](_0x49fb8a);}['setConversationContext'](_0x55f33a){this['_view']['chatControls']['setConversationContext'](_0x55f33a);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x587da2,_0x12b80c,_0x5d3e8d){this['_view']['chatControls']['updateResourceState'](_0x587da2,_0x12b80c,_0x5d3e8d);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x364705){this['_view']['chatControls']['setAddContextOptions'](_0x364705);}['updateCapabilities'](_0xcd5182){this['_view']['chatControls']['setWebSearch'](_0xcd5182['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0xcd5182['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0xcd5182));}['setSelectedModel'](_0x302132,_0xc04794){this['_view']['chatControls']['setModel'](_0x302132),_0xc04794&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x2f507a){this['feedItemRenderingStrategy']=_0x2f507a;}['toggleLoadingSkeleton'](_0x5236f5){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x5236f5);}['resetConversationTitle'](){this['setConversationTitle'](Xn(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x4f185c,_0x251c28=!0x1){if(_0x251c28&&!_0x375620()&&_0x4f185c['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x4f185c);this['_view']['chatHeader']['label']=_0x4f185c;}['_animateConversationTitle'](_0x159d4d){let _0x281846=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x159d4d[_0x281846],_0x281846++,_0x281846===_0x159d4d['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x4a9673){this['_view']['chatHeader']['isMaximized']=_0x4a9673;}['_getLoadingMessage'](_0x510c46){const _0x23a776=_0x510c46['capabilities'];return _0x23a776['isWebSearchEnabled']&&_0x23a776['isReasoningEnabled']?Xn(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x23a776['isWebSearchEnabled']?Xn(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x23a776['isReasoningEnabled']?Xn(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):Xn(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x4a9705){return _0x4a9705?_0x4a9705['isWebSearchEnabled']&&_0x4a9705['isReasoningEnabled']?Xn(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x4a9705['isWebSearchEnabled']?Xn(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x4a9705['isReasoningEnabled']?Xn(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):Xn(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):Xn(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x4d8eee,_0x14e160,_0x3d09b9,_0x3d988e){this['_view']['populateSourceResourceBalloon'](_0x4d8eee,_0x14e160,_0x3d09b9,_0x3d988e);}['closeSourceResourceBalloon'](_0x53c89a){this['_view']['closeSourceResourceBalloon'](_0x53c89a);}['focusPromptInput'](){this['_view']['chatControls']['focusPromptInput']();}['scrollFeedToSuggestion'](_0x1517b2,_0x22e5bf){this['_view']['chatFeed']['scrollToSuggestion'](_0x1517b2,_0x22e5bf);}}class Xi extends _0x1832e1{['sections'];constructor(_0x27ab7a,_0x3896d8){super(_0x27ab7a),this['sections']=_0x3896d8,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x1d8437){let _0x2c15e4=0x0,_0x4d0b0b=0x0;for(const _0x50b96d of this['sections']){const {resultsCount:_0x243631,totalItemsCount:_0x30951c}=_0x50b96d['filter'](_0x1d8437);_0x2c15e4+=_0x243631,_0x4d0b0b+=_0x30951c;}return{'resultsCount':_0x2c15e4,'totalItemsCount':_0x4d0b0b};}}class Zi extends _0x55e39f{['title'];['itemsViews'];['_itemsListView'];constructor(_0x2d1e2a,{title:_0x2146a4,items:_0x18adea}){super(_0x2d1e2a);const _0x50bb0c=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x2146a4,this['itemsViews']=_0x18adea;const _0x2f1b36=new Bt(_0x2d1e2a);_0x2f1b36['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x1832e1(_0x2d1e2a),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x50bb0c['if']('isVisible','ck-hidden',_0x58882a=>!_0x58882a)]},'children':[_0x2f1b36,this['_itemsListView']]});}['filter'](_0x44e509){const _0x70eb1b=this['itemsViews']['length'];let _0x3975a2=0x0;for(const _0xbb14d4 of this['itemsViews']){if(_0x44e509){const _0x93b3ad=_0xbb14d4['isMatching'](_0x44e509);_0xbb14d4['isVisible']=!!_0x93b3ad,_0xbb14d4['highlightText'](_0x44e509);}else _0xbb14d4['isVisible']=!0x0,_0xbb14d4['highlightText'](null);_0xbb14d4['isVisible']&&_0x3975a2++;}return this['isVisible']=_0x3975a2>0x0,{'resultsCount':_0x3975a2,'totalItemsCount':_0x70eb1b};}['getItem'](_0x19081a){return this['itemsViews']['find'](_0x4c7830=>_0x4c7830['id']===_0x19081a);}['removeItem'](_0x395dde){const _0x48f0b5=this['itemsViews']['indexOf'](_0x395dde);-0x1!==_0x48f0b5&&(this['itemsViews']['splice'](_0x48f0b5,0x1),this['_itemsListView']['items']['remove'](_0x395dde));}}class $i extends _0x1b08cc(_0x55e39f){['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(_0x4e2954,_0x112665){super(_0x4e2954);const _0x5c9644=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x112665['pinned']),this['set']('loadingState',null),this['id']=_0x112665['id'];const {title:_0x3e8416,createdAt:_0x45747a,active:_0x771444=!0x1}=_0x112665;this['_titleView']=new _0x1821cc(),this['_titleView']['text']=_0x3e8416,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x58f3db=this['_createCheckView'](),_0x4a913f=this['_createPinButtonView'](_0x4e2954),_0x2d3962=this['_createMenuDropdownView'](),_0x3bca68=this['_createEditInputView'](_0x4e2954,_0x3e8416),_0x13ffbb=this['_createAcceptEditButtonView'](_0x4e2954,_0x3bca68),_0x49271f=this['_createCancelEditButtonView'](_0x4e2954,_0x3bca68);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x4a913f),this['actions']['add'](_0x2d3962),this['on']('change:isEdit',(_0x11eaee,_0x1202f6,_0x24abf6)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x24abf6?(this['actions']['add'](_0x13ffbb),this['actions']['add'](_0x49271f),this['mainContent']['add'](_0x3bca68),_0x3bca68['element']['focus']()):(this['actions']['add'](_0x4a913f),this['actions']['add'](_0x2d3962),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x771444?'ck-ai-chat-history__item--active':'',_0x5c9644['if']('isVisible','ck-hidden',_0x3d3c50=>!_0x3d3c50),_0x5c9644['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',_0x5c9644['if']('loadingState','ck-hidden',_0x30bd71=>!!_0x30bd71)]},'children':_0x771444?[_0x58f3db]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x5c9644['if']('loadingState','ck-hidden',_0x895622=>!_0x895622)]},'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',_0x5c9644['if']('loadingState','ck-hidden',_0x19a0d6=>!!_0x19a0d6)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x5c9644['if']('loadingState','ck-hidden',_0x5de5e3=>!_0x5de5e3)]},'children':[{'text':_0x5c9644['to']('loadingState',_0x50ebda=>_0x50ebda?Xn(this['locale'],$i['LOADING_LABELS'][_0x50ebda]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x45747a]}]},{'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'](_0x3065c8){this['_titleView']['text']=Yt(_0x3065c8);}['updateLoadingState'](_0x8a381e,_0x15fc43){this['set']('loadingState',_0x15fc43?_0x8a381e:null);}['_createCheckView'](){const _0x3f74a6=new _0x8f03f4();return _0x3f74a6['set']({'content':_0x1ec62f}),_0x3f74a6;}['_createPinButtonView'](_0x3244e9){const _0x2518c0=new _0x47081d(_0x3244e9);return _0x2518c0['set']({'label':Xn(_0x3244e9,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x3f1b42,'withText':!0x1,'tooltip':!0x0}),_0x2518c0['bind']('isOn')['to'](this,'pinned'),_0x2518c0['on']('execute',()=>{const _0x586ecd=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x586ecd});}),_0x2518c0;}['_createMenuDropdownView'](){const _0x179fd8=_0x5ecbb1(this['locale'],_0x133381),_0xce1b68=_0x179fd8['panelView']['children'];_0x179fd8['buttonView']['set']({'label':Xn(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x5e549d}),_0x179fd8['panelPosition']='sw';const _0x2751f4=new _0x47081d(this['locale']);_0x2751f4['label']=Xn(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x2751f4['withText']=!0x0,_0x2751f4['on']('execute',()=>{this['isEdit']=!0x0;});const _0x475f51=new _0x47081d(this['locale']);_0x475f51['label']=Xn(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x475f51['withText']=!0x0,_0x475f51['on']('execute',()=>{this['showConfirm'](Xn(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x27836f=new _0x1832e1(this['locale']),_0x175318=new _0x55e39f(this['locale']);_0x175318['children']['add'](_0x2751f4);const _0x4d7589=new _0x55e39f(this['locale']);return _0x4d7589['children']['add'](_0x475f51),_0x27836f['items']['addMany']([_0x175318,_0x4d7589]),_0xce1b68['add'](_0x27836f),_0x179fd8;}['_createEditInputView'](_0x1dde72,_0x55c45e){const _0x4233d2=new _0x348772(_0x1dde72),_0x269c80=_0x4233d2['bindTemplate'];return _0x4233d2['value']=_0x55c45e,_0x4233d2['extendTemplate']({'on':{'keydown':_0x269c80['to'](_0x5e2f6d=>{'Enter'==_0x5e2f6d['key']&&this['_commitEditInputValue'](_0x4233d2);})}}),_0x4233d2;}['_createAcceptEditButtonView'](_0x47ca49,_0x1d3849){const _0xd05297=new _0x47081d(_0x47ca49);return _0xd05297['set']({'icon':_0x1ec62f,'withText':!0x1,'tooltip':Xn(_0x47ca49,'AI_CHAT_HISTORY_ACCEPT')}),_0xd05297['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0xd05297['on']('execute',()=>{this['_commitEditInputValue'](_0x1d3849);}),_0xd05297;}['_commitEditInputValue'](_0x40c518){const _0x392b6d=_0x40c518['element']['value']||'';this['_titleView']['text']=_0x392b6d,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x392b6d});}['_createCancelEditButtonView'](_0x44aa9c,_0x1db4bb){const _0x42af62=new _0x47081d(_0x44aa9c);return _0x42af62['set']({'icon':_0x435221,'withText':!0x1,'tooltip':Xn(_0x44aa9c,'AI_CHAT_HISTORY_CANCEL')}),_0x42af62['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x42af62['on']('execute',()=>{this['isEdit']=!0x1,_0x1db4bb['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x42af62;}['_createSpinnerView'](){const _0x1f8741=new Ve('tiny');return _0x1f8741['isVisible']=!0x0,_0x1f8741;}['isMatching'](_0x350753){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x350753)?{'title':!0x0}:null;}['highlightText'](_0x3d7801){this['_titleView']['highlightText'](_0x3d7801);}}class ct extends Bt{['searchView'];['errorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x17eabe,_0x5b34c9){super(_0x17eabe),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1);const _0x34704f=new _0x17e2c5(_0x17eabe,{'label':Xn(_0x17eabe,'AI_CHAT_HISTORY_HEADING'),'icon':at,'class':'ck-ai-header\x20ck-ai-header_history'});_0x5b34c9&&(this['resizeButton']=as(_0x17eabe,this),_0x34704f['children']['add'](this['resizeButton'])),this['sectionsView']=new Xi(_0x17eabe,[]),this['sectionsView']['delegate'](...cs)['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':[_0x34704f,{'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 _0x29be93=new _0x558367(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':Xn(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x35d601=>Xn(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x35d601),'secondary':Xn(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}});return _0x29be93['on']('render',()=>{this['searchView']['children']['add'](this['errorView'],0x1);}),_0x29be93['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0xca6117=>!_0xca6117)]}}),_0x29be93;}['_createSkeletonView'](){const _0x49ec89=new je(this['locale'],Le['aiHistory']);return _0x49ec89['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x16ca09=>!_0x16ca09)]}}),_0x49ec89;}['_createErrorView'](){const _0x11286e=new Bt(this['locale']),_0x278f3f=new _0x47081d(this['locale']);return _0x278f3f['set']({'withText':!0x1,'icon':_0x435221,'class':'ck-ai-chat-error__dismiss-button'}),_0x278f3f['bind']('isVisible')['to'](this,'hasItems',_0x336bf5=>!!_0x336bf5),_0x278f3f['on']('execute',()=>{this['errorMessage']='';}),_0x11286e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-error',this['bindTemplate']['if']('errorMessage','ck-hidden',_0x29d7bd=>!_0x29d7bd)]},'children':[{'tag':'p','children':[{'text':this['bindTemplate']['to']('errorMessage')}]},_0x278f3f]}),_0x11286e;}['_createEmptyStateView'](){const _0x31a47b=new _0x47081d(this['locale']);_0x31a47b['set']({'withText':!0x0,'label':Xn(this['locale'],'AI_CHAT_HISTORY_GO_TO_CHAT_BUTTON'),'class':'ck-ai-chat-history__open-chat-button'}),_0x31a47b['on']('execute',()=>{this['fire']('openChat');});const _0x467b38=new Bt(this['locale']);return _0x467b38['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x34165e=>!_0x34165e)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[Xn(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x31a47b]}),_0x467b38;}['_createListItemViews'](_0x1f496a,_0x1b1333){const _0x1f1a9b=[];for(const _0x469a68 of _0x1f496a){const _0x567383=new $i(_0x1b1333,_0x469a68);_0x567383['delegate'](...cs)['to'](this),_0x1f1a9b['push'](_0x567383);}return _0x1f1a9b;}['updateHistoryItemsWithCategories'](_0x2a8148){const _0xd653d0=this['locale']||'en',_0x4015f1=[];for(const _0x163f5f of _0x2a8148){const _0x720599=this['_createListItemViews'](_0x163f5f['items'],_0xd653d0);_0x4015f1['push'](new Zi(_0xd653d0,{'title':_0x163f5f['title'],'items':_0x720599}));}this['sectionsView']['sections']=_0x4015f1,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x4015f1),this['hasItems']=_0x2a8148['some'](_0x13d795=>_0x13d795['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x3e1627){for(const _0x1ab553 of this['sectionsView']['sections']){const _0x5a0595=_0x1ab553['getItem'](_0x3e1627);if(_0x5a0595){if(_0x1ab553['removeItem'](_0x5a0595),0x0===_0x1ab553['itemsViews']['length']){const _0x26a636=this['sectionsView']['sections']['indexOf'](_0x1ab553);-0x1!==_0x26a636&&(this['sectionsView']['sections']['splice'](_0x26a636,0x1),this['sectionsView']['items']['remove'](_0x1ab553));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x445045,_0x2eca63){for(const _0x4da780 of this['sectionsView']['sections']){const _0x1093c6=_0x4da780['getItem'](_0x445045);if(_0x1093c6){_0x1093c6['updateTitle'](_0x2eca63);break;}}}['updateItemLoadingState'](_0x13c7c9,_0x4935ac,_0x6ea618){for(const _0x1bb939 of this['sectionsView']['sections']){const _0x228c49=_0x1bb939['getItem'](_0x13c7c9);if(_0x228c49){_0x228c49['updateLoadingState'](_0x4935ac,_0x6ea618);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x46b389=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x46b389);}}}const cs=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class st extends _0x52a465{static get['requires'](){return[M];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3ecab4){super(_0x3ecab4);const _0x1c4ef5=this['context']['plugins']['get']('AITabs');this['_historyView']=new ct(this['context']['locale'],_0x1c4ef5['showResizeButton']),this['_historyView']['delegate'](...cs)['to'](this),_0x1c4ef5['view']['addTab']({'id':'history','buttonLabel':Xn(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':at,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x59a95f){this['_historyView']['removeHistoryItem'](_0x59a95f);}['updateItems'](_0x363c80){this['_historyView']['updateHistoryItemsWithCategories'](_0x363c80);}['updateItemTitle'](_0xc78c19,_0x2cf38c){this['_historyView']['updateItemTitle'](_0xc78c19,_0x2cf38c);}['updateItemLoadingState'](_0x35d3a0,_0xfc8e82,_0x1e213f){this['_historyView']['updateItemLoadingState'](_0x35d3a0,_0xfc8e82,_0x1e213f);}['setLoadingSkeleton'](_0x357217){this['_historyView']['isLoading']=_0x357217;}['showError'](_0x1fc0ac){this['_historyView']['errorMessage']=_0x1fc0ac;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x304195){this['_historyView']['isMaximized']=_0x304195;}}class De extends Jt(){['id'];['createdAt'];constructor({id:_0x4b9ad5,title:_0x1f9fdb,createdAt:_0x37a85b,updatedAt:_0xaa282f,pinned:_0x4f2ec8}){super(),this['id']=_0x4b9ad5,this['createdAt']=new Date(_0x37a85b),this['set']('title',_0x1f9fdb),this['set']('updatedAt',_0xaa282f?new Date(_0xaa282f):null),this['set']('pinned',_0x4f2ec8||!0x1);}['updateTitle'](_0x373628){this['set']('title',Yt(_0x373628)),this['updatedAt']=new Date();}['updatePinned'](_0x4bc110){this['set']('pinned',_0x4bc110),this['updatedAt']=new Date();}}class ht extends bt(){['items']=[];['connector'];['group'];constructor({connector:_0x37642e,group:_0x58fc10}){super(),this['connector']=_0x37642e,this['group']=_0x58fc10;}async['init'](){try{const _0x574933=this['connector']['fetchConversations'](this['group']),_0x4d7300=await _0x574933['getConversations']();this['loadItems'](_0x4d7300);}catch(_0x1637b3){this['fire']('error',{'error':_0x1637b3,'operation':'init'});}}['addItem'](_0x223470){this['items']['push'](_0x223470);}async['removeItem'](_0x216cb8){const _0x41f76e=this['items']['findIndex'](_0x39454f=>_0x39454f['id']===_0x216cb8);if(-0x1===_0x41f76e)return!0x1;try{return await this['connector']['deleteConversation'](_0x216cb8)['execute'](),this['items']['splice'](_0x41f76e,0x1),this['fire']('itemRemoved',{'itemId':_0x216cb8}),!0x0;}catch(_0x2fdfaa){return this['fire']('error',{'error':_0x2fdfaa,'operation':'removeItem','itemId':_0x216cb8}),!0x1;}}['getItem'](_0x1a1331){return this['items']['find'](_0x383f6b=>_0x383f6b['id']===_0x1a1331);}async['updateItemTitle'](_0x2682cc,_0x3e5da2){const _0x215557=this['getItem'](_0x2682cc);if(!_0x215557)return!0x1;try{return await this['connector']['updateConversation'](_0x2682cc,{'title':_0x3e5da2})['getResult'](),_0x215557['updateTitle'](_0x3e5da2),this['fire']('itemUpdated',{'itemId':_0x2682cc,'updates':{'title':_0x3e5da2}}),!0x0;}catch(_0x12f9e0){return this['fire']('error',{'error':_0x12f9e0,'operation':'updateItemTitle','itemId':_0x2682cc}),!0x1;}}async['updateItemPinned'](_0x40847b,_0x1c9736){const _0x4f3f53=this['getItem'](_0x40847b);if(!_0x4f3f53)return!0x1;try{return await this['connector']['updateConversation'](_0x40847b,{'pinned':_0x1c9736})['getResult'](),_0x4f3f53['updatePinned'](_0x1c9736),this['fire']('itemUpdated',{'itemId':_0x40847b,'updates':{'pinned':_0x1c9736}}),!0x0;}catch(_0x38906d){return this['fire']('error',{'error':_0x38906d,'operation':'updateItemPinned','itemId':_0x40847b}),!0x1;}}['loadItems'](_0x2d0f25){try{this['items']=[],_0x2d0f25['map'](_0x37964e=>{this['addItem'](new De(_0x37964e));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x493b98){this['fire']('error',{'error':_0x493b98,'operation':'loadItems'});}}['getItems'](_0x2c554a={}){const _0x4ece24=void 0x0!==_0x2c554a['pinned']&&_0x2c554a['pinned'],_0x1e9dc5=_0x2c554a['from']?new Date(_0x2c554a['from']['getFullYear'](),_0x2c554a['from']['getMonth'](),_0x2c554a['from']['getDate']()):null,_0x23dd6c=_0x2c554a['to']?new Date(_0x2c554a['to']['getFullYear'](),_0x2c554a['to']['getMonth'](),_0x2c554a['to']['getDate']()):null;return this['items']['filter'](_0x281cb2=>{if(_0x281cb2['pinned']!==_0x4ece24)return!0x1;if(_0x23dd6c){const _0x4f07e1=new Date(_0x281cb2['createdAt']['getFullYear'](),_0x281cb2['createdAt']['getMonth'](),_0x281cb2['createdAt']['getDate']());return _0x1e9dc5?_0x1e9dc5['getTime']()===_0x23dd6c['getTime']()?_0x4f07e1['getTime']()===_0x1e9dc5['getTime']():_0x4f07e1<_0x23dd6c&&_0x4f07e1>=_0x1e9dc5:_0x4f07e1<_0x23dd6c;}return!0x0;});}}class rt extends _0x52a465{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[e,x,st,M];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](e),this['_aiChatHistoryUi']=this['context']['plugins']['get'](st),this['_aiChatController']=this['context']['plugins']['get'](x);const _0x16a557=this['context']['plugins']['get'](M),_0x16b5ea=this['_aiChatController']['getGroupId']();this['history']=new ht({'connector':this['_aiConnector'],'group':_0x16b5ea}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x261393,_0x210cda)=>{this['_setItemLoading'](_0x210cda['id'],'remove'),this['_handleRemove'](_0x210cda['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x5641af,_0x3673c3)=>{this['_setItemLoading'](_0x3673c3['id'],'rename'),this['_handleEditTitle'](_0x3673c3['id'],_0x3673c3['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x376955,_0x368771)=>{void 0x0!==_0x368771['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x368771['itemId'],_0x368771['updates']['title']),void 0x0!==_0x368771['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x368771['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x55398e,_0x2f4d66)=>{this['_aiChatController']['handleRemovedConversation'](_0x2f4d66['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x2f4d66['itemId']),this['_clearItemLoading'](_0x2f4d66['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x617e4e,_0x5e09b6)=>{this['_handleHistoryErrorUI'](_0x5e09b6['error'],_0x5e09b6['operation'],_0x5e09b6['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0xca8525,_0x1676a0)=>{this['_handleSelectConversation'](_0x1676a0['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x402b98,_0x350fad)=>{const _0x3174c5=_0x350fad['pinned']?'pin':'unpin';this['_setItemLoading'](_0x350fad['id'],_0x3174c5),this['_handleTogglePin'](_0x350fad['id'],_0x350fad['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x16a557['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x16a557['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x16a557,'resizedTabs',(_0x440fe1,_0x3d4125)=>{this['_setIsMaximized'](_0x3d4125);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x16a557['resize']();});}async['_handleEditTitle'](_0x3b7f34,_0x410ebd){await this['history']['updateItemTitle'](_0x3b7f34,_0x410ebd);}async['_handleTogglePin'](_0x402962,_0x41431a){await this['history']['updateItemPinned'](_0x402962,_0x41431a);}async['_handleRemove'](_0x4773e6){await this['history']['removeItem'](_0x4773e6);}async['_handleSelectConversation'](_0x2a6bc6){await this['_aiChatController']['loadConversation'](_0x2a6bc6);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x3c4e65=this['_aiChatController']['activeConversation']?.['id'],_0x225acc=this['_getCategorizedItems']()['map'](_0x4b93b7=>({'title':_0x4b93b7['title'],'items':_0x4b93b7['items']['map'](_0xb512e5=>({'id':_0xb512e5['id'],'title':_0xb512e5['title']||Xn(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0xb512e5['createdAt'])['toLocaleDateString'](),'active':_0xb512e5['id']===_0x3c4e65,'pinned':_0xb512e5['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x225acc);}['_setItemLoading'](_0x335ab1,_0x6aec1b){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x335ab1,_0x6aec1b,!0x0);}['_clearItemLoading'](_0x5bbd2c){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x5bbd2c,null,!0x1);}['_handleHistoryErrorUI'](_0xa11edc,_0x19ac26,_0x3a3f0c){const _0x21d6f0=this['_generateErrorMessage'](_0x19ac26,_0x3a3f0c);this['_aiChatHistoryUi']['showError'](_0x21d6f0),_0x3a3f0c&&this['_clearItemLoading'](_0x3a3f0c),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x10bdcd,_0x49c6a9){const _0x5d3425=_0x49c6a9?this['history']['getItem'](_0x49c6a9):null,_0xacbc32=_0x5d3425?.['title']||Xn(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x10bdcd){case'updateItemTitle':return Xn(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0xacbc32);case'updateItemPinned':{const _0x3747a6=Xn(this['context']['locale'],_0x5d3425?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return Xn(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x3747a6,_0xacbc32]);}case'removeItem':return Xn(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0xacbc32);case'init':case'loadItems':return Xn(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return Xn(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x315035=new Date(),_0x2aacb0=new Date(_0x315035['getFullYear'](),_0x315035['getMonth'](),_0x315035['getDate']()),_0x2070ee=new Date(_0x2aacb0);_0x2070ee['setDate'](_0x2070ee['getDate']()-0x1);const _0x5e2c42=new Date(_0x2aacb0);_0x5e2c42['setDate'](_0x5e2c42['getDate']()-0xe);const _0x468c55=this['history']['getItems']({'pinned':!0x0}),_0x16ab8d=this['history']['getItems']({'from':_0x2aacb0,'to':_0x2aacb0}),_0x3aa2b3=this['history']['getItems']({'from':_0x2070ee,'to':_0x2070ee}),_0x4c1318=this['history']['getItems']({'from':_0x5e2c42,'to':_0x2070ee}),_0x3c536c=this['history']['getItems']({'to':_0x5e2c42}),_0x34e903=[];return _0x468c55['length']>0x0&&_0x34e903['push']({'title':Xn(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x468c55}),_0x16ab8d['length']>0x0&&_0x34e903['push']({'title':Xn(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x16ab8d}),_0x3aa2b3['length']>0x0&&_0x34e903['push']({'title':Xn(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x3aa2b3}),_0x4c1318['length']>0x0&&_0x34e903['push']({'title':Xn(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x4c1318}),_0x3c536c['length']>0x0&&_0x34e903['push']({'title':Xn(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x3c536c}),_0x34e903;}['_setIsMaximized'](_0x33654f){this['_aiChatHistoryUi']['setIsMaximized'](_0x33654f);}}class I extends _0x52a465{static get['requires'](){return[rt,st];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ca extends _0x52a465{static get['requires'](){return[x,a,v,I];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2ff6ec){super(_0x2ff6ec);const _0x4afa7f=_0x2ff6ec['config'];_0x4afa7f['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),_0x4afa7f['define']('ai.chat.models',{'defaultModelId':void 0x0,'modelSelectorAlwaysVisible':!0x0,'displayedModels':void 0x0});}async['addSelectionToChatContext'](){await this['context']['plugins']['get'](x)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](x)['startConversation']();}async['sendMessage']({message:_0x2d2649,quickActionData:_0x2b05f1}){await this['context']['plugins']['get'](x)['sendMessage']({'message':_0x2d2649,'quickActionData':_0x2b05f1});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](x)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](x)['focusPromptInput']();}}function f(_0x4d764c,_0x51dc8f,_0x3b3632){const t=_0x4d764c['t'];switch(_0x51dc8f){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.'},_0x3b3632);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});default:return _0x51dc8f;}}function Ct(_0x1813bf,_0x1b84a2,_0x22ff35=!0x1,_0x422449=!0x0){return()=>{const _0xd61e83=_0x1813bf['locale'],_0x45c27f=new _0x47081d(_0xd61e83),_0x1353e9=_0x45c27f['bindTemplate'];_0x45c27f['extendTemplate']({'on':{'mouseenter':_0x1353e9['to'](()=>{_0x45c27f['focus']();})}});const _0xaf12ec=_0x1b84a2['icon']??_0x1b84a2['parent']?.['icon'];return _0x45c27f['set']({'label':_0x1b84a2['displayedPrompt'],'withText':_0x22ff35,'role':'menuitem','icon':_0x422449?_0xaf12ec??_0x5a0951:void 0x0,'tooltip':!_0x22ff35}),_0x45c27f['on']('execute',()=>{_0x1813bf['editing']['view']['focus'](),_0x1813bf['commands']['execute']('aiQuickAction',_0x1b84a2);}),_0x45c27f;};}const ds='menu',ws='menuitem';class co extends Bt{['_bodyCollection'];['optionsListView'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();constructor(_0x1ec9f7,_0x429e23,_0x573f45,_0x5337dd){const _0x4d72b5=_0x1ec9f7['locale'];super(_0x4d72b5),this['_bodyCollection']=_0x5337dd;const _0x678726=this['_createListItems'](_0x1ec9f7,_0x429e23,_0x573f45);this['optionsListView']=new _0x1832e1(_0x4d72b5),this['optionsListView']['role']=ds,this['optionsListView']['items']['addMany'](_0x678726),this['focusTracker']=new Pt(),this['keystrokes']=new Ht(),this['_focusables']=_0x678726,this['focusCycler']=new Lt({'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':_0x4d72b5['uiLanguageDirection']},'children':[this['optionsListView']]});}['_createListItems'](_0xd39894,_0x4c0b55,_0x42990b){const _0x108a41=new _0x1b6214();return _0x4c0b55['forEach'](_0x6e2441=>{'actions'in _0x6e2441?_0x108a41['add'](this['_createActionGroupButton'](_0xd39894,_0x6e2441,_0x42990b)):_0x108a41['add'](this['_createActionButton'](_0xd39894,_0x6e2441));}),_0x108a41;}['_createActionButton'](_0x41fb66,_0x4911b6){const _0x30ef06=new _0x55e39f(this['locale']),_0x5acfa9=Ct(_0x41fb66,_0x4911b6,!0x0)();return _0x30ef06['children']['add'](_0x5acfa9),_0x30ef06;}['_createActionGroupButton'](_0xba1ae1,_0x447b27,_0x3dfbf5){const _0x462348=new _0x55e39f(this['locale']),_0x46d1c2=new _0x374933(this['locale']),_0x49ed54=_0x46d1c2['bindTemplate'],_0x457c0c='rtl'===_0x3dfbf5['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft',_0x259a3a=this['_createGroupActionsList'](_0xba1ae1,_0x447b27['actions'],_0x3dfbf5);_0x46d1c2['set']({'label':_0x447b27['label'],'withText':!0x0,'role':ws,'icon':_0x447b27['icon']??_0x5a0951}),_0x46d1c2['extendTemplate']({'on':{'mouseenter':_0x49ed54['to'](()=>{_0x46d1c2['focus']();})}});const _0x45ecc4=new _0x56f82c(this['locale']);return _0x45ecc4['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x49ed54['to'](_0x53bad3=>{_0x53bad3['key']==_0x457c0c&&(_0x46d1c2['focus'](),this['_hideNestedPanel'](_0x45ecc4));})}}),_0x46d1c2['bind']('isOn')['to'](_0x45ecc4,'isVisible'),this['_bodyCollection']['add'](_0x45ecc4),_0x45ecc4['content']['add'](_0x259a3a),this['_setupGroupMenuBehavior'](_0x46d1c2,_0x45ecc4),_0x462348['children']['add'](_0x46d1c2),_0x462348;}['_createGroupActionsList'](_0x1b0458,_0x505482,_0x3eccd8){const _0x12cdd8=new _0x1832e1(this['locale']);return _0x12cdd8['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x505482['forEach'](_0x2daf16=>{const _0x4f9ac7=new _0x55e39f(this['locale']),_0x29d5c7=Ct(_0x1b0458,_0x2daf16,!0x0,!0x1)();_0x4f9ac7['children']['add'](_0x29d5c7),_0x3eccd8['focusTracker']['add'](_0x29d5c7),_0x12cdd8['items']['add'](_0x4f9ac7);}),_0x12cdd8;}['_setupGroupMenuBehavior'](_0x2d75a4,_0x48b507){const _0x30e13d=_0x2d75a4['bindTemplate'],_0x30eebb='rtl'===_0x2d75a4['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';_0x2d75a4['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x30e13d['to'](()=>{this['_showNestedPanel'](_0x48b507,_0x2d75a4);}),'mouseleave':_0x30e13d['to'](_0x46274d=>{const _0x190a53=_0x46274d['relatedTarget'];this['_isMovingToNestedMenu'](_0x190a53,_0x48b507)||this['_hideNestedPanel'](_0x48b507);}),'keydown':_0x30e13d['to'](_0x526c52=>{_0x526c52['key']==_0x30eebb&&(this['_showNestedPanel'](_0x48b507,_0x2d75a4),_0x48b507['content']['get'](0x0)['focus']());})}}),_0x48b507['on']('render',()=>{_0x48b507['element']?.['addEventListener']('mouseleave',_0x1c15e7=>{const _0x9ff672=_0x1c15e7['relatedTarget'];_0x2d75a4['element']?.['contains'](_0x9ff672)||this['_isMovingToNestedMenu'](_0x9ff672,_0x48b507)||this['_hideNestedPanel'](_0x48b507);});});}['_showNestedPanel'](_0x273572,_0x58982b){this['_openNestedPanels']['forEach'](_0x184e9a=>{_0x184e9a!==_0x273572&&_0x184e9a['isVisible']&&_0x184e9a['hide']();}),_0x273572['show'](),_0x273572['pin']({'positions':[_0x517253['eastSouth']],'target':_0x58982b['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x273572);}['_hideNestedPanel'](_0x3ef295){_0x3ef295['hide'](),this['_openNestedPanels']['delete'](_0x3ef295);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x9a41c0=>_0x9a41c0['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x12c801,_0x1d1415){if(!_0x12c801)return!0x1;if(_0x1d1415['element']?.['contains'](_0x12c801))return!0x0;const _0x22df4b=_0x12c801;return _0x22df4b['closest']&&(null!==_0x22df4b['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x22df4b['closest']('.ck-ai-quick-actions-group-list')||null!==_0x22df4b['closest']('.ck-ai-quick-actions-group-button'));}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['optionsListView']['focus']();}}function Nt(_0x4ab1bb,_0x580ecc,_0x4689c1,_0x77b656){return()=>{const _0x597fa3=_0x4ab1bb['locale'],_0x4adbdc=_0x5ecbb1(_0x597fa3);_0x4adbdc['buttonView']['set']({'icon':_0x4689c1['icon']??_0x5a0951,'label':_0x4689c1['label'],'tooltip':!0x0}),_0x4adbdc['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x5531e1=new co(_0x4ab1bb,_0x580ecc,_0x4adbdc,_0x77b656);return _0x4adbdc['panelView']['children']['add'](_0x5531e1),_0x4adbdc;};}const xt='<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>',Ot='<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>',wt='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20extract\x20and\x20present\x20the\x20key\x20points\x20from\x20its\x20content.</task><rules>1.\x20Present\x20the\x20output\x20as\x20a\x20clear,\x20structured\x20list\x20(bullets\x20or\x20numbered).-\x20Each\x20point\x20should\x20be\x20concise\x20(one\x20sentence\x20or\x20less).-\x20Do\x20not\x20merge\x20distinct\x20ideas\x20into\x20one\x20bullet.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20extraction\x20style:-\x20If\x20it\x20is\x20descriptive\x20capture\x20the\x20main\x20attributes\x20or\x20features.-\x20If\x20it\x20is\x20argumentative\x20extract\x20the\x20main\x20claim\x20and\x20supporting\x20reasons\x20separately.-\x20If\x20it\x20is\x20narrative/story-like\x20extract\x20the\x20main\x20events\x20in\x20chronological\x20order.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20highlight\x20the\x20most\x20important\x20facts\x20or\x20numbers.-\x20If\x20it\x20is\x20instructional\x20list\x20the\x20steps\x20or\x20main\x20actions\x20in\x20simplified\x20form.-\x20If\x20it\x20provides\x20comparisons\x20extract\x20the\x20contrasted\x20items\x20and\x20their\x20differences/similarities.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20category\x20above\x20extract\x20the\x20main\x20ideas\x20in\x20plain,\x20short\x20statements.3.\x20Keep\x20the\x20list\x20between\x203–7\x20items\x20where\x20possible.-\x20If\x20the\x20text\x20is\x20very\x20short,\x20fewer\x20items\x20are\x20fine.-\x20If\x20it\x20is\x20very\x20long,\x20focus\x20on\x20the\x20most\x20important\x20ideas\x20only.4.\x20Do\x20not\x20copy\x20long\x20text\x20fragments\x20—\x20restate\x20in\x20simple\x20words.5.\x20Do\x20not\x20add\x20interpretation,\x20evaluation,\x20or\x20commentary\x20beyond\x20the\x20text.6.\x20Ensure\x20the\x20list\x20can\x20stand\x20alone\x20without\x20requiring\x20the\x20reader\x20to\x20see\x20the\x20original\x20document.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20key\x20points.8.\x20Your\x20key\x20points\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20extracted\x20key\x20points.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>';var It=function(_0x4d1614){return _0x4d1614['CHAT']='CHAT',_0x4d1614['ACTION']='ACTION',_0x4d1614['REVIEW']='REVIEW',_0x4d1614;}({}),wa=function(_0x45af19){return _0x45af19['CHAT']='AIChat',_0x45af19['ACTION']='AIActions',_0x45af19['REVIEW']='AIReviewMode',_0x45af19;}({});class gi extends _0x1b47de{static get['requires'](){return[St];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_prepareQuickActionsDefinition'](this['_getDefaultAndCustomActions']()),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x3262fd){return function(_0x48ee2a){const _0x278c81=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x48ee2a['uiLanguage']),_0x5b8add=_0x278c81||'English',_0x3257df=[{'id':'ask-ai','displayedPrompt':f(_0x48ee2a,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':pt},{'id':'chat-commands','label':f(_0x48ee2a,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':yt,'actions':[{'id':'explain','displayedPrompt':f(_0x48ee2a,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':xt['replace']('%0',_0x5b8add),'type':'CHAT'},{'id':'summarize','displayedPrompt':f(_0x48ee2a,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Ot['replace']('%0',_0x5b8add),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':f(_0x48ee2a,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':wt['replace']('%0',_0x5b8add),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':f(_0x48ee2a,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':_t},{'id':'continue','displayedPrompt':f(_0x48ee2a,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':gt},{'id':'fix-grammar','displayedPrompt':f(_0x48ee2a,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':ft},{'id':'adjust-length','label':f(_0x48ee2a,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':ut,'actions':[{'id':'make-shorter','displayedPrompt':f(_0x48ee2a,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':f(_0x48ee2a,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':f(_0x48ee2a,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':mt,'actions':[{'id':'make-tone-casual','displayedPrompt':f(_0x48ee2a,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':f(_0x48ee2a,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':f(_0x48ee2a,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':f(_0x48ee2a,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':f(_0x48ee2a,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':f(_0x48ee2a,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':kt,'actions':[{'id':'translate-to-english','displayedPrompt':f(_0x48ee2a,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':f(_0x48ee2a,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-french','displayedPrompt':f(_0x48ee2a,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':f(_0x48ee2a,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':f(_0x48ee2a,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':f(_0x48ee2a,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':f(_0x48ee2a,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':f(_0x48ee2a,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':f(_0x48ee2a,'AI_QUICK_ACTIONS_OTHER'),'icon':Tt,'actions':[]}];return _0x3257df;}(_0x3262fd);}['_getDefaultAndCustomActions'](){const _0x5c1476=gi['getDefaultQuickActions'](this['editor']['locale']),_0xf6f3ba=(this['editor']['config']['get']('ai.quickActions.extraCommands')||[])['map'](_0x3e0095=>({..._0x3e0095,'icon':void 0x0}));return _0x5c1476['find'](_0x56c0fd=>'other'===_0x56c0fd['id'])['actions']['push'](..._0xf6f3ba),_0x5c1476;}['_initializeQuickActionsComponentsAndCommands'](){const _0x1d659b=new Qt(this['editor']['locale']);_0x1d659b['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x1d659b),this['_initializeQuickActionsComponents'](_0x1d659b);}['_initializeQuickActionsDropdown'](_0x116d42){this['editor']['ui']['componentFactory']['add']('aiQuickActions',Nt(this['editor'],this['_quickActionsDefinition'],{'icon':_0x5a0951,'label':f(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},_0x116d42));}['_prepareQuickActionsDefinition'](_0x4af106){this['_quickActionsDefinition']=_0x4af106['map'](_0xf6839f=>{if('actions'in _0xf6839f){const _0x49e6a0=_0xf6839f;return{..._0x49e6a0,'actions':_0x49e6a0['actions']['map'](_0xc4a7ed=>{const {actions:_0x2936d3,..._0x1e917c}=_0x49e6a0;return{..._0xc4a7ed,'parent':_0x1e917c};})['filter'](_0x520c73=>this['_shouldIncludeAction'](_0x520c73))};}return _0xf6839f;})['filter'](_0x3c489f=>'actions'in _0x3c489f?_0x3c489f['actions']['length']>0x0:this['_shouldIncludeAction'](_0x3c489f));}['_shouldIncludeAction'](_0x29bfc0){const _0x3a22e9=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](wa[_0x29bfc0['type']])&&!_0x3a22e9['includes'](_0x29bfc0['id']);}['_initializeQuickActionsComponents'](_0xb1521b){this['_quickActionsDefinition']['forEach'](_0x317d02=>{if('actions'in _0x317d02){const _0x1ff94d=Nt(this['editor'],_0x317d02['actions'],_0x317d02,_0xb1521b);this['editor']['ui']['componentFactory']['add'](_0x317d02['id'],_0x1ff94d),_0x317d02['actions']['forEach'](_0x104749=>{const _0x30f36f=Ct(this['editor'],_0x104749);this['editor']['ui']['componentFactory']['add'](_0x104749['id'],_0x30f36f);});}else{const _0x4324c3=Ct(this['editor'],_0x317d02);this['editor']['ui']['componentFactory']['add'](_0x317d02['id'],_0x4324c3);}});}}class Ii extends At{['execute'](_0x47a6b1){switch(_0x47a6b1['type']){case It['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x5695fd=f(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x16a90e('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5695fd});}this['_handleAIChatAction'](_0x47a6b1);break;case It['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x46b962=f(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x16a90e('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x46b962});}this['_handleAIActionsAction'](_0x47a6b1);break;case It['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x5f25fe=f(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x16a90e('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5f25fe});}this['_handleAIReviewAction'](_0x47a6b1);}}async['_handleAIChatAction'](_0x2ffe2b){const _0x1a20f2=this['editor']['plugins']['get']('AIChat'),_0x292eee=this['editor']['plugins']['get']('AIChatController');if(this['editor']['plugins']['get']('AITabs')['view']['activateTab']('chat'),'ask-ai'===_0x2ffe2b['id'])_0x292eee['removeSelectionFromChatContext'](),this['_expandSelectionIfCollapsed'](),await _0x1a20f2['addSelectionToChatContext'](),_0x1a20f2['focusPromptInput']();else await _0x1a20f2['startConversation'](),await _0x1a20f2['addSelectionToChatContext'](),await _0x1a20f2['sendMessage']({'message':_0x2ffe2b['prompt']||_0x2ffe2b['displayedPrompt'],'quickActionData':{'id':_0x2ffe2b['id'],'displayedPrompt':_0x2ffe2b['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x2cd27e=this['editor'],_0x560d3d=_0x2cd27e['model']['document']['selection'];if(!_0x560d3d['isCollapsed'])return;const _0x1571fb=_0x3ac2df(_0x560d3d['getSelectedBlocks']())||_0x2cd27e['model']['schema']['getLimitElement'](_0x560d3d);_0x2cd27e['model']['change'](_0x5b0a0e=>{_0x5b0a0e['setSelection'](_0x1571fb,'in');});}['_handleAIActionsActionLabel'](_0x4989dd){return _0x4989dd['parent']?.['label']&&'other'!==_0x4989dd['parent']?.['id']?_0x4989dd['parent']['label']+':\x20'+_0x4989dd['displayedPrompt']:_0x4989dd['displayedPrompt'];}async['_handleAIActionsAction'](_0x2fd492){const _0x14b9c0=this['editor']['plugins']['get']('AIActions'),_0x3cd79f=_0x2fd492['prompt']?{'userMessage':_0x2fd492['prompt'],'model':_0x2fd492['model']}:{'actionName':_0x2fd492['actionName']||_0x2fd492['id'],'args':_0x2fd492['args']},_0x456a46=this['_handleAIActionsActionLabel'](_0x2fd492);await _0x14b9c0['executeAction'](_0x3cd79f,_0x456a46,_0x2fd492['icon']);}async['_handleAIReviewAction'](_0x4a92d){console['log']('handleAIReviewAction',_0x4a92d);}}class ki extends _0x1b47de{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x4402ef=this['editor'],_0x55ccac=new Ii(this['editor']);if(_0x4402ef['commands']['add']('aiQuickAction',_0x55ccac),_0x4402ef['plugins']['has']('AIChat')){const _0x181227=this['editor']['plugins']['get']('AIChat');_0x4402ef['model']['document']['selection']['on']('change:range',(_0x133d48,_0x2100c3)=>{_0x2100c3['directChange']&&_0x181227['removeSelectionFromChatContext']();});}}}class fa extends _0x1b47de{static get['requires'](){return[gi,ki];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xde9bb0){super(_0xde9bb0),_0xde9bb0['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[]});}}class zt extends de{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x4d783f=this['documentContextContent']['children']['map'](_0x345618=>({'node':_0x345618,'id':q(_0x345618,'data-id')})),_0x1af6c2=this['parsedMergedContent']['children']['map'](_0x3214e8=>({'node':_0x3214e8,'id':q(_0x3214e8,'data-id')||_0x206174()})),_0x44464e=_0x5947e4(_0x4d783f,_0x1af6c2,{'comparator':(_0x455f46,_0x3e85bf)=>_0x455f46['id']==_0x3e85bf['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x44464e['length']&&_0x44464e[_0x44464e['length']-0x1]['removed'];)_0x44464e['pop']();}const _0x4fca16=_0x44464e['map'](_0x657de8=>{const _0x1b01f9=_0x657de8['added']?'new':_0x657de8['removed']?'removed':'modified';return{'node':_0x657de8['value'][0x0]['node'],'type':_0x1b01f9,'id':_0x657de8['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x4fca16,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x352c4b,_0x5a00c9){return _0x5a00c9;}}class c extends jt{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];constructor(_0x347a52){super(_0x347a52),this['content']=_0x347a52['content'],this['version']=_0x347a52['version'],this['actionName']=_0x347a52['actionName'],this['args']=_0x347a52['args'],this['userMessage']=_0x347a52['userMessage'],this['model']=_0x347a52['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':Ft['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x3428b){const _0x54e37e=new zt({'editor':this['editor'],'documentContextContent':this['content'],..._0x3428b});return this['replies']['push'](_0x54e37e),_0x54e37e['delegate'](...qt)['to'](this),this['fire']('replyCreated',_0x54e37e),_0x54e37e;}}class Sa extends _0x1b47de{static get['requires'](){return[e,_0x4e4a90,a,m,_0x12f302];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_previousInteractions']=[];['_currentInteractionParams'];['_balloonShowDiff']=!0x1;['_customViews']=new _0x1b6214();['_promiseQueue'];constructor(_0x4bb008){super(_0x4bb008),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'](_0x52fd64,_0x3c7d10,_0xc920be){if(this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x21a396,anchorData:_0x247afe}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x52fd64,_0x21a396,_0x247afe,_0x3c7d10,_0xc920be);}}const {modelFragment:_0x4e4d07,anchorData:_0x2b3b21}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x52fd64,_0x4e4d07,_0x2b3b21,_0x3c7d10,_0xc920be);}['_getExecuteDataRegular'](){const _0x4b8427=this['editor']['model']['document']['selection'];if(_0x4b8427['isCollapsed']){const _0x4f3adb=_0x3ac2df(_0x4b8427['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x4b8427);this['editor']['model']['change'](_0x5a6872=>{_0x5a6872['setSelection'](_0x4f3adb,'in');});}const _0x4e41cb=_0x4b8427['getFirstRange'](),_0x5a95e5=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x4b8427),_0x4e41cb['start'],_0x4e41cb['end']),_0x916c8e=_0x4b8427['getFirstRange']()['start'],_0x1d3d74=new Map();let _0x98e758=_0x5a95e5;for(let _0x127574=0x0;_0x127574<_0x916c8e['path']['length'];_0x127574++)_0x1d3d74['set'](_0x98e758,_0x916c8e['path'][_0x127574]),_0x98e758=_0x98e758['getChild'](0x0);return{'modelFragment':_0x5a95e5,'anchorData':_0x1d3d74};}['_getExecuteDataInTable'](){const _0x24cb5f=this['editor']['model']['document']['selection'],_0x1d773a=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x3cae77=_0x24cb5f['getFirstRange']()['start']['parent']['parent'],_0x4515e1=this['_wrapWithCommonAncestors'](_0x1d773a,this['editor']['model']['createPositionBefore'](_0x3cae77),this['editor']['model']['createPositionAfter'](_0x3cae77)),_0x2c92c8=_0x24cb5f['getFirstRange']()['start'],_0x1a15b2=new Map();let _0x40d04a=_0x4515e1;for(let _0x5673fe=0x0;_0x5673fe<_0x2c92c8['path']['length'];_0x5673fe++)if(_0x1a15b2['set'](_0x40d04a,_0x2c92c8['path'][_0x5673fe]),_0x5673fe<_0x2c92c8['path']['length']-0x1)_0x40d04a=_0x40d04a['getChild'](0x0);else{let _0x9b7bf=_0x40d04a['nextSibling'];for(;_0x9b7bf;)_0x1a15b2['set'](_0x9b7bf,_0x2c92c8['path'][_0x5673fe]),_0x9b7bf=_0x9b7bf['nextSibling'];}return{'modelFragment':_0x4515e1,'anchorData':_0x1a15b2};}['_executeAction'](_0xa39cd1,_0x57df32,_0x1ed041,_0x495192,_0x4d6016){const _0x2f15c6=this['editor']['plugins']['get'](a),_0x3d4ea1=this['editor']['plugins']['get'](m),_0x1b3629=this['editor']['model']['document']['selection'],_0x153f7d=_0x2f15c6['modelToViewWithIds'](_0x57df32),_0x44fe53=this['editor']['data']['processor']['toData'](_0x153f7d),_0x4814a3=this['editor']['model']['document']['version'],_0x1d3f6e=[..._0x1b3629['getRanges']()],_0xca6c37=new o(this['editor']['locale'],{'showDiff':!0x1,'areActionsDisabled':!0x1,'hideHeader':!0x0,'showLoader':!0x0,'miniToolbarConfig':{'showChanges':'icon','customView':this['_customViews']},'showUnchangedParts':!0x0});return _0x3d4ea1['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x495192,'icon':_0x4d6016||_0x5a0951,'mainView':_0xca6c37,'showRotator':!0x1,'showApplyButton':!0x0,'showSuggestButton':!0x0,'ranges':_0x1d3f6e}),this['_setLoadingState'](_0xca6c37,_0x3d4ea1),this['listenTo'](_0x3d4ea1,'applySuggestion',()=>{this['_applyChanges'](_0x57df32,_0x1ed041,!0x1);}),this['listenTo'](_0x3d4ea1,'insertSuggestion',()=>{this['_applyChanges'](_0x57df32,_0x1ed041,!0x0);}),this['listenTo'](_0x3d4ea1,'dialogClosed',()=>{this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](_0x3d4ea1);}),this['_createInteraction'](_0x44fe53,_0x4814a3,_0xca6c37,_0x3d4ea1,_0xa39cd1);}['_wrapWithCommonAncestors'](_0x4ead9c,_0x3e74f6,_0x544d5d){const _0x5c500b=this['editor']['model']['createRange'](_0x3e74f6,_0x544d5d)['getCommonAncestor'](),_0x9b62af=_0x5c500b['is']('documentFragment')?[]:_0x5c500b['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x9b62af['length']){const _0x218579=_0x9b62af['map'](_0x370190=>_0x370190['_clone'](!0x1));for(let _0x248ce8=0x1;_0x248ce8<_0x218579['length'];_0x248ce8++)_0x218579[_0x248ce8-0x1]['_appendChild'](_0x218579[_0x248ce8]);return _0x218579[_0x218579['length']-0x1]['_appendChild'](_0x4ead9c),new _0x2cdf70(_0x218579[0x0]);}return _0x4ead9c;}async['_createInteraction'](_0x5be806,_0xf5ff33,_0x49f183,_0x3c83ad,_0x24af58){const _0xb7103b=this['editor'];this['_currentInteractionParams']={'action':_0x24af58,'content':_0x5be806,'version':_0xf5ff33,'mainView':_0x49f183,'aiBalloon':_0x3c83ad},this['_interaction']=new c({'connector':this['_aiConnector'],'editor':_0xb7103b,'content':_0x5be806,'version':_0xf5ff33,..._0x24af58});const _0x46012e=(_0x4f1a89,_0x572762,_0x5c9450=!0x1,_0x124bbd='streaming')=>this['_promiseQueue']['enqueue'](async _0x1565fe=>{try{const _0x300b5b=p({'editor':_0xb7103b,'changeGroups':_0x4f1a89['changeGroups'],'documentContextContent':_0x4f1a89['documentContextContent'],'showDiff':_0x5c9450,'trimUnchanged':!0x1});await _0x572762['updateContent']({'parts':_0x300b5b,'renderingStrategy':_0x124bbd,'abortSignal':_0x1565fe});}catch(_0x7562e0){if(this['_isAbortError'](_0x7562e0))return;throw _0x7562e0;}});this['_interaction']['on']('replyCreated',(_0x2e59ff,_0xc78bd4)=>{_0x49f183['hideLoader'](),_0x46012e(_0xc78bd4,_0x49f183)['catch'](_0x34b931=>{this['_isAbortError'](_0x34b931)||console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x34b931);});}),this['_interaction']['on']('replyContentUpdated',(_0x11a4a4,_0x166e32)=>{_0x46012e(_0x166e32,_0x49f183)['catch'](_0x98a343=>{this['_isAbortError'](_0x98a343)||console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x98a343);});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](_0x49f183,_0x3c83ad);}catch(_0x2726a2){this['_isAbortError'](_0x2726a2)||console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x2726a2);}}),this['listenTo'](_0x49f183,'toggleSuggestionDisplayMode',(_0x125c81,{showDiff:_0x52c6c7})=>{this['_balloonShowDiff']=_0x52c6c7;const _0x352c4c=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x352c4c&&_0x46012e(_0x352c4c,_0x49f183,_0x52c6c7,'static')['catch'](_0x4f4a26=>{this['_isAbortError'](_0x4f4a26)||console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x4f4a26);});}),this['_setLoadingState'](_0x49f183,_0x3c83ad);try{return await this['_interaction']['start']();}catch(_0x4c6bcb){if(this['_isAbortError'](_0x4c6bcb))return;throw _0x4c6bcb;}}['_applyChanges'](_0x340d5a,_0x5e8557,_0x9018ed){const _0x7ff64d=this['editor'],_0x3e86ec=this['editor']['plugins']['get'](_0x12f302),_0x1ff1ea=this['_interaction'],_0x533272=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x17a0db=_0x533272['changeGroups'];let _0xc083da=w({'editor':_0x7ff64d,'reply':_0x533272,'interaction':_0x1ff1ea,'groups':_0x17a0db,'transform':!0x1,'documentCompare':_0x3e86ec,'documentCompareOptions':{'anchor':_0x7ff64d['model']['createPositionAt'](_0x340d5a,0x0),'markDeletions':_0x9018ed}});_0xc083da=this['_filterOperationsOutsideRange'](_0xc083da,_0x5e8557);for(const _0x57f4bc of _0xc083da)this['_anchorOperation'](_0x5e8557,_0x57f4bc,_0x7ff64d['model']['document']['getRoot']());const _0x52f634=_0x1ff1ea['getDocumentContext']()['version'],_0xbca382=_0x7ff64d['model']['document']['history']['getOperations'](_0x52f634),_0xd6a5cf={'document':_0x7ff64d['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x1b936d=_0xa4dfae(_0xc083da,_0xbca382,_0xd6a5cf)['operationsA'];_0x7ff64d['model']['change'](_0x952560=>{if(_0x952560['setSelection'](_0x7ff64d['model']['document']['selection']['focus']),_0x9018ed)_0x7ff64d['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x1b936d);else{for(const _0x66faf4 of _0x1b936d)_0x66faf4['baseVersion']=_0x7ff64d['model']['document']['version'],_0x952560['batch']['addOperation'](_0x66faf4),_0x7ff64d['model']['applyOperation'](_0x66faf4);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x4d0709,_0x446d42){return _0x4d0709['filter'](_0x52887b=>{if('rename'==_0x52887b['type']){const _0x5ad2fa=_0x52887b['position']['nodeAfter'];return!_0x446d42['has'](_0x5ad2fa);}if(_0x52887b['type']['indexOf']('Attribute')>-0x1){const _0x4988a0=_0x52887b['range']['start']['nodeAfter'];return!_0x446d42['has'](_0x4988a0);}return!0x0;});}['_anchorOperation'](_0x21aff9,_0x426de8,_0x33113c){const _0x9dabd0=_0x426de8['clone']();for(const _0x30a0e8 in _0x426de8){const _0x1b09d4=_0x426de8[_0x30a0e8];_0x1b09d4 instanceof _0x429c60?_0x426de8[_0x30a0e8]=new _0x429c60(_0x14d03f(_0x1b09d4['start']),_0x14d03f(_0x1b09d4['end'])):_0x1b09d4 instanceof _0xa04684&&(_0x426de8[_0x30a0e8]=_0x14d03f(_0x1b09d4));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x9dabd0['type'])){if(_0x9dabd0['isDocumentOperation']=!0x1,_0x9dabd0['baseVersion']=null,'remove'==_0x9dabd0['type']){const _0x483414=_0x9dabd0['sourcePosition'],_0x47c4a8=_0x9dabd0['howMany'];new _0x11d81b(_0x483414,_0x47c4a8)['_execute']();}else _0x9dabd0['_execute']();}function _0x14d03f(_0xeca1e7){if('$graveyard'==_0xeca1e7['root']['rootName'])return _0xeca1e7;const _0x197aa6=[];let _0x301a71=_0xeca1e7['root'];for(let _0x1d18b5=0x0;_0x1d18b5<_0xeca1e7['path']['length'];_0x1d18b5++){const _0x419a84=_0x21aff9['get'](_0x301a71)||0x0;_0x197aa6[_0x1d18b5]=_0xeca1e7['path'][_0x1d18b5]+_0x419a84,_0x301a71=_0x301a71['getChildAtOffset'](_0xeca1e7['path'][_0x1d18b5]);}return new _0xa04684(_0x33113c,_0x197aa6,_0xeca1e7['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:_0x579d5f,content:_0x12a5b6,version:_0x4516c8,mainView:_0x129811,aiBalloon:_0x4067ef}=this['_currentInteractionParams'];this['_clearSuggestionContent'](_0x129811),_0x129811['showLoader'](),this['_createInteraction'](_0x12a5b6,_0x4516c8,_0x129811,_0x4067ef,_0x579d5f)['catch'](_0x223f23=>{this['_isAbortError'](_0x223f23)||console['error']('Error\x20refreshing\x20interaction:',_0x223f23);});}['_clearSuggestionContent'](_0x4bc22f){const _0x335770=_0x4bc22f['bodyView']['_children'];for(;_0x335770['length']>0x0;)_0x335770['remove'](_0x335770['first']);_0x4bc22f['bodyView']['hasPendingParts']=!0x1;}['_isAbortError'](_0xd38f7a){return!!_0xd38f7a['message']&&_0xd38f7a['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 _0x3e9e95=new _0x47081d(this['editor']['locale']);_0x3e9e95['set']({'icon':_0x47506c,'label':Xn(this['editor']['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x3e9e95['bind']('isEnabled')['to'](this,'isBusy',_0x393f4e=>!_0x393f4e),_0x3e9e95['on']('execute',()=>{this['_refreshInteraction']();}),this['_customViews']['add'](_0x3e9e95);}['_setLoadingState'](_0x15baba,_0x2464f1){_0x15baba['setLoading'](),_0x2464f1['balloonView']['setLoading'](),this['isBusy']=!0x0;}async['_clearLoadingState'](_0x3ab309,_0x4a6881){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,_0x3ab309['clearLoading'](),_0x4a6881['balloonView']['clearLoading']();}}class ms{['id'];['title'];['description'];['isParameterized'];['useArgs'];['options'];constructor({id:_0x3952d6,title:_0x3d287e,description:_0xc5e29d,isParameterized:_0x25b573,useArgs:_0x29c752,options:_0x2fc4d2}){this['id']=_0x3952d6,this['title']=_0x3d287e,this['description']=_0xc5e29d,this['isParameterized']=_0x25b573,this['useArgs']=_0x29c752,this['options']=_0x2fc4d2;}}class kr extends ms{['_models']=[];get['models'](){return this['_models'];}set['models'](_0x167e26){this['_models']=_0x167e26;}}class Ri extends Jt(){['_checks'];constructor(_0x1ec066){super(),this['_checks']=this['_mapCheckDefinitions'](_0x1ec066);}get['checks'](){return this['_checks'];}['getCheckById'](_0x2b8199){return this['checks']['find'](_0x16604f=>_0x16604f['id']===_0x2b8199);}['_mapCheckDefinitions'](_0x4c1aee){return _0x4c1aee['map'](_0x2d2376=>'custom'===_0x2d2376['id']?new kr(_0x2d2376):new ms(_0x2d2376));}}class vs extends bt(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0xd2af66,contentNew:_0x142add,contentInitial:_0x4ff49d,documentVersion:_0xb983eb}){super(),this['id']=_0xd2af66,this['contentNew']=_0x142add,this['contentInitial']=_0x4ff49d,this['documentVersion']=_0xb983eb;}}class gs extends Jt(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x2ff1c3,_0x5652ec,_0x568636){super(),this['id']=_0x2ff1c3,this['parent']=_0x568636,this['_data']=_0x5652ec,this['set']('isActivated',!0x1),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 Jt(){['id']=_0x206174();['_results']=new Map();['_changes']=[];['_documentData'];['_sourceCheck'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];constructor(_0x964748,_0x994edb,_0x538086,_0x38ac8d,_0x580e66){super(),this['_documentData']=_0x964748,this['_sourceCheck']=_0x994edb,this['_aiConnector']=_0x538086,this['_reviewParams']=_0x38ac8d,this['_reviewArgs']=_0x580e66,this['on']('change:status',(_0x7cf2c,_0x378a15,_0x315ee3)=>{this['fire']('reviewCheckRunUpdated',{'status':_0x315ee3,'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 _0x16c7fd=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x2e3894 of _0x16c7fd)'unmodified'!==_0x2e3894['data']['operation']&&('error'!==_0x2e3894['data']['operation']?this['_addReviewCheckResult'](_0x2e3894['data']['dataId'],_0x2e3894['data']['textDelta']):this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']?this['status']='unmodified':this['status']='ready');}catch(_0x207229){this['_currentError']=_0x207229,_0x207229 instanceof Error&&_0x207229['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'](_0x34b6f6,_0xb93112){const _0x225747=this['_results']['get'](_0x34b6f6);if(!_0x225747)return;const _0x1bdb54=[];_0xb93112['forEach']((_0x2be823,_0x2cb235)=>{const _0x5f23ed=new gs(_0x225747['id']+'-'+_0x2cb235,_0x2be823,_0x225747);_0x5f23ed['on']('change:status',()=>{'accepted'===_0x5f23ed['status']?this['fire']('reviewCheckResultAccepted',{'change':_0x5f23ed}):'rejected'===_0x5f23ed['status']&&this['fire']('reviewCheckResultRejected',{'change':_0x5f23ed});}),_0x5f23ed['on']('change:isActivated',()=>{_0x5f23ed['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x5f23ed}):this['fire']('reviewCheckResultDeactivated',{'change':_0x5f23ed});}),this['_changes']['push'](_0x5f23ed),_0x1bdb54['push'](_0x5f23ed);}),this['fire']('reviewCheckResultReady',{'changes':_0x1bdb54,'result':_0x225747,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x6c903f){const _0x4003cc=this['_changes']['find'](_0x170d0e=>_0x170d0e['id']===_0x6c903f);return!(!_0x4003cc||'active'!==_0x4003cc['status']);}['getActiveChanges'](){return this['_changes']['filter'](_0x36005e=>'active'===_0x36005e['status']);}['markAllChangesAsAccepted'](){for(const _0x164fa2 of this['_changes'])'active'===_0x164fa2['status']&&(_0x164fa2['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x30e404){const _0x55a784=this['_changes']['find'](_0x2a075b=>_0x2a075b['id']===_0x30e404);_0x55a784&&'active'===_0x55a784['status']&&(_0x55a784['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x5c505e){const _0x564608=this['_changes']['find'](_0xdbe178=>_0xdbe178['id']===_0x5c505e);_0x564608&&'active'===_0x564608['status']&&(_0x564608['status']='rejected'),this['_checkIfFinished']();}['activateChange'](_0x5185e7){this['_changes']['filter'](_0x531b27=>_0x531b27['isActivated']&&_0x531b27['id']!==_0x5185e7)['forEach'](_0xc3450c=>{_0xc3450c['isActivated']=!0x1;});const _0x174b92=this['_changes']['find'](_0x31e001=>_0x31e001['id']===_0x5185e7);_0x174b92&&(_0x174b92['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x3c0765=>_0x3c0765['isActivated'])['forEach'](_0x55084c=>{_0x55084c['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}['_addReviewCheckResult'](_0x2ec999,_0x2da1dd){const _0x3f2c8f=this['_documentData']['elements']['get'](_0x2ec999);if(!_0x3f2c8f)return;const _0x357b82=_0x3f2c8f['getContent']();if(_0x357b82===_0x2da1dd)return;const _0x5c4b11=new vs({'id':_0x2ec999,'contentInitial':_0x357b82,'contentNew':_0x2da1dd,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x5c4b11['id'],_0x5c4b11),this['fire']('reviewCheckResultAdded',{'result':_0x5c4b11,'source':this});}['_checkIfFinished'](){if('ready'!==this['status'])return;0x0===this['_changes']['filter'](_0x2d7fe7=>'active'===_0x2d7fe7['status'])['length']&&(this['status']='finished');}['_createApiRequest'](){throw new Error('Not\x20implemented.');}}class _i extends pr{get['title'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs'])return this['_sourceCheck']['title'];const _0x1bf8c7=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x4288b5=0x0;_0x4288b5<this['_reviewParams']['length'];_0x4288b5++){if(!this['_reviewParams'][_0x4288b5]||!this['_sourceCheck']['options'][_0x4288b5])continue;const _0x17a278=this['_sourceCheck']['options'][_0x4288b5],_0x5d6e85=_0x17a278['data']?.['find'](_0x4d1235=>_0x4d1235['id']===this['_reviewParams'][_0x4288b5]);_0x5d6e85&&_0x1bf8c7['push'](_0x5d6e85['label']);}return this['_sourceCheck']['title']+':\x20'+_0x1bf8c7['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 Ci extends pr{['_prompt'];['_model'];constructor(_0x380c29,_0x196630,_0x2d16ba,_0x184f02,_0x589263){super(_0x2d16ba,_0x184f02,_0x589263),this['_prompt']=_0x380c29,this['_model']=_0x196630;}get['title'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}}class Ei extends bt(){['_modelList']=[];['_connector'];constructor({connector:_0xf1a9d6}){super(),this['_connector']=_0xf1a9d6;}async['getAll'](){if(!this['_modelList']['length'])try{const _0x272a03=this['_connector']['getModels'](),_0x3df0a3=await _0x272a03['list']();this['_modelList']=_0x3df0a3['items'];}catch{}return this['_modelList'];}}const Mi=[{'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 ie extends _0x52a465{['_aiConnector'];['_aiReviewModeUi'];['_aiReviewModeEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_isDiffOn']=!0x1;['_changeActivationSource']=null;static get['requires'](){return[e];}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 _0x23dc70=this['context']['config']['get']('ai.reviewMode.translations');if(_0x23dc70){for(const _0x493e62 of Mi)'translate'===_0x493e62['id']&&(_0x493e62['options'][0x0]['data']=_0x23dc70);}const _0x176969=this['_translateReviewChecks'](Mi);this['_aiReviewCheckList']=new Ri(_0x176969);const _0x1ad8e5=this['_aiReviewCheckList']['checks']['find'](_0xadc470=>'custom'===_0xadc470['id']);if(_0x1ad8e5){const _0x51625b=await new Ei({'connector':this['_aiConnector']})['getAll']();_0x1ad8e5['models']=_0x51625b['map'](_0x49b4ac=>({..._0x49b4ac,'description':this['_getTranslationWithDefault']('AI_MODEL_DESCRIPTION_'+_0x49b4ac['id']['toUpperCase'](),_0x49b4ac['description'])}));}this['listenTo'](this['_aiReviewModeUi'],'getReviewCheckList',()=>{this['_aiReviewModeUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewModeUi'],'runReviewCheck',async(_0x475d93,_0x31095f)=>{const _0x37bd41=this['_aiReviewCheckList']['getCheckById'](_0x31095f['id']);if(_0x37bd41){this['_onDiffChange'](this['_isDiffOn']),_0x31095f['isCustom']?this['_currentReviewCheckRun']=new Ci(_0x31095f['args']['prompt'],_0x31095f['args']['model'],this['_aiReviewModeEditing']['getDocumentData'](),_0x37bd41,this['_aiConnector']):this['_currentReviewCheckRun']=new _i(this['_aiReviewModeEditing']['getDocumentData'](),_0x37bd41,this['_aiConnector'],_0x31095f['params'],_0x31095f['args']),this['_aiReviewModeUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x2fb091,_0x47b0f9)=>{'data'===_0x47b0f9['status']||'loading'===_0x47b0f9['status']?(this['_aiReviewModeEditing']['switchToReadOnly'](),this['_aiReviewModeUi']['showCheckRunResults'](_0x47b0f9)):'finished'===_0x47b0f9['status']?this['_aiReviewModeUi']['showReviewCompletedView']():'ready'===_0x47b0f9['status']?this['_aiReviewModeUi']['showActionsWhenResultIsReady']():'unmodified'===_0x47b0f9['status']?this['_aiReviewModeUi']['showNoChangesView']():'error-general'===_0x47b0f9['status']?this['_aiReviewModeUi']['showGeneralErrorView']():'error-chunk'===_0x47b0f9['status']?this['_aiReviewModeUi']['showChunkErrorView']():'aborted'===_0x47b0f9['status']&&(this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewModeRunLeave'](!0x0));}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x2a6b04,_0x146e08)=>{if(!this['_currentReviewCheckRun'])throw new _0x16a90e('aireviewmode-no-current-check-run',this);const _0x4e5de8=this['_aiReviewModeEditing']['diffContent'](_0x146e08['result']['contentInitial'],_0x146e08['result']['contentNew']);_0x146e08['source']['addResultChanges'](_0x146e08['result']['id'],_0x4e5de8);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x540245,_0x14270c)=>{for(const _0x4019a5 of _0x14270c['changes'])this['_aiReviewModeUi']['showCheckRunResult'](_0x4019a5);this['_aiReviewModeEditing']['markChangePositionInEditorContent'](_0x14270c['changes'],_0x14270c['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultAccepted',(_0x3714e4,_0x23992e)=>{this['_aiReviewModeUi']['updateChangeState'](_0x23992e['change']['id'],'accepted');}),this['_currentReviewCheckRun']['on']('reviewCheckResultRejected',(_0x5150d4,_0x5c5908)=>{this['_aiReviewModeUi']['updateChangeState'](_0x5c5908['change']['id'],'rejected');}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x50f440,_0x17b9f0)=>{this['_aiReviewModeUi']['setActiveStateInResults'](_0x17b9f0['change']['id']);const _0x2760d1=this['_aiReviewModeEditing']['getMarkerElementForChange'](_0x17b9f0['change']['id']);if(_0x2760d1){if('content'===this['_changeActivationSource']){const _0x1ef6a1=this['_aiReviewModeUi']['getChangeElement'](_0x17b9f0['change']['id']);_0x1ef6a1&&_0x9e88b7(_0x1ef6a1['closest']('.ck-ai-review-mode__check-run-result')||_0x1ef6a1);}else{if('panel'===this['_changeActivationSource']){const _0x5b4104={'target':_0x2760d1['domElement'],'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0};_0x4c3d16(_0x5b4104);}}this['_aiReviewModeUi']['showChangeBalloon'](_0x17b9f0['change'],_0x2760d1['domElement']);}}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_aiReviewModeUi']['resetActiveStateInResults']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x40d9aa){_0x40d9aa instanceof Error&&_0x40d9aa['message']['includes']('ai-request-aborted')||(_0x40d9aa instanceof _0x16a90e?this['_logError'](_0x40d9aa):this['_logError'](new _0x16a90e('aireviewmode-check-run-failed',this,{'error':_0x40d9aa})));}}else this['_logError'](new _0x16a90e('aireviewmode-source-check-not-found',this,{'checkId':_0x31095f['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 _0x2ec3e5=this['_currentReviewCheckRun']['getActiveChanges']();_0x2ec3e5['length']&&(this['_aiReviewModeEditing']['applyChange'](_0x2ec3e5['map'](_0x8ba0a4=>_0x8ba0a4['id'])),this['_currentReviewCheckRun']['markAllChangesAsAccepted']());}),this['listenTo'](this['_aiReviewModeUi'],'acceptChange',(_0x21d98a,_0x57c0cf)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x57c0cf['id'])&&(this['_aiReviewModeEditing']['applyChange']([_0x57c0cf['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x57c0cf['id']),this['_aiReviewModeUi']['hideChangeBalloon']());}),this['listenTo'](this['_aiReviewModeUi'],'dismissChange',(_0x4ea994,_0x7e8ac2)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x7e8ac2['id'])&&(this['_aiReviewModeEditing']['rejectChange'](_0x7e8ac2['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x7e8ac2['id']),this['_aiReviewModeUi']['hideChangeBalloon']());}),this['listenTo'](this['_aiReviewModeUi'],'toggleDiff',(_0x589306,_0x36d773)=>{this['_isDiffOn']=_0x36d773['on'],this['_onDiffChange'](this['_isDiffOn']);}),this['listenTo'](this['_aiReviewModeUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&await this['_currentReviewCheckRun']['restart']();}),this['listenTo'](this['_aiReviewModeUi'],'activateChange',(_0x18eec0,_0x19493b)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x19493b['id']));}),this['listenTo'](this['_aiReviewModeUi'],'deactivateChange',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['deactivateChange']();}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerClick',(_0x17c5cf,_0x1d8087)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x1d8087['changeId']));});}['_onReviewModeRunLeave'](_0x1579ba=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']=void 0x0),_0x1579ba&&this['_aiReviewModeUi']['showReviewCheckList'](),this['_aiReviewModeEditing']['clearAllMarkers'](),this['_aiReviewModeEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x366027=this['_aiReviewModeEditing']['getContentElement']();_0x366027&&(_0x366027['classList']['remove']('ck-ai-review-mode-diff'),_0x366027['classList']['remove']('ck-ai-review-mode-highlights'));}['_onDiffChange'](_0x1b300c){const _0x4e8fdf=this['_aiReviewModeEditing']['getContentElement']();_0x4e8fdf&&(_0x4e8fdf['classList']['remove']('ck-ai-review-mode-diff'),_0x4e8fdf['classList']['remove']('ck-ai-review-mode-highlights'),_0x4e8fdf['classList']['add'](_0x1b300c?'ck-ai-review-mode-diff':'ck-ai-review-mode-highlights'));}['_translateReviewChecks'](_0x46eb1e){return _0x46eb1e['map'](_0x1580dd=>{const _0x4f53fd='AI_REVIEW_CHECK_'+_0x1580dd['id']['toUpperCase']()['replaceAll']('-','_'),_0x4e8568={..._0x1580dd,'title':this['_getTranslationWithDefault'](_0x4f53fd+'_TITLE',_0x1580dd['title']),'description':this['_getTranslationWithDefault'](_0x4f53fd+'_DESCRIPTION',_0x1580dd['description'])};return _0x1580dd['options']&&(_0x4e8568['options']=_0x1580dd['options']['map'](_0x2e446c=>({..._0x2e446c,'label':this['_getTranslationWithDefault'](_0x4f53fd+'_OPTIONS_LABEL',_0x2e446c['label']||''),'data':_0x2e446c['data']?_0x2e446c['data']['map'](_0x29f2a1=>({..._0x29f2a1,'label':this['_getTranslationWithDefault'](_0x4f53fd+'_OPTIONS_DATA_'+_0x29f2a1['id']['toUpperCase'](),_0x29f2a1['label'])})):void 0x0}))),_0x4e8568;});}['_getTranslationWithDefault'](_0x331da9,_0x12586c){const _0x509cac=Xn(this['context']['locale'],_0x331da9);return _0x509cac===_0x331da9?_0x12586c:_0x509cac;}['_logError'](_0xea7636){_0x115ab9(_0xea7636['message']),this['_aiReviewModeUi']['showGeneralErrorView']();}}class vr extends Bt{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x297bf6,_0x94884a){super(_0x297bf6),this['_defaultValue']=_0x94884a['default']||(_0x94884a['data']['length']>0x0?_0x94884a['data'][0x0]['id']:''),this['_defaultLabel']=_0x94884a['data']['find'](_0x1dcf40=>_0x1dcf40['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x5ecbb1(this['locale']);const _0x393004=this['_prepareListOptions'](_0x94884a['data']);_0x41f204(this['_dropdownView'],_0x393004,{'role':'menu','ariaLabel':_0x94884a['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5a563c=>{_0x5a563c['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x5aa9e7=>{this['formValue']=_0x5aa9e7['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x5aa9e7['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'](_0x1f7d94=[]){const _0x249fe7=new _0x1eff7a();this['resetToDefault']();for(const _0x628b81 of _0x1f7d94){const _0x3ae46c=new _0xe58aa3({'label':_0x628b81['label'],'withText':!0x0,'role':'menuitemradio','id':_0x628b81['id'],'model':_0x628b81});_0x3ae46c['bind']('isOn')['to'](this,'formValue',_0x5480a0=>_0x5480a0===_0x3ae46c['id']);const _0x53ee4f={'type':'button','model':_0x3ae46c};_0x249fe7['add'](_0x53ee4f);}return _0x249fe7;}}class Ps extends _0x55e39f{['_formItem']=null;constructor(_0x7eb27a,_0x5ea3bc,_0x8e31ca){super(_0x7eb27a),this['argsKey']=_0x5ea3bc?.['argsKey'];if('dropdown'===_0x5ea3bc['formType'])this['_formItem']=new vr(this['locale'],_0x5ea3bc);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x1c29f9=new _0x16f521(this['locale'],{'children':[this['_formItem']],'class':[_0x8e31ca?'ck-form__row_with-submit':'']});_0x8e31ca&&_0x1c29f9['children']['add'](_0x8e31ca),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__form-item','ck-reset_all']},'children':[_0x1c29f9]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class Ss extends _0x2c08f2{static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0xc5e1ed){super(_0xc5e1ed),this['set']('isEmpty',!0x0),this['minRows']=Ss['MIN_ROWS'],this['maxRows']=Ss['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'](_0x27fa1a=>{_0x27fa1a['stopPropagation']();})}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();});}['setPlaceholderText'](_0x17b945){this['set']('placeholder',_0x17b945);}}class js extends Bt{['submitButtonView'];['cancelButtonView'];['promptInputView'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x24ea75,_0x529c33){super(_0x24ea75),this['_check']=_0x529c33,this['set']('prompt',''),this['set']('modelId',''),this['_defaultValue']=_0x529c33['models']&&_0x529c33['models']['length']>0x0?_0x529c33['models'][0x0]['id']:'',this['_defaultLabel']=_0x529c33['models']&&_0x529c33['models']['length']>0x0?_0x529c33['models'][0x0]['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),this['promptInputView']=new Ss(_0x24ea75),this['promptInputView']['bind']('value')['to'](this,'prompt'),this['promptInputView']['on']('input',()=>{this['prompt']=this['promptInputView']['element']['value'];}),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelSelectionDropdownItems']=new _0x1eff7a(),this['_setModelList'](),_0x41f204(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);const _0x45d267=new Bt(_0x24ea75);_0x45d267['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 _0x16f521(this['locale'],{'children':[this['promptInputView']]}),new _0x16f521(this['locale'],{'children':[_0x45d267]})]});}['resetToDefault'](){this['prompt']='',this['modelId']=this['_defaultValue'],this['_modelSelectionDropdown']['buttonView']['label']=this['_defaultLabel'];}['_createSubmitButtonView'](){const _0x766532=new _0x47081d(this['locale']),t=this['locale']['t'];return _0x766532['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x766532['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x4bea54=>{_0x4bea54['stopPropagation']();})}}),_0x766532['on']('execute',()=>{this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x766532;}['_createCancelButtonView'](){const _0x453923=new _0x47081d(this['locale']),t=this['locale']['t'];return _0x453923['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled'}),_0x453923['on']('execute',()=>{this['resetToDefault']();}),_0x453923;}['_setModelList'](){this['_modelSelectionDropdownItems']['clear']();const _0x31f3c8=this['_check']['models'];if(this['resetToDefault'](),_0x31f3c8?.['length'])for(const _0x343e3e of _0x31f3c8){const _0x2878cd=new _0xe58aa3({'label':_0x343e3e['name'],'withText':!0x0,'role':'menuitemradio','id':_0x343e3e['id'],'model':_0x343e3e});_0x2878cd['bind']('isOn')['to'](this,'modelId',_0x22a50d=>_0x22a50d===_0x343e3e['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x2878cd,'labelView':new Ts(this['locale'],_0x343e3e)});}}['_createModelSelectionDropdown'](){const _0x5cdcaf=_0x5ecbb1(this['locale']);return _0x5cdcaf['set']({'panelPosition':'se','class':'ck-ai-review-mode__check-list-item-model-dropdown'}),_0x5cdcaf['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x31e970=>{_0x31e970['stopPropagation']();})}}),_0x5cdcaf['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),this['listenTo'](_0x5cdcaf,'execute',_0x59643f=>{this['modelId']=_0x59643f['source']['model']['id'],_0x5cdcaf['buttonView']['label']=_0x59643f['source']['label'];}),_0x5cdcaf;}}class Ts extends _0x5d6c90{constructor(_0x45a14a,_0x2ac7a2){super();const _0x23b481=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x23b481['to']('style'),'id':_0x23b481['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-name']},'children':[{'text':_0x23b481['to']('text')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[{'text':_0x2ac7a2['description']}]}]}]});}}class Rs extends _0x55e39f{['_formItemsCollection']=new _0x1b6214();['_customCheckView']=null;constructor(_0x5498ac,_0x18bd5c,_0x3204d6){super(_0x5498ac),this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x18bd5c['isParameterized']);const _0x1ff714=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',_0x3effcb=>_0x3effcb),this['bindTemplate']['if']('isListItemRendered','ck-ai-review-mode__check-list-item_rendered',_0x390157=>_0x390157)],'style':{'--ck-ai-check-list-item-index':_0x3204d6}},'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':_0x18bd5c['title']}]},_0x1ff714]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-description']},'children':[{'text':_0x18bd5c['description']}]}]}]},..._0x18bd5c['isParameterized']?[this['_createParameterizedView'](_0x18bd5c)]:[],...'custom'===_0x18bd5c['id']?[this['_createCustomView'](_0x18bd5c)]:[]]}),this['on']('click',()=>{_0x18bd5c['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x18bd5c['id']});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x332a19({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x41f12a=>{_0x41f12a['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x1cba7d=new _0x8f03f4();return _0x1cba7d['content']=_0x2463da,_0x1cba7d['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-title-icon']}}),_0x1cba7d;}['_createParameterizedView'](_0x5a69c4){const _0x4f2c6d=new Bt(),_0x379bdd=this['_createFormView'](_0x5a69c4);return _0x4f2c6d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x23635e=>!_0x23635e)]},'children':[_0x379bdd]}),_0x4f2c6d;}['_createFormView'](_0x14b685){const _0xb9fdd6=new Bt(),_0x2c90fe=Array['isArray'](_0x14b685['options'])?_0x14b685['options']:[],_0x5fce8f=new _0x47081d(this['locale']),t=this['locale']['t'];_0x5fce8f['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x5fce8f['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xabb47a=>{_0xabb47a['stopPropagation']();})}}),_0x5fce8f['on']('execute',()=>{const _0x473987=[],_0x537687={};this['_formItemsCollection']['forEach'](_0x469743=>{_0x473987['push'](_0x469743['value']),_0x14b685['useArgs']&&_0x14b685['options']&&(_0x537687[_0x469743['argsKey']]=_0x469743['value']);}),this['fire']('runReviewCheck',{'id':_0x14b685['id'],'params':_0x473987['length']?_0x473987:void 0x0,'args':Object['keys'](_0x537687)['length']?_0x537687:void 0x0});});const _0x15889c=_0x2c90fe['length'];return _0x2c90fe['forEach']((_0x47ce83,_0x5138dd)=>{const _0xa33ee9=_0x5138dd===_0x15889c-0x1;this['_formItemsCollection']['add'](new Ps(this['locale'],_0x47ce83,_0xa33ee9?_0x5fce8f:null));}),_0xb9fdd6['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0xb9fdd6;}['_createCustomView'](_0x191df0){return this['_customCheckView']=new js(this['locale'],_0x191df0),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',_0x214845=>!_0x214845)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['_customCheckView'];}}class Ls extends _0x55e39f{['_checkViews'];constructor(_0x37935a){super(_0x37935a),this['_checkViews']=new _0x1b6214();const _0x6eb441=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list',_0x6eb441['if']('isVisible','ck-hidden',_0xc6d199=>!_0xc6d199)]},'children':this['_checkViews']});}['setChecks'](_0x4e2add){this['_checkViews']['clear']();for(const [_0x2bd994,_0x304d0b]of _0x4e2add['entries']()){const _0x52702f=new Rs(this['locale'],_0x304d0b,_0x2bd994);_0x52702f['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x52702f);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0xf1ff84 of this['_checkViews'])_0xf1ff84 instanceof Rs&&_0xf1ff84['resetToDefault']();}}class bs extends Bt{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];constructor(_0x16e69b,_0xf204ae){super(_0x16e69b),this['id']=_0xf204ae,this['set']('changeId',_0xf204ae),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),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']('activateChange',{'id':_0xf204ae,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x2ba58e=new Bt(this['locale']);return _0x2ba58e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-ai-review-mode__check-run-result-response']}}),_0x2ba58e;}['_createAcceptButtonView'](){const _0x43fd52=new _0x47081d(this['locale']);return _0x43fd52['set']({'label':Xn(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-result-accept-button'}),_0x43fd52['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x39497b=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x39497b['stopPropagation']();})}}),_0x43fd52;}['_createDismissButtonView'](){const _0x35b63e=new _0x47081d(this['locale']);return _0x35b63e['set']({'label':Xn(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-dismiss-button'}),_0x35b63e['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x1636bd=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x1636bd['stopPropagation']();})}}),_0x35b63e;}['_createInfoButtonView'](){const _0x551d09=new _0x47081d(this['locale']);return _0x551d09['set']({'label':Xn(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x37142b,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-info-button\x20ck-hidden'}),_0x551d09['bind']('isOn')['to'](this,'isInfoToggleOn',_0x5a7932=>_0x5a7932),_0x551d09['on']('execute',()=>{console['log']('Toggle\x20info\x20view'),this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x551d09;}}class Ws extends _0x55e39f{['_resultViews'];['resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];constructor(_0x17c1c7){super(_0x17c1c7),this['_resultViews']=new _0x1b6214(),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 Vi(_0x17c1c7),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 _0x493c80=this['_createCombinedSkeletonLoader'](),_0x4cc67b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run',_0x4cc67b['if']('isVisible','ck-hidden',_0x51d620=>!_0x51d620)]},'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',_0x46b1b4=>_0x46b1b4)]},'children':this['_resultViews']},_0x493c80]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x707ae9){const _0x5367c2=new bs(this['locale'],_0x707ae9['id']);_0x5367c2['delegate']('acceptChange','dismissChange','activateChange')['to'](this),this['_resultViews']['add'](_0x5367c2),_0x5367c2['resultResponseView']['element']['innerHTML']=_0x707ae9['contentDiffed'];}['hideResult'](_0x30a164){const _0x2cd1cb=this['_resultViews']['find'](_0x1ef4a8=>_0x1ef4a8['id']===_0x30a164);_0x2cd1cb&&(_0x2cd1cb['element']?.['classList']['add']('ck-ai-review-mode__check-run-result_removing'),_0x2cd1cb['element']?.['addEventListener']('animationend',()=>{this['_resultViews']['remove'](_0x2cd1cb),_0x2cd1cb['destroy']();},{'once':!0x0}));}['setTitle'](_0xf20f20){this['headerTitle']=_0xf20f20;}['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 _0x26034c=new Bt(this['locale']),_0x34d298=[];for(let _0x152ccf=0x0;_0x152ccf<0x10;_0x152ccf++){const _0x48c7ab=this['_createSkeletonLoader']();_0x48c7ab['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-run-skeleton-item']}}),_0x34d298['push'](_0x48c7ab);}return _0x26034c['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x4fee35=>!_0x4fee35)]},'children':_0x34d298}),_0x26034c;}['_createErrorView'](){const _0x57e21d=new Bt(this['locale']),_0x4ecea8=new _0x47081d(this['locale']),t=this['locale']['t'];return _0x57e21d['delegate']('retryReview')['to'](this),_0x4ecea8['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-error-retry-button'}),_0x4ecea8['on']('execute',()=>{this['fire']('retryReview');}),_0x57e21d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x238fb8=>!_0x238fb8),this['bindTemplate']['if']('errorType','ck-ai-review-mode__check-run-error-container_border-bottom',_0x13d2f2=>'chunk'===_0x13d2f2)]},'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',_0xc105a6=>'chunk'===_0xc105a6)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x15ec9f=>'general'!==_0x15ec9f)]},'children':[{'text':Xn(this['locale'],'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}]},{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x45e85f=>'chunk'!==_0x45e85f)]},'children':[{'text':Xn(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x4ecea8]}),_0x57e21d;}['_createCancelButtonView'](){const _0x1fb507=new _0x47081d(this['locale']);return _0x1fb507['set']({'label':Xn(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ai-chat-controls-loader__cancel-button'],'icon':_0x57f487}),_0x1fb507['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x4bccb4=>_0x4bccb4)]}}),_0x1fb507['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x1fb507;}['_createToggleDiffButtonView'](){const _0xc80b84=new _0x47081d(this['locale']);_0xc80b84['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0xc80b84['bind']('isEnabled')['to'](this,'isError',_0x2a11cd=>!_0x2a11cd),_0xc80b84['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x5e188f=>!_0x5e188f)]}});const _0x281bef=Xn(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x2d2d9b=Xn(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0xc80b84['bind']('isOn')['to'](this,'isToggleDiffOn',_0x2ec2e5=>_0x2ec2e5),_0xc80b84['bind']('icon')['to'](this,'isToggleDiffOn',_0x1dabf0=>_0x1dabf0?_0x1a689f:_0x78175e),_0xc80b84['bind']('label')['to'](this,'isToggleDiffOn',_0x2a5fc8=>_0x2a5fc8?_0x281bef:_0x2d2d9b),_0xc80b84['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0xc80b84;}['_createAcceptAllButtonView'](){const _0x411c2a=new _0x47081d(this['locale']);return _0x411c2a['set']({'label':Xn(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x411c2a['bind']('isEnabled')['to'](this,'isError',_0x48f939=>!_0x48f939),_0x411c2a['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai-review-mode__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x29dedd=>!_0x29dedd)]}}),_0x411c2a['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x411c2a;}['_createExitReviewButtonView'](){const _0x470dd0=new _0x47081d(this['locale']);return _0x470dd0['set']({'label':Xn(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x470dd0['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x27ed9a=>!_0x27ed9a)]}}),_0x470dd0['on']('execute',()=>{this['fire']('leaveReviewModeResultList');}),_0x470dd0;}['_createResultHeaderView'](){const _0x506547=new Bt(this['locale']),_0x179d52=new Ve();return _0x179d52['bind']('isVisible')['to'](this,'isResultReady',_0x2a3c85=>!_0x2a3c85),_0x506547['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':[_0x179d52,this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView']]}]}),_0x506547;}}class Gs extends _0x55e39f{['resultsHeader'];['_finishReviewButtonView'];constructor(_0x36f878){super(_0x36f878),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['resultsHeader']=this['_createResultHeaderView'](),this['set']('viewType','completed');const _0x1add3f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed',_0x1add3f['if']('isVisible','ck-hidden',_0x51497c=>!_0x51497c)]},'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':_0x1add3f['to']('viewType',_0x4cfa33=>Xn(_0x36f878,'completed'===_0x4cfa33?'AI_REVIEW_MODE_COMPLETED_TEXT':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'))}]}]}]});}['_createFinishReviewButtonView'](){const _0x1591bf=new _0x47081d(this['locale']);return _0x1591bf['set']({'label':Xn(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x1591bf['on']('execute',()=>{this['fire']('finishReview');}),_0x1591bf;}['_createResultHeaderView'](){const _0x2540e1=new Bt(this['locale']);return _0x2540e1['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':Xn(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x2540e1;}}class he extends Bt{['reviewModeHeader'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x3b7a1c){super(_0x3b7a1c),this['reviewModeHeader']=new _0x17e2c5(_0x3b7a1c,{'label':Xn(_0x3b7a1c,'AI_REVIEW_MODE'),'icon':_0xe3de91,'class':'ck-ai-header\x20ck-ai-header_review-mode'}),this['reviewCheckListView']=new Ls(_0x3b7a1c),this['reviewCheckListView']['delegate'](...Ms)['to'](this),this['reviewCheckResultsView']=new Ws(_0x3b7a1c),this['reviewCheckResultsView']['delegate'](...Ms)['to'](this),this['reviewCompletedView']=new Gs(_0x3b7a1c),this['reviewCompletedView']['delegate']('finishReview')['to'](this),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isLoading',!0x1),this['reviewCheckResultsView']['set']('isResultReady',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review-mode','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewModeHeader'],this['reviewCheckListView'],this['reviewCheckResultsView'],this['reviewCompletedView']]});}['showReviewCheckListView'](){this['reviewCheckListView']['resetAllParameterizedChecks'](),this['reviewCheckListView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1);}['showReviewCheckResultsView'](){this['hideActionsWhenResultIsReady'](),this['reviewCheckResultsView']['resetErrorState'](),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['clearResults'](),this['reviewCheckResultsView']['set']('isLoading',!0x0);}['addCheckRunResult'](_0x23e98d){this['reviewCheckResultsView']['addResult'](_0x23e98d),this['reviewCheckResultsView']['set']('isLoading',!0x1);}['showReviewCompletedView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('viewType','completed'),this['reviewCompletedView']['set']('isVisible',!0x0);}['showActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x0;}['showNoChangesView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('viewType','unmodified'),this['reviewCompletedView']['set']('isVisible',!0x0);}['hideActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x1;}['showGeneralErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class ae extends _0x56f82c{['resultItemView'];constructor(_0x156bde,_0x1fbf4e){super(_0x156bde),this['set']({'isVisible':!0x1,'position':'se','class':null,'top':0x0,'left':0x0}),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-reset'],'tabindex':'-1'}}),this['content']['add'](this['_createContentView']()),_0x1fbf4e['add'](this),_0x332a19({'emitter':this,'activator':()=>this['isVisible'],'contextElements':[this['element']],'callback':()=>{this['hideBalloon'](),this['deactivateChange']();}});}['updateContent'](_0x11fc16){this['resultItemView']['changeId']=_0x11fc16['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x11fc16['contentDiffed'];}['showBalloon'](_0x2ff414,_0x4c1160){this['updateContent'](_0x2ff414),this['show'](),this['pin']({'target':_0x4c1160});}['hideBalloon'](){this['hide'](),this['unpin']();}['deactivateChange'](){this['fire']('deactivateChange');}['_createContentView'](){const _0x4d3fd2=new Bt();return this['resultItemView']=new bs(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x4d3fd2['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai-review-mode-balloon-panel-suggestion']},'children':[{'tag':'p','attributes':{'class':['ck-ai-review-mode__suggestion-text']},'children':[this['resultItemView']]}]}),_0x4d3fd2;}}const Ms=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewModeResultList','activateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class re extends _0x52a465{['_reviewModeView'];['_reviewModeBalloonSuggestionItemView'];['_bodyCollection'];static get['requires'](){return[M];}static get['pluginName'](){return'AIReviewModeUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1b3f45){super(_0x1b3f45),this['_bodyCollection']=new Qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_reviewModeView']=new he(this['context']['locale']),this['_reviewModeView']['delegate'](...Ms)['to'](this),this['_reviewModeBalloonSuggestionItemView']=new ae(this['context']['locale'],this['_bodyCollection']),this['_reviewModeBalloonSuggestionItemView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x2422a7=this['context']['plugins']['get']('AITabs');_0x2422a7['view']['on']('activateTab',(_0x464b9c,_0x29bd48)=>{'reviewMode'===_0x29bd48?this['fire']('getReviewCheckList'):this['fire']('leaveReviewMode');}),_0x2422a7['view']['addTab']({'id':'reviewMode','buttonLabel':Xn(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0xe3de91,'order':0x0,'content':this['_reviewModeView']});}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x403d44){this['_reviewModeView']['reviewCheckListView']['hasChecks']()||this['_reviewModeView']['reviewCheckListView']['setChecks'](_0x403d44),this['_reviewModeView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x3bbb2f){_0x3bbb2f&&('error-general'!==_0x3bbb2f['status']?'error-chunk'!==_0x3bbb2f['status']?this['_reviewModeView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralErrorView']());}['showCheckRunResult'](_0x563220){this['_reviewModeView']['addCheckRunResult'](_0x563220);}['showGeneralErrorView'](){this['_reviewModeView']['showGeneralErrorView']();}['showChunkErrorView'](){this['_reviewModeView']['showChunkErrorView']();}['setCheckResultTitle'](_0x3042da){this['_reviewModeView']['reviewCheckResultsView']['setTitle'](_0x3042da);}['setActiveStateInResults'](_0x4ca388){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x414cdf=>{_0x414cdf['id']===_0x4ca388&&_0x414cdf['setItemAsActive']();});}['resetActiveStateInResults'](){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x35d191=>_0x35d191['setItemAsInactive']());}['updateChangeState'](_0x2b32af,_0x3c485d){'accepted'!==_0x3c485d&&'rejected'!==_0x3c485d||this['_reviewModeView']['reviewCheckResultsView']['hideResult'](_0x2b32af);}['showReviewCompletedView'](){this['_reviewModeView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_reviewModeView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_reviewModeView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_reviewModeView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x4f6db8,_0x3beeb7){this['_reviewModeBalloonSuggestionItemView']['showBalloon'](_0x4f6db8,_0x3beeb7);}['hideChangeBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideBalloon']();}['getChangeElement'](_0x538e4b){const _0x15902f=this['_reviewModeView']['reviewCheckResultsView']['getResults']()['find'](_0x7acaac=>_0x7acaac['id']===_0x538e4b);return _0x15902f?_0x15902f['element']:null;}['deactivateChange'](){this['_reviewModeBalloonSuggestionItemView']['deactivateChange']();}}const Mt='reviewmode-';class oe extends _0x52a465{static get['pluginName'](){return'AIReviewModeEditing';}static get['requires'](){return[_0x34535e,a];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_domEmitter'];['_eventEmitter'];constructor(_0x36c8ac){super(_0x36c8ac),this['_domEmitter']=new(Et())(),this['_eventEmitter']=new(bt())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x28075e=P(this['context']);_0x28075e['conversion']['for']('editingDowncast')['markerToElement']({'model':Mt+'insert','view':(_0x4a2ac1,{writer:_0x553930})=>{const _0x401eab=this['_markers']['get'](_0x4a2ac1['markerName']),_0x6236f7={'class':'ck-ai_review-mode-marker_add','data-marker-id':_0x4a2ac1['markerName']};return _0x553930['createUIElement']('span',_0x6236f7,function(_0x4d8cb1){const _0x2ff11c=this['toDomElement'](_0x4d8cb1);return _0x2ff11c['innerHTML']=_0x401eab?.['text']||'',_0x2ff11c;});}}),_0x28075e['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Mt+'remove-only','view':_0x51b917=>({'classes':'ck-ai_review-mode-marker_strikethrough','attributes':{'data-marker-id':_0x51b917['markerName']}})}),_0x28075e['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Mt+'remove-context','view':_0x537900=>({'classes':'ck-ai_review-mode-marker_underline','attributes':{'data-marker-id':_0x537900['markerName']}})}),_0x28075e['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Mt+'remove-text','view':_0x21622d=>({'classes':'ck-ai_review-mode-marker_hide','attributes':{'data-marker-id':_0x21622d['markerName']}})}),_0x28075e['conversion']['for']('dataDowncast')['markerToElement']({'model':Mt+'suggestion-context','view':(_0x186e7f,{writer:_0x2741e2})=>_0x2741e2['createRawElement']('span',{'class':'ck-ai_review-mode-marker_context-'+(_0x186e7f['isOpening']?'start':'end')})}),_0x28075e['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x2bb937,'view':Rt}),this['_domEmitter']['listenTo'](document,'click',(_0x511bb0,_0x1c2b42)=>{const _0x46a271=_0x1c2b42['target'],_0x384c49=this['_findMarkerElement'](_0x46a271);if(!_0x384c49)return;const _0x525fed=_0x384c49['getAttribute']('data-marker-id'),_0x1509ec=_0x525fed['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClick',{'markerId':_0x525fed,'changeId':_0x1509ec});});}['getDocumentData'](){const _0x5a96aa=this['context']['plugins']['get']('AIEditing'),_0x3e3875=P(this['context']),_0x2dca3a=_0x3e3875['model'],_0x79283=new _0x2cdf70();for(const _0x489262 of _0x2dca3a['document']['getRoot']()['getChildren']()){const _0x3287fd=_0x489262['_clone'](!0x0);_0x79283['_appendChild'](_0x3287fd);}for(const _0x2c1a25 of _0x2dca3a['markers'])_0x79283['markers']['set'](_0x2c1a25['name'],this['_changeRangeOwnerDocument'](_0x2c1a25['getRange']()['clone'](),_0x79283));const _0x578374=new Dt({'ignoreElementEnd':!0x0,'startPosition':_0x2dca3a['createPositionAt'](_0x79283,0x0)}),_0x3d1845=new Set(),_0x294a17=new Map();for(const {item:_0x14e0e9}of _0x578374){if(!_0x14e0e9['is']('$textProxy'))continue;const _0xcf2145=_0x14e0e9['parent'];if((!_0xcf2145||!_0xcf2145['is']('element','caption'))&&(_0xcf2145&&_0xcf2145['is']('element'))){let _0x21dae7=_0xcf2145['getAttribute'](_0x2bb937);_0x21dae7||(_0x21dae7=_0x5a96aa['_nextDataId'](_0x3d1845),_0xcf2145['_setAttribute'](_0x2bb937,_0x21dae7)),_0x3d1845['add'](_0x21dae7);const _0x13277f=this['_getTopElement'](_0xcf2145);_0x294a17['set'](_0x21dae7,{'path':_0xcf2145['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x13277f['_clone'](!0x0),_0x21dae7,_0x3e3875['data'])}),_0x578374['jumpTo'](_0x2dca3a['createPositionAfter'](_0xcf2145));}}return{'content':_0x3e3875['data']['processor']['toData'](_0x3e3875['data']['toView'](_0x79283)),'version':_0x3e3875['model']['document']['version'],'elements':_0x294a17};}['diffContent'](_0x1c405c,_0x1ee0af){const _0x12497f=P(this['context']),_0x5cd750=_0x12497f['data']['parse'](_0x1c405c,'$documentFragment'),_0x5bda85=_0x12497f['model']['createPositionAt'](_0x5cd750,0x0),_0x34f93a=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x1c405c,_0x1ee0af,{'anchor':_0x5bda85,'markDeletions':!0x0})['getOperations']()['filter'](_0x20a38e=>'insert'===_0x20a38e['type']||'marker'===_0x20a38e['type']&&_0x20a38e['name']['startsWith']('$markedRemove')),_0x27ef71=this['_groupAdjacentOperations'](_0x34f93a),_0x35a50f=[];let _0x20e10b=0x0;return _0x12497f['model']['change'](_0x12d7d5=>{for(let _0xa37df6=0x0;_0xa37df6<_0x27ef71['length'];_0xa37df6++){const _0x1b1006=_0x27ef71[_0xa37df6],_0x319157=_0x12d7d5['createDocumentFragment']();for(const _0x128bf4 of _0x5cd750['getChildren']())_0x12d7d5['append'](_0x128bf4['_clone'](!0x0),_0x319157);for(const _0xb4725f of _0x1b1006['operationsIsolated'])if('insert'===_0xb4725f['type']){const _0x458931=_0xb4725f;_0x458931['baseVersion']=null,_0x458931['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x458931,_0x319157),_0x12d7d5['batch']['addOperation'](_0xb4725f),_0x12497f['model']['applyOperation'](_0xb4725f);const _0x1bad9e='suggestion:insertion:id:authorId:'+_0x20e10b++,_0x32f7a5=_0x12497f['model']['createRange'](_0x458931['position'],_0x458931['position']['getShiftedBy'](_0x458931['howMany']));_0x319157['markers']['set'](_0x1bad9e,_0x32f7a5);}else{if('marker'===_0xb4725f['type']&&_0xb4725f['name']['startsWith']('$markedRemove')){const _0x28f542=_0xb4725f,_0x154236='suggestion:deletion:id:authorId:'+_0x20e10b++;this['_changeOperationOwnerDocument'](_0x28f542,_0x319157),_0x319157['markers']['set'](_0x154236,_0x28f542['newRange']);}}const _0x259f82=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x1b1006['operationsIsolated'][0x0]),_0x319157),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x1b1006['operationsIsolated'][_0x1b1006['operationsIsolated']['length']-0x1]),_0x319157));_0x319157['markers']['set'](Mt+'suggestion-context',new _0x429c60(_0x259f82['start'],_0x259f82['end'])),_0x35a50f['push']({..._0x1b1006,'context':this['_createGetContextFn'](_0x319157,_0x12497f['data'],{'ellipsisBefore':_0x259f82['hasContentBefore'],'ellipsisAfter':_0x259f82['hasContentAfter']}),'content':this['_createGetContentFn'](_0x319157,_0x12497f['data'])});}}),_0x35a50f;}['markChangePositionInEditorContent'](_0x4d3b02,_0x5b9c61){const _0x58e01f=_0x4d3b02[0x0]['parent']['id'],_0x262293=_0x5b9c61['elements']['get'](_0x58e01f);if(!_0x262293)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x58e01f);const _0x3db85c=_0x262293['path'],_0x465a72=P(this['context']),_0x48a7ce=_0x465a72['model']['document']['history']['getOperations'](_0x5b9c61['version']),_0x7d91f6=[];for(const _0x5a4ac1 of _0x4d3b02){const _0x5d9a44=_0x5a4ac1['operationsIsolated']['map'](_0x44788b=>this['_translateOperationToEditorContent'](_0x44788b,_0x3db85c,_0x465a72['model']['document']['getRoots']()[0x0]));if(!_0x5d9a44||!_0x5d9a44['length'])continue;const _0x5c88e5=_0x5d9a44['every'](_0x4c43db=>'marker'===_0x4c43db['type']&&_0x4c43db['name']['startsWith']('$markedRemove')),_0x1bdd65={'document':_0x465a72['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x547ff0=_0xa4dfae(_0x5d9a44,_0x48a7ce,_0x1bdd65)['operationsA'];for(const _0x4d4e66 of _0x547ff0)if('insert'===_0x4d4e66['type']){const _0x5c96e4=_0x4d4e66,_0x1aabf9=_0x5c96e4['nodes'];let _0x41e61a='';for(const _0x3751c4 of _0x1aabf9)_0x3751c4&&_0x3751c4['is']('model:$text')&&(_0x41e61a+=_0x3751c4['data']);_0x7d91f6['push']({'start':_0x5c96e4['position'],'end':_0x5c96e4['position'],'type':'insert','groupId':_0x5a4ac1['id'],'text':_0x41e61a});}else{if('marker'===_0x4d4e66['type']&&_0x4d4e66['name']['startsWith']('$markedRemove')){const _0x2669e8=_0x4d4e66;let _0x5b4da6='remove-text';if(_0x5c88e5){const _0x3d563c=this['_findAdjacentContextDistance'](_0x2669e8['newRange']['start'],'backward',_0x465a72['model']['schema']),_0x54a0eb=this['_findAdjacentContextDistance'](_0x2669e8['newRange']['end'],'forward',_0x465a72['model']['schema']);if(_0x3d563c||_0x54a0eb){const _0x37dc75=_0x2669e8['newRange']['start']['getShiftedBy'](-_0x3d563c),_0x5da2ca=_0x2669e8['newRange']['end']['getShiftedBy'](_0x54a0eb);_0x7d91f6['push']({'start':_0x37dc75,'end':_0x5da2ca,'groupId':_0x5a4ac1['id'],'type':'remove-context'});}else _0x5b4da6='remove-only';}_0x7d91f6['push']({'start':_0x2669e8['newRange']['start'],'end':_0x2669e8['newRange']['end'],'groupId':_0x5a4ac1['id'],'type':_0x5b4da6});}}}this['_insertMarkers'](_0x7d91f6);}['clearAllMarkers'](){P(this['context'])['model']['change'](_0x4ef830=>{for(const _0x21a2b1 of this['_markers']['keys']())_0x4ef830['removeMarker'](_0x21a2b1);}),this['_markers']['clear']();}['switchToReadOnly'](){P(this['context'])['enableReadOnlyMode']('ai-review-mode');}['switchToEdit'](){P(this['context'])['disableReadOnlyMode']('ai-review-mode');}['applyChange'](_0xda4771){const _0x26d027=P(this['context']),_0x72d493=_0x26d027['model'],_0x59af1b=_0xda4771['map'](_0x27be69=>this['_getMarkersDataForGroup'](_0x27be69))['flat']();_0x72d493['change'](_0x34a953=>{for(const _0x476dd1 of _0x59af1b){const _0x5e1299=_0x26d027['model']['markers']['get'](_0x476dd1['id']);_0x5e1299&&('insert'===_0x476dd1['type']?_0x72d493['insertContent'](_0x34a953['createText'](_0x476dd1['text']||''),_0x5e1299['getRange']()['start']):'remove-text'!==_0x476dd1['type']&&'remove-only'!==_0x476dd1['type']||_0x72d493['deleteContent'](_0x72d493['createSelection'](_0x5e1299['getRange']())),_0x34a953['removeMarker'](_0x476dd1['id']),this['_markers']['delete'](_0x476dd1['id']));}});}['rejectChange'](_0x18461e){const _0x63409b=P(this['context']),_0xd75e94=this['_getMarkersDataForGroup'](_0x18461e);_0x63409b['model']['change'](_0x1d4143=>{for(const _0x4a550c of _0xd75e94)_0x1d4143['removeMarker'](_0x4a550c['id']),this['_markers']['delete'](_0x4a550c['id']);});}['getContentElement'](){const _0x18dd5a=P(this['context']);return _0x18dd5a&&_0x18dd5a['ui']&&_0x18dd5a['ui']['element']?_0x18dd5a['ui']['element']:null;}['getMarkerElementForChange'](_0x5e209c){const _0x1b8481=Array['from'](this['_markers']['values']())['filter'](_0x19b089=>_0x19b089['groupId']===_0x5e209c);if(!_0x1b8481['length'])return null;const _0x439024=0x1===_0x1b8481['length']?_0x1b8481[0x0]:this['_sortMarkers'](_0x1b8481)[0x0],_0x3d34a2=P(this['context']),_0x1581ce=_0x3d34a2['model']['markers']['get'](_0x439024['id']);if(!_0x1581ce)return null;const _0x5968a9=_0x1581ce['getRange'](),_0x372f67=_0x3d34a2['editing']['view']['getDomRoot']();if(!_0x372f67||!_0x5968a9)return null;const _0x327115=_0x372f67['querySelector']('[data-marker-id=\x22'+_0x439024['id']+'\x22]');return _0x327115?{'modelRange':_0x5968a9,'domElement':_0x327115}:null;}['_translateOperationToEditorContent'](_0x31c5d6,_0x4d0c74,_0x4c1730){if('insert'===_0x31c5d6['type']){const _0x3df6c0=_0x31c5d6;return new vt(this['_changePosition'](_0x3df6c0['position'],_0x4d0c74['concat'](_0x3df6c0['position']['offset']),_0x4c1730),_0x3df6c0['nodes'],_0x3df6c0['baseVersion']);}if('marker'===_0x31c5d6['type']&&_0x31c5d6['name']['startsWith']('$markedRemove')){const _0x4ffe03=_0x31c5d6;return new $t(_0x4ffe03['name'],_0x4ffe03['oldRange'],this['_changeRange'](_0x4ffe03['newRange'],_0x4d0c74['concat'](_0x4ffe03['newRange']['start']['offset']),_0x4d0c74['concat'](_0x4ffe03['newRange']['end']['offset']),_0x4c1730),_0x4ffe03['_markers'],_0x4ffe03['affectsData'],_0x4ffe03['baseVersion']);}return _0x31c5d6;}['_groupAdjacentOperations'](_0x2ea1b0){if(!_0x2ea1b0['length'])return[];const _0x241a45=[];let _0x2c5afe=0x0,_0x4520e5=0x0,_0x2091af=[];for(let _0x22dd30=0x0;_0x22dd30<=_0x2ea1b0['length'];_0x22dd30++){const _0x3e1c6c=_0x2ea1b0[_0x22dd30],_0x1b7037=_0x2ea1b0[_0x22dd30-0x1];!_0x3e1c6c||_0x1b7037&&!this['_getOperationEnd'](_0x1b7037)['isTouching'](this['_getOperationStart'](_0x3e1c6c))?(_0x241a45['push']({'operations':_0x2091af,'operationsIsolated':_0x2091af['map'](_0x19fbca=>this['_shiftOperation'](_0x19fbca['clone'](),-_0x4520e5)),'groupOffset':_0x2c5afe}),_0x2091af=_0x3e1c6c?[_0x3e1c6c]:[],_0x4520e5+=_0x2c5afe,_0x2c5afe=0x0):_0x2091af['push'](_0x3e1c6c),_0x3e1c6c&&'insert'===_0x3e1c6c['type']&&(_0x2c5afe+=_0x3e1c6c['howMany']);}return _0x241a45;}['_findAdjacentContextDistance'](_0x1e324f,_0x291235,_0x19c108,_0x4ec0c8=0x1){const _0x3cba08=new Dt({'startPosition':_0x1e324f,'direction':_0x291235});let _0x5db5a7=0x0;for(let _0x16ce8b=0x0;_0x16ce8b<_0x4ec0c8;_0x16ce8b++){let _0x1bca21=0x0,_0x157707=!0x1,_0x445021='forward'===_0x291235?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x5973df}of _0x3cba08)if(_0x5973df['is']('$textProxy')){const _0x1c7610=_0x445021['exec'](_0x5973df['data']);if(_0x1c7610&&_0x1c7610['length']){if(_0x1bca21+='forward'===_0x291235?_0x1c7610['index']+_0x1c7610[0x0]['length']:_0x5973df['data']['length']-_0x1c7610['index'],_0x1c7610[0x0]['length']!==_0x5973df['data']['length'])break;_0x157707=!0x0,_0x445021='forward'===_0x291235?/^\w+/:/\w+$/;}else{if(_0x157707)break;_0x1bca21+=_0x5973df['offsetSize'];}}else{if(_0x5973df['is']('element')){_0x19c108['isInline'](_0x5973df)&&!_0x157707&&(_0x1bca21+=0x1);break;}}_0x5db5a7+=_0x1bca21,_0x3cba08['jumpTo'](_0x1e324f['getShiftedBy']('forward'===_0x291235?_0x5db5a7:-_0x5db5a7));}return _0x5db5a7;}['_getChangeContext'](_0x1c37da,_0x2c3a7a){const _0x295930=P(this['context'])['model']['schema'],_0x93074f=this['_findAdjacentContextDistance'](_0x1c37da,'backward',_0x295930,0x6),_0x1d98f2=this['_findAdjacentContextDistance'](_0x2c3a7a,'forward',_0x295930,0x6),_0x33588b=_0x1c37da['getShiftedBy'](-_0x93074f),_0x1870c7=_0x2c3a7a['getShiftedBy'](_0x1d98f2);return{'start':_0x33588b,'end':_0x1870c7,'hasContentBefore':!_0x33588b['isAtStart'],'hasContentAfter':!_0x1870c7['isAtEnd']};}['_insertMarkers'](_0x2fc0d8){const _0x2ff5b2=this['context']['plugins']['get']('AIEditing'),_0x32deb7=new Set();P(this['context'])['model']['change'](_0x5d6e27=>{for(const _0x524012 of _0x2fc0d8){const _0xde7c7a=''+Mt+_0x524012['type']+':'+_0x524012['groupId']+'_'+_0x2ff5b2['_nextDataId'](_0x32deb7);this['_markers']['set'](_0xde7c7a,{'id':_0xde7c7a,'groupId':_0x524012['groupId'],'type':_0x524012['type'],'text':_0x524012['text']}),_0x5d6e27['addMarker'](_0xde7c7a,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5d6e27['createRange'](_0x524012['start'],_0x524012['end'])});}});}['_createGetContextFn'](_0x139499,_0x4c8969,_0x105af5){let _0x5729bb='';return()=>{if(!_0x5729bb){const _0x6432cf=_0x4c8969['toView'](_0x139499,{'showSuggestionHighlights':!0x0}),_0x2f0523=_0x6432cf['getChild'](0x0);if(!_0x2f0523)return'';let _0x27ae49=!0x1;const _0x12280c=[];for(const _0x3e9bd5 of _0x2f0523['getChildren']())_0x3e9bd5['is']('element','span')&&_0x3e9bd5['hasClass']('ck-ai_review-mode-marker_context-end')&&(_0x27ae49=!0x1),_0x27ae49&&_0x12280c['push'](_0x3e9bd5),_0x3e9bd5['is']('element','span')&&_0x3e9bd5['hasClass']('ck-ai_review-mode-marker_context-start')&&(_0x27ae49=!0x0);_0x2f0523['_removeChildren'](0x0,_0x2f0523['childCount']),_0x105af5?.['ellipsisBefore']&&_0x2f0523['_appendChild']('…'),_0x2f0523['_appendChild'](_0x12280c),_0x105af5?.['ellipsisAfter']&&_0x2f0523['_appendChild']('…');const _0x476750=_0x4c8969['htmlProcessor']['domConverter']['viewToDom'](_0x6432cf),_0x566721=_0x4c8969['htmlProcessor']['htmlWriter']['getHtml'](_0x476750);_0x5729bb=_0x566721;}return _0x5729bb;};}['_createGetContentFn'](_0x339b57,_0x48b8dc){let _0x1c84bb='';return()=>(_0x1c84bb||(_0x1c84bb=_0x48b8dc['stringify'](_0x339b57,{'showSuggestionHighlights':!0x0})),_0x1c84bb);}['_createGetContentUsingDataIdFn'](_0x507050,_0x506e74,_0x3e41a7){let _0x176099='';return()=>{if(!_0x176099){const _0x50cb41=_0x3e41a7['toView'](new _0x2cdf70(_0x507050)),_0x4cfa18=_0x3e41a7['htmlProcessor']['domConverter']['viewToDom'](_0x50cb41)['querySelector']('[data-id=\x22'+_0x506e74+'\x22]');_0x176099=_0x4cfa18?.['outerHTML']||'';}return _0x176099;};}['_findMarkerElement'](_0x33ceca,_0x2a760c=0x5){let _0x4478a1=_0x33ceca,_0x3e1347=null;for(let _0x3f4319=0x0;_0x3f4319<_0x2a760c&&_0x4478a1;_0x3f4319++){if(!_0x4478a1['className']){_0x4478a1=_0x4478a1['parentElement'];continue;}if(!(''+_0x4478a1['className'])['includes']('ck-ai_review-mode-marker_')){_0x4478a1=_0x4478a1['parentElement'];continue;}if(!_0x4478a1['getAttribute']('data-marker-id'))break;_0x3e1347=_0x4478a1;break;}return _0x3e1347;}['_getMarkersDataForGroup'](_0xd0d45a){return Array['from'](this['_markers']['values']())['filter'](_0x4e57bb=>_0x4e57bb['groupId']===_0xd0d45a);}['_getOperationStart'](_0xb464b6){return'insert'===_0xb464b6['type']?_0xb464b6['position']:_0xb464b6['newRange']['start'];}['_getOperationEnd'](_0x20315b,_0xef0a8d=!0x1){return'insert'===_0x20315b['type']?_0xef0a8d?_0x20315b['position']:_0x20315b['position']['getShiftedBy'](_0x20315b['howMany']):_0x20315b['newRange']['end'];}['_shiftOperation'](_0x485170,_0xca9cef){return'insert'===_0x485170['type']?_0x485170['position']=_0x485170['position']['getShiftedBy'](_0xca9cef):'marker'===_0x485170['type']&&_0x485170['newRange']&&(_0x485170['newRange']=new _0x429c60(_0x485170['newRange']['start']['getShiftedBy'](_0xca9cef),_0x485170['newRange']['end']['getShiftedBy'](_0xca9cef))),_0x485170;}['_changeOperationOwnerDocument'](_0x8b0911,_0x1aa0b5){'insert'===_0x8b0911['type']?_0x8b0911['position']=this['_changePositionOwnerDocument'](_0x8b0911['position'],_0x1aa0b5):'marker'===_0x8b0911['type']&&_0x8b0911['newRange']&&(_0x8b0911['newRange']=this['_changeRangeOwnerDocument'](_0x8b0911['newRange'],_0x1aa0b5));}['_changePositionOwnerDocument'](_0x358ecb,_0x281e3a){return new _0xa04684(_0x281e3a,_0x358ecb['path']);}['_changeRangeOwnerDocument'](_0x489983,_0x56a445){return new _0x429c60(this['_changePositionOwnerDocument'](_0x489983['start'],_0x56a445),this['_changePositionOwnerDocument'](_0x489983['end'],_0x56a445));}['_changePosition'](_0xe9d649,_0x250721,_0x590a5d){return new _0xa04684(_0x590a5d,[..._0x250721]);}['_changeRange'](_0x29a48c,_0x34abcb,_0x2c9b2c,_0x16fb4c){return new _0x429c60(this['_changePosition'](_0x29a48c['start'],_0x34abcb,_0x16fb4c),this['_changePosition'](_0x29a48c['end'],_0x2c9b2c,_0x16fb4c));}['_getTopElement'](_0x55de35){let _0x38a342=_0x55de35;for(;_0x38a342['parent']&&!_0x38a342['parent']['is']('documentFragment');)_0x38a342=_0x38a342['parent'];return _0x38a342;}['_sortMarkers'](_0xf71f3a){const _0x2f30c3=_0x56698f=>{switch(_0x56698f){case'insert':return 0x1;case'remove-context':return 0x2;case'remove-only':return 0x3;case'remove-text':return 0x4;}};return _0xf71f3a['sort']((_0x6f6011,_0x1e8bf3)=>_0x2f30c3(_0x6f6011['type'])-_0x2f30c3(_0x1e8bf3['type']));}}class Oa extends _0x52a465{static get['requires'](){return[ie,re,oe];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{Sa as AIActions,li as AIAdapter,Yn as AIAssistant,ee as AIAssistantUI,m as AIBalloon,Ca as AIChat,x as AIChatController,I as AIChatHistory,rt as AIChatHistoryController,st as AIChatHistoryUI,v as AIChatUI,e as AIConnector,a as AIEditing,It as AIQuickActionType,fa as AIQuickActions,gi as AIQuickActionsUI,tr as AIRequestError,ms as AIReviewCheck,vs as AIReviewCheckResult,pr as AIReviewCheckRun,Oa as AIReviewMode,ie as AIReviewModeController,oe as AIReviewModeEditing,re as AIReviewModeUI,M as AITabs,ue as AITextAdapter,Qn as AWSTextAdapter,qn as OpenAITextAdapter,hi as ShowAIAssistantCommand,as as createResizeButton,$n as getDefaultAICommands};
23
+ import{Plugin as _0x59916e,Command as Nt,ContextPlugin as tt,Editor as st}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x5ab608,IconCheck as _0x5c7e48,IconError as _0x37fc4d,IconSubmit as _0x5af618,IconAIHistory as Ht,IconMagicWand as _0x4c13c4,IconRobotPencil as _0x65fc61,IconMaximize as _0x5284eb,IconMinimize as _0x133209,IconShowChangesOn as _0x4727ab,IconShowChangesOff as _0x3894d2,IconDocument as _0x21745d,IconThreeStars as _0xfe618c,IconDocumentWithLoupe as _0x378783,IconAddComment as _0x236754,IconRemove as _0x28cc87,IconDocumentWithCheckmark as _0x5a5ebd,IconDocumentWithCross as _0x5b2431,IconLoupe as _0x4fbb91,IconCancel as _0x4f51f8,IconStop as _0x14175e,IconAIChat as St,IconPlus as _0x3e404e,IconPin as _0x2887ac,IconThreeHorizontalDots as _0x5bb7c9,IconChevronRight as _0x39c53d,IconInfo as _0x509605,IconEye as _0xd0fe6d,IconEyeCrossedOut as _0x2eb32e,IconAIReview as _0x4c0e91}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x10e5dc,CKEditorError as _0x5e86d1,ObservableMixin as ts,global as _0x191fbc,isVisible as _0x2935b4,Rect as _0x21ae68,Collection as _0x553151,FocusTracker as _0x49e991,KeystrokeHandler as _0x183f1e,first as _0x53efcd,toArray as _0x4d54b9,EmitterMixin as _0x106985,logWarning as _0x51ad8b,logError as ot,scrollViewportToShowTarget as nt,ResizeObserver as _0x18b8db,_isMotionReduced as At,scrollAncestorsToShowTarget as _0xdd61de,DomEmitterMixin as _0x2023bf}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x5143cf,ButtonView as _0xb98904,View as _0x14b3a2,SpinnerView as _0x354e98,IconView as _0x2bd673,AutocompleteView as _0x1ce9b7,ListView as _0x5d5211,ListItemGroupView as _0x269c7f,ListItemView as _0x17d3e0,ButtonLabelView as _0x5ef6a2,FocusCycler as _0x3f54b9,createLabeledTextarea as _0x2d4d73,Dialog as _0x54639c,createDropdown as _0x19bf5c,addMenuToDropdown as _0x3a5c1b,MenuBarMenuView as _0x2584a5,MenuBarMenuListItemButtonView as _0x141439,DialogViewPosition as _0x26a1f9,MenuBarMenuListView as _0x321b73,MenuBarMenuListItemView as _0x4ac858,ViewCollection as _0x17ac77,UIModel as _0x2819cc,SplitButtonView as _0x48cde8,BalloonPanelView as _0x1b1d73,BodyCollection as Wt,clickOutsideHandler as _0x33b86b,ListItemButtonView as _0x338d49,addListToDropdown as _0x119cd1,submitHandler as _0x3345af,LabeledFieldView as _0x2ce1cc,createLabeledInputText as _0x3dec20,FormHeaderView as _0x4d6d75,HighlightedTextView as _0x4c6d3b,FileDialogButtonView as _0x385ee9,InputTextView as _0x521df6,SearchTextView as _0x310b2f,DropdownMenuButtonView as _0x3fae24,DropdownMenuPanelPositioningFunctions as _0x1ea5d9,BalloonToolbar as Jt,FormRowView as _0x42dbde,TextareaView as _0x185d11}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x52ce1c,ClipboardMarkersUtils as _0x3ad265}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x4312a7,ViewDataTransfer as _0x1d00e0,ViewUpcastWriter as _0x5a5b89,Matcher as _0x1b3141,ViewDowncastWriter as kt,transformOperationSets as _0x45cebc,_DetachOperation as _0x289d3b,_insertIntoModelNodeList as _0x4106c6,_removeFromModelNodeList as _0x3517d6,ModelRange as _0x154493,ModelDocumentFragment as _0x5acb07,ModelPosition as _0x272e84,ModelTreeWalker as te,InsertOperation as $t,MarkerOperation as Bt}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0xfbd5,escape as _0x17097f,escapeRegExp as _0x48db4a}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x5b2913,InvokeModelWithResponseStreamCommand as _0x3d3fc4,InvokeModelCommand as _0x161923}from'@aws-sdk/client-bedrock-runtime';import{createParser as wt}from'eventsource-parser';import{parseDocument as _0x1a1081}from'htmlparser2';import{isTag as _0x2b987d,findOne as mt,getParent as _0x67c08d,findAll as _0x11805f,removeElement as _0x4156ef,replaceElement as _0x2f3107,prepend as _0x3e13e2,prependChild as to,appendChild as _0x364834,append as _0x21a231,find as _0x1bdcc4,isComment as _0x4ec0e6,getChildren as _0x8ec974,textContent as _0xd47988}from'domutils';import _0x501beb from'dom-serializer';import{Document as _t,Element as tn,Text as _0x308946,cloneNode as _0xf6688c,isDocument as _0xe37c80,isText as _0x4a9a90,NodeWithChildren as _0x1dc761}from'domhandler';import{MarkdownGfmMdToHtml as _0x185e01}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{getAllMarkersDomElementsSorted as _0x4afa50,DocumentCompare as _0x436d15,DATA_ID_MODEL_ATTRIBUTE as gt}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import{IconThumbUp as _0x1fa777,IconThumbDown as _0xc7e49b,IconCopy as _0x46278c,IconCheck as _0x2b80f8,IconShowChangesOff as _0x14b360,IconShowChangesOn as _0x2c3bdc,IconWeb as _0x4cc6ea,IconNextArrow as _0x806106,IconPreviousArrow as _0x5d3e17,IconAI as yt,IconClose as _0x20bd6f,IconSelection as _0x45b740,IconFileUpload as _0x491246,IconLink as _0x15ef28,IconDocument as _0x5513a4,IconBulb as ta,IconDocumentOutline as _0x46edee,IconPaperClip as _0x273814,IconBrowseFiles as _0x109cc6,IconDropdownArrow as _0x55d3a8,IconAIAskAI as Ut,IconAIQuickActions as _0x10a3d8,IconAIChatCommands as Mt,IconAIImproveWriting as Yt,IconAIContinueWriting as Lt,IconAIGrammarCheck as Dt,IconAIAdjustLength as Qt,IconAIChangeTone as Kt,IconAITranslate as Gt,IconAIOther as qt,IconRefresh as _0x35a82c}from'@ckeditor/ckeditor5-icons/dist/index.js';import _0x2b9e21 from'morphdom';import{ConfirmMixin as _0x177fa5,LateFocusDropdownButtonView as _0x2e7d19,DocumentCompare as _0x20d1e0,DATA_ID_VIEW_ATTRIBUTE as _0x44e6b7,DATA_ID_MODEL_ATTRIBUTE as _0x5c6e05}from'ckeditor5-collaboration/dist/index.js';import{diffArrays as _0x4b4a86}from'diff';const R='_ungrouppedCommands';function k(_0x4a0cbc,_0x5bc45a){const _0x13270f=(0x0,_0x5bc45a['t'])('Other');return _0x4a0cbc['length']?'groupId'in _0x4a0cbc[0x0]?_0x4a0cbc:[{'groupId':R,'groupLabel':_0x13270f,'order':0x1/0x0,'commands':_0x4a0cbc}]:[{'groupId':R,'groupLabel':_0x13270f,'order':0x1/0x0,'commands':[]}];}const zn=globalThis['DataTransfer'],B='ai-ui';class T extends _0x59916e{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x483dd3}=this,_0x2eb3c5=['ck-fake-ai-selection'];_0x483dd3['config']['get']('ai.assistant.useTheme')&&_0x2eb3c5['push']('ck-ai-assistant-ui_theme'),_0x483dd3['conversion']['for']('editingDowncast')['markerToHighlight']({'model':B,'view':{'classes':_0x2eb3c5,'priority':0xc}}),_0x483dd3['conversion']['for']('editingDowncast')['markerToElement']({'model':B,'view':(_0x4fd15c,{writer:_0x430e0f})=>{if(!_0x4fd15c['markerRange']['isCollapsed'])return null;const _0x44c354=_0x430e0f['createUIElement']('span');return _0x430e0f['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x44c354),_0x44c354;}});}['afterInit'](){!async function(_0x3b99c7){const _0x5093f5=_0x3b0845([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]),_0x3284fe=0x3dffc4e1,_0x3e70c6=0x3df8b039^_0x3284fe,_0x5cc0fc=window[_0x3b0845([0x44,0x61,0x74,0x65])][_0x3b0845([0x6e,0x6f,0x77])](),_0x2c5852=_0x3b99c7[_0x3b0845([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x3c37e2=new window[(_0x3b0845([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3d65b5=>{_0x2c5852[_0x3b0845([0x6f,0x6e,0x63,0x65])](_0x3b0845([0x72,0x65,0x61,0x64,0x79]),_0x3d65b5);}),_0x3fce62={[_0x3b0845([0x6b,0x74,0x79])]:_0x3b0845([0x45,0x43]),[_0x3b0845([0x75,0x73,0x65])]:_0x3b0845([0x73,0x69,0x67]),[_0x3b0845([0x63,0x72,0x76])]:_0x3b0845([0x50,0x2d,0x32,0x35,0x36]),[_0x3b0845([0x78])]:_0x3b0845([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]),[_0x3b0845([0x79])]:_0x3b0845([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]),[_0x3b0845([0x61,0x6c,0x67])]:_0x3b0845([0x45,0x53,0x32,0x35,0x36])},_0x1ad23c=_0x2c5852[_0x3b0845([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x3b0845([0x67,0x65,0x74])](_0x3b0845([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x451f8a(){let _0xf4da43,_0x5b96f8=null,_0x22389e=null;try{if(_0x1ad23c==_0x3b0845([0x47,0x50,0x4c]))return _0x3b0845([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0xf4da43=_0x1f9af7(),!_0xf4da43)return _0x3b0845([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0xf4da43[_0x3b0845([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x22389e=_0x25a816(_0xf4da43[_0x3b0845([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0xf4da43[_0x3b0845([0x6a,0x74,0x69])])),await _0x1fd538()?_0x3b76c2()?_0x22567b()?_0x3b0845([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x28d124()?(_0xf4da43[_0x3b0845([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x3b0845([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x5b96f8=_0x1574f4(_0x3b0845([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0xf4da43[_0x3b0845([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x3b0845([0x74,0x72,0x69,0x61,0x6c])&&(_0x5b96f8=_0x1574f4(_0x3b0845([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x1333c6()):_0x3b0845([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x3b0845([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x3b0845([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x3b0845([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x22567b(){const _0x132ec6=[_0x3b0845([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x3b0845([0x74,0x72,0x69,0x61,0x6c])][_0x3b0845([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xf4da43[_0x3b0845([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x5cc0fc/0x3e8:0xe10*_0x3e70c6;return _0xf4da43[_0x3b0845([0x65,0x78,0x70])]<_0x132ec6;}function _0x3b76c2(){const _0x17d280=_0xf4da43[_0x3b0845([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x17d280&&(!!_0x17d280[_0x3b0845([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3b0845([0x2a]))||!!_0x17d280[_0x3b0845([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3b0845([0x41,0x49])));}function _0x28d124(){const _0x4ae388=_0xf4da43[_0x3b0845([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x4ae388||0x0==_0x4ae388[_0x3b0845([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x4ff8c1}=new URL(window[_0x3b0845([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x4ae388[_0x3b0845([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4ff8c1))return!0x0;const _0x421870=_0x4ff8c1[_0x3b0845([0x73,0x70,0x6c,0x69,0x74])](_0x3b0845([0x2e]));return _0x4ae388[_0x3b0845([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x5f47a0=>_0x5f47a0[_0x3b0845([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3b0845([0x2a])))[_0x3b0845([0x6d,0x61,0x70])](_0x1909ee=>_0x1909ee[_0x3b0845([0x73,0x70,0x6c,0x69,0x74])](_0x3b0845([0x2e])))[_0x3b0845([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x3047ec=>_0x3047ec[_0x3b0845([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x421870[_0x3b0845([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x3b0845([0x6d,0x61,0x70])](_0x184e79=>Array(_0x421870[_0x3b0845([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x184e79[_0x3b0845([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x3b0845([0x66,0x69,0x6c,0x6c])](_0x184e79[0x0]===_0x3b0845([0x2a])?_0x3b0845([0x2a]):'')[_0x3b0845([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x184e79))[_0x3b0845([0x73,0x6f,0x6d,0x65])](_0x11862e=>_0x421870[_0x3b0845([0x65,0x76,0x65,0x72,0x79])]((_0x4c42bc,_0x34b555)=>_0x11862e[_0x34b555]===_0x4c42bc||_0x11862e[_0x34b555]===_0x3b0845([0x2a])));}function _0x1333c6(){return _0x5b96f8&&_0x22389e?new window[(_0x3b0845([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0xbcdb79,_0x2b0143)=>{_0x5b96f8[_0x3b0845([0x74,0x68,0x65,0x6e])](_0xbcdb79,_0x2b0143),_0x22389e[_0x3b0845([0x74,0x68,0x65,0x6e])](_0x3da87e=>{_0x3da87e!=_0x3b0845([0x56,0x61,0x6c,0x69,0x64])&&_0xbcdb79(_0x3da87e);},_0x2b0143);}):_0x5b96f8||_0x22389e||_0x3b0845([0x56,0x61,0x6c,0x69,0x64]);}}function _0x25a816(_0x477822,_0x5b8d2e){return new window[(_0x3b0845([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1edbea=>{if(_0x14cf73())return _0x1edbea(_0x3b0845([0x56,0x61,0x6c,0x69,0x64]));_0x2e21c7(),_0x2c5852[_0x3b0845([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x3b0845([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x100d2f=!0x1;const _0x2c67c0=_0x10e5dc();function _0x4ed904(_0x50c52e){return!!_0x50c52e&&(typeof _0x50c52e===_0x3b0845([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x50c52e===_0x3b0845([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x50c52e[_0x3b0845([0x74,0x68,0x65,0x6e])]===_0x3b0845([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x50c52e[_0x3b0845([0x63,0x61,0x74,0x63,0x68])]===_0x3b0845([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x48f379(_0x330197){_0x2f5a31(_0x330197)[_0x3b0845([0x74,0x68,0x65,0x6e])](_0x50d2bb=>{if(!_0x50d2bb||_0x50d2bb[_0x3b0845([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x3b0845([0x6f,0x6b]))return _0x3b0845([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x5edc8f(_0x369101(_0x2c67c0+_0x5b8d2e))!=_0x50d2bb[_0x3b0845([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x3b0845([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x3b0845([0x56,0x61,0x6c,0x69,0x64]);})[_0x3b0845([0x74,0x68,0x65,0x6e])](_0xe49e26=>(_0x141a23(),_0xe49e26),()=>{const _0x18df91=_0xfa6168();return null==_0x18df91?(_0x141a23(),_0x3b0845([0x56,0x61,0x6c,0x69,0x64])):_0x3b0845(_0x5cc0fc-_0x18df91>(0x19f340e1^_0x3284fe)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x3b0845([0x74,0x68,0x65,0x6e])](_0x1edbea)[_0x3b0845([0x63,0x61,0x74,0x63,0x68])](()=>{_0x1edbea(_0x3b0845([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0xb6a9e4=0x3dc92a61^_0x3284fe;function _0x141a23(){const _0x5d14eb=_0x3b0845([0x6c,0x6c,0x63,0x74,0x2d])+_0x5edc8f(_0x369101(_0x477822)),_0x26bacb=_0x30ecec(_0x5edc8f(window[_0x3b0845([0x4d,0x61,0x74,0x68])][_0x3b0845([0x63,0x65,0x69,0x6c])](_0x5cc0fc/_0xb6a9e4)));window[_0x3b0845([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3b0845([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x5d14eb,_0x26bacb);}function _0xfa6168(){const _0x5d436f=_0x3b0845([0x6c,0x6c,0x63,0x74,0x2d])+_0x5edc8f(_0x369101(_0x477822)),_0x37d345=window[_0x3b0845([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3b0845([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x5d436f);return _0x37d345?window[_0x3b0845([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x30ecec(_0x37d345),0x10)*_0xb6a9e4:null;}function _0x2f5a31(_0x4bd8b4){return new window[(_0x3b0845([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x35313f,_0x2a0337)=>{_0x4bd8b4[_0x3b0845([0x74,0x68,0x65,0x6e])](_0x35313f,_0x2a0337),window[_0x3b0845([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x2a0337,0x3dfe1021^_0x3284fe);});}}_0x2c5852[_0x3b0845([0x6f,0x6e])](_0x3b0845([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x1345ed,_0x599650)=>{if(_0x599650[0x0]!=_0x477822)return _0x1edbea(_0x3b0845([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x599650[0x1]={..._0x599650[0x1],[_0x3b0845([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x2c67c0};},{[_0x3b0845([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3b0845([0x68,0x69,0x67,0x68])}),_0x2c5852[_0x3b0845([0x6f,0x6e])](_0x3b0845([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x1484f0=>{_0x4ed904(_0x1484f0[_0x3b0845([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x100d2f=!0x0,_0x48f379(_0x1484f0[_0x3b0845([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x3b0845([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3b0845([0x6c,0x6f,0x77])}),_0x3c37e2[_0x3b0845([0x74,0x68,0x65,0x6e])](()=>{_0x100d2f||_0x1edbea(_0x3b0845([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x14cf73(){return _0x2c5852[_0x3b0845([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3b0845([0x76,0x69,0x65,0x77])][_0x3b0845([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x3b0845([0x61,0x75,0x74,0x6f]);}function _0x2e21c7(){_0x2c5852[_0x3b0845([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3b0845([0x76,0x69,0x65,0x77])][_0x3b0845([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x3b0845([0x61,0x75,0x74,0x6f]);}}function _0x1574f4(_0x3c5b68){const _0x10305a=[new window[(_0x3b0845([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4a482c=>setTimeout(_0x4a482c,0x3df6fa2d^_0x3284fe)),_0x3c37e2[_0x3b0845([0x74,0x68,0x65,0x6e])](()=>new window[(_0x3b0845([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x59fc9f=>{let _0x349964=0x0;_0x2c5852[_0x3b0845([0x6d,0x6f,0x64,0x65,0x6c])][_0x3b0845([0x6f,0x6e])](_0x3b0845([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0xfb111,_0x3be1a2)=>{_0x3be1a2[0x0][_0x3b0845([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x349964++,_0x349964==(0x3dffc519^_0x3284fe)&&(_0x59fc9f(),_0xfb111[_0x3b0845([0x6f,0x66,0x66])]());});}))];return window[_0x3b0845([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x3b0845([0x72,0x61,0x63,0x65])](_0x10305a)[_0x3b0845([0x74,0x68,0x65,0x6e])](()=>_0x3c5b68);}async function _0x2ce0eb(){await _0x3c37e2,_0x2c5852[_0x3b0845([0x6d,0x6f,0x64,0x65,0x6c])][_0x3b0845([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x46c137,_0x2c5852[_0x3b0845([0x6d,0x6f,0x64,0x65,0x6c])][_0x3b0845([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x46c137,_0x2c5852[_0x3b0845([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x3b0845([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x510939(_0x574ca9){const _0x308cc2=_0x56c450();_0x2c5852[_0x308cc2]=_0x3b0845([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x574ca9,_0x574ca9!=_0x3b0845([0x56,0x61,0x6c,0x69,0x64])&&_0x2ce0eb();}function _0x56c450(){const _0x5d75ac=window[_0x3b0845([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x3b0845([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x3b0845([0x6e,0x6f,0x77])]())[_0x3b0845([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x3b0845([0x2e]),'');let _0x2d2df1=_0x3b0845([0x6e]);for(let _0x297f9a=0x0;_0x297f9a<_0x5d75ac[_0x3b0845([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x297f9a+=0x2){let _0x2a6247=window[_0x3b0845([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5d75ac[_0x3b0845([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x297f9a,_0x297f9a+0x2));_0x2a6247>=_0x5093f5[_0x3b0845([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x2a6247-=_0x5093f5[_0x3b0845([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x2d2df1+=_0x5093f5[_0x2a6247];}return _0x2d2df1;}function _0x1f9af7(){const _0x556fa3=_0x1ad23c[_0x3b0845([0x73,0x70,0x6c,0x69,0x74])](_0x3b0845([0x2e]));if(0x3!=_0x556fa3[_0x3b0845([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x3747d5(_0x556fa3[0x1]);function _0x3747d5(_0x3d456a){const _0xbc0021=_0x1d41b7(_0x3d456a);return _0xbc0021&&_0x5ec0c4()?_0xbc0021:null;function _0x5ec0c4(){const _0xe13849=_0xbc0021[_0x3b0845([0x6a,0x74,0x69])],_0x4c7608=window[_0x3b0845([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xe13849[_0x3b0845([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0xe13849[_0x3b0845([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x54d0b9={..._0xbc0021,[_0x3b0845([0x6a,0x74,0x69])]:_0xe13849[_0x3b0845([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0xe13849[_0x3b0845([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x54d0b9[_0x3b0845([0x76,0x63])],_0x369101(_0x54d0b9)==_0x4c7608;}}}async function _0x1fd538(){let _0x49bc3d=!0x0;try{const _0x2080f1=_0x1ad23c[_0x3b0845([0x73,0x70,0x6c,0x69,0x74])](_0x3b0845([0x2e])),[_0x37c123,_0x124648,_0x1fe098]=_0x2080f1;return _0x59227f(_0x37c123),await _0x1759f4(_0x37c123,_0x124648,_0x1fe098),_0x49bc3d;}catch{return!0x1;}function _0x59227f(_0x42b84c){const _0x1b3d4c=_0x1d41b7(_0x42b84c);_0x1b3d4c&&_0x1b3d4c[_0x3b0845([0x61,0x6c,0x67])]==_0x3b0845([0x45,0x53,0x32,0x35,0x36])||(_0x49bc3d=!0x1);}async function _0x1759f4(_0x509c2e,_0x1bee2a,_0x29144f){const _0x5edbea=window[_0x3b0845([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x3b0845([0x66,0x72,0x6f,0x6d])](_0xbdc430(_0x29144f),_0x428d12=>_0x428d12[_0x3b0845([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x5b4eb1=new window[(_0x3b0845([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x3b0845([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x509c2e+_0x3b0845([0x2e])+_0x1bee2a),_0x109bb4=window[_0x3b0845([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x3b0845([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x109bb4)return;const _0x1c6d56=await _0x109bb4[_0x3b0845([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x3b0845([0x6a,0x77,0x6b]),_0x3fce62,{[_0x3b0845([0x6e,0x61,0x6d,0x65])]:_0x3b0845([0x45,0x43,0x44,0x53,0x41]),[_0x3b0845([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x3b0845([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x3b0845([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x109bb4[_0x3b0845([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x3b0845([0x6e,0x61,0x6d,0x65])]:_0x3b0845([0x45,0x43,0x44,0x53,0x41]),[_0x3b0845([0x68,0x61,0x73,0x68])]:{[_0x3b0845([0x6e,0x61,0x6d,0x65])]:_0x3b0845([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x1c6d56,_0x5edbea,_0x5b4eb1)||(_0x49bc3d=!0x1);}}function _0x1d41b7(_0x5d649b){return _0x5d649b[_0x3b0845([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x3b0845([0x65,0x79]))?JSON[_0x3b0845([0x70,0x61,0x72,0x73,0x65])](_0xbdc430(_0x5d649b)):null;}function _0xbdc430(_0x14c815){return window[_0x3b0845([0x61,0x74,0x6f,0x62])](_0x14c815[_0x3b0845([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x3b0845([0x2b]))[_0x3b0845([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x3b0845([0x2f])));}function _0x369101(_0x439b6e){let _0x3e68d3=0x1505;function _0x1d3d54(_0x5407df){for(let _0x5d37a2=0x0;_0x5d37a2<_0x5407df[_0x3b0845([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5d37a2++){const _0x46aa76=_0x5407df[_0x3b0845([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x5d37a2);_0x3e68d3=(_0x3e68d3<<0x5)+_0x3e68d3+_0x46aa76,_0x3e68d3&=_0x3e68d3;}}function _0x531a5a(_0xe50bcc){Array[_0x3b0845([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0xe50bcc)?_0xe50bcc[_0x3b0845([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x531a5a):_0xe50bcc&&typeof _0xe50bcc==_0x3b0845([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x3b0845([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0xe50bcc)[_0x3b0845([0x73,0x6f,0x72,0x74])]()[_0x3b0845([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x1a6051,_0x25d7c9])=>{_0x1d3d54(_0x1a6051),_0x531a5a(_0x25d7c9);}):_0x1d3d54(window[_0x3b0845([0x53,0x74,0x72,0x69,0x6e,0x67])](_0xe50bcc));}return _0x531a5a(_0x439b6e),_0x3e68d3>>>0x0;}function _0x5edc8f(_0x24de5e){return _0x24de5e[_0x3b0845([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x3b0845([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x3b0845([0x30]));}function _0x30ecec(_0x437a0a){return _0x437a0a[_0x3b0845([0x73,0x70,0x6c,0x69,0x74])]('')[_0x3b0845([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x3b0845([0x6a,0x6f,0x69,0x6e])]('');}function _0x46c137(){}function _0x3b0845(_0x468051){return _0x468051['map'](_0x4ee5cc=>String['fromCharCode'](_0x4ee5cc))['join']('');}_0x510939(await _0x451f8a());}(this);}['showFakeVisualSelection'](){const _0x50fb1c=this['editor']['model'];_0x50fb1c['change'](_0x2431f1=>{const _0x228733=_0x50fb1c['document']['selection']['getRanges']();let _0xeeea23=0x0;for(const _0x1542a7 of _0x228733){const _0x831984=B+':'+_0xeeea23;if(_0x50fb1c['markers']['has'](_0x831984))_0x2431f1['updateMarker'](_0x831984,{'range':_0x1542a7});else{if(_0x1542a7['start']['isAtEnd']){const _0x4b8ab8=_0x1542a7['start']['getLastMatchingPosition'](({item:_0x28c274})=>!_0x50fb1c['schema']['isContent'](_0x28c274),{'boundaries':_0x1542a7});_0x2431f1['addMarker'](_0x831984,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2431f1['createRange'](_0x4b8ab8,_0x1542a7['end'])});}else _0x2431f1['addMarker'](_0x831984,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1542a7});}_0xeeea23++;}});}['hideFakeVisualSelection'](){const _0x8243a6=this['editor']['model'],_0x48c8ae=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](B));_0x48c8ae['length']&&_0x8243a6['change'](_0x55966b=>{_0x48c8ae['forEach'](_0xc0f345=>{_0x55966b['removeMarker'](_0xc0f345);});});}['insertContent'](_0x5d131b,_0x5e725b){const _0x1a58cf=this['_getAISelection'](),_0x4ec12d=_0x5e725b||_0x1a58cf['getFirstRange']();this['editor']['model']['canEditAt'](_0x4ec12d)&&this['editor']['model']['change'](_0x3533df=>{this['hideFakeVisualSelection'](),_0x5e725b||this['_resetContentOfSelectedTableCells'](_0x3533df,_0x1a58cf),this['_pasteHTMLUsingClipboard']({'insertAt':_0x4ec12d,'writer':_0x3533df,'html':_0x5d131b});});}['insertContentBelow'](_0x166420){const {model:_0x21671a}=this['editor'],_0x37f3be=this['_getAISelection']();_0x21671a['change'](()=>{const _0x2275cf=this['_prepareTableInsertBelowPosition'](_0x166420,_0x37f3be)||this['_getDefaultInsertBelowPosition'](_0x37f3be);this['insertContent'](_0x166420,_0x2275cf);});}['_getAISelection'](){const _0x1a67ef=this['editor']['model'],_0x3905d5=Array['from'](_0x1a67ef['markers']['getMarkersGroup'](B))['map'](_0x492df7=>_0x492df7['getRange']());return _0x1a67ef['createSelection'](_0x3905d5);}['_pasteHTMLUsingClipboard']({writer:_0x1ea5c0,html:_0x5d24c8,insertAt:_0x39c3a6}){const {view:_0x5775aa}=this['editor']['editing'],_0x264686=this['editor']['plugins']['get'](_0x52ce1c),_0x23a4d1=new zn();_0x23a4d1['setData']('text/html',_0x5d24c8);const _0xcb45be=new ClipboardEvent('paste',{'clipboardData':_0x23a4d1}),_0x13b885=new _0x4312a7(_0x5775aa,_0xcb45be,{'dataTransfer':new _0x1d00e0(_0x23a4d1)});_0x1ea5c0['setSelection'](_0x39c3a6);const _0x1deec5=(_0x3047b7,_0x5b6268)=>{_0x5b6268['resultRange']&&_0x1ea5c0['setSelection'](_0x5b6268['resultRange']);};_0x264686['once']('contentInsertion',_0x1deec5,{'priority':'lowest'}),_0x5775aa['document']['fire']('paste',_0x13b885),_0x264686['off']('contentInsertion',_0x1deec5);}['_getDefaultInsertBelowPosition'](_0x567574){const {model:_0x48bcd1}=this['editor'],_0x53dcba=Array['from'](_0x567574['getSelectedBlocks']());return _0x53dcba['length']?_0x48bcd1['createPositionAfter'](_0x53dcba['pop']()):_0x567574['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x45343d,_0x5bac30){const {model:_0x1f8684,plugins:_0x1a8e77}=this['editor'];if(_0x1a8e77['has']('TableUtils')){const _0x4d9890=_0x1a8e77['get']('TableUtils')['getSelectedTableCells'](_0x5bac30);if(_0x4d9890['length']){const _0x3cdf22=this['_getTableRowCountFromContent'](_0x45343d),_0x4931cf=this['_createEmptyTableRows'](_0x4d9890,_0x3cdf22);return _0x1f8684['createPositionAt'](_0x4931cf,0x0);}}return null;}['_getTableRowCountFromContent'](_0x2e3142){const _0x1a0140=this['editor']['plugins']['get']('TableUtils'),_0x2e413e=this['editor']['data']['parse'](_0x2e3142),_0x479a5a=Array['from'](_0x2e413e['getChildren']())['filter'](_0x1236ef=>_0x1236ef['is']('element','table'));let _0x56dc63=0x0;return _0x479a5a['forEach'](_0x581018=>{_0x56dc63+=_0x1a0140['getRows'](_0x581018);}),_0x56dc63;}['_createEmptyTableRows'](_0x469ab1,_0x5e6b01){const _0x266b48=this['editor']['plugins']['get']('TableUtils'),_0x24535c=_0x266b48['getRowIndexes'](_0x469ab1),_0x186d5d=_0x266b48['getColumnIndexes'](_0x469ab1),_0x5daac1=_0x24535c['last']+0x1,_0x169261=_0x186d5d['first'],_0x1a07e3=_0x469ab1[0x0]['findAncestor']('table');for(let _0x48a013=0x0;_0x48a013<_0x5e6b01;_0x48a013++)_0x266b48['insertRows'](_0x1a07e3,{'at':_0x5daac1});return _0x1a07e3['getChild'](_0x5daac1)['getChild'](_0x169261);}['_resetContentOfSelectedTableCells'](_0x2f21d2,_0x34c558){const {plugins:_0xf9718d}=this['editor'],{model:_0x1ce174}=_0x2f21d2;if(!_0xf9718d['has']('TableUtils'))return;_0xf9718d['get']('TableUtils')['getSelectedTableCells'](_0x34c558)['length']&&_0x1ce174['deleteContent'](_0x34c558);}}class F extends _0x59916e{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x5e86d1('aiadapter-text-adapter-not-set',null);}}class is extends Error{constructor(_0x4cea93){super(_0x4cea93),this['name']='AIRequestError';}}function Jn(_0x379f59,_0x29bd7f,_0x6bffa8){const t=_0x379f59['t'];switch(_0x29bd7f){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',_0x6bffa8);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x6bffa8);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'},_0x6bffa8);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 _0x29bd7f;}}class J extends Nt{['_commandDefinitions'];constructor(_0x24c2b3,_0x4d6734){super(_0x24c2b3),this['_commandDefinitions']=_0x4d6734,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x57a1e6,_0x41c253,_0x1db81b)=>{this['isEnabled']&&(this['enabledCommandsIds']=os(this['_commandDefinitions'],_0x1db81b));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x367a05,_0x2d7809,_0x143317)=>{this['enabledCommandsIds']=_0x143317?os(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x43bb91=this['editor']['model'];this['_hasContext']=function(_0x2c4d74){const _0x51a016=_0x2c4d74['document']['selection'];return _0x51a016['isCollapsed']?0x0!==[..._0x51a016['getSelectedBlocks']()]['length']&&![..._0x51a016['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x2c4d74['hasContent'](_0x51a016['getFirstRange']());}(_0x43bb91);const _0x4a30bb=_0x43bb91['document']['selection'],_0x222b06=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0xba240 of _0x4a30bb['getRanges']())for(const _0x205db0 of _0xba240['getItems']())if(_0x205db0['is']('element')&&_0x222b06['includes'](_0x205db0['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x530054='',_0x1056fd='',_0x5596d8='custom'){this['editor']['plugins']['get'](x)['showUI'](_0x530054,_0x1056fd,_0x5596d8);}}function os(_0x2d488,_0x299424){const _0x59b9b0=new Set();for(const _0x1b6e34 of _0x2d488['values']())(_0x299424||!0x1===_0x1b6e34['requiresContent'])&&_0x59b9b0['add'](_0x1b6e34['id']);return Array['from'](_0x59b9b0);}const ns=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class Q extends/* #__PURE__ -- @preserve */
24
+ ts(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0xb05318,_0x2a68ca,_0x670212){super(),this['editor']=_0xb05318,this['textAdapter']=_0x2a68ca,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x670212,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x1895c6,_0x47f7c2,_0x819394)=>{this['view']['value']=this['_sanitizeHTML'](_0x819394);}),this['listenTo'](this['view'],'submitPrompt',(_0x3f975c,_0x22af54)=>{const _0xe8b32c=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x22af54,_0xe8b32c,'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:_0x2d2b66,query:_0x469c2b,htmlContent:_0x5bdaac,label:_0x113100,mainActionLabel:_0x486d65}){this['view']['prompt']=_0x113100,this['view']['mainAction']=_0x486d65,this['initialContext']=_0x5bdaac,_0x469c2b&&(this['view']['isRendered']?this['_handleQuery'](_0x469c2b,_0x5bdaac,_0x2d2b66,_0x113100):this['view']['once']('render',()=>{this['_handleQuery'](_0x469c2b,_0x5bdaac,_0x2d2b66,_0x113100);}));}['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'](_0x426335,_0x52e76e,_0x58e2fd,_0x1d11d8){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x52e76e,this['previousQuery']=_0x426335,this['previousLabel']=_0x1d11d8||_0x426335,this['previousActionId']=_0x58e2fd,new Promise(_0x51c5a3=>{this['textAdapter']['makeRequest']({'query':_0x426335,'context':_0x52e76e,'onData':_0x146b0b=>{this['currentResponse']=_0x146b0b,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x58e2fd})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x3d971e=>{_0x3d971e instanceof is?this['view']['handleError'](_0x3d971e['message']):this['view']['handleError'](),_0x51c5a3();})['finally'](()=>{this['stopProcessing'](),_0x51c5a3();});});}['_parseAndNormalizeContent'](_0x5e30d8,_0x14103c=!0x1){const _0x47bf7a=ns['exec'](_0x5e30d8);_0x5e30d8=_0x47bf7a?_0x5e30d8['substring'](_0x47bf7a[0x1]['length']):_0x5e30d8['length']<0x64&&!_0x14103c?'':this['_stripMarkdownSyntax'](_0x5e30d8);const _0x4f3242=this['_domParser']['parseFromString'](_0x5e30d8,'text/html');if(_0x47bf7a){const _0x304b3b=Array['from'](_0x4f3242['body']['childNodes']);_0x304b3b['reverse']();for(const _0x3be229 of _0x304b3b){if(_0x3be229['nodeType']==Node['ELEMENT_NODE'])break;_0x3be229['remove']();}}const _0x2f7def=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x4f3242['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x2f7def);const _0x409399=this['editor']['config']['get']('ai.assistant.preserveComments'),_0xbc276e=this['editor']['data']['toModel'](_0x2f7def);return _0x409399||_0xbc276e['markers']['clear'](),this['editor']['data']['stringify'](_0xbc276e);}['_normalizeResponseHeadings'](_0x27651a){const _0x3afc81=new _0x5a5b89(this['editor']['editing']['view']['document']),_0x1f8520=new _0x1b3141({'name':/^h[1-5]$/}),_0x3063b5=[];let _0x3d956a=!0x1;for(const _0x13dc6a of _0x27651a)_0x13dc6a['is']('element')&&_0x1f8520['match'](_0x13dc6a)&&(_0x3063b5['push'](_0x13dc6a),'h1'==_0x13dc6a['name']&&(_0x3d956a=!0x0));if(_0x3d956a){for(const _0x48e8ea of _0x3063b5)_0x3afc81['rename']('h'+(parseInt(_0x48e8ea['name'][0x1])+0x1),_0x48e8ea);}}['_isH1TagSupportEnabled'](){const {data:_0x2f9714,editing:_0x30fd34}=this['editor'],_0x395dc8=_0x2f9714['htmlProcessor']['toView']('<h1></h1>'),_0x1f249b=_0x2f9714['toView'](_0x2f9714['toModel'](_0x395dc8));return!!_0x30fd34['view']['domConverter']['viewToDom'](_0x1f249b)['querySelector']('h1');}['_sanitizeHTML'](_0x47424e){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x47424e),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x5c5171){const _0x5981eb=_0x5c5171['trim']();return _0x5981eb['startsWith']('```html')?_0x5981eb['endsWith']('```')?_0x5981eb['substring'](0x7,_0x5981eb['length']-0x3):_0x5981eb['substring'](0x7):_0x5c5171;}}const X={'REPLACE':'replace','INSERT':'insert'};class wr extends _0x5143cf{constructor(_0x4befa9){super(_0x4befa9),this['set']('isVisible',!0x1),this['set']('mainAction',X['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x3814a0=>Jn(_0x4befa9,'AI_'+_0x3814a0['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Jn(_0x4befa9,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Jn(_0x4befa9,'Try\x20again')),this['stopButton']=this['_createButton'](Jn(_0x4befa9,'Stop'));const _0x1f1e4d=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x1f1e4d['if']('isVisible','ck-hidden',_0x3f8740=>!_0x3f8740)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x2f76e1,_0x574704){const _0x23e4dd=new _0xb98904(this['locale']);return _0x23e4dd['set']({'label':_0x2f76e1,'class':_0x574704||'','isVisible':!0x0,'withText':!0x0}),_0x23e4dd;}}class yr extends _0x14b3a2{['contentFieldView'];['copyButtonView'];constructor(_0x1e5110,_0x20bf4e=''){super(_0x1e5110),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x3b106d=this['bindTemplate'];this['contentFieldView']=new Zn(_0x1e5110,_0x20bf4e),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x3b106d['if']('isVisible','ck-hidden',_0x4ff94a=>!_0x4ff94a)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x3b106d['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 _0x3b612b=!0x1;this['on']('change:value',(_0x254efd,_0xf2ab8d,_0x1f7571)=>{const _0x44ff03=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x1f7571),this['isProcessing']&&_0x44ff03&&!_0x3b612b&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x29cbef,_0x3a03e5,_0x4e017a)=>{_0x3b612b=!0x1,_0x4e017a?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x3b612b=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x3b612b=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x3f78dd=this['locale'],_0x9b48cf=new _0xb98904(this['locale']),_0x286f0a='ck-ai-form__copy-button';return _0x9b48cf['set']({'label':Jn(_0x3f78dd,'Copy'),'icon':_0x5ab608,'class':_0x286f0a,'tooltip':!0x0}),_0x9b48cf['bind']('isVisible')['to'](this,'value',_0x181829=>!!_0x181829),_0x9b48cf['bind']('isEnabled')['to'](this,'isProcessing',_0xea7f29=>!_0xea7f29),_0x9b48cf['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x9b48cf['icon']=_0x5c7e48,_0x9b48cf['class']=_0x286f0a+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x9b48cf['icon']=_0x5ab608,_0x9b48cf['class']=_0x286f0a;},0x3e8);}),_0x9b48cf;}['_copyHTMLToClipboard'](_0x2dd977){const {window:_0x1b7ac4,document:_0x5a6abc}=_0x191fbc;if(_0x1b7ac4['ClipboardItem']){const {Blob:_0x52562d,ClipboardItem:_0x39c25a}=_0x1b7ac4,_0x572e06=[new _0x39c25a({'text/html':new _0x52562d([_0x2dd977['innerHTML']],{'type':'text/html'}),'text/plain':new _0x52562d([_0x2dd977['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x572e06);}else{const _0x11769e=_0x5a6abc['createElement']('div');_0x11769e['style']['position']='absolute',_0x11769e['style']['left']='-9999px',_0x11769e['innerHTML']='<span>[</span>'+_0x2dd977['innerHTML']+'<span>]</span>',_0x5a6abc['body']['appendChild'](_0x11769e);const _0x150ffa=_0x5a6abc['createRange']();_0x150ffa['setStartAfter'](_0x11769e['firstElementChild']),_0x150ffa['setEndBefore'](_0x11769e['lastElementChild']);const _0x9c57c5=_0x1b7ac4['getSelection']();_0x9c57c5['removeAllRanges'](),_0x9c57c5['addRange'](_0x150ffa),_0x5a6abc['execCommand']('copy'),_0x11769e['remove']();}}}class Zn extends _0x14b3a2{constructor(_0x302006,_0x2ccd34=''){super(_0x302006),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x2ccd34,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x37bb0d){this['element']['innerHTML']=_0x37bb0d;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x4e96ca=new _0x14b3a2(),_0x59d677=this['locale'],_0x18b102=new _0x354e98();return _0x18b102['isVisible']=!0x0,_0x4e96ca['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x18b102,{'text':Jn(_0x59d677,'AI\x20is\x20writing...')}]}),_0x4e96ca['render'](),_0x4e96ca;}}class gr extends _0x14b3a2{constructor(_0x41ffe3,_0xc15e0a=''){super(_0x41ffe3);const _0x340397=new _0x2bd673(),_0x10897b=this['bindTemplate'];this['set']('text',_0xc15e0a),_0x340397['content']=_0x37fc4d,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x340397,{'text':_0x10897b['to']('text')}]});}}class Er extends _0x1ce9b7{['submitButtonView'];['showHistoryButtonView'];constructor(_0xae0eeb,_0x5b4341){super(_0xae0eeb,_0x5b4341),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',(_0x2d4ede,_0x48b379)=>{_0x2d4ede['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x48b379());});}['_createSubmitButton'](){const _0x3966b1=new _0xb98904(this['locale']),_0x9511e8=this['locale'];return _0x3966b1['set']({'icon':_0x5af618,'label':Jn(_0x9511e8,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x3966b1['on']('execute',()=>{this['submit']();}),_0x3966b1['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x44f5ac,_0x261b9e)=>!_0x44f5ac&&_0x261b9e),_0x3966b1;}['_createShowHistoryButton'](){const _0x13e3c7=new _0xb98904(this['locale']),_0x38ee32=this['resultsView'],_0x507807=this['locale'];_0x13e3c7['set']({'label':Jn(_0x507807,'History'),'withText':!0x1,'icon':Ht,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x13e3c7['bind']('isOn')['to'](_0x38ee32,'isVisible'),_0x13e3c7['bind']('isEnabled')['to'](this,'isEnabled'),_0x13e3c7['on']('execute',()=>{_0x38ee32['isVisible']=!_0x38ee32['isVisible'],_0x38ee32['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x5f014e=()=>{_0x191fbc['window']['requestAnimationFrame'](()=>{if(_0x2935b4(this['element'])){const _0x5a6bfe=new _0x21ae68(this['queryView']['fieldView']['element']),_0x415266=_0x5a6bfe['width'],_0x4fb24e='rtl'===_0x507807['uiLanguageDirection']?'left':'right';_0x5a6bfe['excludeScrollbarsAndBorders'](),_0x13e3c7['element']['style'][_0x4fb24e]=_0x415266-_0x5a6bfe['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x5f014e),this['on']('render',_0x5f014e),_0x13e3c7;}['submit'](){const _0x34efb3=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x34efb3);}['focus'](_0x1a0c91){-0x1===_0x1a0c91?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class vr extends _0x5d5211{['historyGroupView'];['clearHistoryButton'];constructor(_0x338628){super(_0x338628),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x269c7f(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Jn(_0x338628,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x13e520=0x0;for(const _0x473315 of this['items'])_0x13e520+=_0x473315['items']['length'];return{'resultsCount':_0x13e520,'totalItemsCount':_0x13e520};}['_createClearHistoryButton'](){const _0x1c1728=this['locale'],_0x18a641=new _0xb98904(this['locale']);return _0x18a641['set']({'label':'('+Jn(_0x1c1728,'Clear')+')','withText':!0x0}),_0x18a641['on']('execute',()=>this['fire']('clearHistory')),_0x18a641;}}class Ar extends _0x17d3e0{constructor(_0x296e7d){super();const _0x33eff3=new _0x5ef6a2(),_0x206491=new _0xb98904(this['locale'],_0x33eff3);this['children']['add'](_0x206491),_0x206491['set']({'label':_0x296e7d['prompt'],'withText':!0x0}),_0x206491['on']('execute',()=>{this['fire']('execute',{'value':_0xfbd5(_0x296e7d['prompt'])});});}}const no='CKEditor/AIFormView/PromptHistory';class Pr extends _0x553151{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x124145,_0x4bfa6a)=>{const _0x4dac0f=co(_0x4bfa6a['prompt']);for(const _0xf87cb6 of this)if(_0xf87cb6!=_0x4bfa6a&&co(_0xf87cb6['prompt'])===_0x4dac0f){this['remove'](_0xf87cb6);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0xf9de1=sessionStorage['getItem'](no)||'[]';this['addMany'](JSON['parse'](_0xf9de1));}['_saveToSessionStorage'](){sessionStorage['setItem'](no,JSON['stringify'](this['map'](_0x27932a=>_0x27932a)));}}function co(_0x5f170d){return _0x5f170d['toLowerCase']()['trim']();}class W extends _0x14b3a2{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x4e4a12,_0x601261,_0x2c93c2=''){super(_0x4e4a12),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',X['REPLACE']),this['_promptHistory']=new Pr(),this['errorView']=new gr(_0x4e4a12),this['contentArea']=new yr(_0x4e4a12,_0x2c93c2),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 _0x49e991(),this['keystrokes']=new _0x183f1e(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x3f54b9({'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 _0x16d2e7=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x601261],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x16d2e7['if']('isError','ck-hidden',_0x54a3dd=>!_0x54a3dd)]},'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'](_0x6dbc3=0x1){-0x1===_0x6dbc3?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 _0x14fe45=this['locale'],_0x5d4f1f=new Er(_0x14fe45,{'queryView':{'label':Jn(_0x14fe45,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x2d4d73,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Jn(_0x14fe45,'Empty\x20history'),'secondary':Jn(_0x14fe45,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x5d4f1f['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x3f64f7,_0x3a9eb2)=>_0x3f64f7&&!_0x3a9eb2),this['listenTo'](_0x5d4f1f,'submit',(_0x52cec5,_0x3f4001)=>{this['prompt']=_0x3f4001;const _0x521d12=_0x17097f(_0x3f4001);this['fire']('submitPrompt',_0x521d12),_0x3f4001['trim']()&&this['_promptHistory']['add']({'prompt':_0x521d12},0x0);},{'priority':'high'}),_0x5d4f1f;}['_createHistoryView'](){const _0xf89256=new vr(this['locale']);return _0xf89256['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Ar),_0xf89256['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0xf89256;}['_createToolbar'](){const _0x258efa=new wr(this['locale']);return _0x258efa['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x27c209,_0x1447ce,_0x318560)=>_0x27c209&&!_0x1447ce&&!!_0x318560),_0x258efa['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x258efa['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x5950fb,_0x15e298,_0xce7117)=>_0x5950fb&&!_0x15e298&&!!_0xce7117),_0x258efa['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x258efa['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0xcf0324,_0x512768)=>_0xcf0324&&!_0x512768),_0x258efa['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x258efa['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x258efa['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x258efa;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x5cb6a1=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Jn(_0x5cb6a1,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x3c8649){const _0x473d18=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x3c8649||Jn(_0x473d18,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const P=globalThis['DataTransfer'];class x extends _0x59916e{['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[_0x3ad265,T,F,_0x54639c];}constructor(_0x43bc51){super(_0x43bc51),_0x43bc51['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x43bc51['config']['define']('ai.assistant.contentAreaCssClass',''),_0x43bc51['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x43bc51['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x54971f}=this;this['_aiAdapter']=_0x54971f['plugins']['get'](F),this['_dialog']=_0x54971f['plugins']['get'](_0x54639c),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x35194c=new J(_0x54971f,Array['from'](this['_commandDefinitions']['values']()));_0x54971f['commands']['add']('showAIAssistant',_0x35194c),_0x54971f['ui']['componentFactory']['add']('aiCommands',_0x3489db=>{const _0x261b85=_0x19bf5c(_0x3489db);return _0x261b85['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x261b85['buttonView']['set']({'label':Jn(_0x3489db,'AI\x20Commands'),'icon':_0x4c13c4,'tooltip':!0x0}),_0x261b85['on']('execute',_0x1f185f=>this['_onExecute'](_0x1f185f['source']['id'])),_0x3a5c1b(_0x261b85,_0x54971f['ui']['view']['body'],function(_0x17e9b1){const _0x1ada79=k(_0x17e9b1['config']['get']('ai.assistant.commands'),_0x17e9b1['locale']),_0x1dcbe9=ii(_0x17e9b1,_0x1ada79)['filter'](_0x56be05=>_0x56be05['commands']['length']);if(0x1===_0x1dcbe9['length'])return ii(_0x17e9b1,_0x1dcbe9[0x0]['commands'])['map'](_0x14da58=>({'id':_0x14da58['id'],'label':_0x14da58['label']}));return _0x1dcbe9['map'](_0x411373=>{const {groupId:_0x14d846,groupLabel:_0x998719,commands:_0x34e270}=_0x411373,_0x21f44d=ii(_0x17e9b1,_0x34e270)['map'](_0xca143c=>({'id':_0xca143c['id'],'label':_0xca143c['label']}));return{'id':_0x14d846,'menu':_0x998719||_0x14d846,'children':_0x21f44d};});}(_0x54971f),{'ariaLabel':Jn(_0x3489db,'AI\x20Commands')}),_0x261b85['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x35194c['on']('change:enabledCommandsIds',_0x4461bb),_0x261b85['menuView']['once']('render',_0x4461bb),_0x261b85;function _0x4461bb(){_0x261b85['isEnabled']=_0x35194c['enabledCommandsIds']['length']>0x0;for(const _0x40c3bb of _0x261b85['menuView']['buttons'])_0x40c3bb['isEnabled']=_0x35194c['enabledCommandsIds']['includes'](_0x40c3bb['id']);}}),_0x54971f['ui']['componentFactory']['add']('menuBar:aiCommands',_0x38520a=>{const _0x32aa9c=new _0x2584a5(_0x38520a);_0x32aa9c['buttonView']['set']({'label':Jn(_0x38520a,'AI\x20Commands'),'icon':_0x4c13c4}),_0x32aa9c['bind']('isEnabled')['to'](_0x35194c,'enabledCommandsIds',_0x31b33a=>_0x31b33a['length']>0x0);const _0x46e4d3=k(_0x54971f['config']['get']('ai.assistant.commands'),_0x38520a);return this['_populateMenuBarMenu'](_0x35194c,_0x32aa9c,_0x46e4d3,_0x81cfa4=>this['_onExecute'](_0x81cfa4)),_0x32aa9c;}),_0x54971f['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x443a6e=this['_createAIAssistantUIButton'](_0xb98904);return _0x443a6e['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x443a6e;}),_0x54971f['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x552608=this['_createAIAssistantUIButton'](_0x141439);return _0x552608['set']({'role':'menuitemcheckbox'}),_0x552608;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x4cb8aa=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x55d3c6;for(const _0x49095b in _0x4cb8aa){const _0x1bfc37=_0x49095b,_0x1ede1b=_0x4cb8aa[_0x1bfc37];if('aiLicenseKeyValid'==_0x1ede1b||'aiLicenseKeyInvalid'==_0x1ede1b||'aiLicenseKeyExpired'==_0x1ede1b||'aiLicenseKeyDomainLimit'==_0x1ede1b||'aiLicenseKeyNotAllowed'==_0x1ede1b||'aiLicenseKeyEvaluationLimit'==_0x1ede1b||'aiLicenseKeyTrialLimit'==_0x1ede1b||'aiLicenseKeyUsageLimit'==_0x1ede1b){delete _0x4cb8aa[_0x1bfc37],_0x55d3c6=_0x1ede1b,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x55d3c6&&_0x4cb8aa['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x55d3c6&&_0x4cb8aa['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x55d3c6&&_0x4cb8aa['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x55d3c6&&_0x4cb8aa['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x55d3c6&&_0x4cb8aa['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x55d3c6&&_0x4cb8aa['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x55d3c6&&_0x4cb8aa['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x523471='',_0x26a312='',_0x7ba15d='custom'){const _0x36abeb=this['editor'],_0x5da007=_0x36abeb['editing']['view'],_0x23ad72=_0x36abeb['plugins']['get'](T),_0x4bd64b=_0x36abeb['plugins']['get'](_0x3ad265);_0x23ad72['showFakeVisualSelection']();const _0x1a16ad=new P(),_0x289235=new ClipboardEvent('copy',{'clipboardData':_0x1a16ad}),_0xfcfe99=new _0x1d00e0(_0x1a16ad),_0xcaac80=new _0x4312a7(_0x5da007,_0x289235,{'dataTransfer':_0xfcfe99});_0x4bd64b['_forceMarkersCopy']('comment',()=>{_0x5da007['document']['fire']('copy',_0xcaac80);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new Q(_0x36abeb,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x875ceb=_0xfcfe99['getData']('text/html');const _0x3489a3=_0x36abeb['model']['document']['selection'],_0x593ad8=Array['from'](_0x3489a3['getRanges']());0x1===_0x593ad8['length']&&_0x593ad8[0x0]['isFlat']&&!_0x3489a3['getSelectedElement']()&&''!==_0x875ceb['replace'](/&nbsp;/g,'')['trim']()&&(_0x875ceb='<p>'+_0x875ceb+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x7ba15d,'query':_0x523471,'htmlContent':_0x875ceb,'label':_0x26a312,'mainActionLabel':X[_0x36abeb['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x65fc61,'title':Jn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x26a1f9['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x23ad72['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x56987c=new Map(),_0x57f77e=k(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x5d4641 of _0x57f77e)for(const _0xfdc7d5 of _0x5d4641['commands'])_0x56987c['set'](_0xfdc7d5['id'],{..._0xfdc7d5,'groupId':_0x5d4641['groupId'],'groupLabel':_0x5d4641['groupLabel']||_0x5d4641['groupId']});return _0x56987c;}['_createAIAssistantUIButton'](_0x4673ba){const _0x309cfd=this['editor'],_0x3b3eeb=_0x309cfd['commands']['get']('showAIAssistant'),_0x477a00=new _0x4673ba(_0x309cfd['locale']);return _0x477a00['set']({'label':Jn(_0x309cfd['locale'],'AI\x20Assistant'),'icon':_0x65fc61,'isToggleable':!0x0}),_0x477a00['bind']('isEnabled')['to'](_0x3b3eeb),_0x477a00['bind']('isOn')['to'](this['_dialog'],'id',_0xeb0e40=>'aiAssistant'===_0xeb0e40),this['listenTo'](_0x477a00,'execute',()=>{_0x477a00['isOn']?this['hideUI']():_0x3b3eeb['execute']();}),_0x477a00;}['_initView'](){const _0x5b4e5a=this['editor']['plugins']['get'](T);this['_formView']=new W(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',()=>{_0x5b4e5a['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x5b4e5a['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x35eeab,ui:{ariaLiveAnnouncer:_0xd6c20e}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x133483,_0xac9ffa,_0x3291e2)=>{const _0x1bc16f=this['_aiAssistantController']['currentContext'];_0x3291e2?_0xd6c20e['announce'](Jn(_0x35eeab,'AI\x20is\x20writing')):_0x1bc16f&&_0xd6c20e['announce'](Jn(_0x35eeab,'Generated\x20content:\x20%0',_0x1bc16f),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x35e115,_0x12f8d0,_0x41104b)=>{if(_0x41104b){const _0x4ad61e=this['_formView']['errorView']['text'];_0xd6c20e['announce'](Jn(_0x35eeab,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x4ad61e));}});}['_onExecute'](_0x3eb8ff){const _0x2e262b=this['_commandDefinitions']['get'](_0x3eb8ff),_0x3761d5=this['editor'],_0x4585d2=_0x3761d5['model']['document']['selection'],_0x54c8db=_0x3761d5['commands']['get']('showAIAssistant'),_0xff0835=_0x3761d5['plugins']['get'](T),_0xf6162b=''+(_0x2e262b['groupId']!==R?_0x2e262b['groupLabel']+':\x20':'')+_0x2e262b['label'];if(!0x1!==_0x2e262b['requiresContent']&&_0x4585d2['isCollapsed']){const _0x22dc8f=_0x53efcd(_0x4585d2['getSelectedBlocks']())||_0x3761d5['model']['schema']['getLimitElement'](_0x4585d2);_0x3761d5['model']['change'](_0x29f430=>{_0x29f430['setSelection'](_0x22dc8f,'in');});}_0xff0835['showFakeVisualSelection'](),_0x54c8db['execute'](_0x2e262b['prompt'],_0xf6162b,'command:'+_0x3eb8ff);}['_populateMenuBarMenu'](_0x1e7dec,_0xe9b3a,_0x29cd5d,_0x27ca39){const _0x4c099b=this['editor'],_0x1b101f=_0x4c099b['locale'],_0x5d1fe3=new _0x321b73(_0x1b101f),_0x96f414=ii(_0x4c099b,_0x29cd5d)['filter'](_0x53f9f7=>_0x53f9f7['commands']['length']);0x1===_0x96f414['length']?this['_getMenuBarGroupButtons']({'command':_0x1e7dec,'commands':_0x96f414[0x0]['commands'],'parentMenuView':_0xe9b3a,'onExecute':_0x27ca39})['forEach'](_0x35ff05=>_0x5d1fe3['items']['add'](_0x35ff05)):_0x96f414['forEach'](({groupId:_0x235ea3,groupLabel:_0x327724,commands:_0x5fc42d})=>{const _0x1a596e=new _0x4ac858(_0x1b101f,_0xe9b3a),_0x296db8=new _0x2584a5(_0x1b101f),_0x530e4a=new _0x321b73(_0x1b101f),_0x372200=this['_getMenuBarGroupButtons']({'command':_0x1e7dec,'commands':_0x5fc42d,'parentMenuView':_0x296db8,'onExecute':_0x27ca39});_0x296db8['buttonView']['set']({'label':_0x327724||_0x235ea3}),_0x296db8['delegate']('execute')['to'](_0xe9b3a),_0x530e4a['items']['addMany'](_0x372200),_0x296db8['panelView']['children']['add'](_0x530e4a),_0x1a596e['children']['add'](_0x296db8),_0x5d1fe3['items']['add'](_0x1a596e);}),_0xe9b3a['panelView']['children']['add'](_0x5d1fe3);}['_getMenuBarGroupButtons']({command:_0x3a68ad,commands:_0x14b54a,parentMenuView:_0x317731,onExecute:_0xc75c2}){const _0x19bc3e=this['editor'],_0x5a0697=_0x19bc3e['locale'];return ii(_0x19bc3e,_0x14b54a)['map'](_0x35b33f=>{const _0x34a614=new _0x4ac858(_0x5a0697,_0x317731),_0x4de0c1=new _0x141439(_0x5a0697);return _0x4de0c1['set']({'label':_0x35b33f['label']}),_0x4de0c1['delegate']('execute')['to'](_0x317731),_0x4de0c1['on']('execute',()=>_0xc75c2(_0x35b33f['id'])),_0x4de0c1['bind']('isEnabled')['to'](_0x3a68ad,'enabledCommandsIds',_0x4c957a=>_0x4c957a['includes'](_0x35b33f['id'])),_0x34a614['children']['add'](_0x4de0c1),_0x34a614;});}}function Z(_0x4eccae,_0x4344ed){return void 0x0!==_0x4eccae['order']&&void 0x0===_0x4344ed['order']?0x1:void 0x0===_0x4eccae['order']&&void 0x0!==_0x4344ed['order']?-0x1:void 0x0!==_0x4eccae['order']&&void 0x0!==_0x4344ed['order']?_0x4eccae['order']-_0x4344ed['order']:0x0;}function ii(_0x4847f4,_0x3de201){_0x3de201['sort'](Z);const _0x250f28={},_0x5cd57c=[];for(const _0x3926f8 of _0x3de201)if(void 0x0!==_0x3926f8['order']){if(_0x3926f8['order']in _0x250f28)throw new _0x5e86d1('ai-commands-config-order-collision',_0x4847f4,{'conflictingDefinitions':[_0x3926f8,_0x250f28[_0x3926f8['order']]]});_0x250f28[_0x3926f8['order']]=_0x3926f8,_0x5cd57c['splice'](_0x3926f8['order'],0x0,_0x3926f8);}else _0x5cd57c['push'](_0x3926f8);return _0x5cd57c;}class Or extends _0x59916e{static get['requires'](){return[x,T];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xac4b97){super(_0xac4b97);const _0x3f1b5a=_0xac4b97['config'],_0x335fdc=_0xac4b97['locale'];_0x3f1b5a['define']('ai.assistant.preserveComments',!0x0),_0x3f1b5a['define']('ai.assistant.commands',Nr(_0x335fdc)),_0x3f1b5a['define']('ai.assistant.extraCommandGroups',[]),_0x3f1b5a['define']('ai.assistant.removeCommands',[]);let _0x5d9a6c=k(_0x3f1b5a['get']('ai.assistant.commands'),_0x335fdc);const _0x1800ce=_0x3f1b5a['get']('ai.assistant.extraCommandGroups'),_0x3974c2=_0x3f1b5a['get']('ai.assistant.removeCommands');_0x1800ce['forEach'](_0x322b84=>{const _0x53917a=_0x5d9a6c['find'](_0x387f14=>_0x387f14['groupId']===_0x322b84['groupId']);_0x53917a?_0x53917a['commands']=_0x53917a['commands']['concat'](_0x322b84['commands']):_0x5d9a6c['push'](_0x322b84);}),_0x5d9a6c=_0x5d9a6c['filter'](_0x1a6b52=>!_0x3974c2['includes'](_0x1a6b52['groupId'])),_0x5d9a6c['forEach'](_0x5279f4=>{_0x5279f4['commands']=_0x5279f4['commands']['filter'](_0x5726b9=>!_0x3974c2['includes'](_0x5726b9['id']));}),_0x3f1b5a['set']('ai.assistant.commands',_0x5d9a6c);}}function Nr(_0x9e68c7){return[{'groupId':'editOrReview','groupLabel':Jn(_0x9e68c7,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Jn(_0x9e68c7,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Jn(_0x9e68c7,'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':Jn(_0x9e68c7,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Jn(_0x9e68c7,'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':Jn(_0x9e68c7,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Jn(_0x9e68c7,'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':Jn(_0x9e68c7,'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':Jn(_0x9e68c7,'Change\x20tone'),'commands':[{'id':'professional','label':Jn(_0x9e68c7,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Jn(_0x9e68c7,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Jn(_0x9e68c7,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Jn(_0x9e68c7,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Jn(_0x9e68c7,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Jn(_0x9e68c7,'Change\x20style'),'commands':[{'id':'business','label':Jn(_0x9e68c7,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Jn(_0x9e68c7,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Jn(_0x9e68c7,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Jn(_0x9e68c7,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Jn(_0x9e68c7,'Translate'),'commands':[{'id':'translateEnglish','label':Jn(_0x9e68c7,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Jn(_0x9e68c7,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Jn(_0x9e68c7,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Jn(_0x9e68c7,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Jn(_0x9e68c7,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Jn(_0x9e68c7,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Jn(_0x9e68c7,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Jn(_0x9e68c7,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class we extends _0x59916e{['abortController'];static get['requires'](){return[F];}constructor(_0x4c559d){super(_0x4c559d),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](F)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x242679){return this['sendRequest'](_0x242679)['catch'](_0x3d7e5c=>{if(_0x3d7e5c instanceof is)return Promise['reject'](_0x3d7e5c);if('AbortError'==_0x3d7e5c['name'])return Promise['resolve']();throw console['error'](_0x3d7e5c),new _0x5e86d1('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x257b7a,_0x1bbbc2){const _0x2d5d89=this['editor']['locale'],_0x384974={'Content-Type':'application/json'};if('object'==typeof _0x257b7a)Object['assign'](_0x384974,_0x257b7a);else{if(_0x257b7a)try{const _0x456da8=await _0x257b7a(_0x1bbbc2);Object['assign'](_0x384974,_0x456da8);}catch{return Promise['reject'](new is(Jn(_0x2d5d89,'AI_ERROR_GET_HEADERS')));}}return _0x384974;}async['_prepareRequestParameters'](_0x1f96b7,_0x4315a7){const _0x1aae0e=this['editor']['locale'];if('object'==typeof _0x1f96b7)return _0x1f96b7;try{return await _0x1f96b7(_0x4315a7);}catch{return Promise['reject'](new is(Jn(_0x1aae0e,'AI_ERROR_GET_PARAMETERS')));}}}class Hr extends we{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x569a90){super(_0x569a90),_0x569a90['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x569a90['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x569a90['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x569a90['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x569a90['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x569a90['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x280eb1,context:_0x28679f,onData:_0x163b2d,actionId:_0x458708}){const _0x1d5b19=this['editor']['locale'],_0x521f1e=await this['prepareMessages'](_0x280eb1,_0x28679f,_0x458708),_0x2b54b3=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x458708),_0x54128e=await this['_prepareRequestParameters'](this['_requestParameters'],_0x458708),_0x1b7242={'messages':_0x521f1e,..._0x54128e},_0x484c5c={'method':'POST','headers':_0x2b54b3,'body':JSON['stringify'](_0x1b7242),'signal':this['abortController']['signal']},_0x57ac9c=await fetch(this['_apiUrl'],_0x484c5c);if(_0x57ac9c['ok'])return _0x54128e['stream']?await this['_readStreamableResponse'](_0x57ac9c,_0x163b2d):await this['_readStaticResponse'](_0x57ac9c,_0x163b2d),Promise['resolve']();{const _0x7e415d=await _0x57ac9c['text']();return _0x7e415d['includes']('context_length_exceeded')?Promise['reject'](new is(Jn(_0x1d5b19,'AI_ERROR_CONTEXT_LENGTH'))):_0x7e415d['includes']('Moderation')?Promise['reject'](new is(Jn(_0x1d5b19,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x7e415d));}}async['prepareMessages'](_0x30c603,_0x1ae4dd,_0x5b0c74){let _0x16943a,_0xdb12aa;return _0x1ae4dd?(_0x16943a='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.',_0xdb12aa='Instruction:\x0a'+_0x30c603+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x1ae4dd):(_0x16943a='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.',_0xdb12aa=_0x30c603),[{'role':'system','content':_0x16943a},{'role':'user','content':_0xdb12aa}];}async['_readStreamableResponse'](_0x26da2f,_0x5afb8b){const _0x1378df=_0x26da2f['body']['getReader'](),_0x46d296=new TextDecoder();let _0x50ac45='',_0x496074='',_0x299a67='',_0x1fd6a9=!0x1;for(;!_0x1fd6a9;){const {done:_0x275850,value:_0xec3181}=await _0x1378df['read'](),_0x567f5f=_0x50ac45+_0x46d296['decode'](_0xec3181);let _0x5d8b3c='';_0x1fd6a9=_0x275850;try{_0x5d8b3c=this['_cleanUpData'](_0x567f5f),_0x50ac45='';}catch{_0x50ac45=_0x567f5f;continue;}_0x496074+=_0x5d8b3c,!_0x1fd6a9&&this['_isBufferIncomplete'](_0x496074)||_0x496074&&(_0x299a67+=_0x496074,_0x496074='',_0x5afb8b(_0x299a67));}return Promise['resolve']();}async['_readStaticResponse'](_0x503342,_0x41df3f){return _0x41df3f((await _0x503342['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x2c8e15){const _0x47b928=_0x2c8e15['split']('<')['length']!==_0x2c8e15['split']('>')['length'],_0x5221e9=_0x2c8e15['length']<0x1e;return _0x47b928&&_0x5221e9;}['_cleanUpData'](_0x3b021b){return _0x3b021b['split'](/\n(?![^{]*\})/g)['map'](_0x240cb8=>_0x240cb8['replace']('data:\x20',''))['filter'](_0x4ee45d=>_0x4ee45d&&_0x4ee45d['length']>0x0&&'[DONE]'!==_0x4ee45d)['map'](_0x3cda68=>{const {choices:_0x38cf02}=JSON['parse'](_0x3cda68);if(_0x38cf02[0x0]?.['delta']?.['content'])return _0x38cf02[0x0]['delta']['content'];})['filter'](_0xa22d2c=>_0xa22d2c)['join']('');}}class Kr extends we{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x51e1b2){super(_0x51e1b2),_0x51e1b2['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x51e1b2['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']=_0x51e1b2['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x51e1b2['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x51e1b2['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x51e1b2['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x2cefd4,context:_0x577646,onData:_0x49d2f5,actionId:_0xc4c7c5}){const {model:_0x545b77,stream:_0x54f279,..._0x45cfbe}=await this['_prepareRequestParameters'](this['_requestParameters'],_0xc4c7c5),_0x37e7a1={'prompt':await this['preparePrompt'](_0x2cefd4,_0x577646,_0x545b77,_0xc4c7c5),..._0x45cfbe};this['_apiUrl']?await this['_processProxyRequest'](_0x37e7a1,_0x545b77,_0x54f279,_0x49d2f5,_0xc4c7c5):await this['_processAWSRequest'](_0x37e7a1,_0x545b77,_0x54f279,_0x49d2f5);}async['preparePrompt'](_0x5afcf3,_0x2582d1,_0x5615ae,_0x114a68){let _0x359105,_0x52c4ca;return _0x2582d1?(_0x359105='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.',_0x52c4ca='Instruction:\x0a'+_0x5afcf3+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x2582d1):(_0x359105='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.',_0x52c4ca=_0x5afcf3),'meta.llama'==this['getModelFamily'](_0x5615ae)?'<<SYS>>\x0a'+_0x359105+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x52c4ca+'\x0a[/INST]':'Human:\x0a'+_0x359105+'\x0a'+_0x52c4ca+'\x0a\x0aAssistant:';}['getModelFamily'](_0x595e1d){if(/^anthropic\.claude/['test'](_0x595e1d))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x595e1d))return'ai21.j2';if(/^cohere\.command/['test'](_0x595e1d))return'cohere.command';if(/^meta\.llama/['test'](_0x595e1d))return'meta.llama';throw new is(Jn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x595e1d));}async['_processProxyRequest'](_0xc6eb63,_0x32f295,_0x4005cb,_0x5a021b,_0x4820a2){const _0x341fae={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x4820a2),'body':JSON['stringify']({..._0xc6eb63,'model':_0x32f295,'stream':_0x4005cb}),'signal':this['abortController']['signal']},_0x69f7e1=await fetch(this['_apiUrl'],_0x341fae);_0x4005cb?await this['_readStreamableResponse'](_0x69f7e1,_0x32f295,_0x5a021b):await this['_readStaticResponse'](_0x69f7e1,_0x32f295,_0x5a021b);}async['_processAWSRequest'](_0x2148c8,_0xc3a755,_0x4315da,_0x420040){const _0x2481af=new _0x5b2913(this['_bedrockClientConfig']),_0x224f89={'body':JSON['stringify'](_0x2148c8),'contentType':'application/json','accept':'application/json','modelId':_0xc3a755};let _0x271619;if(_0x4315da){const _0x4566f6=new _0x3d3fc4(_0x224f89);_0x271619=await _0x2481af['send'](_0x4566f6,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x271619,_0xc3a755,_0x420040);}else{const _0x16e890=new _0x161923(_0x224f89);_0x271619=await _0x2481af['send'](_0x16e890,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x271619,_0xc3a755,_0x420040);}}async['_readAsyncIterableResponse'](_0x329171,_0x3617e6,_0x3db550){const _0x38a18a=_0x329171['body'],_0x246080=new TextDecoder('utf-8');let _0x1b3da8='';for await(const _0xd70aaf of _0x38a18a)if(_0xd70aaf['chunk']){const _0x30045b=_0x246080['decode'](_0xd70aaf['chunk']['bytes']),_0x446a8f=JSON['parse'](_0x30045b);_0x1b3da8+=this['_getGeneratedText'](_0x446a8f,_0x3617e6),_0x3db550(_0x1b3da8);}return Promise['resolve']();}async['_readStreamableResponse'](_0x45bb46,_0x367dbb,_0xfdb9eb){const _0x5822aa=_0x45bb46['body'],_0x54130d=new TextDecoder('utf-8'),_0x3c53f3=_0x5822aa['getReader']();let _0x5b70b9='',_0x124cc8='',_0x501477=!0x1;for(;!_0x501477;){const {done:_0x28f968,value:_0x2ec6c8}=await _0x3c53f3['read']();if(_0x501477=_0x28f968,_0x501477)break;const _0x7415a4=(_0x5b70b9+_0x54130d['decode'](_0x2ec6c8))['split']('\x0a')['map'](_0x19efc4=>{try{return _0x5b70b9='',JSON['parse'](_0x19efc4);}catch{return _0x5b70b9=_0x19efc4,null;}})['filter'](_0x9117fc=>null!==_0x9117fc);_0x7415a4['length']&&(_0x124cc8+=_0x7415a4['map'](_0x437d69=>this['_getGeneratedText'](_0x437d69,_0x367dbb))['join'](''),_0xfdb9eb(_0x124cc8));}return Promise['resolve']();}async['_readStaticResponse'](_0x1edfe2,_0x7c1ed6,_0x49d0b9){let _0x488a0b;return _0x488a0b=_0x1edfe2 instanceof Response?await _0x1edfe2['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x1edfe2['body'])),(_0x49d0b9(this['_getGeneratedText'](_0x488a0b,_0x7c1ed6)),Promise['resolve']());}['_getGeneratedText'](_0x2294b8,_0x5883f4){switch(this['getModelFamily'](_0x5883f4)){case'anthropic.claude':return _0x2294b8['completion'];case'ai21.j2':return _0x2294b8['completions'][0x0]['data']['text'];case'cohere.command':return _0x2294b8['generations'][0x0]['text'];case'meta.llama':return _0x2294b8['generation'];}}}class Ks extends _0xb98904{constructor(_0x4c7cf2,_0x2ced50={}){super(_0x4c7cf2),this['isToggleable']=!0x0,this['set']('side',_0x2ced50['side']||'top');const _0x51a3bc=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x4d54b9(_0x2ced50['class']||[]),_0x51a3bc['to']('side',_0x2c74b5=>'ck-tab-button_'+_0x2c74b5),_0x51a3bc['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class Qs extends _0x14b3a2{['children'];constructor(_0xb80837,_0x1b17f1={}){super(_0xb80837);const _0x41d2d4=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x4d54b9(_0x1b17f1['class']||[]),_0x41d2d4['to']('class'),_0x41d2d4['if']('isVisible','ck-hidden',_0x4910a9=>!_0x4910a9)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x14b3a2{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x4d20ce,_0x40e807={}){super(_0x4d20ce),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x40e807['side']||'top'),this['set']('isMaximized',!0x1);const _0x424667=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x4d54b9(_0x40e807['class']||[]),_0x424667['to']('side',_0x330334=>'ck-tabs_'+_0x330334),_0x424667['to']('class'),_0x424667['to']('isMaximized',_0x53bbbe=>_0x53bbbe?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x424667['to']('side',_0x36c13f=>'ck-tabs__buttons-container_'+_0x36c13f)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x424667['to']('side',_0x10f6c0=>'ck-tabs__panels-container_'+_0x10f6c0)]},'children':this['panelViews']},..._0x4d54b9(_0x40e807['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x50f56a){const _0x1ca73d=this['_tabs']['get'](_0x50f56a);return _0x1ca73d||null;}['addTab'](_0x26112e){const _0x628237=this['_setupButton']({'id':_0x26112e['id'],'label':_0x26112e['buttonLabel'],'icon':_0x26112e['buttonIcon'],'order':_0x26112e['order']}),_0x3fce0c=new Qs(this['locale']);return _0x3fce0c['render'](),_0x26112e['content']&&_0x3fce0c['children']['add'](_0x26112e['content']),this['panelViews']['add'](_0x3fce0c),this['_tabs']['set'](_0x26112e['id'],{'button':_0x628237,'panel':_0x3fce0c,'order':void 0x0!==_0x26112e['order']?_0x26112e['order']:null}),this['fire']('addTab:'+_0x26112e['id'],{'id':_0x26112e['id'],'button':_0x628237,'panel':_0x3fce0c}),null===this['activeTab']?this['activateTab'](_0x26112e['id']):this['_hidePanel'](_0x26112e['id']),{'button':_0x628237,'panel':_0x3fce0c};}['activateTab'](_0x82cb33){if(null!==_0x82cb33&&!this['getTab'](_0x82cb33))throw new _0x5e86d1('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x82cb33});this['activeTab']!==_0x82cb33&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x82cb33,_0x82cb33&&this['_showPanel'](_0x82cb33),this['fire']('activateTab:'+_0x82cb33,_0x82cb33));}['showTab'](_0x5b53e5){if(!this['getTab'](_0x5b53e5))throw new _0x5e86d1('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x5b53e5});this['_showPanel'](_0x5b53e5),this['_showButton'](_0x5b53e5),this['fire']('show:'+_0x5b53e5,_0x5b53e5);}['hideTab'](_0x54a7d1){if(!this['getTab'](_0x54a7d1))throw new _0x5e86d1('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x54a7d1});const _0x21913d=this['activeTab'];this['_hidePanel'](_0x54a7d1),this['_hideButton'](_0x54a7d1);const _0x57e740=this['getTabIds']();_0x21913d===_0x54a7d1&&_0x57e740['length']>0x1&&this['activateTab'](_0x57e740['find'](_0x40a8f7=>_0x40a8f7!==_0x54a7d1)),this['fire']('hide:'+_0x54a7d1,_0x54a7d1);}['_getPanel'](_0x2c75ee){const _0x5efbc6=this['_tabs']['get'](_0x2c75ee);return _0x5efbc6?_0x5efbc6['panel']:null;}['_showPanel'](_0x368560){null!==this['activeTab']&&this['activeTab']!==_0x368560||this['_getPanel'](_0x368560)['show']();}['_hidePanel'](_0x16dea6){const _0x3b0777=this['_getPanel'](_0x16dea6);_0x3b0777['isVisible']&&(this['activeTab']===_0x16dea6&&(this['activeTab']=null),_0x3b0777['hide']());}['_getButton'](_0x1f2df3){const _0xeb4b00=this['_tabs']['get'](_0x1f2df3);return _0xeb4b00?_0xeb4b00['button']:null;}['_showButton'](_0x53110e){this['_getButton'](_0x53110e)['show']();}['_hideButton'](_0x5f2678){this['_getButton'](_0x5f2678)['hide']();}['_setupButton'](_0xc3edde){const _0x19029d=new Ks(this['locale'],{'side':this['side']}),_0x164959=this['buttonViews'];if(_0x19029d['set']({'label':_0xc3edde['label'],'icon':_0xc3edde['icon'],'tooltip':!0x0,'withText':!0x0}),_0x19029d['bind']('isOn')['to'](this,'activeTab',_0x20b41f=>_0x20b41f===_0xc3edde['id']),_0x19029d['bind']('side')['to'](this,'side'),_0xc3edde['order']){const _0x3c2695=[...this['_tabs']]['reduce']((_0x402787,_0x3c4eba)=>{const _0x57d97f=_0x3c4eba[0x0],{order:_0xc4979}=_0x3c4eba[0x1];return!_0xc4979||_0xc4979>_0xc3edde['order']?_0x402787:_0xc4979>=_0x402787['order']?{'id':_0x57d97f,'order':_0xc4979}:_0x402787;},{'id':'','order':0x0}),_0x4f0733=_0x164959['getIndex'](this['_getButton'](_0x3c2695['id']));_0x164959['add'](_0x19029d,_0x4f0733+0x1);}else _0x164959['add'](_0x19029d);return _0x19029d['on']('execute',()=>{this['activateTab'](_0xc3edde['id']);}),_0x19029d;}}const wi=['overlay','sidebar','custom'],pi=['left','right'];class ui extends ss{constructor(_0x42be03,_0x409faa={}){super(_0x42be03,_0x409faa),this['set']('type',_0x409faa['type']||'sidebar'),this['set']('side',_0x409faa['side']||'right'),this['set']('isVisible',!0x0);const _0x41dd4a=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x41dd4a['if']('type','ck-ai-tabs__overlay',_0x56db18=>'overlay'===_0x56db18),_0x41dd4a['if']('type','ck-ai-tabs__sidebar',_0x47163f=>'sidebar'===_0x47163f),_0x41dd4a['if']('isVisible','ck-hidden',_0x45a86d=>!_0x45a86d)]}}),this['buttonViews']['on']('add',(_0x486f8f,_0x35010a)=>{_0x35010a['set']('withText',!0x1);});}}class rt extends tt{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xf747af){super(_0xf747af);const _0xbe48f2=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0xbe48f2)throw new _0x5e86d1('ai-tabs-configuration-not-found');if(void 0x0!==_0xbe48f2['showResizeButton']&&(this['showResizeButton']=_0xbe48f2['showResizeButton']),'sidebar'!==_0xbe48f2['type']&&'overlay'!==_0xbe48f2['type']||_0xbe48f2['side']&&(this['side']=_0xbe48f2['side']),'sidebar'===_0xbe48f2['type']){if(this['container']=_0xbe48f2['element'],this['set']('type','sidebar'),!this['container'])throw new _0x5e86d1('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0xbe48f2['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'](_0x229542){if(_0x229542&&this['type']!==_0x229542){if(!wi['includes'](_0x229542))throw new _0x5e86d1('ai-tabs-unsupported-ui-type');this['type']=_0x229542;}}['switchSide'](_0x5b8282){if(_0x5b8282&&this['side']!==_0x5b8282){if(!pi['includes'](_0x5b8282))throw new _0x5e86d1('ai-tabs-unsupported-ui-side');this['side']=_0x5b8282;}}['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 w(_0x14865a,_0x478af8,_0x3b79b6){const t=_0x14865a['t'];switch(_0x478af8){case'AI_SUGGESTION_HEADER_TITLE':return t({'id':'AI_SUGGESTION_HEADER_TITLE','string':'Proposed\x20changes'});case'AI_SUGGESTION_BUTTON_SHOW_CHANGES':return t({'id':'AI_SUGGESTION_BUTTON_SHOW_CHANGES','string':'Show\x20details'});case'AI_MINI_TOOLBAR_LIKE':return t({'id':'AI_MINI_TOOLBAR_LIKE','string':'I\x20like\x20this\x20response'});case'AI_MINI_TOOLBAR_DISLIKE':return t({'id':'AI_MINI_TOOLBAR_DISLIKE','string':'I\x20don\x27t\x20like\x20this\x20response'});case'AI_MINI_TOOLBAR_COPY':return t({'id':'AI_MINI_TOOLBAR_COPY','string':'Copy\x20to\x20clipboard'});case'AI_SUGGESTION_CONTENT_PART_TITLE':return t({'id':'AI_SUGGESTION_CONTENT_PART_TITLE','string':'Change\x20%0'},_0x3b79b6);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':'Preview'});case'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION','string':'Insert\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_DELETE':return t({'id':'AI_SUGGESTION_CONTENT_PART_DELETE','string':'Reject'});case'AI_DISCLAIMER_TEXT':return t({'id':'AI_DISCLAIMER_TEXT','string':'AI\x20can\x20make\x20mistakes.\x20Please\x20double-check\x20responses.'});case'AI_TABS_LABEL_MAXIMIZE':return t({'id':'AI_TABS_LABEL_MAXIMIZE','string':'Maximize'});case'AI_TABS_LABEL_MINIMIZE':return t({'id':'AI_TABS_LABEL_MINIMIZE','string':'Minimize'});case'AI_CHAT_HEADING':return t({'id':'AI_CHAT_HEADING','string':'Chat'});case'AI_CHAT_SOURCES_HEADER':return t({'id':'AI_CHAT_SOURCES_HEADER','string':'Sources'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi,\x20I\x27m\x20your\x20AI\x20assistant.\x20Think\x20of\x20me\x20as\x20your\x20writing\x20buddy,\x20reviewer,\x20or\x20research\x20partner.\x20I\x20can\x20suggest\x20changes\x20to\x20your\x20document,\x20help\x20generate\x20ideas,\x20offer\x20feedback,\x20discuss\x20attached\x20files,\x20and\x20much\x20more!'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'The\x20request\x20was\x20aborted.'});case'AI_CHAT_GENERIC_ERROR':return t({'id':'AI_CHAT_GENERIC_ERROR','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_START_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_START_CONVERSATION','string':'Unable\x20to\x20start\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE','string':'Failed\x20to\x20upload\x20files:\x20%0.\x20Please\x20try\x20again.'},_0x3b79b6);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.'},_0x3b79b6);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.'},_0x3b79b6);case'AI_CHAT_CONTEXT_INVALID_DATA':return t({'id':'AI_CHAT_CONTEXT_INVALID_DATA','string':'Invalid\x20context\x20data\x20type\x20for\x20the\x20selected\x20resource.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE','string':'Unsupported\x20resource\x20type.\x20Only\x20files\x20and\x20URLs\x20are\x20supported.'});case'AI_CHAT_CONTEXT_URL_EMPTY_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_EMPTY_ERROR','string':'URL\x20cannot\x20be\x20empty.'});case'AI_CHAT_CONTEXT_URL_INVALID_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_INVALID_ERROR','string':'Please\x20enter\x20a\x20valid\x20URL.'});case'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR','string':'AI\x20is\x20preparing\x20a\x20response...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH','string':'AI\x20is\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REASONING','string':'AI\x20is\x20using\x20reasoning\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING','string':'AI\x20is\x20using\x20reasoning\x20and\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH','string':'Scanned\x20the\x20internet\x20for\x20insights'});case'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING','string':'AI\x20used\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING','string':'AI\x20used\x20search\x20and\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR','string':'Ask\x20AI\x20anything...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH','string':'Ask\x20AI\x20anything\x20(web\x20search\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING','string':'Ask\x20AI\x20anything\x20(reasoning\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING','string':'Ask\x20AI\x20anything\x20(web\x20search\x20and\x20reasoning\x20enabled)...'});case'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT','string':'Preview','plural':'Preview'},_0x3b79b6);case'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP','string':'Show\x20change\x20in\x20the\x20document','plural':'Show\x20changes\x20in\x20the\x20document'},_0x3b79b6);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION','string':'Suggest','plural':'Suggest'},_0x3b79b6);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP','string':'Insert\x20change\x20as\x20suggestion','plural':'Insert\x20changes\x20as\x20suggestions'},_0x3b79b6);case'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL','string':'Apply','plural':'Apply\x20all'},_0x3b79b6);case'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP','string':'Apply\x20changes\x20immediately','plural':'Apply\x20all\x20changes\x20immediately'},_0x3b79b6);case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x3b79b6);case'AI_CHAT_MODEL_SELECTOR_GROUP':return t({'id':'AI_CHAT_MODEL_SELECTOR_GROUP','string':'Models'});case'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP':return t({'id':'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP','string':'Select\x20a\x20model'});case'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP':return t({'id':'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP','string':'Start\x20a\x20new\x20conversation\x20to\x20change\x20the\x20model'});case'AI_CHAT_CAPABILITIES_YES':return t({'id':'AI_CHAT_CAPABILITIES_YES','string':'Yes'});case'AI_CHAT_CAPABILITIES_NO':return t({'id':'AI_CHAT_CAPABILITIES_NO','string':'No'});case'AI_CHAT_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.'},_0x3b79b6);case'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY':return t({'id':'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY','string':'Please\x20try\x20a\x20different\x20phrase\x20or\x20check\x20the\x20spelling.'});case'AI_CHAT_HISTORY_EMPTY_MESSAGE':return t({'id':'AI_CHAT_HISTORY_EMPTY_MESSAGE','string':'Your\x20chat\x20history\x20for\x20current\x20document\x20will\x20appear\x20here.'});case'AI_CHAT_HISTORY_GO_TO_CHAT_BUTTON':return t({'id':'AI_CHAT_HISTORY_GO_TO_CHAT_BUTTON','string':'Go\x20to\x20chat'});case'AI_CHAT_HISTORY_PIN_BUTTON':return t({'id':'AI_CHAT_HISTORY_PIN_BUTTON','string':'Pin'});case'AI_CHAT_HISTORY_SHOW_MORE_ITEMS':return t({'id':'AI_CHAT_HISTORY_SHOW_MORE_ITEMS','string':'Show\x20more\x20items'});case'AI_CHAT_HISTORY_EDIT_NAME':return t({'id':'AI_CHAT_HISTORY_EDIT_NAME','string':'Edit\x20name'});case'AI_CHAT_HISTORY_REMOVE':return t({'id':'AI_CHAT_HISTORY_REMOVE','string':'Remove'});case'AI_CHAT_HISTORY_REMOVE_CONFIRM':return t({'id':'AI_CHAT_HISTORY_REMOVE_CONFIRM','string':'Do\x20you\x20want\x20to\x20remove\x20this\x20chat?'});case'AI_CHAT_HISTORY_ACCEPT':return t({'id':'AI_CHAT_HISTORY_ACCEPT','string':'Accept'});case'AI_CHAT_HISTORY_CANCEL':return t({'id':'AI_CHAT_HISTORY_CANCEL','string':'Cancel'});case'AI_CHAT_HISTORY_LOADING_REMOVING':return t({'id':'AI_CHAT_HISTORY_LOADING_REMOVING','string':'Removing\x20the\x20chat...'});case'AI_CHAT_HISTORY_LOADING_RENAMING':return t({'id':'AI_CHAT_HISTORY_LOADING_RENAMING','string':'Renaming\x20the\x20chat...'});case'AI_CHAT_HISTORY_LOADING_PINNING':return t({'id':'AI_CHAT_HISTORY_LOADING_PINNING','string':'Pinning\x20the\x20chat...'});case'AI_CHAT_HISTORY_LOADING_UNPINNING':return t({'id':'AI_CHAT_HISTORY_LOADING_UNPINNING','string':'Unpinning\x20the\x20chat...'});case'AI_CHAT_HISTORY_CATEGORY_PINNED':return t({'id':'AI_CHAT_HISTORY_CATEGORY_PINNED','string':'Pinned'});case'AI_CHAT_HISTORY_CATEGORY_TODAY':return t({'id':'AI_CHAT_HISTORY_CATEGORY_TODAY','string':'Today'});case'AI_CHAT_HISTORY_CATEGORY_YESTERDAY':return t({'id':'AI_CHAT_HISTORY_CATEGORY_YESTERDAY','string':'Yesterday'});case'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS':return t({'id':'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS','string':'Last\x2014\x20days'});case'AI_CHAT_HISTORY_CATEGORY_LATER':return t({'id':'AI_CHAT_HISTORY_CATEGORY_LATER','string':'Later'});case'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE':return t({'id':'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE','string':'Failed\x20to\x20change\x20the\x20\x22%0\x22\x20chat\x20name.\x20Please\x20try\x20again\x20later.'},_0x3b79b6);case'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED':return t({'id':'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED','string':'Failed\x20to\x20%0\x20the\x20\x22%1\x22\x20chat.\x20Please\x20try\x20again\x20later.'},_0x3b79b6);case'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM':return t({'id':'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM','string':'Failed\x20to\x20delete\x20the\x20\x22%0\x22\x20chat.\x20Please\x20try\x20again\x20later.'},_0x3b79b6);case'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS':return t({'id':'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS','string':'Failed\x20to\x20load\x20the\x20chat\x20history.\x20Please\x20try\x20again\x20later.'});case'AI_CHAT_HISTORY_ERROR_GENERIC':return t({'id':'AI_CHAT_HISTORY_ERROR_GENERIC','string':'Something\x20went\x20wrong.\x20Please\x20try\x20again\x20later.'});case'AI_CHAT_HISTORY_PIN_ACTION':return t({'id':'AI_CHAT_HISTORY_PIN_ACTION','string':'pin'});case'AI_CHAT_HISTORY_UNPIN_ACTION':return t({'id':'AI_CHAT_HISTORY_UNPIN_ACTION','string':'unpin'});case'AI_BALLOON_HEADER_TITLE':return t({'id':'AI_BALLOON_HEADER_TITLE','string':'Change\x20%0'},_0x3b79b6);case'AI_BALLOON_APPLY_BUTTON':return t({'id':'AI_BALLOON_APPLY_BUTTON','string':'Apply'});case'AI_BALLOON_SUGGEST_BUTTON':return t({'id':'AI_BALLOON_SUGGEST_BUTTON','string':'Suggest'});case'AI_BALLOON_NEXT_TOOLTIP':return t({'id':'AI_BALLOON_NEXT_TOOLTIP','string':'Next'});case'AI_BALLOON_PREVIOUS_TOOLTIP':return t({'id':'AI_BALLOON_PREVIOUS_TOOLTIP','string':'Previous'});case'AI_SUGGESTION_NO_PARTS_WARNING':return t({'id':'AI_SUGGESTION_NO_PARTS_WARNING','string':'This\x20change\x20is\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20of\x20the\x20changes\x20are\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Retry'});case'AI_ACTIONS_PREVIOUS_INTERACTION':return t({'id':'AI_ACTIONS_PREVIOUS_INTERACTION','string':'Previous'});case'AI_ACTIONS_NEXT_INTERACTION':return t({'id':'AI_ACTIONS_NEXT_INTERACTION','string':'Next'});case'AI_MODEL_DESCRIPTION_AGENT-1':return t({'id':'AI_MODEL_DESCRIPTION_AGENT-1','string':'Automatically\x20selects\x20best\x20model\x20for\x20speed,\x20quality,\x20and\x20cost.'});case'AI_MODEL_DESCRIPTION_GPT-5':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5','string':'OpenAI\x27s\x20flagship\x20model\x20for\x20advanced\x20reasoning,\x20creativity,\x20and\x20complex\x20tasks'});case'AI_MODEL_DESCRIPTION_GPT-5-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5-MINI','string':'A\x20lightweight\x20version\x20of\x20GPT-5\x20-\x20faster,\x20more\x20cost-efficient'});case'AI_MODEL_DESCRIPTION_GPT-4.1':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1','string':'OpenAI\x27s\x20model\x20for\x20reliable\x20reasoning,\x20speed,\x20and\x20versatility'});case'AI_MODEL_DESCRIPTION_GPT-4.1-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1-MINI','string':'A\x20lighter\x20variant\x20of\x20GPT-4.1\x20that\x20balances\x20speed\x20and\x20cost\x20while\x20maintaining\x20solid\x20accuracy'});case'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU','string':'Anthropic\x27s\x20fast,\x20cost-efficient\x20model\x20for\x20simpler\x20tasks'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-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_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});case'AI_QUICK_ACTIONS_ASK_AI':return t({'id':'AI_QUICK_ACTIONS_ASK_AI','string':'Ask\x20AI'});case'AI_QUICK_ACTIONS_CHAT_COMMANDS':return t({'id':'AI_QUICK_ACTIONS_CHAT_COMMANDS','string':'Chat\x20commands'});case'AI_QUICK_ACTIONS_IMPROVE_WRITING':return t({'id':'AI_QUICK_ACTIONS_IMPROVE_WRITING','string':'Improve\x20writing'});case'AI_QUICK_ACTIONS_CONTINUE_WRITING':return t({'id':'AI_QUICK_ACTIONS_CONTINUE_WRITING','string':'Continue\x20writing'});case'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING':return t({'id':'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING','string':'Fix\x20grammar\x20&\x20spelling'});case'AI_QUICK_ACTIONS_ADJUST_LENGTH':return t({'id':'AI_QUICK_ACTIONS_ADJUST_LENGTH','string':'Adjust\x20length'});case'AI_QUICK_ACTIONS_CHANGE_TONE':return t({'id':'AI_QUICK_ACTIONS_CHANGE_TONE','string':'Change\x20tone'});case'AI_QUICK_ACTIONS_TRANSLATE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE','string':'Translate'});case'AI_QUICK_ACTIONS_EXPLAIN':return t({'id':'AI_QUICK_ACTIONS_EXPLAIN','string':'Explain'});case'AI_QUICK_ACTIONS_SUMMARIZE':return t({'id':'AI_QUICK_ACTIONS_SUMMARIZE','string':'Summarize'});case'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS':return t({'id':'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS','string':'Highlight\x20key\x20points'});case'AI_QUICK_ACTIONS_MAKE_SHORTER':return t({'id':'AI_QUICK_ACTIONS_MAKE_SHORTER','string':'Make\x20shorter'});case'AI_QUICK_ACTIONS_MAKE_LONGER':return t({'id':'AI_QUICK_ACTIONS_MAKE_LONGER','string':'Make\x20longer'});case'AI_QUICK_ACTIONS_MORE_CASUAL':return t({'id':'AI_QUICK_ACTIONS_MORE_CASUAL','string':'More\x20casual'});case'AI_QUICK_ACTIONS_MORE_DIRECT':return t({'id':'AI_QUICK_ACTIONS_MORE_DIRECT','string':'More\x20direct'});case'AI_QUICK_ACTIONS_MORE_FRIENDLY':return t({'id':'AI_QUICK_ACTIONS_MORE_FRIENDLY','string':'More\x20friendly'});case'AI_QUICK_ACTIONS_MORE_CONFIDENT':return t({'id':'AI_QUICK_ACTIONS_MORE_CONFIDENT','string':'More\x20confident'});case'AI_QUICK_ACTIONS_MORE_PROFESSIONAL':return t({'id':'AI_QUICK_ACTIONS_MORE_PROFESSIONAL','string':'More\x20professional'});case'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT':return t({'id':'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT','string':'Adjust\x20based\x20on\x20the\x20rest\x20of\x20the\x20document'});case'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH','string':'English'});case'AI_QUICK_ACTIONS_TRANSLATE_CHINESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_QUICK_ACTIONS_TRANSLATE_FRENCH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_FRENCH','string':'French'});case'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE','string':'Japanese'});case'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE','string':'Portuguese'});case'AI_QUICK_ACTIONS_TRANSLATE_KOREAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_KOREAN','string':'Korean'});case'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN','string':'Italian'});case'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN','string':'Russian'});case'AI_QUICK_ACTIONS_TRANSLATE_SPANISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_SPANISH','string':'Spanish'});case'AI_QUICK_ACTIONS_TRANSLATE_GERMAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_GERMAN','string':'German'});case'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','string':'%0\x20plugin\x20is\x20required\x20but\x20not\x20found.'},_0x3b79b6);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});case'AI_ACTIONS_GENERIC_ERROR':return t({'id':'AI_ACTIONS_GENERIC_ERROR','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20response.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_REVIEW_MODE_STOP_GENERATING':return t({'id':'AI_REVIEW_MODE_STOP_GENERATING','string':'Stop\x20generating'});case'AI_REVIEW_MODE_HIDE_CHANGES':return t({'id':'AI_REVIEW_MODE_HIDE_CHANGES','string':'Hide\x20changes'});case'AI_REVIEW_MODE_SHOW_CHANGES':return t({'id':'AI_REVIEW_MODE_SHOW_CHANGES','string':'Show\x20changes'});case'AI_REVIEW_MODE_ACCEPT_ALL':return t({'id':'AI_REVIEW_MODE_ACCEPT_ALL','string':'Accept\x20all'});case'AI_REVIEW_MODE_EXIT_REVIEW':return t({'id':'AI_REVIEW_MODE_EXIT_REVIEW','string':'Exit\x20review'});case'AI_REVIEW_MODE_ACCEPT_CHANGE':return t({'id':'AI_REVIEW_MODE_ACCEPT_CHANGE','string':'Accept'});case'AI_REVIEW_MODE_DISMISS_CHANGE':return t({'id':'AI_REVIEW_MODE_DISMISS_CHANGE','string':'Dismiss'});case'AI_REVIEW_MODE_LEARN_MORE':return t({'id':'AI_REVIEW_MODE_LEARN_MORE','string':'Learn\x20more'});case'AI_REVIEW_MODE_COMPLETED_TEXT':return t({'id':'AI_REVIEW_MODE_COMPLETED_TEXT','string':'There\x27s\x20nothing\x20left\x20to\x20review.'});case'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT':return t({'id':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20changes\x20to\x20suggest.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20whole\x20review\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE','string':'Not\x20everything\x20went\x20through,\x20but\x20the\x20completed\x20items\x20are\x20listed\x20below.'});case'AI_REVIEW_MODE':return t({'id':'AI_REVIEW_MODE','string':'Review'});case'AI_REVIEW_CHECK_CUSTOM_TITLE':return t({'id':'AI_REVIEW_CHECK_CUSTOM_TITLE','string':'Custom\x20command'});case'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION','string':'Enter\x20a\x20custom\x20command\x20for\x20a\x20specific\x20review.'});case'AI_REVIEW_CHECK_CORRECTNESS_TITLE':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_TITLE','string':'Proofread'});case'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION','string':'Check\x20the\x20text\x20for\x20errors\x20in\x20grammar,\x20spelling,\x20and\x20punctuation.'});case'AI_REVIEW_CHECK_CLARITY_TITLE':return t({'id':'AI_REVIEW_CHECK_CLARITY_TITLE','string':'Improve\x20clarity'});case'AI_REVIEW_CHECK_CLARITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CLARITY_DESCRIPTION','string':'Improve\x20the\x20logical\x20structure\x20and\x20precision\x20for\x20clearer\x20message.'});case'AI_REVIEW_CHECK_READABILITY_TITLE':return t({'id':'AI_REVIEW_CHECK_READABILITY_TITLE','string':'Improve\x20readability'});case'AI_REVIEW_CHECK_READABILITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_READABILITY_DESCRIPTION','string':'Adjust\x20sentence\x20structure\x20and\x20word\x20choice\x20for\x20an\x20easier\x20read.'});case'AI_REVIEW_CHECK_MAKE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TITLE','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_DESCRIPTION','string':'Shorten\x20or\x20lengthen\x20the\x20text\x20as\x20needed.'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER','string':'Longer'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER','string':'Shorter'});case'AI_REVIEW_CHECK_MAKE_TONE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_TITLE','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION','string':'Modify\x20the\x20text\x20to\x20a\x20desired\x20tone\x20and\x20style.'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL','string':'Casual'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT','string':'Direct'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY','string':'Friendly'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT','string':'Confident'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL','string':'Professional'});case'AI_REVIEW_CHECK_TRANSLATE_TITLE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_TITLE','string':'Translate'});case'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION','string':'Translate\x20the\x20text\x20into\x20another\x20language.'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL','string':'Select\x20language'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH','string':'English'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH','string':'Spanish'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH','string':'French'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN','string':'German'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE','string':'Japanese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN','string':'Russian'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE','string':'Portuguese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN','string':'Korean'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN','string':'Italian'});case'AI_TOGGLE_BUTTON_LABEL':return t({'id':'AI_TOGGLE_BUTTON_LABEL','string':'AI'});default:return _0x478af8;}}class s extends tt{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5837bc){super(_0x5837bc),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 _0x59e537=this['context']['plugins']['get']('CloudServices');if(!_0x59e537['token'])throw new _0x5e86d1('ai-missing-token',this);this['_token']=_0x59e537['token'];}['startConversation'](_0x1606a7,_0x5a7f08){const _0x6a2f85=this['_sendApiRequest']('/conversations','POST',{'id':_0x1606a7,'group':_0x5a7f08});return{'getConversation':async()=>(await _0x6a2f85['request'])['json'](),'abortController':_0x6a2f85['abortController']};}['queryAssistant']({message:_0x37c513,conversationId:_0x2d6d89,parts:_0x2bed87,capabilities:_0x1c4f1a,model:_0x4bef81,quickActionData:_0xda957c}){const _0xc9fdfe={..._0xda957c&&{'quickActionData':_0xda957c}},_0x4a977c={'prompt':_0x37c513,'content':_0x2bed87,'model':_0x4bef81,..._0x1c4f1a&&{'capabilities':_0x1c4f1a},...Object['keys'](_0xc9fdfe)['length']>0x0&&{'attributes':_0xc9fdfe}},_0x3e01ad=this['_sendApiRequest']('/conversations/'+_0x2d6d89+'/messages','POST',_0x4a977c);return{'getStream':async()=>{const _0x538c4e=(await _0x3e01ad['request'])['body'];return this['_getStreamReader'](_0x538c4e);},'abortController':_0x3e01ad['abortController']};}['executeCustomAction']({content:_0x42a896,message:_0x10d40d,model:_0xd15578,outputFormat:_0x5f566a}){const _0x107d2d={'content':[{'type':'text','content':_0x42a896}],'prompt':_0x10d40d,'model':_0xd15578,'outputFormat':_0x5f566a},_0x29fcf4=this['_sendApiRequest']('/actions/custom/calls','POST',_0x107d2d);return{'getStream':async()=>{const _0x30bd80=(await _0x29fcf4['request'])['body'];return this['_getStreamReader'](_0x30bd80);},'abortController':_0x29fcf4['abortController']};}['executeAction']({actionName:_0x5ae4e8,content:_0x268aab,args:_0x57f397}){const _0x50ae26={'content':[{'type':'text','content':_0x268aab}],'args':_0x57f397},_0x4a1d59=this['_sendApiRequest']('/actions/system/'+_0x5ae4e8+'/calls','POST',_0x50ae26);return{'getStream':async()=>{const _0x6113ee=(await _0x4a1d59['request'])['body'];return this['_getStreamReader'](_0x6113ee);},'abortController':_0x4a1d59['abortController']};}['uploadFile'](_0x2b59e0,_0x99583e,_0x4dbf42){const _0x106b53=new FormData();_0x106b53['append']('file',_0x99583e,_0x99583e['name']),_0x4dbf42&&_0x106b53['append']('attributes',JSON['stringify'](_0x4dbf42));const _0x5b650b=this['_sendApiRequest']('/conversations/'+_0x2b59e0+'/files','POST',_0x106b53);return{'getId':async()=>(await _0x5b650b['request'])['json'](),'abortController':_0x5b650b['abortController']};}['fetchDocument'](_0x29ee4c,_0x337126){const _0x4d24db=this['_sendApiRequest']('/conversations/'+_0x29ee4c+'/documents/'+_0x337126,'GET');return{'getDocument':async()=>(await _0x4d24db['request'])['json'](),'abortController':_0x4d24db['abortController']};}['uploadDocument'](_0x5d9c89,_0x182960,_0x325299){const _0x5c7b0b={'content':_0x182960};_0x325299&&(_0x5c7b0b['attributes']=_0x325299);const _0x1ce621=this['_sendApiRequest']('/conversations/'+_0x5d9c89+'/documents','POST',_0x5c7b0b);return{'getId':async()=>(await _0x1ce621['request'])['json'](),'abortController':_0x1ce621['abortController']};}['fetchConversations'](_0x4228ef,_0x1a8e80){const _0x290f6e=new URLSearchParams();_0x290f6e['append']('excludeEmpty','true'),_0x290f6e['append']('limit','100'),_0x290f6e['append']('group',_0x4228ef),_0x1a8e80&&_0x290f6e['append']('search',_0x1a8e80);const _0x2c099b=this['_sendApiRequest']('/conversations?'+_0x290f6e['toString'](),'GET');return{'getConversations':async()=>{const _0x3ae929=await _0x2c099b['request'];return(await _0x3ae929['json']())['items'];},'abortController':_0x2c099b['abortController']};}['deleteConversation'](_0x3370d8){const _0x32dd7b=this['_sendApiRequest']('/conversations/'+_0x3370d8,'DELETE');return{'execute':async()=>{await _0x32dd7b['request'];},'abortController':_0x32dd7b['abortController']};}['updateConversation'](_0xff34,_0x21d9f6){const _0x1506d9=this['_sendApiRequest']('/conversations/'+_0xff34,'PATCH',_0x21d9f6);return{'getResult':async()=>(await _0x1506d9['request'],_0x21d9f6),'abortController':_0x1506d9['abortController']};}['fetchConversation'](_0x118792){const _0x43bb70=this['_sendApiRequest']('/conversations/'+_0x118792,'GET');return{'getConversation':async()=>(await _0x43bb70['request'])['json'](),'abortController':_0x43bb70['abortController']};}['fetchConversationMessages'](_0x7b1047){const _0x2adfa2=this['_sendApiRequest']('/conversations/'+_0x7b1047+'/messages','GET');return{'getMessages':async()=>{const _0x528f3a=await _0x2adfa2['request'];return(await _0x528f3a['json']())['items'];},'abortController':_0x2adfa2['abortController']};}['uploadUrl'](_0x5c8093,_0x34cbd0,_0x3f7aaa){const _0x42fab6=this['_sendApiRequest']('/conversations/'+_0x5c8093+'/web-resources','POST',{'url':_0x34cbd0,'attributes':_0x3f7aaa});return{'getId':async()=>(await _0x42fab6['request'])['json'](),'abortController':_0x42fab6['abortController']};}['getModels'](){const _0x4578b1=this['_sendApiRequest']('/models/1','GET');return{'list':async()=>{const _0x54f1b0=await(await _0x4578b1['request'])['json'](),_0x37bc27=_0x54f1b0['items']['map'](_0x4cc93b=>({..._0x4cc93b,'description':w(this['context']['locale'],'AI_MODEL_DESCRIPTION_'+_0x4cc93b['id']['toUpperCase']())}));return{..._0x54f1b0,'items':_0x37bc27};},'abortController':_0x4578b1['abortController']};}['deleteFile'](_0xb33289,_0x3b3cec){const _0xe547e5=this['_sendApiRequest']('/conversations/'+_0xb33289+'/files/'+_0x3b3cec,'DELETE');return{'execute':async()=>{await _0xe547e5['request'];},'abortController':_0xe547e5['abortController']};}['deleteDocument'](_0x2eab17,_0x4bb101){const _0x1fb6b2=this['_sendApiRequest']('/conversations/'+_0x2eab17+'/documents/'+_0x4bb101,'DELETE');return{'execute':async()=>{await _0x1fb6b2['request'];},'abortController':_0x1fb6b2['abortController']};}['deleteWebResource'](_0x3b79a0,_0x4cde89){const _0x4d44e1=this['_sendApiRequest']('/conversations/'+_0x3b79a0+'/web-resources/'+_0x4cde89,'DELETE');return{'execute':async()=>{await _0x4d44e1['request'];},'abortController':_0x4d44e1['abortController']};}['callSystemReview']({reviewName:_0x21c450,content:_0x4dbc70,args:_0x57544e}){const _0x1ea53f=this['_sendApiRequest']('/reviews/system/'+_0x21c450+'/calls','POST',{'content':[{'type':'text','content':_0x4dbc70}],'args':_0x57544e});return{'getStream':async()=>{const _0x4b4db5=(await _0x1ea53f['request'])['body'];return this['_getStreamReader'](_0x4b4db5);},'abortController':_0x1ea53f['abortController']};}['callCustomReview']({content:_0x38d6e1,prompt:_0x4fefe0,model:_0x35a8f4}){const _0xfd0a1=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x38d6e1}],'prompt':_0x4fefe0,'model':_0x35a8f4});return{'getStream':async()=>{const _0x44630a=(await _0xfd0a1['request'])['body'];return this['_getStreamReader'](_0x44630a);},'abortController':_0xfd0a1['abortController']};}['upsertAIChatRating'](_0x1a576a,_0xece8fc,_0x556471){const _0x2172be=this['_sendApiRequest']('/conversations/'+_0x1a576a+'/messages/'+_0xece8fc+'/ratings','PUT',{'positiveCount':_0x556471['positiveCount'],'totalCount':_0x556471['totalCount']});return{'execute':async()=>{await _0x2172be['request'];},'abortController':_0x2172be['abortController']};}['upsertAIActionRating'](_0x31fb5b,_0x1fd152,_0x532522){const _0x58231a=this['_sendApiRequest']('/actions/system/'+_0x31fb5b+'/calls/'+_0x1fd152+'/ratings','PUT',{'positiveCount':_0x532522['positiveCount'],'totalCount':_0x532522['totalCount']});return{'execute':async()=>{await _0x58231a['request'];},'abortController':_0x58231a['abortController']};}['upsertCustomAIActionRating'](_0x1fb0a0,_0x289f26){const _0x1d278a=this['_sendApiRequest']('/actions/custom/calls/'+_0x1fb0a0+'/ratings','PUT',{'positiveCount':_0x289f26['positiveCount'],'totalCount':_0x289f26['totalCount']});return{'execute':async()=>{await _0x1d278a['request'];},'abortController':_0x1d278a['abortController']};}['upsertAIReviewRating'](_0xc6c8b7,_0x4b7f3e,_0x296964){const _0x2ee1b2=this['_sendApiRequest']('/reviews/system/'+_0xc6c8b7+'/calls/'+_0x4b7f3e+'/ratings','PUT',{'positiveCount':_0x296964['positiveCount'],'totalCount':_0x296964['totalCount']});return{'execute':async()=>{await _0x2ee1b2['request'];},'abortController':_0x2ee1b2['abortController']};}['upsertCustomAIReviewRating'](_0x2b33ed,_0x47a1aa){const _0x37f06c=this['_sendApiRequest']('/reviews/custom/calls/'+_0x2b33ed+'/ratings','PUT',{'positiveCount':_0x47a1aa['positiveCount'],'totalCount':_0x47a1aa['totalCount']});return{'execute':async()=>{await _0x37f06c['request'];},'abortController':_0x37f06c['abortController']};}['_sendApiRequest'](_0x2520b7,_0xbf7f75,_0x1085d9){const _0xa2ee2f=new AbortController(),_0x4c746f=_0x1085d9 instanceof FormData,_0x25042f={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x1085d9&&!_0x4c746f&&(_0x25042f['Content-Type']='application/json');const _0x514847={'method':_0xbf7f75,'headers':_0x25042f,'signal':_0xa2ee2f['signal']};return _0x1085d9&&(_0x514847['body']=_0x4c746f?_0x1085d9:JSON['stringify'](_0x1085d9)),{'request':fetch(''+this['_apiUrl']+_0x2520b7,_0x514847)['catch'](_0x479111=>{this['_handleError'](_0x479111);})['then'](_0x9012ec=>{if(!_0x9012ec['ok'])throw new _0x5e86d1('ai-request-failed',this,{'url':this['_apiUrl'],'path':_0x2520b7,'method':_0xbf7f75,'body':_0x1085d9,'status':(_0x9012ec||{})['status'],'statusText':(_0x9012ec||{})['statusText']});return _0x9012ec;}),'abortController':_0xa2ee2f};}async*['_getStreamReader'](_0x4e1796){const _0x447f7d=[],_0x116fe9=_0x4e1796['getReader'](),_0x500ab5=wt({'onError':_0xc141d3=>{this['_handleError'](_0xc141d3);},'onEvent':_0x214a40=>{_0x214a40['data']=JSON['parse'](_0x214a40['data']),_0x447f7d['push'](_0x214a40);}});try{let _0x5ab5f2=!0x1;for(;!_0x5ab5f2;){const {done:_0x167450,value:_0x29b5dc}=await _0x116fe9['read']();_0x167450&&(_0x5ab5f2=!0x0),_0x500ab5['feed'](this['_decoder']['decode'](_0x29b5dc,{'stream':!0x0})),yield*_0x447f7d,_0x447f7d['length']=0x0;}}catch(_0x48a774){this['_handleError'](_0x48a774);}finally{_0x116fe9['releaseLock'](),_0x500ab5['reset']();}}['_handleError'](_0x37cd02){if(_0x37cd02 instanceof _0x5e86d1)throw _0x37cd02;if(_0x37cd02 instanceof Error&&'AbortError'===_0x37cd02['name'])throw new _0x5e86d1('ai-request-aborted',this,{'originalError':_0x37cd02});throw new _0x5e86d1('ai-request-failed',this,{'originalError':_0x37cd02});}}function cs(_0x380d63,_0x5c5ebf){const _0x4e762e=new _0xb98904(_0x380d63),_0xba0048=w(_0x380d63,'AI_TABS_LABEL_MINIMIZE'),_0x4f28c1=w(_0x380d63,'AI_TABS_LABEL_MAXIMIZE');return _0x4e762e['set']({'withText':!0x1,'icon':_0x5284eb,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary-text'}),_0x4e762e['bind']('label')['to'](_0x5c5ebf,'isMaximized',_0x5c757e=>_0x5c757e?_0xba0048:_0x4f28c1),_0x4e762e['bind']('icon')['to'](_0x5c5ebf,'isMaximized',_0x5d5ac5=>_0x5d5ac5?_0x133209:_0x5284eb),_0x4e762e['bind']('isOn')['to'](_0x5c5ebf,'isMaximized'),_0x4e762e['on']('execute',()=>{_0x5c5ebf['fire']('resizeTabs');}),_0x4e762e;}function tr(_0x7b6efb){return _0x1a1081(_0x7b6efb);}function Ct(_0xb5a59a){return _0x501beb(_0xb5a59a);}function It(_0x3fff68,_0x4b4288,_0xc6ceda){const _0x4d8d56=null!==_0x4b4288?_0x3de353=>_0x3de353['attribs'][_0x3fff68]===_0x4b4288:_0x2eb1d7=>Boolean(_0x2eb1d7['attribs'][_0x3fff68]);return mt(_0x5ca44e=>_0x2b987d(_0x5ca44e)&&_0x4d8d56(_0x5ca44e),_0xc6ceda);}function Ne(_0x1570df,_0x3827ad,_0x2d59bf){const _0x568d69=null!==_0x3827ad?_0x35e537=>_0x35e537['attribs'][_0x1570df]===_0x3827ad:_0x59fec9=>Boolean(_0x59fec9['attribs'][_0x1570df]);return _0x11805f(_0x5aae46=>_0x2b987d(_0x5aae46)&&_0x568d69(_0x5aae46),_0x2d59bf);}function ft(_0x2df210,_0x265441){return _0x2df210&&_0x2b987d(_0x2df210)?_0x2df210['attribs'][_0x265441]:null;}function Je(_0x234720,_0x12ed30,_0xd3fd74){_0x2b987d(_0x234720)&&(null===_0xd3fd74?delete _0x234720['attribs'][_0x12ed30]:_0x234720['attribs'][_0x12ed30]=_0xd3fd74);}function qe(_0x260906,_0x18c49c,_0x22e502){const _0x280fc2=_0x18c49c['cloneNode'](!0x0);'beforebegin'===_0x22e502?_0x3e13e2(_0x260906,_0x280fc2):'afterbegin'===_0x22e502?to(_0x260906,_0x280fc2):'beforeend'===_0x22e502?_0x364834(_0x260906,_0x280fc2):'afterend'===_0x22e502&&_0x21a231(_0x260906,_0x280fc2);}function Xe(_0x2e8094){const _0x355f86=[];let _0x87d659=_0x2e8094;for(;_0x87d659;)_0x87d659=_0x67c08d(_0x87d659),_0x87d659&&_0x355f86['push'](_0x87d659);return _0x355f86;}function Wr(_0x5113f3){return _0x5113f3['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Ye(_0x1a4e37){let _0x5e2bd2=0x0;for(;_0x1a4e37['parentNode'];)_0x1a4e37=_0x1a4e37['parentNode'],_0x5e2bd2++;return _0x5e2bd2;}function $e(_0x10d5e8){const _0x1770a9=[];let _0x351305=_0x10d5e8['nextSibling'];for(;_0x351305;)_0x1770a9['push'](_0x351305),_0x351305=_0x351305['nextSibling'];_0x1770a9['forEach'](_0x25c7d3=>{_0x4156ef(_0x25c7d3);});}class sn extends/* #__PURE__ -- @preserve */
25
+ ts(){['_m2html'];constructor(){super(),this['_m2html']=new _0x185e01();}['convertMarkdownToHTML'](_0x50faf7){const _0x5c0180=this['_m2html']['parse'](_0x50faf7);return this['parseAndNormalizeHTML'](_0x5c0180);}['parseAndNormalizeHTML'](_0x5967b3){return this['_parseHTML'](_0x5967b3);}['_parseHTML'](_0x28c9fb){const _0x4570eb=tr('<dummy>'+_0x28c9fb['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x4570eb['children']=_0x4570eb['children'][0x0]['children'],_0x4570eb;}}class on extends/* #__PURE__ -- @preserve */
26
+ ts(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x38c82a){super(),this['_generateUid']=_0x38c82a||_0x10e5dc;}['merge'](_0x3c0d0c,_0x2ce846,_0x56b6b7){const _0x219bff=_0x3c0d0c['cloneNode'](!0x0);if(0x0===_0x2ce846['childNodes']['length']){const _0x5d6a47=[];return Ne('data-id','new-element',_0x219bff)['forEach'](_0x22b0e9=>{const _0x5047b7=this['_generateUid']();Je(_0x22b0e9,'data-id',_0x5047b7),_0x5d6a47['push'](_0x5047b7);}),this['_removeSpecialComments'](_0x219bff),{'parsedContent':_0x219bff,'newNodeIds':_0x5d6a47,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x56b6b7&&_0x56b6b7['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x219bff),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Ne('data-id',null,_0x2ce846)['map'](_0x35c667=>ft(_0x35c667,'data-id'))['filter'](_0x3fc658=>!!_0x3fc658));let _0x4fcd40=-0x1,_0x64bd59=!0x1;const _0x87469b=_0x219bff['childNodes'],_0x5b6660=Array['from'](_0x87469b)['filter'](_0x30d5e6=>!(0x3===_0x30d5e6['nodeType']&&''===Ct(_0x30d5e6)['trim']())),_0x2f3297=_0x5b6660['length'];for(let _0x406a4c=0x0;_0x406a4c<_0x2f3297;_0x406a4c++){const _0xd90f7a=_0x5b6660[_0x406a4c],_0x155326=_0x5b6660[_0x406a4c+0x1];if(this['_isNewNode'](_0xd90f7a)){if(-0x1===_0x4fcd40&&(_0x4fcd40=_0x406a4c),this['_markWrappedElements'](_0xd90f7a),!this['_isNewNode'](_0x155326)){const [_0x3de89e,_0x4d0b0b]=this['_findReferenceNode'](_0xd90f7a,_0x64bd59,_0x2ce846);if(_0x3de89e){const _0xbceb2c=Array['from'](_0x5b6660)['slice'](_0x4fcd40,_0x406a4c+0x1);this['_insertNodes'](_0x3de89e,_0xbceb2c,_0x4d0b0b),_0x4fcd40=-0x1;}}}else{if(this['_isExistingContentComment'](_0xd90f7a))_0x64bd59=!0x0;else{if(this['_isExistingNode'](_0xd90f7a)){const _0x242064=ft(_0xd90f7a,'data-id');if(_0x242064&&this['_existingDataIds']['has'](_0x242064)){const _0x1c1d50=It('data-id',_0x242064,_0x2ce846);this['_replaceNode'](_0x1c1d50,_0xd90f7a);}if(this['_touchedNodesState']['removedIds']['includes'](_0x242064)){const _0x2c4e3d=this['_touchedNodesState']['removedIds']['indexOf'](_0x242064);this['_touchedNodesState']['removedIds']['splice'](_0x2c4e3d,0x1);}}else{if(this['_isDelNode'](_0xd90f7a)){const _0x1638de=ft(_0xd90f7a,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x1638de)||this['_storeDeletedElementIds'](_0xd90f7a);}}}}}for(const _0x233cf7 of this['_touchedNodesState']['removedIds']){const _0x341e71=It('data-id',_0x233cf7,_0x2ce846);if(_0x341e71){if(_0x56b6b7&&_0x56b6b7['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x233cf7;const _0x14ea88=_0x56b6b7['replaceRemovedWith']['cloneNode'](!0x0);Je(_0x14ea88,'data-id',_0x233cf7),Je(_0x14ea88,'data-removed','true'),_0x2f3107(_0x341e71,_0x14ea88);}else _0x4156ef(_0x341e71);}}if(Ne('data-wrapped-id',null,_0x2ce846)['forEach'](_0x5cffd0=>{const _0x264dca=It('data-id',ft(_0x5cffd0,'data-wrapped-id'),_0x2ce846);var _0xba1064,_0x1ab247;_0x264dca&&(_0x1ab247=_0x5cffd0,_0x4156ef(_0xba1064=_0x264dca),_0x2f3107(_0x1ab247,_0xba1064));}),Ne('data-id','new-element',_0x2ce846)['forEach'](_0x25ec0b=>{const _0x165fcc=this['_getUid'](_0x25ec0b);Je(_0x25ec0b,'data-id',_0x165fcc),this['_touchedNodesState']['newIds']['push'](_0x165fcc);}),this['_removeSpecialComments'](_0x2ce846),_0x56b6b7&&_0x56b6b7['markUnstableElements']&&this['_markUnstableElements'](_0x2ce846,_0x56b6b7['markUnstableElementsDepth']||0x0),_0x56b6b7&&_0x56b6b7['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0xcdeff6=It('data-id',this['_touchedNodesState']['lastTouchedId'],_0x2ce846);for(;_0xcdeff6;)$e(_0xcdeff6),_0xcdeff6=_0xcdeff6['parentNode'];}return{'parsedContent':_0x2ce846,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x5757e0,_0x270e28,_0x1ea7f8){for(const _0x1de3fe of _0x270e28){const _0x12b8ce=this['_getUid'](_0x1de3fe);Je(_0x1de3fe,'data-id',_0x12b8ce),this['_touchedNodesState']['newIds']['push'](_0x12b8ce),this['_touchedNodesState']['lastTouchedId']=_0x12b8ce;}const _0x49e80a='afterbegin'===_0x1ea7f8||'afterend'===_0x1ea7f8?_0x270e28['reverse']():_0x270e28;for(const _0x3715b4 of _0x49e80a)qe(_0x5757e0,_0x3715b4,_0x1ea7f8);}['_replaceNode'](_0x36c533,_0x3527b2){if(!_0x36c533)return;if(_0x4e4073=_0x3527b2,Wr(Ct(_0x36c533))===Wr(Ct(_0x4e4073)))return;var _0x4e4073;const _0x19dc4b=this['_getUid'](_0x36c533);Je(_0x3527b2,'data-id',_0x19dc4b),this['_touchedNodesState']['modifiedIds']['push'](_0x19dc4b),this['_touchedNodesState']['lastTouchedId']=_0x19dc4b,_0x2f3107(_0x36c533,_0x3527b2['cloneNode'](!0x0));}['_findReferenceNode'](_0x223f89,_0x27194a,_0x2220ed){const _0x1de402=this['_findPrevElementWithDataId'](_0x223f89,!0x1);if(_0x1de402){const _0x8dd4a6=this['_getNodeDataId'](_0x1de402),_0x44d547=It('data-id',_0x8dd4a6,_0x2220ed);if(_0x44d547)return[_0x44d547,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x8dd4a6);}const _0x4a212e=this['_findNextElementWithDataId'](_0x223f89,!0x1);if(_0x4a212e){const _0x12cd78=this['_getNodeDataId'](_0x4a212e),_0x582bda=It('data-id',_0x12cd78,_0x2220ed);if(_0x582bda)return[_0x582bda,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x12cd78);}return _0x27194a?_0x223f89['nextSibling']?this['_findFallbackReferenceNode'](_0x223f89,_0x2220ed):[_0x2220ed['childNodes'][_0x2220ed['childNodes']['length']-0x1],'afterend']:[_0x2220ed['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x4ed5f4,_0x4f0d21){const _0x2dcc80=[],_0x1fa7da=this['_findPrevElementWithDataId'](_0x4ed5f4,!0x0);if(_0x1fa7da){const _0x5a2513=It('data-id',this['_getNodeDataId'](_0x1fa7da),_0x4f0d21);_0x5a2513&&_0x2dcc80['push']([_0x5a2513,'afterend']);}const _0x44af68=this['_findNextElementWithDataId'](_0x4ed5f4,!0x0);if(_0x44af68){const _0x5243fd=It('data-id',this['_getNodeDataId'](_0x44af68),_0x4f0d21);_0x5243fd&&_0x2dcc80['push']([_0x5243fd,'beforebegin']);}if(_0x2dcc80['length']>0x1)return Ye(_0x2dcc80[0x0][0x0])<=Ye(_0x2dcc80[0x1][0x0])?_0x2dcc80[0x0]:_0x2dcc80[0x1];return 0x1===_0x2dcc80['length']?_0x2dcc80[0x0]:[_0x4f0d21['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x413c06,_0x1781f8){let _0x3e1d13=_0x413c06['nextSibling'],_0x58f1b3=null,_0x3a31b6=!0x1;for(;_0x3e1d13;){if(_0x4ec0e6(_0x3e1d13)){if(this['_isDelNode'](_0x3e1d13)&&(_0x58f1b3=_0x3e1d13),this['_isExistingContentComment'](_0x3e1d13)&&_0x1781f8&&!_0x3a31b6){_0x3a31b6=!0x0,_0x3e1d13=_0x3e1d13['nextSibling'];continue;}break;}const _0xdbd6a7=ft(_0x3e1d13,'data-id');if(_0xdbd6a7&&'new-element'!==_0xdbd6a7&&this['_existingDataIds']['has'](_0xdbd6a7)){_0x58f1b3=_0x3e1d13;break;}_0x3e1d13=_0x3e1d13['nextSibling'];}return _0x58f1b3;}['_findPrevElementWithDataId'](_0x54a29e,_0x21bae0){let _0x58a71d=_0x54a29e['previousSibling'],_0x58566=null,_0x4ada3f=!0x1;for(;_0x58a71d;){if(_0x4ec0e6(_0x58a71d)){if(this['_isDelNode'](_0x58a71d)&&(_0x58566=_0x58a71d),this['_isExistingContentComment'](_0x58a71d)&&_0x21bae0&&!_0x4ada3f){_0x4ada3f=!0x0,_0x58a71d=_0x58a71d['previousSibling'];continue;}break;}const _0x13176d=ft(_0x58a71d,'data-id');if(_0x13176d&&'new-element'!==_0x13176d&&this['_existingDataIds']['has'](_0x13176d)){_0x58566=_0x58a71d;break;}_0x58a71d=_0x58a71d['previousSibling'];}return _0x58566;}['_markWrappedElements'](_0x2e50b2){_0x2b987d(_0x2e50b2)&&Ne('data-id',null,_0x2e50b2)['forEach'](_0x5e82fe=>{this['_isExistingNode'](_0x5e82fe)&&!this['_hasWrappedParent'](_0x5e82fe)&&(Je(_0x5e82fe,'data-wrapped-id',ft(_0x5e82fe,'data-id')),Je(_0x5e82fe,'data-id',null));});}['_getNodeDataId'](_0x385757){if(!_0x385757)return null;if(_0x2b987d(_0x385757))return ft(_0x385757,'data-id');if(_0x4ec0e6(_0x385757)){const _0x333782=Ct(_0x385757)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x333782&&_0x333782[0x1])return _0x333782[0x1];}return null;}['_storeDeletedElementIds'](_0x1dd2fe){if(_0x4ec0e6(_0x1dd2fe)){const _0x5b60ab=Ct(_0x1dd2fe)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x5b60ab&&_0x5b60ab[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x5b60ab[0x1]);}}['_getUid'](_0x272ad4){return this['_isExistingNode'](_0x272ad4)?ft(_0x272ad4,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x152d2a){(function(_0x1aee60){return _0x1bdcc4(_0x1cb9cc=>_0x4ec0e6(_0x1cb9cc),_0x1aee60,!0x0,0x1/0x0);}(_0x152d2a)['filter'](_0x3d46ea=>this['_isDelNode'](_0x3d46ea)||this['_isExistingContentComment'](_0x3d46ea))['forEach'](_0x39f063=>{_0x4156ef(_0x39f063);}));}['_markLastTagElementUnstable'](_0x590151){const _0xd16517=_0x590151['childNodes'],_0x489680=_0xd16517[_0xd16517['length']-0x1];_0x489680&&_0x2b987d(_0x489680)&&Je(_0x489680,'data-unstable','true');}['_markUnstableElements'](_0x12f70e,_0x4180d6){const _0x5bf572=It('data-unstable','true',_0x12f70e);if(!_0x5bf572)return;const _0x1fd247=Xe(_0x5bf572)['slice'](0x0,-0x1),_0x3f0d76=_0x1fd247['length'];let _0x26f435=_0x5bf572;if(_0x3f0d76>_0x4180d6){let _0x252497=_0x3f0d76,_0x517152=null;for(;_0x252497>_0x4180d6&&_0x252497>=0x0;)_0x252497--,_0x517152=_0x1fd247[_0x252497];_0x517152&&(_0x26f435=_0x517152,Je(_0x5bf572,'data-unstable',null),Je(_0x517152,'data-unstable','true'));}else{if(_0x3f0d76<_0x4180d6){let _0x58e13d=_0x3f0d76,_0x4748c0=_0x5bf572;for(;_0x58e13d<_0x4180d6;){const _0x457682=_0x4748c0['childNodes']['filter'](_0x5bba50=>_0x2b987d(_0x5bba50));if(0x0===_0x457682['length'])break;_0x58e13d++,_0x4748c0=_0x457682[_0x457682['length']-0x1];}_0x4748c0&&(_0x26f435=_0x4748c0,Je(_0x5bf572,'data-unstable',null),Je(_0x4748c0,'data-unstable','true'));}}let _0x4e9f5b=_0x26f435;for(;_0x4e9f5b;){for(;_0x4e9f5b['nextSibling'];)_0x4e9f5b=_0x4e9f5b['nextSibling'],_0x2b987d(_0x4e9f5b)&&Je(_0x4e9f5b,'data-unstable','true');_0x4e9f5b=_0x4e9f5b['parentNode'];}}['_isNewNode'](_0x3d7059){return Boolean('new-element'===ft(_0x3d7059,'data-id'));}['_isExistingNode'](_0x594263){return Boolean((ft(_0x594263,'data-id')||'')['length']>0x0&&'new-element'!==ft(_0x594263,'data-id'));}['_isDelNode'](_0xbf5b37){return!!_0xbf5b37&&Boolean(_0x4ec0e6(_0xbf5b37)&&Ct(_0xbf5b37)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x4b209b){let _0x36008a=_0x4b209b['parentNode'];for(;_0x36008a;){if(ft(_0x36008a,'data-wrapped-id'))return!0x0;_0x36008a=_0x36008a['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x2ef7f7){return Boolean(_0x4ec0e6(_0x2ef7f7)&&Ct(_0x2ef7f7)['match'](/\s*existing[\s*-](content|document)\s*/g));}}const Yr=['modification-delta','text-delta','web-search','reasoning'],$r=['conversation-title'];class fe extends ts(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _t([]);['parsedMergedContent']=new _t([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];constructor({type:_0x13de67,content:_0x1d4f6e='',isDone:_0x36d4e5=!0x1,interactionId:_0x47a29f,areActionsDisabled:_0x2a75ed,documentContextContent:_0xabd4f1,editor:_0x10c813}){super(),this['id']=_0x10e5dc(),this['interactionId']=_0x47a29f,this['type']=_0x13de67,this['areActionsDisabled']=!!_0x2a75ed,this['editor']=_0x10c813,this['aiResponseParser']=new sn(),this['aiResponseApplier']=new on(),this['documentContextContent']=tr(_0xabd4f1||''),this['set']('isDone',_0x36d4e5),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x1d4f6e);}['appendContent'](_0x5dd9ee){this['set']('content',this['content']+_0x5dd9ee);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x34defb,_0x57ad55){this['changeGroups'][_0x34defb]['state']=_0x57ad55,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x34defb,'state':_0x57ad55});}['onContentChange'](){if('modification-delta'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x29e507=this['changeGroups'];this['updateChangeGroups']();const _0x4deafa=this['_getDifferentChangeGroups'](_0x29e507,this['changeGroups']);(_0x4deafa['length']||this['isDone'])&&this['fire']('replyContentUpdated',this,_0x4deafa);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x7ead1a,_0x17f1b4){const _0x33d460=[];for(const _0x28b4cd of _0x17f1b4){const _0x13e4e7=_0x7ead1a[_0x28b4cd['index']];_0x13e4e7?_0x13e4e7['changes']['length']!==_0x28b4cd['changes']['length']?_0x33d460['push'](_0x28b4cd):_0x13e4e7['changes']['forEach']((_0x3430d9,_0x48c444)=>{const _0x3f1dc7=_0x28b4cd['changes'][_0x48c444];_0x3430d9['id']!==_0x3f1dc7['id']&&_0x33d460['push'](_0x28b4cd);}):_0x33d460['push'](_0x28b4cd);}return _0x33d460;}['updateChangeGroups'](){const _0xebb793=new tn('p',{},[new tn('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x308946('Removed\x20content.\x20Use\x20\x22Show\x20changes\x22\x20to\x20learn\x20more.')])]),_0x29ff2f=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0xebb793,'cutAfterLastChange':!this['isDone']});if(!_0x29ff2f['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x29ff2f['parsedContent'];let _0x1fafcd=[];if(_0x11805f(_0x5b2e7f=>{const _0x5a5706=ft(_0x5b2e7f,'data-id');if(!_0x5a5706||!_0x4a456c(_0x5a5706))return!0x1;const _0x4ce13a=[_0x5b2e7f,...Xe(_0x5b2e7f)]['at'](-0x2);if(_0x5b2e7f!=_0x4ce13a){const _0x2fc95f=ft(_0x4ce13a,'data-id');_0x4a456c(_0x2fc95f)||(_0x1fafcd['push']({'node':_0x4ce13a,'id':_0x2fc95f,'type':'modified'}),_0x29ff2f['modifiedNodeIds']['push'](_0x2fc95f));}else _0x29ff2f['modifiedNodeIds']['includes'](_0x5a5706)?_0x1fafcd['push']({'node':_0x5b2e7f,'type':'modified','id':_0x5a5706}):_0x29ff2f['newNodeIds']['includes'](_0x5a5706)?_0x1fafcd['push']({'node':_0x5b2e7f,'type':'new','id':_0x5a5706,'anchorId':ft(_0x5b2e7f['previousSibling'],'data-id')}):_0x1fafcd['push']({'node':_0x5b2e7f,'type':'removed','id':_0x5a5706});return!0x0;},this['parsedMergedContent']),_0x1fafcd=_0x1fafcd['filter'](({node:_0x1c74f5})=>[...Xe(_0x1c74f5),_0x1c74f5]['every'](_0x4684c9=>!ft(_0x4684c9,'data-unstable'))),0x0==_0x1fafcd['length'])return;const _0x4855d5=[[_0x1fafcd[0x0]]];for(let _0x3ce927=0x1;_0x3ce927<_0x1fafcd['length'];_0x3ce927++){const _0x146291=_0x4855d5[_0x4855d5['length']-0x1],_0x4bb75e=_0x146291[_0x146291['length']-0x1];_0x1fafcd[_0x3ce927]['node']['previousSibling']==_0x4bb75e['node']&&'modified'!=_0x1fafcd[_0x3ce927]['type']&&'modified'!=_0x4bb75e['type']?_0x146291['push'](_0x1fafcd[_0x3ce927]):_0x4855d5['push']([_0x1fafcd[_0x3ce927]]);}for(const _0x5be61e of _0x4855d5){const _0x3ffd59=_0x5be61e[0x0],_0x529cf5=_0x5be61e[_0x5be61e['length']-0x1],_0x1a9068=_0xf29a29(_0x3ffd59['node']['previousSibling']);_0x1a9068&&_0x5be61e['unshift'](_0x1a9068);const _0x4de5c0=_0xf29a29(_0x529cf5['node']['nextSibling']);_0x4de5c0&&_0x5be61e['push'](_0x4de5c0);}function _0x4a456c(_0x61bcb4){return _0x29ff2f['modifiedNodeIds']['includes'](_0x61bcb4)||_0x29ff2f['newNodeIds']['includes'](_0x61bcb4)||_0x29ff2f['removedNodeIds']['includes'](_0x61bcb4);}function _0xf29a29(_0x2cb8f5){if(_0x2cb8f5&&ft(_0x2cb8f5,'data-id')&&!ft(_0x2cb8f5,'data-unstable')){const _0x111001=ft(_0x2cb8f5,'data-id');if(!_0x4a456c(_0x111001))return{'node':_0x2cb8f5,'type':'context','id':_0x111001};}return null;}this['changeGroups']=_0x4855d5['map']((_0x59f4b2,_0x1265b9)=>({'changes':_0x59f4b2,'state':'pending','index':_0x1265b9}));}}function qi(_0x78b250){return Object['values'](Yr)['includes'](_0x78b250);}function Ui(_0x307721){return $r['includes'](_0x307721);}function Gi(_0x363476){return'conversation-title'===_0x363476;}function Wi(_0x940b3d){return'source'===_0x940b3d;}const ue=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','error'];class me extends _0x106985(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x342518,editor:_0x2cbb79}){super(),this['id']=_0x10e5dc(),this['connector']=_0x342518,this['isStopped']=!0x0,this['editor']=_0x2cbb79;}async['start'](){let _0x4cf3e0;const _0x5e06df=[];this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x2167b6=await this['currentRequest']['getStream']();for await(const _0x5dfb90 of _0x2167b6){if(this['isStopped'])return;if('error'===_0x5dfb90['event'])return void this['fire']('error',{'error':new _0x5e86d1('ai-chat-interaction-error',this)});if('message-metadata'!==_0x5dfb90['event']){if('action-metadata'!==_0x5dfb90['event']){if(Gi(_0x5dfb90['event'])&&this['setConversationTitle'](_0x5dfb90['data']['conversationTitle'],!0x0),Wi(_0x5dfb90['event']))_0x5e06df['push'](_0x5dfb90['data']['source']);else{if(qi(_0x5dfb90['event'])){if(_0x5dfb90['event']!==_0x4cf3e0){if(_0x4cf3e0=_0x5dfb90['event'],'web-search'===_0x5dfb90['event']){this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));continue;}if('reasoning'===_0x5dfb90['event']){this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));continue;}this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this)),this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this)),this['currentReply']&&this['currentReply']['done'](),this['currentReply']=this['createReply']({'type':_0x5dfb90['event'],'interactionId':this['id']}),_0x5e06df['length']>0x0&&'modification-delta'===_0x5dfb90['event']&&(this['currentReply']['sources']=_0x5e06df['splice'](0x0));}_0x5dfb90['data']['textDelta']&&this['currentReply']['appendContent'](_0x5dfb90['data']['textDelta']);}else Ui(_0x5dfb90['event'])||_0x51ad8b('ai-interaction-invalid-event-type',{'chunk':_0x5dfb90});}}else this['actionCallId']=_0x5dfb90['data']['callId'];}else this['messageId']=_0x5dfb90['data']['id'];}}finally{this['isStopped']||(_0x5e06df['length']>0x0&&(this['currentReply']['sources']=_0x5e06df['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x1fe172){return this['replies']['find'](_0x2bf335=>_0x2bf335['id']===_0x1fe172);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x193a2f=>_0x193a2f['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x46ab8f){const _0x1c031b=new fe({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x46ab8f});return this['replies']['push'](_0x1c031b),_0x1c031b['delegate'](...ue)['to'](this),this['fire']('replyCreated',_0x1c031b),_0x1c031b;}['setConversationTitle'](_0x3f23c7,_0x1cbb88=!0x1){this['fire']('setConversationTitle',_0x3f23c7,_0x1cbb88);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var de=function(_0x223c84){return _0x223c84['FILE']='file',_0x223c84['DOCUMENT']='document',_0x223c84['URL']='web-resource',_0x223c84['TEXT']='text',_0x223c84['SELECTION']='selection',_0x223c84;}({}),Re=function(_0x1d4b0c){return _0x1d4b0c['TEXT']='text',_0x1d4b0c['MARKDOWN']='markdown',_0x1d4b0c['HTML']='html',_0x1d4b0c;}({});const xi=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class Ii extends ts(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x123c18,config:_0x56d00b,ownerId:_0x4391fc}){super(),this['_connector']=_0x123c18,this['_config']=_0x56d00b,this['_ownerId']=_0x4391fc;}['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'](_0x36efbd){const _0x467186=await this['_createContextItemFromContent'](_0x36efbd);return this['_addToConversationContextItem'](_0x467186),'current-document'===_0x467186['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x467186;}async['_createContextItemFromContent'](_0x1da827){if(_0x1da827['type']===de['DOCUMENT']){const _0xf481ec=await this['_connector']['fetchDocument'](this['_ownerId'],_0x1da827['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x1da827['type'],'content':_0xf481ec['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0xf481ec['attributes']?.['version'],'sessionId':_0xf481ec['attributes']?.['sessionId']};}return{'id':_0x1da827['id'],'uiId':_0x1da827['id'],'label':_0x1da827['attributes']?.['label']||_0x1da827['name']||_0x1da827['url']||_0x1da827['id'],'type':_0x1da827['type'],..._0x1da827?.['attributes']?.['resourceId']?{'resourceId':_0x1da827['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x21cdd9){const _0x5f4c4c=this['_pendingContextItems']['get'](_0x21cdd9);_0x5f4c4c?.['isReadOnly']||this['_removeContextItem'](_0x21cdd9);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0xe93b1f of this['_pendingContextItems']['values']())this['_removeContextItem'](_0xe93b1f['uiId']);const _0x5446db=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x5446db&&this['_addContextItem']({..._0x5446db,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x4b99a2){for(const _0x104120 of _0x4b99a2['values']())this['_addToConversationContextItem'](_0x104120);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'](_0x437860){return Array['from'](_0x437860['values']())['map'](_0x1bbb70=>this['_mapContextItemToRequestData'](_0x1bbb70))['filter'](_0x752c1b=>null!==_0x752c1b);}async['addFilesToContext'](_0x2116d2,_0x50019b,_0x46e51f=de['FILE']){const _0x11d3d0='files-'+_0x10e5dc();this['_startUploadOperation'](_0x11d3d0);try{await Promise['all'](_0x2116d2['map'](async _0x54c3cc=>{const _0x493c03='file-'+_0x10e5dc(),_0x3a1b34=_0x17097f(_0x54c3cc['name']);try{this['_addContextItem']({'type':_0x46e51f,'label':_0x50019b?.['label']||_0x3a1b34,'uiId':_0x493c03,'resourceId':_0x50019b?.['resourceId']},!0x0);const _0x578c31=this['_connector']['uploadFile'](this['_ownerId'],_0x54c3cc,_0x50019b);this['_ongoingUploads']['set'](_0x493c03,_0x578c31['abortController']);const {id:_0x5d529d}=await _0x578c31['getId']();this['_ongoingUploads']['delete'](_0x493c03),this['_finishContextItemLoading']({'type':_0x46e51f,'id':_0x5d529d,'label':_0x50019b?.['label']||_0x3a1b34,'uiId':_0x493c03,'resourceId':_0x50019b?.['resourceId']},!0x1);}catch(_0x4e1c72){this['_ongoingUploads']['delete'](_0x493c03);if(!_0x4e1c72['message']['startsWith']('ai-request-aborted')){const _0x58c34e=new _0x5e86d1('ai-chat-file-upload-failed',null,{'fileName':_0x3a1b34});_0x58c34e['stack']=_0x4e1c72['stack'],this['fire']('error',{'error':_0x58c34e,'fileName':_0x3a1b34});}this['_removeContextItem'](_0x493c03);}}));}finally{this['_finishUploadOperation'](_0x11d3d0);}}['addCurrentDocumentToContext'](_0x5b9363){if(this['isCurrentDocumentInContext']())return;const _0x5bea65={'type':de['DOCUMENT'],'uiId':'current-document','label':_0x5b9363,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x5bea65);}async['updateCurrentDocument'](_0x470bf3,_0x4bb699,_0x24fd79,_0x1a56ba){const _0x12f936=this['_pendingContextItems']['get']('current-document');if(_0x12f936&&_0x470bf3){_0x12f936['selection']=_0x1a56ba?_0x1a56ba['map'](_0x455ad3=>({'start':_0x455ad3['start'],'end':_0x455ad3['end']})):[];try{if(_0x12f936['version']===_0x4bb699)return;const {id:_0x4e181d}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x470bf3,{'version':_0x4bb699,'sessionId':_0x24fd79})['getId']();_0x12f936['id']=_0x4e181d,_0x12f936['content']=_0x470bf3,_0x12f936['version']=_0x4bb699,_0x12f936['sessionId']=_0x24fd79;}catch(_0x1860ee){const _0x37037c=new _0x5e86d1('ai-chat-document-upload-failed',null);_0x37037c['stack']=_0x1860ee['stack'],this['fire']('error',{'error':_0x37037c});}}}['addSelectionToContext'](_0x6a25b6){this['_addContextItem']({'type':de['SELECTION'],'label':_0x6a25b6,'uiId':'selection','content':_0x6a25b6});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x509178,_0x2da5e8){const _0x3862e4='url-'+_0x10e5dc();this['_startUploadOperation'](_0x3862e4);const _0x3cf060='url-'+_0x10e5dc();try{this['_addContextItem']({'type':de['URL'],'label':_0x2da5e8?.['label']||_0x509178,'uiId':_0x3cf060,'resourceId':_0x2da5e8?.['resourceId']},!0x0);const _0x131108=this['_connector']['uploadUrl'](this['_ownerId'],_0x509178,_0x2da5e8);this['_ongoingUploads']['set'](_0x3cf060,_0x131108['abortController']);const {id:_0x15d15c}=await _0x131108['getId']();this['_ongoingUploads']['delete'](_0x3cf060),this['_finishContextItemLoading']({'type':de['URL'],'id':_0x15d15c,'label':_0x2da5e8?.['label']||_0x509178,'uiId':_0x3cf060,'resourceId':_0x2da5e8?.['resourceId']},!0x1);}catch(_0x2d1609){this['_ongoingUploads']['delete'](_0x3cf060),(_0x2d1609['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x5e86d1('ai-chat-url-upload-failed',this,{'url':_0x509178,'originalError':_0x2d1609}),'url':_0x509178}),this['_removeContextItem'](_0x3cf060));}finally{this['_finishUploadOperation'](_0x3862e4);}}async['loadSourceResources'](_0x1aa87a,_0x2ace51,_0xd201ff){const _0xbf8918=this['_addContextOptionsState']['sources']['find'](_0x44dfce=>_0x44dfce['id']===_0x1aa87a);if(!_0xbf8918)return this['fire']('error',{'error':new _0x5e86d1('ai-chat-source-not-found',this,{'sourceId':_0x1aa87a}),'sourceId':_0x1aa87a}),[];try{const _0x30e959=(await _0xbf8918['getResources'](_0x2ace51))['map'](_0x178901=>{const _0xe4809c=this['_isResourceInContext'](_0x178901['id']);return{..._0x178901,'isInContext':_0xe4809c};});return _0xbf8918['resources']=_0x30e959,this['fire']('sourceResourcesLoaded',{'sourceId':_0x1aa87a,'source':_0xbf8918,'resources':_0x30e959,'uid':_0xd201ff}),_0x30e959;}catch(_0x541a7c){return this['fire']('error',{'error':new _0x5e86d1('ai-chat-source-resources-load-failed',this,{'sourceId':_0x1aa87a,'originalError':_0x541a7c}),'sourceId':_0x1aa87a,'sourceLabel':_0xbf8918['label']}),[];}}async['addResourceToContext'](_0x4fc742,_0x53e379){if(this['_isResourceInContext'](_0x53e379['id']))return;let _0x3bbead=_0x53e379['data'];if(!_0x3bbead&&_0x4fc742['getData'])try{_0x3bbead=await _0x4fc742['getData'](_0x53e379['id']);}catch(_0x2534a){return void this['fire']('error',{'error':new _0x5e86d1('ai-chat-resource-load-failed',this,{'resourceId':_0x53e379['id'],'sourceId':_0x4fc742['id'],'originalError':_0x2534a}),'resourceId':_0x53e379['id'],'sourceId':_0x4fc742['id']});}if(_0x3bbead)switch(_0x53e379['type']){case de['URL']:if('string'!=typeof _0x3bbead)return void this['fire']('error',{'error':new _0x5e86d1('ai-chat-context-invalid-data',this,{'resourceId':_0x53e379['id'],'sourceId':_0x4fc742['id'],'expectedType':'string','actualType':typeof _0x3bbead}),'resourceId':_0x53e379['id'],'sourceId':_0x4fc742['id']});await this['addUrlToContext'](_0x3bbead,{'label':_0x53e379['label'],'resourceId':_0x53e379['id']});break;case de['FILE']:if(!(_0x3bbead instanceof File))return void this['fire']('error',{'error':new _0x5e86d1('ai-chat-context-invalid-data',this,{'resourceId':_0x53e379['id'],'sourceId':_0x4fc742['id'],'expectedType':'File','actualType':typeof _0x3bbead}),'resourceId':_0x53e379['id'],'sourceId':_0x4fc742['id']});await this['addFilesToContext']([_0x3bbead],{'label':_0x53e379['label'],'resourceId':_0x53e379['id']});break;case de['TEXT']:if('object'!=typeof _0x3bbead||!('content'in _0x3bbead)||!('type'in _0x3bbead))return void this['fire']('error',{'error':new _0x5e86d1('ai-chat-context-invalid-data',this,{'resourceId':_0x53e379['id'],'sourceId':_0x4fc742['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x3bbead}),'resourceId':_0x53e379['id'],'sourceId':_0x4fc742['id']});_0x3bbead=Ii['_convertTextResourceToFile'](_0x3bbead,_0x53e379['label']),await this['addFilesToContext']([_0x3bbead],{'label':_0x53e379['label'],'resourceId':_0x53e379['id']},de['TEXT']);break;default:this['fire']('error',{'error':new _0x5e86d1('ai-chat-context-unsupported-type',this,{'resourceId':_0x53e379['id'],'sourceId':_0x4fc742['id'],'resourceType':_0x53e379['type']}),'resourceId':_0x53e379['id'],'sourceId':_0x4fc742['id']});}else this['fire']('error',{'error':new _0x5e86d1('ai-chat-resource-no-data',this,{'resourceId':_0x53e379['id'],'sourceId':_0x4fc742['id']}),'resourceId':_0x53e379['id'],'sourceId':_0x4fc742['id']});}static['_convertTextResourceToFile'](_0x2877b3,_0x314421){switch(_0x2877b3['type']){case Re['MARKDOWN']:return new File([_0x2877b3['content']],_0x314421,{'type':'text/markdown'});case Re['HTML']:return new File([_0x2877b3['content']],_0x314421,{'type':'text/html'});default:return new File([_0x2877b3['content']],_0x314421,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x555dc9){switch(_0x555dc9['type']){case de['FILE']:return{'type':de['FILE'],'id':_0x555dc9['id']};case de['URL']:return{'type':de['URL'],'id':_0x555dc9['id']};case de['DOCUMENT']:return{'type':de['DOCUMENT'],'id':_0x555dc9['id'],..._0x555dc9['selection']?.['length']&&{'selection':_0x555dc9['selection']}};case de['TEXT']:return{'type':de['FILE'],'id':_0x555dc9['id']};default:return null;}}['_addContextItem'](_0x51c13b,_0x2800c1=!0x1){if(this['_pendingContextItems']['set'](_0x51c13b['uiId'],_0x51c13b),_0x51c13b['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x51c13b,'isLoading':_0x2800c1}),'current-document'===_0x51c13b['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x51c13b['resourceId']){const _0x316f5b=this['_findSourceIdsByResourceId'](_0x51c13b['resourceId']);_0x316f5b&&_0x316f5b['forEach'](_0x39dded=>{this['_updateResourceInContextState'](_0x39dded,_0x51c13b['resourceId'],!0x0);});}}['_removeContextItem'](_0x2eb674){const _0x353026=this['_pendingContextItems']['get'](_0x2eb674),_0x19db64=this['_ongoingUploads']['get'](_0x2eb674);if(_0x19db64&&(_0x19db64['abort'](),this['_ongoingUploads']['delete'](_0x2eb674)),_0x353026?.['resourceId']){const _0x2c6f05=this['_findSourceIdsByResourceId'](_0x353026['resourceId']);_0x2c6f05&&_0x2c6f05['forEach'](_0x10f164=>{this['_updateResourceInContextState'](_0x10f164,_0x353026['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x2eb674),this['fire']('contextItemRemoved',{'uiId':_0x2eb674,'type':_0x353026?.['type']}),'current-document'===_0x2eb674&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x44f181,_0x47d6e1){if(this['_pendingContextItems']['has'](_0x44f181['uiId'])&&(this['_pendingContextItems']['set'](_0x44f181['uiId'],_0x44f181),this['fire']('contextItemLoadingEnded',{'contextItem':_0x44f181,'isLoading':_0x47d6e1}),_0x44f181['resourceId'])){const _0x3e4666=this['_findSourceIdsByResourceId'](_0x44f181['resourceId']);_0x3e4666&&_0x3e4666['forEach'](_0x557719=>{this['_updateResourceInContextState'](_0x557719,_0x44f181['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x22a17a){this['_conversationContextItems']['set'](_0x22a17a['uiId'],_0x22a17a);}['_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'](_0x4d85ba=>({..._0x4d85ba,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x2f9e66=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x2f9e66,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x3e9d76){for(const _0xf849db of this['_pendingContextItems']['values']())if(_0xf849db['resourceId']===_0x3e9d76)return!0x0;for(const _0x565c7e of this['_conversationContextItems']['values']())if(_0x565c7e['resourceId']===_0x3e9d76)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0xb41496){const _0x31c8aa=[];for(const _0x3ed1d2 of this['_addContextOptionsState']['sources']){_0x3ed1d2['resources']['find'](_0x22dc68=>_0x22dc68['id']===_0xb41496)&&_0x31c8aa['push'](_0x3ed1d2['id']);}return 0x0===_0x31c8aa['length']?null:_0x31c8aa;}['_updateResourceInContextState'](_0x166015,_0x343fec,_0x2633d1){const _0xccdb0b=this['_addContextOptionsState']['sources']['find'](_0x32563f=>_0x32563f['id']===_0x166015);if(!_0xccdb0b)return;const _0x25f5b4=_0xccdb0b['resources']['find'](_0x172c8e=>_0x172c8e['id']===_0x343fec);_0x25f5b4&&(_0x25f5b4['isInContext']=_0x2633d1,this['fire']('resourceStateChanged',{'sourceId':_0x166015,'resourceId':_0x343fec,'isInContext':_0x2633d1}));}['_startUploadOperation'](_0x363a3a){this['_ongoingUploadOperations']['set'](_0x363a3a,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x64d575){this['_ongoingUploadOperations']['delete'](_0x64d575),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const bi=['capabilitiesUpdated'];class gi extends _0x106985(){['_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'](_0x5483d3){const _0x2acd87={};return _0x5483d3&&_0x5483d3['isWebSearchEnabled']&&(_0x2acd87['webSearch']={}),_0x5483d3&&_0x5483d3['isReasoningEnabled']&&(_0x2acd87['reasoning']={}),_0x2acd87;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x4a018f){_0x4a018f!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x4a018f,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x103763){_0x103763!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x103763,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class yi extends me{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['quickActionData'];constructor(_0x520b15){super(_0x520b15),this['conversationId']=_0x520b15['conversationId'],this['contextItems']=_0x520b15['contextItems'],this['capabilities']=_0x520b15['capabilities'],this['userMessage']=_0x520b15['userMessage'],this['model']=_0x520b15['model'],this['quickActionData']=_0x520b15['quickActionData'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':Ii['mapContextItemsToRequestData'](this['contextItems']),'capabilities':gi['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'quickActionData':this['quickActionData']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class ht extends _0x106985(){['id'];['isStarted']=!0x1;['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x115f9c){super(),this['options']=_0x115f9c,this['connector']=_0x115f9c['connector'],this['chatModels']=_0x115f9c['chatModels'],this['id']=_0x115f9c['conversationId'];}async['init'](_0x41c41e){try{this['chatContext']=new Ii({'connector':this['connector'],'config':_0x41c41e,'ownerId':this['id']}),this['chatContext']['delegate'](...xi)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new gi(),this['chatCapabilities']['delegate'](...bi)['to'](this),this['chatCapabilities']['init']();const _0x49915d=await this['chatModels']['getAll']();this['fire']('conversationInitialized',{'availableModels':_0x49915d});const _0x22caf8=await this['chatModels']['getDefault'](this['options']['defaultModelId']);_0x22caf8&&await this['setModel'](_0x22caf8);}catch(_0x5df747){const _0x5eb05f=new _0x5e86d1('ai-chat-conversation-init-failed',null,{'message':_0x5df747['message']});_0x5eb05f['stack']=_0x5df747['stack'],this['fire']('error',{'error':_0x5eb05f});}}async['start'](){if(this['isStarted'])throw new _0x5e86d1('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x5e86d1('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x47b4f0}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x47b4f0,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x5cd7a4){const _0x170365=new _0x5e86d1('ai-chat-conversation-start-failed',null,{'message':_0x5cd7a4['message']});_0x170365['stack']=_0x5cd7a4['stack'],this['fire']('error',{'error':_0x170365});}}async['load'](_0x2c01af,_0x161646){try{const _0x15bbc2=await this['connector']['fetchConversation'](_0x2c01af)['getConversation'](),_0x2c291c=await this['connector']['fetchConversationMessages'](_0x2c01af)['getMessages'](),_0x2d266f=_0x2c291c[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x15bbc2['id'],'title'in _0x15bbc2?this['fire']('setConversationTitle',_0x15bbc2['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x492cb2=(await this['chatModels']['getAll']())['find'](_0x35d283=>_0x35d283['id']['toLowerCase']()===_0x2d266f['toLowerCase']());return this['selectedModel']=_0x492cb2,this['fire']('modelSelected',{'selectedModel':_0x492cb2,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x2c291c,_0x161646,_0x2d266f),this['currentInteraction']=void 0x0,this;}catch(_0x315129){const _0x4cb8a5=new _0x5e86d1('ai-chat-conversation-init-from-id-failed',null,{'message':_0x315129['message'],'conversationId':_0x2c01af});throw _0x4cb8a5['stack']=_0x315129['stack'],this['fire']('error',{'error':_0x4cb8a5}),_0x4cb8a5;}}async['_processMessagesToInteractions'](_0x16e83c,_0x220df,_0x508699){let _0xcda2d;for(const _0x558d03 of _0x16e83c)if('user'===_0x558d03['role']){const _0x2a2ee7=await this['_extractContextItems'](_0x558d03),_0x2e6554={'isReasoningEnabled':Object['hasOwn'](_0x558d03['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x558d03['capabilities'],'webSearch')};_0xcda2d=this['createInteraction']({'userMessage':_0x558d03['prompt'],'contextItems':_0x2a2ee7,'capabilities':_0x2e6554,'modelId':_0x508699,'quickActionData':_0x558d03['attributes']?.['quickActionData']}),this['currentInteraction']=_0xcda2d,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x558d03['role']&&_0xcda2d)for(const _0x53a1bb of _0x558d03['content']){const _0x2e7437='text'===_0x53a1bb['type']?'text-delta':'modification-delta',_0x5ce5a6=_0xcda2d['getDocumentContext']()?.['sessionId']!==_0x220df;_0xcda2d['currentReply']=_0xcda2d['createReply']({'type':_0x2e7437,'isDone':!0x0,'interactionId':_0xcda2d['id'],'areActionsDisabled':_0x5ce5a6}),_0xcda2d['currentReply']['appendContent'](_0x53a1bb['content']);}}}async['_extractContextItems'](_0x21403){const _0x5aa76d=new Map();if(!_0x21403['content'])return _0x5aa76d;for(const _0x17d009 of _0x21403['content']){const _0x2cb044=await this['chatContext']['populateFromMessage'](_0x17d009);_0x2cb044&&_0x5aa76d['set'](_0x2cb044['id'],_0x2cb044);}return _0x5aa76d;}async['handleUserInteraction']({userMessage:_0x1c1afc,quickActionData:_0xf4a8d6}){if(!this['isStarted'])throw new _0x5e86d1('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x5e86d1('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x569897=this['chatContext']['getPendingContextItems'](),_0x3d92bd=this['chatCapabilities']['getCapabilitiesConfig'](),_0x230f60=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x1c1afc,'contextItems':_0x569897,'capabilities':_0x3d92bd,'modelId':_0x230f60,'quickActionData':_0xf4a8d6}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x3e1b6e){this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x3e1b6e});}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x82469,contextItems:_0xd0428b,capabilities:_0x323f8b,modelId:_0x3e9bbc,quickActionData:_0x19c038}){const _0x402ec1=new yi({'userMessage':_0x82469,'contextItems':_0xd0428b,'capabilities':_0x323f8b,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x3e9bbc,'quickActionData':_0x19c038});return _0x402ec1['delegate'](...ue)['to'](this),this['interactions']['push'](_0x402ec1),this['fire']('interactionCreated',_0x402ec1),_0x402ec1;}['getInteraction'](_0x1d20be){return this['interactions']['find'](_0x40882e=>_0x40882e['id']===_0x1d20be);}['removeInteraction'](_0x4f2695){const _0x3ae290=this['getInteraction'](_0x4f2695);_0x3ae290&&(_0x3ae290['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x3ae290),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x4b768f){this['chatContext']['addCurrentDocumentToContext'](_0x4b768f);}async['updateCurrentDocumentInContext']({content:_0xcd00b6,version:_0xd873cd,sessionId:_0x1ca169,selections:_0x175c0c}){await this['chatContext']['updateCurrentDocument'](_0xcd00b6,_0xd873cd,_0x1ca169,_0x175c0c);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x132f2b){this['chatContext']['addSelectionToContext'](_0x132f2b);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x59c284){this['chatContext']['addFilesToContext'](_0x59c284);}['addUrlToContext'](_0x2d290e){this['chatContext']['addUrlToContext'](_0x2d290e);}['addResourceToContext'](_0x417be5,_0x1d6647){this['chatContext']['addResourceToContext'](_0x417be5,_0x1d6647);}['loadSourceResources'](_0x5bab56,_0x408d9d,_0x417dff){return this['chatContext']['loadSourceResources'](_0x5bab56,_0x408d9d,_0x417dff);}['removeFromContext'](_0x5632c2){this['chatContext']['removeFromContext'](_0x5632c2);}['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'](_0x137b45){if(!_0x137b45)throw new _0x5e86d1('ai-chat-conversation-set-model-null',null,{'conversation':this});if(!0x1===await this['chatModels']['isAvailable'](_0x137b45))throw new _0x5e86d1('ai-chat-conversation-set-model-not-available',null,{'conversation':this,'model':_0x137b45});_0x137b45['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x137b45,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x137b45}));}}function lt(_0x22db57){if(_0x22db57 instanceof st)return _0x22db57;if(_0x22db57?.['editors']&&_0x22db57['editors']['get'](0x0))return _0x22db57['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.'),_0x22db57['editors']['get'](0x0);throw new _0x5e86d1('ai-get-editor-from-context-no-editor');}const ct='ai-selection';class h extends tt{['_displayedFakeSelectionId']=null;['_displayedFakeSelectionLocked']=!0x1;['_sessionId'];static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['sessionId'](){if(!this['_sessionId']){const _0x4a2905=lt(this['context']),_0x187fde=_0x4a2905['plugins']['has']('RealTimeCollaborationClient')&&_0x4a2905['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x187fde||_0x10e5dc();}return this['_sessionId'];}['getDocumentData'](){const _0x269af1=lt(this['context']),_0x11b11f=_0x269af1['model'],_0x18d616=_0x269af1['data']['toView'](_0x11b11f['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x4a81e1=new kt(_0x269af1['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x18d616,_0x4a81e1);let _0x406297=_0x269af1['data']['processor']['toData'](_0x18d616);const _0xe42c5b=this['_getMarkersInDocumentOrder'](),_0x16ff33=[];for(const _0x4f9cea of _0xe42c5b){const _0x3233f3='<'+_0x4f9cea['name']+':start></'+_0x4f9cea['name']+':start>',_0x1fff80=_0x406297['indexOf'](_0x3233f3);_0x406297=_0x406297['substring'](0x0,_0x1fff80)+_0x406297['substring'](_0x1fff80+_0x3233f3['length']);const _0x469c2d='<'+_0x4f9cea['name']+':end></'+_0x4f9cea['name']+':end>',_0x2a0640=_0x406297['indexOf'](_0x469c2d);_0x406297=_0x406297['substring'](0x0,_0x2a0640)+_0x406297['substring'](_0x2a0640+_0x469c2d['length']),_0x16ff33['push']({'markerName':_0x4f9cea['name'],'start':_0x1fff80,'end':_0x2a0640,'htmlFragment':_0x406297['substring'](_0x1fff80,_0x2a0640)});}return{'content':_0x406297,'version':_0x269af1['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x16ff33};}async['afterInit'](){this['context']instanceof st?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x3d5ba6,_0x122fcf)=>{_0x122fcf['on']('ready',()=>{this['_integrateEditor'](_0x122fcf);});});}['_integrateEditor'](_0xc366d3){_0xc366d3['conversion']['for']('editingDowncast')['markerToHighlight']({'model':ct,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0xc366d3['conversion']['for']('dataDowncast')['markerToElement']({'model':ct,'view':(_0x830b92,{writer:_0x592d25,options:_0x11fe9f})=>_0x11fe9f['convertAiChatSelectionMarker']?_0x592d25['createUIElement'](_0x830b92['markerName']+':'+(_0x830b92['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x2241b3,_0x10b860,_0x17dabf=!0x1,_0x49d18f=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x49d18f)return!0x1;this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x10b860,this['_displayedFakeSelectionLocked']=_0x17dabf;const _0x2c817a=lt(this['context'])['model'];return _0x2c817a['change'](_0x2af59d=>{let _0x132c6a=0x0;for(let _0xf8f0f of _0x2241b3){const _0x1a0e7e=ct+':'+_0x132c6a;if(_0xf8f0f['start']['isAtEnd']){const _0x3af54b=_0xf8f0f['start']['getLastMatchingPosition'](({item:_0x38ae68})=>!_0x2c817a['schema']['isContent'](_0x38ae68),{'boundaries':_0xf8f0f});_0xf8f0f=_0x2af59d['createRange'](_0x3af54b,_0xf8f0f['end']);}_0x2af59d['addMarker'](_0x1a0e7e,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xf8f0f}),_0x132c6a++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0xd3e4aa){if(this['_displayedFakeSelectionId']!=_0xd3e4aa)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x246842=lt(this['context']),_0x53ff0f=_0x246842['model']['markers']['getMarkersGroup'](ct);return _0x246842['model']['change'](_0x55d199=>{for(const _0x368409 of _0x53ff0f)_0x55d199['removeMarker'](_0x368409);}),!0x0;}['modelToViewWithIds'](_0x2c6a57){const _0x3fe255=lt(this['context']),_0x288c17=_0x3fe255['data']['toView'](_0x2c6a57),_0xbe2134=new kt(_0x3fe255['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x288c17,_0xbe2134),_0x288c17;}['_setDataIdsOnChildren'](_0x2a1e1e,_0x2dcf71){let _0x382934=!0x1;const _0x3fbcaa=new Set();for(const _0x5b27fe of _0x2a1e1e['getChildren']()){const _0x260dbe=_0x5b27fe['is']('emptyElement')||_0x5b27fe['is']('containerElement');if(!_0x5b27fe['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x5b27fe,_0x2dcf71)||_0x260dbe)&&(_0x2dcf71['setAttribute']('data-id',this['_nextDataId'](_0x3fbcaa),_0x5b27fe),_0x382934=!0x0);}return _0x382934;}['_nextDataId'](_0x499cae){let _0x3e3e8c;do{_0x3e3e8c='';for(let _0x13da5b=0x0;_0x13da5b<0x4;_0x13da5b++)_0x3e3e8c+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x499cae['has'](_0x3e3e8c));return _0x499cae['add'](_0x3e3e8c),_0x3e3e8c;}['getSelectionText'](){const {model:_0x81772a}=lt(this['context']),_0x5ef5d3=_0x81772a['document']['selection'],_0x2c7863=_0x81772a['getSelectedContent'](_0x5ef5d3),_0x444f5b=[],_0x1b2445=_0x81772a['createRangeIn'](_0x2c7863)['getWalker']();for(const {item:_0x1f80b1}of _0x1b2445)_0x1f80b1['is']('$textProxy')?_0x444f5b['push'](_0x1f80b1['data']):_0x1f80b1['is']('element')&&_0x444f5b['length']>0x0&&'\x20'!==_0x444f5b[_0x444f5b['length']-0x1]&&_0x444f5b['push']('\x20');return'\x22'+_0x444f5b['join']('')['trim']()+'\x22';}['_getMarkersInDocumentOrder'](){const _0x5e5f7b=lt(this['context'])['model'];return Array['from'](_0x5e5f7b['markers']['getMarkersGroup'](ct))['sort']((_0x3b7fbc,_0x19a553)=>_0x3b7fbc['getStart']()['isBefore'](_0x19a553['getStart']())?-0x1:_0x3b7fbc['getStart']()['isAfter'](_0x19a553['getStart']())?0x1:0x0);}}class dt extends _0x106985(){['_modelList']=[];['_connector'];constructor({connector:_0x418c25}){super(),this['_connector']=_0x418c25;}async['getAll'](){if(!this['_modelList']['length']){const _0x1b6ad2=this['_connector']['getModels'](),_0x2bf723=(await _0x1b6ad2['list']())['items']['sort']((_0x44b809,_0x1679fb)=>{const _0x3b9b57=Object['values'](_0x44b809['capabilities'])['filter'](_0x97632b=>_0x97632b['enabled'])['length'];return Object['values'](_0x1679fb['capabilities'])['filter'](_0xfd7183=>_0xfd7183['enabled'])['length']-_0x3b9b57;});this['_modelList']=_0x2bf723;}return this['_modelList'];}async['getDefault'](_0x53bc65){const _0xcf9bb7=await this['getAll']();if(!_0xcf9bb7['length'])return null;if(_0x53bc65){const _0x39d817=_0xcf9bb7['find'](_0x2214ba=>_0x2214ba['id']===_0x53bc65);if(_0x39d817)return _0x39d817;_0x51ad8b('ai-chat-default-model-id-unrecognized',{'defaultModelId':_0x53bc65,'fallBackModelId':_0xcf9bb7[0x0]['id']});}return _0xcf9bb7[0x0];}async['isAvailable'](_0x2ca962){return(await this['getAll']())['some'](_0x174637=>_0x174637['name']===_0x2ca962['name']&&_0x174637['provider']===_0x2ca962['provider']);}}function I({editor:_0x4e6611,interaction:_0x653934,reply:_0x51abf1,groups:_0x5c59e1,transform:_0xaef8eb,documentCompare:_0x19ccb3,documentCompareOptions:_0x1cafc4}){const _0x1d5a64=_0x653934['getDocumentContext']();if(!_0x1d5a64)return[];const _0x368852=_0x1d5a64['content'],_0x3da7fa=_0x1d5a64['version'],_0x4f9507=_0x51abf1['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x2950b6}of _0x5c59e1){const _0x46eb95=_0x2950b6['filter'](_0x48e92a=>'new'!=_0x48e92a['type'])['map'](_0x4ed0d8=>It('data-id',_0x4ed0d8['id'],_0x4f9507)),_0x2fc1a3=_0x2950b6['filter'](_0x5f0232=>'removed'!=_0x5f0232['type'])['map'](_0x402633=>_0x402633['node']['cloneNode'](!0x0));let _0x218f47=null;if(_0x46eb95['length']){_0x218f47=_0x46eb95[0x0]['previousSibling'];for(let _0x24c976=0x0;_0x24c976<_0x46eb95['length'];_0x24c976++)_0x4156ef(_0x46eb95[_0x24c976]);}if(_0x2fc1a3['length']){_0x218f47||(_0x2950b6[0x0]['anchorId']?_0x218f47=It('data-id',_0x2950b6[0x0]['anchorId'],_0x4f9507):(_0x218f47=_0x2fc1a3['shift'](),to(_0x4f9507,_0x218f47)));for(let _0x20039f=0x0;_0x20039f<_0x2fc1a3['length'];_0x20039f++)_0x21a231(_0x218f47,_0x2fc1a3[_0x20039f]),_0x218f47=_0x2fc1a3[_0x20039f];}}const _0x87e7e2=Ct(_0x4f9507),_0x46fabf=_0x19ccb3['getDiff'](_0x368852,_0x87e7e2,_0x1cafc4)['getOperations']();if(_0xaef8eb){const _0x3b2280=_0x4e6611['model']['document']['history']['getOperations'](_0x3da7fa),_0x554258={'document':_0x4e6611['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x45cebc(_0x46fabf,_0x3b2280,_0x554258)['operationsA'];}return _0x46fabf;}function y({editor:_0x220779,changeGroups:_0x5f13e3,documentContextContent:_0x4c85f8,showDiff:_0x4a8269,trimUnchanged:_0x5d13de=!0x0}){return _0x5f13e3['map'](_0x7c8c55=>{const _0x1fbf63=new _t([]),_0x96c86c=new _t([]);for(const _0x3b3b0d of _0x7c8c55['changes'])if(_0x4a8269&&'removed'==_0x3b3b0d['type']||_0x96c86c['children']['push'](_0x3b3b0d['node']['cloneNode'](!0x0)),'new'!=_0x3b3b0d['type']&&(_0x4a8269||'removed'!=_0x3b3b0d['type'])){const _0x53b714=mt(_0x2174c4=>ft(_0x2174c4,'data-id')==_0x3b3b0d['id'],_0x4c85f8,!0x0);_0x53b714&&_0x1fbf63['children']['push'](_0x53b714['cloneNode'](!0x0));}const {content:_0xd06c81,hasChanges:_0x1716d0}=function(_0x2b5ba7,_0x10bf22,_0x286dd8,_0x39d18e,_0x1fc913=!0x0){const _0x259775=_0x2b5ba7['plugins']['get']('DocumentCompare'),_0x5e492d=_0x2b5ba7['plugins']['get']('TrackChangesEditing'),_0xfa531b=Ct(_0x10bf22),_0x223a01=Ct(_0x286dd8),_0xa7f65=_0x2b5ba7['data']['parse'](_0xfa531b,'$root'),_0xa43e60=_0x2b5ba7['model']['createPositionAt'](_0xa7f65,0x0),_0x4039dc=_0x259775['getDiff'](_0xfa531b,_0x223a01,{'anchor':_0xa43e60,'markDeletions':_0x39d18e}),_0x3c4c2d=_0x4039dc['getOperations']();if(0x0==_0x3c4c2d['length'])return{'content':_0x10bf22['cloneNode'](!0x0),'hasChanges':!0x1};_0x39d18e?_0x5e492d['_applyOperationsAsSuggestions'](_0x3c4c2d):_0x2b5ba7['model']['change'](_0x1a651f=>{for(const _0x2a7d85 of _0x3c4c2d)if('remove'==_0x2a7d85['type']){const _0x34552d=_0x2a7d85['sourcePosition'],_0x1a7bf3=_0x2a7d85['howMany'],_0x4041e8=new _0x289d3b(_0x34552d,_0x1a7bf3);_0x1a651f['batch']['addOperation'](_0x4041e8),_0x2b5ba7['model']['applyOperation'](_0x4041e8);}else _0x2a7d85['baseVersion']=null,_0x2a7d85['isDocumentOperation']=!0x1,_0x1a651f['batch']['addOperation'](_0x2a7d85),_0x2b5ba7['model']['applyOperation'](_0x2a7d85);});if(_0x1fc913){const _0x36cad6=ut(_0x2b5ba7,_0x3c4c2d,_0xa7f65);pt(_0x2b5ba7['model'],_0x36cad6),function(_0x11751d,_0xcfb87c){const _0x4a9f87=_0xcfb87c['getFirstRange']()['start'];let _0x469c24=_0xcfb87c['getFirstRange']()['end'];const _0x249d91=_0x4a9f87['root'];(_0x469c24['textNode']||_0x469c24['nodeAfter']&&_0x469c24['nodeAfter']['is']('$text'))&&(_0x4106c6(_0x469c24,'...'),_0x469c24=_0x469c24['getShiftedBy'](0x3)),(_0x4a9f87['textNode']||_0x4a9f87['nodeBefore']&&_0x4a9f87['nodeBefore']['is']('$text'))&&(_0x4106c6(_0x4a9f87,'...'),function(_0x1f01a5,_0x12558e,_0x1ac90e){for(let [_0x535b36,_0x1ab020]of _0x1f01a5['markers']){const _0x13bfe6=_0x1ab020['_getTransformedByInsertion'](_0x12558e,_0x1ac90e,!0x1);_0x1ab020=_0x13bfe6[0x0],_0x1f01a5['markers']['set'](_0x535b36,_0x1ab020);}}(_0x249d91,_0x4a9f87,0x3),_0x4a9f87['parent']==_0x469c24['parent']&&(_0x469c24=_0x469c24['getShiftedBy'](0x3)));const _0x361ef4=_0x11751d['createRange'](_0x11751d['createPositionAt'](_0x249d91,0x0),_0x4a9f87),_0x4a5662=_0x11751d['createRange'](_0x469c24,_0x11751d['createPositionAt'](_0x249d91,'end')),_0x250825=[..._0x361ef4['getMinimalFlatRanges'](),..._0x4a5662['getMinimalFlatRanges']()];_0x250825['reverse']();for(const _0x3b0ab3 of _0x250825)_0x3517d6(_0x3b0ab3),Qr(_0x249d91,_0x3b0ab3);}(_0x2b5ba7['model'],_0x36cad6);}const _0x171054=_0x2b5ba7['data']['stringify'](_0xa7f65,{'showSuggestionHighlights':!0x0});return{'content':tr(_0x171054),'hasChanges':!0x0};}(_0x220779,_0x1fbf63,_0x96c86c,_0x4a8269,_0x5d13de);return{'type':_0x7c8c55['changes'][0x0]['type'],'index':_0x7c8c55['index'],'content':_0xd06c81,'hasChanges':_0x1716d0};});}function ut(_0x121b3d,_0x10cf13,_0x1e3ef9){const _0x298db1=_0x121b3d['plugins']['get']('DocumentCompare');let _0x3a2648=_0x121b3d['model']['createPositionAt'](_0x1e3ef9,Number['POSITIVE_INFINITY']),_0x1ba7e5=_0x121b3d['model']['createPositionAt'](_0x1e3ef9,0x0);for(const _0x29948f of _0x10cf13){let _0x34f025,_0x1d9e77;if(_0x298db1['isMarkedRemoveOperation'](_0x29948f))_0x34f025=_0x29948f['newRange']['start'],_0x1d9e77=_0x29948f['newRange']['end'];else switch(_0x3a2648=_0x3a2648['getTransformedByOperation'](_0x29948f),_0x1ba7e5=_0x1ba7e5['getTransformedByOperation'](_0x29948f),_0x29948f['type']){case'rename':_0x34f025=_0x29948f['position'],_0x1d9e77=_0x34f025['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x34f025=_0x29948f['range']['start'],_0x1d9e77=_0x29948f['range']['end'];break;case'insert':_0x34f025=_0x29948f['position'],_0x1d9e77=_0x34f025['getShiftedBy'](_0x29948f['howMany']);break;case'split':_0x34f025=_0x29948f['splitPosition'],_0x1d9e77=_0x29948f['moveTargetPosition'];break;case'merge':{const _0x681cac=_0x29948f['targetPosition']['path']['slice'](0x0,-0x1);_0x34f025=_0x121b3d['model']['createPositionFromPath'](_0x1e3ef9,_0x681cac),_0x1d9e77=_0x34f025['getShiftedBy'](0x1);break;}case'remove':{const _0x1d4325=_0x29948f['howMany'],_0x95587d=_0x29948f['sourcePosition']['_getTransformedByInsertion'](_0x29948f['targetPosition'],_0x1d4325),_0x570e3a=_0x29948f['getMovedRangeStart']();'remove'==_0x29948f['type']?(_0x34f025=_0x95587d,_0x1d9e77=_0x95587d):(_0x34f025=_0x570e3a,_0x1d9e77=_0x570e3a['getShiftedBy'](_0x1d4325));break;}}_0x34f025&&_0x34f025['isBefore'](_0x3a2648)&&(_0x3a2648=_0x34f025['clone'](),_0x3a2648['stickiness']='toNone'),_0x1d9e77&&_0x1d9e77['isAfter'](_0x1ba7e5)&&(_0x1ba7e5=_0x1d9e77['clone'](),_0x1ba7e5['stickiness']='toNone');}return _0x121b3d['model']['createSelection'](_0x121b3d['model']['createRange'](_0x3a2648,_0x1ba7e5));}function pt(_0x13b439,_0x5c5938){mn(_0x13b439,_0x5c5938,'forward');const _0x4144cd=_0x5c5938['getFirstRange']();_0x5c5938['setTo']([]),_0x5c5938['setTo'](_0x4144cd,{'backward':!0x0}),mn(_0x13b439,_0x5c5938,'backward');}function mn(_0x155fbb,_0x5c5009,_0x29f13e){let _0x2f13a7=0x14;for(;_0x2f13a7;){_0x155fbb['modifySelection'](_0x5c5009,{'unit':'word','direction':_0x29f13e}),_0x2f13a7--;const _0x13e99a=_0x5c5009['focus']['forward'==_0x29f13e?'nodeBefore':'nodeAfter'];if(_0x13e99a&&_0x13e99a['is']('element')&&_0x155fbb['schema']['isBlock'](_0x13e99a)&&_0x155fbb['schema']['isObject'](_0x13e99a))break;}}function Qr(_0x3e0b16,_0x5de419){for(let [_0x44dbab,_0x335d06]of _0x3e0b16['markers'])_0x335d06=_0x335d06['_getTransformedByDeletion'](_0x5de419['start'],_0x5de419['end']['offset']-_0x5de419['start']['offset']),_0x3e0b16['markers']['set'](_0x44dbab,_0x335d06);}class Lr extends _0x5143cf{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x5185c5,_0x8dff05={},_0x4407b8){super(_0x5185c5),this['set']('isLoading',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x8dff05};const _0x487886=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x487886?'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'](_0x4407b8),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 _0xb98904(this['locale']),this['likeButton']['set']({'icon':_0x1fa777,'label':w(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x5625cc=>!_0x5625cc),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0xb98904(this['locale']),this['dislikeButton']['set']({'icon':_0xc7e49b,'label':w(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x3a872f=>!_0x3a872f),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0xb98904(this['locale']),this['copyButton']['set']({'icon':_0x46278c,'label':w(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x27e9e9=>!_0x27e9e9);const _0x44aef2=new _0x2bd673();_0x44aef2['set']({'content':_0x2b80f8}),_0x44aef2['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'](_0x44aef2);}['_setupShowChangesButton'](_0xf121b3){this['showChangesButton']=new _0xb98904(this['locale']),this['showChangesButton']['set']({'icon':_0x14b360,'label':w(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'isOn':_0xf121b3}),this['showChangesButton']['bind']('isEnabled')['to'](this,'isLoading',_0x3db813=>!_0x3db813),this['showChangesButton']['on']('execute',()=>{const _0x7a9135=!this['showChangesButton']['isOn'];this['showChangesButton']['set']({'isOn':_0x7a9135,'icon':_0x7a9135?_0x2c3bdc:_0x14b360}),this['fire']('toggleShowChanges',_0x7a9135);});}}class Dr extends _0x14b3a2{['showChangesToggleView'];constructor(_0x46aa65,_0x2cc4c2){super(_0x46aa65),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Xr(_0x46aa65),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle','label':w(_0x46aa65,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x2cc4c2['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x24d90a=>_0x24d90a?_0x4727ab:_0x3894d2),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x3bf53e=new _0x2bd673();_0x3bf53e['content']=_0x21745d,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x2cc4c2['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x3bf53e,{'tag':'span','children':[w(_0x46aa65,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Xr extends _0xb98904{['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(_0x5332c7){this['options']={'delay':_0x5332c7['delay']??0x14,'textNodeStyle':_0x5332c7['textNodeStyle'],'onStreamUpdate':_0x5332c7['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x3dd7bc,targetElement:_0x2dc8fc,abortSignal:_0x46a97a}){this['isStreaming']&&this['stop'](),_0x46a97a?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0xf6688c(_0x3dd7bc,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(_0x51ad8b('html-streamer-current-index-out-of-bounds',{'currentIndex':this['currentIndex'],'nodeList':this['nodesList']}),this['currentIndex']=this['nodesList']['length']);for(let _0x54cbbb=0x0;_0x54cbbb<this['currentIndex'];_0x54cbbb++)this['nodesList'][_0x54cbbb]['shouldBeStreamed']=!0x0;let _0x278370=0x0;for(let _0x5ecc48=this['currentIndex'];_0x5ecc48<this['nodesList']['length'];_0x5ecc48++){const _0x1cfcc0=Date['now'](),_0x478dd5=this['nodesList'][_0x5ecc48],_0x4cbf72=_0x1cfcc0-_0x278370;_0x478dd5['shouldBeStreamed']=!0x0;let _0x3e14f6=_0x478dd5['parent'];for(;_0x3e14f6;)_0x3e14f6['shouldBeStreamed']=!0x0,_0x3e14f6=_0x3e14f6['parent'];if(_0x4cbf72<this['options']['delay'])try{const {promise:_0x40ee5e,abortController:_0x412aae}=mr(this['options']['delay']-_0x4cbf72);this['timeoutAbortController']=_0x412aae,await _0x40ee5e;}catch(_0x5894b9){return;}_0x2b9e21(_0x2dc8fc,'<'+_0x2dc8fc['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x2dc8fc['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']=_0x5ecc48,_0x278370=Date['now']();}this['isStreaming']=!0x1;}['cleanUpAnimations']({targetElement:_0x5e2490}){Array['from'](_0x5e2490['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x4ec569=>{_0x4ec569['replaceWith'](_0x4ec569['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x257ee3){let _0x3bedc0='';if(function(_0x10cfa9){return _0xe37c80(_0x10cfa9);}(_0x257ee3)){for(const _0x40a7f4 of _0x257ee3['children'])_0x3bedc0+=this['renderNode'](_0x40a7f4);}else{if(ar(_0x257ee3)){if(!_0x257ee3['shouldBeStreamed'])return'';const _0x428319=_0x257ee3,_0x465194=Object['entries'](_0x428319['attribs'])['map'](([_0x293ed4,_0x5dd803])=>_0x293ed4+'=\x22'+_0x5dd803+'\x22')['join']('\x20');_0x3bedc0+='<'+_0x428319['tagName']+(_0x465194?'\x20'+_0x465194:'')+'>';for(const _0x2ac162 of _0x8ec974(_0x428319))_0x3bedc0+=this['renderNode'](_0x2ac162);_0x3bedc0+='</'+_0x428319['tagName']+'>';}else{if(!cr(_0x257ee3))return'';if(!_0x257ee3['shouldBeStreamed'])return'';!function(_0x2e0716){if(!_0x2e0716['parent']||!ar(_0x2e0716['parent']))return!0x1;if(!hr['includes'](_0x2e0716['parent']['tagName']))return!0x1;return!_0xd47988(_0x2e0716)['match'](/^\s*[<>]\s*$/);}(_0x257ee3)?_0x3bedc0+=_0x501beb(_0x257ee3):_0x3bedc0+=_0x501beb(new tn('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x257ee3]));}}return _0x3bedc0;}['getParsedDocumentNodeList'](){const _0x2fb819=[];return function(_0x5d114d,_0x53b121){const _0x5bbb2f=_0x28323a=>{if(_0x53b121(_0x28323a),_0x28323a instanceof _0x1dc761)for(let _0x3d6873=0x0;_0x3d6873<_0x28323a['children']['length'];_0x3d6873++){const _0x5541ba=_0x28323a['children'][_0x3d6873];_0x5bbb2f(_0x5541ba);}};for(let _0x39c579=0x0;_0x39c579<_0x5d114d['children']['length'];_0x39c579++)_0x5bbb2f(_0x5d114d['children'][_0x39c579]);}(this['document'],_0x24485a=>{if(cr(_0x24485a)){const _0x8756be=this['splitTextNodeIntoWordNodes'](_0x24485a);_0x8756be['length']&&_0x2fb819['push'](..._0x8756be);}_0x24485a['isWordSplitSource']||_0x24485a['isWordSplitResult']||_0x2fb819['push'](_0x24485a);}),_0x2fb819;}['splitTextNodeIntoWordNodes'](_0x50f4ee){if(_0x50f4ee['isWordSplitSource']||_0x50f4ee['isWordSplitResult'])return[];const _0x5d786d=_0xd47988(_0x50f4ee)['match'](/(?:\s*\S+\s*)/g),_0x436553=[];if(_0x5d786d&&_0x5d786d['length']>0x1){for(const _0x44f273 of _0x5d786d){const _0x1703ce=new _0x308946(_0x44f273);_0x1703ce['isWordSplitResult']=!0x0,_0x3e13e2(_0x50f4ee,_0x1703ce),_0x436553['push'](_0x1703ce);}_0x50f4ee['isWordSplitSource']=!0x0,_0x4156ef(_0x50f4ee);}return _0x436553;}}const hr=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function cr(_0x1e4a56){return _0x4a9a90(_0x1e4a56);}function ar(_0x540e7a){return _0x2b987d(_0x540e7a);}function mr(_0x27dfa9){const _0x32a51d=new AbortController();return{'promise':new Promise((_0x223a4b,_0x4678a5)=>{const _0x2acbc4=setTimeout(_0x223a4b,_0x27dfa9);_0x32a51d['signal']['addEventListener']('abort',()=>{clearTimeout(_0x2acbc4),_0x4678a5();});}),'abortController':_0x32a51d};}const Ue=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'];class Sr extends _0x14b3a2{['htmlStreamer'];['children'];['headerView'];['contentView'];constructor(_0x2e6e0e,{part:_0x41c095,areActionsDisabled:_0x35afc1}){super(_0x2e6e0e),this['set']('partDefinition',_0x41c095),this['set']('state','pending'),this['set']('isVisible',!0x1),this['bind']('isEnabled')['to'](this,'state',_0x4d4a04=>'pending'==_0x4d4a04&&!_0x35afc1),this['children']=this['createCollection'](),this['htmlStreamer']=new sa({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['headerView']=new Hn(_0x2e6e0e,_0x41c095),this['headerView']['bind']('partDefinition')['to'](this),this['headerView']['bind']('isEnabled')['to'](this),this['headerView']['bind']('state')['to'](this),this['headerView']['delegate'](...Ue)['to'](this);const _0x53560a=this['bindTemplate'];this['contentView']=new _0x14b3a2(),this['contentView']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__content']}}),this['children']['addMany']([this['contentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x53560a['to']('state',_0x4d36f2=>'ck-ai-suggestion__body__content-part_'+_0x4d36f2),_0x53560a['to']('isEnabled',_0x28c651=>_0x28c651?'ck-ai-suggestion__body__content-part_active':void 0x0),_0x53560a['if']('isVisible','ck-hidden',_0x58af8b=>!_0x58af8b)]},'children':this['children'],'on':{'mouseenter':_0x53560a['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x41c095['index']});}),'mouseleave':_0x53560a['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x41c095['index']});})}});}async['updateContent']({part:_0x36937d,renderingStrategy:_0xc62862,showUnchangedParts:_0x2e9a1b=!0x1,abortSignal:_0x1b8ad6}){this['partDefinition']=_0x36937d,this['isVisible']=this['partDefinition']['hasChanges']||_0x2e9a1b,this['isVisible']&&('streaming'===_0xc62862?await this['htmlStreamer']['stream']({'document':this['partDefinition']['content'],'targetElement':this['contentView']['element'],'abortSignal':_0x1b8ad6}):this['contentView']['element']['innerHTML']=Ct(this['partDefinition']['content']));}['toggleHeader'](_0x2d41c8){_0x2d41c8?this['children']['has'](this['headerView'])||this['children']['add'](this['headerView'],0x0):this['children']['has'](this['headerView'])&&this['children']['remove'](this['headerView']);}}class Hn extends _0x14b3a2{['children'];['_toolbarView'];['_iconStateAccepted'];['_iconStateRejected'];constructor(_0x7dea63,_0xe7c35a){super(_0x7dea63),this['set']('partDefinition',_0xe7c35a),this['set']('isEnabled',!0x0),this['set']('state','pending');const _0x605ffe=new _0x2bd673();_0x605ffe['content']=_0xfe618c,_0x605ffe['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-title']}});const _0x52a0d7=new _0xb98904(_0x7dea63);_0x52a0d7['set']({'label':w(_0x7dea63,'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT'),'tooltip':!0x0,'withText':!0x1,'icon':_0x378783}),_0x52a0d7['bind']('isEnabled')['to'](this),_0x52a0d7['on']('execute',()=>{this['fire']('showChangeInText',{'index':_0xe7c35a['index']});});const _0x1fd0c5=new _0xb98904(_0x7dea63);_0x1fd0c5['set']({'label':w(_0x7dea63,'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION'),'tooltip':!0x0,'withText':!0x1,'icon':_0x236754}),_0x1fd0c5['bind']('isEnabled')['to'](this),_0x1fd0c5['on']('execute',()=>{this['fire']('insertSuggestion',{'index':_0xe7c35a['index']});});const _0x2f2674=new _0xb98904(_0x7dea63);_0x2f2674['set']({'label':w(_0x7dea63,'AI_SUGGESTION_CONTENT_PART_DELETE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x28cc87}),_0x2f2674['on']('execute',()=>{this['fire']('rejectSuggestion',{'index':_0xe7c35a['index']});}),_0x2f2674['bind']('isEnabled')['to'](this),this['_toolbarView']=new _0x5143cf(_0x7dea63),this['_toolbarView']['items']['addMany']([_0x52a0d7,_0x1fd0c5,_0x2f2674]),this['_iconStateAccepted']=new _0x2bd673(),this['_iconStateAccepted']['content']=_0x5a5ebd,this['_iconStateAccepted']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-accepted'],'data-cke-tooltip-text':w(_0x7dea63,'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED'),'data-cke-tooltip-position':'n'}}),this['_iconStateRejected']=new _0x2bd673(),this['_iconStateRejected']['content']=_0x5b2431,this['_iconStateRejected']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-rejected'],'data-cke-tooltip-text':w(_0x7dea63,'AI_SUGGESTION_CONTENT_PART_REJECTED'),'data-cke-tooltip-position':'n'}});const _0x2283dd=new _0x14b3a2(_0x7dea63);_0x2283dd['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[w(_0x7dea63,'AI_SUGGESTION_CONTENT_PART_TITLE',(_0xe7c35a['index']+0x1)['toString']())]}),this['children']=this['createCollection'](),this['children']['addMany']([_0x605ffe,_0x2283dd,this['_toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__title']},'children':this['children']}),this['on']('change:state',(_0xe40b6d,_0x15241a,_0x15e50e,_0x4b7757)=>{switch(_0x4b7757){case'pending':this['children']['remove'](this['_toolbarView']);break;case'accepted':this['children']['remove'](this['_iconStateAccepted']);break;case'rejected':this['children']['remove'](this['_iconStateRejected']);}switch(_0x15e50e){case'pending':this['children']['add'](this['_toolbarView']);break;case'accepted':this['children']['add'](this['_iconStateAccepted']);break;case'rejected':this['children']['add'](this['_iconStateRejected']);}});}}class _ extends _0x106985(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x47585b){const _0x38bcc0=this['createTask'](_0x47585b);return this['queue']['push'](_0x38bcc0),this['_processQueue'](),_0x38bcc0['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(_0xd5fecb=>{this['once']('_queueEmpty',()=>{_0xd5fecb();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0xb12332=this['queue']['shift']();try{await _0xb12332['callback'](this['_abortController']['signal']),_0xb12332['resolve']();}catch(_0x250eeb){_0xb12332['reject'](_0x250eeb);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0xea2334){let _0x5f1fd4,_0x47eaf2;const _0x20c6e7=new Promise((_0xd14cbe,_0x1988c8)=>{_0x5f1fd4=_0xd14cbe,_0x47eaf2=_0x1988c8;});return{'callback':_0xea2334,'resolve':_0x5f1fd4,'reject':_0x47eaf2,'completePromise':_0x20c6e7};}}class Cr extends _0x14b3a2{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x3f22b1){super();const _0x51aee8=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']=_0x3f22b1,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x51aee8['if']('isDone','ck-ai-chat__feed__item_done'),_0x51aee8['if']('isVisible','ck-hidden',_0x273abc=>!_0x273abc),'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'](_0x3ce0ec=>{_0x3ce0ec['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x367997,_0xe5f681,_0x497678){await this['htmlStreamer']['stream']({'document':_0x367997,'targetElement':_0xe5f681,'abortSignal':_0x497678});}}class Ve extends Cr{constructor(_0x453cd4){super(_0x453cd4),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-error','warning'===_0x453cd4['level']?'ck-ai-chat-error_warning':'']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x2da9ee){this['element']['innerHTML']=_0x2da9ee;}}class Rr extends _0x14b3a2{['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];constructor(_0x768554,{areActionsDisabled:_0x4f87d1,showUnchangedParts:_0x3946b3}){super(_0x768554),this['_areActionsDisabled']=_0x4f87d1,this['_showUnchangedParts']=_0x3946b3,this['set']('hasPendingParts',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new _(),this['_emptyPartsWarningView']=new Ve({'id':'empty-parts-warning','initialContent':w(_0x768554,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0xd74e12,renderingStrategy:_0x11c6de,abortSignal:_0x2cce76}){for(const _0x499e2f of _0xd74e12)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x235e8d=>{let _0xcbf4dd=this['_children']['find'](_0x3ddf2b=>_0x3ddf2b['partDefinition']['index']==_0x499e2f['index']);_0xcbf4dd||(_0xcbf4dd=new Sr(this['locale'],{'part':_0x499e2f,'areActionsDisabled':this['_areActionsDisabled']}),_0xcbf4dd['delegate'](...Ue)['to'](this),this['_children']['add'](_0xcbf4dd),this['hasPendingParts']=!0x0),0x2===this['_children']['length']&&this['_children']['first']['toggleHeader'](!0x0),_0xcbf4dd['toggleHeader'](this['_children']['length']>0x1),await _0xcbf4dd['updateContent']({'part':_0x499e2f,'renderingStrategy':_0x11c6de,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x235e8d});});return _0x2cce76?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x10a58c,_0x3a8670){this['_children']['get'](_0x10a58c)['state']=_0x3a8670,this['hasPendingParts']='pending'==_0x3a8670||Array['from'](this['_children'])['some'](_0x48babf=>'pending'==_0x48babf['state']);}['getPartView'](_0x147a14){return this['_children']['get'](_0x147a14);}['markAsDone'](){if(!this['_showUnchangedParts']){const _0xf2457a=!this['_children']['find'](_0x2238ec=>_0x2238ec['partDefinition']['hasChanges']),_0xf93ebc=!!this['_children']['find'](_0x3bb367=>!_0x3bb367['partDefinition']['hasChanges']);this['_emptyPartsWarningView']['isVisible']=_0xf93ebc,_0xf2457a?this['_emptyPartsWarningView']['setContent'](w(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](w(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}}get['hasNonEmptyParts'](){return!!this['_children']['find'](_0x463f6d=>_0x463f6d['partDefinition']['hasChanges']);}}class Fe extends _0x354e98{constructor(_0x329dbf=void 0x0){super();const _0x458acb=_0x329dbf?'ck-ai-spinner_'+_0x329dbf:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x458acb]}});}}class e extends _0x14b3a2{['bodyView'];['miniToolbarView'];['children'];['headerView'];['loaderView'];['errorView'];['sourcesView'];constructor(_0x5a691c,{showDiff:_0x14ece6,areActionsDisabled:_0x1a36f8,miniToolbarConfig:_0x4f8638,hideHeader:_0x415c1a,showLoader:_0x32f2a1,showUnchangedParts:_0x2644ae}){super(_0x5a691c),this['set']('areChangesVisible',!0x1),this['set']('isLoaderVisible',!!_0x32f2a1),this['set']('isErrorVisible',!0x1),this['set']('isLoading',!0x1),this['children']=this['createCollection'](),_0x415c1a||(this['headerView']=new Dr(_0x5a691c,{'showDiff':_0x14ece6}),this['headerView']['on']('toggleShowChanges',(_0x2bae8b,_0x182f8e)=>{this['areChangesVisible']=_0x182f8e['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x182f8e['isOn']});}),this['children']['add'](this['headerView'])),this['bodyView']=new Rr(_0x5a691c,{'areActionsDisabled':_0x1a36f8,'showUnchangedParts':!!_0x2644ae}),this['bodyView']['delegate'](...Ue)['to'](this),this['bodyView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoaderVisible','ck-hidden'),this['bindTemplate']['if']('isErrorVisible','ck-hidden')]}}),this['miniToolbarView']=new Lr(_0x5a691c,_0x4f8638,_0x14ece6),this['miniToolbarView']['delegate'](...Ue)['to'](this),this['miniToolbarView']['on']('toggleShowChanges',(_0x1b00af,_0x1dc03c)=>{this['areChangesVisible']=_0x1dc03c,this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x1dc03c});}),this['miniToolbarView']['bind']('isLoading')['to'](this),this['children']['add'](this['bodyView']),this['children']['add'](this['miniToolbarView']),this['sourcesView']=new _r(this['locale']),this['children']['add'](this['sourcesView']),_0x32f2a1&&(this['loaderView']=this['_createLoaderView'](),this['children']['add'](this['loaderView'])),this['errorView']=this['_createErrorView'](),this['children']['add'](this['errorView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0xa2f738){await this['bodyView']['updateContentParts'](_0xa2f738);}['updateSources'](_0x44ed43){this['sourcesView']['children']['addMany'](_0x44ed43['map'](_0x4f4d16=>new jr(this['locale'],_0x4f4d16))),this['sourcesView']['isVisible']=!0x0;}['showLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x0);}['hideLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x1);}['showError'](_0x1a0a4b){if(this['errorView']){const _0x1414cf=this['errorView']['element']?.['querySelector']('.ck-ai-suggestion__error-text');_0x1414cf&&(_0x1414cf['textContent']=_0x1a0a4b),this['isErrorVisible']=!0x0;}}['hideError'](){this['errorView']&&(this['isErrorVisible']=!0x1);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['setErrorState'](){this['miniToolbarView']&&(this['miniToolbarView']['isLoading']=!0x0),this['headerView']?.['showChangesToggleView']&&(this['headerView']['showChangesToggleView']['isEnabled']=!0x1);}['clearErrorState'](){this['miniToolbarView']&&(this['miniToolbarView']['isLoading']=!0x1),this['headerView']?.['showChangesToggleView']&&(this['headerView']['showChangesToggleView']['isEnabled']=!0x0);}['addNavigationItem'](_0x302470){this['miniToolbarView']['items']['add'](_0x302470);}['removeNavigationItem'](_0x3f8f13){this['miniToolbarView']['items']['remove'](_0x3f8f13);}['_createLoaderView'](){const _0x1abca4=new _0x14b3a2(this['locale']),_0x3afed9=new Fe('small');_0x3afed9['isVisible']=!0x0;const _0x5aee68=new _0x14b3a2(this['locale']);return _0x5aee68['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[w(this['locale'],'AI_CHAT_IS_WRITING')]}),_0x1abca4['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isLoaderVisible','ck-hidden',_0x2bb909=>!_0x2bb909)]},'children':[_0x3afed9,_0x5aee68]}),_0x1abca4;}['_createErrorView'](){const _0x32362d=new _0x14b3a2(this['locale']),_0x824563=new _0x14b3a2(this['locale']);return _0x824563['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[w(this['locale'],'AI_CHAT_GENERIC_ERROR')]}),_0x32362d['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0x5af885=>!_0x5af885)]},'children':[_0x824563]}),_0x32362d;}}class _r extends _0x14b3a2{['children'];constructor(_0x36d66b){super(_0x36d66b),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',_0xd9561d=>!_0xd9561d)]},'children':this['children']});const _0x4d8eac=new _0x14b3a2(this['locale']),_0x576b04=new _0x2bd673();_0x576b04['content']=_0x4cc6ea,_0x4d8eac['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x576b04,{'tag':'span','children':[{'text':w(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x4d8eac);}}class jr extends _0xb98904{constructor(_0x58abed,_0x24c002){super(_0x58abed),this['set']({'label':_0x24c002['title'],'tooltip':_0x24c002['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x210f74=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x210f74['to'](()=>{window['open'](_0x24c002['url'],'_blank');})}}),_0x24c002['favicon']){const _0x2318ad=new _0x14b3a2(_0x58abed);_0x2318ad['setTemplate']({'tag':'img','attributes':{'src':_0x24c002['favicon']||_0x4cc6ea,'alt':_0x24c002['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x2318ad);}else this['set']('icon',_0x4cc6ea);}}class ps extends _0x5143cf{constructor(_0x5a0afd,_0x37aebe=!0x0,_0x187d96=!0x0){super(_0x5a0afd),this['set']('isLoading',!0x1),_0x37aebe&&(this['applyButton']=this['_createButton'](w(_0x5a0afd,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x4b2fd7=>!_0x4b2fd7),this['items']['add'](this['applyButton'])),_0x187d96&&(this['suggestButton']=this['_createButton'](w(_0x5a0afd,'AI_BALLOON_SUGGEST_BUTTON'),_0x37aebe?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this,'isLoading',_0x23303c=>!_0x23303c),this['items']['add'](this['suggestButton'])),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['_createButton'](_0x42910e,_0x1e0f4b){const _0x2f3ad1=new _0xb98904(this['locale']);return _0x2f3ad1['set']({'label':_0x42910e,'class':_0x1e0f4b||'','isVisible':!0x0,'withText':!0x0}),_0x2f3ad1;}}class ws extends _0x14b3a2{constructor(_0x257bd7){super(_0x257bd7),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':w(_0x257bd7,'AI_DISCLAIMER_TEXT')}]}]});}}const ti=['applySuggestion','insertSuggestion','showNext','showPrevious'];class oi extends _0x14b3a2{['focusTracker'];['keystrokes'];['focusCycler'];['_dropdownConfig'];['_focusables'];constructor(_0x3b65d1,_0x4ef6ce,_0x3fddd0,_0x935ee7){super(_0x3b65d1),this['_dropdownConfig']=_0x3fddd0,this['set']('isLoading',!0x1),this['set']('isTrackChangesOn',_0x935ee7),this['focusTracker']=new _0x49e991(),this['keystrokes']=new _0x183f1e(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x3f54b9({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x17ac77(),this['_addContentView'](_0x4ef6ce['mainView']),this['_addDisclaimerView'](),this['_addToolbar'](_0x4ef6ce['showApplyButton'],_0x4ef6ce['showSuggestButton']),this['toolbar']['bind']('isLoading')['to'](this),this['_focusables']['clear'](),this['_focusables']['addMany']([this['toolbar']]),this['setTemplate']({'tag':'div','attributes':{'class':'ai-balloon-content'},'children':this['_dialogContent']}),this['listenTo'](this,'change:isTrackChangesOn',()=>{this['_dialogContent']['remove'](this['toolbar']),this['_addToolbar'](_0x4ef6ce['showApplyButton'],_0x4ef6ce['showSuggestButton']);});}['render'](){super['render']();for(const _0xe3bba2 of this['_focusables'])this['focusTracker']['add'](_0xe3bba2['element']);this['keystrokes']['listenTo'](this['element']);}['focus'](_0x59eff5){-0x1===_0x59eff5?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['setupRotator'](_0x6deca6){const _0x2302ac=this['_createNextButtonView'](),_0x59352f=this['_createPreviousButtonView']();_0x6deca6['view']['headerView']['children']['add'](_0x2302ac,0x2),_0x6deca6['view']['headerView']['children']['add'](_0x59352f,0x0),this['_focusables']['addMany']([_0x2302ac,_0x59352f]),this['focusTracker']['add'](_0x2302ac['element']),this['focusTracker']['add'](_0x59352f['element']);}['_addContentView'](_0x3e8444){this['_mainView']=_0x3e8444,this['_dialogContent']['add'](this['_mainView']);}['_addDisclaimerView'](){this['disclaimerView']=new ws(this['locale']),this['_dialogContent']['add'](this['disclaimerView']);}['_addToolbar'](_0x2a218b=!0x0,_0x1de4c2=!0x0){_0x2a218b=_0x2a218b&&!this['isTrackChangesOn']&&this['_dropdownConfig']['includes']('applySuggestion'),_0x1de4c2=_0x1de4c2&&this['_dropdownConfig']['includes']('insertSuggestion'),this['toolbar']=new ps(this['locale'],_0x2a218b,_0x1de4c2),this['toolbar']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['toolbar']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_dialogContent']['add'](this['toolbar']);}['_createNextButtonView'](){const _0x3fd5a1=new _0xb98904(this['locale']);return _0x3fd5a1['set']({'icon':_0x806106,'tooltip':w(this['locale'],'AI_BALLOON_NEXT_TOOLTIP')}),_0x3fd5a1['on']('execute',()=>{this['fire']('showNext');}),_0x3fd5a1;}['_createPreviousButtonView'](){const _0x26d1fa=new _0xb98904(this['locale']);return _0x26d1fa['set']({'icon':_0x5d3e17,'tooltip':w(this['locale'],'AI_BALLOON_PREVIOUS_TOOLTIP')}),_0x26d1fa['on']('execute',()=>{this['fire']('showPrevious');}),_0x26d1fa;}}const ei=['applySuggestion','insertSuggestion','showChangeInText'];class th extends _0x14b3a2{['actionsButton'];['children'];['applySuggestionModel'];['showChangeInTextModel'];['insertSuggestionModel'];['_partsCount']=0x1;['_dropdownOriginalConfig'];['_dropdownCurrentConfig'];constructor(_0x591fe2,_0x21c783){super(_0x591fe2),this['_dropdownOriginalConfig']=_0x21c783||[...ei],this['_dropdownCurrentConfig']=[...this['_dropdownOriginalConfig']];const _0x2d385d=this['bindTemplate'];this['set']('isEnabled',!0x0),this['set']('isVisible',!0x0),this['applySuggestionModel']=new _0x2819cc({'label':An('applySuggestion',_0x591fe2,this['_partsCount']),'icon':_0x5c7e48,'withText':!0x0,'type':'button','actionName':'applySuggestion'}),this['showChangeInTextModel']=new _0x2819cc({'label':An('showChangeInText',_0x591fe2,this['_partsCount']),'icon':_0x378783,'withText':!0x0,'type':'button','actionName':'showChangeInText'}),this['insertSuggestionModel']=new _0x2819cc({'label':An('insertSuggestion',_0x591fe2,this['_partsCount']),'icon':_0x236754,'withText':!0x0,'type':'button','actionName':'insertSuggestion'}),this['actionsButton']=this['_createActionsDropdownOrButton'](_0x591fe2),this['children']=this['createCollection']([this['actionsButton']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x2d385d['if']('isVisible','ck-hidden',_0x392ff4=>!_0x392ff4)]},'children':this['children']}),this['listenTo'](this,'change:isTrackChangesOn',()=>{this['_dropdownCurrentConfig']=this['isTrackChangesOn']?this['_dropdownOriginalConfig']['filter'](_0x15180c=>'applySuggestion'!==_0x15180c):[...this['_dropdownOriginalConfig']],this['_updateDropdownActions'](_0x591fe2);});}['_updateDropdownActions'](_0x1d8ddf){this['children']['has'](this['actionsButton'])&&(this['children']['remove'](this['actionsButton']),this['actionsButton']['destroy']()),0x0!=this['_dropdownCurrentConfig']['length']&&(this['actionsButton']=this['_createActionsDropdownOrButton'](_0x1d8ddf),this['children']['add'](this['actionsButton']));}['_createActionsDropdownOrButton'](_0x5c2233){const _0x5ad8e0=0x1===this['_dropdownCurrentConfig']['length']?this['_createActionsButton'](_0x5c2233):this['_createActionsDropdown'](_0x5c2233);_0x5ad8e0['set']({'label':An(this['_dropdownCurrentConfig'][0x0],_0x5c2233,this['_partsCount']),'tooltip':Cn(this['_dropdownCurrentConfig'][0x0],_0x5c2233,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions'});for(const _0x44c09a of this['_dropdownCurrentConfig'])_0x5ad8e0['on'](_0x44c09a,()=>{this['fire'](_0x44c09a);});return _0x5ad8e0;}['_createActionsButton'](_0x55b615){const _0x34e00f=new _0xb98904(_0x55b615);return _0x34e00f['set']({'class':'ck-ai-button-primary','withText':!0x0}),_0x34e00f['on']('execute',()=>{_0x34e00f['fire'](this['_dropdownCurrentConfig'][0x0]);}),_0x34e00f;}['_createActionsDropdown'](_0x415e44){const _0x1ad05c=new In(_0x415e44,{'listItemModels':this['_dropdownCurrentConfig']['map'](_0x43cb76=>{switch(_0x43cb76){case'applySuggestion':return this['applySuggestionModel'];case'showChangeInText':return this['showChangeInTextModel'];case'insertSuggestion':return this['insertSuggestionModel'];}})});return _0x1ad05c['set']({'label':An(this['_dropdownCurrentConfig'][0x0],_0x415e44,this['_partsCount']),'tooltip':Cn(this['_dropdownCurrentConfig'][0x0],_0x415e44,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions','balloonPanelClass':'ck-ai-chat__feed__ai-suggestion__actions__balloon'}),_0x1ad05c['bind']('isEnabled')['to'](this),_0x1ad05c;}['updateLabels'](_0x8c3058){const _0x223b81=this['locale'];this['_partsCount']=_0x8c3058||this['_partsCount'],this['actionsButton']['set']({'label':An(this['_dropdownCurrentConfig'][0x0],_0x223b81,this['_partsCount']),'tooltip':Cn(this['_dropdownCurrentConfig'][0x0],_0x223b81,this['_partsCount'])}),this['applySuggestionModel']['label']=An('applySuggestion',_0x223b81,this['_partsCount']),this['showChangeInTextModel']['label']=An('showChangeInText',_0x223b81,this['_partsCount']),this['insertSuggestionModel']['label']=An('insertSuggestion',_0x223b81,this['_partsCount']);}}class In extends _0x48cde8{['bodyCollection'];['balloonPanelView'];['listView'];['keystrokeHandler'];constructor(_0x1f0fad,_0x466398){super(_0x1f0fad),this['balloonPanelView']=new _0x1b1d73(this['locale']),this['bodyCollection']=new Wt(this['locale']),this['bodyCollection']['attachToDom'](),this['set']('balloonPanelClass',''),this['balloonPanelView']['bind']('class')['to'](this,'balloonPanelClass'),this['listView']=this['_setUpList'](_0x466398['listItemModels']['slice'](0x1)),this['bodyCollection']['add'](this['balloonPanelView']),this['balloonPanelView']['content']['add'](this['listView']),this['arrowView']['unbind']('tooltip'),this['arrowView']['set']('tooltip',w(this['locale'],'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP')),this['_setUpKeystrokes'](),this['on']('execute',()=>{const _0x1c3720=_0x466398['listItemModels'][0x0]['actionName'];this['fire'](_0x1c3720),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']?Sn:wn]}),this['listView']['focus']());}),_0x33b86b({'emitter':this['balloonPanelView'],'callback':()=>{this['balloonPanelView']['hide']();},'activator':()=>this['balloonPanelView']['isVisible'],'contextElements':()=>[this['element'],this['balloonPanelView']['element']]});}['_setUpList'](_0x446c93){const _0x7f6844=this['locale'],_0x490152=new _0x5d5211(_0x7f6844);for(const _0x5da3cb of _0x446c93){const _0x1cf6a2=new _0x17d3e0(_0x7f6844),_0x2c5b3f=new _0x338d49(_0x7f6844);_0x2c5b3f['bind'](...Object['keys'](_0x5da3cb))['to'](_0x5da3cb),_0x2c5b3f['delegate']('execute')['to'](_0x490152),_0x1cf6a2['children']['add'](_0x2c5b3f),_0x490152['items']['add'](_0x1cf6a2);}return _0x490152['items']['delegate']('execute')['to'](this),_0x490152['on']('execute',_0x981c23=>{const _0x535588=_0x981c23['source'];this['fire'](_0x535588['actionName']),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),_0x490152;}['_setUpKeystrokes'](){this['keystrokeHandler']=new _0x183f1e(),this['keystrokeHandler']['listenTo'](this['balloonPanelView']['element']),this['keystrokeHandler']['set']('esc',(_0xda3a7d,_0x313952)=>{this['balloonPanelView']['hide'](),this['arrowView']['focus'](),_0x313952();});}['destroy'](){super['destroy'](),this['keystrokeHandler']['destroy'](),this['balloonPanelView']['destroy'](),this['bodyCollection']['detachFromDom']();}}function Sn(_0x30f799){return{'top':_0x30f799['bottom'],'left':_0x30f799['left'],'name':'arrowless','config':{'withArrow':!0x1}};}function wn(_0x5857ab,_0x1c663c){return{'top':_0x5857ab['bottom'],'left':_0x5857ab['left']-(_0x1c663c['width']-_0x5857ab['width']),'name':'arrowless','config':{'withArrow':!0x1}};}function An(_0x379e56,_0x56d138,_0x25fb6b){switch(_0x379e56){case'applySuggestion':return w(_0x56d138,'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL',_0x25fb6b);case'showChangeInText':return w(_0x56d138,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT',_0x25fb6b);case'insertSuggestion':return w(_0x56d138,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION',_0x25fb6b);}}function Cn(_0x288d33,_0x1db8f3,_0x2dad44){switch(_0x288d33){case'applySuggestion':return w(_0x1db8f3,'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP',_0x2dad44);case'showChangeInText':return w(_0x1db8f3,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP',_0x2dad44);case'insertSuggestion':return w(_0x1db8f3,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP',_0x2dad44);}}class f extends tt{static get['requires'](){return[s,h];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_config'];['open'](_0x1d8172){const _0x5f0272=lt(this['context']);this['_config']=_0x1d8172;const _0x10ba4a=this['context']['config']['get']('ai.availableReplyActions')||[...ei],_0x1b3199=_0x5f0272?.['commands']['get']('trackChanges'),_0x4ac58d=_0x1b3199?.['value'];this['balloonView']=new oi(_0x5f0272['locale'],_0x1d8172,_0x10ba4a,!!_0x4ac58d),this['balloonView']['delegate'](...ti)['to'](this),_0x1b3199&&this['balloonView']['bind']('isTrackChangesOn')['to'](_0x1b3199,'value'),this['_showDialog'](_0x1d8172);}['close'](){lt(this['context'])['plugins']['get']('Dialog')['hide']();}['_setupVisualSelection'](_0x5f08b7,_0x5dd91a){this['context']['plugins']['get'](h)['showFakeVisualSelection'](_0x5f08b7,'ai-balloon-'+_0x5dd91a,!0x0,!0x0);}['_showDialog'](_0x45397d){const _0x1a331f=lt(this['context']);this['_setupVisualSelection'](_0x45397d['ranges'],_0x45397d['index']),_0x1a331f['plugins']['get']('Dialog')['show']({'title':_0x45397d['title'],'icon':_0x45397d['icon'],'hasCloseButton':!0x0,'id':'aiBalloon','position':this['_calculateDialogPosition']['bind'](this),'className':'ai-balloon'+(_0x45397d['showRotator']?'\x20ai-balloon-rotator':''),'content':this['balloonView'],'onShow':_0x5a65ee=>{_0x45397d['showRotator']&&this['balloonView']['setupRotator'](_0x5a65ee),this['isOpen']=!0x0;},'onHide':()=>{this['context']['plugins']['get']('AIEditing')['hideFakeVisualSelection']('ai-balloon-'+_0x45397d['index']),this['fire']('dialogClosed'),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x2d6e75,_0x3d199f){const _0x13ab31=lt(this['context']);if(!_0x3d199f)return null;const _0x51ef27=_0x4afa50(_0x13ab31['editing'],[..._0x13ab31['model']['markers']['getMarkersGroup']('ai-selection'),..._0x13ab31['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);if(!_0x51ef27||0x0===_0x51ef27['length'])return{'left':Math['round'](_0x3d199f['left']+_0x3d199f['width']/0x2-_0x2d6e75['width']/0x2),'top':Math['round'](_0x3d199f['top']+_0x3d199f['height']/0x2-_0x2d6e75['height']/0x2)};const _0x260389=Math['round'](_0x3d199f['left']+_0x3d199f['width']/0x2-_0x2d6e75['width']/0x2),_0x3a7497=_0x51ef27[0x0]['getBoundingClientRect'](),_0x2a072d=_0x51ef27[_0x51ef27['length']-0x1]['getBoundingClientRect'](),_0x40e242=_0x2d6e75['height'],_0x37ef67=this['_config']['showRotator']?0x8:0x0;return{'left':_0x260389,'top':this['_calculateOptimalTopPosition'](_0x3a7497,_0x2a072d,_0x40e242,_0x37ef67)};}['_calculateOptimalTopPosition'](_0x48cc6b,_0x4f72ee,_0x330975,_0x374cfc=0x0){const _0x35d0f9=_0x4f72ee['top']+_0x4f72ee['height'],_0x221336=_0x48cc6b['top']-_0x330975-_0x374cfc,_0x7765df=window['innerHeight']-_0x35d0f9-0xa,_0x5e0032=_0x48cc6b['top']-_0x374cfc-0xa;let _0x2427cb;if(_0x7765df>=_0x330975)_0x2427cb=_0x35d0f9+0xa;else{if(_0x5e0032>=_0x330975)_0x2427cb=_0x221336-0xa;else _0x2427cb=_0x48cc6b['top']+(_0x4f72ee['top']+_0x4f72ee['height'])/0x2-(_0x330975+_0x374cfc)/0x2;}return _0x2427cb;}}class et extends tt{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_batchToChanges']=new Map();['_previewedChangeGroup']=null;['_balloonShowDiff']=!0x1;static get['requires'](){return[s,f,_0x436d15];}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 _0x138cfe=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x25616b,_0xf46648)=>{this['_handleUIUserMessage']({'userMessage':_0xf46648});}),this['listenTo'](_0x138cfe,'resizedTabs',(_0x5d3967,_0x1e8b04)=>{this['_setIsMaximized'](_0x1e8b04);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x138cfe['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['activeConversation']?.['addCurrentDocumentToContext'](w(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x5f02f3,_0x59db28)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x59db28));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x348e94,_0x33fac6)=>{this['activeConversation']?.['addUrlToContext'](_0x33fac6);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x11f224,_0x341152)=>{this['activeConversation']?.['addResourceToContext'](_0x341152['source'],_0x341152['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x4ecfdf,_0x56a2da)=>{this['_removeFromContext'](_0x56a2da);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x1ae98b,_0x4363b6)=>{this['activeConversation']?.['loadSourceResources'](_0x4363b6['sourceId'],_0x4363b6['query'],_0x4363b6['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x5a829e,_0x336419)=>{this['activeConversation']?.['setModel'](_0x336419);}),this['listenTo'](this['_aiChatUi'],'like',(_0x421be0,{replyId:_0x4d461d})=>{console['log']('Liked\x20response',_0x4d461d);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x173a15,{replyId:_0x325ed7})=>{console['log']('Disliked\x20response',_0x325ed7);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x54b2f7,_0x33a7cf)=>{this['context']['plugins']['get'](f)['close'](),this['_insertSuggestion'](_0x33a7cf);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x58f09b,{replyId:_0x541339,partIndex:_0xb04d9f})=>{this['_balloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x541339,_0xb04d9f);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x6ee29,{replyId:_0x5a8983,partIndex:_0x30ce03})=>{const _0x478d8a=this['_getDocumentRangeForReplyChanges'](_0x5a8983,_0x30ce03);_0x478d8a&&'$graveyard'!=_0x478d8a['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x478d8a['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x259f07,_0x5d006f)=>{this['context']['plugins']['get'](f)['close'](),this['_applySuggestion'](_0x5d006f);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x3e5694,_0x2802a4)=>{const {reply:_0x3e1995}=this['getInteractionAndReplyById'](_0x2802a4['replyId']),_0x4d2a95=y({'editor':lt(this['context']),'changeGroups':_0x3e1995['changeGroups'],'documentContextContent':_0x3e1995['documentContextContent'],'showDiff':_0x2802a4['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x3e1995['id'],'parts':_0x4d2a95,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x2eaeaf,{replyId:_0x32b326,partIndex:_0x39d2db})=>{this['_previewedChangeGroup']?.['replyId']==_0x32b326&&this['_previewedChangeGroup']?.['partIndex']==_0x39d2db&&this['context']['plugins']['get'](f)['close']();const {reply:_0x5d7f7f}=this['getInteractionAndReplyById'](_0x32b326);_0x5d7f7f['setChangeGroupState'](_0x39d2db,'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',(_0x176687,_0x2c58b4)=>{_0x2c58b4['on']('ready',()=>{this['_integrateEditor'](_0x2c58b4);});}),await this['_startConversationSafely']();}['_insertSuggestion'](_0x1f2927){const _0x49f2f1=lt(this['context']);if(!_0x49f2f1['plugins']['has']('TrackChangesEditing'))return;const _0x1fcb8d=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x3b189b,interaction:_0x10778c}=this['getInteractionAndReplyById'](_0x1f2927['replyId']),_0x5b69b9=this['_getDocumentRangeForReplyChanges'](_0x1f2927['replyId'],_0x1f2927['partIndex']),_0x1736f2=void 0x0!==_0x1f2927['partIndex']?[_0x3b189b['changeGroups'][_0x1f2927['partIndex']]]:_0x3b189b['changeGroups']['filter'](_0x8113a0=>'pending'==_0x8113a0['state']),_0x572a0b=_0x1736f2['map'](_0x48def7=>_0x3b189b['changeGroups']['indexOf'](_0x48def7));_0x572a0b['forEach'](_0x895b80=>_0x3b189b['setChangeGroupState'](_0x895b80,'accepted'));const _0x2628b0=I({'editor':_0x49f2f1,'reply':_0x3b189b,'interaction':_0x10778c,'groups':_0x1736f2,'transform':!0x0,'documentCompare':_0x1fcb8d,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x225a79;_0x5b69b9&&this['_scrollToSuggestionRange'](_0x5b69b9['range']),_0x49f2f1['model']['change'](_0x3d9ccb=>{_0x225a79=_0x3d9ccb['batch'],_0x49f2f1['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x2628b0),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x225a79,{'interactionId':_0x10778c['id'],'replyId':_0x3b189b['id'],'indexes':_0x572a0b['slice']()}),this['_updateRatings'](_0x3b189b);}['_applySuggestion'](_0x270519){const _0x4ef40a=lt(this['context']),_0x12bd21=this['context']['plugins']['get'](_0x436d15),{reply:_0x316ad7,interaction:_0x3746bf}=this['getInteractionAndReplyById'](_0x270519['replyId']),_0x345f7f=this['_getDocumentRangeForReplyChanges'](_0x270519['replyId'],_0x270519['partIndex']),_0xf43595=void 0x0!==_0x270519['partIndex']?[_0x316ad7['changeGroups'][_0x270519['partIndex']]]:_0x316ad7['changeGroups']['filter'](_0x4c2d18=>'pending'==_0x4c2d18['state']),_0x5bbbaf=_0xf43595['map'](_0xcc4b85=>_0x316ad7['changeGroups']['indexOf'](_0xcc4b85));_0x5bbbaf['forEach'](_0x2ac865=>_0x316ad7['setChangeGroupState'](_0x2ac865,'accepted'));const _0x4bd1e9=I({'editor':_0x4ef40a,'reply':_0x316ad7,'interaction':_0x3746bf,'groups':_0xf43595,'transform':!0x0,'documentCompare':_0x12bd21,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x5a44fd;_0x345f7f&&this['_scrollToSuggestionRange'](_0x345f7f['range']),_0x4ef40a['model']['change'](_0x308600=>{_0x5a44fd=_0x308600['batch'];for(const _0x3cdeab of _0x4bd1e9)_0x3cdeab['baseVersion']=_0x4ef40a['model']['document']['version'],_0x308600['batch']['addOperation'](_0x3cdeab),_0x4ef40a['model']['applyOperation'](_0x3cdeab);}),this['_batchToChanges']['set'](_0x5a44fd,{'interactionId':_0x3746bf['id'],'replyId':_0x316ad7['id'],'indexes':_0x5bbbaf['slice']()}),this['_updateRatings'](_0x316ad7);}['_openBalloonFor'](_0x3926fd,_0x1631d1){const _0x2877d4=lt(this['context']),_0x1a71b1=this['_getDocumentRangeForReplyChanges'](_0x3926fd,_0x1631d1),_0x42cf0a=this['context']['plugins']['get'](f);if(!_0x1a71b1)return void _0x42cf0a['close']();const {range:_0x14df0e,currentIndex:_0x1da9ab,previousIndex:_0x1b50d3,nextIndex:_0x1e69c9}=_0x1a71b1;if(this['_previewedChangeGroup']?.['replyId']==_0x3926fd&&this['_previewedChangeGroup']?.['partIndex']==_0x1da9ab)return;this['_previewedChangeGroup']={'replyId':_0x3926fd,'partIndex':_0x1da9ab};const _0x1661f9=new e(_0x2877d4['locale'],{'showDiff':this['_balloonShowDiff'],'areActionsDisabled':!0x1,'miniToolbarConfig':{'showChanges':'full'},'hideHeader':!0x0}),{reply:_0x10802e}=this['getInteractionAndReplyById'](_0x3926fd),_0x57683d=y({'editor':_0x2877d4,'changeGroups':[_0x10802e['changeGroups'][_0x1da9ab]],'documentContextContent':_0x10802e['documentContextContent'],'showDiff':this['_balloonShowDiff']});_0x1661f9['updateContent']({'parts':_0x57683d,'renderingStrategy':'static'});const _0x29426c=_0x1da9ab!==_0x1b50d3;this['_scrollToSuggestionRange'](_0x14df0e,!0x0),_0x42cf0a['open']({'index':_0x1da9ab,'title':w(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x1da9ab+0x1)['toString']()),'icon':yt,'mainView':_0x1661f9,'showRotator':_0x29426c,'showApplyButton':!0x0,'showSuggestButton':!0x0,'ranges':[_0x14df0e]}),this['_aiChatUi']['scrollFeedToSuggestion'](_0x3926fd,_0x1da9ab),this['listenTo'](_0x1661f9,'toggleSuggestionDisplayMode',(_0x209423,{showDiff:_0xecb9ba})=>{this['_balloonShowDiff']=_0xecb9ba;const {reply:_0x2b2a9c}=this['getInteractionAndReplyById'](_0x3926fd),_0x4ae7fb=y({'editor':_0x2877d4,'changeGroups':[_0x2b2a9c['changeGroups'][_0x1da9ab]],'documentContextContent':_0x2b2a9c['documentContextContent'],'showDiff':_0xecb9ba});_0x1661f9['updateContent']({'parts':_0x4ae7fb,'renderingStrategy':'static'});}),this['listenTo'](_0x42cf0a,'applySuggestion',()=>{this['_applySuggestion']({'replyId':_0x3926fd,'partIndex':_0x1da9ab}),_0x29426c?this['_openBalloonFor'](_0x3926fd,_0x1e69c9):_0x42cf0a['close']();}),this['listenTo'](_0x42cf0a,'insertSuggestion',()=>{this['_insertSuggestion']({'replyId':_0x3926fd,'partIndex':_0x1da9ab}),_0x29426c?this['_openBalloonFor'](_0x3926fd,_0x1e69c9):_0x42cf0a['close']();}),_0x29426c&&(this['listenTo'](_0x42cf0a,'showNext',()=>{this['_openBalloonFor'](_0x3926fd,_0x1e69c9);}),this['listenTo'](_0x42cf0a,'showPrevious',()=>{this['_openBalloonFor'](_0x3926fd,_0x1b50d3);})),this['listenTo'](_0x42cf0a,'dialogClosed',()=>{this['stopListening'](_0x42cf0a),this['stopListening'](_0x1661f9),this['_previewedChangeGroup']=null;});}['_getDocumentRangeForReplyChanges'](_0x559955,_0x3b924f){const _0x2a6530=lt(this['context']),{reply:_0x197bf5,interaction:_0x3ed703}=this['getInteractionAndReplyById'](_0x559955),_0x158fb1=_0x197bf5['changeGroups']['filter'](_0x3e88b1=>'pending'==_0x3e88b1['state']),_0xcaace8=_0x158fb1['map'](_0x1cce71=>_0x197bf5['changeGroups']['indexOf'](_0x1cce71));void 0x0===_0x3b924f&&(_0x3b924f=_0xcaace8[0x0]);const _0x4ba44d=_0xcaace8['indexOf'](_0x3b924f);if(-0x1==_0x4ba44d)return null;const _0xa5d96=0x0==_0x4ba44d?_0xcaace8[_0xcaace8['length']-0x1]:_0xcaace8[_0x4ba44d-0x1],_0x4535a3=_0x4ba44d==_0xcaace8['length']-0x1?_0xcaace8[0x0]:_0xcaace8[_0x4ba44d+0x1],_0x8a97a9=_0x158fb1[_0x4ba44d],_0x2449be=new _t([]),_0x1b4a8d=new _t([]);for(const _0x4c48c6 of _0x8a97a9['changes'])if('removed'!=_0x4c48c6['type']&&_0x1b4a8d['children']['push'](_0x4c48c6['node']['cloneNode'](!0x0)),'new'!=_0x4c48c6['type']){const _0x5e82a8=mt(_0x2d817c=>ft(_0x2d817c,'data-id')==_0x4c48c6['id'],_0x197bf5['documentContextContent'],!0x0);_0x2449be['children']['push'](_0x5e82a8['cloneNode'](!0x0));}if(0x0==_0x2449be['children']['length']){if(_0x8a97a9['changes'][0x0]['anchorId']){const _0x59c347=It('data-id',_0x8a97a9['changes'][0x0]['anchorId'],_0x197bf5['documentContextContent']);_0x2449be['children']['unshift'](_0x59c347['cloneNode'](!0x0)),_0x1b4a8d['children']['unshift'](_0x59c347['cloneNode'](!0x0)),_0x59c347['nextSibling']&&(_0x2449be['children']['push'](_0x59c347['nextSibling']['cloneNode'](!0x0)),_0x1b4a8d['children']['push'](_0x59c347['nextSibling']['cloneNode'](!0x0)));}else{const _0x340dfc=_0x197bf5['documentContextContent']['children'][0x0];if(!_0x340dfc)return null;_0x2449be['children']['push'](_0x340dfc['cloneNode'](!0x0)),_0x1b4a8d['children']['push'](_0x340dfc['cloneNode'](!0x0));}}const _0xa6aa82=_0x3ed703['getDocumentContext'](),_0x3b9d3e=_0x2a6530['data']['parse'](_0xa6aa82['content']),_0x435c5f=Ct(_0x2449be),_0x23d93f=_0x2a6530['data']['parse'](_0x435c5f),_0x117ea1=_0x2a6530['data']['parse'](_0x435c5f),_0x487a16=_0x2a6530['model']['createPositionAt'](_0x23d93f,0x0),_0x6edba0=Ct(_0x1b4a8d),_0xf8f05={'anchor':_0x487a16,'markDeletions':!0x1},_0x2d4f13=_0x2a6530['plugins']['get'](_0x436d15)['getDiff'](_0x435c5f,_0x6edba0,_0xf8f05)['getOperations']();if(!_0x2d4f13['length'])return null;_0x2a6530['model']['change'](_0x835cb5=>{for(const _0x591583 of _0x2d4f13)if('remove'==_0x591583['type']){const _0x8d0a65=_0x591583['sourcePosition'],_0x227cc1=_0x591583['howMany'],_0x2e7fba=new _0x289d3b(_0x8d0a65,_0x227cc1);_0x835cb5['batch']['addOperation'](_0x2e7fba),_0x2a6530['model']['applyOperation'](_0x2e7fba);}else _0x591583['baseVersion']=null,_0x591583['isDocumentOperation']=!0x1,_0x835cb5['batch']['addOperation'](_0x591583),_0x2a6530['model']['applyOperation'](_0x591583);});const _0x54b55e=ut(_0x2a6530,_0x2d4f13,_0x23d93f);pt(_0x2a6530['model'],_0x54b55e);const _0x9d9e5d=_0x54b55e['getFirstRange']()['start']['path']['slice'](),_0x37e4b5=_0x54b55e['getFirstRange']()['end']['path']['slice'](),_0x4ff426=[];let _0xbfcdb4=_0x23d93f,_0x2b1c61=_0x117ea1;for(let _0x1e9627=0x0;_0x1e9627<_0x37e4b5['length'];_0x1e9627++){const _0x2ce65f=_0xbfcdb4['maxOffset']-_0x37e4b5[_0x1e9627];_0x4ff426[_0x1e9627]=_0x2b1c61['maxOffset']-_0x2ce65f,_0xbfcdb4=_0xbfcdb4['getChildAtOffset'](_0x37e4b5[_0x1e9627]),_0x2b1c61=_0x2b1c61['getChildAtOffset'](_0x4ff426[_0x1e9627]);}const _0x46e403=_0x2a6530['model']['createRange'](_0x2a6530['model']['createPositionFromPath'](_0x117ea1,_0x9d9e5d),_0x2a6530['model']['createPositionFromPath'](_0x117ea1,_0x4ff426)),_0x25ae14=_0x117ea1['getChild'](0x0)['getAttribute'](gt),_0x718429=Array['from'](_0x3b9d3e['getChildren']())['find'](_0x324c18=>_0x324c18['getAttribute'](gt)==_0x25ae14)['getPath'](),_0x45b8e7=_0x46e403['start']['path']['slice'](),_0x59a97b=_0x46e403['end']['path']['slice']();_0x45b8e7[0x0]=_0x718429[0x0]+_0x45b8e7[0x0],_0x59a97b[0x0]=_0x718429[0x0]+_0x59a97b[0x0];let _0x3e2316=_0x2a6530['model']['createRange'](_0x2a6530['model']['createPositionFromPath'](_0x2a6530['model']['document']['getRoot'](),_0x45b8e7),_0x2a6530['model']['createPositionFromPath'](_0x2a6530['model']['document']['getRoot'](),_0x59a97b));const _0x28346e=_0x2a6530['model']['document']['history']['getOperations'](_0xa6aa82['version']);for(const _0x355f92 of _0x28346e)_0x3e2316=_0x154493['_createFromRanges'](_0x3e2316['getTransformedByOperation'](_0x355f92));return{'range':_0x3e2316,'previousIndex':_0xa5d96,'nextIndex':_0x4535a3,'currentIndex':_0x3b924f};}['_integrateEditor'](_0x31acfe){if(!_0x31acfe['plugins']['has']('Undo'))return;const _0x53bca2=_0x31acfe['commands']['get']('undo'),_0x4579b2=_0x31acfe['commands']['get']('redo');this['listenTo'](_0x53bca2,'revert',(_0x19be1b,_0x105c3d,_0x1c9b4f)=>{const _0x4553a2=this['_batchToChanges']['get'](_0x105c3d);if(!_0x4553a2)return;const _0x33beec=this['activeConversation']['getInteraction'](_0x4553a2['interactionId'])['getReply'](_0x4553a2['replyId']);_0x4553a2['indexes']['forEach'](_0x2cbb83=>_0x33beec['setChangeGroupState'](_0x2cbb83,'pending')),this['_batchToChanges']['delete'](_0x105c3d),this['_batchToChanges']['set'](_0x1c9b4f,_0x4553a2);}),this['listenTo'](_0x4579b2,'revert',(_0x278b09,_0x2c175a,_0x3918fb)=>{const _0x5509d5=this['_batchToChanges']['get'](_0x2c175a);if(!_0x5509d5)return;const _0x1703ac=this['activeConversation']['getInteraction'](_0x5509d5['interactionId'])['getReply'](_0x5509d5['replyId']);_0x5509d5['indexes']['forEach'](_0x2bfddc=>_0x1703ac['setChangeGroupState'](_0x2bfddc,'accepted')),this['_batchToChanges']['delete'](_0x2c175a),this['_batchToChanges']['set'](_0x3918fb,_0x5509d5);});}async['loadConversation'](_0x137cb9){this['context']['plugins']['get'](f)['close'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']();try{const _0x258611=this['context']['plugins']['get'](rt);this['updateConversationTitle']('\x20'),_0x258611['view']['activateTab']('chat'),await this['_startConversationSafely'](_0x137cb9);const {sessionId:_0x26e203}=this['_aiEditing']['getDocumentData']();await this['activeConversation']['load'](_0x137cb9,_0x26e203),this['activeConversation']['isCurrentDocumentInConversation']()&&this['activeConversation']['addCurrentDocumentToContext'](w(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}catch(_0x27e260){console['error']('Failed\x20to\x20load\x20conversation',_0x27e260);}finally{this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['handleRemovedConversation'](_0x469a78){this['activeConversation']['id']===_0x469a78&&this['_startConversationSafely']();}async['addSelectionToChatContext'](){const _0x28e769=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x28e769),this['activeConversation']?.['addCurrentDocumentToContext'](w(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x5e65e5,quickActionData:_0x7fecf7}){await this['_handleUIUserMessage']({'userMessage':_0x5e65e5,'quickActionData':_0x7fecf7});}['getGroupId'](){const _0x47112b=this['context']['config']['get']('collaboration.channelId');if(!_0x47112b)throw new _0x5e86d1('ai-chat-missing-channel-id',this);return _0x47112b;}async['_startConversationSafely'](_0x3bbdcf){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x3bbdcf);}catch(_0x34787b){ot('ai-chat-conversation-start-failed',_0x34787b),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x4d6fd0){const _0x275701=this['context']['plugins']['get'](f);let _0x360a97;_0x275701['isOpen']&&_0x275701['close'](),_0x360a97=_0x4d6fd0||!this['activeConversation']?this['context']['config']['get']('ai.chat.models.defaultModelId'):this['activeConversation']['selectedModel']['id'],await this['_stopLastInteraction']();const _0x270d79=this['getGroupId'](),_0x135d3f=_0x4d6fd0||_0x10e5dc();this['activeConversation']=new ht({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'defaultModelId':_0x360a97,'conversationId':_0x135d3f,'group':_0x270d79,'getEditor':()=>lt(this['context'])}),this['activeConversation']['on']('conversationInitialized',(_0x42e048,_0x460a0a)=>{_0x460a0a['availableModels']=this['_filterModels'](_0x460a0a['availableModels'],this['context']['config']['get']('ai.chat.models.displayedModels')),this['_aiChatUi']['createConversation'](_0x460a0a),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x4d6fd0||(this['_aiChatUi']['resetConversationTitle'](),this['activeConversation']?.['addCurrentDocumentToContext'](w(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT')));}),this['activeConversation']['on']('uploadProgressChanged',(_0x1ff30e,_0x568f2b)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x568f2b['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x4f5810,_0x257e85)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x257e85);}),this['activeConversation']['on']('webSearchStarted',()=>{this['_aiChatUi']['setLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningStarted',()=>{this['_aiChatUi']['setLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('webSearchFinished',(_0x777249,_0x4a1641)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x4a1641,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x153923,_0x19ff70)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x19ff70,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x3bb6c9,_0x2e3cbc)=>{this['_aiChatUi']['removeFeedInteraction'](_0x2e3cbc['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x11989d,_0x29efd5,_0x583a2f)=>{this['updateConversationTitle'](_0x29efd5,_0x583a2f);}),this['activeConversation']['on']('replyCreated',(_0x3ba771,_0x3e86ef)=>{'text-delta'===_0x3e86ef['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x3e86ef):this['_aiChatUi']['addFeedItemAISuggestion'](_0x3e86ef);}),this['activeConversation']['on']('replyContentUpdated',async(_0x20f6b9,_0x3c0e47,_0x98148f)=>{await this['_updateReplyContent']({'reply':_0x3c0e47,'changeGroups':_0x98148f});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x1b3bd3,{reply:_0x4c5598,index:_0x4cc32d,state:_0x5b45b4})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x4c5598['id'],'index':_0x4cc32d,'state':_0x5b45b4});}),this['activeConversation']['on']('contextItemAdded',(_0x21bce0,_0x5f4523)=>{if(this['_aiChatUi']['addContextItem'](_0x5f4523['contextItem'],_0x5f4523['isLoading']),'selection'===_0x5f4523['contextItem']['type']){const _0x3ae2bf=[...lt(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x3ae2bf,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0xf4975f,_0x27c552)=>{this['_aiChatUi']['removeContextItem'](_0x27c552['uiId']),'current-document'==_0x27c552['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x27c552['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x11a27d,_0x11bf11)=>{this['_aiChatUi']['setContextItemLoading'](_0x11bf11['contextItem']['uiId'],_0x11bf11['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x3ad9b7,_0x4ee802)=>{this['_aiChatUi']['setConversationContext'](_0x4ee802['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x3badde,_0x398312)=>{this['_aiChatUi']['setAddContextOptions'](_0x398312['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x19780c,_0x4f0923)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x4f0923['sourceId'],_0x4f0923['source'],_0x4f0923['resources'],_0x4f0923['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x2f20a4,_0x1027db)=>{this['_aiChatUi']['updateResourceState'](_0x1027db['sourceId'],_0x1027db['resourceId'],_0x1027db['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x1fb577,_0x23db84)=>{this['_aiChatUi']['updateCapabilities'](_0x23db84);}),this['activeConversation']['on']('modelSelected',(_0x5554db,_0x1f574b)=>{this['_aiChatUi']['setSelectedModel'](_0x1f574b['selectedModel'],_0x1f574b['isDisabled']);}),this['activeConversation']['on']('error',(_0x27e7b3,{error:_0x142ae1,interactionId:_0x4712e3,fileName:_0x4019e1,url:_0x3e0c92,sourceId:_0x234e4d,sourceLabel:_0x15f02c})=>{const _0x47be76=_0x4712e3?_0x4712e3+':'+_0x10e5dc():_0x10e5dc();_0x142ae1['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':w(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x47be76}):_0x142ae1['message']['startsWith']('ai-chat-conversation-init-failed')||_0x142ae1['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':w(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x47be76}),this['_logError'](_0x142ae1)):_0x142ae1['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':w(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x4019e1),'id':_0x47be76}):_0x142ae1['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':w(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x3e0c92),'id':_0x47be76}):_0x142ae1['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':w(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x47be76}):_0x142ae1['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':w(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x47be76}):_0x142ae1['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x234e4d&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x234e4d),this['_aiChatUi']['addFeedItemError']({'errorMessage':w(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x15f02c||'source'),'id':_0x47be76}),this['_logError'](_0x142ae1)):_0x142ae1['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':w(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x47be76}),this['_logError'](_0x142ae1)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':w(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x47be76}),this['_logError'](_0x142ae1));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x4d6fd0||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0xaa098b,quickActionData:_0x30eee9}){if(!this['activeConversation'])throw new _0x5e86d1('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':_0xaa098b,'quickActionData':_0x30eee9}),this['_removeAISelectionMarkers']();}['_removeAISelectionMarkers'](){const _0x4a963e=lt(this['context'])['model'],_0x38455d=Array['from'](_0x4a963e['markers']['getMarkersGroup'](ct));_0x4a963e['change'](_0x5dcd4a=>{_0x38455d['forEach'](_0x2a86f4=>_0x5dcd4a['removeMarker'](_0x2a86f4));});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x5366e3){this['_aiChatUi']['setIsMaximized'](_0x5366e3);}['_logError'](_0x2b2559){ot(_0x2b2559['message']);}['_removeFromContext'](_0x2f9d4f){this['activeConversation']?.['removeFromContext'](_0x2f9d4f);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x227956){const [_0x1dcef4,_0x22e386]=_0x227956['split'](':'),_0x4ff6d5=this['activeConversation']['getInteraction'](_0x1dcef4),_0x1a4d57=_0x4ff6d5['getReply'](_0x22e386);return{'interaction':_0x4ff6d5,'reply':_0x1a4d57};}['_scrollToSuggestionRange'](_0x1432af,_0x41c166=!0x1){const _0x5c5f94=lt(this['context']),_0x367c5e={'target':_0x5c5f94['editing']['view']['domConverter']['viewRangeToDom'](_0x5c5f94['editing']['mapper']['toViewRange'](_0x1432af)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x41c166};_0x41c166&&(_0x367c5e['alignToTop']=!0x0),nt(_0x367c5e);}['updateConversationTitle'](_0x51f85e,_0x340331=!0x1){this['_aiChatUi']['setConversationTitle'](_0x51f85e||w(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x340331);}['_filterModels'](_0x55a54c,_0x7b6d29){let _0xab9f02;if(_0x7b6d29){_0xab9f02=[];const _0x252c97='string'==typeof _0x7b6d29?[_0x7b6d29['toLocaleLowerCase']()]:_0x7b6d29['map'](_0x24e362=>_0x24e362['toLocaleLowerCase']());for(const _0x12b6f8 of _0x252c97)for(const _0x12d07f of _0x55a54c)(_0x12d07f['id']['toLocaleLowerCase']()===_0x12b6f8||_0x12d07f['name']['toLocaleLowerCase']()===_0x12b6f8||_0x12d07f['provider']['toLocaleLowerCase']()===_0x12b6f8||_0x12d07f['id']['toLocaleLowerCase']()['startsWith'](_0x12b6f8))&&_0xab9f02['push'](_0x12d07f);}else _0xab9f02=_0x55a54c;return _0xab9f02;}async['_updateReplyContent']({reply:_0x4fb67b,changeGroups:_0x3df775,renderingStrategy:_0x5061d1}){const {id:_0x2def59,isDone:_0x412413,type:_0x55680a,parsedContent:_0x4ebc63}=_0x4fb67b;if('modification-delta'===_0x55680a){const _0x4c1644=y({'editor':lt(this['context']),'showDiff':this['_aiChatUi']['showDiff'],'changeGroups':_0x3df775,'documentContextContent':_0x4fb67b['documentContextContent']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x2def59,'parts':_0x4c1644,'renderingStrategy':_0x5061d1,'isDone':_0x412413});}else'text-delta'===_0x55680a&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x2def59,'parsedContent':_0x4ebc63,'renderingStrategy':_0x5061d1,'isDone':_0x412413});_0x412413&&_0x4fb67b['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x2def59,_0x4fb67b['sources']);}async['_stopLastInteraction'](){const _0x9b7859=this['activeConversation']?.['lastInteraction'];_0x9b7859&&(_0x9b7859['stop'](),this['_aiChatUi']['stopInteraction'](_0x9b7859));}async['_flushLastInteractionUI'](){const _0x4a3bd8=this['activeConversation']?.['lastInteraction'];if(_0x4a3bd8){for await(const _0x383221 of _0x4a3bd8['replies'])await this['_updateReplyContent']({'reply':_0x383221,'changeGroups':_0x383221['changeGroups'],'renderingStrategy':'static'});}}['_updateRatings'](_0x34d27b){const _0x100f36={'positiveCount':_0x34d27b['changeGroups']['filter'](_0x2f7306=>'accepted'===_0x2f7306['state'])['length'],'totalCount':_0x34d27b['changeGroups']['length']},_0x32b3f8=this['activeConversation']['getInteraction'](_0x34d27b['interactionId'])['messageId'];this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x32b3f8,_0x100f36);}}const Pt=[...Ue,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class je extends Cr{['containerView'];['actionsView'];constructor(_0x549de0,_0x1aee5b){super(_0x1aee5b),this['containerView']=new e(_0x549de0,{'showDiff':_0x1aee5b['showDiff'],'areActionsDisabled':_0x1aee5b['areActionsDisabled']}),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x4d5cfb,_0x4e96cc)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x4e96cc['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',(_0x108b0f,{index:_0xe6008b})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0xe6008b});}),this['containerView']['on']('insertSuggestion',(_0x512eed,{index:_0x5f3ecf})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x5f3ecf});}),this['containerView']['on']('rejectSuggestion',(_0x27967e,{index:_0x4828cc})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4828cc});}),this['containerView']['on']('mouseOverSuggestion',(_0x118fdf,{index:_0x546b9e})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x546b9e});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x2ba5ca,{index:_0x4b8d0e})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4b8d0e});}),this['actionsView']=new th(_0x549de0,this['options']['dropdownConfig']),this['actionsView']['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn'),this['actionsView']['on']('showChangeInText',()=>{this['fire']('showChangeInText',{'replyId':this['options']['id']});}),this['actionsView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'replyId':this['options']['id']});}),this['actionsView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'replyId':this['options']['id']});}),_0x1aee5b['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'](_0x62b167){await this['containerView']['updateContent'](_0x62b167),this['actionsView']['updateLabels'](this['containerView']['bodyView']['partsCount']);}['updatePartState'](_0xed36dd,_0x11c784){this['containerView']['bodyView']['updatePartState'](_0xed36dd,_0x11c784);}['updateSources'](_0x6f372d){this['containerView']['updateSources'](_0x6f372d);}['getPartView'](_0x2f2653){return this['containerView']['bodyView']['getPartView'](_0x2f2653);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone'](),this['actionsView']['isVisible']=this['containerView']['bodyView']['hasNonEmptyParts'];}}class Le extends Cr{['replyContainer'];constructor(_0x56c1d5,_0x3caea3){super(_0x3caea3),this['locale']=_0x56c1d5,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x14b3a2(),this['replyContainer']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-chat__feed__ai-reply-container']}}),this['children']['add'](this['replyContainer']);}async['render'](){super['render'](),this['options']['initialContent']&&(await this['updateContent']({'parsedContent':tr(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x582444,renderingStrategy:_0x3e1418,abortSignal:_0xff9e5e}){'streaming'===_0x3e1418?await this['streamIntoElement'](_0x582444,this['replyContainer']['element'],_0xff9e5e):this['replyContainer']['element']['innerHTML']=_0x501beb(_0x582444);}['updateSources'](_0x21e52b){const _0x4507ae=new _r(this['locale']);_0x4507ae['children']['addMany'](_0x21e52b['map'](_0xf9b64=>new jr(this['locale'],_0xf9b64))),_0x4507ae['isVisible']=!0x0,this['children']['add'](_0x4507ae);}}const yn={'file':_0x491246,'document':_0x5513a4,'web-resource':_0x15ef28,'text':_0x491246,'selection':_0x45b740},Jr='ck-ai-chat-context-chip',Zr='ck-ai-chat-context-chip_wide',Qo='ck-ai-chat-context-chip_document',Zo='ck-ai-chat-context-chip__label',na='ck-ai-chat-context-chip__type-icon',ra='ck-ai-chat-context-controls__chip-tooltip',Nn='n';class ao extends _0xb98904{constructor(_0x3cfe09,_0x58d281,_0xc8f0c8,_0x212bfb,_0x28cc15=!0x1){super(_0x3cfe09),this['_isAnimationOnEnterEnabled']=_0x212bfb,this['_initializeProperties'](_0x58d281,_0xc8f0c8,_0x28cc15),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'](_0xc44fce,_0x5c5ecc,_0x34e6ae){this['set']('label',_0xc44fce['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0xc44fce['type']),this['set']('id',_0xc44fce['uiId']),this['set']('readonly',_0x5c5ecc),this['set']('isLoading',_0x34e6ae);}['_setupTemplate'](){const _0x3ef80f=this['_createIconView'](),_0x404fda=this['_createRemoveButton'](),_0x33b693=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x33b693),'children':this['_createTemplateChildren'](_0x3ef80f,_0x404fda,_0x33b693)});}['_createTemplateAttributes'](_0xf89cce){return{'class':[Jr,_0xf89cce['if']('itemType',Qo,_0x78bc6d=>'document'==_0x78bc6d),_0xf89cce['if']('itemType',Zr,_0x2ed587=>'selection'==_0x2ed587)],'data-cke-tooltip-text':_0xf89cce['to']('label',Xn),'data-cke-tooltip-position':Nn,'data-cke-tooltip-class':ra};}['_createTemplateChildren'](_0x1543e0,_0x5e77fe,_0x35b31a){const _0x2c9912=this['_createLabelElement'](_0x35b31a),_0x1c364a=this['_createLoaderIcon']();return this['readonly']?[_0x1543e0,_0x2c9912]:[_0x1543e0,_0x1c364a,_0x2c9912,_0x5e77fe];}['_createLabelElement'](_0x5ec5db){return{'tag':'span','attributes':{'class':Zo},'children':[{'text':_0x5ec5db['to']('label')}]};}['_createRemoveButton'](){const _0x48cf68=new _0xb98904(this['locale']);return _0x48cf68['set']({'label':w(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x20bd6f}),this['_setupRemoveButtonEvent'](_0x48cf68),_0x48cf68;}['_setupRemoveButtonEvent'](_0x4dbbfb){_0x4dbbfb['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x234a98=this['bindTemplate'],_0x31e4af=new _0x2bd673();return _0x31e4af['content']=yn[this['itemType']],_0x31e4af['extendTemplate']({'attributes':{'class':[na,_0x234a98['if']('isLoading','ck-hidden',_0x85b3b0=>_0x85b3b0)]}}),_0x31e4af;}['_handleAnimationEndOnce'](_0x1d4460,_0x4d0ade){if(!_0x1d4460)return;const _0x52b097=()=>{_0x4d0ade(),_0x1d4460['removeEventListener']('animationend',_0x52b097),_0x1d4460['removeEventListener']('webkitAnimationEnd',_0x52b097);};_0x1d4460['addEventListener']('animationend',_0x52b097),_0x1d4460['addEventListener']('webkitAnimationEnd',_0x52b097);}['_createLoaderIcon'](){const _0x2e495e=new Fe('small');return _0x2e495e['bind']('isVisible')['to'](this,'isLoading',_0x2f55c8=>_0x2f55c8),_0x2e495e;}}function Xn(_0xfa5fa0){if(!_0xfa5fa0)return _0xfa5fa0;if(_0xfa5fa0['length']<=0x78)return _0xfa5fa0;const _0x1ce9d4=_0xfa5fa0['slice'](0x0,0x78),_0x23e62d=_0x1ce9d4['lastIndexOf']('\x20');return(_0x23e62d>0x0?_0x1ce9d4['slice'](0x0,_0x23e62d):_0x1ce9d4)+'…';}const dn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},bn='300px';class lo{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x3a8fbc,_0x97c5b0,_0x3d3553,_0x43fa6f,_0x3d391b){this['_locale']=_0x3a8fbc,this['_visibleChips']=_0x97c5b0,this['_config']={...dn,..._0x3d3553,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x3d3553['cssClasses']}},this['_overflowChips']=new _0x553151(),this['_bodyCollection']=_0x43fa6f,this['_parentView']=_0x3d391b||null;}['setContainerElement'](_0x599a5e){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x599a5e,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 _0x2170a3=[...this['_visibleChips'],...this['_overflowChips']],_0x15b7e4=this['_createCalculationContainer'](),_0x28f993=this['_calculateOverflowInContainer'](_0x15b7e4,_0x2170a3),_0x2379ee=_0x15b7e4['_ancestorsToRestore'];_0x2379ee&&this['_restoreAncestorVisibility'](_0x2379ee),_0x15b7e4['remove'](),this['_applyOverflowResults'](_0x2170a3,_0x28f993);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x33b86b({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x105597=new _0xb98904(this['_locale']);_0x105597['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x469837=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x469837['push'](this['_config']['cssClasses']['controlsButton']),_0x105597['extendTemplate']({'attributes':{'class':_0x469837}}),_0x105597;}['_createShowMoreBalloonPanelView'](){const _0x5ab851=new _0x1b1d73(this['_locale']);return _0x5ab851['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x5ab851),_0x5ab851;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x2b0669=>{_0x2b0669['disableAnimationOnEnter']();});const _0x404977=new _0x14b3a2(this['_locale']);_0x404977['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x404977);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x3f085a=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x3f085a?'':'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'](_0x1dea91){const _0x437426=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x4b16af=this['_containerElement']?.['classList'];if(_0x4b16af){const _0x7ee61b=_0x4b16af[0x0]||'',_0x2bf517=_0x1dea91['querySelector']('.'+_0x7ee61b),_0x2c264c=_0x1dea91['querySelector'](_0x437426);return _0x2bf517||_0x2c264c||_0x1dea91;}return _0x1dea91['querySelector'](_0x437426)||_0x1dea91;}['_calculateContainerWidth'](){const _0x2049d6=this['_parentView']?.['element']||this['_containerElement'];if(!_0x2049d6)return bn;const _0x39b9bc=window['getComputedStyle'](_0x2049d6)['width'];if('auto'===_0x39b9bc||'0px'===_0x39b9bc||!_0x39b9bc){const _0x3c677b=_0x2049d6['parentElement'];if(_0x3c677b){const _0x341543=window['getComputedStyle'](_0x3c677b);return'auto'!==_0x341543['width']?_0x341543['width']:bn;}return bn;}return _0x39b9bc;}['_applyCalculationStyles'](_0x3c8808,_0x1e4a54){this['_config']['cssClasses']['calculationContainer']&&_0x3c8808['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x3c8808['style']['width']=_0x1e4a54,_0x3c8808['style']['position']='absolute',_0x3c8808['style']['top']='-9999px',_0x3c8808['style']['left']='-9999px',_0x3c8808['style']['opacity']='0',_0x3c8808['style']['pointerEvents']='none',_0x3c8808['style']['zIndex']='-1',_0x3c8808['style']['visibility']='visible\x20!important',_0x3c8808['style']['display']='block\x20!important',_0x3c8808['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x27610b){_0x27610b['forEach'](({element:_0xfe0881,originalDisplay:_0x4a3cd6,originalVisibility:_0x56e551})=>{_0xfe0881['style']['display']=_0x4a3cd6,_0xfe0881['style']['visibility']=_0x56e551;});}['_makeAncestorsVisible'](_0x2c3032){const _0x5bf5a9=[];let _0x3c0cc4=_0x2c3032;for(;_0x3c0cc4&&_0x3c0cc4!==document['body'];){const _0xe2b74d=window['getComputedStyle'](_0x3c0cc4);'none'!==_0xe2b74d['display']&&'hidden'!==_0xe2b74d['visibility']||(_0x5bf5a9['push']({'element':_0x3c0cc4,'originalDisplay':_0x3c0cc4['style']['display'],'originalVisibility':_0x3c0cc4['style']['visibility']}),_0x3c0cc4['style']['display']='block',_0x3c0cc4['style']['visibility']='visible'),_0x3c0cc4=_0x3c0cc4['parentElement'];}return _0x5bf5a9;}['_createContainerElements'](){let _0x3a5f29,_0x55310f;return this['_parentView']?.['element']?(_0x3a5f29=this['_parentView']['element']['cloneNode'](!0x0),_0x55310f=this['_findTargetContainer'](_0x3a5f29)):(_0x3a5f29=document['createElement']('div'),_0x55310f=_0x3a5f29),{'calculationContainer':_0x3a5f29,'targetContainer':_0x55310f};}['_createCalculationContainer'](){const {calculationContainer:_0x1734b4,targetContainer:_0x519765}=this['_createContainerElements'](),_0x11f289=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x1734b4,_0x11f289);const _0x5d84f9=this['_parentView']?.['element']||this['_containerElement'],_0x163e5d=_0x5d84f9?.['parentElement'];_0x163e5d?_0x163e5d['appendChild'](_0x1734b4):document['body']['appendChild'](_0x1734b4),_0x1734b4['_targetContainer']=_0x519765;const _0x13d54c=this['_makeAncestorsVisible'](_0x163e5d||null);return _0x1734b4['offsetWidth'],_0x1734b4['_ancestorsToRestore']=_0x13d54c,_0x1734b4;}['_calculateOverflowInContainer'](_0x35d50a,_0x9c4db6){const _0x3d5522=_0x35d50a['_targetContainer']||_0x35d50a,_0x4d0002=[],{rowCount:_0x5650ce}=this['_renderChipsAndCountRows'](_0x3d5522,_0x9c4db6);if(_0x5650ce<=this['_config']['maxVisibleRows'])return _0x4d0002;const _0x559c48=_0x9c4db6['slice']();for(;_0x559c48['length']>0x0;){if(this['_testButtonFit'](_0x35d50a,_0x3d5522,_0x559c48)){const _0x106524=_0x9c4db6['filter'](_0x43174b=>!_0x559c48['includes'](_0x43174b));_0x4d0002['push'](..._0x106524);break;}if(!_0x559c48['pop']())break;}return _0x4d0002;}['_renderChipsAndCountRows'](_0x3fd7a5,_0x5c165b){_0x3fd7a5['innerHTML']='',_0x5c165b['forEach'](_0x1e83f9=>{if(_0x1e83f9['element']){const _0x1cfb24=_0x1e83f9['element']['cloneNode'](!0x0);_0x3fd7a5['appendChild'](_0x1cfb24);}}),_0x3fd7a5['offsetWidth'];const _0x405d4a=_0x3fd7a5['children'],_0x5bcdf1=[];return Array['from'](_0x405d4a)['forEach'](_0x5a46da=>{const _0x438604=_0x5a46da['getBoundingClientRect']()['top'];_0x5bcdf1['some'](_0x15992c=>Math['abs'](_0x15992c-_0x438604)<this['_config']['rowDetectionTolerance'])||_0x5bcdf1['push'](_0x438604);}),{'rowCount':_0x5bcdf1['length']};}['_createMockButton'](){const _0x17576a=document['createElement']('button');return _0x17576a['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x17576a['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x17576a['textContent']='+\x201',_0x17576a;}['_testButtonFit'](_0x562dbe,_0x227fc9,_0x2f0326){this['_renderChipsAndCountRows'](_0x227fc9,_0x2f0326);const _0x4110f6=this['_createMockButton']();_0x562dbe['appendChild'](_0x4110f6),_0x562dbe['offsetWidth'];const _0xcf39ca=[..._0x227fc9['children'],_0x4110f6],_0x38db7a=[];_0xcf39ca['forEach'](_0x5c4274=>{const _0x4f5ec8=_0x5c4274['getBoundingClientRect']()['top'];_0x38db7a['some'](_0x30fb67=>Math['abs'](_0x30fb67-_0x4f5ec8)<this['_config']['rowDetectionTolerance'])||_0x38db7a['push'](_0x4f5ec8);});const _0x5c001d=_0x38db7a['length'];return _0x4110f6['remove'](),_0x5c001d<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x2d54de,_0x1c6421){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x2d54de['forEach'](_0xdf9b3e=>{_0x1c6421['includes'](_0xdf9b3e)?this['_overflowChips']['add'](_0xdf9b3e):this['_visibleChips']['add'](_0xdf9b3e);});}['_updateOverflowUI'](_0x2d5634){if(_0x2d5634>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x2d5634>0x0&&this['_showMoreButtonView']){const _0x47abb7=''+this['_config']['showMoreLabelPrefix']+(_0x2d5634<0x63?_0x2d5634:'99');this['_showMoreButtonView']['label']=_0x47abb7;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x65f0f1,_0x213a49){this['_distributeChips'](_0x65f0f1,_0x213a49),this['_updateOverflowUI'](_0x213a49['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x4aa852=>{_0x4aa852[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 _0x2e638d=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x2e638d['width']||0x0===_0x2e638d['height'])return!0x1;const _0x11937a=window['innerHeight']||document['documentElement']['clientHeight'],_0x5d16e7=window['innerWidth']||document['documentElement']['clientWidth'],_0x138fd8=0xc8;return _0x2e638d['bottom']>=-0xc8&&_0x2e638d['top']<=_0x11937a+_0x138fd8&&_0x2e638d['right']>=-0xc8&&_0x2e638d['left']<=_0x5d16e7+_0x138fd8;}}const oa='ck-ai-chat__feed__context-chips',aa='ck-ai-chat-context-chips-wrapper',ha='ck-ai-chat-context-chips-wrapper-balloon',ca='ck-ai-chat-controls-button',la='ck-ai-chat-controls_context_show-more-button',da='ck-ai-chat-context-controls__show-more-balloon-panel';class eh extends _0x14b3a2{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x2238a5,_0x4587e1,_0x31db4e){super(_0x2238a5),this['_bodyCollection']=_0x31db4e,this['_createContextChips'](_0x4587e1);const _0x434016={'cssClasses':{'showMoreButton':la,'showMoreBalloon':da,'overflowContainer':ha,'controlsButton':ca}};this['_overflowManager']=new lo(_0x2238a5,this['_contextChips'],_0x434016,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[oa,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':aa},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x5076e7=this['element']['querySelector']('.'+aa);_0x5076e7&&(this['_overflowManager']['setContainerElement'](_0x5076e7),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x51a5a6){for(const _0x29f622 of _0x51a5a6){const _0xc906fd=new ao(this['locale'],_0x29f622,!0x0,!0x1);this['_contextChips']['add'](_0xc906fd);}}}class Te extends Cr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x2b3fd5,_0x5613f2,_0x37d853){super(_0x5613f2),this['_locale']=_0x2b3fd5,this['_bodyCollection']=_0x37d853,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 eh(this['_locale'],this['options']['contextItems']['filter'](_0x3cee5a=>!_0x3cee5a['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x14b3a2(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 Cr{['capabilities'];constructor(_0x520f54,_0xf9d923){super(_0xf9d923);const {isWebSearchEnabled:_0x554af6,isReasoningEnabled:_0x758fdc}=_0xf9d923['capabilities'],_0x1f875e=[];let _0x456ad5='';_0x554af6&&_0x758fdc?(_0x456ad5=w(_0x520f54,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x1f875e['push'](ia(_0x4cc6ea)),_0x1f875e['push'](ia(ta))):_0x554af6?(_0x456ad5=w(_0x520f54,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x1f875e['push'](ia(_0x4cc6ea))):_0x758fdc&&(_0x456ad5=w(_0x520f54,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x1f875e['push'](ia(ta))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x456ad5?'':'ck-hidden']}});const _0x1de38a=new _0x14b3a2();_0x1de38a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x1f875e,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x456ad5]}]}),this['children']['add'](_0x1de38a),this['capabilities']=_0xf9d923['capabilities'];}}function ia(_0x322310){const _0x2af859=new _0x2bd673();return _0x2af859['content']=_0x322310,_0x2af859;}const ls=['wheel','touchstart','pointerdown','keydown'],ms=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class Me{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x1a2511){this['element']=_0x1a2511,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x1c9384 of ls){const _0x5a1cb6='keydown'!==_0x1c9384;this['element']['addEventListener'](_0x1c9384,this['_onUserEvent']['bind'](this),{'passive':_0x5a1cb6,'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'](_0x28d448){if(this['isRunning']){if('keydown'===_0x28d448['type']){const _0x57695f=_0x28d448['key'];if(!ms['includes'](_0x57695f))return;}_0x28d448 instanceof WheelEvent?_0x28d448['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x4b6566,scrollHeight:_0x16caf4,clientHeight:_0x4170e1}=this['element'];return _0x16caf4-_0x4b6566-_0x4170e1<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class Ae extends _0x14b3a2{constructor(_0x2e706e,_0x32437e){super(_0x2e706e),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x32437e)});}['_createSkeletonItems'](_0x7b7ddd){const _0x445e78=['ck','ck-ai-skeleton__item'];return _0x7b7ddd['map'](_0x5234cc=>{let _0x14952d='';switch(_0x5234cc['attributes']['align']){case'right':_0x14952d='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x14952d='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x14952d='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x5234cc['tag'],'attributes':{'class':[..._0x445e78,_0x5234cc['attributes']['class']?_0x5234cc['attributes']['class']:''],'style':'width:\x20'+_0x5234cc['attributes']['width']+';\x20height:\x20'+_0x5234cc['attributes']['height']+';'+_0x14952d}};});}}const Oe={'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(_0x362c3b,_0x449a68,_0x15107d,_0x33501f){return new Array(_0x362c3b)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x449a68,'height':_0x15107d,'align':_0x33501f}}));}class mi extends _0x14b3a2{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x1826c6,_0x34a8f2){super(_0x1826c6),this['_bodyCollection']=_0x34a8f2,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Pt)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new Me(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x47ea4e,_0x2e212e){let _0x3a3fd5;'ai-reply'===_0x47ea4e?_0x3a3fd5=new Le(this['locale'],_0x2e212e):'ai-suggestion-reply'===_0x47ea4e?(_0x3a3fd5=new je(this['locale'],_0x2e212e),_0x3a3fd5['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn')):_0x3a3fd5='user-message'===_0x47ea4e?new Te(this['locale'],_0x2e212e,this['_bodyCollection']):'interaction-header'===_0x47ea4e?new Rt(this['locale'],_0x2e212e):new Ve(_0x2e212e),this['children']['add'](_0x3a3fd5);}async['updateReplyItem']({id:_0x29aaf8,parsedContent:_0xf5e7db,renderingStrategy:_0x380955,abortSignal:_0x26f7fc}){const _0x4ff41d=this['getItemById'](_0x29aaf8);if(!(_0x4ff41d instanceof Le))throw new _0x5e86d1('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x4ff41d,'id':_0x29aaf8,'parsedContent':_0xf5e7db});await _0x4ff41d['updateContent']({'parsedContent':_0xf5e7db,'renderingStrategy':_0x380955,'abortSignal':_0x26f7fc});}async['updateWebSources'](_0x494cec,_0x4e20c3){const _0x531cf3=this['getItemById'](_0x494cec);if(_0x531cf3 instanceof je)_0x531cf3['updateSources'](_0x4e20c3);else{if(!(_0x531cf3 instanceof Le))throw new _0x5e86d1('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x531cf3,'id':_0x494cec,'sources':_0x4e20c3});_0x531cf3['updateSources'](_0x4e20c3);}}async['updateSuggestionItem']({id:_0x15a4be,parts:_0x49d9b7,renderingStrategy:_0x437cb6,abortSignal:_0x51571d}){const _0x217af7=this['getItemById'](_0x15a4be);if(!(_0x217af7 instanceof je))throw new _0x5e86d1('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x217af7,'id':_0x15a4be,'parts':_0x49d9b7});await _0x217af7['updateContent']({'parts':_0x49d9b7,'renderingStrategy':_0x437cb6,'abortSignal':_0x51571d});}['updateSuggestionPartState']({id:_0x239519,index:_0x439884,state:_0x44857f}){const _0x50cee9=this['getItemById'](_0x239519);if(!(_0x50cee9 instanceof je))throw new _0x5e86d1('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x239519});_0x50cee9['updatePartState'](_0x439884,_0x44857f);}['markItemAsDone'](_0x3812ba){this['getItemById'](_0x3812ba)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0xe1aa75=>_0xe1aa75['options']['id']);}['removeItem'](_0x438f80){this['children']['remove'](this['getItemById'](_0x438f80));}['scrollToSuggestion'](_0x757211,_0x254eae){const _0x368c96=this['getItemById'](_0x757211);if(!(_0x368c96 instanceof je))return void _0x51ad8b('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x757211,'partIndex':_0x254eae});const _0x1f123e=_0x368c96['getPartView'](_0x254eae);_0x1f123e?nt({'target':_0x1f123e['element'],'ancestorOffset':0x14,'alignToTop':!0x0,'forceScroll':!0x0}):_0x51ad8b('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x757211,'partIndex':_0x254eae});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x4c2b44=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x4c2b44,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x198ee6=new Ae(this['locale'],Oe['aiFeed']);return _0x198ee6['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x1df802=>!_0x1df802)]}}),_0x198ee6;}['_createFeedItems'](){const _0x18e1f1=new _0x14b3a2(this['locale']);return _0x18e1f1['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x18e1f1;}['_createFeedLoader'](){const _0x7dcbb9=new _0x14b3a2(this['locale']);return _0x7dcbb9['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x4e0111=>!_0x4e0111)]},'children':this['_createLoaderChildren']()}),_0x7dcbb9;}['_createLoaderChildren'](){const _0x136755=new Fe();return _0x136755['isVisible']=!0x0,[_0x136755,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x216bd5){const _0x3bed89=this['children']['find'](_0x2ee34d=>_0x2ee34d['options']['id']['includes'](_0x216bd5));if(!_0x3bed89)throw new _0x5e86d1('ai-chat-feed-view-item-not-found',this,{'id':_0x216bd5});return _0x3bed89;}['setLoadingMessage'](_0x3f127f){this['set']('loadingMessage',_0x3f127f);}['toggleLoadingSkeleton'](_0x43055e){this['set']('isLoadingSkeletonVisible',_0x43055e);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class Vr extends _0x5d5211{['filter'](){let _0x177978=0x0;for(const _0x313135 of this['items'])_0x177978+=_0x313135['items']['length'];return{'resultsCount':_0x177978,'totalItemsCount':_0x177978};}}class Ie extends _0x1ce9b7{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x87d0fe,_0xd82079){super(_0x87d0fe,{'queryView':{'label':'','creator':_0x2d4d73,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new Vr(_0x87d0fe),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0xd82079,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=Ie['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=Ie['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',(_0x4b66a4,_0x426a7f)=>!_0x4b66a4&&!_0x426a7f),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x50517b,_0x2f8f2b)=>{this['isUploadInProgress']||this['isEmpty']||_0x50517b['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x2f8f2b());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x5e8728=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x5e8728)return this['queryView']['errorText']=w(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x4da580=_0x17097f(_0x5e8728);this['fire']('sendUserMessage',_0x4da580),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x13b024){this['queryView']['fieldView']['set']('placeholder',_0x13b024);}['_createSubmitButton'](){const _0x43c74c=new _0xb98904(this['locale']);return _0x43c74c['set']({'icon':_0x5af618,'label':w(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x43c74c['on']('execute',()=>{this['submit']();}),_0x43c74c;}['setIsUploadInProgress'](_0x27f2cc){this['isUploadInProgress']=_0x27f2cc;}['_setUpAddContextButtonPositioning'](){const _0x2a28d3=this['locale'],_0x313d15=()=>{_0x191fbc['window']['requestAnimationFrame'](()=>{if(_0x2935b4(this['element'])){const _0x4af250=new _0x21ae68(this['queryView']['fieldView']['element']),_0x18e42f=new _0x21ae68(this['_addContextButtonView']['element']),_0x115576=_0x4af250['width'],_0x3d9e7a='rtl'===_0x2a28d3['uiLanguageDirection']?'right':'left';_0x4af250['excludeScrollbarsAndBorders']();const _0x47080e=_0x115576-_0x4af250['width']+0x1;this['_addContextButtonView']['element']['style'][_0x3d9e7a]='calc('+(_0x115576-_0x18e42f['width']-_0x47080e)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x313d15),this['on']('render',()=>{_0x313d15(),this['_queryViewResizeObserver']=new _0x18b8db(this['queryView']['fieldView']['element'],()=>{_0x313d15();});});}}const ua='ck-ai-chat__prompt-capabilities',_a='ck-ai-chat-controls-button',Ia='ck-ai-chat-controls-button--commands',Aa='ck-ai-chat-controls__model-selection',ga='ck-ai-chat-controls__model-selection__item-name',pa='ck-ai-chat-controls__model-selection__item-description',ma='ck-ai-chat-controls__model-selection__item-capabilities',Ta='n';class Ce extends _0x14b3a2{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x4f41d8){super(_0x4f41d8),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',_0x574424=>_0x574424),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x53db27=>_0x53db27?this['_modelSelectionDropdown']['buttonView']['label']:w(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x4620bc=>_0x4620bc),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x5c90e7=>_0x5c90e7),this['_webSearchButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x23d633=>!_0x23d633),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x44c4dc=>w(this['locale'],_0x44c4dc?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x5a5bde=>_0x5a5bde),this['_reasoningButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x4b95ee=>!_0x4b95ee),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x1deb17=>w(this['locale'],_0x1deb17?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[ua]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x553151(),_0x119cd1(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x39222,_0x5355f9){if(this['set']('modelSelectorVisible',!(_0x5355f9&&_0x39222['length']<=0x1)),this['_modelSelectionDropdownItems']['clear'](),_0x39222?.['length'])for(const _0x4d2487 of _0x39222){const _0x58fe2e=new _0x2819cc({'label':_0x4d2487['name'],'withText':!0x0,'role':'menuitemradio','id':_0x4d2487['id'],'model':_0x4d2487});_0x58fe2e['bind']('isOn')['to'](this,'activeModelId',_0x1f8d69=>_0x1f8d69===_0x4d2487['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x58fe2e,'labelView':new Ea(this['locale'],_0x4d2487)});}}['setWebSearch'](_0xcefffe){this['set']('webSearchActive',_0xcefffe);}['setReasoning'](_0xc2cb19){this['set']('reasoningActive',_0xc2cb19);}['setModel'](_0x65334f){if(!_0x65334f)return;this['activeModelId']=_0x65334f['id'],this['activeModelName']=_0x65334f['name']||_0x65334f['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x65334f['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x65334f['name']);const _0x1fc4d2=_0x65334f['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x1fc4d2),this['_webSearchButton']['set']('isVisible',_0x1fc4d2);const _0x23c538=_0x65334f['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x23c538),this['_reasoningButton']['set']('isVisible',_0x23c538);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0),this['set']('modelSelectorVisible',!0x0);}['disableModelSelector'](_0x1d2b5e){this['set']('modelSelectorEnabled',!0x1),_0x1d2b5e&&this['set']('modelSelectorVisible',!0x1);}['_createWebSearchButton'](){const _0x2115ec=new _0xb98904();return _0x2115ec['set']({'label':w(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x4cc6ea,'class':_a,'isToggleable':!0x0,'tooltipPosition':Ta}),_0x2115ec['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x2115ec;}['_createReasoningButton'](){const _0x601718=new _0xb98904();return _0x601718['set']({'label':w(this['locale'],'AI_CHAT_REASONING'),'icon':ta,'class':_a,'isToggleable':!0x0,'tooltipPosition':Ta}),_0x601718['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x601718;}['_createCommandsButton'](){const _0x116f08=new _0xb98904();return _0x116f08['set']({'label':w(this['locale'],'AI_CHAT_COMMANDS'),'icon':yt,'withText':!0x0,'class':_a,'isToggleable':!0x0,'tooltip':w(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':Ta}),_0x116f08['extendTemplate']({'attributes':{'class':[Ia]}}),_0x116f08['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x116f08;}['_createModelSelectionDropdown'](){const _0x4a841e=_0x19bf5c(this['locale']);return _0x4a841e['set']({'panelPosition':'ne','class':[Aa]}),_0x4a841e['buttonView']['set']({'label':w(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Ta}),this['listenTo'](_0x4a841e,'execute',_0x150326=>{this['fire']('selectModel',_0x150326['source']['model']);}),_0x4a841e;}['_createModelNameView'](){const _0x60d985=new Go(this['locale']);return _0x60d985['bind']('text')['to'](this,'activeModelName',_0x5377bf=>_0x5377bf??''),_0x60d985['bind']('isVisible')['to'](this,'modelSelectorVisible',this,'activeModelName',(_0x27171b,_0x53870b)=>!_0x27171b&&!_0x53870b?.['toLowerCase']()['startsWith']('agent')),_0x60d985;}}let Ea=class extends _0x5ef6a2{constructor(_0x3689f1,_0x21aafc){super();const _0x99d5e7=this['bindTemplate'],_0x30a85b=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x99d5e7['to']('style'),'id':_0x99d5e7['to']('id')},'children':[{'tag':'div','attributes':{'class':[ga]},'children':[{'text':_0x99d5e7['to']('text')}]},{'tag':'div','attributes':{'class':[pa]},'children':[{'tag':'span','children':[{'text':_0x21aafc['description']}]}]},{'tag':'div','attributes':{'class':[ma]},'children':_0x30a85b}]}),_0x30a85b['addMany'](this['_getCapabilityParts'](_0x3689f1,_0x4cc6ea,'AI_CHAT_SEARCH_WEB',_0x21aafc['capabilities']['webSearch']?.['enabled']??!0x1)),_0x30a85b['addMany'](this['_getCapabilityParts'](_0x3689f1,ta,'AI_CHAT_REASONING',_0x21aafc['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x5852e3,_0xcae132,_0x10abdb,_0x5b7466){const _0xdc82e3=new _0x2bd673();_0xdc82e3['content']=_0xcae132;const _0x5d0122=new _0x14b3a2(_0x5852e3);_0x5d0122['setTemplate']({'tag':'span','children':[{'text':w(_0x5852e3,_0x10abdb)+':\x20'}]});const _0x2e79f1=new _0x14b3a2(_0x5852e3);return _0x2e79f1['setTemplate']({'tag':'span','children':[{'text':w(_0x5852e3,_0x5b7466?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0xdc82e3,_0x5d0122,_0x2e79f1];}};class Go extends _0x14b3a2{constructor(_0x4aae44){super(_0x4aae44),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x430bea=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x430bea['if']('isVisible','ck-hidden',_0x46234f=>!_0x46234f)]},'children':[{'text':_0x430bea['to']('text')}]});}}const Ca='ck-ai-chat-context-controls__url-form',wa='ck-ai-chat-context-controls__url-input-section';class ko extends _0x14b3a2{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x4598f4){super(_0x4598f4),this['focusTracker']=new _0x49e991(),this['keystrokes']=new _0x183f1e(),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 _0x3f54b9({'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'](_0x4d6aa7=>{this['focusTracker']['add'](_0x4d6aa7['element']),this['keystrokes']['listenTo'](_0x4d6aa7['element']);}),_0x3345af({'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'](_0x10d6f9){this['urlInputField']['errorText']=_0x10d6f9,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x103845=new _0xb98904(this['locale']);return _0x103845['set']({'icon':_0x5d3e17,'tooltip':w(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':'ck-button-icon\x20ck-button-back'}),_0x103845;}['_createUrlInputField'](){const _0x157a6a=new _0x2ce1cc(this['locale'],_0x3dec20);return _0x157a6a['set']({'label':w(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x157a6a['fieldView']['set']({'placeholder':w(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x157a6a;}['_createConfirmButton'](){const _0x4a83cb=new _0xb98904(this['locale']);return _0x4a83cb['set']({'icon':_0x2b80f8,'tooltip':w(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x4a83cb;}['_setupTemplate'](){const _0x52dd19=new _0x4d6d75(this['locale'],{'label':w(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x52dd19['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Ca,'tabindex':'-1'},'children':[_0x52dd19,{'tag':'div','attributes':{'class':wa},'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',_0x21feae=>{_0x21feae['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x238b53,_0x14e9c9)=>{this['clear'](),this['fire']('cancel'),_0x14e9c9();});}['_handleSubmit'](){const _0x2f3726=this['getValue']()['trim']();_0x2f3726?this['_isValidUrl'](_0x2f3726)?(this['clearError'](),this['fire']('submitUrl',_0x2f3726)):this['setError'](w(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](w(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x3b926e=this['getValue']()['trim'](),_0x5a4fb1=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x3b926e['length']>0x0&&!_0x5a4fb1;}['_isValidUrl'](_0x151b36){try{return!!new URL(_0x151b36);}catch{return!0x1;}}}const fa='ck-ai-chat-resources__item',Sa='ck-ai-chat-resources__item--in-context',Oa='ck-ai-chat-resources__item-title',Ra='ck-ai-chat-resources__item__icon';class $o extends _0x17d3e0{['resource'];['_titleView'];['_iconView'];constructor(_0x5c57fb,_0x4ae444){super(_0x5c57fb),this['resource']=_0x4ae444,this['set']('isInContext',!!_0x4ae444['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x4e6a33){if(_0x4e6a33['isInContext'])return _0x2b80f8;switch(_0x4e6a33['type']){case de['DOCUMENT']:return _0x5513a4;case de['URL']:return _0x15ef28;case de['FILE']:case de['TEXT']:return _0x491246;default:return _0x46edee;}}['highlightText'](_0x3a8749){if(!_0x3a8749||''===_0x3a8749['trim']())return void this['_titleView']['highlightText'](null);const _0x69ddae=new RegExp(_0x48db4a(_0x3a8749),'gi');this['_titleView']['highlightText'](_0x69ddae);}['updateResourceState'](_0x205184){this['resource']['isInContext']=_0x205184,this['isInContext']=_0x205184,this['_updateIcon']();}['_createTitleView'](){const _0x1b8749=new _0x4c6d3b();return _0x1b8749['text']=this['resource']['label'],_0x1b8749['extendTemplate']({'tag':'span','attributes':{'class':[Oa]}}),_0x1b8749;}['_createIconView'](){const _0x885247=new _0x2bd673();return _0x885247['content']=this['getResourceIcon'](this['resource']),_0x885247;}['_setupTemplate'](){const _0x163c97=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[fa,_0x163c97['if']('isVisible','ck-hidden',_0xed62e5=>!_0xed62e5),_0x163c97['if']('isInContext',Sa)]},'children':[{'tag':'div','attributes':{'class':[Ra]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x163c97['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const ba='ck-ai-chat-resources__list';class Ur extends _0x5d5211{['_source'];constructor(_0x5e4c62,_0x42feb5){super(_0x5e4c62),this['_source']=_0x42feb5,this['extendTemplate']({'attributes':{'class':[ba]}});}['setResources'](_0x3d3e97,_0xcaee5a){this['items']['clear']();let _0x56a9a2=_0x3d3e97;if(this['_source']['useDefaultFiltering']&&_0xcaee5a&&''!==_0xcaee5a['trim']()){const _0x23741b=new RegExp(_0xcaee5a['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x56a9a2=_0x3d3e97['filter'](_0x5ea0bc=>_0x23741b['test'](_0x5ea0bc['label']));}for(const _0x3df2d3 of _0x56a9a2){const _0x3a19a9=new $o(this['locale'],_0x3df2d3);_0x3a19a9['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x3df2d3);}),this['items']['add'](_0x3a19a9);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0xcaee5a);}['highlightText'](_0x10af48){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x3b5f40=>{_0x3b5f40['highlightText'](_0x10af48);});}['updateResourceState'](_0x48cdd2,_0x193fcb){for(const _0x31a17c of this['items']){const _0x167d3e=_0x31a17c;_0x167d3e['resource']['id']===_0x48cdd2&&_0x167d3e['updateResourceState'](_0x193fcb);}}['_handleResourceSelection'](_0x56a744,_0x4648a2){this['fire']('addResourceToContext',{'source':_0x56a744,'resource':_0x4648a2});}}class Gr extends _0x2ce1cc{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x505430){const t=_0x505430['t'],_0x5c31da={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x3dec20,'label':w(_0x505430,'AI_CHAT_SEARCH_RESOURCES')};super(_0x505430,_0x5c31da['creator']),this['label']=_0x5c31da['label'],this['_viewConfig']=_0x5c31da,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x505430,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x42888b){this['fire']('search',_0x42888b);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x2bd673(),this['iconView']['content']=_0x4fbb91,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x1a4b3b,t){this['resetButtonView']=new _0xb98904(_0x1a4b3b),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x4f51f8,'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',_0x38be2b=>!_0x38be2b),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 Fo extends _0x14b3a2{['_searchView'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x356ce1,_0x38b51b){super(_0x356ce1),this['_source']=_0x38b51b,this['set']('isLoading',!0x0),this['_searchView']=this['_createSearchView']();const _0x3d3a54=this['_createSearchSection']();this['_resourcesListView']=this['_createResourcesListView'](),this['_skeletonLoader']=this['_createSkeletonView'](),this['children']=new _0x17ac77([_0x3d3a54,this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new Gr(this['locale']);}['_createSearchSection'](){const _0x30f9e1=new _0x14b3a2(this['locale']);return _0x30f9e1['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x599838,_0x3e41e4)=>{this['loadResources'](_0x3e41e4),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x3e41e4);}),_0x30f9e1;}['_createResourcesListView'](){const _0x5c7900=new Ur(this['locale'],this['_source']);return _0x5c7900['delegate']('addResourceToContext')['to'](this),_0x5c7900['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x5c7900;}['_createSkeletonView'](){const _0x44e764=new Ae(this['locale'],Oe['aiChatResources']);return _0x44e764['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x56d61e=>!_0x56d61e)]}}),_0x44e764;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x4a2761){const _0x1405d0=_0x10e5dc();this['_latestLoadResourcesUid']=_0x1405d0,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x4a2761,'uid':_0x1405d0}),this['isLoading']=!0x0;}['setResources'](_0x3b3d4c,_0x2d4cec){if(_0x2d4cec&&_0x2d4cec!==this['_latestLoadResourcesUid'])return;const _0x565862=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x3b3d4c,_0x565862),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x2f5d92,_0x984a22){this['_resourcesListView']['updateResourceState'](_0x2f5d92,_0x984a22);}}const Na='ck-ai-chat-context-controls__source-balloon-panel',ya='ck-button-icon\x20ck-button-back',ka='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Eo{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x2c533c,_0x3ced60,_0x1029e4){this['_locale']=_0x2c533c,this['_bodyCollection']=_0x3ced60,this['_config']=_0x1029e4;}['showSourceResourcesBalloon'](_0x4b8b6a){let _0x2b92d2=this['_sourceResourceBalloons']['get'](_0x4b8b6a['id']);_0x2b92d2||(_0x2b92d2=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x4b8b6a['id'],_0x2b92d2),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x2b92d2)),this['_addSourceResourceContent'](_0x2b92d2,_0x4b8b6a),_0x2b92d2['show']();const _0x256e09=this['_config']['getTargetElement']();_0x256e09&&_0x2b92d2['pin']({'target':_0x256e09,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x5c9848,_0x2c6afe,_0x23eae3){const _0x3d4bdc=this['_sourceResourceBalloons']['get'](_0x5c9848);if(!_0x3d4bdc)return;const _0x484bfa=this['_getResourcesViewFromBalloon'](_0x3d4bdc);_0x484bfa&&_0x484bfa['setResources'](_0x2c6afe,_0x23eae3);}['closeSourceResourceBalloon'](_0x116170){const _0x22f134=this['_sourceResourceBalloons']['get'](_0x116170);_0x22f134&&requestAnimationFrame(()=>{_0x22f134['hide'](),this['_sourceResourceBalloons']['delete'](_0x116170),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x1e191d of this['_sourceResourceBalloons']['values']())if(_0x1e191d['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x2af23e,_0x1d89e6,_0x2e6b0a){const _0x56b7cf=this['_sourceResourceBalloons']['get'](_0x2af23e);if(!_0x56b7cf||!_0x56b7cf['isVisible'])return;const _0x574b74=this['_config']['getTargetElement']();if(!_0x574b74)return;_0x56b7cf['pin']({'target':_0x574b74,'limiter':this['_config']['getLimiterElement']()});const _0x5c1381=this['_getResourcesViewFromBalloon'](_0x56b7cf);_0x5c1381&&_0x5c1381['updateResourceState'](_0x1d89e6,_0x2e6b0a);}['destroy'](){for(const _0x54f598 of this['_sourceResourceBalloons']['values']())_0x54f598['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x1045e7=new _0x1b1d73(this['_locale']);return _0x1045e7['extendTemplate']({'attributes':{'class':Na}}),this['_bodyCollection']['add'](_0x1045e7),_0x1045e7;}['_addSourceResourceContent'](_0x2d886e,_0x22f840){_0x2d886e['content']['clear']();const _0x44dc7e=this['_createBalloonHeader'](_0x2d886e,_0x22f840);_0x2d886e['content']['add'](_0x44dc7e);const _0x3bbdf4=this['_createBalloonResourcesView'](_0x22f840);_0x2d886e['content']['add'](_0x3bbdf4);}['_createBalloonHeader'](_0x388f6b,_0x2a7d1a){const _0x10ea29=this['_createBackButton'](_0x388f6b),_0x3a6508=new _0x4d6d75(this['_locale'],{'label':_0x2a7d1a['label'],'class':ka});return _0x3a6508['children']['add'](_0x10ea29,0x0),_0x3a6508;}['_createBackButton'](_0x2d2419){const _0x2f9753=new _0xb98904(this['_locale']);return _0x2f9753['set']({'icon':_0x5d3e17,'tooltip':w(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':ya}),_0x2f9753['on']('execute',()=>{_0x2d2419['hide'](),this['_config']['onBackToContext']();}),_0x2f9753;}['_createBalloonResourcesView'](_0x1592fe){const _0x529eb4=new Fo(this['_locale'],_0x1592fe);return _0x529eb4['on']('loadSourceResources',(_0x4dba4e,_0x3cce28)=>{this['_config']['onLoadSourceResources'](_0x3cce28);}),_0x529eb4['on']('addResourceToContext',(_0x5cff34,_0x3202e7)=>{this['_config']['onResourceSelected'](_0x3202e7['source'],_0x3202e7['resource']),this['closeSourceResourceBalloon'](_0x1592fe['id']);}),_0x529eb4;}['_getResourcesViewFromBalloon'](_0x36ea13){const _0x4be5fe=_0x36ea13['content']['get'](0x1);return _0x4be5fe instanceof Fo?_0x4be5fe:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x25f70f){_0x33b86b({'emitter':_0x25f70f,'contextElements':[_0x25f70f['element']],'callback':()=>{_0x25f70f['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x25f70f['isVisible']});}}const Pe=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources'],vo='ck-ai-chat-context-controls',go='ck-ai-chat-context-controls__pending-contexts',Vo='ck-ai-chat-context-controls__add-context-balloon-panel',fo='ck-ai-chat-context-controls__add-context-button',Io='ck-ai-chat-context-controls__url-balloon-panel',Po='ck-ai-chat-context-controls__balloon-button',Ro='ck-ai-chat-context-controls__balloon-button-source',uo='ck-ai-chat-controls-button',So='ck-ai-chat-context-chips-wrapper-balloon',xo='ck-ai-chat-controls_context_show-more-button',mo='ck-ai-chat-context-controls__show-more-balloon-panel',Uo='ck-ai-chat',Lo=[_0x1b1d73['defaultPositions']['northArrowSouthWest'],_0x1b1d73['defaultPositions']['northArrowSouth'],_0x1b1d73['defaultPositions']['northArrowSouthEast'],_0x1b1d73['defaultPositions']['southArrowNorthWest'],_0x1b1d73['defaultPositions']['southArrowNorth'],_0x1b1d73['defaultPositions']['southArrowNorthEast']];class xe extends _0x14b3a2{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['bodyCollection'];constructor(_0x550bb7,_0x35565d){super(_0x550bb7),this['bodyCollection']=_0x35565d,this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x550bb7),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x550bb7),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x550bb7),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x550bb7,_0x35565d);const _0x12a789={'cssClasses':{'showMoreButton':xo,'showMoreBalloon':mo,'overflowContainer':So,'controlsButton':uo}};this['_overflowManager']=new lo(_0x550bb7,this['_currentContextsChips'],_0x12a789,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'](_0x16de2c,_0x573e44){const _0x559afd=this['_createContextButton'](_0x16de2c,'current',!0x0,_0x573e44);this['_addContextToCollection'](_0x559afd,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x599d5b){this['_removeContextFromCollection'](_0x599d5b,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x599d5b,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x357e7b,_0x120900){let _0x416933=this['_currentContextsChips']['find'](_0x2b9c75=>_0x2b9c75['id']===_0x357e7b);_0x416933||(_0x416933=this['_overflowManager']['overflowChips']['find'](_0x23cef8=>_0x23cef8['id']===_0x357e7b)),_0x416933&&(_0x416933['isLoading']=_0x120900);}['setConversationContext'](_0x2cb141){this['_conversationContextsChips']['clear']();for(const _0x5bf5fa of _0x2cb141){const _0x29c0b2=this['_createContextButton'](_0x5bf5fa,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x29c0b2,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x273497,_0x2714fc,_0x331b14){this['_resourcesBalloonView']['updateResourceState'](_0x273497,_0x2714fc,_0x331b14);}['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'](_0x5e47f8){this['_resourcesBalloonView']['showSourceResourcesBalloon'](_0x5e47f8),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0xbd946,_0x3fd124,_0x5881a1,_0x5ceed7){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0xbd946,_0x5881a1,_0x5ceed7);}['closeSourceResourceBalloon'](_0x38661d){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x38661d),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x344b84){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x344b84),this['_setAddContextButtonEnabled'](_0x344b84);}['_setAddContextButtonEnabled'](_0x248231){const _0x46df74=!_0x248231['document']['isHidden']&&_0x248231['document']['enabled'],_0x99637a=_0x248231['urls']['enabled'],_0xe8f809=_0x248231['files']['enabled'];this['addContextButtonView']['isEnabled']=_0x46df74||_0x99637a||_0xe8f809;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[vo,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':go},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0xfae9bc){const _0x26d5c0=new _0xb98904(_0xfae9bc);return _0x26d5c0['set']({'label':w(_0xfae9bc,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':uo+'\x20'+fo,'icon':_0x273814,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x26d5c0;}['_createAddContextBalloonPanelView'](_0x39b399){return this['_createBaseBalloonPanel'](_0x39b399,Vo);}['_createUrlBalloonPanelView'](_0x32cb23){const _0x1363ca=this['_createBaseBalloonPanel'](_0x32cb23,Io);return this['_addUrlContent'](_0x1363ca,_0x32cb23),_0x1363ca;}['_createResourcesBalloonView'](_0x589e19,_0x3c2483){return new Eo(_0x589e19,_0x3c2483,{'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Lo});},'onResourceSelected':(_0x119dbb,_0x3acb46)=>{this['fire']('addResourceToContext',{'source':_0x119dbb,'resource':_0x3acb46});},'onLoadSourceResources':_0x36fa44=>{this['fire']('loadSourceResources',_0x36fa44);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']});}['_getLimiterElement'](){return this['element']?.['closest']('.'+Uo)||document['body'];}['_createBaseBalloonPanel'](_0x178bd9,_0x10092d){const _0x997016=new _0x1b1d73(_0x178bd9);return _0x997016['extendTemplate']({'attributes':{'class':_0x10092d}}),this['bodyCollection']['add'](_0x997016),_0x997016;}['_setBalloonPanelContent'](_0xea1161,_0x357f1c,_0x57f2c8){if(_0xea1161['content']['clear'](),!_0x57f2c8['document']['isHidden']&&_0x57f2c8['document']['enabled']){const _0x3e8104=this['_createBalloonButton'](_0x357f1c,{'label':w(_0x357f1c,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x5513a4});_0x3e8104['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0xea1161['content']['add'](_0x3e8104);}if(_0x57f2c8['urls']['enabled']){const _0x109779=this['_createBalloonButton'](_0x357f1c,{'label':w(_0x357f1c,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x15ef28});_0x109779['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Lo}),this['_urlInputView']['focus']();}),_0xea1161['content']['add'](_0x109779);}if(_0x57f2c8['files']['enabled']){const _0x4aa8a1=new _0x385ee9(_0x357f1c);_0x4aa8a1['set']({'label':w(_0x357f1c,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x109cc6,'withText':!0x0,'tooltip':!0x0,'class':Po,'allowMultipleFiles':!0x0}),_0x4aa8a1['on']('done',(_0x4320d0,_0x24f71d)=>{this['fire']('addFileToContext',_0x24f71d),this['hideAddContextBalloonPanel']();}),_0x4aa8a1['tooltip']=!0x0,_0xea1161['content']['add'](_0x4aa8a1);}for(const _0x4cb21b of _0x57f2c8['sources']){const _0x534a07=this['_createBalloonButton'](_0x357f1c,{'label':_0x4cb21b['label'],'icon':_0x4cb21b['icon']||_0x46edee,'type':'source'});_0xea1161['content']['add'](_0x534a07),_0x534a07['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon'](_0x4cb21b);});}}['_addUrlContent'](_0x1a6461,_0x2cc258){this['_urlInputView']=new ko(_0x2cc258),this['_urlInputView']['on']('submitUrl',(_0x13ced5,_0x3e08ac)=>{this['_handleUrlSubmit'](_0x3e08ac);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Lo});}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Lo});}),_0x1a6461['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x36a344,_0x13ed87){const _0x440a8a='source'===_0x13ed87['type']?new va(_0x36a344):new _0xb98904(_0x36a344);return _0x440a8a['set']({'label':_0x13ed87['label'],'icon':_0x13ed87['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Po}),_0x440a8a;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x33b86b({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x946494){const _0x447508=this['_addContextBalloonConfig'];_0x447508['buttonView']['isOn']=_0x946494,_0x946494?_0x447508['balloonView']['show']():_0x447508['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x44f0b2,buttonView:_0x12d108,hideMethod:_0x1abbde}=this['_addContextBalloonConfig'];_0x33b86b({'emitter':_0x44f0b2,'contextElements':[_0x44f0b2['element'],_0x12d108['element']],'callback':()=>{_0x1abbde();},'activator':()=>_0x12d108['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x2e5bf1,_0x335142,_0x49e562=!0x1,_0x14ebd8=!0x1){const _0x52b138='conversation'===_0x335142||!0x0===_0x2e5bf1['isReadOnly'],_0x3cb959=new ao(this['locale'],_0x2e5bf1,_0x52b138,_0x49e562,_0x14ebd8);return _0x52b138||_0x3cb959['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x3cb959['id']);}),_0x3cb959;}['_addContextToCollection'](_0x28228d,_0x443f6d){_0x443f6d['add'](_0x28228d,0x0);}['_removeContextFromCollection'](_0x51024b,_0x5c3598){const _0x5df072=_0x5c3598['find'](_0x1a6865=>_0x1a6865['id']===_0x51024b);_0x5df072&&_0x5c3598['remove'](_0x5df072);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Lo}));}['_handleUrlSubmit'](_0x53f58e){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x53f58e);}}class va extends _0xb98904{['arrowView'];constructor(_0x159960){super(_0x159960),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Ro]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x289cf7=new _0x2bd673();return _0x289cf7['content']=_0x55d3a8,_0x289cf7['extendTemplate']({'attributes':{'class':Ro+'__arrow'}}),_0x289cf7;}}class ve extends _0x14b3a2{['_cancelButtonView'];['_loaderView'];constructor(_0x4e2054){super(_0x4e2054),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 _0x5d755d=new _0xb98904(this['locale']);return _0x5d755d['set']({'label':w(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ai-chat-controls-loader__cancel-button','icon':_0x14175e}),_0x5d755d['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x5d755d;}['_createLoaderView'](){const _0x2db146=new _0x14b3a2(this['locale']);return _0x2db146['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':w(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x2db146;}}class ji extends _0x14b3a2{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_shouldRestorePromptInputFocus'];constructor(_0x3b0732,_0x5e94ba){super(_0x3b0732),this['_contextPanelView']=this['_createContextPanelView'](_0x3b0732,_0x5e94ba),this['_promptInputView']=this['_createPromptInputView'](_0x3b0732),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x3b0732),this['_loaderView']=this['_createLoaderView'](_0x3b0732),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),this['set']('isDisabled',!0x1);const _0xacac19=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0xacac19['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0xacac19['if']('isLoading','ck-hidden')]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0xacac19['if']('isLoading','ck-hidden',_0x16ae48=>!_0x16ae48)]},'children':[this['_loaderView']]}]}),_0x33b86b({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x4f1830,_0x57693d){return new xe(_0x4f1830,_0x57693d);}['_createPromptInputView'](_0x26e54f){return new Ie(_0x26e54f,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x5e03a4){return new Ce(_0x5e03a4);}['_createLoaderView'](_0x53db32){return new ve(_0x53db32);}['_handlePromptInputFocus'](_0x4a4617,_0xe5f13f,_0x510b16){_0x510b16?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x3494d9,_0x4d4864){this['_contextPanelView']['addContextItem'](_0x3494d9,_0x4d4864);}['removeContextItem'](_0x28c9cc){this['_contextPanelView']['removeContextItem'](_0x28c9cc);}['setContextItemLoading'](_0x38d3e4,_0x14ff83){this['_contextPanelView']['setContextItemLoading'](_0x38d3e4,_0x14ff83);}['setIsUploadInProgress'](_0x569163){this['_promptInputView']['setIsUploadInProgress'](_0x569163);}['setConversationContext'](_0x2c4f82){this['_contextPanelView']['setConversationContext'](_0x2c4f82);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x455398,_0x29841f,_0x57ee69){this['_contextPanelView']['updateResourceState'](_0x455398,_0x29841f,_0x57ee69);}['setWebSearch'](_0x3e1bdb){this['_promptCapabilitiesView']['setWebSearch'](_0x3e1bdb);}['setReasoning'](_0x2d97a8){this['_promptCapabilitiesView']['setReasoning'](_0x2d97a8);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x3227f7){this['_contextPanelView']['setAddContextOptions'](_0x3227f7);}['setInputPlaceholder'](_0x2c0cd8){this['_promptInputView']['setPlaceholderText'](_0x2c0cd8);}['setModelList'](_0x52a901,_0xc437e2){this['_promptCapabilitiesView']['setModelList'](_0x52a901,_0xc437e2);}['setModel'](_0x5eeb16){this['_promptCapabilitiesView']['setModel'](_0x5eeb16);}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x35fbfe){this['_promptCapabilitiesView']['disableModelSelector'](_0x35fbfe);}['populateSourceResourceBalloon'](_0x432f8b,_0x3d8d27,_0x1c654b,_0x4c5117){this['_contextPanelView']['populateSourceResourceBalloon'](_0x432f8b,_0x3d8d27,_0x1c654b,_0x4c5117);}['closeSourceResourceBalloon'](_0x15c986){this['_contextPanelView']['closeSourceResourceBalloon'](_0x15c986);}['focusPromptInput'](){this['_promptInputView']['focus']();}}class ki extends _0x4d6d75{['conversationStartButton'];['resizeButton'];constructor(_0x60250e,_0x58d9d7){super(_0x60250e,{'label':w(_0x60250e,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':St}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x60250e),this['children']['add'](this['conversationStartButton']),_0x58d9d7&&(this['resizeButton']=cs(_0x60250e,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x30284d){const _0x31998f=new _0xb98904(_0x30284d);return _0x31998f['set']({'label':w(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x3e404e,'class':'ck-ai-chat__start-conversation'}),_0x31998f['on']('execute',()=>{this['fire']('startConversation');}),_0x31998f;}}class Ci extends _0x14b3a2{constructor(_0x26aa24){super(_0x26aa24),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':w(_0x26aa24,'AI_DISCLAIMER_TEXT')}]}]});}}class Et extends _0x14b3a2{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x2413a0,_0x2db654){super(_0x2413a0),this['_bodyCollection']=new Wt(_0x2413a0),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new ki(_0x2413a0,_0x2db654),this['chatHeader']['delegate'](...Pt)['to'](this),this['chatFeed']=new mi(_0x2413a0,this['_bodyCollection']),this['chatFeed']['delegate'](...Pt)['to'](this),this['chatControls']=new ji(_0x2413a0,this['_bodyCollection']),this['chatControls']['delegate'](...Pt)['to'](this),this['chatDisclaimer']=new Ci(_0x2413a0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x2413a0['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x497ca4,_0x57cd8b,_0x43d9e7,_0x5ab3d3){this['chatControls']['populateSourceResourceBalloon'](_0x497ca4,_0x57cd8b,_0x43d9e7,_0x5ab3d3);}['closeSourceResourceBalloon'](_0x4d0be3){this['chatControls']['closeSourceResourceBalloon'](_0x4d0be3);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class it extends tt{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;['_isTrackChangesCommandValueBound']=!0x1;constructor(_0x47888f){super(_0x47888f);const _0x486179=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new _(),this['_view']=new Et(this['context']['locale'],_0x486179['showResizeButton']),this['_view']['delegate'](...Pt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x4c6286,{showDiff:_0x1ef72d})=>{this['showDiff']=_0x1ef72d;}),_0x486179['view']['addTab']({'id':'chat','buttonLabel':w(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':St,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x1720de=>_0x1720de),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x52db9e=>_0x52db9e),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x49b4f4){this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x49b4f4['availableModels'],!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':w(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE')});}['addFeedItemStaticMessage']({id:_0x14aa5f,staticMessage:_0x5b922d}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x14aa5f,'initialContent':'<p>'+_0x5b922d+'</p>'});}['addFeedItemUserMessage'](_0x2554e6){const _0x3e2c0c=_0x2554e6['quickActionData']?.['displayedPrompt']||_0x2554e6['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x2554e6['contextItems']['values']()),'initialContent':'<p>'+_0x3e2c0c+'</p>','id':_0x2554e6['id']});}['addFeedItemError']({errorMessage:_0x46857a,id:_0x6ed80}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x46857a+'</p>','id':_0x6ed80});}['addFeedItemAIReply'](_0x166acd){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x166acd['interactionId']+':'+_0x166acd['id']}),this['setLoadingMessage'](null);});}async['addFeedItemAISuggestion'](_0x56a25b){const _0x4419c0=lt(this['context']);if(_0x4419c0){const _0x35bcd7=_0x4419c0['commands']['get']('trackChanges');_0x35bcd7&&!this['_isTrackChangesCommandValueBound']&&(this['_isTrackChangesCommandValueBound']=!0x0,this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x35bcd7,'value'));}return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x56a25b['interactionId']+':'+_0x56a25b['id'],'areActionsDisabled':_0x56a25b['areActionsDisabled'],'showDiff':this['showDiff'],'dropdownConfig':this['context']['config']['get']('ai.availableReplyActions')}),this['setLoadingMessage'](null);});}['addFeedInteractionHeader'](_0x1b0daa,_0x1dac98){const _0x19a449=this['_view']['chatFeed']['children']['last'];if(_0x19a449 instanceof Rt)return this['_view']['chatFeed']['children']['remove'](_0x19a449),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x1b0daa['id'],'capabilities':{'isWebSearchEnabled':_0x19a449['capabilities']['isWebSearchEnabled']||_0x1dac98['isWebSearchEnabled'],'isReasoningEnabled':_0x19a449['capabilities']['isReasoningEnabled']||_0x1dac98['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x1b0daa['id'],'capabilities':_0x1dac98});}['updateFeedInteractionHeader'](_0x1cd058){const _0xec7215=this['_view']['chatFeed']['children']['find'](_0x5fe790=>_0x5fe790['options']['id']==_0x1cd058['id']&&_0x5fe790 instanceof Rt);_0xec7215&&_0xec7215['set']('isVisible',_0x1cd058['isVisible']);}async['updateFeedItemAIReplyContent'](_0x41dca6){const _0x478112=_0x41dca6['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x520699=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x41dca6,'abortSignal':_0x520699,'renderingStrategy':_0x478112}),_0x41dca6['isDone']&&this['markFeedItemAsDone'](_0x41dca6['id']);});}['updateFeedItemAIReplySources'](_0x3f7ab6,_0x56a23d){this['_view']['chatFeed']['updateWebSources'](_0x3f7ab6,_0x56a23d);}async['updateFeedItemAIReplySuggestionContent'](_0x466ab6){const _0x3f575a=_0x466ab6['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x4f9de9=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x466ab6,'abortSignal':_0x4f9de9,'renderingStrategy':_0x3f575a}),_0x466ab6['isDone']&&this['markFeedItemAsDone'](_0x466ab6['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x130c6d){this['_view']['chatFeed']['updateSuggestionPartState'](_0x130c6d);}['markFeedItemAsDone'](_0x4a2787){this['_view']['chatFeed']['markItemAsDone'](_0x4a2787);}['removeFeedInteraction'](_0x534247){this['_view']['chatFeed']['getItemIds']()['filter'](_0x3026ee=>_0x3026ee['startsWith'](_0x534247))['forEach'](_0x3d9e12=>this['_view']['chatFeed']['removeItem'](_0x3d9e12));}['startInteraction'](){this['setLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1}),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x2d7f5f){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x1c4f41=>_0x1c4f41['startsWith'](_0x2d7f5f['id']))['forEach'](_0x2acfed=>this['markFeedItemAsDone'](_0x2acfed)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0xe18406,_0x32269e){this['_view']['chatControls']['addContextItem'](_0xe18406,_0x32269e);}['removeContextItem'](_0x2e37d7){this['_view']['chatControls']['removeContextItem'](_0x2e37d7);}['setContextItemLoading'](_0x496daa,_0x5c597b){this['_view']['chatControls']['setContextItemLoading'](_0x496daa,_0x5c597b);}['setIsUploadInProgress'](_0x1b5f20){this['_view']['chatControls']['setIsUploadInProgress'](_0x1b5f20);}['setConversationContext'](_0x367d89){this['_view']['chatControls']['setConversationContext'](_0x367d89);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x4d6716,_0x386426,_0x69602){this['_view']['chatControls']['updateResourceState'](_0x4d6716,_0x386426,_0x69602);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x1e7537){this['_view']['chatControls']['setAddContextOptions'](_0x1e7537);}['updateCapabilities'](_0x2a3747){this['_view']['chatControls']['setWebSearch'](_0x2a3747['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x2a3747['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x2a3747));}['setSelectedModel'](_0x197b1a,_0x5b6347){this['_view']['chatControls']['setModel'](_0x197b1a),_0x5b6347&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x9c77d){this['feedItemRenderingStrategy']=_0x9c77d;}['toggleLoadingSkeleton'](_0x4e6f5e){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x4e6f5e);}['resetConversationTitle'](){this['setConversationTitle'](w(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x35cc04,_0x2d430f=!0x1){if(_0x2d430f&&!At()&&_0x35cc04['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x35cc04);this['_view']['chatHeader']['label']=_0x35cc04;}['setLoadingMessage'](_0x305f9e){const _0x5d791d=this['_getLoadingMessage'](_0x305f9e);this['_view']['chatFeed']['setLoadingMessage'](_0x5d791d);}['_animateConversationTitle'](_0x5429ac){let _0x5e6fd9=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x5429ac[_0x5e6fd9],_0x5e6fd9++,_0x5e6fd9===_0x5429ac['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x38ddbb){this['_view']['chatHeader']['isMaximized']=_0x38ddbb;}['_getLoadingMessage'](_0x4fdd49){return _0x4fdd49?_0x4fdd49['isWebSearchEnabled']&&_0x4fdd49['isReasoningEnabled']?w(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x4fdd49['isWebSearchEnabled']?w(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x4fdd49['isReasoningEnabled']?w(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):w(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR'):'';}['_getInputPlaceholder'](_0x3f6a19){return _0x3f6a19?_0x3f6a19['isWebSearchEnabled']&&_0x3f6a19['isReasoningEnabled']?w(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x3f6a19['isWebSearchEnabled']?w(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x3f6a19['isReasoningEnabled']?w(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):w(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):w(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x43b011,_0x3a17bd,_0x27d71e,_0x1de67c){this['_view']['populateSourceResourceBalloon'](_0x43b011,_0x3a17bd,_0x27d71e,_0x1de67c);}['closeSourceResourceBalloon'](_0x3fe29f){this['_view']['closeSourceResourceBalloon'](_0x3fe29f);}['focusPromptInput'](){this['_view']['chatControls']['focusPromptInput']();}['scrollFeedToSuggestion'](_0x54857c,_0x5b51cf){this['_view']['chatFeed']['scrollToSuggestion'](_0x54857c,_0x5b51cf);}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class Di extends _0x5d5211{['sections'];constructor(_0x4f9f46,_0x58276c){super(_0x4f9f46),this['sections']=_0x58276c,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x15b7a3){let _0x5b5f12=0x0,_0x5ed94b=0x0;for(const _0x2e22b7 of this['sections']){const {resultsCount:_0x3b72dc,totalItemsCount:_0x3190b5}=_0x2e22b7['filter'](_0x15b7a3);_0x5b5f12+=_0x3b72dc,_0x5ed94b+=_0x3190b5;}return{'resultsCount':_0x5b5f12,'totalItemsCount':_0x5ed94b};}}class zi extends _0x17d3e0{['title'];['itemsViews'];['_itemsListView'];constructor(_0x1550b2,{title:_0x43ceb1,items:_0x5bf516}){super(_0x1550b2);const _0x17ebd1=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x43ceb1,this['itemsViews']=_0x5bf516;const _0x222c62=new _0x14b3a2(_0x1550b2);_0x222c62['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x5d5211(_0x1550b2),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x17ebd1['if']('isVisible','ck-hidden',_0x5cd8ee=>!_0x5cd8ee)]},'children':[_0x222c62,this['_itemsListView']]});}['filter'](_0x29a92a){const _0x49379c=this['itemsViews']['length'];let _0x121c96=0x0;for(const _0x39d0af of this['itemsViews']){if(_0x29a92a){const _0x3cbcd1=_0x39d0af['isMatching'](_0x29a92a);_0x39d0af['isVisible']=!!_0x3cbcd1,_0x39d0af['highlightText'](_0x29a92a);}else _0x39d0af['isVisible']=!0x0,_0x39d0af['highlightText'](null);_0x39d0af['isVisible']&&_0x121c96++;}return this['isVisible']=_0x121c96>0x0,{'resultsCount':_0x121c96,'totalItemsCount':_0x49379c};}['getItem'](_0x4b318f){return this['itemsViews']['find'](_0x5a0fd8=>_0x5a0fd8['id']===_0x4b318f);}['removeItem'](_0x3d602a){const _0x2be211=this['itemsViews']['indexOf'](_0x3d602a);-0x1!==_0x2be211&&(this['itemsViews']['splice'](_0x2be211,0x1),this['_itemsListView']['items']['remove'](_0x3d602a));}}class Bi extends _0x177fa5(_0x17d3e0){['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(_0x470150,_0x40d710){super(_0x470150);const _0x42c236=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x40d710['pinned']),this['set']('loadingState',null),this['id']=_0x40d710['id'];const {title:_0x2f32af,createdAt:_0x1dd498,active:_0xb5c378=!0x1}=_0x40d710;this['_titleView']=new _0x4c6d3b(),this['_titleView']['text']=_0x2f32af,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x3b379b=this['_createCheckView'](),_0x56e6d2=this['_createPinButtonView'](_0x470150),_0x103339=this['_createMenuDropdownView'](),_0x13b9c8=this['_createEditInputView'](_0x470150,_0x2f32af),_0x2cc033=this['_createAcceptEditButtonView'](_0x470150,_0x13b9c8),_0x73ee76=this['_createCancelEditButtonView'](_0x470150,_0x13b9c8);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x56e6d2),this['actions']['add'](_0x103339),this['on']('change:isEdit',(_0x35dbd2,_0x26cebf,_0xeeb37b)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0xeeb37b?(this['actions']['add'](_0x2cc033),this['actions']['add'](_0x73ee76),this['mainContent']['add'](_0x13b9c8),_0x13b9c8['element']['focus']()):(this['actions']['add'](_0x56e6d2),this['actions']['add'](_0x103339),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0xb5c378?'ck-ai-chat-history__item--active':'',_0x42c236['if']('isVisible','ck-hidden',_0x263e97=>!_0x263e97),_0x42c236['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',_0x42c236['if']('loadingState','ck-hidden',_0xa09c67=>!!_0xa09c67)]},'children':_0xb5c378?[_0x3b379b]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x42c236['if']('loadingState','ck-hidden',_0x275f09=>!_0x275f09)]},'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',_0x42c236['if']('loadingState','ck-hidden',_0x24b96d=>!!_0x24b96d)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x42c236['if']('loadingState','ck-hidden',_0x4982e8=>!_0x4982e8)]},'children':[{'text':_0x42c236['to']('loadingState',_0x401eca=>_0x401eca?w(this['locale'],Bi['LOADING_LABELS'][_0x401eca]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x1dd498]}]},{'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'](_0x449ac6){this['_titleView']['text']=_0x17097f(_0x449ac6);}['updateLoadingState'](_0x4497a5,_0x1cc4f3){this['set']('loadingState',_0x1cc4f3?_0x4497a5:null);}['_createCheckView'](){const _0xe29181=new _0x2bd673();return _0xe29181['set']({'content':_0x5c7e48}),_0xe29181;}['_createPinButtonView'](_0x25a302){const _0x527f2c=new _0xb98904(_0x25a302);return _0x527f2c['set']({'label':w(_0x25a302,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x2887ac,'withText':!0x1,'tooltip':!0x0}),_0x527f2c['bind']('isOn')['to'](this,'pinned'),_0x527f2c['on']('execute',()=>{const _0x339968=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x339968});}),_0x527f2c;}['_createMenuDropdownView'](){const _0x180daf=_0x19bf5c(this['locale'],_0x2e7d19),_0xe2f699=_0x180daf['panelView']['children'];_0x180daf['buttonView']['set']({'label':w(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x5bb7c9}),_0x180daf['panelPosition']='sw';const _0x17bb83=new _0xb98904(this['locale']);_0x17bb83['label']=w(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x17bb83['withText']=!0x0,_0x17bb83['on']('execute',()=>{this['isEdit']=!0x0;});const _0x191cd9=new _0xb98904(this['locale']);_0x191cd9['label']=w(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x191cd9['withText']=!0x0,_0x191cd9['on']('execute',()=>{this['showConfirm'](w(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x283210=new _0x5d5211(this['locale']),_0x4c4a34=new _0x17d3e0(this['locale']);_0x4c4a34['children']['add'](_0x17bb83);const _0x55be50=new _0x17d3e0(this['locale']);return _0x55be50['children']['add'](_0x191cd9),_0x283210['items']['addMany']([_0x4c4a34,_0x55be50]),_0xe2f699['add'](_0x283210),_0x180daf;}['_createEditInputView'](_0x3be24c,_0x3293f2){const _0x106a41=new _0x521df6(_0x3be24c),_0x203c6d=_0x106a41['bindTemplate'];return _0x106a41['value']=_0x3293f2,_0x106a41['extendTemplate']({'on':{'keydown':_0x203c6d['to'](_0x4449d8=>{'Enter'==_0x4449d8['key']&&this['_commitEditInputValue'](_0x106a41);})}}),_0x106a41;}['_createAcceptEditButtonView'](_0x1d58d0,_0x5f07c9){const _0x44a3a3=new _0xb98904(_0x1d58d0);return _0x44a3a3['set']({'icon':_0x5c7e48,'withText':!0x1,'tooltip':w(_0x1d58d0,'AI_CHAT_HISTORY_ACCEPT')}),_0x44a3a3['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x44a3a3['on']('execute',()=>{this['_commitEditInputValue'](_0x5f07c9);}),_0x44a3a3;}['_commitEditInputValue'](_0x3d3e5b){const _0x2ed0fc=_0x3d3e5b['element']['value']||'';this['_titleView']['text']=_0x2ed0fc,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x2ed0fc});}['_createCancelEditButtonView'](_0x3d2bb2,_0x82c23){const _0x3bb861=new _0xb98904(_0x3d2bb2);return _0x3bb861['set']({'icon':_0x4f51f8,'withText':!0x1,'tooltip':w(_0x3d2bb2,'AI_CHAT_HISTORY_CANCEL')}),_0x3bb861['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x3bb861['on']('execute',()=>{this['isEdit']=!0x1,_0x82c23['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x3bb861;}['_createSpinnerView'](){const _0x464360=new Fe('tiny');return _0x464360['isVisible']=!0x0,_0x464360;}['isMatching'](_0xb246d3){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0xb246d3)?{'title':!0x0}:null;}['highlightText'](_0x59e6ba){this['_titleView']['highlightText'](_0x59e6ba);}}class vt extends _0x14b3a2{['searchView'];['errorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x4d7063,_0x4495af){super(_0x4d7063),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1);const _0x478fed=new _0x4d6d75(_0x4d7063,{'label':w(_0x4d7063,'AI_CHAT_HISTORY_HEADING'),'icon':Ht,'class':'ck-ai-header\x20ck-ai-header_history'});_0x4495af&&(this['resizeButton']=cs(_0x4d7063,this),_0x478fed['children']['add'](this['resizeButton'])),this['sectionsView']=new Di(_0x4d7063,[]),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':[_0x478fed,{'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 _0x3ed571=new _0x310b2f(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':w(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x205168=>w(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x205168),'secondary':w(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}});return _0x3ed571['on']('render',()=>{this['searchView']['children']['add'](this['errorView'],0x1);}),_0x3ed571['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x3a5240=>!_0x3a5240)]}}),_0x3ed571;}['_createSkeletonView'](){const _0x5abeb9=new Ae(this['locale'],Oe['aiHistory']);return _0x5abeb9['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x4f5493=>!_0x4f5493)]}}),_0x5abeb9;}['_createErrorView'](){const _0x2cfd1f=new _0x14b3a2(this['locale']),_0x181848=new _0xb98904(this['locale']);return _0x181848['set']({'withText':!0x1,'icon':_0x4f51f8,'class':'ck-ai-chat-error__dismiss-button'}),_0x181848['bind']('isVisible')['to'](this,'hasItems',_0x532122=>!!_0x532122),_0x181848['on']('execute',()=>{this['errorMessage']='';}),_0x2cfd1f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-error',this['bindTemplate']['if']('errorMessage','ck-hidden',_0x3225e0=>!_0x3225e0)]},'children':[{'tag':'p','children':[{'text':this['bindTemplate']['to']('errorMessage')}]},_0x181848]}),_0x2cfd1f;}['_createEmptyStateView'](){const _0x27d954=new _0xb98904(this['locale']);_0x27d954['set']({'label':w(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x3e404e,'class':'ck-ai-chat__start-conversation'}),_0x27d954['on']('execute',()=>{this['fire']('openChat');});const _0x121aa5=new _0x14b3a2(this['locale']);return _0x121aa5['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x49f158=>!_0x49f158)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[w(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x27d954]}),_0x121aa5;}['_createListItemViews'](_0x3fe80c,_0x48ac81){const _0x54d25c=[];for(const _0x172f88 of _0x3fe80c){const _0x36f5f5=new Bi(_0x48ac81,_0x172f88);_0x36f5f5['delegate'](...Fi)['to'](this),_0x54d25c['push'](_0x36f5f5);}return _0x54d25c;}['updateHistoryItemsWithCategories'](_0x3f6fa3){const _0x1b7fe4=this['locale']||'en',_0x1a9d6d=[];for(const _0x35144f of _0x3f6fa3){const _0x7b4873=this['_createListItemViews'](_0x35144f['items'],_0x1b7fe4);_0x1a9d6d['push'](new zi(_0x1b7fe4,{'title':_0x35144f['title'],'items':_0x7b4873}));}this['sectionsView']['sections']=_0x1a9d6d,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x1a9d6d),this['hasItems']=_0x3f6fa3['some'](_0x5aff17=>_0x5aff17['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x262ac8){for(const _0x2d4d0b of this['sectionsView']['sections']){const _0x368a07=_0x2d4d0b['getItem'](_0x262ac8);if(_0x368a07){if(_0x2d4d0b['removeItem'](_0x368a07),0x0===_0x2d4d0b['itemsViews']['length']){const _0x2ea0aa=this['sectionsView']['sections']['indexOf'](_0x2d4d0b);-0x1!==_0x2ea0aa&&(this['sectionsView']['sections']['splice'](_0x2ea0aa,0x1),this['sectionsView']['items']['remove'](_0x2d4d0b));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x408014,_0x13dd19){for(const _0x1f5b86 of this['sectionsView']['sections']){const _0x12b050=_0x1f5b86['getItem'](_0x408014);if(_0x12b050){_0x12b050['updateTitle'](_0x13dd19);break;}}}['updateItemLoadingState'](_0x468637,_0x1444c0,_0x40aa51){for(const _0x202e0a of this['sectionsView']['sections']){const _0x2c557f=_0x202e0a['getItem'](_0x468637);if(_0x2c557f){_0x2c557f['updateLoadingState'](_0x1444c0,_0x40aa51);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x3d405e=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x3d405e);}}}const Fi=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class xt extends tt{static get['requires'](){return[rt];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3e7369){super(_0x3e7369);const _0x5e5498=this['context']['plugins']['get']('AITabs');this['_historyView']=new vt(this['context']['locale'],_0x5e5498['showResizeButton']),this['_historyView']['delegate'](...Fi)['to'](this),_0x5e5498['view']['addTab']({'id':'history','buttonLabel':w(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Ht,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0xa30f78){this['_historyView']['removeHistoryItem'](_0xa30f78);}['updateItems'](_0x5933fe){this['_historyView']['updateHistoryItemsWithCategories'](_0x5933fe);}['updateItemTitle'](_0x42117d,_0x3be8f2){this['_historyView']['updateItemTitle'](_0x42117d,_0x3be8f2);}['updateItemLoadingState'](_0xb734b7,_0x5b1a28,_0x5afc7f){this['_historyView']['updateItemLoadingState'](_0xb734b7,_0x5b1a28,_0x5afc7f);}['setLoadingSkeleton'](_0x16eaf8){this['_historyView']['isLoading']=_0x16eaf8;}['showError'](_0x598933){this['_historyView']['errorMessage']=_0x598933;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x188c81){this['_historyView']['isMaximized']=_0x188c81;}}class De extends ts(){['id'];['createdAt'];constructor({id:_0x1e4820,title:_0x6187d4,createdAt:_0xfc3449,updatedAt:_0x424547,pinned:_0x1dd07c}){super(),this['id']=_0x1e4820,this['createdAt']=new Date(_0xfc3449),this['set']('title',_0x6187d4),this['set']('updatedAt',_0x424547?new Date(_0x424547):null),this['set']('pinned',_0x1dd07c||!0x1);}['updateTitle'](_0x498bb3){this['set']('title',_0x17097f(_0x498bb3)),this['updatedAt']=new Date();}['updatePinned'](_0x503ecd){this['set']('pinned',_0x503ecd),this['updatedAt']=new Date();}}class Tt extends _0x106985(){['items']=[];['connector'];['group'];constructor({connector:_0x1c2a85,group:_0x50d0a5}){super(),this['connector']=_0x1c2a85,this['group']=_0x50d0a5;}async['init'](){try{const _0x3cef13=this['connector']['fetchConversations'](this['group']),_0x2c2a31=await _0x3cef13['getConversations']();this['loadItems'](_0x2c2a31);}catch(_0x4467f2){this['fire']('error',{'error':_0x4467f2,'operation':'init'});}}['addItem'](_0x49b8ff){this['items']['push'](_0x49b8ff);}async['removeItem'](_0x16a0d7){const _0xd4c7cd=this['items']['findIndex'](_0x319aa7=>_0x319aa7['id']===_0x16a0d7);if(-0x1===_0xd4c7cd)return!0x1;try{return await this['connector']['deleteConversation'](_0x16a0d7)['execute'](),this['items']['splice'](_0xd4c7cd,0x1),this['fire']('itemRemoved',{'itemId':_0x16a0d7}),!0x0;}catch(_0x39bd22){return this['fire']('error',{'error':_0x39bd22,'operation':'removeItem','itemId':_0x16a0d7}),!0x1;}}['getItem'](_0x438af0){return this['items']['find'](_0x521445=>_0x521445['id']===_0x438af0);}async['updateItemTitle'](_0x1c0e74,_0x33b902){const _0x4628f9=this['getItem'](_0x1c0e74);if(!_0x4628f9)return!0x1;try{return await this['connector']['updateConversation'](_0x1c0e74,{'title':_0x33b902})['getResult'](),_0x4628f9['updateTitle'](_0x33b902),this['fire']('itemUpdated',{'itemId':_0x1c0e74,'updates':{'title':_0x33b902}}),!0x0;}catch(_0x574940){return this['fire']('error',{'error':_0x574940,'operation':'updateItemTitle','itemId':_0x1c0e74}),!0x1;}}async['updateItemPinned'](_0x46d338,_0x4dfab4){const _0x1e287f=this['getItem'](_0x46d338);if(!_0x1e287f)return!0x1;try{return await this['connector']['updateConversation'](_0x46d338,{'pinned':_0x4dfab4})['getResult'](),_0x1e287f['updatePinned'](_0x4dfab4),this['fire']('itemUpdated',{'itemId':_0x46d338,'updates':{'pinned':_0x4dfab4}}),!0x0;}catch(_0x518723){return this['fire']('error',{'error':_0x518723,'operation':'updateItemPinned','itemId':_0x46d338}),!0x1;}}['loadItems'](_0x12dd11){try{this['items']=[],_0x12dd11['map'](_0x4b49b7=>{this['addItem'](new De(_0x4b49b7));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0xf8a2f8){this['fire']('error',{'error':_0xf8a2f8,'operation':'loadItems'});}}['getItems'](_0x382120={}){const _0x427f39=void 0x0!==_0x382120['pinned']&&_0x382120['pinned'],_0x8b30d2=_0x382120['from']?new Date(_0x382120['from']['getFullYear'](),_0x382120['from']['getMonth'](),_0x382120['from']['getDate']()):null,_0x4c5dab=_0x382120['to']?new Date(_0x382120['to']['getFullYear'](),_0x382120['to']['getMonth'](),_0x382120['to']['getDate']()):null;return this['items']['filter'](_0x288673=>{if(_0x288673['pinned']!==_0x427f39)return!0x1;if(_0x4c5dab){const _0x121c15=new Date(_0x288673['createdAt']['getFullYear'](),_0x288673['createdAt']['getMonth'](),_0x288673['createdAt']['getDate']());return _0x8b30d2?_0x8b30d2['getTime']()===_0x4c5dab['getTime']()?_0x121c15['getTime']()===_0x8b30d2['getTime']():_0x121c15<_0x4c5dab&&_0x121c15>=_0x8b30d2:_0x121c15<_0x4c5dab;}return!0x0;});}}class jt extends tt{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[s,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'](s),this['_aiChatHistoryUi']=this['context']['plugins']['get'](xt),this['_aiChatController']=this['context']['plugins']['get'](et);const _0x509886=this['context']['plugins']['get'](rt),_0x378cfd=this['_aiChatController']['getGroupId']();this['history']=new Tt({'connector':this['_aiConnector'],'group':_0x378cfd}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x2b7033,_0x5003a6)=>{this['_setItemLoading'](_0x5003a6['id'],'remove'),this['_handleRemove'](_0x5003a6['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x11948b,_0xa0e44c)=>{this['_setItemLoading'](_0xa0e44c['id'],'rename'),this['_handleEditTitle'](_0xa0e44c['id'],_0xa0e44c['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x319edd,_0x9f441a)=>{void 0x0!==_0x9f441a['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x9f441a['itemId'],_0x9f441a['updates']['title']),void 0x0!==_0x9f441a['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x9f441a['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x258dc9,_0x163467)=>{this['_aiChatController']['handleRemovedConversation'](_0x163467['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x163467['itemId']),this['_clearItemLoading'](_0x163467['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x1ab744,_0x2e9ac5)=>{this['_handleHistoryErrorUI'](_0x2e9ac5['error'],_0x2e9ac5['operation'],_0x2e9ac5['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x508973,_0x39432d)=>{this['_handleSelectConversation'](_0x39432d['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x161776,_0x2ad425)=>{const _0x501596=_0x2ad425['pinned']?'pin':'unpin';this['_setItemLoading'](_0x2ad425['id'],_0x501596),this['_handleTogglePin'](_0x2ad425['id'],_0x2ad425['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x509886['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x509886['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x509886,'resizedTabs',(_0x468ca3,_0x5efacb)=>{this['_setIsMaximized'](_0x5efacb);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x509886['resize']();});}async['_handleEditTitle'](_0x12aa25,_0x3e9a4e){await this['history']['updateItemTitle'](_0x12aa25,_0x3e9a4e);}async['_handleTogglePin'](_0x5484da,_0x4db658){await this['history']['updateItemPinned'](_0x5484da,_0x4db658);}async['_handleRemove'](_0x135030){await this['history']['removeItem'](_0x135030);}async['_handleSelectConversation'](_0x148a32){await this['_aiChatController']['loadConversation'](_0x148a32);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x16f705=this['_aiChatController']['activeConversation']?.['id'],_0x38c0ca=this['_getCategorizedItems']()['map'](_0x103052=>({'title':_0x103052['title'],'items':_0x103052['items']['map'](_0xe45dfa=>({'id':_0xe45dfa['id'],'title':_0xe45dfa['title']||w(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0xe45dfa['createdAt'])['toLocaleDateString'](),'active':_0xe45dfa['id']===_0x16f705,'pinned':_0xe45dfa['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x38c0ca);}['_setItemLoading'](_0x3a6246,_0x5f4ca0){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x3a6246,_0x5f4ca0,!0x0);}['_clearItemLoading'](_0x55b860){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x55b860,null,!0x1);}['_handleHistoryErrorUI'](_0x42bded,_0xd85283,_0x16f764){const _0x50e101=this['_generateErrorMessage'](_0xd85283,_0x16f764);this['_aiChatHistoryUi']['showError'](_0x50e101),_0x16f764&&this['_clearItemLoading'](_0x16f764),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x1c7470,_0x2ad99b){const _0x2d1ea9=_0x2ad99b?this['history']['getItem'](_0x2ad99b):null,_0x4d355c=_0x2d1ea9?.['title']||w(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x1c7470){case'updateItemTitle':return w(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x4d355c);case'updateItemPinned':{const _0xa11e76=w(this['context']['locale'],_0x2d1ea9?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return w(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0xa11e76,_0x4d355c]);}case'removeItem':return w(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x4d355c);case'init':case'loadItems':return w(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return w(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x3b895b=new Date(),_0x59a5f1=new Date(_0x3b895b['getFullYear'](),_0x3b895b['getMonth'](),_0x3b895b['getDate']()),_0x32dc42=new Date(_0x59a5f1);_0x32dc42['setDate'](_0x32dc42['getDate']()-0x1);const _0x31b7a0=new Date(_0x59a5f1);_0x31b7a0['setDate'](_0x31b7a0['getDate']()-0xe);const _0x282b08=this['history']['getItems']({'pinned':!0x0}),_0x5856a1=this['history']['getItems']({'from':_0x59a5f1,'to':_0x59a5f1}),_0x1387ba=this['history']['getItems']({'from':_0x32dc42,'to':_0x32dc42}),_0x4a3303=this['history']['getItems']({'from':_0x31b7a0,'to':_0x32dc42}),_0x527c95=this['history']['getItems']({'to':_0x31b7a0}),_0x2c5939=[];return _0x282b08['length']>0x0&&_0x2c5939['push']({'title':w(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x282b08}),_0x5856a1['length']>0x0&&_0x2c5939['push']({'title':w(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x5856a1}),_0x1387ba['length']>0x0&&_0x2c5939['push']({'title':w(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x1387ba}),_0x4a3303['length']>0x0&&_0x2c5939['push']({'title':w(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x4a3303}),_0x527c95['length']>0x0&&_0x2c5939['push']({'title':w(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x527c95}),_0x2c5939;}['_setIsMaximized'](_0x133bd7){this['_aiChatHistoryUi']['setIsMaximized'](_0x133bd7);}}class at extends tt{static get['requires'](){return[jt,xt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class xa extends tt{static get['requires'](){return[et,h,it,at];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4dbff0){super(_0x4dbff0);const _0xcd7cb4=_0x4dbff0['config'];_0xcd7cb4['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),_0xcd7cb4['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:_0x4e75a9,quickActionData:_0xbae84e}){await this['context']['plugins']['get'](et)['sendMessage']({'message':_0x4e75a9,'quickActionData':_0xbae84e});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](et)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](et)['focusPromptInput']();}}class eo extends Nt{constructor(_0x2eaa9a){super(_0x2eaa9a);const _0x46dfab=_0x2eaa9a['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x46dfab,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x32e952=this['editor']['plugins']['get']('AITabs')['view'];_0x32e952['isVisible']=!_0x32e952['isVisible'];}}class bt extends _0x59916e{static get['requires'](){return[rt];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x31fda0=this['editor'];_0x31fda0['commands']['add']('toggleAi',new eo(_0x31fda0)),_0x31fda0['ui']['componentFactory']['add']('toggleAi',()=>{const _0x40e50c=this['_createAIUIButton'](_0xb98904);return _0x40e50c['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x40e50c;}),_0x31fda0['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x13e651=this['_createAIUIButton'](_0x141439);return _0x13e651['set']({'role':'menuitemcheckbox'}),_0x13e651;});}['_createAIUIButton'](_0x5cc2ea){const _0x517949=this['editor'],_0xf288a2=_0x517949['commands']['get']('toggleAi'),_0x1cc118=new _0x5cc2ea(_0x517949['locale']);return _0x1cc118['set']({'label':w(_0x517949['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':Ut,'isToggleable':!0x0}),_0x1cc118['bind']('isEnabled')['to'](_0xf288a2),_0x1cc118['bind']('isOn')['to'](_0xf288a2,'value',_0x52c47a=>!!_0x52c47a),this['listenTo'](_0x1cc118,'execute',()=>{_0xf288a2['execute']();}),_0x1cc118;}}class La extends _0x59916e{static get['requires'](){return[bt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function zt(_0x1591bb,_0x416dd6,_0x189562=!0x1,_0x372d6a=!0x0){return()=>{const _0x4cc20f=_0x1591bb['locale'],_0x125be4=new _0xb98904(_0x4cc20f),_0x573749=_0x125be4['bindTemplate'];_0x125be4['extendTemplate']({'on':{'mouseenter':_0x573749['to'](()=>{_0x125be4['focus']();})}});const _0x1edae3=_0x416dd6['icon']??_0x416dd6['parent']?.['icon'];return _0x125be4['set']({'label':_0x416dd6['displayedPrompt'],'withText':_0x189562,'role':'menuitem','icon':_0x372d6a?_0x1edae3??_0x10a3d8:void 0x0,'tooltip':!_0x189562}),_0x125be4['on']('execute',()=>{_0x1591bb['editing']['view']['focus'](),_0x1591bb['commands']['execute']('aiQuickAction',_0x416dd6);}),_0x125be4;};}const As='menu',qs='menuitem';class io extends _0x14b3a2{['_bodyCollection'];['optionsListView'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();constructor(_0x543894,_0x1d6213,_0x132dc7,_0x13462b){const _0x4ea631=_0x543894['locale'];super(_0x4ea631),this['_bodyCollection']=_0x13462b;const _0x1978c8=this['_createListItems'](_0x543894,_0x1d6213,_0x132dc7);this['optionsListView']=new _0x5d5211(_0x4ea631),this['optionsListView']['role']=As,this['optionsListView']['items']['addMany'](_0x1978c8),this['focusTracker']=new _0x49e991(),this['keystrokes']=new _0x183f1e(),this['_focusables']=_0x1978c8,this['focusCycler']=new _0x3f54b9({'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':_0x4ea631['uiLanguageDirection']},'children':[this['optionsListView']]});}['_createListItems'](_0x3e8965,_0x5059da,_0x51ad40){const _0x51b072=new _0x17ac77();return _0x5059da['forEach'](_0x25517=>{'actions'in _0x25517?_0x51b072['add'](this['_createActionGroupButton'](_0x3e8965,_0x25517,_0x51ad40)):_0x51b072['add'](this['_createActionButton'](_0x3e8965,_0x25517));}),_0x51b072;}['_createActionButton'](_0x4e38a9,_0x5c8bcf){const _0x45e7c6=new _0x17d3e0(this['locale']),_0x51309c=zt(_0x4e38a9,_0x5c8bcf,!0x0,void 0x0!==_0x5c8bcf['icon'])();return _0x45e7c6['children']['add'](_0x51309c),_0x45e7c6;}['_createActionGroupButton'](_0x25b63a,_0x131c51,_0x46e304){const _0x338360=new _0x17d3e0(this['locale']),_0x46df58=new _0x3fae24(this['locale']),_0x90eaee=_0x46df58['bindTemplate'],_0x53e383='rtl'===_0x46e304['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft',_0x4d8f62=this['_createGroupActionsList'](_0x25b63a,_0x131c51['actions'],_0x46e304);_0x46df58['set']({'label':_0x131c51['label'],'withText':!0x0,'role':qs,'icon':_0x131c51['icon']??_0x10a3d8}),_0x46df58['extendTemplate']({'on':{'mouseenter':_0x90eaee['to'](()=>{_0x46df58['focus']();})}});const _0x243286=new _0x1b1d73(this['locale']);return _0x243286['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x90eaee['to'](_0x3f2330=>{_0x3f2330['key']==_0x53e383&&(_0x46df58['focus'](),this['_hideNestedPanel'](_0x243286));})}}),_0x46df58['bind']('isOn')['to'](_0x243286,'isVisible'),this['_bodyCollection']['add'](_0x243286),_0x243286['content']['add'](_0x4d8f62),this['_setupGroupMenuBehavior'](_0x46df58,_0x243286),_0x338360['children']['add'](_0x46df58),_0x338360;}['_createGroupActionsList'](_0x47dd0b,_0x5a19bb,_0x3b4015){const _0x4dac58=new _0x5d5211(this['locale']);return _0x4dac58['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x5a19bb['forEach'](_0x20ebc7=>{const _0xefcde7=new _0x17d3e0(this['locale']),_0x515c01=zt(_0x47dd0b,_0x20ebc7,!0x0,!0x1)();_0xefcde7['children']['add'](_0x515c01),_0x3b4015['focusTracker']['add'](_0x515c01),_0x4dac58['items']['add'](_0xefcde7);}),_0x4dac58;}['_setupGroupMenuBehavior'](_0x418820,_0x5357a7){const _0x18548d=_0x418820['bindTemplate'],_0x3e3c6e='rtl'===_0x418820['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';_0x418820['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x18548d['to'](()=>{this['_showNestedPanel'](_0x5357a7,_0x418820);}),'mouseleave':_0x18548d['to'](_0x336d9f=>{const _0x2c3e95=_0x336d9f['relatedTarget'];this['_isMovingToNestedMenu'](_0x2c3e95,_0x5357a7)||this['_hideNestedPanel'](_0x5357a7);}),'keydown':_0x18548d['to'](_0x33d4d7=>{_0x33d4d7['key']==_0x3e3c6e&&(this['_showNestedPanel'](_0x5357a7,_0x418820),_0x5357a7['content']['get'](0x0)['focus']());})}}),_0x5357a7['on']('render',()=>{_0x5357a7['element']?.['addEventListener']('mouseleave',_0x38326b=>{const _0x4fdcc9=_0x38326b['relatedTarget'];_0x418820['element']?.['contains'](_0x4fdcc9)||this['_isMovingToNestedMenu'](_0x4fdcc9,_0x5357a7)||this['_hideNestedPanel'](_0x5357a7);});});}['_showNestedPanel'](_0x2b5efc,_0xd7fb68){this['_openNestedPanels']['forEach'](_0x461f48=>{_0x461f48!==_0x2b5efc&&_0x461f48['isVisible']&&_0x461f48['hide']();}),_0x2b5efc['show'](),_0x2b5efc['pin']({'positions':[_0x1ea5d9['eastSouth']],'target':_0xd7fb68['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x2b5efc);}['_hideNestedPanel'](_0x20dde1){_0x20dde1['hide'](),this['_openNestedPanels']['delete'](_0x20dde1);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x5d15a6=>_0x5d15a6['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x29ba52,_0x3e16ed){if(!_0x29ba52)return!0x1;if(_0x3e16ed['element']?.['contains'](_0x29ba52))return!0x0;const _0x410d2c=_0x29ba52;return _0x410d2c['closest']&&(null!==_0x410d2c['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x410d2c['closest']('.ck-ai-quick-actions-group-list')||null!==_0x410d2c['closest']('.ck-ai-quick-actions-group-button'));}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['optionsListView']['focus']();}}function Ft(_0x56789a,_0x18d9ed,_0x2cb586,_0x5d448a){return()=>{const _0x2e95cd=_0x56789a['locale'],_0x4339b6=_0x19bf5c(_0x2e95cd);_0x4339b6['buttonView']['set']({'icon':_0x2cb586['icon']??_0x10a3d8,'label':_0x2cb586['label'],'tooltip':!0x0}),_0x4339b6['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x8a7518=new io(_0x56789a,_0x18d9ed,_0x4339b6,_0x5d448a);return _0x4339b6['panelView']['children']['add'](_0x8a7518),_0x4339b6;};}const Vt='<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>',Xt='<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>',Zt='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20extract\x20and\x20present\x20the\x20key\x20points\x20from\x20its\x20content.</task><rules>1.\x20Present\x20the\x20output\x20as\x20a\x20clear,\x20structured\x20list\x20(bullets\x20or\x20numbered).-\x20Each\x20point\x20should\x20be\x20concise\x20(one\x20sentence\x20or\x20less).-\x20Do\x20not\x20merge\x20distinct\x20ideas\x20into\x20one\x20bullet.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20extraction\x20style:-\x20If\x20it\x20is\x20descriptive\x20capture\x20the\x20main\x20attributes\x20or\x20features.-\x20If\x20it\x20is\x20argumentative\x20extract\x20the\x20main\x20claim\x20and\x20supporting\x20reasons\x20separately.-\x20If\x20it\x20is\x20narrative/story-like\x20extract\x20the\x20main\x20events\x20in\x20chronological\x20order.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20highlight\x20the\x20most\x20important\x20facts\x20or\x20numbers.-\x20If\x20it\x20is\x20instructional\x20list\x20the\x20steps\x20or\x20main\x20actions\x20in\x20simplified\x20form.-\x20If\x20it\x20provides\x20comparisons\x20extract\x20the\x20contrasted\x20items\x20and\x20their\x20differences/similarities.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20category\x20above\x20extract\x20the\x20main\x20ideas\x20in\x20plain,\x20short\x20statements.3.\x20Keep\x20the\x20list\x20between\x203–7\x20items\x20where\x20possible.-\x20If\x20the\x20text\x20is\x20very\x20short,\x20fewer\x20items\x20are\x20fine.-\x20If\x20it\x20is\x20very\x20long,\x20focus\x20on\x20the\x20most\x20important\x20ideas\x20only.4.\x20Do\x20not\x20copy\x20long\x20text\x20fragments\x20—\x20restate\x20in\x20simple\x20words.5.\x20Do\x20not\x20add\x20interpretation,\x20evaluation,\x20or\x20commentary\x20beyond\x20the\x20text.6.\x20Ensure\x20the\x20list\x20can\x20stand\x20alone\x20without\x20requiring\x20the\x20reader\x20to\x20see\x20the\x20original\x20document.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20key\x20points.8.\x20Your\x20key\x20points\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20extracted\x20key\x20points.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>';var Ot=function(_0xd086d4){return _0xd086d4['CHAT']='CHAT',_0xd086d4['ACTION']='ACTION',_0xd086d4['REVIEW']='REVIEW',_0xd086d4;}({}),Pa=function(_0x39c5e2){return _0x39c5e2['CHAT']='AIChat',_0x39c5e2['ACTION']='AIActions',_0x39c5e2['REVIEW']='AIReviewMode',_0x39c5e2;}({});class ri extends _0x59916e{static get['requires'](){return[Jt];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_prepareQuickActionsDefinition'](this['_getDefaultAndCustomActions']()),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x387634){return function(_0xbcd139){const _0x37990a=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0xbcd139['uiLanguage']),_0x4c7b36=_0x37990a||'English',_0x50d9ed=[{'id':'ask-ai','displayedPrompt':w(_0xbcd139,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Ut},{'id':'chat-commands','label':w(_0xbcd139,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Mt,'actions':[{'id':'explain','displayedPrompt':w(_0xbcd139,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Vt['replace']('%0',_0x4c7b36),'type':'CHAT'},{'id':'summarize','displayedPrompt':w(_0xbcd139,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Xt['replace']('%0',_0x4c7b36),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':w(_0xbcd139,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Zt['replace']('%0',_0x4c7b36),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':w(_0xbcd139,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Yt},{'id':'continue','displayedPrompt':w(_0xbcd139,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Lt},{'id':'fix-grammar','displayedPrompt':w(_0xbcd139,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Dt},{'id':'adjust-length','label':w(_0xbcd139,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Qt,'actions':[{'id':'make-shorter','displayedPrompt':w(_0xbcd139,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':w(_0xbcd139,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':w(_0xbcd139,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Kt,'actions':[{'id':'make-tone-casual','displayedPrompt':w(_0xbcd139,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':w(_0xbcd139,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':w(_0xbcd139,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':w(_0xbcd139,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':w(_0xbcd139,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':w(_0xbcd139,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Gt,'actions':[{'id':'translate-to-english','displayedPrompt':w(_0xbcd139,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':w(_0xbcd139,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':w(_0xbcd139,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':w(_0xbcd139,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':w(_0xbcd139,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':w(_0xbcd139,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':w(_0xbcd139,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':w(_0xbcd139,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':w(_0xbcd139,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':w(_0xbcd139,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':w(_0xbcd139,'AI_QUICK_ACTIONS_OTHER'),'icon':qt,'actions':[]}];return _0x50d9ed;}(_0x387634);}['_getDefaultAndCustomActions'](){const _0x1c4c70=ri['getDefaultQuickActions'](this['editor']['locale']),_0x4e65d1=(this['editor']['config']['get']('ai.quickActions.extraCommands')||[])['map'](_0x34c917=>({..._0x34c917,'icon':void 0x0}));return _0x1c4c70['find'](_0x70e50a=>'other'===_0x70e50a['id'])['actions']['push'](..._0x4e65d1),_0x1c4c70;}['_initializeQuickActionsComponentsAndCommands'](){const _0xc8965e=new Wt(this['editor']['locale']);_0xc8965e['attachToDom'](),this['_initializeQuickActionsDropdown'](_0xc8965e),this['_initializeQuickActionsComponents'](_0xc8965e);}['_initializeQuickActionsDropdown'](_0x2311c3){this['editor']['ui']['componentFactory']['add']('aiQuickActions',Ft(this['editor'],this['_quickActionsDefinition'],{'icon':_0x10a3d8,'label':w(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},_0x2311c3));}['_prepareQuickActionsDefinition'](_0x1c0de6){this['_quickActionsDefinition']=_0x1c0de6['map'](_0xc900aa=>{if('actions'in _0xc900aa){const _0x5caddf=_0xc900aa;return{..._0x5caddf,'actions':_0x5caddf['actions']['map'](_0x25ebc7=>{const {actions:_0x4acc25,..._0x22f760}=_0x5caddf;return{..._0x25ebc7,'parent':_0x22f760};})['filter'](_0x1f458e=>this['_shouldIncludeAction'](_0x1f458e))};}return _0xc900aa;})['filter'](_0x1ee27c=>'actions'in _0x1ee27c?_0x1ee27c['actions']['length']>0x0:this['_shouldIncludeAction'](_0x1ee27c));}['_shouldIncludeAction'](_0x43bda6){const _0xe93f7e=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Pa[_0x43bda6['type']])&&!_0xe93f7e['includes'](_0x43bda6['id']);}['_initializeQuickActionsComponents'](_0x6597cc){this['_quickActionsDefinition']['forEach'](_0x2eb320=>{if('actions'in _0x2eb320){const _0x4ba2bc=Ft(this['editor'],_0x2eb320['actions'],_0x2eb320,_0x6597cc);this['editor']['ui']['componentFactory']['add'](_0x2eb320['id'],_0x4ba2bc),_0x2eb320['actions']['forEach'](_0x37a948=>{const _0x6a8e1c=zt(this['editor'],_0x37a948);this['editor']['ui']['componentFactory']['add'](_0x37a948['id'],_0x6a8e1c);});}else{const _0x2d722d=zt(this['editor'],_0x2eb320);this['editor']['ui']['componentFactory']['add'](_0x2eb320['id'],_0x2d722d);}});}}class ni extends Nt{['execute'](_0xb5fd40){switch(_0xb5fd40['type']){case Ot['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x5db678=w(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x5e86d1('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5db678});}this['_handleAIChatAction'](_0xb5fd40);break;case Ot['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x3958e5=w(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x5e86d1('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x3958e5});}this['_handleAIActionsAction'](_0xb5fd40);break;case Ot['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x2d7099=w(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x5e86d1('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x2d7099});}this['_handleAIReviewAction'](_0xb5fd40);}}async['_handleAIChatAction'](_0x3d09d8){const _0x48e25f=this['editor']['plugins']['get']('AIChat'),_0x53464c=this['editor']['plugins']['get']('AIChatController');if(this['editor']['plugins']['get']('AITabs')['view']['activateTab']('chat'),'ask-ai'===_0x3d09d8['id'])_0x53464c['removeSelectionFromChatContext'](),this['_expandSelectionIfCollapsed'](),await _0x48e25f['addSelectionToChatContext'](),_0x48e25f['focusPromptInput']();else await _0x48e25f['startConversation'](),await _0x48e25f['addSelectionToChatContext'](),await _0x48e25f['sendMessage']({'message':_0x3d09d8['prompt']||_0x3d09d8['displayedPrompt'],'quickActionData':{'id':_0x3d09d8['id'],'displayedPrompt':_0x3d09d8['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x3ee13b=this['editor'],_0xa3eec3=_0x3ee13b['model']['document']['selection'];if(!_0xa3eec3['isCollapsed'])return;const _0x48e09b=_0x53efcd(_0xa3eec3['getSelectedBlocks']())||_0x3ee13b['model']['schema']['getLimitElement'](_0xa3eec3);_0x3ee13b['model']['change'](_0x429c4f=>{_0x429c4f['setSelection'](_0x48e09b,'in');});}['_handleAIActionsActionLabel'](_0x599ad0){return _0x599ad0['parent']?.['label']&&'other'!==_0x599ad0['parent']?.['id']?_0x599ad0['parent']['label']+':\x20'+_0x599ad0['displayedPrompt']:_0x599ad0['displayedPrompt'];}async['_handleAIActionsAction'](_0x1ff624){const _0x16a318=this['editor']['plugins']['get']('AIActions'),_0x37be13=_0x1ff624['prompt']?{'userMessage':_0x1ff624['prompt'],'model':_0x1ff624['model']}:{'actionName':_0x1ff624['actionName']||_0x1ff624['id'],'args':_0x1ff624['args']},_0x44fe08=this['_handleAIActionsActionLabel'](_0x1ff624);await _0x16a318['executeAction'](_0x37be13,_0x44fe08,_0x1ff624['icon']);}async['_handleAIReviewAction'](_0x3bfc29){console['log']('handleAIReviewAction',_0x3bfc29);}}class ci extends _0x59916e{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0xf6123d=this['editor'],_0x7391c0=new ni(this['editor']);if(_0xf6123d['commands']['add']('aiQuickAction',_0x7391c0),_0xf6123d['plugins']['has']('AIChat')){const _0xdc79d9=this['editor']['plugins']['get']('AIChat');_0xf6123d['model']['document']['selection']['on']('change:range',(_0x564197,_0x2493cd)=>{_0x2493cd['directChange']&&_0xdc79d9['removeSelectionFromChatContext']();});}}}class Ha extends _0x59916e{static get['requires'](){return[ri,ci];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x10459e){super(_0x10459e),_0x10459e['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[]});}}class pe extends fe{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x2f04f0=this['documentContextContent']['children']['map'](_0x42451e=>({'node':_0x42451e,'id':ft(_0x42451e,'data-id')})),_0x30f325=this['parsedMergedContent']['children']['map'](_0x306c7d=>({'node':_0x306c7d,'id':ft(_0x306c7d,'data-id')||_0x10e5dc()})),_0x284be0=_0x4b4a86(_0x2f04f0,_0x30f325,{'comparator':(_0x430eae,_0x2d2240)=>_0x430eae['id']==_0x2d2240['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x284be0['length']&&_0x284be0[_0x284be0['length']-0x1]['removed'];)_0x284be0['pop']();}const _0x49213e=_0x284be0['map'](_0x2deb1f=>{const _0x5b9d21=_0x2deb1f['added']?'new':_0x2deb1f['removed']?'removed':'modified';return{'node':_0x2deb1f['value'][0x0]['node'],'type':_0x5b9d21,'id':_0x2deb1f['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x49213e,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x5a9e54,_0x3c2f78){return _0x3c2f78;}}class c extends me{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x223c3c){super(_0x223c3c),this['content']=_0x223c3c['content'],this['version']=_0x223c3c['version'],this['actionName']=_0x223c3c['actionName'],this['args']=_0x223c3c['args'],this['userMessage']=_0x223c3c['userMessage'],this['model']=_0x223c3c['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':de['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x28cf7b){const _0x4bbcee=new pe({'editor':this['editor'],'documentContextContent':this['content'],..._0x28cf7b});return this['replies']['push'](_0x4bbcee),_0x4bbcee['delegate'](...ue)['to'](this),this['fire']('replyCreated',_0x4bbcee),_0x4bbcee;}}class Da extends _0x59916e{static get['requires'](){return[s,_0x54639c,h,f,_0x436d15];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_customViews']=new _0x17ac77();['_navigationPreviousButton'];['_navigationCounter'];['_isNavigationCounterInView']=!0x1;['_navigationNextButton'];['_isNavigationPreviousButtonInView']=!0x1;['_isNavigationNextButtonInView']=!0x1;['_promiseQueue'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}constructor(_0x5a2b07){super(_0x5a2b07),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new _(),this['_setupCustomViews']();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x698bea,_0x545ed7,_0x37c9f6){if(this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x3a6c82,anchorData:_0x3ac6f1}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x698bea,_0x3a6c82,_0x3ac6f1,_0x545ed7,_0x37c9f6);}}const {modelFragment:_0x5c8022,anchorData:_0x1b8b54}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x698bea,_0x5c8022,_0x1b8b54,_0x545ed7,_0x37c9f6);}['_getExecuteDataRegular'](){const _0xf6a859=this['editor']['model']['document']['selection'];if(_0xf6a859['isCollapsed']){const _0x672c0d=_0x53efcd(_0xf6a859['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0xf6a859);this['editor']['model']['change'](_0x4e0b1e=>{_0x4e0b1e['setSelection'](_0x672c0d,'in');});}const _0xdfda4=_0xf6a859['getFirstRange'](),_0x286f37=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0xf6a859),_0xdfda4['start'],_0xdfda4['end']),_0x55f256=_0xf6a859['getFirstRange']()['start'],_0x20e474=new Map();let _0x527fc2=_0x286f37;for(let _0x139e4d=0x0;_0x139e4d<_0x55f256['path']['length'];_0x139e4d++)_0x20e474['set'](_0x527fc2,_0x55f256['path'][_0x139e4d]),_0x527fc2=_0x527fc2['getChild'](0x0);return{'modelFragment':_0x286f37,'anchorData':_0x20e474};}['_getExecuteDataInTable'](){const _0x257fdc=this['editor']['model']['document']['selection'],_0x4498ed=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x2e4957=_0x257fdc['getFirstRange']()['start']['parent']['parent'],_0x50f2c0=this['_wrapWithCommonAncestors'](_0x4498ed,this['editor']['model']['createPositionBefore'](_0x2e4957),this['editor']['model']['createPositionAfter'](_0x2e4957)),_0x31e59f=_0x257fdc['getFirstRange']()['start'],_0x62e85=new Map();let _0x4c37cb=_0x50f2c0;for(let _0x52767f=0x0;_0x52767f<_0x31e59f['path']['length'];_0x52767f++)if(_0x62e85['set'](_0x4c37cb,_0x31e59f['path'][_0x52767f]),_0x52767f<_0x31e59f['path']['length']-0x1)_0x4c37cb=_0x4c37cb['getChild'](0x0);else{let _0x21f7c5=_0x4c37cb['nextSibling'];for(;_0x21f7c5;)_0x62e85['set'](_0x21f7c5,_0x31e59f['path'][_0x52767f]),_0x21f7c5=_0x21f7c5['nextSibling'];}return{'modelFragment':_0x50f2c0,'anchorData':_0x62e85};}['_executeAction'](_0x46ef3f,_0x5455c2,_0x5ed1f2,_0x3f365c,_0x27647b){const _0x3e6f61=this['editor']['plugins']['get'](h),_0x2df3d4=this['editor']['plugins']['get'](f),_0x4d1359=this['editor']['model']['document']['selection'],_0xf12e46=_0x3e6f61['modelToViewWithIds'](_0x5455c2),_0x197daa=this['editor']['data']['processor']['toData'](_0xf12e46),_0x132441=this['editor']['model']['document']['version'],_0x5733b4=[..._0x4d1359['getRanges']()],_0x26a0e9=new e(this['editor']['locale'],{'showDiff':!0x1,'areActionsDisabled':!0x1,'hideHeader':!0x0,'showLoader':!0x0,'miniToolbarConfig':{'showChanges':'icon','customView':this['_customViews']},'showUnchangedParts':!0x0});return _0x2df3d4['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x3f365c,'icon':_0x27647b||_0x10a3d8,'mainView':_0x26a0e9,'showRotator':!0x1,'showApplyButton':!0x0,'showSuggestButton':!0x0,'ranges':_0x5733b4}),this['_setLoadingState'](_0x26a0e9,_0x2df3d4),this['listenTo'](_0x2df3d4,'applySuggestion',()=>{this['_applyChanges'](_0x5455c2,_0x5ed1f2,!0x1);}),this['listenTo'](_0x2df3d4,'insertSuggestion',()=>{this['_applyChanges'](_0x5455c2,_0x5ed1f2,!0x0);}),this['listenTo'](_0x2df3d4,'dialogClosed',()=>{if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x322584=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x46112d=_0x322584['changeGroups'][0x0];_0x46112d&&'pending'===_0x46112d['state']&&_0x322584['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](_0x2df3d4);}),this['_createInteraction'](_0x197daa,_0x132441,_0x26a0e9,_0x2df3d4,_0x46ef3f);}['_wrapWithCommonAncestors'](_0x4f2c81,_0x56b7a0,_0x17794b){const _0x3af63b=this['editor']['model']['createRange'](_0x56b7a0,_0x17794b)['getCommonAncestor'](),_0x10392a=_0x3af63b['is']('documentFragment')?[]:_0x3af63b['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x10392a['length']){const _0x1840f7=_0x10392a['map'](_0x4dd500=>_0x4dd500['_clone'](!0x1));for(let _0x307887=0x1;_0x307887<_0x1840f7['length'];_0x307887++)_0x1840f7[_0x307887-0x1]['_appendChild'](_0x1840f7[_0x307887]);return _0x1840f7[_0x1840f7['length']-0x1]['_appendChild'](_0x4f2c81),new _0x5acb07(_0x1840f7[0x0]);}return _0x4f2c81;}async['_createInteraction'](_0x2d7d5f,_0x14ae50,_0x3a326c,_0x9d6b19,_0x5d7bd9){const _0x3aa6c4=this['editor'];this['_interactionParams']={'action':_0x5d7bd9,'content':_0x2d7d5f,'version':_0x14ae50,'mainView':_0x3a326c,'aiBalloon':_0x9d6b19};const _0x4a7481=new c({'connector':this['_aiConnector'],'editor':_0x3aa6c4,'content':_0x2d7d5f,'version':_0x14ae50,..._0x5d7bd9});this['_interactions']['push'](_0x4a7481),_0x3a326c['hideError']();const _0x4aa5d9=(_0x5d0f0d,_0x7f9787,_0x223eeb=!0x1,_0x1d1923='streaming')=>this['_promiseQueue']['enqueue'](async _0x9f44aa=>{try{const _0x3e081e=y({'editor':_0x3aa6c4,'changeGroups':_0x5d0f0d['changeGroups'],'documentContextContent':_0x5d0f0d['documentContextContent'],'showDiff':_0x223eeb,'trimUnchanged':!0x1});await _0x7f9787['updateContent']({'parts':_0x3e081e,'renderingStrategy':_0x1d1923,'abortSignal':_0x9f44aa});}catch(_0x30cfef){if(this['_isAbortError'](_0x30cfef))return;throw _0x30cfef;}});this['_interaction']['on']('replyCreated',(_0x5cfbaa,_0x3fe380)=>{_0x3a326c['hideLoader'](),_0x4aa5d9(_0x3fe380,_0x3a326c)['catch'](_0x40d489=>{this['_isAbortError'](_0x40d489)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x40d489),this['_setErrorState'](_0x4a7481,_0x3a326c));});}),this['_interaction']['on']('replyContentUpdated',(_0x1f4297,_0xece636)=>{_0x4aa5d9(_0xece636,_0x3a326c)['catch'](_0xb7c166=>{this['_isAbortError'](_0xb7c166)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0xb7c166),this['_setErrorState'](_0x4a7481,_0x3a326c));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](_0x3a326c,_0x9d6b19),this['_updateNavigationUI']();}catch(_0x48d210){this['_isAbortError'](_0x48d210)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x48d210),this['_setErrorState'](_0x4a7481,_0x3a326c));}}),this['listenTo'](_0x3a326c,'toggleSuggestionDisplayMode',(_0x3ac2fc,{showDiff:_0x11b3d3})=>{this['_balloonShowDiff']=_0x11b3d3;const _0x37c739=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x37c739&&_0x4aa5d9(_0x37c739,_0x3a326c,_0x11b3d3,'static')['catch'](_0x4be000=>{this['_isAbortError'](_0x4be000)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x4be000),this['_setErrorState'](_0x4a7481,_0x3a326c));});}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x3f4254,{reply:_0x4339d7})=>{const _0x164e0c={'positiveCount':_0x4339d7['changeGroups']['filter'](_0x253b7f=>'accepted'===_0x253b7f['state'])['length'],'totalCount':_0x4339d7['changeGroups']['length']},_0x20fa5f=this['_interaction']['actionCallId'],_0x51695f=this['_interaction']['actionName'];_0x51695f?this['_aiConnector']['upsertAIActionRating'](_0x51695f,_0x20fa5f,_0x164e0c):this['_aiConnector']['upsertCustomAIActionRating'](_0x20fa5f,_0x164e0c);}),this['_setLoadingState'](_0x3a326c,_0x9d6b19);try{const _0x41dd6c=await this['_interaction']['start']();return this['_updateNavigationUI'](),_0x41dd6c;}catch(_0x1b36cd){if(this['_isAbortError'](_0x1b36cd))return;_0x3a326c['hideLoader'](),this['_setErrorState'](_0x4a7481,_0x3a326c);}}['_applyChanges'](_0x190bbc,_0x41879a,_0x31ecae){const _0xf9b4cb=this['editor'],_0x5bb2f2=this['editor']['plugins']['get'](_0x436d15),_0xe7e53c=this['_interaction'],_0x1d4ea3=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x2c1dbf=_0x1d4ea3['changeGroups'];_0x1d4ea3['setChangeGroupState'](0x0,'accepted');let _0xb92e0=I({'editor':_0xf9b4cb,'reply':_0x1d4ea3,'interaction':_0xe7e53c,'groups':_0x2c1dbf,'transform':!0x1,'documentCompare':_0x5bb2f2,'documentCompareOptions':{'anchor':_0xf9b4cb['model']['createPositionAt'](_0x190bbc,0x0),'markDeletions':_0x31ecae}});_0xb92e0=this['_filterOperationsOutsideRange'](_0xb92e0,_0x41879a);for(const _0x545375 of _0xb92e0)this['_anchorOperation'](_0x41879a,_0x545375,_0xf9b4cb['model']['document']['getRoot']());const _0x2877a4=_0xe7e53c['getDocumentContext']()['version'],_0x148027=_0xf9b4cb['model']['document']['history']['getOperations'](_0x2877a4),_0x2f7c5a={'document':_0xf9b4cb['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x20f71c=_0x45cebc(_0xb92e0,_0x148027,_0x2f7c5a)['operationsA'];_0xf9b4cb['model']['change'](_0x432636=>{if(_0x432636['setSelection'](_0xf9b4cb['model']['document']['selection']['focus']),_0x31ecae)_0xf9b4cb['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x20f71c);else{for(const _0x543d2f of _0x20f71c)_0x543d2f['baseVersion']=_0xf9b4cb['model']['document']['version'],_0x432636['batch']['addOperation'](_0x543d2f),_0xf9b4cb['model']['applyOperation'](_0x543d2f);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x18a1e4,_0x4712a6){return _0x18a1e4['filter'](_0x337843=>{if('rename'==_0x337843['type']){const _0x3b5629=_0x337843['position']['nodeAfter'];return!_0x4712a6['has'](_0x3b5629);}if(_0x337843['type']['indexOf']('Attribute')>-0x1){const _0x4c5b0a=_0x337843['range']['start']['nodeAfter'];return!_0x4712a6['has'](_0x4c5b0a);}return!0x0;});}['_anchorOperation'](_0x1300ce,_0x4627a9,_0x3d8561){const _0x4827d1=_0x4627a9['clone']();for(const _0x1e2602 in _0x4627a9){const _0x65198b=_0x4627a9[_0x1e2602];_0x65198b instanceof _0x154493?_0x4627a9[_0x1e2602]=new _0x154493(_0x59f9c5(_0x65198b['start']),_0x59f9c5(_0x65198b['end'])):_0x65198b instanceof _0x272e84&&(_0x4627a9[_0x1e2602]=_0x59f9c5(_0x65198b));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x4827d1['type'])){if(_0x4827d1['isDocumentOperation']=!0x1,_0x4827d1['baseVersion']=null,'remove'==_0x4827d1['type']){const _0x2ea255=_0x4827d1['sourcePosition'],_0x2cc72d=_0x4827d1['howMany'];new _0x289d3b(_0x2ea255,_0x2cc72d)['_execute']();}else _0x4827d1['_execute']();}function _0x59f9c5(_0x5c8c6e){if('$graveyard'==_0x5c8c6e['root']['rootName'])return _0x5c8c6e;const _0x37b49f=[];let _0x592b8b=_0x5c8c6e['root'];for(let _0x25d505=0x0;_0x25d505<_0x5c8c6e['path']['length'];_0x25d505++){const _0x4957f2=_0x1300ce['get'](_0x592b8b)||0x0;_0x37b49f[_0x25d505]=_0x5c8c6e['path'][_0x25d505]+_0x4957f2,_0x592b8b=_0x592b8b['getChildAtOffset'](_0x5c8c6e['path'][_0x25d505]);}return new _0x272e84(_0x3d8561,_0x37b49f,_0x5c8c6e['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x561cea,content:_0x93ea58,version:_0x3a18e7,mainView:_0x92e3b0,aiBalloon:_0xc6e4e5}=this['_interactionParams'];_0x92e3b0['areChangesVisible']=!0x1,_0x92e3b0['hideError'](),this['_clearErrorState'](_0x92e3b0,_0xc6e4e5);const _0x3bab6e=_0x92e3b0;_0x3bab6e['miniToolbarView']&&_0x3bab6e['miniToolbarView']['showChangesButton']&&_0x3bab6e['miniToolbarView']['showChangesButton']['set']({'isOn':!0x1,'icon':_0x14b360}),this['_clearSuggestionContent'](_0x92e3b0),_0x92e3b0['showLoader'](),this['_updateNavigationUI'](),this['_createInteraction'](_0x93ea58,_0x3a18e7,_0x92e3b0,_0xc6e4e5,_0x561cea)['catch'](_0x3d0d71=>{this['_isAbortError'](_0x3d0d71)||console['error']('Error\x20refreshing\x20interaction:',_0x3d0d71);});}['_clearSuggestionContent'](_0x3104df){const _0x298dfe=_0x3104df['bodyView']['_children'];for(;_0x298dfe['length']>0x0;)_0x298dfe['remove'](_0x298dfe['first']);_0x3104df['bodyView']['hasPendingParts']=!0x1;}['_isAbortError'](_0x437c2f){return!!_0x437c2f['message']&&_0x437c2f['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_updateNavigationUI']();}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1;}['_setupCustomViews'](){const _0x1c05fa=new _0xb98904(this['editor']['locale']),_0x3aac3d=new _0xb98904(this['editor']['locale']),_0x2eb9f9=new _0x14b3a2(this['editor']['locale']),_0x452407=new _0xb98904(this['editor']['locale']);_0x1c05fa['set']({'icon':_0x35a82c,'label':w(this['editor']['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x3aac3d['set']({'icon':_0x5d3e17,'tooltip':w(this['editor']['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x2eb9f9['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':['1/1']}),_0x452407['set']({'icon':_0x806106,'tooltip':w(this['editor']['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x1c05fa['bind']('isEnabled')['to'](this,'isBusy',_0x422221=>!_0x422221),_0x1c05fa['on']('execute',()=>{this['_refreshInteraction']();}),_0x3aac3d['bind']('isEnabled')['to'](this,'isBusy',_0x587bb3=>!_0x587bb3),_0x3aac3d['on']('execute',()=>{this['_navigateToPrevious']();}),_0x452407['bind']('isEnabled')['to'](this,'isBusy',_0x4b8398=>!_0x4b8398),_0x452407['on']('execute',()=>{this['_navigateToNext']();}),this['_navigationPreviousButton']=_0x3aac3d,this['_navigationCounter']=_0x2eb9f9,this['_navigationNextButton']=_0x452407,this['_customViews']['add'](_0x1c05fa);}['_navigateToPrevious'](){const _0x28bd4d=this['_interactions']['length'];this['_currentInteractionIndex']<_0x28bd4d-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x182b78){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x182b78;const {mainView:_0x5d0b3a}=this['_interactionParams'],_0x11d8a6=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x11d8a6)return;if(_0x11d8a6['hasError'])return this['_setErrorState'](_0x11d8a6,_0x5d0b3a),void this['_updateNavigationUI']();if(!_0x11d8a6['replies']['length'])return;_0x5d0b3a['hideError'](),this['_interactionParams']&&this['_clearErrorState'](_0x5d0b3a,this['_interactionParams']['aiBalloon']);const _0x3b0891=_0x11d8a6['replies'][_0x11d8a6['replies']['length']-0x1];if(_0x3b0891){const _0x4dd0a0=this['editor'];this['_clearSuggestionContent'](_0x5d0b3a);try{const _0x1a868c=y({'editor':_0x4dd0a0,'changeGroups':_0x3b0891['changeGroups'],'documentContextContent':_0x3b0891['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});this['_clearSuggestionContent'](_0x5d0b3a),await new Promise(_0x152815=>setTimeout(_0x152815,0x32)),await _0x5d0b3a['updateContent']({'parts':_0x1a868c,'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x27aca4){this['_isAbortError'](_0x27aca4)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x27aca4);}}this['_updateNavigationUI']();}['_updateNavigationUI'](){if(!this['_navigationPreviousButton']||!this['_navigationCounter']||!this['_navigationNextButton'])return;const _0x3d6dd1=this['_interactions']['length'],_0x2d1455=_0x3d6dd1>0x1,_0x2ef6e8=this['_interactionParams']?.['mainView'];if(_0x2d1455){this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView']||(this['_customViews']['add'](this['_navigationPreviousButton']),_0x2ef6e8?.['addNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x0,this['_customViews']['add'](this['_navigationCounter']),_0x2ef6e8?.['addNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x0,this['_customViews']['add'](this['_navigationNextButton']),_0x2ef6e8?.['addNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x0);const _0x2893dd=_0x3d6dd1-this['_currentInteractionIndex'];this['_navigationCounter']['element']&&(this['_navigationCounter']['element']['textContent']=_0x2893dd+'/'+_0x3d6dd1),this['_navigationPreviousButton']['isEnabled']=this['_currentInteractionIndex']<_0x3d6dd1-0x1,this['_navigationNextButton']['isEnabled']=this['_currentInteractionIndex']>0x0;}else(this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView'])&&(this['_customViews']['remove'](this['_navigationPreviousButton']),_0x2ef6e8?.['removeNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x1,this['_customViews']['remove'](this['_navigationCounter']),_0x2ef6e8?.['removeNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x1,this['_customViews']['remove'](this['_navigationNextButton']),_0x2ef6e8?.['removeNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x1);}['_setLoadingState'](_0x3c3221,_0x423992){_0x3c3221['setLoading'](),_0x423992['balloonView']['setLoading'](),this['isBusy']=!0x0;}async['_setErrorState'](_0x45c94e,_0xc6fe37){const _0x21bf69=w(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');_0xc6fe37['showError'](_0x21bf69),_0x45c94e['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],_0xc6fe37['setErrorState'](),this['_interactionParams']?.['aiBalloon']['balloonView']['toolbar']&&(this['_interactionParams']['aiBalloon']['balloonView']['toolbar']['isLoading']=!0x0);}['_clearErrorState'](_0x49041a,_0x15308d){_0x49041a['clearErrorState'](),_0x15308d['balloonView']['toolbar']&&(_0x15308d['balloonView']['toolbar']['isLoading']=!0x1);}async['_clearLoadingState'](_0x5ded9a,_0x148c51){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,_0x5ded9a['clearLoading'](),_0x148c51['balloonView']['clearLoading']();}}class Fs{['id'];['title'];['description'];['isParameterized'];['useArgs'];['options'];constructor({id:_0x582227,title:_0x305604,description:_0x410a00,isParameterized:_0x110470,useArgs:_0x4b4f35,options:_0x3566d6}){this['id']=_0x582227,this['title']=_0x305604,this['description']=_0x410a00,this['isParameterized']=_0x110470,this['useArgs']=_0x4b4f35,this['options']=_0x3566d6;}}class kr extends Fs{['_models']=[];get['models'](){return this['_models'];}set['models'](_0x4d64bc){this['_models']=_0x4d64bc;}}class ai extends ts(){['_checks'];constructor(_0x2779fe){super(),this['_checks']=this['_mapCheckDefinitions'](_0x2779fe);}get['checks'](){return this['_checks'];}['getCheckById'](_0x2b829e){return this['checks']['find'](_0xaceada=>_0xaceada['id']===_0x2b829e);}['_mapCheckDefinitions'](_0x2b9e7b){return _0x2b9e7b['map'](_0x290ba0=>'custom'===_0x290ba0['id']?new kr(_0x290ba0):new Fs(_0x290ba0));}}class Ns extends _0x106985(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x6d0346,contentNew:_0x492fe4,contentInitial:_0x386f2a,documentVersion:_0x1eb33d}){super(),this['id']=_0x6d0346,this['contentNew']=_0x492fe4,this['contentInitial']=_0x386f2a,this['documentVersion']=_0x1eb33d;}}class $s extends ts(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x2267f4,_0x4a141b,_0x239edb){super(),this['id']=_0x2267f4,this['parent']=_0x239edb,this['_data']=_0x4a141b,this['set']('isActivated',!0x1),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 ts(){['id']=_0x10e5dc();['_results']=new Map();['_changes']=[];['_documentData'];['_sourceCheck'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['callId'];constructor(_0x5526ff,_0x36c6db,_0x42f5ba,_0x4605e8,_0x47ecd8){super(),this['_documentData']=_0x5526ff,this['_sourceCheck']=_0x36c6db,this['_aiConnector']=_0x42f5ba,this['_reviewParams']=_0x4605e8,this['_reviewArgs']=_0x47ecd8,this['on']('change:status',(_0x45e2f3,_0x417a4b,_0x2a400e)=>{this['fire']('reviewCheckRunUpdated',{'status':_0x2a400e,'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 _0x46b542=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x28d0f4 of _0x46b542)'unmodified'!==_0x28d0f4['data']['operation']&&('error'!==_0x28d0f4['data']['operation']?'review-metadata'!==_0x28d0f4['event']?this['_addReviewCheckResult'](_0x28d0f4['data']['dataId'],_0x28d0f4['data']['textDelta']):this['callId']=_0x28d0f4['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']?this['status']='unmodified':this['status']='ready');}catch(_0x34d2f0){this['_currentError']=_0x34d2f0,_0x34d2f0 instanceof Error&&_0x34d2f0['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'](_0x3a7349,_0x171fd9){const _0x1b6203=this['_results']['get'](_0x3a7349);if(!_0x1b6203)return;const _0x447b21=[];_0x171fd9['forEach']((_0x264836,_0x1c9088)=>{const _0x112c8a=new $s(_0x1b6203['id']+'-'+_0x1c9088,_0x264836,_0x1b6203);_0x112c8a['on']('change:status',()=>{'accepted'===_0x112c8a['status']?this['fire']('reviewCheckResultAccepted',{'change':_0x112c8a}):'rejected'===_0x112c8a['status']&&this['fire']('reviewCheckResultRejected',{'change':_0x112c8a});}),_0x112c8a['on']('change:isActivated',()=>{_0x112c8a['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x112c8a}):this['fire']('reviewCheckResultDeactivated',{'change':_0x112c8a});}),this['_changes']['push'](_0x112c8a),_0x447b21['push'](_0x112c8a);}),this['fire']('reviewCheckResultReady',{'changes':_0x447b21,'result':_0x1b6203,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x2d2e04){const _0x386dc6=this['_changes']['find'](_0x79304b=>_0x79304b['id']===_0x2d2e04);return!(!_0x386dc6||'active'!==_0x386dc6['status']);}['getActiveChanges'](){return this['_changes']['filter'](_0x303281=>'active'===_0x303281['status']);}['markAllChangesAsAccepted'](){for(const _0x18bea9 of this['_changes'])'active'===_0x18bea9['status']&&(_0x18bea9['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x4f4690){const _0x26819e=this['_changes']['find'](_0x41a48e=>_0x41a48e['id']===_0x4f4690);_0x26819e&&'active'===_0x26819e['status']&&(_0x26819e['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x4f55ee){const _0x8dd033=this['_changes']['find'](_0x1f130a=>_0x1f130a['id']===_0x4f55ee);_0x8dd033&&'active'===_0x8dd033['status']&&(_0x8dd033['status']='rejected'),this['_checkIfFinished']();}['activateChange'](_0x354fe1){this['_changes']['filter'](_0x2a0c7d=>_0x2a0c7d['isActivated']&&_0x2a0c7d['id']!==_0x354fe1)['forEach'](_0xa6f064=>{_0xa6f064['isActivated']=!0x1;});const _0x63b03a=this['_changes']['find'](_0x223ae5=>_0x223ae5['id']===_0x354fe1);_0x63b03a&&(_0x63b03a['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x29fd65=>_0x29fd65['isActivated'])['forEach'](_0x51871d=>{_0x51871d['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}['_addReviewCheckResult'](_0x2fd5c6,_0x11f80d){const _0x53a629=this['_documentData']['elements']['get'](_0x2fd5c6);if(!_0x53a629)return;const _0x5a0cfa=_0x53a629['getContent']();if(_0x5a0cfa===_0x11f80d)return;const _0x274f58=new Ns({'id':_0x2fd5c6,'contentInitial':_0x5a0cfa,'contentNew':_0x11f80d,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x274f58['id'],_0x274f58),this['fire']('reviewCheckResultAdded',{'result':_0x274f58,'source':this});}['_checkIfFinished'](){if('ready'!==this['status'])return;0x0===this['_changes']['filter'](_0x22ea1e=>'active'===_0x22ea1e['status'])['length']&&(this['status']='finished');}['_createApiRequest'](){throw new Error('Not\x20implemented.');}['getAcceptedChangesCount'](){return this['_changes']['filter'](_0x26127c=>'accepted'===_0x26127c['status'])['length'];}['getTotalChangesCount'](){return this['_changes']['length'];}get['reviewName'](){return this['_sourceCheck']['id'];}}class di extends pr{get['title'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs'])return this['_sourceCheck']['title'];const _0x2c4c3b=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x36e468=0x0;_0x36e468<this['_reviewParams']['length'];_0x36e468++){if(!this['_reviewParams'][_0x36e468]||!this['_sourceCheck']['options'][_0x36e468])continue;const _0x4c8f89=this['_sourceCheck']['options'][_0x36e468],_0x256cff=_0x4c8f89['data']?.['find'](_0x148444=>_0x148444['id']===this['_reviewParams'][_0x36e468]);_0x256cff&&_0x2c4c3b['push'](_0x256cff['label']);}return this['_sourceCheck']['title']+':\x20'+_0x2c4c3b['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 li extends pr{['_prompt'];['_model'];constructor(_0x255aa3,_0x194a1a,_0x384657,_0x5e32c2,_0x97a60a){super(_0x384657,_0x5e32c2,_0x97a60a),this['_prompt']=_0x255aa3,this['_model']=_0x194a1a;}get['title'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}}class fi extends _0x106985(){['_modelList']=[];['_connector'];constructor({connector:_0x4d6a38}){super(),this['_connector']=_0x4d6a38;}async['getAll'](){if(!this['_modelList']['length'])try{const _0x349ad4=this['_connector']['getModels'](),_0x232697=await _0x349ad4['list']();this['_modelList']=_0x232697['items'];}catch{}return this['_modelList'];}}const vi=[{'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 tt{['_aiConnector'];['_aiReviewModeUi'];['_aiReviewModeEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_isDiffOn']=!0x1;['_changeActivationSource']=null;static get['requires'](){return[s];}static get['pluginName'](){return'AIReviewModeController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiReviewModeUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewModeEditing']=this['context']['plugins']['get']('AIReviewModeEditing');const _0x5f3fe1=this['context']['config']['get']('ai.reviewMode.translations');if(_0x5f3fe1){for(const _0x3fb8ab of vi)'translate'===_0x3fb8ab['id']&&(_0x3fb8ab['options'][0x0]['data']=_0x5f3fe1);}const _0x1e5e6b=this['_translateReviewChecks'](vi);this['_aiReviewCheckList']=new ai(_0x1e5e6b);const _0x467f26=this['_aiReviewCheckList']['checks']['find'](_0x125d42=>'custom'===_0x125d42['id']);if(_0x467f26){const _0x409e79=await new fi({'connector':this['_aiConnector']})['getAll']();_0x467f26['models']=_0x409e79['map'](_0x1e3c8b=>({..._0x1e3c8b,'description':this['_getTranslationWithDefault']('AI_MODEL_DESCRIPTION_'+_0x1e3c8b['id']['toUpperCase'](),_0x1e3c8b['description'])}));}this['listenTo'](this['_aiReviewModeUi'],'getReviewCheckList',()=>{this['_aiReviewModeUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewModeUi'],'runReviewCheck',async(_0x3f5d9c,_0x39ab42)=>{const _0x16403c=this['_aiReviewCheckList']['getCheckById'](_0x39ab42['id']);if(_0x16403c){this['_onDiffChange'](this['_isDiffOn']),_0x39ab42['isCustom']?this['_currentReviewCheckRun']=new li(_0x39ab42['args']['prompt'],_0x39ab42['args']['model'],this['_aiReviewModeEditing']['getDocumentData'](),_0x16403c,this['_aiConnector']):this['_currentReviewCheckRun']=new di(this['_aiReviewModeEditing']['getDocumentData'](),_0x16403c,this['_aiConnector'],_0x39ab42['params'],_0x39ab42['args']),this['_aiReviewModeUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x5897d4,_0x58ad73)=>{'data'===_0x58ad73['status']||'loading'===_0x58ad73['status']?(this['_aiReviewModeEditing']['switchToReadOnly'](),this['_aiReviewModeUi']['showCheckRunResults'](_0x58ad73)):'finished'===_0x58ad73['status']?this['_aiReviewModeUi']['showReviewCompletedView']():'ready'===_0x58ad73['status']?this['_aiReviewModeUi']['showActionsWhenResultIsReady']():'unmodified'===_0x58ad73['status']?this['_aiReviewModeUi']['showNoChangesView']():'error-general'===_0x58ad73['status']?this['_aiReviewModeUi']['showGeneralErrorView']():'error-chunk'===_0x58ad73['status']?this['_aiReviewModeUi']['showChunkErrorView']():'aborted'===_0x58ad73['status']&&(this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewModeRunLeave'](!0x0));}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x244748,_0x3629c7)=>{if(!this['_currentReviewCheckRun'])throw new _0x5e86d1('aireviewmode-no-current-check-run',this);const _0x4b6c8e=this['_aiReviewModeEditing']['diffContent'](_0x3629c7['result']['contentInitial'],_0x3629c7['result']['contentNew']);_0x3629c7['source']['addResultChanges'](_0x3629c7['result']['id'],_0x4b6c8e);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x294192,_0x5ea192)=>{for(const _0x375975 of _0x5ea192['changes'])this['_aiReviewModeUi']['showCheckRunResult'](_0x375975);this['_aiReviewModeEditing']['markChangePositionInEditorContent'](_0x5ea192['changes'],_0x5ea192['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultAccepted',(_0x1c2cab,_0x2efc92)=>{this['_aiReviewModeUi']['updateChangeState'](_0x2efc92['change']['id'],'accepted');}),this['_currentReviewCheckRun']['on']('reviewCheckResultRejected',(_0x43ca53,_0xe5dda4)=>{this['_aiReviewModeUi']['updateChangeState'](_0xe5dda4['change']['id'],'rejected');}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x30172b,_0x76761f)=>{this['_aiReviewModeUi']['setActiveStateInResults'](_0x76761f['change']['id']);const _0x1c5906=this['_aiReviewModeEditing']['getMarkerElementForChange'](_0x76761f['change']['id']);if(_0x1c5906){if('content'===this['_changeActivationSource']){const _0x3d3f75=this['_aiReviewModeUi']['getChangeElement'](_0x76761f['change']['id']);_0x3d3f75&&_0xdd61de(_0x3d3f75['closest']('.ck-ai-review-mode__check-run-result')||_0x3d3f75);}else{if('panel'===this['_changeActivationSource']){const _0x56e251={'target':_0x1c5906['domElement'],'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0};nt(_0x56e251);}}this['_aiReviewModeUi']['showChangeBalloon'](_0x76761f['change'],_0x1c5906['domElement']);}}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_aiReviewModeUi']['resetActiveStateInResults']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x490620){_0x490620 instanceof Error&&_0x490620['message']['includes']('ai-request-aborted')||(_0x490620 instanceof _0x5e86d1?this['_logError'](_0x490620):this['_logError'](new _0x5e86d1('aireviewmode-check-run-failed',this,{'error':_0x490620})));}}else this['_logError'](new _0x5e86d1('aireviewmode-source-check-not-found',this,{'checkId':_0x39ab42['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 _0x27afb7=this['_currentReviewCheckRun']['getActiveChanges']();_0x27afb7['length']&&(this['_aiReviewModeEditing']['applyChange'](_0x27afb7['map'](_0x13160e=>_0x13160e['id'])),this['_currentReviewCheckRun']['markAllChangesAsAccepted'](),this['_updateRatings']());}),this['listenTo'](this['_aiReviewModeUi'],'acceptChange',(_0x29f137,_0x3ce997)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x3ce997['id'])&&(this['_aiReviewModeEditing']['applyChange']([_0x3ce997['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x3ce997['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_updateRatings']());}),this['listenTo'](this['_aiReviewModeUi'],'dismissChange',(_0x396b00,_0x32069a)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x32069a['id'])&&(this['_aiReviewModeEditing']['rejectChange'](_0x32069a['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x32069a['id']),this['_aiReviewModeUi']['hideChangeBalloon']());}),this['listenTo'](this['_aiReviewModeUi'],'toggleDiff',(_0x20fa25,_0x34e8e3)=>{this['_isDiffOn']=_0x34e8e3['on'],this['_onDiffChange'](this['_isDiffOn']);}),this['listenTo'](this['_aiReviewModeUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&await this['_currentReviewCheckRun']['restart']();}),this['listenTo'](this['_aiReviewModeUi'],'activateChange',(_0x300e94,_0x5e8add)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x5e8add['id']));}),this['listenTo'](this['_aiReviewModeUi'],'deactivateChange',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['deactivateChange']();}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerClick',(_0x1995c9,_0x5f3b28)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x5f3b28['changeId']));});}['_updateRatings'](){if(!this['_currentReviewCheckRun'])return;const _0x19ec0a={'positiveCount':this['_currentReviewCheckRun']['getAcceptedChangesCount'](),'totalCount':this['_currentReviewCheckRun']['getTotalChangesCount']()},_0x3acb0a=this['_currentReviewCheckRun']['callId'];if(this['_currentReviewCheckRun']instanceof di){const _0x3a709e=this['_currentReviewCheckRun']['reviewName'];this['_aiConnector']['upsertAIReviewRating'](_0x3a709e,_0x3acb0a,_0x19ec0a);}else this['_currentReviewCheckRun']instanceof li&&this['_aiConnector']['upsertCustomAIReviewRating'](_0x3acb0a,_0x19ec0a);}['_onReviewModeRunLeave'](_0x83db60=!0x1){this['_currentReviewCheckRun']&&(this['_updateRatings'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']=void 0x0),_0x83db60&&this['_aiReviewModeUi']['showReviewCheckList'](),this['_aiReviewModeEditing']['clearAllMarkers'](),this['_aiReviewModeEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x310300=this['_aiReviewModeEditing']['getContentElement']();_0x310300&&(_0x310300['classList']['remove']('ck-ai-review-mode-diff'),_0x310300['classList']['remove']('ck-ai-review-mode-highlights'));}['_onDiffChange'](_0x51969c){const _0x2b4ed9=this['_aiReviewModeEditing']['getContentElement']();_0x2b4ed9&&(_0x2b4ed9['classList']['remove']('ck-ai-review-mode-diff'),_0x2b4ed9['classList']['remove']('ck-ai-review-mode-highlights'),_0x2b4ed9['classList']['add'](_0x51969c?'ck-ai-review-mode-diff':'ck-ai-review-mode-highlights'));}['_translateReviewChecks'](_0x343b53){return _0x343b53['map'](_0x5920dc=>{const _0x1d700c='AI_REVIEW_CHECK_'+_0x5920dc['id']['toUpperCase']()['replaceAll']('-','_'),_0x3a926f={..._0x5920dc,'title':this['_getTranslationWithDefault'](_0x1d700c+'_TITLE',_0x5920dc['title']),'description':this['_getTranslationWithDefault'](_0x1d700c+'_DESCRIPTION',_0x5920dc['description'])};return _0x5920dc['options']&&(_0x3a926f['options']=_0x5920dc['options']['map'](_0xca21ca=>({..._0xca21ca,'label':this['_getTranslationWithDefault'](_0x1d700c+'_OPTIONS_LABEL',_0xca21ca['label']||''),'data':_0xca21ca['data']?_0xca21ca['data']['map'](_0x177389=>({..._0x177389,'label':this['_getTranslationWithDefault'](_0x1d700c+'_OPTIONS_DATA_'+_0x177389['id']['toUpperCase'](),_0x177389['label'])})):void 0x0}))),_0x3a926f;});}['_getTranslationWithDefault'](_0x54e0dd,_0x30dd0c){const _0x244e7d=w(this['context']['locale'],_0x54e0dd);return _0x244e7d===_0x54e0dd?_0x30dd0c:_0x244e7d;}['_logError'](_0x3d0ea0){ot(_0x3d0ea0['message']),this['_aiReviewModeUi']['showGeneralErrorView']();}}class Mr extends _0x14b3a2{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x2147cf,_0x446faa){super(_0x2147cf),this['_defaultValue']=_0x446faa['default']||(_0x446faa['data']['length']>0x0?_0x446faa['data'][0x0]['id']:''),this['_defaultLabel']=_0x446faa['data']['find'](_0x5915fb=>_0x5915fb['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x19bf5c(this['locale']);const _0xbb89e9=this['_prepareListOptions'](_0x446faa['data']);_0x119cd1(this['_dropdownView'],_0xbb89e9,{'role':'menu','ariaLabel':_0x446faa['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x39d6a2=>{_0x39d6a2['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x57ec6d=>{this['formValue']=_0x57ec6d['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x57ec6d['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'](_0x29520b=[]){const _0x3ce57c=new _0x553151();this['resetToDefault']();for(const _0x1d70f7 of _0x29520b){const _0x8c3e8d=new _0x2819cc({'label':_0x1d70f7['label'],'withText':!0x0,'role':'menuitemradio','id':_0x1d70f7['id'],'model':_0x1d70f7});_0x8c3e8d['bind']('isOn')['to'](this,'formValue',_0x3a551c=>_0x3a551c===_0x8c3e8d['id']);const _0x345e98={'type':'button','model':_0x8c3e8d};_0x3ce57c['add'](_0x345e98);}return _0x3ce57c;}}class Ps extends _0x17d3e0{['_formItem']=null;constructor(_0x3e79e3,_0x4119dc,_0x29c610){super(_0x3e79e3),this['argsKey']=_0x4119dc?.['argsKey'];if('dropdown'===_0x4119dc['formType'])this['_formItem']=new Mr(this['locale'],_0x4119dc);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x45d48f=new _0x42dbde(this['locale'],{'children':[this['_formItem']],'class':[_0x29c610?'ck-form__row_with-submit':'']});_0x29c610&&_0x45d48f['children']['add'](_0x29c610),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__form-item','ck-reset_all']},'children':[_0x45d48f]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class Ts extends _0x185d11{static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x1efbdb){super(_0x1efbdb),this['set']('isEmpty',!0x0),this['minRows']=Ts['MIN_ROWS'],this['maxRows']=Ts['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'](_0x3745d4=>{_0x3745d4['stopPropagation']();})}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();});}['setPlaceholderText'](_0x10873d){this['set']('placeholder',_0x10873d);}}class js extends _0x14b3a2{['submitButtonView'];['cancelButtonView'];['promptInputView'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x557a4c,_0x3d7f2b){super(_0x557a4c),this['_check']=_0x3d7f2b,this['set']('prompt',''),this['set']('modelId',''),this['_defaultValue']=_0x3d7f2b['models']&&_0x3d7f2b['models']['length']>0x0?_0x3d7f2b['models'][0x0]['id']:'',this['_defaultLabel']=_0x3d7f2b['models']&&_0x3d7f2b['models']['length']>0x0?_0x3d7f2b['models'][0x0]['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),this['promptInputView']=new Ts(_0x557a4c),this['promptInputView']['bind']('value')['to'](this,'prompt'),this['promptInputView']['on']('input',()=>{this['prompt']=this['promptInputView']['element']['value'];}),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelSelectionDropdownItems']=new _0x553151(),this['_setModelList'](),_0x119cd1(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);const _0x282215=new _0x14b3a2(_0x557a4c);_0x282215['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 _0x42dbde(this['locale'],{'children':[this['promptInputView']]}),new _0x42dbde(this['locale'],{'children':[_0x282215]})]});}['resetToDefault'](){this['prompt']='',this['modelId']=this['_defaultValue'],this['_modelSelectionDropdown']['buttonView']['label']=this['_defaultLabel'];}['_createSubmitButtonView'](){const _0xa66f62=new _0xb98904(this['locale']),t=this['locale']['t'];return _0xa66f62['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0xa66f62['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x1df076=>{_0x1df076['stopPropagation']();})}}),_0xa66f62['on']('execute',()=>{this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0xa66f62;}['_createCancelButtonView'](){const _0x155822=new _0xb98904(this['locale']),t=this['locale']['t'];return _0x155822['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled'}),_0x155822['on']('execute',()=>{this['resetToDefault']();}),_0x155822;}['_setModelList'](){this['_modelSelectionDropdownItems']['clear']();const _0x4e9456=this['_check']['models'];if(this['resetToDefault'](),_0x4e9456?.['length'])for(const _0x4257b1 of _0x4e9456){const _0x171d51=new _0x2819cc({'label':_0x4257b1['name'],'withText':!0x0,'role':'menuitemradio','id':_0x4257b1['id'],'model':_0x4257b1});_0x171d51['bind']('isOn')['to'](this,'modelId',_0x1740b1=>_0x1740b1===_0x4257b1['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x171d51,'labelView':new Bs(this['locale'],_0x4257b1)});}}['_createModelSelectionDropdown'](){const _0x24891f=_0x19bf5c(this['locale']);return _0x24891f['set']({'panelPosition':'se','class':'ck-ai-review-mode__check-list-item-model-dropdown'}),_0x24891f['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5928e4=>{_0x5928e4['stopPropagation']();})}}),_0x24891f['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),this['listenTo'](_0x24891f,'execute',_0x9a0e24=>{this['modelId']=_0x9a0e24['source']['model']['id'],_0x24891f['buttonView']['label']=_0x9a0e24['source']['label'];}),_0x24891f;}}class Bs extends _0x5ef6a2{constructor(_0x260a61,_0x6af4f7){super();const _0x5af3b6=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x5af3b6['to']('style'),'id':_0x5af3b6['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-name']},'children':[{'text':_0x5af3b6['to']('text')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[{'text':_0x6af4f7['description']}]}]}]});}}class Rs extends _0x17d3e0{['_formItemsCollection']=new _0x17ac77();['_customCheckView']=null;constructor(_0x3e786a,_0x579d09,_0x5062aa){super(_0x3e786a),this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x579d09['isParameterized']);const _0x69424d=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',_0x4cb2d4=>_0x4cb2d4),this['bindTemplate']['if']('isListItemRendered','ck-ai-review-mode__check-list-item_rendered',_0x224329=>_0x224329)],'style':{'--ck-ai-check-list-item-index':_0x5062aa}},'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':_0x579d09['title']}]},_0x69424d]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-description']},'children':[{'text':_0x579d09['description']}]}]}]},..._0x579d09['isParameterized']?[this['_createParameterizedView'](_0x579d09)]:[],...'custom'===_0x579d09['id']?[this['_createCustomView'](_0x579d09)]:[]]}),this['on']('click',()=>{_0x579d09['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x579d09['id']});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x33b86b({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x272fa0=>{_0x272fa0['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x18abc5=new _0x2bd673();return _0x18abc5['content']=_0x39c53d,_0x18abc5['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-title-icon']}}),_0x18abc5;}['_createParameterizedView'](_0x2b38b2){const _0x2479f1=new _0x14b3a2(),_0x4c1aa8=this['_createFormView'](_0x2b38b2);return _0x2479f1['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x38727a=>!_0x38727a)]},'children':[_0x4c1aa8]}),_0x2479f1;}['_createFormView'](_0x40953f){const _0x13ebe5=new _0x14b3a2(),_0x595bd5=Array['isArray'](_0x40953f['options'])?_0x40953f['options']:[],_0x199da2=new _0xb98904(this['locale']),t=this['locale']['t'];_0x199da2['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x199da2['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x33396c=>{_0x33396c['stopPropagation']();})}}),_0x199da2['on']('execute',()=>{const _0x2d25c7=[],_0xb9e9b4={};this['_formItemsCollection']['forEach'](_0x157b6c=>{_0x2d25c7['push'](_0x157b6c['value']),_0x40953f['useArgs']&&_0x40953f['options']&&(_0xb9e9b4[_0x157b6c['argsKey']]=_0x157b6c['value']);}),this['fire']('runReviewCheck',{'id':_0x40953f['id'],'params':_0x2d25c7['length']?_0x2d25c7:void 0x0,'args':Object['keys'](_0xb9e9b4)['length']?_0xb9e9b4:void 0x0});});const _0xfcfa98=_0x595bd5['length'];return _0x595bd5['forEach']((_0x5adf74,_0x21b169)=>{const _0xa8f7b9=_0x21b169===_0xfcfa98-0x1;this['_formItemsCollection']['add'](new Ps(this['locale'],_0x5adf74,_0xa8f7b9?_0x199da2:null));}),_0x13ebe5['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x13ebe5;}['_createCustomView'](_0x4ff46a){return this['_customCheckView']=new js(this['locale'],_0x4ff46a),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',_0x26b268=>!_0x26b268)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['_customCheckView'];}}class Ls extends _0x17d3e0{['_checkViews'];constructor(_0x3bc19d){super(_0x3bc19d),this['_checkViews']=new _0x17ac77();const _0x39d500=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list',_0x39d500['if']('isVisible','ck-hidden',_0x5cd455=>!_0x5cd455)]},'children':this['_checkViews']});}['setChecks'](_0x45a33b){this['_checkViews']['clear']();for(const [_0x54a2c3,_0x5552a7]of _0x45a33b['entries']()){const _0x37426e=new Rs(this['locale'],_0x5552a7,_0x54a2c3);_0x37426e['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x37426e);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x92d620 of this['_checkViews'])_0x92d620 instanceof Rs&&_0x92d620['resetToDefault']();}}class vs extends _0x14b3a2{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];constructor(_0x8f9722,_0x26890b){super(_0x8f9722),this['id']=_0x26890b,this['set']('changeId',_0x26890b),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),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']('activateChange',{'id':_0x26890b,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x4b660e=new _0x14b3a2(this['locale']);return _0x4b660e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-content-direct-excluded','ck-ai-review-mode__check-run-result-response']}}),_0x4b660e;}['_createAcceptButtonView'](){const _0x39d588=new _0xb98904(this['locale']);return _0x39d588['set']({'label':w(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-result-accept-button'}),_0x39d588['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5d4f6a=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x5d4f6a['stopPropagation']();})}}),_0x39d588;}['_createDismissButtonView'](){const _0x3e65f3=new _0xb98904(this['locale']);return _0x3e65f3['set']({'label':w(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-dismiss-button'}),_0x3e65f3['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x1580d2=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x1580d2['stopPropagation']();})}}),_0x3e65f3;}['_createInfoButtonView'](){const _0x4779a7=new _0xb98904(this['locale']);return _0x4779a7['set']({'label':w(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x509605,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-info-button\x20ck-hidden'}),_0x4779a7['bind']('isOn')['to'](this,'isInfoToggleOn',_0x5f0077=>_0x5f0077),_0x4779a7['on']('execute',()=>{console['log']('Toggle\x20info\x20view'),this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x4779a7;}}class Gs extends _0x17d3e0{['_resultViews'];['resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];constructor(_0x1251ef){super(_0x1251ef),this['_resultViews']=new _0x17ac77(),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 Ci(_0x1251ef),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 _0xba701f=this['_createCombinedSkeletonLoader'](),_0x28c590=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run',_0x28c590['if']('isVisible','ck-hidden',_0x1658ba=>!_0x1658ba)]},'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',_0x5256af=>_0x5256af)]},'children':this['_resultViews']},_0xba701f]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x19b6f1){const _0x1616e4=new vs(this['locale'],_0x19b6f1['id']);_0x1616e4['delegate']('acceptChange','dismissChange','activateChange')['to'](this),this['_resultViews']['add'](_0x1616e4),_0x1616e4['resultResponseView']['element']['innerHTML']=_0x19b6f1['contentDiffed'];}['hideResult'](_0x550e73){const _0x1ad9ab=this['_resultViews']['find'](_0x5ccf61=>_0x5ccf61['id']===_0x550e73);_0x1ad9ab&&(_0x1ad9ab['element']?.['classList']['add']('ck-ai-review-mode__check-run-result_removing'),_0x1ad9ab['element']?.['addEventListener']('animationend',()=>{this['_resultViews']['remove'](_0x1ad9ab),_0x1ad9ab['destroy']();},{'once':!0x0}));}['setTitle'](_0x17d6c9){this['headerTitle']=_0x17d6c9;}['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 Ae(this['locale'],Oe['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x362931=new _0x14b3a2(this['locale']),_0xcb3e9c=[];for(let _0x1ab1b1=0x0;_0x1ab1b1<0x10;_0x1ab1b1++){const _0x34c01f=this['_createSkeletonLoader']();_0x34c01f['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-run-skeleton-item']}}),_0xcb3e9c['push'](_0x34c01f);}return _0x362931['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x45eae9=>!_0x45eae9)]},'children':_0xcb3e9c}),_0x362931;}['_createErrorView'](){const _0x5579bd=new _0x14b3a2(this['locale']),_0x3499fe=new _0xb98904(this['locale']),t=this['locale']['t'];return _0x5579bd['delegate']('retryReview')['to'](this),_0x3499fe['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-error-retry-button'}),_0x3499fe['on']('execute',()=>{this['fire']('retryReview');}),_0x5579bd['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x491c2a=>!_0x491c2a),this['bindTemplate']['if']('errorType','ck-ai-review-mode__check-run-error-container_border-bottom',_0x28ae6d=>'chunk'===_0x28ae6d)]},'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',_0x1b0c13=>'chunk'===_0x1b0c13)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x4ba277=>'general'!==_0x4ba277)]},'children':[{'text':w(this['locale'],'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}]},{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x532e6c=>'chunk'!==_0x532e6c)]},'children':[{'text':w(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x3499fe]}),_0x5579bd;}['_createCancelButtonView'](){const _0x56814d=new _0xb98904(this['locale']);return _0x56814d['set']({'label':w(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ai-chat-controls-loader__cancel-button'],'icon':_0x14175e}),_0x56814d['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x3472dd=>_0x3472dd)]}}),_0x56814d['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x56814d;}['_createToggleDiffButtonView'](){const _0x39a5c1=new _0xb98904(this['locale']);_0x39a5c1['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x39a5c1['bind']('isEnabled')['to'](this,'isError',_0x974a76=>!_0x974a76),_0x39a5c1['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x376407=>!_0x376407)]}});const _0xb681ee=w(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0xfe27b=w(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x39a5c1['bind']('isOn')['to'](this,'isToggleDiffOn',_0x3e9425=>_0x3e9425),_0x39a5c1['bind']('icon')['to'](this,'isToggleDiffOn',_0x14e2c0=>_0x14e2c0?_0xd0fe6d:_0x2eb32e),_0x39a5c1['bind']('label')['to'](this,'isToggleDiffOn',_0xb51367=>_0xb51367?_0xb681ee:_0xfe27b),_0x39a5c1['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x39a5c1;}['_createAcceptAllButtonView'](){const _0x5177f3=new _0xb98904(this['locale']);return _0x5177f3['set']({'label':w(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x5177f3['bind']('isEnabled')['to'](this,'isError',_0x31fb33=>!_0x31fb33),_0x5177f3['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai-review-mode__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x39c36e=>!_0x39c36e)]}}),_0x5177f3['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x5177f3;}['_createExitReviewButtonView'](){const _0x1e10f7=new _0xb98904(this['locale']);return _0x1e10f7['set']({'label':w(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x1e10f7['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x136595=>!_0x136595)]}}),_0x1e10f7['on']('execute',()=>{this['fire']('leaveReviewModeResultList');}),_0x1e10f7;}['_createResultHeaderView'](){const _0x31f2e6=new _0x14b3a2(this['locale']),_0x210625=new Fe();return _0x210625['bind']('isVisible')['to'](this,'isResultReady',_0x2723cd=>!_0x2723cd),_0x31f2e6['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':[_0x210625,this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView']]}]}),_0x31f2e6;}}class Hs extends _0x17d3e0{['resultsHeader'];['_finishReviewButtonView'];constructor(_0x2c350a){super(_0x2c350a),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['resultsHeader']=this['_createResultHeaderView'](),this['set']('viewType','completed');const _0x1db736=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed',_0x1db736['if']('isVisible','ck-hidden',_0xd4f3e3=>!_0xd4f3e3)]},'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':_0x1db736['to']('viewType',_0x47e6b3=>'completed'===_0x47e6b3?'🎉':'👍')}]},{'tag':'p','attributes':{'class':['ck-ai-review-mode__review-completed-content-text']},'children':[{'text':_0x1db736['to']('viewType',_0x207e7e=>w(_0x2c350a,'completed'===_0x207e7e?'AI_REVIEW_MODE_COMPLETED_TEXT':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'))}]}]}]});}['_createFinishReviewButtonView'](){const _0x5ad6f6=new _0xb98904(this['locale']);return _0x5ad6f6['set']({'label':w(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x5ad6f6['on']('execute',()=>{this['fire']('finishReview');}),_0x5ad6f6;}['_createResultHeaderView'](){const _0x3d88c7=new _0x14b3a2(this['locale']);return _0x3d88c7['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':w(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x3d88c7;}}class ce extends _0x14b3a2{['reviewModeHeader'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x5d5565){super(_0x5d5565),this['reviewModeHeader']=new _0x4d6d75(_0x5d5565,{'label':w(_0x5d5565,'AI_REVIEW_MODE'),'icon':_0x4c0e91,'class':'ck-ai-header\x20ck-ai-header_review-mode'}),this['reviewCheckListView']=new Ls(_0x5d5565),this['reviewCheckListView']['delegate'](...Ws)['to'](this),this['reviewCheckResultsView']=new Gs(_0x5d5565),this['reviewCheckResultsView']['delegate'](...Ws)['to'](this),this['reviewCompletedView']=new Hs(_0x5d5565),this['reviewCompletedView']['delegate']('finishReview')['to'](this),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isLoading',!0x1),this['reviewCheckResultsView']['set']('isResultReady',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review-mode','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewModeHeader'],this['reviewCheckListView'],this['reviewCheckResultsView'],this['reviewCompletedView']]});}['showReviewCheckListView'](){this['reviewCheckListView']['resetAllParameterizedChecks'](),this['reviewCheckListView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1);}['showReviewCheckResultsView'](){this['hideActionsWhenResultIsReady'](),this['reviewCheckResultsView']['resetErrorState'](),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['clearResults'](),this['reviewCheckResultsView']['set']('isLoading',!0x0);}['addCheckRunResult'](_0x26f75e){this['reviewCheckResultsView']['addResult'](_0x26f75e),this['reviewCheckResultsView']['set']('isLoading',!0x1);}['showReviewCompletedView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('viewType','completed'),this['reviewCompletedView']['set']('isVisible',!0x0);}['showActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x0;}['showNoChangesView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('viewType','unmodified'),this['reviewCompletedView']['set']('isVisible',!0x0);}['hideActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x1;}['showGeneralErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class le extends _0x1b1d73{['resultItemView'];constructor(_0x7618,_0x374286){super(_0x7618),this['set']({'isVisible':!0x1,'position':'se','class':null,'top':0x0,'left':0x0}),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-reset'],'tabindex':'-1'}}),this['content']['add'](this['_createContentView']()),_0x374286['add'](this),_0x33b86b({'emitter':this,'activator':()=>this['isVisible'],'contextElements':[this['element']],'callback':()=>{this['hideBalloon'](),this['deactivateChange']();}});}['updateContent'](_0xbe495){this['resultItemView']['changeId']=_0xbe495['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0xbe495['contentDiffed'];}['showBalloon'](_0x57bae7,_0x33e172){this['updateContent'](_0x57bae7),this['show'](),this['pin']({'target':_0x33e172});}['hideBalloon'](){this['hide'](),this['unpin']();}['deactivateChange'](){this['fire']('deactivateChange');}['_createContentView'](){const _0x45d9e5=new _0x14b3a2();return this['resultItemView']=new vs(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x45d9e5['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai-review-mode-balloon-panel-suggestion']},'children':[{'tag':'p','attributes':{'class':['ck-ai-review-mode__suggestion-text']},'children':[this['resultItemView']]}]}),_0x45d9e5;}}const Ws=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewModeResultList','activateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ie extends tt{['_reviewModeView'];['_reviewModeBalloonSuggestionItemView'];['_bodyCollection'];static get['requires'](){return[rt];}static get['pluginName'](){return'AIReviewModeUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x320995){super(_0x320995),this['_bodyCollection']=new Wt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_reviewModeView']=new ce(this['context']['locale']),this['_reviewModeView']['delegate'](...Ws)['to'](this),this['_reviewModeBalloonSuggestionItemView']=new le(this['context']['locale'],this['_bodyCollection']),this['_reviewModeBalloonSuggestionItemView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x21a18d=this['context']['plugins']['get']('AITabs');_0x21a18d['view']['on']('activateTab',(_0x1dca4e,_0x226620)=>{'reviewMode'===_0x226620?this['fire']('getReviewCheckList'):this['fire']('leaveReviewMode');}),_0x21a18d['view']['addTab']({'id':'reviewMode','buttonLabel':w(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x4c0e91,'order':0x0,'content':this['_reviewModeView']});}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x474d5e){this['_reviewModeView']['reviewCheckListView']['hasChecks']()||this['_reviewModeView']['reviewCheckListView']['setChecks'](_0x474d5e),this['_reviewModeView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x3b3a1a){_0x3b3a1a&&('error-general'!==_0x3b3a1a['status']?'error-chunk'!==_0x3b3a1a['status']?this['_reviewModeView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralErrorView']());}['showCheckRunResult'](_0x3201e2){this['_reviewModeView']['addCheckRunResult'](_0x3201e2);}['showGeneralErrorView'](){this['_reviewModeView']['showGeneralErrorView']();}['showChunkErrorView'](){this['_reviewModeView']['showChunkErrorView']();}['setCheckResultTitle'](_0x564451){this['_reviewModeView']['reviewCheckResultsView']['setTitle'](_0x564451);}['setActiveStateInResults'](_0x5d7027){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x56b37e=>{_0x56b37e['id']===_0x5d7027&&_0x56b37e['setItemAsActive']();});}['resetActiveStateInResults'](){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x4506e5=>_0x4506e5['setItemAsInactive']());}['updateChangeState'](_0x4d2170,_0x24c166){'accepted'!==_0x24c166&&'rejected'!==_0x24c166||this['_reviewModeView']['reviewCheckResultsView']['hideResult'](_0x4d2170);}['showReviewCompletedView'](){this['_reviewModeView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_reviewModeView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_reviewModeView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_reviewModeView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x21c70a,_0x2c6fc4){this['_reviewModeBalloonSuggestionItemView']['showBalloon'](_0x21c70a,_0x2c6fc4);}['hideChangeBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideBalloon']();}['getChangeElement'](_0x6a350e){const _0x392a28=this['_reviewModeView']['reviewCheckResultsView']['getResults']()['find'](_0x3b5d70=>_0x3b5d70['id']===_0x6a350e);return _0x392a28?_0x392a28['element']:null;}['deactivateChange'](){this['_reviewModeBalloonSuggestionItemView']['deactivateChange']();}}const ae='reviewmode-';class re extends tt{static get['pluginName'](){return'AIReviewModeEditing';}static get['requires'](){return[_0x20d1e0,h];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_domEmitter'];['_eventEmitter'];constructor(_0x21744e){super(_0x21744e),this['_domEmitter']=new(_0x2023bf())(),this['_eventEmitter']=new(_0x106985())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x403a57=lt(this['context']);_0x403a57['conversion']['for']('editingDowncast')['markerToElement']({'model':ae+'insert','view':(_0x2813cf,{writer:_0xdb215c})=>{const _0x2648d6=this['_markers']['get'](_0x2813cf['markerName']),_0x9bdc3d={'class':'ck-ai_review-mode-marker_add','data-marker-id':_0x2813cf['markerName']};return _0xdb215c['createUIElement']('span',_0x9bdc3d,function(_0x7dcfb1){const _0x4dd7aa=this['toDomElement'](_0x7dcfb1);return _0x4dd7aa['innerHTML']=_0x2648d6?.['text']||'',_0x4dd7aa;});}}),_0x403a57['conversion']['for']('editingDowncast')['markerToHighlight']({'model':ae+'remove-only','view':_0x5df551=>({'classes':'ck-ai_review-mode-marker_strikethrough','attributes':{'data-marker-id':_0x5df551['markerName']}})}),_0x403a57['conversion']['for']('editingDowncast')['markerToHighlight']({'model':ae+'remove-context','view':_0x6a9540=>({'classes':'ck-ai_review-mode-marker_underline','attributes':{'data-marker-id':_0x6a9540['markerName']}})}),_0x403a57['conversion']['for']('editingDowncast')['markerToHighlight']({'model':ae+'remove-text','view':_0x580521=>({'classes':'ck-ai_review-mode-marker_hide','attributes':{'data-marker-id':_0x580521['markerName']}})}),_0x403a57['conversion']['for']('dataDowncast')['markerToElement']({'model':ae+'suggestion-context','view':(_0x3741ca,{writer:_0x3f5264})=>_0x3f5264['createRawElement']('span',{'class':'ck-ai_review-mode-marker_context-'+(_0x3741ca['isOpening']?'start':'end')})}),_0x403a57['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x5c6e05,'view':_0x44e6b7}),this['_domEmitter']['listenTo'](document,'click',(_0x23eb64,_0x3cafb8)=>{const _0x265884=_0x3cafb8['target'],_0x136a9b=this['_findMarkerElement'](_0x265884);if(!_0x136a9b)return;const _0x1466f8=_0x136a9b['getAttribute']('data-marker-id'),_0x338c2e=_0x1466f8['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClick',{'markerId':_0x1466f8,'changeId':_0x338c2e});});}['getDocumentData'](){const _0x694efc=this['context']['plugins']['get']('AIEditing'),_0x1c3d27=lt(this['context']),_0xe1917=_0x1c3d27['model'],_0x29bcf6=new _0x5acb07();for(const _0x26bc23 of _0xe1917['document']['getRoot']()['getChildren']()){const _0x16c930=_0x26bc23['_clone'](!0x0);_0x29bcf6['_appendChild'](_0x16c930);}for(const _0x39a797 of _0xe1917['markers'])_0x29bcf6['markers']['set'](_0x39a797['name'],this['_changeRangeOwnerDocument'](_0x39a797['getRange']()['clone'](),_0x29bcf6));const _0x3c44cc=new te({'ignoreElementEnd':!0x0,'startPosition':_0xe1917['createPositionAt'](_0x29bcf6,0x0)}),_0x51e194=new Set(),_0x5c851f=new Map();for(const {item:_0x868789}of _0x3c44cc){if(!_0x868789['is']('$textProxy'))continue;const _0x10167c=_0x868789['parent'];if((!_0x10167c||!_0x10167c['is']('element','caption'))&&(_0x10167c&&_0x10167c['is']('element'))){let _0xfad0a0=_0x10167c['getAttribute'](_0x5c6e05);_0xfad0a0||(_0xfad0a0=_0x694efc['_nextDataId'](_0x51e194),_0x10167c['_setAttribute'](_0x5c6e05,_0xfad0a0)),_0x51e194['add'](_0xfad0a0);let _0x1dd51f=_0x10167c;for(;_0x1dd51f['parent']&&!_0x1dd51f['parent']['is']('documentFragment');)_0x1dd51f=_0x1dd51f['parent'],_0x1dd51f['hasAttribute'](_0x5c6e05)&&_0x1dd51f['_removeAttribute'](_0x5c6e05);_0x5c851f['set'](_0xfad0a0,{'path':_0x10167c['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x1dd51f['_clone'](!0x0),_0xfad0a0,_0x1c3d27['data'])}),_0x3c44cc['jumpTo'](_0xe1917['createPositionAfter'](_0x10167c));}}return{'content':_0x1c3d27['data']['processor']['toData'](_0x1c3d27['data']['toView'](_0x29bcf6)),'version':_0x1c3d27['model']['document']['version'],'elements':_0x5c851f};}['diffContent'](_0x386433,_0x2fd117){const _0x242c89=lt(this['context']),_0x41ab31=_0x242c89['data']['parse'](_0x386433,'$documentFragment'),_0x4f50c7=_0x242c89['model']['createPositionAt'](_0x41ab31,0x0),_0x5e74a1=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x386433,_0x2fd117,{'anchor':_0x4f50c7,'markDeletions':!0x0})['getOperations']()['filter'](_0x246e31=>'insert'===_0x246e31['type']||'marker'===_0x246e31['type']&&_0x246e31['name']['startsWith']('$markedRemove')),_0x2be668=this['_groupAdjacentOperations'](_0x5e74a1),_0x597332=[];let _0x433270=0x0;return _0x242c89['model']['change'](_0xb82e1c=>{for(let _0xf420e5=0x0;_0xf420e5<_0x2be668['length'];_0xf420e5++){const _0xb04b49=_0x2be668[_0xf420e5],_0x2cc474=_0xb82e1c['createDocumentFragment']();for(const _0x2fcc40 of _0x41ab31['getChildren']())_0xb82e1c['append'](_0x2fcc40['_clone'](!0x0),_0x2cc474);for(const _0x2ca04c of _0xb04b49['operationsIsolated'])if('insert'===_0x2ca04c['type']){const _0x526592=_0x2ca04c;_0x526592['baseVersion']=null,_0x526592['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x526592,_0x2cc474),_0xb82e1c['batch']['addOperation'](_0x2ca04c),_0x242c89['model']['applyOperation'](_0x2ca04c);const _0x5cb559='suggestion:insertion:id:authorId:'+_0x433270++,_0x115f3c=_0x242c89['model']['createRange'](_0x526592['position'],_0x526592['position']['getShiftedBy'](_0x526592['howMany']));_0x2cc474['markers']['set'](_0x5cb559,_0x115f3c);}else{if('marker'===_0x2ca04c['type']&&_0x2ca04c['name']['startsWith']('$markedRemove')){const _0x4aa59b=_0x2ca04c,_0x5d43e1='suggestion:deletion:id:authorId:'+_0x433270++;this['_changeOperationOwnerDocument'](_0x4aa59b,_0x2cc474),_0x2cc474['markers']['set'](_0x5d43e1,_0x4aa59b['newRange']);}}const _0x5e92d8=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0xb04b49['operationsIsolated'][0x0]),_0x2cc474),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0xb04b49['operationsIsolated'][_0xb04b49['operationsIsolated']['length']-0x1]),_0x2cc474));_0x2cc474['markers']['set'](ae+'suggestion-context',new _0x154493(_0x5e92d8['start'],_0x5e92d8['end'])),_0x597332['push']({..._0xb04b49,'context':this['_createGetContextFn'](_0x2cc474,_0x242c89['data'],{'ellipsisBefore':_0x5e92d8['hasContentBefore'],'ellipsisAfter':_0x5e92d8['hasContentAfter']}),'content':this['_createGetContentFn'](_0x2cc474,_0x242c89['data'])});}}),_0x597332;}['markChangePositionInEditorContent'](_0x313532,_0x2cb32f){const _0x5e8fab=_0x313532[0x0]['parent']['id'],_0x28d959=_0x2cb32f['elements']['get'](_0x5e8fab);if(!_0x28d959)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x5e8fab);const _0x5d3a80=_0x28d959['path'],_0x363ed7=lt(this['context']),_0x5462dc=_0x363ed7['model']['document']['history']['getOperations'](_0x2cb32f['version']),_0x34a7f2=[];for(const _0x3c48cd of _0x313532){const _0x30eabd=_0x3c48cd['operationsIsolated']['map'](_0xff24e0=>this['_translateOperationToEditorContent'](_0xff24e0,_0x5d3a80,_0x363ed7['model']['document']['getRoots']()[0x0]));if(!_0x30eabd||!_0x30eabd['length'])continue;const _0x3626f2=_0x30eabd['every'](_0x2afc2e=>'marker'===_0x2afc2e['type']&&_0x2afc2e['name']['startsWith']('$markedRemove')),_0x14d35b={'document':_0x363ed7['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x2f98df=_0x45cebc(_0x30eabd,_0x5462dc,_0x14d35b)['operationsA'];for(const _0x5653f1 of _0x2f98df)if('insert'===_0x5653f1['type']){const _0x642422=_0x5653f1,_0x86777=_0x642422['nodes'];let _0x40e813='';for(const _0x406c5c of _0x86777)_0x406c5c&&_0x406c5c['is']('model:$text')&&(_0x40e813+=_0x406c5c['data']);_0x34a7f2['push']({'start':_0x642422['position'],'end':_0x642422['position'],'type':'insert','groupId':_0x3c48cd['id'],'text':_0x40e813});}else{if('marker'===_0x5653f1['type']&&_0x5653f1['name']['startsWith']('$markedRemove')){const _0x29ffa1=_0x5653f1;let _0x6fee45='remove-text';if(_0x3626f2){const _0x5755e0=this['_findAdjacentContextDistance'](_0x29ffa1['newRange']['start'],'backward',_0x363ed7['model']['schema']),_0xb850b8=this['_findAdjacentContextDistance'](_0x29ffa1['newRange']['end'],'forward',_0x363ed7['model']['schema']);if(_0x5755e0||_0xb850b8){const _0xaf7be=_0x29ffa1['newRange']['start']['getShiftedBy'](-_0x5755e0),_0x3ec2cd=_0x29ffa1['newRange']['end']['getShiftedBy'](_0xb850b8);_0x34a7f2['push']({'start':_0xaf7be,'end':_0x3ec2cd,'groupId':_0x3c48cd['id'],'type':'remove-context'});}else _0x6fee45='remove-only';}_0x34a7f2['push']({'start':_0x29ffa1['newRange']['start'],'end':_0x29ffa1['newRange']['end'],'groupId':_0x3c48cd['id'],'type':_0x6fee45});}}}this['_insertMarkers'](_0x34a7f2);}['clearAllMarkers'](){lt(this['context'])['model']['change'](_0x7917d0=>{for(const _0x4e44f6 of this['_markers']['keys']())_0x7917d0['removeMarker'](_0x4e44f6);}),this['_markers']['clear']();}['switchToReadOnly'](){lt(this['context'])['enableReadOnlyMode']('ai-review-mode');}['switchToEdit'](){lt(this['context'])['disableReadOnlyMode']('ai-review-mode');}['applyChange'](_0xf39e33){const _0x57daf6=lt(this['context']),_0x50a1f3=_0x57daf6['model'],_0x3e2bc9=_0xf39e33['map'](_0x10cfe5=>this['_getMarkersDataForGroup'](_0x10cfe5))['flat']();_0x50a1f3['change'](_0x141532=>{for(const _0x2ea5ee of _0x3e2bc9){const _0x5c3de1=_0x57daf6['model']['markers']['get'](_0x2ea5ee['id']);_0x5c3de1&&('insert'===_0x2ea5ee['type']?_0x50a1f3['insertContent'](_0x141532['createText'](_0x2ea5ee['text']||''),_0x5c3de1['getRange']()['start']):'remove-text'!==_0x2ea5ee['type']&&'remove-only'!==_0x2ea5ee['type']||_0x50a1f3['deleteContent'](_0x50a1f3['createSelection'](_0x5c3de1['getRange']())),_0x141532['removeMarker'](_0x2ea5ee['id']),this['_markers']['delete'](_0x2ea5ee['id']));}});}['rejectChange'](_0x583b6c){const _0x1aeef9=lt(this['context']),_0x4e5426=this['_getMarkersDataForGroup'](_0x583b6c);_0x1aeef9['model']['change'](_0x25ba38=>{for(const _0x2beed7 of _0x4e5426)_0x25ba38['removeMarker'](_0x2beed7['id']),this['_markers']['delete'](_0x2beed7['id']);});}['getContentElement'](){const _0x4df611=lt(this['context']);return _0x4df611&&_0x4df611['ui']&&_0x4df611['ui']['element']?_0x4df611['ui']['element']:null;}['getMarkerElementForChange'](_0x56c8fb){const _0x40ca72=Array['from'](this['_markers']['values']())['filter'](_0x59b749=>_0x59b749['groupId']===_0x56c8fb);if(!_0x40ca72['length'])return null;const _0x800da0=0x1===_0x40ca72['length']?_0x40ca72[0x0]:this['_sortMarkers'](_0x40ca72)[0x0],_0x521b71=lt(this['context']),_0x471535=_0x521b71['model']['markers']['get'](_0x800da0['id']);if(!_0x471535)return null;const _0x1842e1=_0x471535['getRange'](),_0x4e5665=_0x521b71['editing']['view']['getDomRoot']();if(!_0x4e5665||!_0x1842e1)return null;const _0x4645d5=_0x4e5665['querySelector']('[data-marker-id=\x22'+_0x800da0['id']+'\x22]');return _0x4645d5?{'modelRange':_0x1842e1,'domElement':_0x4645d5}:null;}['_translateOperationToEditorContent'](_0x5abb11,_0x24939e,_0x3e8b82){if('insert'===_0x5abb11['type']){const _0x239672=_0x5abb11;return new $t(this['_changePosition'](_0x239672['position'],_0x24939e['concat'](_0x239672['position']['offset']),_0x3e8b82),_0x239672['nodes'],_0x239672['baseVersion']);}if('marker'===_0x5abb11['type']&&_0x5abb11['name']['startsWith']('$markedRemove')){const _0x1fd751=_0x5abb11;return new Bt(_0x1fd751['name'],_0x1fd751['oldRange'],this['_changeRange'](_0x1fd751['newRange'],_0x24939e['concat'](_0x1fd751['newRange']['start']['offset']),_0x24939e['concat'](_0x1fd751['newRange']['end']['offset']),_0x3e8b82),_0x1fd751['_markers'],_0x1fd751['affectsData'],_0x1fd751['baseVersion']);}return _0x5abb11;}['_groupAdjacentOperations'](_0x247dad){if(!_0x247dad['length'])return[];const _0x16b3e8=[];let _0x1e0fc8=0x0,_0x156eb4=0x0,_0x2258c7=[];for(let _0x3d7d4c=0x0;_0x3d7d4c<=_0x247dad['length'];_0x3d7d4c++){const _0x1cd5be=_0x247dad[_0x3d7d4c],_0x555f76=_0x247dad[_0x3d7d4c-0x1];!_0x1cd5be||_0x555f76&&!this['_getOperationEnd'](_0x555f76)['isTouching'](this['_getOperationStart'](_0x1cd5be))?(_0x16b3e8['push']({'operations':_0x2258c7,'operationsIsolated':_0x2258c7['map'](_0x11a63a=>this['_shiftOperation'](_0x11a63a['clone'](),-_0x156eb4)),'groupOffset':_0x1e0fc8}),_0x2258c7=_0x1cd5be?[_0x1cd5be]:[],_0x156eb4+=_0x1e0fc8,_0x1e0fc8=0x0):_0x2258c7['push'](_0x1cd5be),_0x1cd5be&&'insert'===_0x1cd5be['type']&&(_0x1e0fc8+=_0x1cd5be['howMany']);}return _0x16b3e8;}['_findAdjacentContextDistance'](_0xdcf580,_0x5cc6a5,_0x336885,_0x1b4635=0x1){const _0x1c00df=new te({'startPosition':_0xdcf580,'direction':_0x5cc6a5});let _0x1df47c=0x0;for(let _0x6670ea=0x0;_0x6670ea<_0x1b4635;_0x6670ea++){let _0x2a743b=0x0,_0x475ea9=!0x1,_0x20776f='forward'===_0x5cc6a5?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x7af075}of _0x1c00df)if(_0x7af075['is']('$textProxy')){const _0x3a0ffb=_0x20776f['exec'](_0x7af075['data']);if(_0x3a0ffb&&_0x3a0ffb['length']){if(_0x2a743b+='forward'===_0x5cc6a5?_0x3a0ffb['index']+_0x3a0ffb[0x0]['length']:_0x7af075['data']['length']-_0x3a0ffb['index'],_0x3a0ffb[0x0]['length']!==_0x7af075['data']['length'])break;_0x475ea9=!0x0,_0x20776f='forward'===_0x5cc6a5?/^\w+/:/\w+$/;}else{if(_0x475ea9)break;_0x2a743b+=_0x7af075['offsetSize'];}}else{if(_0x7af075['is']('element')){_0x336885['isInline'](_0x7af075)&&!_0x475ea9&&(_0x2a743b+=0x1);break;}}_0x1df47c+=_0x2a743b,_0x1c00df['jumpTo'](_0xdcf580['getShiftedBy']('forward'===_0x5cc6a5?_0x1df47c:-_0x1df47c));}return _0x1df47c;}['_getChangeContext'](_0x4627a4,_0x38a193){const _0x3e566d=lt(this['context'])['model']['schema'],_0xcf95ae=this['_findAdjacentContextDistance'](_0x4627a4,'backward',_0x3e566d,0x6),_0x25e5a9=this['_findAdjacentContextDistance'](_0x38a193,'forward',_0x3e566d,0x6),_0x524d9f=_0x4627a4['getShiftedBy'](-_0xcf95ae),_0x4070c7=_0x38a193['getShiftedBy'](_0x25e5a9);return{'start':_0x524d9f,'end':_0x4070c7,'hasContentBefore':!_0x524d9f['isAtStart'],'hasContentAfter':!_0x4070c7['isAtEnd']};}['_insertMarkers'](_0x36e4cc){const _0x42f2e7=this['context']['plugins']['get']('AIEditing'),_0x4147bf=new Set();lt(this['context'])['model']['change'](_0x15adf8=>{for(const _0x2abed7 of _0x36e4cc){const _0x33b6b6=''+ae+_0x2abed7['type']+':'+_0x2abed7['groupId']+'_'+_0x42f2e7['_nextDataId'](_0x4147bf);this['_markers']['set'](_0x33b6b6,{'id':_0x33b6b6,'groupId':_0x2abed7['groupId'],'type':_0x2abed7['type'],'text':_0x2abed7['text']}),_0x15adf8['addMarker'](_0x33b6b6,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x15adf8['createRange'](_0x2abed7['start'],_0x2abed7['end'])});}});}['_createGetContextFn'](_0x119ca7,_0x5d7f51,_0x3c3c02){let _0x871989='';return()=>{if(!_0x871989){const _0x4bff9a=_0x5d7f51['toView'](_0x119ca7,{'showSuggestionHighlights':!0x0}),_0x4f88b1=_0x4bff9a['getChild'](0x0);if(!_0x4f88b1)return'';let _0x3c188e=!0x1;const _0x531656=[];for(const _0x16106b of _0x4f88b1['getChildren']())_0x16106b['is']('element','span')&&_0x16106b['hasClass']('ck-ai_review-mode-marker_context-end')&&(_0x3c188e=!0x1),_0x3c188e&&_0x531656['push'](_0x16106b),_0x16106b['is']('element','span')&&_0x16106b['hasClass']('ck-ai_review-mode-marker_context-start')&&(_0x3c188e=!0x0);_0x4f88b1['_removeChildren'](0x0,_0x4f88b1['childCount']),_0x3c3c02?.['ellipsisBefore']&&_0x4f88b1['_appendChild']('…'),_0x4f88b1['_appendChild'](_0x531656),_0x3c3c02?.['ellipsisAfter']&&_0x4f88b1['_appendChild']('…');const _0x208341=_0x5d7f51['htmlProcessor']['domConverter']['viewToDom'](_0x4bff9a),_0x3b307b=_0x5d7f51['htmlProcessor']['htmlWriter']['getHtml'](_0x208341);_0x871989=_0x3b307b;}return _0x871989;};}['_createGetContentFn'](_0x334904,_0x545804){let _0x2d67e7='';return()=>(_0x2d67e7||(_0x2d67e7=_0x545804['stringify'](_0x334904,{'showSuggestionHighlights':!0x0})),_0x2d67e7);}['_createGetContentUsingDataIdFn'](_0x433e70,_0x11ccb2,_0x3800ba){let _0x2a8596='';return()=>{if(!_0x2a8596){const _0x198f14=_0x3800ba['toView'](new _0x5acb07(_0x433e70)),_0x2df21c=_0x3800ba['htmlProcessor']['domConverter']['viewToDom'](_0x198f14)['querySelector']('[data-id=\x22'+_0x11ccb2+'\x22]');_0x2a8596=_0x2df21c?.['outerHTML']||'';}return _0x2a8596;};}['_findMarkerElement'](_0x18ad7f,_0x5bfae3=0x5){let _0x4a2104=_0x18ad7f,_0x494d01=null;for(let _0x414e94=0x0;_0x414e94<_0x5bfae3&&_0x4a2104;_0x414e94++){if(!_0x4a2104['className']){_0x4a2104=_0x4a2104['parentElement'];continue;}if(!(''+_0x4a2104['className'])['includes']('ck-ai_review-mode-marker_')){_0x4a2104=_0x4a2104['parentElement'];continue;}if(!_0x4a2104['getAttribute']('data-marker-id'))break;_0x494d01=_0x4a2104;break;}return _0x494d01;}['_getMarkersDataForGroup'](_0x5bc00b){return Array['from'](this['_markers']['values']())['filter'](_0x134738=>_0x134738['groupId']===_0x5bc00b);}['_getOperationStart'](_0x2251cd){return'insert'===_0x2251cd['type']?_0x2251cd['position']:_0x2251cd['newRange']['start'];}['_getOperationEnd'](_0x3c823d,_0x4fb576=!0x1){return'insert'===_0x3c823d['type']?_0x4fb576?_0x3c823d['position']:_0x3c823d['position']['getShiftedBy'](_0x3c823d['howMany']):_0x3c823d['newRange']['end'];}['_shiftOperation'](_0x1b0668,_0x1c4f19){return'insert'===_0x1b0668['type']?_0x1b0668['position']=_0x1b0668['position']['getShiftedBy'](_0x1c4f19):'marker'===_0x1b0668['type']&&_0x1b0668['newRange']&&(_0x1b0668['newRange']=new _0x154493(_0x1b0668['newRange']['start']['getShiftedBy'](_0x1c4f19),_0x1b0668['newRange']['end']['getShiftedBy'](_0x1c4f19))),_0x1b0668;}['_changeOperationOwnerDocument'](_0x172605,_0x4e4a89){'insert'===_0x172605['type']?_0x172605['position']=this['_changePositionOwnerDocument'](_0x172605['position'],_0x4e4a89):'marker'===_0x172605['type']&&_0x172605['newRange']&&(_0x172605['newRange']=this['_changeRangeOwnerDocument'](_0x172605['newRange'],_0x4e4a89));}['_changePositionOwnerDocument'](_0x25f96c,_0x4d295a){return new _0x272e84(_0x4d295a,_0x25f96c['path']);}['_changeRangeOwnerDocument'](_0x4f5b5f,_0x2a4dee){return new _0x154493(this['_changePositionOwnerDocument'](_0x4f5b5f['start'],_0x2a4dee),this['_changePositionOwnerDocument'](_0x4f5b5f['end'],_0x2a4dee));}['_changePosition'](_0x33e5e9,_0x44ea91,_0xb91cbe){return new _0x272e84(_0xb91cbe,[..._0x44ea91]);}['_changeRange'](_0x2ddd6c,_0x6ed881,_0xe697a6,_0x203acc){return new _0x154493(this['_changePosition'](_0x2ddd6c['start'],_0x6ed881,_0x203acc),this['_changePosition'](_0x2ddd6c['end'],_0xe697a6,_0x203acc));}['_sortMarkers'](_0x475cb9){const _0x5413f2=_0x4bdd9d=>{switch(_0x4bdd9d){case'insert':return 0x1;case'remove-context':return 0x2;case'remove-only':return 0x3;case'remove-text':return 0x4;}};return _0x475cb9['sort']((_0x1df6b7,_0x25e6f5)=>_0x5413f2(_0x1df6b7['type'])-_0x5413f2(_0x25e6f5['type']));}}class Ma extends tt{static get['requires'](){return[ee,ie,re];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{Da as AIActions,F as AIAdapter,Or as AIAssistant,x as AIAssistantUI,f as AIBalloon,xa as AIChat,et as AIChatController,at as AIChatHistory,jt as AIChatHistoryController,xt as AIChatHistoryUI,it as AIChatUI,s as AIConnector,h as AIEditing,La as AIEditorIntegration,Ot as AIQuickActionType,Ha as AIQuickActions,ri as AIQuickActionsUI,is as AIRequestError,Fs as AIReviewCheck,Ns as AIReviewCheckResult,pr as AIReviewCheckRun,Ma as AIReviewMode,ee as AIReviewModeController,re as AIReviewModeEditing,ie as AIReviewModeUI,rt as AITabs,we as AITextAdapter,bt as AIToggleButtonUI,Kr as AWSTextAdapter,Hr as OpenAITextAdapter,J as ShowAIAssistantCommand,eo as ToggleAICommand,cs as createResizeButton,Nr as getDefaultAICommands};