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

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 (318) hide show
  1. package/build/ai.js +1 -1
  2. package/dist/index.js +5 -5
  3. package/dist/translations/af.js +1 -1
  4. package/dist/translations/af.umd.js +1 -1
  5. package/dist/translations/ar.js +1 -1
  6. package/dist/translations/ar.umd.js +1 -1
  7. package/dist/translations/ast.js +1 -1
  8. package/dist/translations/ast.umd.js +1 -1
  9. package/dist/translations/az.js +1 -1
  10. package/dist/translations/az.umd.js +1 -1
  11. package/dist/translations/be.js +1 -1
  12. package/dist/translations/be.umd.js +1 -1
  13. package/dist/translations/bg.js +1 -1
  14. package/dist/translations/bg.umd.js +1 -1
  15. package/dist/translations/bn.js +1 -1
  16. package/dist/translations/bn.umd.js +1 -1
  17. package/dist/translations/bs.js +1 -1
  18. package/dist/translations/bs.umd.js +1 -1
  19. package/dist/translations/ca.js +1 -1
  20. package/dist/translations/ca.umd.js +1 -1
  21. package/dist/translations/cs.js +1 -1
  22. package/dist/translations/cs.umd.js +1 -1
  23. package/dist/translations/da.js +1 -1
  24. package/dist/translations/da.umd.js +1 -1
  25. package/dist/translations/de-ch.js +1 -1
  26. package/dist/translations/de-ch.umd.js +1 -1
  27. package/dist/translations/de.js +1 -1
  28. package/dist/translations/de.umd.js +1 -1
  29. package/dist/translations/el.js +1 -1
  30. package/dist/translations/el.umd.js +1 -1
  31. package/dist/translations/en-au.js +1 -1
  32. package/dist/translations/en-au.umd.js +1 -1
  33. package/dist/translations/en-gb.js +1 -1
  34. package/dist/translations/en-gb.umd.js +1 -1
  35. package/dist/translations/en.js +1 -1
  36. package/dist/translations/en.umd.js +1 -1
  37. package/dist/translations/eo.js +1 -1
  38. package/dist/translations/eo.umd.js +1 -1
  39. package/dist/translations/es-co.js +1 -1
  40. package/dist/translations/es-co.umd.js +1 -1
  41. package/dist/translations/es.js +1 -1
  42. package/dist/translations/es.umd.js +1 -1
  43. package/dist/translations/et.js +1 -1
  44. package/dist/translations/et.umd.js +1 -1
  45. package/dist/translations/eu.js +1 -1
  46. package/dist/translations/eu.umd.js +1 -1
  47. package/dist/translations/fa.js +1 -1
  48. package/dist/translations/fa.umd.js +1 -1
  49. package/dist/translations/fi.js +1 -1
  50. package/dist/translations/fi.umd.js +1 -1
  51. package/dist/translations/fr.js +1 -1
  52. package/dist/translations/fr.umd.js +1 -1
  53. package/dist/translations/gl.js +1 -1
  54. package/dist/translations/gl.umd.js +1 -1
  55. package/dist/translations/gu.js +1 -1
  56. package/dist/translations/gu.umd.js +1 -1
  57. package/dist/translations/he.js +1 -1
  58. package/dist/translations/he.umd.js +1 -1
  59. package/dist/translations/hi.js +1 -1
  60. package/dist/translations/hi.umd.js +1 -1
  61. package/dist/translations/hr.js +1 -1
  62. package/dist/translations/hr.umd.js +1 -1
  63. package/dist/translations/hu.js +1 -1
  64. package/dist/translations/hu.umd.js +1 -1
  65. package/dist/translations/hy.js +1 -1
  66. package/dist/translations/hy.umd.js +1 -1
  67. package/dist/translations/id.js +1 -1
  68. package/dist/translations/id.umd.js +1 -1
  69. package/dist/translations/it.js +1 -1
  70. package/dist/translations/it.umd.js +1 -1
  71. package/dist/translations/ja.js +1 -1
  72. package/dist/translations/ja.umd.js +1 -1
  73. package/dist/translations/jv.js +1 -1
  74. package/dist/translations/jv.umd.js +1 -1
  75. package/dist/translations/kk.js +1 -1
  76. package/dist/translations/kk.umd.js +1 -1
  77. package/dist/translations/km.js +1 -1
  78. package/dist/translations/km.umd.js +1 -1
  79. package/dist/translations/kn.js +1 -1
  80. package/dist/translations/kn.umd.js +1 -1
  81. package/dist/translations/ko.js +1 -1
  82. package/dist/translations/ko.umd.js +1 -1
  83. package/dist/translations/ku.js +1 -1
  84. package/dist/translations/ku.umd.js +1 -1
  85. package/dist/translations/lt.js +1 -1
  86. package/dist/translations/lt.umd.js +1 -1
  87. package/dist/translations/lv.js +1 -1
  88. package/dist/translations/lv.umd.js +1 -1
  89. package/dist/translations/ms.js +1 -1
  90. package/dist/translations/ms.umd.js +1 -1
  91. package/dist/translations/nb.js +1 -1
  92. package/dist/translations/nb.umd.js +1 -1
  93. package/dist/translations/ne.js +1 -1
  94. package/dist/translations/ne.umd.js +1 -1
  95. package/dist/translations/nl.js +1 -1
  96. package/dist/translations/nl.umd.js +1 -1
  97. package/dist/translations/no.js +1 -1
  98. package/dist/translations/no.umd.js +1 -1
  99. package/dist/translations/oc.js +1 -1
  100. package/dist/translations/oc.umd.js +1 -1
  101. package/dist/translations/pl.js +1 -1
  102. package/dist/translations/pl.umd.js +1 -1
  103. package/dist/translations/pt-br.js +1 -1
  104. package/dist/translations/pt-br.umd.js +1 -1
  105. package/dist/translations/pt.js +1 -1
  106. package/dist/translations/pt.umd.js +1 -1
  107. package/dist/translations/ro.js +1 -1
  108. package/dist/translations/ro.umd.js +1 -1
  109. package/dist/translations/ru.js +1 -1
  110. package/dist/translations/ru.umd.js +1 -1
  111. package/dist/translations/si.js +1 -1
  112. package/dist/translations/si.umd.js +1 -1
  113. package/dist/translations/sk.js +1 -1
  114. package/dist/translations/sk.umd.js +1 -1
  115. package/dist/translations/sl.js +1 -1
  116. package/dist/translations/sl.umd.js +1 -1
  117. package/dist/translations/sq.js +1 -1
  118. package/dist/translations/sq.umd.js +1 -1
  119. package/dist/translations/sr-latn.js +1 -1
  120. package/dist/translations/sr-latn.umd.js +1 -1
  121. package/dist/translations/sr.js +1 -1
  122. package/dist/translations/sr.umd.js +1 -1
  123. package/dist/translations/sv.js +1 -1
  124. package/dist/translations/sv.umd.js +1 -1
  125. package/dist/translations/th.js +1 -1
  126. package/dist/translations/th.umd.js +1 -1
  127. package/dist/translations/ti.js +1 -1
  128. package/dist/translations/ti.umd.js +1 -1
  129. package/dist/translations/tk.js +1 -1
  130. package/dist/translations/tk.umd.js +1 -1
  131. package/dist/translations/tr.js +1 -1
  132. package/dist/translations/tr.umd.js +1 -1
  133. package/dist/translations/tt.js +1 -1
  134. package/dist/translations/tt.umd.js +1 -1
  135. package/dist/translations/ug.js +1 -1
  136. package/dist/translations/ug.umd.js +1 -1
  137. package/dist/translations/uk.js +1 -1
  138. package/dist/translations/uk.umd.js +1 -1
  139. package/dist/translations/ur.js +1 -1
  140. package/dist/translations/ur.umd.js +1 -1
  141. package/dist/translations/uz.js +1 -1
  142. package/dist/translations/uz.umd.js +1 -1
  143. package/dist/translations/vi.js +1 -1
  144. package/dist/translations/vi.umd.js +1 -1
  145. package/dist/translations/zh-cn.js +1 -1
  146. package/dist/translations/zh-cn.umd.js +1 -1
  147. package/dist/translations/zh.js +1 -1
  148. package/dist/translations/zh.umd.js +1 -1
  149. package/package.json +15 -15
  150. package/src/aiactions/aiactions.js +1 -1
  151. package/src/aiactions/model/aiactionsinteraction.js +1 -1
  152. package/src/aiactions/model/aiactionsreply.js +1 -1
  153. package/src/aiassistant/adapters/aiadapter.js +1 -1
  154. package/src/aiassistant/adapters/aitextadapter.js +1 -1
  155. package/src/aiassistant/adapters/awstextadapter.js +1 -1
  156. package/src/aiassistant/adapters/openaitextadapter.js +1 -1
  157. package/src/aiassistant/aiassistant.js +1 -1
  158. package/src/aiassistant/aiassistantediting.js +1 -1
  159. package/src/aiassistant/aiassistantui.js +1 -1
  160. package/src/aiassistant/legacyerrors.js +1 -1
  161. package/src/aiassistant/ui/aiassistantcontroller.js +2 -2
  162. package/src/aiassistant/ui/form/aiformcontentarea.js +1 -1
  163. package/src/aiassistant/ui/form/aiformerrorview.js +1 -1
  164. package/src/aiassistant/ui/form/aiformpromptview.js +1 -1
  165. package/src/aiassistant/ui/form/aiformtoolbarview.js +1 -1
  166. package/src/aiassistant/ui/form/aiformview.js +1 -1
  167. package/src/aiassistant/ui/form/aihistorylistitemview.js +1 -1
  168. package/src/aiassistant/ui/form/aihistorylistview.js +1 -1
  169. package/src/aiassistant/ui/form/prompthistory.js +1 -1
  170. package/src/aiassistant/ui/showaiassistantcommand.js +1 -1
  171. package/src/aiassistant/utils/common-translations.js +1 -1
  172. package/src/aiassistant/utils/normalizecommandsconfig.js +1 -1
  173. package/src/aiballoon/aiballoon.js +1 -1
  174. package/src/aiballoon/ui/aiballoonview.js +1 -1
  175. package/src/aichat/aichat.js +1 -1
  176. package/src/aichat/aichatballoon.js +1 -1
  177. package/src/aichat/aichatcontroller.js +1 -1
  178. package/src/aichat/aichatui.js +1 -1
  179. package/src/aichat/model/aichatcontext.js +1 -1
  180. package/src/aichat/model/aichatconversation.js +1 -1
  181. package/src/aichat/model/aichatinteraction.js +1 -1
  182. package/src/aichat/ui/aichatballoonview.js +1 -1
  183. package/src/aichat/ui/aichatcontrolsview.js +1 -1
  184. package/src/aichat/ui/aichatfeedview.js +1 -1
  185. package/src/aichat/ui/aichatheaderview.js +1 -1
  186. package/src/aichat/ui/aichatview.js +1 -1
  187. package/src/aichat/ui/controls/aichatchipsoverflowmanager.js +1 -1
  188. package/src/aichat/ui/controls/aichatcontextitembuttonview.js +1 -1
  189. package/src/aichat/ui/controls/aichatcontextpanelurlinputview.js +1 -1
  190. package/src/aichat/ui/controls/aichatcontextpanelview.js +1 -1
  191. package/src/aichat/ui/controls/aichatcontrolsloaderview.js +1 -1
  192. package/src/aichat/ui/controls/aichatpromptcapabilitiesview.js +1 -1
  193. package/src/aichat/ui/controls/aichatpromptinputview.js +1 -1
  194. package/src/aichat/ui/controls/aichatpromptsuggestionslistview.js +1 -1
  195. package/src/aichat/ui/controls/resources/aichatcontextresourceslistview.js +1 -1
  196. package/src/aichat/ui/controls/resources/aichatcontextresourcesview.js +1 -1
  197. package/src/aichat/ui/controls/resources/aichatresourcelistitemview.js +1 -1
  198. package/src/aichat/ui/controls/resources/aichatresourcesballoonview.js +1 -1
  199. package/src/aichat/ui/controls/resources/aichatresourcessearchinputview.js +1 -1
  200. package/src/aichat/ui/feed/aichatfeedcontextchipsview.js +1 -1
  201. package/src/aichat/ui/feed/aichatfeedcustomelementview.js +1 -1
  202. package/src/aichat/ui/feed/aichatfeederroritemview.js +1 -1
  203. package/src/aichat/ui/feed/aichatfeedinteractionheaderview.js +1 -1
  204. package/src/aichat/ui/feed/aichatfeeditemview.js +1 -1
  205. package/src/aichat/ui/feed/aichatfeedreplyitemview.js +1 -1
  206. package/src/aichat/ui/feed/aichatfeedsuggestionitemactionsview.js +1 -1
  207. package/src/aichat/ui/feed/aichatfeedsuggestionitemview.js +1 -1
  208. package/src/aichat/ui/feed/aichatfeedusermessageitem.js +1 -1
  209. package/src/aichat/utils/eventnames.js +1 -1
  210. package/src/aichat/utils/promisequeue.js +1 -1
  211. package/src/aichathistory/aichathistory.js +1 -1
  212. package/src/aichathistory/aichathistorycontroller.js +1 -1
  213. package/src/aichathistory/aichathistoryui.js +1 -1
  214. package/src/aichathistory/model/aichathistoryconversations.js +1 -1
  215. package/src/aichathistory/model/aichathistoryitem.js +1 -1
  216. package/src/aichathistory/ui/aichathistorylistitemview.js +2 -2
  217. package/src/aichathistory/ui/aichathistorylistview.js +1 -1
  218. package/src/aichathistory/ui/aichathistorysectionlistview.js +1 -1
  219. package/src/aichathistory/ui/aichathistoryview.js +1 -1
  220. package/src/aichatshortcuts/aichatshortcuts.js +1 -1
  221. package/src/aichatshortcuts/ui/aichatshortcutsview.js +1 -1
  222. package/src/aichatshortcuts/ui/aichatshortcutview.js +1 -1
  223. package/src/aicore/aiconnector.js +1 -1
  224. package/src/aicore/aiediting.js +1 -1
  225. package/src/aicore/model/aicapabilities.js +1 -1
  226. package/src/aicore/model/aicontext.js +1 -1
  227. package/src/aicore/model/aiinteraction.js +1 -1
  228. package/src/aicore/model/aimodels.js +1 -1
  229. package/src/aicore/model/aireply.js +1 -1
  230. package/src/aicore/pipeline/airesponseapplier.js +2 -2
  231. package/src/aicore/pipeline/airesponseparser.js +2 -2
  232. package/src/aicore/ui/aidisclaimerview.js +1 -1
  233. package/src/aicore/ui/aiskeleton.js +1 -1
  234. package/src/aicore/ui/aispinner.js +1 -1
  235. package/src/aicore/ui/suggestioncontainer/aiminitoolbarview.js +1 -1
  236. package/src/aicore/ui/suggestioncontainer/aisuggestionbodyview.js +1 -1
  237. package/src/aicore/ui/suggestioncontainer/aisuggestioncontainerview.js +1 -1
  238. package/src/aicore/ui/suggestioncontainer/aisuggestioncontentpartheaderview.js +1 -1
  239. package/src/aicore/ui/suggestioncontainer/aisuggestioncontentpartstateview.js +1 -1
  240. package/src/aicore/ui/suggestioncontainer/aisuggestioncontentparttoolbarview.js +1 -1
  241. package/src/aicore/ui/suggestioncontainer/aisuggestioncontentpartview.js +1 -1
  242. package/src/aicore/ui/suggestioncontainer/aisuggestionheaderview.js +1 -1
  243. package/src/aicore/ui/suggestioncontainer/aisuggestionloaderview.js +1 -1
  244. package/src/aicore/ui/suggestioncontainer/aisuggestionstreamablecontentview.js +1 -1
  245. package/src/aicore/ui/suggestioncontainer/aiwebsourcesview.js +1 -1
  246. package/src/aicore/utils/common-translations.js +1 -1
  247. package/src/aicore/utils/createresizebutton.js +1 -1
  248. package/src/aicore/utils/documentposition.js +1 -1
  249. package/src/aicore/utils/documentrange.js +1 -1
  250. package/src/aicore/utils/eventnames.js +1 -1
  251. package/src/aicore/utils/geteditorfromcontext.js +1 -1
  252. package/src/aicore/utils/getoperationsfromreply.js +1 -1
  253. package/src/aicore/utils/getsuggestionpartsfromreply.js +1 -1
  254. package/src/aicore/utils/htmlparser.js +1 -1
  255. package/src/aicore/utils/htmlstreamer.js +1 -1
  256. package/src/aicore/utils/scrollmanager.js +1 -1
  257. package/src/aieditorintegration/aieditorintegration.js +1 -1
  258. package/src/aieditorintegration/aitogglebutton/aitogglebuttonui.js +1 -1
  259. package/src/aieditorintegration/aitogglebutton/toggleaicommand.js +1 -1
  260. package/src/aiquickactions/aiquickactions.js +1 -1
  261. package/src/aiquickactions/aiquickactionscommand.js +1 -1
  262. package/src/aiquickactions/aiquickactionsediting.js +1 -1
  263. package/src/aiquickactions/aiquickactionsui.js +1 -1
  264. package/src/aiquickactions/ui/aiquickactionsbuttoncreator.js +1 -1
  265. package/src/aiquickactions/ui/aiquickactionsdropdowncontentview.js +1 -1
  266. package/src/aiquickactions/ui/aiquickactionsdropdowncreator.js +1 -1
  267. package/src/aiquickactions/ui/aiquickactionsfilteredlistview.js +1 -1
  268. package/src/aiquickactions/ui/balloon/aiactionsballoondisclaimerview.js +1 -1
  269. package/src/aiquickactions/ui/balloon/aiactionsballoontoolbarview.js +1 -1
  270. package/src/aiquickactions/ui/balloon/aiactionsballoonview.js +1 -1
  271. package/src/aiquickactions/ui/dropdownmenubuttonwithhighlightview.js +1 -1
  272. package/src/aireviewcore/aireviewcorecontroller.js +1 -1
  273. package/src/aireviewcore/aireviewcoreediting.js +1 -1
  274. package/src/aireviewcore/aireviewcoreui.js +1 -1
  275. package/src/aireviewcore/model/aireviewcheck.js +1 -1
  276. package/src/aireviewcore/model/aireviewchecklist.js +1 -1
  277. package/src/aireviewcore/model/aireviewcheckresult.js +1 -1
  278. package/src/aireviewcore/model/aireviewcheckresultchange.js +1 -1
  279. package/src/aireviewcore/model/aireviewcheckrun.js +1 -1
  280. package/src/aireviewcore/model/aireviewsystemcheckrun.js +1 -1
  281. package/src/aireviewcore/ui/aireviewcoreballoonsuggestionview.js +1 -1
  282. package/src/aireviewcore/ui/aireviewcorechecklistitemresultview.js +1 -1
  283. package/src/aireviewcore/ui/aireviewcorecustomcheckview.js +1 -1
  284. package/src/aireviewcore/ui/aireviewcorefinishreviewbuttonview.js +1 -1
  285. package/src/aireviewcore/ui/aireviewcoregeneralerrorview.js +1 -1
  286. package/src/aireviewcore/ui/aireviewcorepromptinputview.js +1 -1
  287. package/src/aireviewcore/ui/aireviewcorereviewchecklistview.js +1 -1
  288. package/src/aireviewcore/ui/aireviewcorereviewcommandlistitemview.js +1 -1
  289. package/src/aireviewcore/ui/aireviewcorereviewcompletedview.js +1 -1
  290. package/src/aireviewcore/ui/aireviewcoreuicheckresultsview.js +1 -1
  291. package/src/aireviewcore/ui/aireviewcoreview.js +1 -1
  292. package/src/aireviewcore/ui/form/aireviewcoreformdropdown.js +1 -1
  293. package/src/aireviewcore/ui/form/aireviewcoreformmanager.js +1 -1
  294. package/src/aireviewmode/aireviewcheckdefinitions.js +1 -1
  295. package/src/aireviewmode/aireviewmode.js +1 -1
  296. package/src/aireviewmode/aireviewmodecontroller.js +1 -1
  297. package/src/aireviewmode/aireviewmodeui.js +1 -1
  298. package/src/aireviewmode/model/aireviewcheckcustom.js +1 -1
  299. package/src/aireviewmode/model/aireviewcheckextra.js +1 -1
  300. package/src/aireviewmode/model/aireviewcustomcheckrun.js +1 -1
  301. package/src/aireviewmode/model/aireviewextracheckrun.js +1 -1
  302. package/src/aireviewmode/model/aireviewmodechecklist.js +1 -1
  303. package/src/aitabs/aitabs.js +1 -1
  304. package/src/aitabs/aitabsmainview.js +1 -1
  305. package/src/aitabs/tabs/aitabsview.js +1 -1
  306. package/src/aitabs/tabs/tabbuttonview.js +1 -1
  307. package/src/aitabs/tabs/tabpanelview.js +1 -1
  308. package/src/aitranslate/aitranslate.js +1 -1
  309. package/src/aitranslate/aitranslatecontroller.js +1 -1
  310. package/src/aitranslate/aitranslateui.js +1 -1
  311. package/src/aitranslate/model/aitranslatecheck.js +1 -1
  312. package/src/aitranslate/model/aitranslatechecklist.js +1 -1
  313. package/src/aitranslate/model/aitranslatecheckrun.js +1 -1
  314. package/src/aitranslate/ui/aitranslatechecklistview.js +1 -1
  315. package/src/aitranslate/ui/aitranslatecheckresultsview.js +1 -1
  316. package/src/errors.js +1 -1
  317. package/src/errorsmap.js +1 -1
  318. package/src/index.js +1 -1
package/dist/index.js CHANGED
@@ -20,8 +20,8 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x558b99,Command as Lt,ContextPlugin as _0x3de4b5,Editor as dt}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x16d0de,IconCheck as _0x13f61e,IconError as _0x32c77e,IconSubmit as _0x2a6e28,IconAIHistory as Nt,IconMagicWand as _0x1da90a,IconRobotPencil as _0x2fe681,IconMaximize as _0x14a2a8,IconMinimize as _0x318b82,IconShowChangesOn as _0x6ecf94,IconShowChangesOff as _0xe8e21c,IconDocument as _0x239981,IconBoxWithCross as _0x3ada2f,IconBoxWithCheck as _0x161dde,IconBoxWithMarker as _0xd1c008,IconInfo as _0x3f0ea0,IconLoupe as _0x1a07b3,IconCancel as _0x58fd68,IconStop as _0xaf27a6,IconAIChat as vt,IconPlus as _0x5deb17,IconPin as _0x194933,IconThreeHorizontalDots as _0x38a34c,IconChevronDown as _0x2d9b3b,IconChevronUp as _0x10f0b1,IconOutdated as tc,IconEye as _0x146a4f,IconEyeCrossedOut as _0x541710,IconChevronRight as _0x4df6ac,IconAIReview as _0x2dc573,IconAITranslate as _0x1cce89}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x589eaf,CKEditorError as _0x54686c,ObservableMixin as ts,global as _0x4b8472,isVisible as _0x23b8f5,Rect as _0x182987,Collection as _0x207453,FocusTracker as _0x49bffd,KeystrokeHandler as _0x287999,first as _0x97da1c,logWarning as _0x73e170,logError as gt,toArray as _0x32132b,EmitterMixin as _0x12cec9,scrollViewportToShowTarget as _0x1dbe2e,scrollAncestorsToShowTarget as _0x59e8aa,ResizeObserver as _0x477005,_isMotionReduced as Rt,getConstrainedViewportRect as _0x48c4b5,DomEmitterMixin as _0x3d476c}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x28f204,ButtonView as _0x28db64,View as _0x25f6b6,SpinnerView as _0x39a237,IconView as _0x283d41,AutocompleteView as _0x19cfd0,ListView as _0x56abe9,ListItemGroupView as _0x4579fe,ListItemView as _0x1cf10a,ButtonLabelView as _0x594a98,FocusCycler as _0x596602,createLabeledTextarea as _0x17d079,Dialog as _0x14d881,createDropdown as _0x340743,addMenuToDropdown as _0x4397ea,MenuBarMenuView as _0x2e7068,MenuBarMenuListItemButtonView as _0x42f0b4,DialogViewPosition as _0x35a191,MenuBarMenuListView as _0x3d7509,MenuBarMenuListItemView as _0x11788c,BodyCollection as _0x74da33,BalloonPanelView as _0x132eb0,clickOutsideHandler as _0x13f50b,addListToDropdown as _0x1fdd70,UIModel as _0x173411,submitHandler as _0x3b3248,LabeledFieldView as _0x4318b8,createLabeledInputText as th,FormHeaderView as _0x214d1d,HighlightedTextView as _0x139c4b,ViewCollection as _0x3fe74c,FileDialogButtonView as _0x7b6044,InputTextView as _0x19df65,SearchTextView as _0x39747a,ListItemButtonView as _0x484834,ButtonLabelWithHighlightView as _0x4a5be9,DropdownMenuPanelPositioningFunctions as _0x20372a,BalloonToolbar as te,FormRowView as _0x273186,TextareaView as _0x247703}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x354057,ClipboardMarkersUtils as _0x352a41}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x29ed40,ViewDataTransfer as _0x1ba4cd,ViewUpcastWriter as _0x1afb2b,Matcher as _0x4c8fa8,_DetachOperation as et,_insertIntoModelNodeList as _0x203d29,_removeFromModelNodeList as to,ModelRange as it,transformOperationSets as nt,ViewDowncastWriter as Dt,ModelDocumentFragment as tt,ModelPosition as st,ModelTreeWalker as _0x18a58a,MarkerOperation as _0x3f2bd2,InsertOperation as _0x58153c}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x3dc617,escape as _0x169b70,escapeRegExp as _0x2fe64e,debounce as _0x3dc05e}from'es-toolkit/compat';import{createParser as $t}from'eventsource-parser';import{parseDocument as _0x318981}from'htmlparser2';import{isTag as _0x1415cb,findOne as yt,getParent as _0x3d07f5,findAll as _0x53d6a8,removeElement as _0x2a3aa1,replaceElement as _0x304ded,prepend as _0x17e3d4,prependChild as _0x47697d,appendChild as _0x283409,append as _0x5a8aef,find as _0x188181,isComment as _0x3604f6,getChildren as _0x3d261d,textContent as _0x63493}from'domutils';import _0x3d00aa from'dom-serializer';import{Document as Et,Element as _0x5fd8c8,Text as _0x5dcbfa,cloneNode as _0xe31279,isDocument as _0x4d2112,isText as _0x1f8133,NodeWithChildren as _0x74a3ae}from'domhandler';import{MarkdownGfmMdToHtml as _0x52bcce}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x434e3f,DocumentCompare as _0x29b670,DATA_ID_MODEL_ATTRIBUTE as Ct,ConfirmMixin as _0x4d7972,LateFocusDropdownButtonView as _0x5c73fa,getAllMarkersDomElementsSorted as _0x133f0e,SuggestionsConversion as zt,DATA_ID_VIEW_ATTRIBUTE as _0x3b8ea2,getMarkerDomElement as _0x301572}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x4210b4}from'es-toolkit';import _0x5470ef from'morphdom';import{IconWeb as _0x395f9,IconClose as _0x373232,IconDocument as _0x5e59e8,IconSelection as _0x50d8ea,IconFileUpload as _0x4f5d8d,IconLink as _0x11a450,IconBulb as _0x6f2f23,IconAI as _0x187a3e,IconPreviousArrow as _0x40452e,IconCheck as _0x5d07bd,IconDocumentOutline as _0xc05306,IconPaperClip as _0xe48ba7,IconBrowseFiles as _0x5e20bd,IconDropdownArrow as _0x4f22f1,IconAIChat as _0x4e54e3,IconAIReview as _0x3f4a47,IconAITranslate as Vt,IconAIAskAI as _0x2533ea,IconThumbUp as _0x37c703,IconThumbDown as _0x4bfbd1,IconCopy as _0x1e31e5,IconShowChangesOff as _0x37b528,IconShowChangesOn as _0x477b28,IconAIQuickActions as _0x12fe1f,IconAIChatCommands as Gt,IconAIImproveWriting as Bt,IconAIContinueWriting as Ft,IconAIGrammarCheck as Wt,IconAIAdjustLength as Kt,IconAIChangeTone as Yt,IconAIOther as Jt,IconRefresh as _0x19fd2d,IconNextArrow as _0x3efd11}from'@ckeditor/ckeditor5-icons/dist/index.js';import{diffArrays as _0xaf8377}from'diff';const x='_ungrouppedCommands';function o(_0x88bbe,_0xe3fc99){const _0x588769=(0x0,_0xe3fc99['t'])('Other');return _0x88bbe['length']?'groupId'in _0x88bbe[0x0]?_0x88bbe:[{'groupId':x,'groupLabel':_0x588769,'order':0x1/0x0,'commands':_0x88bbe}]:[{'groupId':x,'groupLabel':_0x588769,'order':0x1/0x0,'commands':[]}];}const Kn=globalThis['DataTransfer'],f='ai-ui';class a extends _0x558b99{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x5c59fa}=this,_0x4a9785=['ck-fake-ai-selection'];_0x5c59fa['config']['get']('ai.assistant.useTheme')&&_0x4a9785['push']('ck-ai-assistant-ui_theme'),_0x5c59fa['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x4a9785,'priority':0xc}}),_0x5c59fa['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x544744,{writer:_0x41dbc7})=>{if(!_0x544744['markerRange']['isCollapsed'])return null;const _0x5d7287=_0x41dbc7['createUIElement']('span');return _0x41dbc7['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x5d7287),_0x5d7287;}});}['afterInit'](){!async function(_0x713be0){const _0x4ff931=_0xf46fbf([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]),_0x2a8497=0x3dffc4e1,_0x31fe4c=0x3df843b1^_0x2a8497,_0x61b7ed=window[_0xf46fbf([0x44,0x61,0x74,0x65])][_0xf46fbf([0x6e,0x6f,0x77])](),_0x5b556a=_0x713be0[_0xf46fbf([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x2bb858=new window[(_0xf46fbf([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4c6329=>{_0x5b556a[_0xf46fbf([0x6f,0x6e,0x63,0x65])](_0xf46fbf([0x72,0x65,0x61,0x64,0x79]),_0x4c6329);}),_0x5a6857={[_0xf46fbf([0x6b,0x74,0x79])]:_0xf46fbf([0x45,0x43]),[_0xf46fbf([0x75,0x73,0x65])]:_0xf46fbf([0x73,0x69,0x67]),[_0xf46fbf([0x63,0x72,0x76])]:_0xf46fbf([0x50,0x2d,0x32,0x35,0x36]),[_0xf46fbf([0x78])]:_0xf46fbf([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]),[_0xf46fbf([0x79])]:_0xf46fbf([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]),[_0xf46fbf([0x61,0x6c,0x67])]:_0xf46fbf([0x45,0x53,0x32,0x35,0x36])},_0x9c7572=_0x5b556a[_0xf46fbf([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0xf46fbf([0x67,0x65,0x74])](_0xf46fbf([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x9df4d1(){let _0x3742ef,_0x17f695=null,_0x38ff9b=null;try{if(_0x9c7572==_0xf46fbf([0x47,0x50,0x4c]))return _0xf46fbf([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x3742ef=_0x347bc4(),!_0x3742ef)return _0xf46fbf([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x3742ef[_0xf46fbf([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x38ff9b=_0xb7ad28(_0x3742ef[_0xf46fbf([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x3742ef[_0xf46fbf([0x6a,0x74,0x69])])),await _0x8c9c26()?_0x438e3a()?_0x3ab38f()?_0xf46fbf([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x15f6ca()?(_0x3742ef[_0xf46fbf([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0xf46fbf([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x17f695=_0x25bb25(_0xf46fbf([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x308881()):_0xf46fbf([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0xf46fbf([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0xf46fbf([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0xf46fbf([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x3ab38f(){const _0x449485=[_0xf46fbf([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0xf46fbf([0x74,0x72,0x69,0x61,0x6c])][_0xf46fbf([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3742ef[_0xf46fbf([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x61b7ed/0x3e8:0xe10*_0x31fe4c;return _0x3742ef[_0xf46fbf([0x65,0x78,0x70])]<_0x449485;}function _0x438e3a(){const _0x22d7a6=_0x3742ef[_0xf46fbf([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x22d7a6&&(!!_0x22d7a6[_0xf46fbf([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xf46fbf([0x2a]))||!!_0x22d7a6[_0xf46fbf([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xf46fbf([0x41,0x49])));}function _0x15f6ca(){const _0x53eaad=_0x3742ef[_0xf46fbf([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x53eaad||0x0==_0x53eaad[_0xf46fbf([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x2bf52a}=new URL(window[_0xf46fbf([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x53eaad[_0xf46fbf([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2bf52a))return!0x0;const _0x52037b=_0x2bf52a[_0xf46fbf([0x73,0x70,0x6c,0x69,0x74])](_0xf46fbf([0x2e]));return _0x53eaad[_0xf46fbf([0x66,0x69,0x6c,0x74,0x65,0x72])](_0xbc2d56=>_0xbc2d56[_0xf46fbf([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xf46fbf([0x2a])))[_0xf46fbf([0x6d,0x61,0x70])](_0x401b58=>_0x401b58[_0xf46fbf([0x73,0x70,0x6c,0x69,0x74])](_0xf46fbf([0x2e])))[_0xf46fbf([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x2ae50d=>_0x2ae50d[_0xf46fbf([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x52037b[_0xf46fbf([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0xf46fbf([0x6d,0x61,0x70])](_0x9b3cf0=>Array(_0x52037b[_0xf46fbf([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x9b3cf0[_0xf46fbf([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0xf46fbf([0x66,0x69,0x6c,0x6c])](_0x9b3cf0[0x0]===_0xf46fbf([0x2a])?_0xf46fbf([0x2a]):'')[_0xf46fbf([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x9b3cf0))[_0xf46fbf([0x73,0x6f,0x6d,0x65])](_0x4cadbe=>_0x52037b[_0xf46fbf([0x65,0x76,0x65,0x72,0x79])]((_0x1b8fd7,_0x45f818)=>_0x4cadbe[_0x45f818]===_0x1b8fd7||_0x4cadbe[_0x45f818]===_0xf46fbf([0x2a])));}function _0x308881(){return _0x17f695&&_0x38ff9b?new window[(_0xf46fbf([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x536201,_0x5c1b96)=>{_0x17f695[_0xf46fbf([0x74,0x68,0x65,0x6e])](_0x536201,_0x5c1b96),_0x38ff9b[_0xf46fbf([0x74,0x68,0x65,0x6e])](_0x1d4307=>{_0x1d4307!=_0xf46fbf([0x56,0x61,0x6c,0x69,0x64])&&_0x536201(_0x1d4307);},_0x5c1b96);}):_0x17f695||_0x38ff9b||_0xf46fbf([0x56,0x61,0x6c,0x69,0x64]);}}function _0xb7ad28(_0x5532a6,_0x556b13){return new window[(_0xf46fbf([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4b80d4=>{if(_0x48e63e())return _0x4b80d4(_0xf46fbf([0x56,0x61,0x6c,0x69,0x64]));_0x258cea(),_0x5b556a[_0xf46fbf([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0xf46fbf([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x92041=!0x1;const _0x11ae51=_0x589eaf();function _0x13539c(_0x329667){return!!_0x329667&&(typeof _0x329667===_0xf46fbf([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x329667===_0xf46fbf([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x329667[_0xf46fbf([0x74,0x68,0x65,0x6e])]===_0xf46fbf([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x329667[_0xf46fbf([0x63,0x61,0x74,0x63,0x68])]===_0xf46fbf([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x31e579(_0x30c6b6){_0x5cc64c(_0x30c6b6)[_0xf46fbf([0x74,0x68,0x65,0x6e])](_0x2120a6=>{if(!_0x2120a6||_0x2120a6[_0xf46fbf([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0xf46fbf([0x6f,0x6b]))return _0xf46fbf([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x333f12(_0x52c203(_0x11ae51+_0x556b13))!=_0x2120a6[_0xf46fbf([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0xf46fbf([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0xf46fbf([0x56,0x61,0x6c,0x69,0x64]);})[_0xf46fbf([0x74,0x68,0x65,0x6e])](_0x348137=>(_0x1ee340(),_0x348137),()=>{const _0x3df610=_0x43346c();return null==_0x3df610?(_0x1ee340(),_0xf46fbf([0x56,0x61,0x6c,0x69,0x64])):_0xf46fbf(_0x61b7ed-_0x3df610>(0x19f340e1^_0x2a8497)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0xf46fbf([0x74,0x68,0x65,0x6e])](_0x4b80d4)[_0xf46fbf([0x63,0x61,0x74,0x63,0x68])](()=>{_0x4b80d4(_0xf46fbf([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x80e0a2=0x3dc92a61^_0x2a8497;function _0x1ee340(){const _0x364594=_0xf46fbf([0x6c,0x6c,0x63,0x74,0x2d])+_0x333f12(_0x52c203(_0x5532a6)),_0x2a8a83=_0x4024fb(_0x333f12(window[_0xf46fbf([0x4d,0x61,0x74,0x68])][_0xf46fbf([0x63,0x65,0x69,0x6c])](_0x61b7ed/_0x80e0a2)));window[_0xf46fbf([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0xf46fbf([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x364594,_0x2a8a83);}function _0x43346c(){const _0x46c08d=_0xf46fbf([0x6c,0x6c,0x63,0x74,0x2d])+_0x333f12(_0x52c203(_0x5532a6)),_0x2968f3=window[_0xf46fbf([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0xf46fbf([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x46c08d);return _0x2968f3?window[_0xf46fbf([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4024fb(_0x2968f3),0x10)*_0x80e0a2:null;}function _0x5cc64c(_0x5c8c42){return new window[(_0xf46fbf([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x568fd6,_0x397a15)=>{_0x5c8c42[_0xf46fbf([0x74,0x68,0x65,0x6e])](_0x568fd6,_0x397a15),window[_0xf46fbf([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x397a15,0x3dfe1021^_0x2a8497);});}}_0x5b556a[_0xf46fbf([0x6f,0x6e])](_0xf46fbf([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x53bb9f,_0x39d448)=>{if(_0x39d448[0x0]!=_0x5532a6)return _0x4b80d4(_0xf46fbf([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x39d448[0x1]={..._0x39d448[0x1],[_0xf46fbf([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x11ae51};},{[_0xf46fbf([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0xf46fbf([0x68,0x69,0x67,0x68])}),_0x5b556a[_0xf46fbf([0x6f,0x6e])](_0xf46fbf([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x1610b7=>{_0x13539c(_0x1610b7[_0xf46fbf([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x92041=!0x0,_0x31e579(_0x1610b7[_0xf46fbf([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0xf46fbf([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0xf46fbf([0x6c,0x6f,0x77])}),_0x2bb858[_0xf46fbf([0x74,0x68,0x65,0x6e])](()=>{_0x92041||_0x4b80d4(_0xf46fbf([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x48e63e(){return _0x5b556a[_0xf46fbf([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0xf46fbf([0x76,0x69,0x65,0x77])][_0xf46fbf([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0xf46fbf([0x61,0x75,0x74,0x6f]);}function _0x258cea(){_0x5b556a[_0xf46fbf([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0xf46fbf([0x76,0x69,0x65,0x77])][_0xf46fbf([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0xf46fbf([0x61,0x75,0x74,0x6f]);}}function _0x25bb25(_0x52fb94){const _0x253a9e=[new window[(_0xf46fbf([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1330fb=>setTimeout(_0x1330fb,0x3df6fa2d^_0x2a8497)),_0x2bb858[_0xf46fbf([0x74,0x68,0x65,0x6e])](()=>new window[(_0xf46fbf([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1f98fd=>{let _0x481ad8=0x0;_0x5b556a[_0xf46fbf([0x6d,0x6f,0x64,0x65,0x6c])][_0xf46fbf([0x6f,0x6e])](_0xf46fbf([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x198aaf,_0x4298d4)=>{_0x4298d4[0x0][_0xf46fbf([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x481ad8++,_0x481ad8==(0x3dffc109^_0x2a8497)&&(_0x1f98fd(),_0x198aaf[_0xf46fbf([0x6f,0x66,0x66])]());});}))];return window[_0xf46fbf([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0xf46fbf([0x72,0x61,0x63,0x65])](_0x253a9e)[_0xf46fbf([0x74,0x68,0x65,0x6e])](()=>_0x52fb94);}async function _0x59123f(){await _0x2bb858,_0x5b556a[_0xf46fbf([0x6d,0x6f,0x64,0x65,0x6c])][_0xf46fbf([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x27a7a2,_0x5b556a[_0xf46fbf([0x6d,0x6f,0x64,0x65,0x6c])][_0xf46fbf([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x27a7a2,_0x5b556a[_0xf46fbf([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0xf46fbf([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x6aa098(_0x3d2715){const _0x2cde4e=_0xc9e982();_0x5b556a[_0x2cde4e]=_0xf46fbf([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x3d2715,_0x3d2715!=_0xf46fbf([0x56,0x61,0x6c,0x69,0x64])&&_0x59123f();}function _0xc9e982(){const _0x4c5965=window[_0xf46fbf([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0xf46fbf([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0xf46fbf([0x6e,0x6f,0x77])]())[_0xf46fbf([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0xf46fbf([0x2e]),'');let _0x2f6bcd=_0xf46fbf([0x6e]);for(let _0x1db02f=0x0;_0x1db02f<_0x4c5965[_0xf46fbf([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1db02f+=0x2){let _0x3db3ed=window[_0xf46fbf([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4c5965[_0xf46fbf([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x1db02f,_0x1db02f+0x2));_0x3db3ed>=_0x4ff931[_0xf46fbf([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x3db3ed-=_0x4ff931[_0xf46fbf([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x2f6bcd+=_0x4ff931[_0x3db3ed];}return _0x2f6bcd;}function _0x347bc4(){const _0x3d4776=_0x9c7572[_0xf46fbf([0x73,0x70,0x6c,0x69,0x74])](_0xf46fbf([0x2e]));if(0x3!=_0x3d4776[_0xf46fbf([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x1b3c3d(_0x3d4776[0x1]);function _0x1b3c3d(_0xda765a){const _0x4a667c=_0x10580e(_0xda765a);return _0x4a667c&&_0x31bdaa()?_0x4a667c:null;function _0x31bdaa(){const _0xfae25d=_0x4a667c[_0xf46fbf([0x6a,0x74,0x69])],_0x259dd6=window[_0xf46fbf([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xfae25d[_0xf46fbf([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0xfae25d[_0xf46fbf([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0xcfedc4={..._0x4a667c,[_0xf46fbf([0x6a,0x74,0x69])]:_0xfae25d[_0xf46fbf([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0xfae25d[_0xf46fbf([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0xcfedc4[_0xf46fbf([0x76,0x63])],_0x52c203(_0xcfedc4)==_0x259dd6;}}}async function _0x8c9c26(){let _0x581ee8=!0x0;try{const _0x185018=_0x9c7572[_0xf46fbf([0x73,0x70,0x6c,0x69,0x74])](_0xf46fbf([0x2e])),[_0x5c1a7c,_0x599c2e,_0x14e41c]=_0x185018;return _0x3ca890(_0x5c1a7c),await _0x224619(_0x5c1a7c,_0x599c2e,_0x14e41c),_0x581ee8;}catch{return!0x1;}function _0x3ca890(_0x99186d){const _0x4e43e9=_0x10580e(_0x99186d);_0x4e43e9&&_0x4e43e9[_0xf46fbf([0x61,0x6c,0x67])]==_0xf46fbf([0x45,0x53,0x32,0x35,0x36])||(_0x581ee8=!0x1);}async function _0x224619(_0x539ae5,_0xc3f629,_0x4c7e84){const _0x126173=window[_0xf46fbf([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0xf46fbf([0x66,0x72,0x6f,0x6d])](_0x58589f(_0x4c7e84),_0x4d034e=>_0x4d034e[_0xf46fbf([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x52c243=new window[(_0xf46fbf([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0xf46fbf([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x539ae5+_0xf46fbf([0x2e])+_0xc3f629),_0x33f740=window[_0xf46fbf([0x63,0x72,0x79,0x70,0x74,0x6f])][_0xf46fbf([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x33f740)return;const _0x3b712d=await _0x33f740[_0xf46fbf([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0xf46fbf([0x6a,0x77,0x6b]),_0x5a6857,{[_0xf46fbf([0x6e,0x61,0x6d,0x65])]:_0xf46fbf([0x45,0x43,0x44,0x53,0x41]),[_0xf46fbf([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0xf46fbf([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0xf46fbf([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x33f740[_0xf46fbf([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0xf46fbf([0x6e,0x61,0x6d,0x65])]:_0xf46fbf([0x45,0x43,0x44,0x53,0x41]),[_0xf46fbf([0x68,0x61,0x73,0x68])]:{[_0xf46fbf([0x6e,0x61,0x6d,0x65])]:_0xf46fbf([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x3b712d,_0x126173,_0x52c243)||(_0x581ee8=!0x1);}}function _0x10580e(_0x1e7fdf){return _0x1e7fdf[_0xf46fbf([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0xf46fbf([0x65,0x79]))?JSON[_0xf46fbf([0x70,0x61,0x72,0x73,0x65])](_0x58589f(_0x1e7fdf)):null;}function _0x58589f(_0x49b48d){return window[_0xf46fbf([0x61,0x74,0x6f,0x62])](_0x49b48d[_0xf46fbf([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0xf46fbf([0x2b]))[_0xf46fbf([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0xf46fbf([0x2f])));}function _0x52c203(_0xa83b2){let _0x2b1f08=0x1505;function _0x5b8342(_0x5239ba){for(let _0xab1d4=0x0;_0xab1d4<_0x5239ba[_0xf46fbf([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0xab1d4++){const _0x5e1bdc=_0x5239ba[_0xf46fbf([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0xab1d4);_0x2b1f08=(_0x2b1f08<<0x5)+_0x2b1f08+_0x5e1bdc,_0x2b1f08&=_0x2b1f08;}}function _0x51cf65(_0x57a3fd){Array[_0xf46fbf([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x57a3fd)?_0x57a3fd[_0xf46fbf([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x51cf65):_0x57a3fd&&typeof _0x57a3fd==_0xf46fbf([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0xf46fbf([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x57a3fd)[_0xf46fbf([0x73,0x6f,0x72,0x74])]()[_0xf46fbf([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x3261dd,_0x54c822])=>{_0x5b8342(_0x3261dd),_0x51cf65(_0x54c822);}):_0x5b8342(window[_0xf46fbf([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x57a3fd));}return _0x51cf65(_0xa83b2),_0x2b1f08>>>0x0;}function _0x333f12(_0x24fa68){return _0x24fa68[_0xf46fbf([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0xf46fbf([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0xf46fbf([0x30]));}function _0x4024fb(_0x3d6d26){return _0x3d6d26[_0xf46fbf([0x73,0x70,0x6c,0x69,0x74])]('')[_0xf46fbf([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0xf46fbf([0x6a,0x6f,0x69,0x6e])]('');}function _0x27a7a2(){}function _0xf46fbf(_0x576357){return _0x576357['map'](_0x5a331c=>String['fromCharCode'](_0x5a331c))['join']('');}_0x6aa098(await _0x9df4d1());}(this);}['showFakeVisualSelection'](){const _0x850c18=this['editor']['model'];_0x850c18['change'](_0x4f5e4e=>{const _0x552503=_0x850c18['document']['selection']['getRanges']();let _0x3247c3=0x0;for(const _0x5c035c of _0x552503){const _0x263922=f+':'+_0x3247c3;if(_0x850c18['markers']['has'](_0x263922))_0x4f5e4e['updateMarker'](_0x263922,{'range':_0x5c035c});else{if(_0x5c035c['start']['isAtEnd']){const _0xb7e4a4=_0x5c035c['start']['getLastMatchingPosition'](({item:_0x2548ce})=>!_0x850c18['schema']['isContent'](_0x2548ce),{'boundaries':_0x5c035c});_0x4f5e4e['addMarker'](_0x263922,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4f5e4e['createRange'](_0xb7e4a4,_0x5c035c['end'])});}else _0x4f5e4e['addMarker'](_0x263922,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5c035c});}_0x3247c3++;}});}['hideFakeVisualSelection'](){const _0x2a1285=this['editor']['model'],_0x830946=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x830946['length']&&_0x2a1285['change'](_0x276192=>{_0x830946['forEach'](_0xc74966=>{_0x276192['removeMarker'](_0xc74966);});});}['insertContent'](_0x2db8f4,_0x430992){const _0x235989=this['_getAISelection'](),_0x235626=_0x430992||_0x235989['getFirstRange']();this['editor']['model']['canEditAt'](_0x235626)&&this['editor']['model']['change'](_0x1e9e2d=>{this['hideFakeVisualSelection'](),_0x430992||this['_resetContentOfSelectedTableCells'](_0x1e9e2d,_0x235989),this['_pasteHTMLUsingClipboard']({'insertAt':_0x235626,'writer':_0x1e9e2d,'html':_0x2db8f4});});}['insertContentBelow'](_0x55eedd){const {model:_0x90a09}=this['editor'],_0x10958f=this['_getAISelection']();_0x90a09['change'](()=>{const _0x20e64b=this['_prepareTableInsertBelowPosition'](_0x55eedd,_0x10958f)||this['_getDefaultInsertBelowPosition'](_0x10958f);this['insertContent'](_0x55eedd,_0x20e64b);});}['_getAISelection'](){const _0x33aa47=this['editor']['model'],_0x3e56f2=Array['from'](_0x33aa47['markers']['getMarkersGroup'](f))['map'](_0x5515e6=>_0x5515e6['getRange']());return _0x33aa47['createSelection'](_0x3e56f2);}['_pasteHTMLUsingClipboard']({writer:_0x4dd4b6,html:_0x451b1e,insertAt:_0x3464cf}){const {view:_0x14facb}=this['editor']['editing'],_0x1ff6dd=this['editor']['plugins']['get'](_0x354057),_0x562d9e=new Kn();_0x562d9e['setData']('text/html',_0x451b1e);const _0x20b3bb=new ClipboardEvent('paste',{'clipboardData':_0x562d9e}),_0x3ffa87=new _0x29ed40(_0x14facb,_0x20b3bb,{'dataTransfer':new _0x1ba4cd(_0x562d9e)});_0x4dd4b6['setSelection'](_0x3464cf);const _0xda7c50=(_0x5f1f28,_0x1498cd)=>{_0x1498cd['resultRange']&&_0x4dd4b6['setSelection'](_0x1498cd['resultRange']);};_0x1ff6dd['once']('contentInsertion',_0xda7c50,{'priority':'lowest'}),_0x14facb['document']['fire']('paste',_0x3ffa87),_0x1ff6dd['off']('contentInsertion',_0xda7c50);}['_getDefaultInsertBelowPosition'](_0x3315f1){const {model:_0x18f026}=this['editor'],_0x49ed7b=Array['from'](_0x3315f1['getSelectedBlocks']());return _0x49ed7b['length']?_0x18f026['createPositionAfter'](_0x49ed7b['pop']()):_0x3315f1['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x3aff68,_0x4ff550){const {model:_0x2648a1,plugins:_0x17891d}=this['editor'];if(_0x17891d['has']('TableUtils')){const _0x2ec892=_0x17891d['get']('TableUtils')['getSelectedTableCells'](_0x4ff550);if(_0x2ec892['length']){const _0x32f286=this['_getTableRowCountFromContent'](_0x3aff68),_0x421f86=this['_createEmptyTableRows'](_0x2ec892,_0x32f286);return _0x2648a1['createPositionAt'](_0x421f86,0x0);}}return null;}['_getTableRowCountFromContent'](_0xa997ce){const _0x559566=this['editor']['plugins']['get']('TableUtils'),_0x474556=this['editor']['data']['parse'](_0xa997ce),_0x4f7d82=Array['from'](_0x474556['getChildren']())['filter'](_0xc66c8b=>_0xc66c8b['is']('element','table'));let _0x55763c=0x0;return _0x4f7d82['forEach'](_0x48c519=>{_0x55763c+=_0x559566['getRows'](_0x48c519);}),_0x55763c;}['_createEmptyTableRows'](_0x33e7d7,_0x4307ab){const _0x4a8874=this['editor']['plugins']['get']('TableUtils'),_0x5d2981=_0x4a8874['getRowIndexes'](_0x33e7d7),_0x120f5c=_0x4a8874['getColumnIndexes'](_0x33e7d7),_0x5d2da7=_0x5d2981['last']+0x1,_0x5c1474=_0x120f5c['first'],_0x43655d=_0x33e7d7[0x0]['findAncestor']('table');for(let _0x28ad62=0x0;_0x28ad62<_0x4307ab;_0x28ad62++)_0x4a8874['insertRows'](_0x43655d,{'at':_0x5d2da7});return _0x43655d['getChild'](_0x5d2da7)['getChild'](_0x5c1474);}['_resetContentOfSelectedTableCells'](_0x58de5c,_0x1d9e59){const {plugins:_0x1b3c9c}=this['editor'],{model:_0x4a1d05}=_0x58de5c;if(!_0x1b3c9c['has']('TableUtils'))return;_0x1b3c9c['get']('TableUtils')['getSelectedTableCells'](_0x1d9e59)['length']&&_0x4a1d05['deleteContent'](_0x1d9e59);}}class K extends _0x558b99{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x54686c('aiadapter-text-adapter-not-set',null);}}class er extends Error{constructor(_0x1aa146){super(_0x1aa146),this['name']='AIRequestError';}}function Wn(_0x2e7241,_0x3050dc,_0x2dadb8){const t=_0x2e7241['t'];switch(_0x3050dc){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',_0x2dadb8);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2dadb8);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'},_0x2dadb8);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_AWS_NOT_SUPPORTED':return t({'id':'AI_ERROR_AWS_NOT_SUPPORTED','string':'The\x20AWS\x20integration\x20is\x20no\x20longer\x20supported.\x20Please\x20contact\x20the\x20support.'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x3050dc;}}class E extends Lt{['_commandDefinitions'];constructor(_0x54c7a3,_0x274052){super(_0x54c7a3),this['_commandDefinitions']=_0x274052,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x522b69,_0x2be522,_0x41f491)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0x41f491));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x6e0602,_0x1c44eb,_0x304211)=>{this['enabledCommandsIds']=_0x304211?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x343972=this['editor']['model'];this['_hasContext']=function(_0x59291d){const _0x45696e=_0x59291d['document']['selection'];return _0x45696e['isCollapsed']?0x0!==[..._0x45696e['getSelectedBlocks']()]['length']&&![..._0x45696e['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x59291d['hasContent'](_0x45696e['getFirstRange']());}(_0x343972);const _0x59fe31=_0x343972['document']['selection'],_0x495a69=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0xa91a8a of _0x59fe31['getRanges']())for(const _0x1420fb of _0xa91a8a['getItems']())if(_0x1420fb['is']('element')&&_0x495a69['includes'](_0x1420fb['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x108e7e='',_0xa5e491='',_0x545f85='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x108e7e,_0xa5e491,_0x545f85);}}function ns(_0x4e8726,_0x54638d){const _0x19530e=new Set();for(const _0x4d39a2 of _0x4e8726['values']())(_0x54638d||!0x1===_0x4d39a2['requiresContent'])&&_0x19530e['add'](_0x4d39a2['id']);return Array['from'](_0x19530e);}const hs=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
24
- ts(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x4a1546,_0x1f9823,_0x3b1594){super(),this['editor']=_0x4a1546,this['textAdapter']=_0x1f9823,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x3b1594,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x7cf487,_0x1124d5,_0x15fab2)=>{this['view']['value']=this['_sanitizeHTML'](_0x15fab2);}),this['listenTo'](this['view'],'submitPrompt',(_0x56d22f,_0x4e734f)=>{const _0x261daf=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x4e734f,_0x261daf,'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:_0x2e97e6,query:_0x57efa5,htmlContent:_0x21d197,label:_0x319d7a,mainActionLabel:_0x47ca08}){this['view']['prompt']=_0x319d7a,this['view']['mainAction']=_0x47ca08,this['initialContext']=_0x21d197,_0x57efa5&&(this['view']['isRendered']?this['_handleQuery'](_0x57efa5,_0x21d197,_0x2e97e6,_0x319d7a):this['view']['once']('render',()=>{this['_handleQuery'](_0x57efa5,_0x21d197,_0x2e97e6,_0x319d7a);}));}['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'](_0x23b527,_0x220182,_0x53d0f6,_0x3f0ea8){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x220182,this['previousQuery']=_0x23b527,this['previousLabel']=_0x3f0ea8||_0x23b527,this['previousActionId']=_0x53d0f6,new Promise(_0x41a4ab=>{this['textAdapter']['makeRequest']({'query':_0x23b527,'context':_0x220182,'onData':_0x243a7c=>{this['currentResponse']=_0x243a7c,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x53d0f6})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0xbcf346=>{_0xbcf346 instanceof er?this['view']['handleError'](_0xbcf346['message']):this['view']['handleError'](),_0x41a4ab();})['finally'](()=>{this['stopProcessing'](),_0x41a4ab();});});}['_parseAndNormalizeContent'](_0x669088,_0x52e7f6=!0x1){const _0x2a1546=hs['exec'](_0x669088);_0x669088=_0x2a1546?_0x669088['substring'](_0x2a1546[0x1]['length']):_0x669088['length']<0x64&&!_0x52e7f6?'':this['_stripMarkdownSyntax'](_0x669088);const _0x26805b=this['_domParser']['parseFromString'](_0x669088,'text/html');if(_0x2a1546){const _0x1c71d4=Array['from'](_0x26805b['body']['childNodes']);_0x1c71d4['reverse']();for(const _0x588edd of _0x1c71d4){if(_0x588edd['nodeType']==Node['ELEMENT_NODE'])break;_0x588edd['remove']();}}const _0x170dcb=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x26805b['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x170dcb);const _0x2642b3=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x2aa040=this['editor']['data']['toModel'](_0x170dcb);return _0x2642b3||_0x2aa040['markers']['clear'](),this['editor']['data']['stringify'](_0x2aa040);}['_normalizeResponseHeadings'](_0x441214){const _0x4a3941=new _0x1afb2b(this['editor']['editing']['view']['document']),_0x5101d5=new _0x4c8fa8({'name':/^h[1-5]$/}),_0x13bfea=[];let _0x211727=!0x1;for(const _0x1740d4 of _0x441214)_0x1740d4['is']('element')&&_0x5101d5['match'](_0x1740d4)&&(_0x13bfea['push'](_0x1740d4),'h1'==_0x1740d4['name']&&(_0x211727=!0x0));if(_0x211727){for(const _0x25014c of _0x13bfea)_0x4a3941['rename']('h'+(parseInt(_0x25014c['name'][0x1])+0x1),_0x25014c);}}['_isH1TagSupportEnabled'](){const {data:_0xae192b,editing:_0x202eca}=this['editor'],_0x5b1ad8=_0xae192b['htmlProcessor']['toView']('<h1></h1>'),_0x4c4ab5=_0xae192b['toView'](_0xae192b['toModel'](_0x5b1ad8));return!!_0x202eca['view']['domConverter']['viewToDom'](_0x4c4ab5)['querySelector']('h1');}['_sanitizeHTML'](_0x225a90){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x225a90),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x8ecd20){const _0x5b8986=_0x8ecd20['trim']();return _0x5b8986['startsWith']('```html')?_0x5b8986['endsWith']('```')?_0x5b8986['substring'](0x7,_0x5b8986['length']-0x3):_0x5b8986['substring'](0x7):_0x8ecd20;}}const _={'REPLACE':'replace','INSERT':'insert'};class Ar extends _0x28f204{constructor(_0x557200){super(_0x557200),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x1bbdd6=>Wn(_0x557200,'AI_'+_0x1bbdd6['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Wn(_0x557200,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Wn(_0x557200,'Try\x20again')),this['stopButton']=this['_createButton'](Wn(_0x557200,'Stop'));const _0x42f01e=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x42f01e['if']('isVisible','ck-hidden',_0x294225=>!_0x294225)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x5f864c,_0x316fb0){const _0x2f9ba0=new _0x28db64(this['locale']);return _0x2f9ba0['set']({'label':_0x5f864c,'class':_0x316fb0||'','isVisible':!0x0,'withText':!0x0}),_0x2f9ba0;}}class Pr extends _0x25f6b6{['contentFieldView'];['copyButtonView'];constructor(_0x2a897a,_0x3e8008=''){super(_0x2a897a),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x35fed=this['bindTemplate'];this['contentFieldView']=new Yn(_0x2a897a,_0x3e8008),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x35fed['if']('isVisible','ck-hidden',_0x2924e4=>!_0x2924e4)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x35fed['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 _0x2230b0=!0x1;this['on']('change:value',(_0x35e09e,_0x29b1ea,_0x65b37f)=>{const _0x5eefaf=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x65b37f),this['isProcessing']&&_0x5eefaf&&!_0x2230b0&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x129985,_0x40af12,_0xa7ca6f)=>{_0x2230b0=!0x1,_0xa7ca6f?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x2230b0=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x2230b0=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x29ca89=this['locale'],_0x153596=new _0x28db64(this['locale']),_0x345228='ck-ai-form__copy-button';return _0x153596['set']({'label':Wn(_0x29ca89,'Copy'),'icon':_0x16d0de,'class':_0x345228,'tooltip':!0x0}),_0x153596['bind']('isVisible')['to'](this,'value',_0x3a3a1f=>!!_0x3a3a1f),_0x153596['bind']('isEnabled')['to'](this,'isProcessing',_0x3842d0=>!_0x3842d0),_0x153596['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x153596['icon']=_0x13f61e,_0x153596['class']=_0x345228+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x153596['icon']=_0x16d0de,_0x153596['class']=_0x345228;},0x3e8);}),_0x153596;}['_copyHTMLToClipboard'](_0x45aba8){const {window:_0x40861b,document:_0x15cdcb}=_0x4b8472;if(_0x40861b['ClipboardItem']){const {Blob:_0x490c7a,ClipboardItem:_0x4e868b}=_0x40861b,_0x48e3c3=[new _0x4e868b({'text/html':new _0x490c7a([_0x45aba8['innerHTML']],{'type':'text/html'}),'text/plain':new _0x490c7a([_0x45aba8['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x48e3c3);}else{const _0x4ebf28=_0x15cdcb['createElement']('div');_0x4ebf28['style']['position']='absolute',_0x4ebf28['style']['left']='-9999px',_0x4ebf28['innerHTML']='<span>[</span>'+_0x45aba8['innerHTML']+'<span>]</span>',_0x15cdcb['body']['appendChild'](_0x4ebf28);const _0x1d5dd0=_0x15cdcb['createRange']();_0x1d5dd0['setStartAfter'](_0x4ebf28['firstElementChild']),_0x1d5dd0['setEndBefore'](_0x4ebf28['lastElementChild']);const _0x45f1c2=_0x40861b['getSelection']();_0x45f1c2['removeAllRanges'](),_0x45f1c2['addRange'](_0x1d5dd0),_0x15cdcb['execCommand']('copy'),_0x4ebf28['remove']();}}}class Yn extends _0x25f6b6{constructor(_0x58cb47,_0xa74124=''){super(_0x58cb47),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0xa74124,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x22b81a){this['element']['innerHTML']=_0x22b81a;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0xd1611e=new _0x25f6b6(),_0x3d9bc8=this['locale'],_0x101961=new _0x39a237();return _0x101961['isVisible']=!0x0,_0xd1611e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x101961,{'text':Wn(_0x3d9bc8,'AI\x20is\x20writing...')}]}),_0xd1611e['render'](),_0xd1611e;}}class Vr extends _0x25f6b6{constructor(_0x4631c1,_0x4b9fab=''){super(_0x4631c1);const _0x335799=new _0x283d41(),_0x10e08e=this['bindTemplate'];this['set']('text',_0x4b9fab),_0x335799['content']=_0x32c77e,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x335799,{'text':_0x10e08e['to']('text')}]});}}class Cr extends _0x19cfd0{['submitButtonView'];['showHistoryButtonView'];constructor(_0x238061,_0x7f3446){super(_0x238061,_0x7f3446),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',(_0x17cb09,_0x43f7ad)=>{_0x17cb09['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x43f7ad());});}['_createSubmitButton'](){const _0x2b96e3=new _0x28db64(this['locale']),_0x3f8b9a=this['locale'];return _0x2b96e3['set']({'icon':_0x2a6e28,'label':Wn(_0x3f8b9a,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x2b96e3['on']('execute',()=>{this['submit']();}),_0x2b96e3['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x12e41b,_0x19817d)=>!_0x12e41b&&_0x19817d),_0x2b96e3;}['_createShowHistoryButton'](){const _0x18faa1=new _0x28db64(this['locale']),_0x256a8=this['resultsView'],_0x2e1ca3=this['locale'];_0x18faa1['set']({'label':Wn(_0x2e1ca3,'History'),'withText':!0x1,'icon':Nt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x18faa1['bind']('isOn')['to'](_0x256a8,'isVisible'),_0x18faa1['bind']('isEnabled')['to'](this,'isEnabled'),_0x18faa1['on']('execute',()=>{_0x256a8['isVisible']=!_0x256a8['isVisible'],_0x256a8['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x3e5c3b=()=>{_0x4b8472['window']['requestAnimationFrame'](()=>{if(_0x23b8f5(this['element'])){const _0x5098ae=new _0x182987(this['queryView']['fieldView']['element']),_0x453b67=_0x5098ae['width'],_0x1f1092='rtl'===_0x2e1ca3['uiLanguageDirection']?'left':'right';_0x5098ae['excludeScrollbarsAndBorders'](),_0x18faa1['element']['style'][_0x1f1092]=_0x453b67-_0x5098ae['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x3e5c3b),this['on']('render',_0x3e5c3b),_0x18faa1;}['submit'](){const _0x574183=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x574183);}['focus'](_0x571a29){-0x1===_0x571a29?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Hr extends _0x56abe9{['historyGroupView'];['clearHistoryButton'];constructor(_0x5ba28f){super(_0x5ba28f),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x4579fe(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Wn(_0x5ba28f,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x2059f6=0x0;for(const _0x3df8bf of this['items'])_0x2059f6+=_0x3df8bf['items']['length'];return{'resultsCount':_0x2059f6,'totalItemsCount':_0x2059f6};}['_createClearHistoryButton'](){const _0x56adca=this['locale'],_0x148995=new _0x28db64(this['locale']);return _0x148995['set']({'label':'('+Wn(_0x56adca,'Clear')+')','withText':!0x0}),_0x148995['on']('execute',()=>this['fire']('clearHistory')),_0x148995;}}class Rr extends _0x1cf10a{constructor(_0x2d2a24){super();const _0x54184b=new _0x594a98(),_0x528d45=new _0x28db64(this['locale'],_0x54184b);this['children']['add'](_0x528d45),_0x528d45['set']({'label':_0x2d2a24['prompt'],'withText':!0x0}),_0x528d45['on']('execute',()=>{this['fire']('execute',{'value':_0x3dc617(_0x2d2a24['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class Br extends _0x207453{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x333036,_0x2039cd)=>{const _0x8173ed=go(_0x2039cd['prompt']);for(const _0x2bfa97 of this)if(_0x2bfa97!=_0x2039cd&&go(_0x2bfa97['prompt'])===_0x8173ed){this['remove'](_0x2bfa97);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x503786=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0x503786));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0x37f0ca=>_0x37f0ca)));}}function go(_0xcf48c1){return _0xcf48c1['toLowerCase']()['trim']();}class k extends _0x25f6b6{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x34d40e,_0x979895,_0x5d20c0=''){super(_0x34d40e),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',_['REPLACE']),this['_promptHistory']=new Br(),this['errorView']=new Vr(_0x34d40e),this['contentArea']=new Pr(_0x34d40e,_0x5d20c0),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 _0x49bffd(),this['keystrokes']=new _0x287999(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x596602({'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 _0x513213=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x979895],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x513213['if']('isError','ck-hidden',_0x661d5c=>!_0x661d5c)]},'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'](_0x10c19b=0x1){-0x1===_0x10c19b?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 _0x29b614=this['locale'],_0x4c281f=new Cr(_0x29b614,{'queryView':{'label':Wn(_0x29b614,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x17d079,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Wn(_0x29b614,'Empty\x20history'),'secondary':Wn(_0x29b614,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x4c281f['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x3e0d24,_0x172222)=>_0x3e0d24&&!_0x172222),this['listenTo'](_0x4c281f,'submit',(_0x587932,_0x5f5a9c)=>{this['prompt']=_0x5f5a9c;const _0x5ab095=_0x169b70(_0x5f5a9c);this['fire']('submitPrompt',_0x5ab095),_0x5f5a9c['trim']()&&this['_promptHistory']['add']({'prompt':_0x5ab095},0x0);},{'priority':'high'}),_0x4c281f;}['_createHistoryView'](){const _0x2532f5=new Hr(this['locale']);return _0x2532f5['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Rr),_0x2532f5['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x2532f5;}['_createToolbar'](){const _0x59eafe=new Ar(this['locale']);return _0x59eafe['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x365252,_0x1fa64a,_0x54ab12)=>_0x365252&&!_0x1fa64a&&!!_0x54ab12),_0x59eafe['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x59eafe['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x4a8c60,_0x1c4a62,_0x10bd56)=>_0x4a8c60&&!_0x1c4a62&&!!_0x10bd56),_0x59eafe['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x59eafe['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2d862d,_0x10af52)=>_0x2d862d&&!_0x10af52),_0x59eafe['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x59eafe['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x59eafe['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x59eafe;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x12cddd=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Wn(_0x12cddd,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x873053){const _0x32641d=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x873053||Wn(_0x32641d,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x558b99{['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[_0x352a41,a,K,_0x14d881];}constructor(_0x24ff05){super(_0x24ff05),_0x24ff05['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x24ff05['config']['define']('ai.assistant.contentAreaCssClass',''),_0x24ff05['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x24ff05['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x276156}=this;this['_aiAdapter']=_0x276156['plugins']['get'](K),this['_dialog']=_0x276156['plugins']['get'](_0x14d881),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x2eee6f=new E(_0x276156,Array['from'](this['_commandDefinitions']['values']()));_0x276156['commands']['add']('showAIAssistant',_0x2eee6f),_0x276156['ui']['componentFactory']['add']('aiCommands',_0x231bc2=>{const _0x1eaf82=_0x340743(_0x231bc2);return _0x1eaf82['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x1eaf82['buttonView']['set']({'label':Wn(_0x231bc2,'AI\x20Commands'),'icon':_0x1da90a,'tooltip':!0x0}),_0x1eaf82['on']('execute',_0x1bd9c7=>this['_onExecute'](_0x1bd9c7['source']['id'])),_0x4397ea(_0x1eaf82,_0x276156['ui']['view']['body'],function(_0x453fc8){const _0x2eb274=o(_0x453fc8['config']['get']('ai.assistant.commands'),_0x453fc8['locale']),_0x53edb9=B(_0x453fc8,_0x2eb274)['filter'](_0xb48d58=>_0xb48d58['commands']['length']);if(0x1===_0x53edb9['length'])return B(_0x453fc8,_0x53edb9[0x0]['commands'])['map'](_0x14a6ec=>({'id':_0x14a6ec['id'],'label':_0x14a6ec['label']}));return _0x53edb9['map'](_0x325df3=>{const {groupId:_0x13b510,groupLabel:_0x1a0930,commands:_0x266492}=_0x325df3,_0x304751=B(_0x453fc8,_0x266492)['map'](_0xd3260d=>({'id':_0xd3260d['id'],'label':_0xd3260d['label']}));return{'id':_0x13b510,'menu':_0x1a0930||_0x13b510,'children':_0x304751};});}(_0x276156),{'ariaLabel':Wn(_0x231bc2,'AI\x20Commands')}),_0x1eaf82['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x2eee6f['on']('change:enabledCommandsIds',_0x375b5c),_0x1eaf82['menuView']['once']('render',_0x375b5c),_0x1eaf82;function _0x375b5c(){_0x1eaf82['isEnabled']=_0x2eee6f['enabledCommandsIds']['length']>0x0;for(const _0x24a8d1 of _0x1eaf82['menuView']['buttons'])_0x24a8d1['isEnabled']=_0x2eee6f['enabledCommandsIds']['includes'](_0x24a8d1['id']);}}),_0x276156['ui']['componentFactory']['add']('menuBar:aiCommands',_0x43f2db=>{const _0x54cb2c=new _0x2e7068(_0x43f2db);_0x54cb2c['buttonView']['set']({'label':Wn(_0x43f2db,'AI\x20Commands'),'icon':_0x1da90a}),_0x54cb2c['bind']('isEnabled')['to'](_0x2eee6f,'enabledCommandsIds',_0x26b011=>_0x26b011['length']>0x0);const _0x1f7428=o(_0x276156['config']['get']('ai.assistant.commands'),_0x43f2db);return this['_populateMenuBarMenu'](_0x2eee6f,_0x54cb2c,_0x1f7428,_0x21168c=>this['_onExecute'](_0x21168c)),_0x54cb2c;}),_0x276156['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x3e1998=this['_createAIAssistantUIButton'](_0x28db64);return _0x3e1998['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x3e1998;}),_0x276156['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x4231e8=this['_createAIAssistantUIButton'](_0x42f0b4);return _0x4231e8['set']({'role':'menuitemcheckbox'}),_0x4231e8;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x2f6efa=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x38a181;for(const _0x5560fb in _0x2f6efa){const _0x3dc9bc=_0x5560fb,_0x1a33a4=_0x2f6efa[_0x3dc9bc];if('aiLicenseKeyValid'==_0x1a33a4||'aiLicenseKeyInvalid'==_0x1a33a4||'aiLicenseKeyExpired'==_0x1a33a4||'aiLicenseKeyDomainLimit'==_0x1a33a4||'aiLicenseKeyNotAllowed'==_0x1a33a4||'aiLicenseKeyEvaluationLimit'==_0x1a33a4||'aiLicenseKeyUsageLimit'==_0x1a33a4){delete _0x2f6efa[_0x3dc9bc],_0x38a181=_0x1a33a4,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x38a181&&_0x2f6efa['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x38a181&&_0x2f6efa['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x38a181&&_0x2f6efa['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x38a181&&_0x2f6efa['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x38a181&&_0x2f6efa['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x38a181&&_0x2f6efa['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x4aefaa='',_0x15ff71='',_0x32106e='custom'){const _0x3c1cda=this['editor'],_0x429307=_0x3c1cda['editing']['view'],_0x2ef953=_0x3c1cda['plugins']['get'](a),_0x402267=_0x3c1cda['plugins']['get'](_0x352a41);_0x2ef953['showFakeVisualSelection']();const _0x5d8526=new w(),_0x4472b3=new ClipboardEvent('copy',{'clipboardData':_0x5d8526}),_0x53974b=new _0x1ba4cd(_0x5d8526),_0x33b672=new _0x29ed40(_0x429307,_0x4472b3,{'dataTransfer':_0x53974b});_0x402267['_forceMarkersCopy']('comment',()=>{_0x429307['document']['fire']('copy',_0x33b672);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x3c1cda,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x45f779=_0x53974b['getData']('text/html');const _0x55408a=_0x3c1cda['model']['document']['selection'],_0x482696=Array['from'](_0x55408a['getRanges']());0x1===_0x482696['length']&&_0x482696[0x0]['isFlat']&&!_0x55408a['getSelectedElement']()&&''!==_0x45f779['replace'](/&nbsp;/g,'')['trim']()&&(_0x45f779='<p>'+_0x45f779+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x32106e,'query':_0x4aefaa,'htmlContent':_0x45f779,'label':_0x15ff71,'mainActionLabel':_[_0x3c1cda['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x2fe681,'title':Wn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x35a191['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x2ef953['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x2aac32=new Map(),_0x376b19=o(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x3c7e76 of _0x376b19)for(const _0xbb1d17 of _0x3c7e76['commands'])_0x2aac32['set'](_0xbb1d17['id'],{..._0xbb1d17,'groupId':_0x3c7e76['groupId'],'groupLabel':_0x3c7e76['groupLabel']||_0x3c7e76['groupId']});return _0x2aac32;}['_createAIAssistantUIButton'](_0x4b73b4){const _0xb1f440=this['editor'],_0x7959f8=_0xb1f440['commands']['get']('showAIAssistant'),_0x45bf33=new _0x4b73b4(_0xb1f440['locale']);return _0x45bf33['set']({'label':Wn(_0xb1f440['locale'],'AI\x20Assistant'),'icon':_0x2fe681,'isToggleable':!0x0}),_0x45bf33['bind']('isEnabled')['to'](_0x7959f8),_0x45bf33['bind']('isOn')['to'](this['_dialog'],'id',_0x9bc03=>'aiAssistant'===_0x9bc03),this['listenTo'](_0x45bf33,'execute',()=>{_0x45bf33['isOn']?this['hideUI']():_0x7959f8['execute']();}),_0x45bf33;}['_initView'](){const _0x40a8ae=this['editor']['plugins']['get'](a);this['_formView']=new k(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.assistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x40a8ae['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x40a8ae['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x4cc545,ui:{ariaLiveAnnouncer:_0xe42fe5}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x199484,_0x1a9388,_0x3f8406)=>{const _0x1bf0f8=this['_aiAssistantController']['currentContext'];_0x3f8406?_0xe42fe5['announce'](Wn(_0x4cc545,'AI\x20is\x20writing')):_0x1bf0f8&&_0xe42fe5['announce'](Wn(_0x4cc545,'Generated\x20content:\x20%0',_0x1bf0f8),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x4edad3,_0x29e68e,_0x150678)=>{if(_0x150678){const _0x14048a=this['_formView']['errorView']['text'];_0xe42fe5['announce'](Wn(_0x4cc545,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x14048a));}});}['_onExecute'](_0x21dca4){const _0x484730=this['_commandDefinitions']['get'](_0x21dca4),_0x388714=this['editor'],_0x5bb9d1=_0x388714['model']['document']['selection'],_0x3ac077=_0x388714['commands']['get']('showAIAssistant'),_0x1fbf09=_0x388714['plugins']['get'](a),_0x8ac9bd=''+(_0x484730['groupId']!==x?_0x484730['groupLabel']+':\x20':'')+_0x484730['label'];if(!0x1!==_0x484730['requiresContent']&&_0x5bb9d1['isCollapsed']){const _0x4ee690=_0x97da1c(_0x5bb9d1['getSelectedBlocks']())||_0x388714['model']['schema']['getLimitElement'](_0x5bb9d1);_0x388714['model']['change'](_0x3a1a2e=>{_0x3a1a2e['setSelection'](_0x4ee690,'in');});}_0x1fbf09['showFakeVisualSelection'](),_0x3ac077['execute'](_0x484730['prompt'],_0x8ac9bd,'command:'+_0x21dca4);}['_populateMenuBarMenu'](_0x1adfb3,_0x148ee7,_0x192ffe,_0x5938cf){const _0x2c9612=this['editor'],_0x544edc=_0x2c9612['locale'],_0x27c7e8=new _0x3d7509(_0x544edc),_0x3427dc=B(_0x2c9612,_0x192ffe)['filter'](_0x38e039=>_0x38e039['commands']['length']);0x1===_0x3427dc['length']?this['_getMenuBarGroupButtons']({'command':_0x1adfb3,'commands':_0x3427dc[0x0]['commands'],'parentMenuView':_0x148ee7,'onExecute':_0x5938cf})['forEach'](_0x369c1c=>_0x27c7e8['items']['add'](_0x369c1c)):_0x3427dc['forEach'](({groupId:_0x3635a1,groupLabel:_0x5ac426,commands:_0x75acfc})=>{const _0x237353=new _0x11788c(_0x544edc,_0x148ee7),_0x2fe67e=new _0x2e7068(_0x544edc),_0x571c12=new _0x3d7509(_0x544edc),_0x56c00f=this['_getMenuBarGroupButtons']({'command':_0x1adfb3,'commands':_0x75acfc,'parentMenuView':_0x2fe67e,'onExecute':_0x5938cf});_0x2fe67e['buttonView']['set']({'label':_0x5ac426||_0x3635a1}),_0x2fe67e['delegate']('execute')['to'](_0x148ee7),_0x571c12['items']['addMany'](_0x56c00f),_0x2fe67e['panelView']['children']['add'](_0x571c12),_0x237353['children']['add'](_0x2fe67e),_0x27c7e8['items']['add'](_0x237353);}),_0x148ee7['panelView']['children']['add'](_0x27c7e8);}['_getMenuBarGroupButtons']({command:_0x55f7f2,commands:_0x3cbcf7,parentMenuView:_0x15740c,onExecute:_0x1d6cf0}){const _0x3ae7c1=this['editor'],_0x4d93b0=_0x3ae7c1['locale'];return B(_0x3ae7c1,_0x3cbcf7)['map'](_0x348dea=>{const _0x1b8870=new _0x11788c(_0x4d93b0,_0x15740c),_0x82a8c0=new _0x42f0b4(_0x4d93b0);return _0x82a8c0['set']({'label':_0x348dea['label']}),_0x82a8c0['delegate']('execute')['to'](_0x15740c),_0x82a8c0['on']('execute',()=>_0x1d6cf0(_0x348dea['id'])),_0x82a8c0['bind']('isEnabled')['to'](_0x55f7f2,'enabledCommandsIds',_0x6e011=>_0x6e011['includes'](_0x348dea['id'])),_0x1b8870['children']['add'](_0x82a8c0),_0x1b8870;});}}function U(_0x2bca2e,_0x511bab){return void 0x0!==_0x2bca2e['order']&&void 0x0===_0x511bab['order']?0x1:void 0x0===_0x2bca2e['order']&&void 0x0!==_0x511bab['order']?-0x1:void 0x0!==_0x2bca2e['order']&&void 0x0!==_0x511bab['order']?_0x2bca2e['order']-_0x511bab['order']:0x0;}function B(_0x2052ad,_0x120af5){_0x120af5['sort'](U);const _0x185aee={},_0x52c0d7=[];for(const _0x2a2fc4 of _0x120af5)if(void 0x0!==_0x2a2fc4['order']){if(_0x2a2fc4['order']in _0x185aee)throw new _0x54686c('ai-commands-config-order-collision',_0x2052ad,{'conflictingDefinitions':[_0x2a2fc4,_0x185aee[_0x2a2fc4['order']]]});_0x185aee[_0x2a2fc4['order']]=_0x2a2fc4,_0x52c0d7['splice'](_0x2a2fc4['order'],0x0,_0x2a2fc4);}else _0x52c0d7['push'](_0x2a2fc4);return _0x52c0d7;}class $n extends _0x558b99{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x24516e){super(_0x24516e);const _0x2e1657=_0x24516e['config'],_0x44b6cb=_0x24516e['locale'];_0x2e1657['define']('ai.assistant.preserveComments',!0x0),_0x2e1657['define']('ai.assistant.commands',qn(_0x44b6cb)),_0x2e1657['define']('ai.assistant.extraCommandGroups',[]),_0x2e1657['define']('ai.assistant.removeCommands',[]);let _0x8b817a=o(_0x2e1657['get']('ai.assistant.commands'),_0x44b6cb);const _0xf02413=_0x2e1657['get']('ai.assistant.extraCommandGroups'),_0x106ec1=_0x2e1657['get']('ai.assistant.removeCommands');_0xf02413['forEach'](_0x8d9a46=>{const _0x18ffee=_0x8b817a['find'](_0x740cb6=>_0x740cb6['groupId']===_0x8d9a46['groupId']);_0x18ffee?_0x18ffee['commands']=_0x18ffee['commands']['concat'](_0x8d9a46['commands']):_0x8b817a['push'](_0x8d9a46);}),_0x8b817a=_0x8b817a['filter'](_0x5b3b6b=>!_0x106ec1['includes'](_0x5b3b6b['groupId'])),_0x8b817a['forEach'](_0x4fc327=>{_0x4fc327['commands']=_0x4fc327['commands']['filter'](_0x13a5bb=>!_0x106ec1['includes'](_0x13a5bb['id']));}),_0x2e1657['set']('ai.assistant.commands',_0x8b817a);}}function qn(_0xba1b29){return[{'groupId':'editOrReview','groupLabel':Wn(_0xba1b29,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Wn(_0xba1b29,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Wn(_0xba1b29,'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(_0xba1b29,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Wn(_0xba1b29,'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(_0xba1b29,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Wn(_0xba1b29,'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(_0xba1b29,'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(_0xba1b29,'Change\x20tone'),'commands':[{'id':'professional','label':Wn(_0xba1b29,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Wn(_0xba1b29,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Wn(_0xba1b29,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Wn(_0xba1b29,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Wn(_0xba1b29,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Wn(_0xba1b29,'Change\x20style'),'commands':[{'id':'business','label':Wn(_0xba1b29,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Wn(_0xba1b29,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Wn(_0xba1b29,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Wn(_0xba1b29,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Wn(_0xba1b29,'Translate'),'commands':[{'id':'translateEnglish','label':Wn(_0xba1b29,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Wn(_0xba1b29,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Wn(_0xba1b29,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Wn(_0xba1b29,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Wn(_0xba1b29,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Wn(_0xba1b29,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Wn(_0xba1b29,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Wn(_0xba1b29,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ar extends _0x558b99{['abortController'];static get['requires'](){return[K];}constructor(_0x11265d){super(_0x11265d),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](K)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x31354e){return this['sendRequest'](_0x31354e)['catch'](_0x379ecc=>{if(_0x379ecc instanceof er)return Promise['reject'](_0x379ecc);if('AbortError'==_0x379ecc['name'])return Promise['resolve']();throw console['error'](_0x379ecc),new _0x54686c('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x51788f,_0x186a8a){const _0x27d8d5=this['editor']['locale'],_0x1164d0={'Content-Type':'application/json'};if('object'==typeof _0x51788f)Object['assign'](_0x1164d0,_0x51788f);else{if(_0x51788f)try{const _0x2851a0=await _0x51788f(_0x186a8a);Object['assign'](_0x1164d0,_0x2851a0);}catch{return Promise['reject'](new er(Wn(_0x27d8d5,'AI_ERROR_GET_HEADERS')));}}return _0x1164d0;}async['_prepareRequestParameters'](_0x1a77f8,_0x3b5c26){const _0x45fe60=this['editor']['locale'];if('object'==typeof _0x1a77f8)return _0x1a77f8;try{return await _0x1a77f8(_0x3b5c26);}catch{return Promise['reject'](new er(Wn(_0x45fe60,'AI_ERROR_GET_PARAMETERS')));}}}class Qn extends ar{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x15d8d9){super(_0x15d8d9),_0x15d8d9['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x15d8d9['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x15d8d9['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x15d8d9['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x15d8d9['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x15d8d9['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x26197c,context:_0x4c3525,onData:_0x3a4795,actionId:_0x15e384}){const _0x147a4c=this['editor']['locale'],_0x49dc73=await this['prepareMessages'](_0x26197c,_0x4c3525,_0x15e384),_0x1317f4=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x15e384),_0x446aca=await this['_prepareRequestParameters'](this['_requestParameters'],_0x15e384),_0x52906f={'messages':_0x49dc73,..._0x446aca},_0x200fbf={'method':'POST','headers':_0x1317f4,'body':JSON['stringify'](_0x52906f),'signal':this['abortController']['signal']},_0x343f46=await fetch(this['_apiUrl'],_0x200fbf);if(_0x343f46['ok'])return _0x446aca['stream']?await this['_readStreamableResponse'](_0x343f46,_0x3a4795):await this['_readStaticResponse'](_0x343f46,_0x3a4795),Promise['resolve']();{const _0x5edb36=await _0x343f46['text']();return _0x5edb36['includes']('context_length_exceeded')?Promise['reject'](new er(Wn(_0x147a4c,'AI_ERROR_CONTEXT_LENGTH'))):_0x5edb36['includes']('Moderation')?Promise['reject'](new er(Wn(_0x147a4c,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x5edb36));}}async['prepareMessages'](_0x2c8414,_0x231835,_0x6a1561){let _0x294553,_0xe06377;return _0x231835?(_0x294553='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.',_0xe06377='Instruction:\x0a'+_0x2c8414+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x231835):(_0x294553='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.',_0xe06377=_0x2c8414),[{'role':'system','content':_0x294553},{'role':'user','content':_0xe06377}];}async['_readStreamableResponse'](_0x202e39,_0x589b70){const _0x50e850=_0x202e39['body']['getReader'](),_0x33593e=new TextDecoder();let _0x23a959='',_0xad9c87='',_0x3d378c='',_0x260cb9=!0x1;for(;!_0x260cb9;){const {done:_0x225635,value:_0x32996b}=await _0x50e850['read'](),_0x710116=_0x23a959+_0x33593e['decode'](_0x32996b);let _0x13ac33='';_0x260cb9=_0x225635;try{_0x13ac33=this['_cleanUpData'](_0x710116),_0x23a959='';}catch{_0x23a959=_0x710116;continue;}_0xad9c87+=_0x13ac33,!_0x260cb9&&this['_isBufferIncomplete'](_0xad9c87)||_0xad9c87&&(_0x3d378c+=_0xad9c87,_0xad9c87='',_0x589b70(_0x3d378c));}return Promise['resolve']();}async['_readStaticResponse'](_0x425f57,_0x3da1b3){return _0x3da1b3((await _0x425f57['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0xc231e){const _0x594781=_0xc231e['split']('<')['length']!==_0xc231e['split']('>')['length'],_0x231b00=_0xc231e['length']<0x1e;return _0x594781&&_0x231b00;}['_cleanUpData'](_0x213842){return _0x213842['split'](/\n(?![^{]*\})/g)['map'](_0xcfb7f4=>_0xcfb7f4['replace']('data:\x20',''))['filter'](_0x5a41e7=>_0x5a41e7&&_0x5a41e7['length']>0x0&&'[DONE]'!==_0x5a41e7)['map'](_0x4a16ca=>{const {choices:_0x3442a0}=JSON['parse'](_0x4a16ca);if(_0x3442a0[0x0]?.['delta']?.['content'])return _0x3442a0[0x0]['delta']['content'];})['filter'](_0x316e14=>_0x316e14)['join']('');}}class Xn extends ar{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),_0x73e170('ai-aws-adapter-not-supported');}async['sendRequest'](_0x3ea9b5){throw gt('ai-aws-adapter-not-supported'),new er(Wn(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class ia extends _0x28db64{constructor(_0x34acc3,_0x4e9902={}){super(_0x34acc3),this['isToggleable']=!0x0,this['set']('side',_0x4e9902['side']||'top');const _0x56e470=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x32132b(_0x4e9902['class']||[]),_0x56e470['to']('side',_0x40c400=>'ck-tab-button_'+_0x40c400),_0x56e470['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x25f6b6{['children'];constructor(_0x160aa5,_0x315dc4={}){super(_0x160aa5);const _0x4df373=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x32132b(_0x315dc4['class']||[]),_0x4df373['to']('class'),_0x4df373['if']('isVisible','ck-hidden',_0x4584aa=>!_0x4584aa)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x25f6b6{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0xfd1148,_0x433b4d={}){super(_0xfd1148),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x433b4d['side']||'top'),this['set']('isMaximized',!0x1);const _0x5193bc=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x32132b(_0x433b4d['class']||[]),_0x5193bc['to']('side',_0x4d8ae6=>'ck-tabs_'+_0x4d8ae6),_0x5193bc['to']('class'),_0x5193bc['to']('isMaximized',_0x3e6dd8=>_0x3e6dd8?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x5193bc['to']('side',_0x2bd756=>'ck-tabs__buttons-container_'+_0x2bd756)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x5193bc['to']('side',_0x239525=>'ck-tabs__panels-container_'+_0x239525)]},'children':this['panelViews']},..._0x32132b(_0x433b4d['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x4b15e7){const _0x9034e9=this['_tabs']['get'](_0x4b15e7);return _0x9034e9||null;}['addTab'](_0x405011){const _0x1df3db=this['_setupButton']({'id':_0x405011['id'],'label':_0x405011['buttonLabel'],'icon':_0x405011['buttonIcon'],'order':_0x405011['order']}),_0x5413d7=new ea(this['locale']);return _0x5413d7['render'](),_0x405011['content']&&_0x5413d7['children']['add'](_0x405011['content']),this['panelViews']['add'](_0x5413d7),this['_tabs']['set'](_0x405011['id'],{'button':_0x1df3db,'panel':_0x5413d7,'order':void 0x0!==_0x405011['order']?_0x405011['order']:null}),this['fire']('addTab:'+_0x405011['id'],{'id':_0x405011['id'],'button':_0x1df3db,'panel':_0x5413d7}),null===this['activeTab']?this['activateTab'](_0x405011['id']):this['_hidePanel'](_0x405011['id']),{'button':_0x1df3db,'panel':_0x5413d7};}['activateTab'](_0xbfbbfa){if(null!==_0xbfbbfa&&!this['getTab'](_0xbfbbfa))throw new _0x54686c('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0xbfbbfa});this['activeTab']!==_0xbfbbfa&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0xbfbbfa,_0xbfbbfa&&this['_showPanel'](_0xbfbbfa),this['fire']('activateTab:'+_0xbfbbfa,_0xbfbbfa));}['showTab'](_0x4e7129){if(!this['getTab'](_0x4e7129))throw new _0x54686c('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x4e7129});this['_showPanel'](_0x4e7129),this['_showButton'](_0x4e7129),this['fire']('show:'+_0x4e7129,_0x4e7129);}['hideTab'](_0x2c28a6){if(!this['getTab'](_0x2c28a6))throw new _0x54686c('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x2c28a6});const _0x423aba=this['activeTab'];this['_hidePanel'](_0x2c28a6),this['_hideButton'](_0x2c28a6);const _0x1d68d7=this['getTabIds']();_0x423aba===_0x2c28a6&&_0x1d68d7['length']>0x1&&this['activateTab'](_0x1d68d7['find'](_0x495904=>_0x495904!==_0x2c28a6)),this['fire']('hide:'+_0x2c28a6,_0x2c28a6);}['_getPanel'](_0x4c53f8){const _0x2fd8be=this['_tabs']['get'](_0x4c53f8);return _0x2fd8be?_0x2fd8be['panel']:null;}['_showPanel'](_0x3e792f){null!==this['activeTab']&&this['activeTab']!==_0x3e792f||this['_getPanel'](_0x3e792f)['show']();}['_hidePanel'](_0x309230){const _0x3d7502=this['_getPanel'](_0x309230);_0x3d7502['isVisible']&&(this['activeTab']===_0x309230&&(this['activeTab']=null),_0x3d7502['hide']());}['_getButton'](_0x39dcda){const _0x285b9a=this['_tabs']['get'](_0x39dcda);return _0x285b9a?_0x285b9a['button']:null;}['_showButton'](_0x2f1b7c){this['_getButton'](_0x2f1b7c)['show']();}['_hideButton'](_0x28b1f7){this['_getButton'](_0x28b1f7)['hide']();}['_setupButton'](_0xe84cb3){const _0x2a84ce=new ia(this['locale'],{'side':this['side']}),_0x25793e=this['buttonViews'];if(_0x2a84ce['set']({'label':_0xe84cb3['label'],'icon':_0xe84cb3['icon'],'tooltip':!0x0,'withText':!0x0}),_0x2a84ce['bind']('isOn')['to'](this,'activeTab',_0x261abf=>_0x261abf===_0xe84cb3['id']),_0x2a84ce['bind']('side')['to'](this,'side'),_0xe84cb3['order']){const _0x53c44c=[...this['_tabs']]['reduce']((_0x2381c5,_0x259b1b)=>{const _0x5addb7=_0x259b1b[0x0],{order:_0x4d32e2}=_0x259b1b[0x1];return!_0x4d32e2||_0x4d32e2>_0xe84cb3['order']?_0x2381c5:_0x4d32e2>=_0x2381c5['order']?{'id':_0x5addb7,'order':_0x4d32e2}:_0x2381c5;},{'id':'','order':0x0}),_0x175354=_0x25793e['getIndex'](this['_getButton'](_0x53c44c['id']));_0x25793e['add'](_0x2a84ce,_0x175354+0x1);}else _0x25793e['add'](_0x2a84ce);return _0x2a84ce['on']('execute',()=>{this['activateTab'](_0xe84cb3['id']);}),_0x2a84ce;}}const ni=['overlay','sidebar','custom'],oi=['left','right'];class hi extends ss{constructor(_0x79a448,_0x103248={}){super(_0x79a448,_0x103248),this['set']('type',_0x103248['type']||'sidebar'),this['set']('side',_0x103248['side']||'right'),this['set']('isVisible',_0x103248['visibleByDefault']??!0x0);const _0x28c8b2=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x28c8b2['if']('type','ck-ai-tabs__overlay',_0x4f43b=>'overlay'===_0x4f43b),_0x28c8b2['if']('type','ck-ai-tabs__sidebar',_0x5e3b1d=>'sidebar'===_0x5e3b1d),_0x28c8b2['if']('isVisible','ck-hidden',_0x18b916=>!_0x18b916)]}}),this['buttonViews']['on']('add',(_0x4d3360,_0x4fb24a)=>{_0x4fb24a['set']('withText',!0x1);});}}class pt extends _0x3de4b5{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2ad0f7){super(_0x2ad0f7);const _0x8303db=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x8303db)throw new _0x54686c('ai-tabs-configuration-not-found');if(void 0x0!==_0x8303db['showResizeButton']&&(this['showResizeButton']=_0x8303db['showResizeButton']),'sidebar'!==_0x8303db['type']&&'overlay'!==_0x8303db['type']||_0x8303db['side']&&(this['side']=_0x8303db['side']),'sidebar'===_0x8303db['type']){if(this['container']=_0x8303db['element'],this['set']('type','sidebar'),!this['container'])throw new _0x54686c('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x8303db['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new hi(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x8303db['visibleByDefault']||_0x8303db['visibleByDefault']}),this['view']['render'](),this['view']['bind']('side')['to'](this,'side'),this['view']['bind']('type')['to'](this,'type'),this['container']&&this['container']['appendChild'](this['view']['element']),this['context']instanceof dt&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x38747b){if(_0x38747b&&this['type']!==_0x38747b){if(!ni['includes'](_0x38747b))throw new _0x54686c('ai-tabs-unsupported-ui-type');this['type']=_0x38747b;}}['switchSide'](_0x340387){if(_0x340387&&this['side']!==_0x340387){if(!oi['includes'](_0x340387))throw new _0x54686c('ai-tabs-unsupported-ui-side');this['side']=_0x340387;}}['resize'](){this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class q extends _0x3de4b5{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1b9a9a){super(_0x1b9a9a),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 _0x18dbe9=this['context']['plugins']['get']('CloudServices');if(!_0x18dbe9['token'])throw new _0x54686c('ai-missing-token',this);this['_token']=_0x18dbe9['token'];}['startConversation'](_0x39196e,_0xac96aa){const _0x4f7108=this['_sendApiRequest']('/conversations','POST',{'id':_0x39196e,'group':_0xac96aa});return{'getConversation':async()=>(await _0x4f7108['request'])['json'](),'abortController':_0x4f7108['abortController']};}['queryAssistant']({message:_0x399652,conversationId:_0x38e9b1,parts:_0x152676,capabilities:_0x62d75e,model:_0x3c571b,attributes:_0x415a2d}){const _0x7efc9c={'prompt':_0x399652,'content':_0x152676,'model':_0x3c571b,..._0x62d75e&&{'capabilities':_0x62d75e},..._0x415a2d&&{'attributes':_0x415a2d}},_0x112787=this['_sendApiRequest']('/conversations/'+_0x38e9b1+'/messages','POST',_0x7efc9c);return{'getStream':async()=>{const _0xf05699=(await _0x112787['request'])['body'];return this['_getStreamReader'](_0xf05699);},'abortController':_0x112787['abortController']};}['executeCustomAction']({content:_0x2b460f,message:_0x28f99f,model:_0x115770,outputFormat:_0x162882}){const _0x3d7411={'content':[{'type':'text','content':_0x2b460f}],'prompt':_0x28f99f,'model':_0x115770,'outputFormat':_0x162882},_0x4c36cc=this['_sendApiRequest']('/actions/custom/calls','POST',_0x3d7411);return{'getStream':async()=>{const _0x303c20=(await _0x4c36cc['request'])['body'];return this['_getStreamReader'](_0x303c20);},'abortController':_0x4c36cc['abortController']};}['executeAction']({actionName:_0x456f90,content:_0x27b255,args:_0x1e7945}){const _0x1eafae={'content':[{'type':'text','content':_0x27b255}],'args':_0x1e7945},_0x703aa5=this['_sendApiRequest']('/actions/system/'+_0x456f90+'/calls','POST',_0x1eafae);return{'getStream':async()=>{const _0xd2e977=(await _0x703aa5['request'])['body'];return this['_getStreamReader'](_0xd2e977);},'abortController':_0x703aa5['abortController']};}['uploadFile'](_0x5202ed,_0x5835e7,_0x3c7845){const _0x290267=new FormData();_0x290267['append']('file',_0x5835e7,_0x5835e7['name']),_0x3c7845&&_0x290267['append']('attributes',JSON['stringify'](_0x3c7845));const _0x5c570e=this['_sendApiRequest']('/conversations/'+_0x5202ed+'/files','POST',_0x290267);return{'getId':async()=>(await _0x5c570e['request'])['json'](),'abortController':_0x5c570e['abortController']};}['fetchDocument'](_0x3c67f2,_0x254cb1){const _0x44b7e4=this['_sendApiRequest']('/conversations/'+_0x3c67f2+'/documents/'+_0x254cb1,'GET');return{'getDocument':async()=>(await _0x44b7e4['request'])['json'](),'abortController':_0x44b7e4['abortController']};}['uploadDocument'](_0x8f8bc5,_0x1aa4f6,_0x31b2a6){const _0x43d434={'content':_0x1aa4f6};_0x31b2a6&&(_0x43d434['attributes']=_0x31b2a6);const _0x31076b=this['_sendApiRequest']('/conversations/'+_0x8f8bc5+'/documents','POST',_0x43d434);return{'getId':async()=>(await _0x31076b['request'])['json'](),'abortController':_0x31076b['abortController']};}['fetchConversations'](_0x181b14,_0x3c7798={}){const _0x5d5863=new URLSearchParams();_0x5d5863['append']('group',_0x181b14),_0x5d5863['append']('excludeEmpty',!0x1!==_0x3c7798['excludeEmpty']?'true':'false'),_0x5d5863['append']('limit',_0x3c7798['limit']?_0x3c7798['limit']['toString']():'100'),_0x5d5863['append']('sortBy',_0x3c7798['sortBy']?_0x3c7798['sortBy']:'createdAt'),_0x5d5863['append']('order',_0x3c7798['order']?_0x3c7798['order']:'desc');const _0x681157=this['_sendApiRequest']('/conversations?'+_0x5d5863['toString'](),'GET');return{'getConversations':async()=>{const _0x23724c=await _0x681157['request'];return(await _0x23724c['json']())['items'];},'abortController':_0x681157['abortController']};}['deleteConversation'](_0x1a89d2){const _0x31f757=this['_sendApiRequest']('/conversations/'+_0x1a89d2,'DELETE');return{'execute':async()=>{await _0x31f757['request'];},'abortController':_0x31f757['abortController']};}['updateConversation'](_0x22bd65,_0x369f2c){const _0x23ab81=this['_sendApiRequest']('/conversations/'+_0x22bd65,'PATCH',_0x369f2c);return{'getResult':async()=>(await _0x23ab81['request'],_0x369f2c),'abortController':_0x23ab81['abortController']};}['fetchConversation'](_0x10a785){const _0x4e34e9=this['_sendApiRequest']('/conversations/'+_0x10a785,'GET');return{'getConversation':async()=>(await _0x4e34e9['request'])['json'](),'abortController':_0x4e34e9['abortController']};}['fetchConversationMessages'](_0x1fcd52){const _0xc6cbbf=this['_sendApiRequest']('/conversations/'+_0x1fcd52+'/messages','GET');return{'getMessages':async()=>{const _0x3aa7ad=await _0xc6cbbf['request'];return(await _0x3aa7ad['json']())['items'];},'abortController':_0xc6cbbf['abortController']};}['uploadUrl'](_0x23b722,_0x5911d7,_0x551acb){const _0x1febd1=this['_sendApiRequest']('/conversations/'+_0x23b722+'/web-resources','POST',{'url':_0x5911d7,'attributes':_0x551acb});return{'getId':async()=>(await _0x1febd1['request'])['json'](),'abortController':_0x1febd1['abortController']};}['getModels'](_0x303d31='en'){const _0x2e22e0=new URLSearchParams();_0x2e22e0['append']('language',_0x303d31);const _0x1d00c0='/models/1?'+_0x2e22e0['toString'](),_0x710287=this['_sendApiRequest'](_0x1d00c0,'GET');return{'list':async()=>await(await _0x710287['request'])['json'](),'abortController':_0x710287['abortController']};}['deleteFile'](_0x3afb10,_0x53d3c6){const _0x5bf26f=this['_sendApiRequest']('/conversations/'+_0x3afb10+'/files/'+_0x53d3c6,'DELETE');return{'execute':async()=>{await _0x5bf26f['request'];},'abortController':_0x5bf26f['abortController']};}['deleteDocument'](_0x7b820c,_0x1029f8){const _0x3ecaac=this['_sendApiRequest']('/conversations/'+_0x7b820c+'/documents/'+_0x1029f8,'DELETE');return{'execute':async()=>{await _0x3ecaac['request'];},'abortController':_0x3ecaac['abortController']};}['deleteWebResource'](_0x596014,_0x2a79ba){const _0x2183e8=this['_sendApiRequest']('/conversations/'+_0x596014+'/web-resources/'+_0x2a79ba,'DELETE');return{'execute':async()=>{await _0x2183e8['request'];},'abortController':_0x2183e8['abortController']};}['callSystemReview']({reviewName:_0x23f8f3,content:_0x410c79,args:_0x5095c2}){const _0x39e504=this['_sendApiRequest']('/reviews/system/'+_0x23f8f3+'/calls','POST',{'content':[{'type':'text','content':_0x410c79}],'args':_0x5095c2});return{'getStream':async()=>{const _0x7476c7=(await _0x39e504['request'])['body'];return this['_getStreamReader'](_0x7476c7);},'abortController':_0x39e504['abortController']};}['callCustomReview']({content:_0x4ec71b,prompt:_0x487c07,model:_0x100a36}){const _0x32499e=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x4ec71b}],'prompt':_0x487c07,'model':_0x100a36});return{'getStream':async()=>{const _0x5daaf0=(await _0x32499e['request'])['body'];return this['_getStreamReader'](_0x5daaf0);},'abortController':_0x32499e['abortController']};}['upsertAIChatRating'](_0x51db91,_0x4ae3e6,_0x3fc98f){const _0x11d848=this['_sendApiRequest']('/conversations/'+_0x51db91+'/messages/'+_0x4ae3e6+'/ratings','PUT',{'positiveCount':_0x3fc98f['positiveCount'],'totalCount':_0x3fc98f['totalCount'],'modificationId':_0x3fc98f['modificationId']});return{'execute':async()=>{await _0x11d848['request'];},'abortController':_0x11d848['abortController']};}['upsertAIActionRating'](_0x3fd023,_0x1f36af,_0x5d81ed){const _0x334a51=this['_sendApiRequest']('/actions/system/'+_0x3fd023+'/calls/'+_0x1f36af+'/ratings','PUT',{'positiveCount':_0x5d81ed['positiveCount'],'totalCount':_0x5d81ed['totalCount']});return{'execute':async()=>{await _0x334a51['request'];},'abortController':_0x334a51['abortController']};}['upsertCustomAIActionRating'](_0x3de891,_0x532427){const _0x605779=this['_sendApiRequest']('/actions/custom/calls/'+_0x3de891+'/ratings','PUT',{'positiveCount':_0x532427['positiveCount'],'totalCount':_0x532427['totalCount']});return{'execute':async()=>{await _0x605779['request'];},'abortController':_0x605779['abortController']};}['upsertAIReviewRating'](_0x18723c,_0x3212d1,_0x2a7f1a,_0x28d213){const _0x31a90a=this['_sendApiRequest']('/reviews/system/'+_0x18723c+'/calls/'+_0x3212d1+'/ratings','PUT',{'positiveCount':_0x2a7f1a['positiveCount'],'totalCount':_0x2a7f1a['totalCount'],'dataId':_0x28d213});return{'execute':async()=>{await _0x31a90a['request'];},'abortController':_0x31a90a['abortController']};}['upsertCustomAIReviewRating'](_0x3816a7,_0x45833f,_0x17e423){const _0x479886=this['_sendApiRequest']('/reviews/custom/calls/'+_0x3816a7+'/ratings','PUT',{'positiveCount':_0x45833f['positiveCount'],'totalCount':_0x45833f['totalCount'],'dataId':_0x17e423});return{'execute':async()=>{await _0x479886['request'];},'abortController':_0x479886['abortController']};}['_sendApiRequest'](_0x332f2b,_0x242798,_0x42dc7d){const _0xc6f84e=new AbortController(),_0x317358=_0x42dc7d instanceof FormData,_0x20daf2={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x42dc7d&&!_0x317358&&(_0x20daf2['Content-Type']='application/json');const _0x4696a2={'method':_0x242798,'headers':_0x20daf2,'signal':_0xc6f84e['signal']};return _0x42dc7d&&(_0x4696a2['body']=_0x317358?_0x42dc7d:JSON['stringify'](_0x42dc7d)),{'request':fetch(''+this['_apiUrl']+_0x332f2b,_0x4696a2)['catch'](_0x3181bb=>{this['_handleError'](_0x3181bb);})['then'](_0x91ae10=>_0x91ae10['ok']?_0x91ae10:_0x91ae10['json']()['then'](_0x57c423=>{throw{'url':this['_apiUrl'],'path':_0x332f2b,'method':_0x242798,'body':_0x42dc7d,'status':(_0x91ae10||{})['status'],'statusText':(_0x91ae10||{})['statusText'],'code':_0x57c423['code'],'message':_0x57c423['message'],'traceId':_0x57c423['traceId']};})),'abortController':_0xc6f84e};}async*['_getStreamReader'](_0xd6bf00){const _0x80754=[],_0x57d9cf=_0xd6bf00['getReader'](),_0x5ca41c=$t({'onError':_0x107e06=>{this['_handleError'](_0x107e06);},'onEvent':_0x374d88=>{_0x374d88['data']=JSON['parse'](_0x374d88['data']),_0x80754['push'](_0x374d88);}});try{let _0x427488=!0x1;for(;!_0x427488;){const {done:_0xa47c13,value:_0x384fba}=await _0x57d9cf['read']();_0xa47c13&&(_0x427488=!0x0),_0x5ca41c['feed'](this['_decoder']['decode'](_0x384fba,{'stream':!0x0})),yield*_0x80754,_0x80754['length']=0x0;}}catch(_0x205f80){this['_handleError'](_0x205f80);}finally{_0x57d9cf['releaseLock'](),_0x5ca41c['reset']();}}['_handleError'](_0x5076f5){if(_0x5076f5 instanceof _0x54686c)throw _0x5076f5;if(_0x5076f5 instanceof Error&&'AbortError'===_0x5076f5['name'])throw new _0x54686c('ai-request-aborted',this,{'originalError':_0x5076f5});throw new _0x54686c('ai-request-failed',this,{'originalError':_0x5076f5});}}function i(_0x218b5d,_0x1b76b1,_0x1c33fb){const t=_0x218b5d['t'];switch(_0x1b76b1){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'},_0x1c33fb);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});case'AI_SUGGESTION_CONTENT_PART_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_OUTDATED','string':'Change\x20is\x20outdated'});case'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED':return t({'id':'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED','string':'Change\x20is\x20already\x20applied'});case'AI_SUGGESTION_CONTENT_PART_APPLY':return t({'id':'AI_SUGGESTION_CONTENT_PART_APPLY','string':'Apply\x20change'});case'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION','string':'Add\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_REJECT':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECT','string':'Reject\x20change'});case'AI_SUGGESTION_CONTENT_PART_REMOVED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REMOVED','string':'Removed\x20content.\x20Use\x20\x22Show\x20details\x22\x20to\x20learn\x20more.'});case'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED','string':'Approved'});case'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED','string':'Rejected'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED','string':'Outdated'});case'AI_DISCLAIMER_TEXT':return t({'id':'AI_DISCLAIMER_TEXT','string':'AI\x20can\x20make\x20mistakes.\x20Please\x20double-check\x20responses.'});case'AI_TABS_LABEL_MAXIMIZE':return t({'id':'AI_TABS_LABEL_MAXIMIZE','string':'Maximize'});case'AI_TABS_LABEL_MINIMIZE':return t({'id':'AI_TABS_LABEL_MINIMIZE','string':'Minimize'});case'AI_CHAT_HEADING':return t({'id':'AI_CHAT_HEADING','string':'Chat'});case'AI_CHAT_SOURCES_HEADER':return t({'id':'AI_CHAT_SOURCES_HEADER','string':'Sources'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi!\x20I\x20can\x20help\x20you\x20draft,\x20rewrite,\x20and\x20improve\x20your\x20text,\x20explore\x20ideas,\x20research\x20topics,\x20and\x20solve\x20problems.\x20How\x20can\x20I\x20help\x20right\x20now?'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'The\x20request\x20was\x20aborted.'});case'AI_CHAT_GENERIC_ERROR':return t({'id':'AI_CHAT_GENERIC_ERROR','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_START_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_START_CONVERSATION','string':'Unable\x20to\x20start\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION','string':'Unable\x20to\x20load\x20chosen\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE','string':'Failed\x20to\x20upload\x20files:\x20%0.\x20Please\x20try\x20again.'},_0x1c33fb);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.'},_0x1c33fb);case'AI_CHAT_RESOURCE_LOAD_FAILED':return t({'id':'AI_CHAT_RESOURCE_LOAD_FAILED','string':'Failed\x20to\x20load\x20resource.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_CURRENT_DOCUMENT':return t({'id':'AI_CHAT_CONTEXT_CURRENT_DOCUMENT','string':'Current\x20document'});case'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT','string':'Remove\x20from\x20context'});case'AI_CHAT_CONTEXT_ADD_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_ADD_CONTEXT','string':'Add\x20context'});case'AI_CHAT_CONTEXT_URL_LABEL':return t({'id':'AI_CHAT_CONTEXT_URL_LABEL','string':'URL'});case'AI_CHAT_CONTEXT_FILE_LABEL':return t({'id':'AI_CHAT_CONTEXT_FILE_LABEL','string':'File'});case'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL':return t({'id':'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL','string':'Current\x20context'});case'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL':return t({'id':'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL','string':'Selected\x20content'});case'AI_CHAT_SEARCH_WEB':return t({'id':'AI_CHAT_SEARCH_WEB','string':'Web\x20search'});case'AI_CHAT_ENABLE_WEB_SEARCH':return t({'id':'AI_CHAT_ENABLE_WEB_SEARCH','string':'Enable\x20web\x20search'});case'AI_CHAT_DISABLE_WEB_SEARCH':return t({'id':'AI_CHAT_DISABLE_WEB_SEARCH','string':'Disable\x20web\x20search'});case'AI_CHAT_REASONING':return t({'id':'AI_CHAT_REASONING','string':'Reasoning'});case'AI_CHAT_ENABLE_REASONING':return t({'id':'AI_CHAT_ENABLE_REASONING','string':'Enable\x20reasoning'});case'AI_CHAT_DISABLE_REASONING':return t({'id':'AI_CHAT_DISABLE_REASONING','string':'Disable\x20reasoning'});case'AI_CHAT_COMMANDS':return t({'id':'AI_CHAT_COMMANDS','string':'Commands'});case'AI_CHAT_SEARCH_RESOURCES':return t({'id':'AI_CHAT_SEARCH_RESOURCES','string':'Search\x20resources'});case'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT','string':'Back\x20to\x20context\x20options'});case'AI_CHAT_CONTEXT_URL_ADD_URL':return t({'id':'AI_CHAT_CONTEXT_URL_ADD_URL','string':'Add\x20URL'});case'AI_CHAT_CONTEXT_URL_PLACEHOLDER':return t({'id':'AI_CHAT_CONTEXT_URL_PLACEHOLDER','string':'Add\x20URL...'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL','string':'Failed\x20to\x20upload\x20URL:\x20%0.\x20Please\x20try\x20again.'},_0x1c33fb);case'AI_CHAT_CONTEXT_INVALID_DATA':return t({'id':'AI_CHAT_CONTEXT_INVALID_DATA','string':'Invalid\x20context\x20data\x20type\x20for\x20the\x20selected\x20resource.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE','string':'Unsupported\x20resource\x20type.\x20Only\x20files\x20and\x20URLs\x20are\x20supported.'});case'AI_CHAT_CONTEXT_URL_EMPTY_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_EMPTY_ERROR','string':'URL\x20cannot\x20be\x20empty.'});case'AI_CHAT_CONTEXT_URL_INVALID_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_INVALID_ERROR','string':'Please\x20enter\x20a\x20valid\x20URL.'});case'AI_CHAT_INVALID_REQUEST':return t({'id':'AI_CHAT_INVALID_REQUEST','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE','string':'The\x20file\x20type\x20is\x20not\x20supported.\x20Please\x20upload\x20a\x20different\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_LARGE':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_LARGE','string':'The\x20file\x20is\x20too\x20large.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES','string':'The\x20file\x20has\x20too\x20many\x20pages.\x20Please\x20upload\x20a\x20file\x20with\x20fewer\x20pages.'});case'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED':return t({'id':'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED','string':'The\x20form\x20data\x20size\x20limits\x20are\x20exceeded.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR','string':'AI\x20is\x20preparing\x20a\x20response...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH','string':'AI\x20is\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REASONING','string':'AI\x20is\x20using\x20reasoning\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING','string':'AI\x20is\x20using\x20reasoning\x20and\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH','string':'Scanned\x20the\x20internet\x20for\x20insights'});case'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING','string':'AI\x20used\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING','string':'AI\x20used\x20search\x20and\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR','string':'Ask\x20AI\x20anything...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH','string':'Ask\x20AI\x20anything\x20(web\x20search\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING','string':'Ask\x20AI\x20anything\x20(reasoning\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING','string':'Ask\x20AI\x20anything\x20(web\x20search\x20and\x20reasoning\x20enabled)...'});case'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL','string':'Suggest\x20all'},_0x1c33fb);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x1c33fb);case'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL','string':'Apply\x20all'});case'AI_CHAT_SUGGESTION_ACTION_APPLY':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY','string':'Apply'});case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x1c33fb);case'AI_CHAT_MODEL_SELECTOR_GROUP':return t({'id':'AI_CHAT_MODEL_SELECTOR_GROUP','string':'Models'});case'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP':return t({'id':'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP','string':'Select\x20a\x20model'});case'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP':return t({'id':'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP','string':'Start\x20a\x20new\x20conversation\x20to\x20change\x20the\x20model'});case'AI_CHAT_CAPABILITIES_YES':return t({'id':'AI_CHAT_CAPABILITIES_YES','string':'Yes'});case'AI_CHAT_CAPABILITIES_NO':return t({'id':'AI_CHAT_CAPABILITIES_NO','string':'No'});case'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT':return t({'id':'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT','string':'The\x20selected\x20model\x20is\x20no\x20longer\x20available,\x20so\x20you\x20cannot\x20continue\x20this\x20conversation.\x20Please\x20'});case'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON':return t({'id':'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON','string':'start\x20a\x20new\x20one.'});case'AI_CHAT_CONTEXT_SOURCES_LABEL':return t({'id':'AI_CHAT_CONTEXT_SOURCES_LABEL','string':'Sources'});case'AI_CHAT_HISTORY_HEADING':return t({'id':'AI_CHAT_HISTORY_HEADING','string':'Chat\x20History'});case'AI_CHAT_HISTORY_SEARCH_LABEL':return t({'id':'AI_CHAT_HISTORY_SEARCH_LABEL','string':'Search\x20history'});case'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY':return t({'id':'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY','string':'No\x20chats\x20were\x20found\x20matching\x20\x22%0\x22.'},_0x1c33fb);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.'},_0x1c33fb);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.'},_0x1c33fb);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.'},_0x1c33fb);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'},_0x1c33fb);case'AI_BALLOON_APPLY_BUTTON':return t({'id':'AI_BALLOON_APPLY_BUTTON','string':'Apply'});case'AI_BALLOON_SUGGEST_BUTTON':return t({'id':'AI_BALLOON_SUGGEST_BUTTON','string':'Suggest'});case'AI_BALLOON_NEXT_LABEL':return t({'id':'AI_BALLOON_NEXT_LABEL','string':'Next'});case'AI_BALLOON_PREVIOUS_LABEL':return t({'id':'AI_BALLOON_PREVIOUS_LABEL','string':'Previous'});case'AI_SUGGESTION_NO_PARTS_WARNING':return t({'id':'AI_SUGGESTION_NO_PARTS_WARNING','string':'This\x20change\x20is\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20of\x20the\x20changes\x20are\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Retry'});case'AI_ACTIONS_PREVIOUS_INTERACTION':return t({'id':'AI_ACTIONS_PREVIOUS_INTERACTION','string':'Previous'});case'AI_ACTIONS_NEXT_INTERACTION':return t({'id':'AI_ACTIONS_NEXT_INTERACTION','string':'Next'});case'AI_MODEL_NAME_AUTO':return t({'id':'AI_MODEL_NAME_AUTO','string':'Auto'});case'AI_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});case'AI_QUICK_ACTIONS_SEARCH':return t({'id':'AI_QUICK_ACTIONS_SEARCH','string':'Search\x20AI\x20commands'});case'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND','string':'No\x20AI\x20commands\x20found'});case'AI_QUICK_ACTIONS_ASK_AI':return t({'id':'AI_QUICK_ACTIONS_ASK_AI','string':'Ask\x20AI'});case'AI_QUICK_ACTIONS_CHAT_COMMANDS':return t({'id':'AI_QUICK_ACTIONS_CHAT_COMMANDS','string':'Chat\x20commands'});case'AI_QUICK_ACTIONS_IMPROVE_WRITING':return t({'id':'AI_QUICK_ACTIONS_IMPROVE_WRITING','string':'Improve\x20writing'});case'AI_QUICK_ACTIONS_CONTINUE_WRITING':return t({'id':'AI_QUICK_ACTIONS_CONTINUE_WRITING','string':'Continue\x20writing'});case'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING':return t({'id':'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING','string':'Fix\x20grammar\x20&\x20spelling'});case'AI_QUICK_ACTIONS_ADJUST_LENGTH':return t({'id':'AI_QUICK_ACTIONS_ADJUST_LENGTH','string':'Adjust\x20length'});case'AI_QUICK_ACTIONS_CHANGE_TONE':return t({'id':'AI_QUICK_ACTIONS_CHANGE_TONE','string':'Change\x20tone'});case'AI_QUICK_ACTIONS_TRANSLATE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE','string':'Translate'});case'AI_QUICK_ACTIONS_EXPLAIN':return t({'id':'AI_QUICK_ACTIONS_EXPLAIN','string':'Explain'});case'AI_QUICK_ACTIONS_SUMMARIZE':return t({'id':'AI_QUICK_ACTIONS_SUMMARIZE','string':'Summarize'});case'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS':return t({'id':'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS','string':'Highlight\x20key\x20points'});case'AI_QUICK_ACTIONS_MAKE_SHORTER':return t({'id':'AI_QUICK_ACTIONS_MAKE_SHORTER','string':'Make\x20shorter'});case'AI_QUICK_ACTIONS_MAKE_LONGER':return t({'id':'AI_QUICK_ACTIONS_MAKE_LONGER','string':'Make\x20longer'});case'AI_QUICK_ACTIONS_MORE_CASUAL':return t({'id':'AI_QUICK_ACTIONS_MORE_CASUAL','string':'More\x20casual'});case'AI_QUICK_ACTIONS_MORE_DIRECT':return t({'id':'AI_QUICK_ACTIONS_MORE_DIRECT','string':'More\x20direct'});case'AI_QUICK_ACTIONS_MORE_FRIENDLY':return t({'id':'AI_QUICK_ACTIONS_MORE_FRIENDLY','string':'More\x20friendly'});case'AI_QUICK_ACTIONS_MORE_CONFIDENT':return t({'id':'AI_QUICK_ACTIONS_MORE_CONFIDENT','string':'More\x20confident'});case'AI_QUICK_ACTIONS_MORE_PROFESSIONAL':return t({'id':'AI_QUICK_ACTIONS_MORE_PROFESSIONAL','string':'More\x20professional'});case'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT':return t({'id':'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT','string':'Adjust\x20based\x20on\x20the\x20rest\x20of\x20the\x20document'});case'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH','string':'English'});case'AI_QUICK_ACTIONS_TRANSLATE_CHINESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_QUICK_ACTIONS_TRANSLATE_FRENCH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_FRENCH','string':'French'});case'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE','string':'Japanese'});case'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE','string':'Portuguese'});case'AI_QUICK_ACTIONS_TRANSLATE_KOREAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_KOREAN','string':'Korean'});case'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN','string':'Italian'});case'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN','string':'Russian'});case'AI_QUICK_ACTIONS_TRANSLATE_SPANISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_SPANISH','string':'Spanish'});case'AI_QUICK_ACTIONS_TRANSLATE_GERMAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_GERMAN','string':'German'});case'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','string':'%0\x20plugin\x20is\x20required\x20but\x20not\x20found.'},_0x1c33fb);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});case'AI_ACTIONS_GENERIC_ERROR':return t({'id':'AI_ACTIONS_GENERIC_ERROR','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20response.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_BALLOON_SELECTION_REMOVED_ERROR':return t({'id':'AI_BALLOON_SELECTION_REMOVED_ERROR','string':'Changes\x20cannot\x20be\x20applied.\x20The\x20original\x20content\x20no\x20longer\x20exists.'});case'AI_REVIEW_MODE_STOP_GENERATING':return t({'id':'AI_REVIEW_MODE_STOP_GENERATING','string':'Stop\x20generating'});case'AI_REVIEW_MODE_HIDE_CHANGES':return t({'id':'AI_REVIEW_MODE_HIDE_CHANGES','string':'Hide\x20changes'});case'AI_REVIEW_MODE_SHOW_CHANGES':return t({'id':'AI_REVIEW_MODE_SHOW_CHANGES','string':'Show\x20changes'});case'AI_REVIEW_MODE_ACCEPT_ALL':return t({'id':'AI_REVIEW_MODE_ACCEPT_ALL','string':'Accept\x20all'});case'AI_REVIEW_MODE_EXIT_REVIEW':return t({'id':'AI_REVIEW_MODE_EXIT_REVIEW','string':'Exit\x20review'});case'AI_REVIEW_MODE_ACCEPT_CHANGE':return t({'id':'AI_REVIEW_MODE_ACCEPT_CHANGE','string':'Accept'});case'AI_REVIEW_MODE_DISMISS_CHANGE':return t({'id':'AI_REVIEW_MODE_DISMISS_CHANGE','string':'Dismiss'});case'AI_REVIEW_MODE_LEARN_MORE':return t({'id':'AI_REVIEW_MODE_LEARN_MORE','string':'Learn\x20more'});case'AI_REVIEW_MODE_COMPLETED_TEXT':return t({'id':'AI_REVIEW_MODE_COMPLETED_TEXT','string':'There\x27s\x20nothing\x20left\x20to\x20review.'});case'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT':return t({'id':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20changes\x20to\x20suggest.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE':return t({'id':'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE','string':'AI\x20Review\x20initialized\x20with\x20errors.\x20Some\x20features\x20may\x20not\x20be\x20available\x20or\x20work\x20properly.'});case'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20whole\x20review\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE','string':'Not\x20everything\x20went\x20through,\x20but\x20the\x20completed\x20items\x20are\x20listed\x20below.'});case'AI_REVIEW_MODE':return t({'id':'AI_REVIEW_MODE','string':'Review'});case'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR':return t({'id':'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR','string':'Prompt\x20must\x20not\x20be\x20empty'});case'AI_REVIEW_CHECK_CUSTOM_TITLE':return t({'id':'AI_REVIEW_CHECK_CUSTOM_TITLE','string':'Custom\x20command'});case'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION','string':'Enter\x20a\x20custom\x20command\x20for\x20a\x20specific\x20review.'});case'AI_REVIEW_CHECK_CORRECTNESS_TITLE':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_TITLE','string':'Proofread'});case'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION','string':'Check\x20the\x20text\x20for\x20errors\x20in\x20grammar,\x20spelling,\x20and\x20punctuation.'});case'AI_REVIEW_CHECK_CLARITY_TITLE':return t({'id':'AI_REVIEW_CHECK_CLARITY_TITLE','string':'Improve\x20clarity'});case'AI_REVIEW_CHECK_CLARITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CLARITY_DESCRIPTION','string':'Improve\x20the\x20logical\x20structure\x20and\x20precision\x20for\x20clearer\x20message.'});case'AI_REVIEW_CHECK_READABILITY_TITLE':return t({'id':'AI_REVIEW_CHECK_READABILITY_TITLE','string':'Improve\x20readability'});case'AI_REVIEW_CHECK_READABILITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_READABILITY_DESCRIPTION','string':'Adjust\x20sentence\x20structure\x20and\x20word\x20choice\x20for\x20an\x20easier\x20read.'});case'AI_REVIEW_CHECK_MAKE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TITLE','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_DESCRIPTION','string':'Shorten\x20or\x20lengthen\x20the\x20text\x20as\x20needed.'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER','string':'Longer'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER','string':'Shorter'});case'AI_REVIEW_CHECK_MAKE_TONE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_TITLE','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION','string':'Modify\x20the\x20text\x20to\x20a\x20desired\x20tone\x20and\x20style.'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL','string':'Casual'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT','string':'Direct'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY','string':'Friendly'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT','string':'Confident'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL','string':'Professional'});case'AI_REVIEW_CHECK_TRANSLATE_TITLE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_TITLE','string':'Translate'});case'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION','string':'Translate\x20the\x20text\x20into\x20another\x20language.'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL','string':'Select\x20language'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH','string':'English'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH','string':'Spanish'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH','string':'French'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN','string':'German'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE','string':'Japanese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN','string':'Russian'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE','string':'Portuguese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN','string':'Korean'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN','string':'Italian'});case'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED','string':'Accepted'});case'AI_REVIEW_MODE_CHECK_STATUS_REJECTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_REJECTED','string':'Dismissed'});case'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED','string':'Outdated'});case'AI_TOGGLE_BUTTON_LABEL':return t({'id':'AI_TOGGLE_BUTTON_LABEL','string':'AI'});case'AI_TRANSLATE_ACCEPT_ALL':return t({'id':'AI_TRANSLATE_ACCEPT_ALL','string':'Accept\x20translation'});case'AI_TRANSLATE_FINISH_HEADER_TITLE':return t({'id':'AI_TRANSLATE_FINISH_HEADER_TITLE','string':'Translation\x20complete.\x20Finish\x20when\x20ready.'});case'AI_TRANSLATE_EMPTY_RESULTS_TEXT':return t({'id':'AI_TRANSLATE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20translations\x20to\x20review.'});case'AI_TRANSLATE_FINISH_BUTTON_LABEL':return t({'id':'AI_TRANSLATE_FINISH_BUTTON_LABEL','string':'Finish\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE','string':'Content\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION','string':'A\x20dedicated\x20mode\x20for\x20translating\x20the\x20entire\x20text.'});case'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE','string':'Translating\x20to'});case'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE','string':'Translated\x20to'});case'AI_TRANSLATE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_TRANSLATE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20translations\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE','string':'This\x20conversation\x20is\x20loaded\x20from\x20chat\x20history\x20from\x20a\x20previous\x20session,\x20so\x20you\x20can’t\x20apply,\x20reject,\x20or\x20suggest\x20changes.'});case'AI_SUGGESTION_DISABLED_FEED_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_FEED_MESSAGE','string':'Actions\x20aren’t\x20available\x20for\x20changes\x20from\x20a\x20previous\x20session.'});default:return _0x1b76b1;}}function Hs(_0x26ad4a,_0x337bb2){const _0x5adb22=new _0x28db64(_0x26ad4a),_0x60627b=i(_0x26ad4a,'AI_TABS_LABEL_MINIMIZE'),_0x5cbfe4=i(_0x26ad4a,'AI_TABS_LABEL_MAXIMIZE');return _0x5adb22['set']({'withText':!0x1,'icon':_0x14a2a8,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary'}),_0x5adb22['bind']('label')['to'](_0x337bb2,'isMaximized',_0x5222ae=>_0x5222ae?_0x60627b:_0x5cbfe4),_0x5adb22['bind']('icon')['to'](_0x337bb2,'isMaximized',_0x22118a=>_0x22118a?_0x318b82:_0x14a2a8),_0x5adb22['bind']('isOn')['to'](_0x337bb2,'isMaximized'),_0x5adb22['on']('execute',()=>{_0x337bb2['fire']('resizeTabs');}),_0x5adb22;}function ji(_0x10599d){return _0x318981(_0x10599d);}function Tt(_0x2ee84e){return _0x3d00aa(_0x2ee84e);}function St(_0x2b6547,_0x41f726,_0x13d58e){const _0x39d0eb=null!==_0x41f726?_0x127717=>_0x127717['attribs'][_0x2b6547]===_0x41f726:_0x2702f7=>Boolean(_0x2702f7['attribs'][_0x2b6547]);return yt(_0x3e409f=>_0x1415cb(_0x3e409f)&&_0x39d0eb(_0x3e409f),_0x13d58e);}function Bi(_0x4873dd,_0x703037,_0x537478){const _0x2d8681=null!==_0x703037?_0x29f759=>_0x29f759['attribs'][_0x4873dd]===_0x703037:_0x3111d7=>Boolean(_0x3111d7['attribs'][_0x4873dd]);return _0x53d6a8(_0x46dac4=>_0x1415cb(_0x46dac4)&&_0x2d8681(_0x46dac4),_0x537478);}function At(_0x5efde3,_0x6895d6){return _0x5efde3&&_0x1415cb(_0x5efde3)?_0x5efde3['attribs'][_0x6895d6]:null;}function Qi(_0x268678,_0x3f63fb,_0x51c345){_0x1415cb(_0x268678)&&(null===_0x51c345?delete _0x268678['attribs'][_0x3f63fb]:_0x268678['attribs'][_0x3f63fb]=_0x51c345);}function qi(_0xb8895e,_0x10aef4,_0x52dded){const _0xe685a1=_0x10aef4['cloneNode'](!0x0);'beforebegin'===_0x52dded?_0x17e3d4(_0xb8895e,_0xe685a1):'afterbegin'===_0x52dded?_0x47697d(_0xb8895e,_0xe685a1):'beforeend'===_0x52dded?_0x283409(_0xb8895e,_0xe685a1):'afterend'===_0x52dded&&_0x5a8aef(_0xb8895e,_0xe685a1);}function Gi(_0x33c86d){const _0x25636a=[];let _0x16f6a3=_0x33c86d;for(;_0x16f6a3;)_0x16f6a3=_0x3d07f5(_0x16f6a3),_0x16f6a3&&_0x25636a['push'](_0x16f6a3);return _0x25636a;}function zn(_0x842be6){return _0x842be6['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Zi(_0x2cbf3e){let _0x380fd0=0x0;for(;_0x2cbf3e['parentNode'];)_0x2cbf3e=_0x2cbf3e['parentNode'],_0x380fd0++;return _0x380fd0;}function Ns(_0x201fd2){const _0x47366e=[];let _0x5c8a12=_0x201fd2['nextSibling'];for(;_0x5c8a12;)_0x47366e['push'](_0x5c8a12),_0x5c8a12=_0x5c8a12['nextSibling'];_0x47366e['forEach'](_0x2f3174=>{_0x2a3aa1(_0x2f3174);});}class Ui extends/* #__PURE__ -- @preserve */
25
- ts(){['_m2html'];constructor(){super(),this['_m2html']=new _0x52bcce();}['convertMarkdownToHTML'](_0x1ff2ec){const _0x5d175a=this['_m2html']['parse'](_0x1ff2ec);return this['parseAndNormalizeHTML'](_0x5d175a);}['parseAndNormalizeHTML'](_0x4e40da){return this['_parseHTML'](_0x4e40da);}['_parseHTML'](_0x2e09da){const _0x527a92=ji('<dummy>'+_0x2e09da['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x527a92['children']=_0x527a92['children'][0x0]['children'],_0x527a92;}}class Ni extends/* #__PURE__ -- @preserve */
26
- ts(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x1f15bd){super(),this['_generateUid']=_0x1f15bd||_0x589eaf;}['merge'](_0x39c2b1,_0x501cba,_0x4a776a){const _0xcdb40a=_0x39c2b1['cloneNode'](!0x0);if(0x0===_0x501cba['childNodes']['length']){const _0x4afe1b=[];return Bi('data-id','new-element',_0xcdb40a)['forEach'](_0x57f1d1=>{const _0x362a98=this['_generateUid']();Qi(_0x57f1d1,'data-id',_0x362a98),_0x4afe1b['push'](_0x362a98);}),this['_removeSpecialComments'](_0xcdb40a),{'parsedContent':_0xcdb40a,'newNodeIds':_0x4afe1b,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x4a776a&&_0x4a776a['markUnstableElements']&&this['_markLastTagElementUnstable'](_0xcdb40a),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Bi('data-id',null,_0x501cba)['map'](_0x4f7e55=>At(_0x4f7e55,'data-id'))['filter'](_0x3a8ca4=>!!_0x3a8ca4));let _0x1826a3=-0x1,_0x3ef75c=!0x1;const _0x5fb23=_0xcdb40a['childNodes'],_0x344777=Array['from'](_0x5fb23)['filter'](_0x4f540f=>!(0x3===_0x4f540f['nodeType']&&''===Tt(_0x4f540f)['trim']())),_0x2612d2=_0x344777['length'];for(let _0x29d419=0x0;_0x29d419<_0x2612d2;_0x29d419++){const _0x329761=_0x344777[_0x29d419],_0x1ac9a4=_0x344777[_0x29d419+0x1];if(this['_isNewNode'](_0x329761)){if(-0x1===_0x1826a3&&(_0x1826a3=_0x29d419),this['_markWrappedElements'](_0x329761),!this['_isNewNode'](_0x1ac9a4)){const [_0x2a7e0c,_0x2a8f29]=this['_findReferenceNode'](_0x329761,_0x3ef75c,_0x501cba);if(_0x2a7e0c){const _0x411d30=Array['from'](_0x344777)['slice'](_0x1826a3,_0x29d419+0x1);this['_insertNodes'](_0x2a7e0c,_0x411d30,_0x2a8f29),_0x1826a3=-0x1;}}}else{if(this['_isExistingContentComment'](_0x329761))_0x3ef75c=!0x0;else{if(this['_isExistingNode'](_0x329761)){const _0x2d46cd=At(_0x329761,'data-id');if(_0x2d46cd&&this['_existingDataIds']['has'](_0x2d46cd)){const _0x510ecb=St('data-id',_0x2d46cd,_0x501cba);this['_replaceNode'](_0x510ecb,_0x329761);}if(this['_touchedNodesState']['removedIds']['includes'](_0x2d46cd)){const _0x39eb5e=this['_touchedNodesState']['removedIds']['indexOf'](_0x2d46cd);this['_touchedNodesState']['removedIds']['splice'](_0x39eb5e,0x1);}}else{if(this['_isDelNode'](_0x329761)){const _0x1cbd27=At(_0x329761,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x1cbd27)||this['_storeDeletedElementIds'](_0x329761);}}}}}for(const _0x45da93 of this['_touchedNodesState']['removedIds']){const _0xeb1ab4=St('data-id',_0x45da93,_0x501cba);if(_0xeb1ab4){if(_0x4a776a&&_0x4a776a['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x45da93;const _0x4a0a9a=_0x4a776a['replaceRemovedWith']['cloneNode'](!0x0);Qi(_0x4a0a9a,'data-id',_0x45da93),Qi(_0x4a0a9a,'data-removed','true'),_0x304ded(_0xeb1ab4,_0x4a0a9a);}else _0x2a3aa1(_0xeb1ab4);}}if(Bi('data-wrapped-id',null,_0x501cba)['forEach'](_0x2ef821=>{const _0x17fb5e=St('data-id',At(_0x2ef821,'data-wrapped-id'),_0x501cba);var _0x5c75ea,_0x130853;_0x17fb5e&&(_0x130853=_0x2ef821,_0x2a3aa1(_0x5c75ea=_0x17fb5e),_0x304ded(_0x130853,_0x5c75ea));}),Bi('data-id','new-element',_0x501cba)['forEach'](_0x7465fe=>{const _0x37450b=this['_getUid'](_0x7465fe);Qi(_0x7465fe,'data-id',_0x37450b),this['_touchedNodesState']['newIds']['push'](_0x37450b);}),this['_removeSpecialComments'](_0x501cba),_0x4a776a&&_0x4a776a['markUnstableElements']&&this['_markUnstableElements'](_0x501cba,_0x4a776a['markUnstableElementsDepth']||0x0),_0x4a776a&&_0x4a776a['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x4497f4=St('data-id',this['_touchedNodesState']['lastTouchedId'],_0x501cba);for(;_0x4497f4;)Ns(_0x4497f4),_0x4497f4=_0x4497f4['parentNode'];}return{'parsedContent':_0x501cba,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x43a648,_0x446a5d,_0x5d862f){for(const _0x2212bd of _0x446a5d){const _0x6dc6a9=this['_getUid'](_0x2212bd);Qi(_0x2212bd,'data-id',_0x6dc6a9),this['_touchedNodesState']['newIds']['push'](_0x6dc6a9),this['_touchedNodesState']['lastTouchedId']=_0x6dc6a9;}const _0x18de32='afterbegin'===_0x5d862f||'afterend'===_0x5d862f?_0x446a5d['reverse']():_0x446a5d;for(const _0x38455b of _0x18de32)qi(_0x43a648,_0x38455b,_0x5d862f);}['_replaceNode'](_0x237728,_0x5e4247){if(!_0x237728)return;if(_0x3753f6=_0x5e4247,zn(Tt(_0x237728))===zn(Tt(_0x3753f6)))return;var _0x3753f6;const _0x36dec8=this['_getUid'](_0x237728);Qi(_0x5e4247,'data-id',_0x36dec8),this['_touchedNodesState']['modifiedIds']['push'](_0x36dec8),this['_touchedNodesState']['lastTouchedId']=_0x36dec8,_0x304ded(_0x237728,_0x5e4247['cloneNode'](!0x0));}['_findReferenceNode'](_0xe279ab,_0x495dec,_0x14a338){const _0x3abbf3=this['_findPrevElementWithDataId'](_0xe279ab,!0x1);if(_0x3abbf3){const _0x201446=this['_getNodeDataId'](_0x3abbf3),_0xd6c28f=St('data-id',_0x201446,_0x14a338);if(_0xd6c28f)return[_0xd6c28f,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x201446);}const _0x231c74=this['_findNextElementWithDataId'](_0xe279ab,!0x1);if(_0x231c74){const _0x30f5d4=this['_getNodeDataId'](_0x231c74),_0x4560c0=St('data-id',_0x30f5d4,_0x14a338);if(_0x4560c0)return[_0x4560c0,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x30f5d4);}return _0x495dec?_0xe279ab['nextSibling']?this['_findFallbackReferenceNode'](_0xe279ab,_0x14a338):[_0x14a338['childNodes'][_0x14a338['childNodes']['length']-0x1],'afterend']:[_0x14a338['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x5c9d1b,_0x430bdd){const _0x459fb1=[],_0x149dcf=this['_findPrevElementWithDataId'](_0x5c9d1b,!0x0);if(_0x149dcf){const _0x5240d2=St('data-id',this['_getNodeDataId'](_0x149dcf),_0x430bdd);_0x5240d2&&_0x459fb1['push']([_0x5240d2,'afterend']);}const _0x212482=this['_findNextElementWithDataId'](_0x5c9d1b,!0x0);if(_0x212482){const _0x2103a8=St('data-id',this['_getNodeDataId'](_0x212482),_0x430bdd);_0x2103a8&&_0x459fb1['push']([_0x2103a8,'beforebegin']);}if(_0x459fb1['length']>0x1)return Zi(_0x459fb1[0x0][0x0])<=Zi(_0x459fb1[0x1][0x0])?_0x459fb1[0x0]:_0x459fb1[0x1];return 0x1===_0x459fb1['length']?_0x459fb1[0x0]:[_0x430bdd['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x453472,_0x6b121b){let _0x5d9c12=_0x453472['nextSibling'],_0x2e111c=null,_0x2f3751=!0x1;for(;_0x5d9c12;){if(_0x3604f6(_0x5d9c12)){if(this['_isDelNode'](_0x5d9c12)&&(_0x2e111c=_0x5d9c12),this['_isExistingContentComment'](_0x5d9c12)&&_0x6b121b&&!_0x2f3751){_0x2f3751=!0x0,_0x5d9c12=_0x5d9c12['nextSibling'];continue;}break;}const _0x43a5b7=At(_0x5d9c12,'data-id');if(_0x43a5b7&&'new-element'!==_0x43a5b7&&this['_existingDataIds']['has'](_0x43a5b7)){_0x2e111c=_0x5d9c12;break;}_0x5d9c12=_0x5d9c12['nextSibling'];}return _0x2e111c;}['_findPrevElementWithDataId'](_0x468326,_0x4803e5){let _0x52edcb=_0x468326['previousSibling'],_0x2821a7=null,_0x55565b=!0x1;for(;_0x52edcb;){if(_0x3604f6(_0x52edcb)){if(this['_isDelNode'](_0x52edcb)&&(_0x2821a7=_0x52edcb),this['_isExistingContentComment'](_0x52edcb)&&_0x4803e5&&!_0x55565b){_0x55565b=!0x0,_0x52edcb=_0x52edcb['previousSibling'];continue;}break;}const _0x1860f=At(_0x52edcb,'data-id');if(_0x1860f&&'new-element'!==_0x1860f&&this['_existingDataIds']['has'](_0x1860f)){_0x2821a7=_0x52edcb;break;}_0x52edcb=_0x52edcb['previousSibling'];}return _0x2821a7;}['_markWrappedElements'](_0x54417a){_0x1415cb(_0x54417a)&&Bi('data-id',null,_0x54417a)['forEach'](_0x3562e1=>{this['_isExistingNode'](_0x3562e1)&&!this['_hasWrappedParent'](_0x3562e1)&&(Qi(_0x3562e1,'data-wrapped-id',At(_0x3562e1,'data-id')),Qi(_0x3562e1,'data-id',null));});}['_getNodeDataId'](_0x1412b1){if(!_0x1412b1)return null;if(_0x1415cb(_0x1412b1))return At(_0x1412b1,'data-id');if(_0x3604f6(_0x1412b1)){const _0x167c1f=Tt(_0x1412b1)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x167c1f&&_0x167c1f[0x1])return _0x167c1f[0x1];}return null;}['_storeDeletedElementIds'](_0x760824){if(_0x3604f6(_0x760824)){const _0x58c574=Tt(_0x760824)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x58c574&&_0x58c574[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x58c574[0x1]);}}['_getUid'](_0x20d989){return this['_isExistingNode'](_0x20d989)?At(_0x20d989,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x4be0d7){(function(_0x117ce9){return _0x188181(_0x1835d6=>_0x3604f6(_0x1835d6),_0x117ce9,!0x0,0x1/0x0);}(_0x4be0d7)['filter'](_0x4d538c=>this['_isDelNode'](_0x4d538c)||this['_isExistingContentComment'](_0x4d538c))['forEach'](_0xeac5ca=>{_0x2a3aa1(_0xeac5ca);}));}['_markLastTagElementUnstable'](_0x4c0a67){const _0x4d685c=_0x4c0a67['childNodes'],_0x5720c8=_0x4d685c[_0x4d685c['length']-0x1];_0x5720c8&&_0x1415cb(_0x5720c8)&&Qi(_0x5720c8,'data-unstable','true');}['_markUnstableElements'](_0x2873c0,_0x127362){const _0x5e331=St('data-unstable','true',_0x2873c0);if(!_0x5e331)return;const _0x2f3a0c=Gi(_0x5e331)['slice'](0x0,-0x1),_0x5cee1e=_0x2f3a0c['length'];let _0xf4fed7=_0x5e331;if(_0x5cee1e>_0x127362){let _0x14e337=_0x5cee1e,_0x54a7a1=null;for(;_0x14e337>_0x127362&&_0x14e337>=0x0;)_0x14e337--,_0x54a7a1=_0x2f3a0c[_0x14e337];_0x54a7a1&&(_0xf4fed7=_0x54a7a1,Qi(_0x5e331,'data-unstable',null),Qi(_0x54a7a1,'data-unstable','true'));}else{if(_0x5cee1e<_0x127362){let _0x4b4545=_0x5cee1e,_0x42435b=_0x5e331;for(;_0x4b4545<_0x127362;){const _0x4affd5=_0x42435b['childNodes']['filter'](_0x45b98e=>_0x1415cb(_0x45b98e));if(0x0===_0x4affd5['length'])break;_0x4b4545++,_0x42435b=_0x4affd5[_0x4affd5['length']-0x1];}_0x42435b&&(_0xf4fed7=_0x42435b,Qi(_0x5e331,'data-unstable',null),Qi(_0x42435b,'data-unstable','true'));}}let _0x7392af=_0xf4fed7;for(;_0x7392af;){for(;_0x7392af['nextSibling'];)_0x7392af=_0x7392af['nextSibling'],_0x1415cb(_0x7392af)&&Qi(_0x7392af,'data-unstable','true');_0x7392af=_0x7392af['parentNode'];}}['_isNewNode'](_0x29d25f){return Boolean('new-element'===At(_0x29d25f,'data-id'));}['_isExistingNode'](_0x3a55f2){return Boolean((At(_0x3a55f2,'data-id')||'')['length']>0x0&&'new-element'!==At(_0x3a55f2,'data-id'));}['_isDelNode'](_0x6fcc03){return!!_0x6fcc03&&Boolean(_0x3604f6(_0x6fcc03)&&Tt(_0x6fcc03)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x5a79d0){let _0xa55276=_0x5a79d0['parentNode'];for(;_0xa55276;){if(At(_0xa55276,'data-wrapped-id'))return!0x0;_0xa55276=_0xa55276['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x542704){return Boolean(_0x3604f6(_0x542704)&&Tt(_0x542704)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function J({editor:_0x2c5f22,changeGroups:_0x31795b,documentContextContent:_0x2274e8,showDiff:_0x557a4a,trimUnchanged:_0x3dad97=!0x0}){return _0x31795b['map'](_0xc1d5e9=>{const _0x262fdd=new Et([]),_0x591484=new Et([]);for(const _0x294908 of _0xc1d5e9['changes'])if(_0x557a4a&&'removed'==_0x294908['type']||_0x591484['children']['push'](_0x294908['node']['cloneNode'](!0x0)),'new'!=_0x294908['type']&&(_0x557a4a||'removed'!=_0x294908['type'])){const _0x59a130=yt(_0x7d910d=>At(_0x7d910d,'data-id')==_0x294908['id'],_0x2274e8,!0x0);_0x59a130&&_0x262fdd['children']['push'](_0x59a130['cloneNode'](!0x0));}const {content:_0x5a0f2f,hasChanges:_0x25200b}=function(_0x48e899,_0x2f1f4c,_0xc458e0,_0x492606,_0x196799=!0x0){const _0x10fa53=_0x48e899['plugins']['get']('DocumentCompare'),_0x16ecd4=Tt(_0x2f1f4c),_0xadc021=Tt(_0xc458e0),_0x581169=_0x48e899['data']['parse'](_0x16ecd4,'$root'),_0x4faac0=_0x48e899['model']['createPositionAt'](_0x581169,0x0),_0x248112=_0x10fa53['getDiff'](_0x16ecd4,_0xadc021,{'anchor':_0x4faac0,'markDeletions':_0x492606}),_0x583cb2=_0x248112['getOperations']();if(0x0==_0x583cb2['length'])return{'content':_0x2f1f4c['cloneNode'](!0x0),'hasChanges':!0x1};_0x492606?function(_0x31d70f,_0x2c0ce0,_0x148e7b){if(0x0==_0x31d70f['length'])return;const _0x586a98=_0x148e7b['plugins']['get']('DocumentCompare'),_0x1ca6c2=_0x148e7b['plugins']['get']('SuggestionsConversion');_0x148e7b['model']['change'](_0xad4071=>{const _0x377b86=new Set();for(let _0xe3a39c=0x0;_0xe3a39c<_0x31d70f['length'];_0xe3a39c++){const _0x2b6f79=_0x31d70f[_0xe3a39c];if(_0x2b6f79['baseVersion']=null,_0x2b6f79['isDocumentOperation']=!0x1,_0x586a98['isMarkedRemoveOperation'](_0x2b6f79)){const _0x4f099b=_0x434e3f(_0x2b6f79['newRange'],_0x148e7b['model']),_0x27a157='suggestion:deletion:'+_0x589eaf()+':$aiSuggestion';_0x2c0ce0['markers']['set'](_0x27a157,_0x4f099b);}else switch(_0x2b6f79['type']){case'rename':{if(_0x2b6f79['oldName']==_0x2b6f79['newName'])break;_0xad4071['batch']['addOperation'](_0x2b6f79),_0x148e7b['model']['applyOperation'](_0x2b6f79);const _0x32313d='$elementName',_0x162008=_0x2b6f79['position'],_0x1b9a30=_0x148e7b['model']['createRange'](_0x162008,_0x148e7b['model']['createPositionAt'](_0x162008['nodeAfter'],'end')),_0x57817f='suggestion:attribute:'+_0x32313d+':'+_0x589eaf()+':$aiSuggestion';_0x2c0ce0['markers']['set'](_0x57817f,_0x1b9a30);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x2b6f79['oldValue']==_0x2b6f79['newValue'])break;_0xad4071['batch']['addOperation'](_0x2b6f79),_0x148e7b['model']['applyOperation'](_0x2b6f79);const _0x53ab45=_0x2b6f79['key'];if(!_0x1ca6c2['isRegisteredAttribute'](_0x53ab45))break;const _0x5c1dc5=_0x434e3f(_0x2b6f79['range'],_0x148e7b['model']),_0x47f650='suggestion:attribute:'+_0x53ab45+':'+_0x589eaf()+':$aiSuggestion';_0x2c0ce0['markers']['set'](_0x47f650,_0x5c1dc5);break;}case'insert':{_0xad4071['batch']['addOperation'](_0x2b6f79),_0x148e7b['model']['applyOperation'](_0x2b6f79);if(_0x31d70f[_0xe3a39c+0x1]&&'move'==_0x31d70f[_0xe3a39c+0x1]['type']){no(_0x2c0ce0,_0x2b6f79);break;}const _0x43b2b4=_0x2b6f79['position'],_0xf22586=_0x2b6f79['howMany'],_0x951d0d=_0x434e3f(_0x148e7b['model']['createRange'](_0x43b2b4,_0x43b2b4['getShiftedBy'](_0xf22586)),_0x148e7b['model']),_0x64cd70='suggestion:insertion:'+_0x589eaf()+':$aiSuggestion';_0x2c0ce0['markers']['set'](_0x64cd70,_0x951d0d);break;}case'split':{_0xad4071['batch']['addOperation'](_0x2b6f79),_0x148e7b['model']['applyOperation'](_0x2b6f79);const _0x123cde=_0x2b6f79['splitPosition'],_0x25b7be=_0x2b6f79['moveTargetPosition'],_0x1ea4f0=_0x148e7b['model']['createRange'](_0x123cde,_0x25b7be),_0x27aa02='suggestion:insertion:'+_0x589eaf()+':$aiSuggestion';_0x2c0ce0['markers']['set'](_0x27aa02,_0x1ea4f0);break;}case'move':{_0xad4071['batch']['addOperation'](_0x2b6f79),_0x148e7b['model']['applyOperation'](_0x2b6f79),_0x31d70f[_0xe3a39c-0x1]&&'insert'==_0x31d70f[_0xe3a39c-0x1]['type']&&no(_0x2c0ce0,_0x2b6f79);const _0x142fd2=_0x2b6f79['getMovedRangeStart'](),_0x2f82b7=_0x2b6f79['howMany'];for(let _0x284a2a=0x0;_0x284a2a<_0x2f82b7;_0x284a2a++){const _0x293449=_0x142fd2['getShiftedBy'](_0x284a2a)['nodeAfter'];_0x377b86['add'](_0x293449);}break;}case'remove':{const _0x51b0e6=_0x2b6f79['sourcePosition'],_0xa9e45=_0x2b6f79['howMany'],_0x118a60=new et(_0x51b0e6,_0xa9e45);_0xad4071['batch']['addOperation'](_0x118a60),_0x148e7b['model']['applyOperation'](_0x118a60);break;}}}for(const _0x5e368f of _0x377b86){const _0x24baa0=_0x148e7b['model']['createRangeOn'](_0x5e368f),_0x1cfddb='suggestion:formatBlock:$fakeWrap:'+_0x589eaf()+':$aiSuggestion';_0x2c0ce0['markers']['set'](_0x1cfddb,_0x434e3f(_0x24baa0,_0x148e7b['model']));}});}(_0x583cb2,_0x581169,_0x48e899):_0x48e899['model']['change'](_0x779a7c=>{for(const _0x4e0f9f of _0x583cb2)if('remove'==_0x4e0f9f['type']){const _0x422d06=_0x4e0f9f['sourcePosition'],_0xe61183=_0x4e0f9f['howMany'],_0x5e94e0=new et(_0x422d06,_0xe61183);_0x779a7c['batch']['addOperation'](_0x5e94e0),_0x48e899['model']['applyOperation'](_0x5e94e0);}else{if('marker'==_0x4e0f9f['type']){const _0x5c99ec=_0x4e0f9f['name'],_0x4cd055=_0x4e0f9f['newRange'];null!==_0x4cd055?_0x581169['markers']['set'](_0x5c99ec,_0x4cd055):_0x581169['markers']['delete'](_0x5c99ec);}else _0x4e0f9f['baseVersion']=null,_0x4e0f9f['isDocumentOperation']=!0x1,_0x779a7c['batch']['addOperation'](_0x4e0f9f),_0x48e899['model']['applyOperation'](_0x4e0f9f);}});if(_0x196799){const _0x57200b=mt(_0x48e899,_0x583cb2,_0x581169);ft(_0x48e899['model'],_0x57200b),function(_0x4d2539,_0x527336){const _0x39203b=_0x527336['getFirstRange']()['start'];let _0x2697b9=_0x527336['getFirstRange']()['end'];const _0x1b81ea=_0x39203b['root'];(_0x2697b9['textNode']||_0x2697b9['nodeAfter']&&_0x2697b9['nodeAfter']['is']('$text'))&&(_0x203d29(_0x2697b9,'...'),_0x2697b9=_0x2697b9['getShiftedBy'](0x3)),(_0x39203b['textNode']||_0x39203b['nodeBefore']&&_0x39203b['nodeBefore']['is']('$text'))&&(_0x203d29(_0x39203b,'...'),function(_0x33822,_0x33c1c7,_0x55ee30){for(let [_0x1312aa,_0x1d65af]of _0x33822['markers']){const _0x5a9ffe=_0x1d65af['_getTransformedByInsertion'](_0x33c1c7,_0x55ee30,!0x1);_0x1d65af=_0x5a9ffe[0x0],_0x33822['markers']['set'](_0x1312aa,_0x1d65af);}}(_0x1b81ea,_0x39203b,0x3),_0x39203b['parent']==_0x2697b9['parent']&&(_0x2697b9=_0x2697b9['getShiftedBy'](0x3)));const _0x1eae07=_0x4d2539['createRange'](_0x4d2539['createPositionAt'](_0x1b81ea,0x0),_0x39203b),_0x1857f5=_0x4d2539['createRange'](_0x2697b9,_0x4d2539['createPositionAt'](_0x1b81ea,'end')),_0x40cfed=[..._0x1eae07['getMinimalFlatRanges'](),..._0x1857f5['getMinimalFlatRanges']()];_0x40cfed['reverse']();for(const _0x3b88fd of _0x40cfed)to(_0x3b88fd),Jn(_0x1b81ea,_0x3b88fd);}(_0x48e899['model'],_0x57200b);}const _0x34c30b=_0x48e899['data']['stringify'](_0x581169,{'showSuggestionHighlights':!0x0});return{'content':ji(_0x34c30b),'hasChanges':!0x0};}(_0x2c5f22,_0x262fdd,_0x591484,_0x557a4a,_0x3dad97);return{'type':_0xc1d5e9['changes'][0x0]['type'],'index':_0xc1d5e9['index'],'content':_0x5a0f2f,'hasChanges':_0x25200b};});}function no(_0x92f4cc,_0x5a7148){for(const [_0x1f7a17,_0x5055f3]of _0x92f4cc['markers']){const _0x5809fa=it['_createFromRanges'](_0x5055f3['getTransformedByOperation'](_0x5a7148));_0x92f4cc['markers']['set'](_0x1f7a17,_0x5809fa);}}function mt(_0x51a7ac,_0x5add08,_0x368821){const _0xe74629=_0x51a7ac['plugins']['get']('DocumentCompare');let _0x9248f0=_0x51a7ac['model']['createPositionAt'](_0x368821,Number['POSITIVE_INFINITY']),_0x163094=_0x51a7ac['model']['createPositionAt'](_0x368821,0x0);for(const _0x1a436a of _0x5add08){let _0x111970,_0x28cdfd;if(_0xe74629['isMarkedRemoveOperation'](_0x1a436a))_0x111970=_0x1a436a['newRange']['start'],_0x28cdfd=_0x1a436a['newRange']['end'];else switch(_0x9248f0=_0x9248f0['getTransformedByOperation'](_0x1a436a),_0x163094=_0x163094['getTransformedByOperation'](_0x1a436a),_0x1a436a['type']){case'rename':_0x111970=_0x1a436a['position'],_0x28cdfd=_0x111970['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x111970=_0x1a436a['range']['start'],_0x28cdfd=_0x1a436a['range']['end'];break;case'insert':_0x111970=_0x1a436a['position'],_0x28cdfd=_0x111970['getShiftedBy'](_0x1a436a['howMany']);break;case'split':_0x111970=_0x1a436a['splitPosition'],_0x28cdfd=_0x1a436a['moveTargetPosition'];break;case'merge':{const _0x484d41=_0x1a436a['targetPosition']['path']['slice'](0x0,-0x1);_0x111970=_0x51a7ac['model']['createPositionFromPath'](_0x368821,_0x484d41),_0x28cdfd=_0x111970['getShiftedBy'](0x1);break;}case'remove':{const _0x3a3d4b=_0x1a436a['howMany'],_0x366983=_0x1a436a['sourcePosition']['_getTransformedByInsertion'](_0x1a436a['targetPosition'],_0x3a3d4b),_0x106736=_0x1a436a['getMovedRangeStart']();'remove'==_0x1a436a['type']?(_0x111970=_0x366983,_0x28cdfd=_0x366983):(_0x111970=_0x106736,_0x28cdfd=_0x106736['getShiftedBy'](_0x3a3d4b));break;}}_0x111970&&_0x111970['isBefore'](_0x9248f0)&&(_0x9248f0=_0x111970['clone'](),_0x9248f0['stickiness']='toNone'),_0x28cdfd&&_0x28cdfd['isAfter'](_0x163094)&&(_0x163094=_0x28cdfd['clone'](),_0x163094['stickiness']='toNone');}return _0x51a7ac['model']['createSelection'](_0x51a7ac['model']['createRange'](_0x9248f0,_0x163094));}function ft(_0x320e97,_0x4a5bbd){ro(_0x320e97,_0x4a5bbd,'forward');const _0x26fa05=_0x4a5bbd['getFirstRange']();_0x4a5bbd['setTo']([]),_0x4a5bbd['setTo'](_0x26fa05,{'backward':!0x0}),ro(_0x320e97,_0x4a5bbd,'backward');}function ro(_0x4147cb,_0x7e1671,_0x214b18){let _0x27da9b=0x14;for(;_0x27da9b;){_0x4147cb['modifySelection'](_0x7e1671,{'unit':'word','direction':_0x214b18}),_0x27da9b--;const _0x576a30=_0x7e1671['focus']['forward'==_0x214b18?'nodeBefore':'nodeAfter'];if(_0x576a30&&_0x576a30['is']('element')&&_0x4147cb['schema']['isBlock'](_0x576a30)&&_0x4147cb['schema']['isObject'](_0x576a30))break;}}function Jn(_0x45b350,_0x4dded9){for(const [_0x2a72ef,_0x42e5a2]of _0x45b350['markers']){const _0x505c9f=_0x42e5a2['_getTransformedByDeletion'](_0x4dded9['start'],_0x4dded9['end']['offset']-_0x4dded9['start']['offset']);null!=_0x505c9f?_0x45b350['markers']['set'](_0x2a72ef,_0x505c9f):_0x45b350['markers']['delete'](_0x2a72ef);}}class Ge extends ts(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new Et([]);['parsedMergedContent']=new Et([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x11bdde,content:_0x10da3b='',isDone:_0x1ebceb=!0x1,interactionId:_0x1d91a,areActionsDisabled:_0x732c6f,documentContextContent:_0x5ed118,editor:_0xf9cfeb,id:_0x2d82ba}){super(),this['id']=_0x2d82ba||_0x589eaf(),this['interactionId']=_0x1d91a,this['type']=_0x11bdde,this['areActionsDisabled']=!!_0x732c6f,this['editor']=_0xf9cfeb,this['aiResponseParser']=new Ui(),this['aiResponseApplier']=new Ni(),this['documentContextContent']=ji(_0x5ed118||''),this['set']('isDone',_0x1ebceb),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x10da3b);}['appendContent'](_0x14a707){this['set']('content',this['content']+_0x14a707);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x2c7cf7,_0x13b249){this['changeGroups'][_0x2c7cf7]['state']=_0x13b249,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x2c7cf7,'state':_0x13b249});}['getContentParts']({showDiff:_0x1b48c3,groupIndex:_0x366600}){if(!this['editor'])throw new _0x54686c('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x536b35=this['_getCachedContentParts'](_0x1b48c3,_0x366600);if(_0x536b35)return _0x536b35;let _0x1866f0=[];if(void 0x0===_0x366600)_0x1866f0=this['changeGroups'];else{const _0x2429b=this['changeGroups']['find'](({index:_0x150d90})=>_0x150d90===_0x366600);if(!_0x2429b)throw new _0x54686c('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x366600});_0x1866f0=[_0x2429b];}const _0x2b8863=J({'editor':this['editor'],'showDiff':_0x1b48c3,'changeGroups':_0x1866f0,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x1b48c3,_0x2b8863),_0x2b8863;}['_getCachedContentParts'](_0x2543ce,_0x1460b2){const _0x5ea737=_0x2543ce?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x5ea737]['length'])return null;const _0x2b2f9a=this['cachedSuggestionContentParts'][_0x5ea737];if(void 0x0===_0x1460b2)return _0x2b2f9a['length']>0x0&&_0x2b2f9a['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x2543ce,null),null):_0x4210b4(_0x2b2f9a);{const _0x5c84bc=_0x2b2f9a['find'](({index:_0xafb0a0})=>_0xafb0a0===_0x1460b2);if(_0x5c84bc)return[_0x4210b4(_0x5c84bc)];}return null;}['_setCachedContentParts'](_0x10a494,_0x21425b){const _0x32929a=_0x10a494?'withDiff':'withoutDiff';_0x21425b?_0x21425b['forEach'](_0x2b678a=>{const _0x4cb32c=this['cachedSuggestionContentParts'][_0x32929a],_0x361af1=_0x4cb32c['find'](({index:_0x3a8215})=>_0x3a8215===_0x2b678a['index']);if(_0x361af1){const _0x9d5e31=_0x4cb32c['indexOf'](_0x361af1);_0x4cb32c['splice'](_0x9d5e31,0x1,_0x2b678a);}else _0x4cb32c['push'](_0x2b678a);}):this['cachedSuggestionContentParts'][_0x32929a]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x43fd9e=this['changeGroups'];this['updateChangeGroups']();const _0x193753=this['_getDifferentChangeGroups'](_0x43fd9e,this['changeGroups']);(_0x193753['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x193753),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x35df4a,_0x377e48){const _0x26dda0=[];for(const _0x361527 of _0x377e48){const _0x1200a2=_0x35df4a[_0x361527['index']];_0x1200a2?_0x1200a2['changes']['length']!==_0x361527['changes']['length']?_0x26dda0['push'](_0x361527):_0x1200a2['changes']['forEach']((_0x765d89,_0x2c64f7)=>{const _0x362664=_0x361527['changes'][_0x2c64f7];_0x765d89['id']!==_0x362664['id']&&_0x26dda0['push'](_0x361527);}):_0x26dda0['push'](_0x361527);}return _0x26dda0;}['updateChangeGroups'](){const _0x56a330=new _0x5fd8c8('p',{},[new _0x5fd8c8('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x5dcbfa(i(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x2b0415=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x56a330,'cutAfterLastChange':!this['isDone']});if(!_0x2b0415['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x2b0415['parsedContent'];let _0x1d4530=[];if(_0x53d6a8(_0xa9ce90=>{const _0x472e52=At(_0xa9ce90,'data-id');if(!_0x472e52||!_0x3fcd6c(_0x472e52))return!0x1;const _0x2f1ad9=[_0xa9ce90,...Gi(_0xa9ce90)]['at'](-0x2);if(_0xa9ce90!=_0x2f1ad9){const _0x419197=At(_0x2f1ad9,'data-id');_0x3fcd6c(_0x419197)||(_0x1d4530['push']({'node':_0x2f1ad9,'id':_0x419197,'type':'modified'}),_0x2b0415['modifiedNodeIds']['push'](_0x419197));}else _0x2b0415['modifiedNodeIds']['includes'](_0x472e52)?_0x1d4530['push']({'node':_0xa9ce90,'type':'modified','id':_0x472e52}):_0x2b0415['newNodeIds']['includes'](_0x472e52)?_0x1d4530['push']({'node':_0xa9ce90,'type':'new','id':_0x472e52,'anchorId':At(_0xa9ce90['previousSibling'],'data-id')}):_0x1d4530['push']({'node':_0xa9ce90,'type':'removed','id':_0x472e52});return!0x0;},this['parsedMergedContent']),_0x1d4530=_0x1d4530['filter'](({node:_0x4aa424})=>[...Gi(_0x4aa424),_0x4aa424]['every'](_0x54e79b=>!At(_0x54e79b,'data-unstable'))),0x0==_0x1d4530['length'])return;const _0x9ec2e4=[[_0x1d4530[0x0]]];for(let _0x4b26ea=0x1;_0x4b26ea<_0x1d4530['length'];_0x4b26ea++){const _0x4c30a4=_0x9ec2e4[_0x9ec2e4['length']-0x1],_0x48f50b=_0x4c30a4[_0x4c30a4['length']-0x1];_0x1d4530[_0x4b26ea]['node']['previousSibling']==_0x48f50b['node']&&'modified'!=_0x1d4530[_0x4b26ea]['type']&&'modified'!=_0x48f50b['type']?_0x4c30a4['push'](_0x1d4530[_0x4b26ea]):_0x9ec2e4['push']([_0x1d4530[_0x4b26ea]]);}for(const _0x2db3ca of _0x9ec2e4){const _0x565b4e=_0x2db3ca[0x0],_0xaa61b3=_0x2db3ca[_0x2db3ca['length']-0x1],_0xb2be5a=_0x25b096(_0x565b4e['node']['previousSibling']);_0xb2be5a&&_0x2db3ca['unshift'](_0xb2be5a);const _0x23299d=_0x25b096(_0xaa61b3['node']['nextSibling']);_0x23299d&&_0x2db3ca['push'](_0x23299d);}function _0x3fcd6c(_0x2eaf43){return _0x2b0415['modifiedNodeIds']['includes'](_0x2eaf43)||_0x2b0415['newNodeIds']['includes'](_0x2eaf43)||_0x2b0415['removedNodeIds']['includes'](_0x2eaf43);}function _0x25b096(_0x5ae080){if(_0x5ae080&&At(_0x5ae080,'data-id')&&!At(_0x5ae080,'data-unstable')){const _0xa16eb4=At(_0x5ae080,'data-id');if(!_0x3fcd6c(_0xa16eb4))return{'node':_0x5ae080,'type':'context','id':_0xa16eb4};}return null;}this['changeGroups']=_0x9ec2e4['map']((_0x2c289d,_0x3edbb4)=>({'changes':_0x2c289d,'state':'pending','index':_0x3edbb4}));}}const ye=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class xe extends _0x12cec9(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x15c291,editor:_0x46567f}){super(),this['id']=_0x589eaf(),this['connector']=_0x15c291,this['isStopped']=!0x0,this['editor']=_0x46567f;}async['start'](){const _0x386402=[];let _0x91e1dc,_0x5a7938,_0x5598fb;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x3a884b=await this['currentRequest']['getStream']();for await(const _0x16c8b3 of _0x3a884b){if(this['isStopped'])return;if('error'==_0x16c8b3['event'])return void this['fire']('error',{'error':new _0x54686c('ai-chat-interaction-error',this)});switch(_0x16c8b3['event']){case'message-metadata':this['messageId']=_0x16c8b3['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x16c8b3['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x16c8b3['data']['conversationTitle'],!0x0);break;case'source':_0x386402['push'](_0x16c8b3['data']['source']);break;case'web-search':this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));break;case'reasoning':this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));break;case'modification-delta':case'text-delta':this['resetReasoningState'](),this['resetWebSearchState'](),_0x91e1dc='modification-delta'==_0x16c8b3['event']?'modification':'text',_0x5a7938='modification-delta'==_0x16c8b3['event']?_0x16c8b3['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x91e1dc&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x91e1dc,'interactionId':this['id'],'id':_0x5a7938}),'modification'==_0x91e1dc&&(this['currentReply']['sources']=_0x386402['splice'](0x0))),this['currentReply']['appendContent'](_0x16c8b3['data']['textDelta']);break;case'mcp-tool-result':_0x5598fb=JSON['parse'](_0x16c8b3['data']['result']),this['_handleToolResultData']({'toolName':_0x16c8b3['data']['toolName'],'data':_0x5598fb['data'],'attributes':_0x5598fb['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x16c8b3['data']['toolName'],'data':_0x16c8b3['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0x386402['length']>0x0&&(this['currentReply']['sources']=_0x386402['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x56d133){return this['replies']['find'](_0xfeb17f=>_0xfeb17f['id']===_0x56d133);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x5ee35c=>_0x5ee35c['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0xc69ddb){const _0x4c5ccd=new Ge({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0xc69ddb});return this['replies']['push'](_0x4c5ccd),_0x4c5ccd['delegate'](...ye)['to'](this),this['fire']('replyCreated',_0x4c5ccd),_0x4c5ccd;}['setConversationTitle'](_0x272131,_0x162512=!0x1){this['fire']('setConversationTitle',_0x272131,_0x162512);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x565e87){this['fire']('toolDataReceived',{'type':'result','toolName':_0x565e87['toolName'],'data':structuredClone(_0x565e87['data']||{}),'attributes':structuredClone(_0x565e87['attributes']||{})},this);}['_handleToolNotificationData'](_0x2c424b){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x2c424b['toolName'],'data':structuredClone(_0x2c424b['data'])},this);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var qe=function(_0x28b89e){return _0x28b89e['TOOL']='mcp-tool-context',_0x28b89e['FILE']='file',_0x28b89e['DOCUMENT']='document',_0x28b89e['URL']='web-resource',_0x28b89e['TEXT']='text',_0x28b89e['SELECTION']='selection',_0x28b89e;}({}),Fe=function(_0x58e7eb){return _0x58e7eb['TEXT']='text',_0x58e7eb['MARKDOWN']='markdown',_0x58e7eb['HTML']='html',_0x58e7eb;}({});const Ue=new Map([['usage-limits-exceeded','ai-usage-limits-exceeded'],['rate-limits-exceeded','ai-rate-limits-exceeded'],['invalid-content-type','ai-invalid-content-type'],['invalid-request-data','ai-chat-invalid-request'],['model-already-set','ai-chat-model-already-set'],['model-not-found','ai-chat-model-not-found'],['unsafe-content-detected','ai-chat-unsafe-content-detected'],['unsupported-content-type','ai-chat-unsupported-content-type'],['content-too-large','ai-chat-content-too-large'],['unsupported-file-type','ai-chat-context-unsupported-file-type'],['file-too-large','ai-chat-context-file-too-large'],['file-too-many-pages','ai-chat-context-file-too-many-pages'],['form-data-size-limits-exceeded','ai-chat-context-form-data-size-limits-exceeded']]),He=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class We extends ts(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x1473e5,config:_0x1fdbb3,ownerId:_0x5c809d}){super(),this['_connector']=_0x1473e5,this['_config']=_0x1fdbb3,this['_ownerId']=_0x5c809d;}['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'](_0x49dbe4){const _0x52b844=await this['_createContextItemFromContent'](_0x49dbe4);return this['_addToConversationContextItem'](_0x52b844),'current-document'===_0x52b844['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x52b844;}async['_createContextItemFromContent'](_0x41a639){if(_0x41a639['type']===qe['DOCUMENT']){const _0x5f4530=await this['_connector']['fetchDocument'](this['_ownerId'],_0x41a639['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x41a639['type'],'content':_0x5f4530['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x5f4530['attributes']?.['version'],'sessionId':_0x5f4530['attributes']?.['sessionId']};}if(_0x41a639['type']===qe['TOOL'])return{'id':_0x41a639['id'],'uiId':_0x41a639['id'],'label':_0x41a639['data']?.['label']||_0x41a639['id'],'type':qe['TOOL'],'mcpServerName':_0x41a639['mcpServerName'],'toolName':_0x41a639['toolName'],'data':_0x41a639['data']||{}};return{'id':_0x41a639['id'],'uiId':_0x41a639['id'],'label':_0x41a639['attributes']?.['label']||_0x41a639['name']||_0x41a639['url']||_0x41a639['id'],'type':_0x41a639['type'],..._0x41a639?.['attributes']?.['resourceId']?{'resourceId':_0x41a639['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x48cfd5){const _0x23ff94=this['_pendingContextItems']['get'](_0x48cfd5);_0x23ff94?.['isReadOnly']||this['_removeContextItem'](_0x48cfd5);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x2b9825 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x2b9825['uiId']);const _0x4bc57c=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x4bc57c&&this['_addContextItem']({..._0x4bc57c,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x34d68c){for(const _0x3b2166 of _0x34d68c['values']())this['_addToConversationContextItem'](_0x3b2166);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'](_0x2cb71e){return Array['from'](_0x2cb71e['values']())['map'](_0x43f873=>this['_mapContextItemToRequestData'](_0x43f873))['filter'](_0x195d21=>null!==_0x195d21);}async['addFilesToContext'](_0x192e1e,_0x3b1236,_0x188c5b=qe['FILE']){const _0x4d28b6='files-'+_0x589eaf();this['_startUploadOperation'](_0x4d28b6);try{await Promise['all'](_0x192e1e['map'](async _0x36ec3e=>{const _0x4a30ba='file-'+_0x589eaf(),_0x14d225=_0x169b70(_0x36ec3e['name']);try{this['_addContextItem']({'type':_0x188c5b,'label':_0x3b1236?.['label']||_0x14d225,'uiId':_0x4a30ba,'resourceId':_0x3b1236?.['resourceId']},!0x0);const _0x263b05=this['_connector']['uploadFile'](this['_ownerId'],_0x36ec3e,_0x3b1236);this['_ongoingUploads']['set'](_0x4a30ba,_0x263b05['abortController']);const {id:_0x33af7f}=await _0x263b05['getId']();this['_ongoingUploads']['delete'](_0x4a30ba),this['_finishContextItemLoading']({'type':_0x188c5b,'id':_0x33af7f,'label':_0x3b1236?.['label']||_0x14d225,'uiId':_0x4a30ba,'resourceId':_0x3b1236?.['resourceId']},!0x1);}catch(_0x8ffd){this['_ongoingUploads']['delete'](_0x4a30ba);if(!(_0x8ffd instanceof _0x54686c&&_0x8ffd['message']['startsWith']('ai-request-aborted'))){const _0x1f9cb1=Ue['get'](_0x8ffd['code'])||'ai-chat-file-upload-failed',_0x4a5f4b=new _0x54686c(_0x1f9cb1,null,{'fileName':_0x14d225,..._0x8ffd});_0x4a5f4b['stack']=_0x8ffd['stack'],this['fire']('error',{'error':_0x4a5f4b});}this['_removeContextItem'](_0x4a30ba);}}));}finally{this['_finishUploadOperation'](_0x4d28b6);}}['addCurrentDocumentToContext'](_0x1e7f02){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x2f9622={'type':qe['DOCUMENT'],'uiId':'current-document','label':_0x1e7f02,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x2f9622);}async['updateCurrentDocument'](_0x51246b,_0x98a788,_0x35e95f,_0x435e25){const _0x232fec=this['_pendingContextItems']['get']('current-document');if(_0x232fec&&_0x51246b){_0x232fec['selection']=_0x435e25?_0x435e25['map'](_0x1d1290=>({'start':_0x1d1290['start'],'end':_0x1d1290['end']})):[];try{if(_0x232fec['version']===_0x98a788)return;const {id:_0x16cb06}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x51246b,{'version':_0x98a788,'sessionId':_0x35e95f})['getId']();_0x232fec['id']=_0x16cb06,_0x232fec['content']=_0x51246b,_0x232fec['version']=_0x98a788,_0x232fec['sessionId']=_0x35e95f;}catch(_0x25724e){const _0x258759=new _0x54686c('ai-chat-document-upload-failed',null);_0x258759['stack']=_0x25724e['stack'],this['fire']('error',{'error':_0x258759});}}}['addSelectionToContext'](_0x589575){this['_addContextItem']({'type':qe['SELECTION'],'label':_0x589575,'uiId':'selection','content':_0x589575});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x5b0034,_0x2ab6f1){const _0x4b9ce8='url-'+_0x589eaf();this['_startUploadOperation'](_0x4b9ce8);const _0xf849af='url-'+_0x589eaf();try{this['_addContextItem']({'type':qe['URL'],'label':_0x2ab6f1?.['label']||_0x5b0034,'uiId':_0xf849af,'resourceId':_0x2ab6f1?.['resourceId']},!0x0);const _0x9f4d4f=this['_connector']['uploadUrl'](this['_ownerId'],_0x5b0034,_0x2ab6f1);this['_ongoingUploads']['set'](_0xf849af,_0x9f4d4f['abortController']);const {id:_0x230c9a}=await _0x9f4d4f['getId']();this['_ongoingUploads']['delete'](_0xf849af),this['_finishContextItemLoading']({'type':qe['URL'],'id':_0x230c9a,'label':_0x2ab6f1?.['label']||_0x5b0034,'uiId':_0xf849af,'resourceId':_0x2ab6f1?.['resourceId']},!0x1);}catch(_0x13e03c){this['_ongoingUploads']['delete'](_0xf849af),(_0x13e03c['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x54686c('ai-chat-url-upload-failed',this,{'url':_0x5b0034,'originalError':_0x13e03c}),'url':_0x5b0034}),this['_removeContextItem'](_0xf849af));}finally{this['_finishUploadOperation'](_0x4b9ce8);}}['addToolItemToContext'](_0x522dd9){_0x522dd9['id']=_0x522dd9['id']??_0x589eaf()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x522dd9['uiId'],_0x522dd9),this['fire']('contextItemAdded',{'contextItem':_0x522dd9,'isLoading':!0x1});}async['loadSourceResources'](_0x2062df,_0x3c0019,_0x526025){const _0x1055e8=this['_addContextOptionsState']['sources']['find'](_0x5649b8=>_0x5649b8['id']===_0x2062df);if(!_0x1055e8)return this['fire']('error',{'error':new _0x54686c('ai-chat-source-not-found',this,{'sourceId':_0x2062df}),'sourceId':_0x2062df}),[];try{const _0x3e2c68=(await _0x1055e8['getResources'](_0x3c0019))['map'](_0x1525c7=>{const _0x45e5e2=this['_isResourceInContext'](_0x1525c7['id']);return{..._0x1525c7,'isInContext':_0x45e5e2};});return _0x1055e8['resources']=_0x3e2c68,this['fire']('sourceResourcesLoaded',{'sourceId':_0x2062df,'source':_0x1055e8,'resources':_0x3e2c68,'uid':_0x526025}),_0x3e2c68;}catch(_0xfcd632){return this['fire']('error',{'error':new _0x54686c('ai-chat-source-resources-load-failed',this,{'sourceId':_0x2062df,'originalError':_0xfcd632}),'sourceId':_0x2062df,'sourceLabel':_0x1055e8['label']}),[];}}async['addResourceToContext'](_0xcb2633,_0x21849a){if(this['_isResourceInContext'](_0x21849a['id']))return;let _0x534d1e=_0x21849a['data'];if(!_0x534d1e&&_0xcb2633['getData'])try{_0x534d1e=await _0xcb2633['getData'](_0x21849a['id']);}catch(_0x23a664){return void this['fire']('error',{'error':new _0x54686c('ai-chat-resource-load-failed',this,{'resourceId':_0x21849a['id'],'sourceId':_0xcb2633['id'],'originalError':_0x23a664}),'resourceId':_0x21849a['id'],'sourceId':_0xcb2633['id']});}if(_0x534d1e)switch(_0x21849a['type']){case qe['URL']:if('string'!=typeof _0x534d1e)return void this['fire']('error',{'error':new _0x54686c('ai-chat-context-invalid-data',this,{'resourceId':_0x21849a['id'],'sourceId':_0xcb2633['id'],'expectedType':'string','actualType':typeof _0x534d1e}),'resourceId':_0x21849a['id'],'sourceId':_0xcb2633['id']});await this['addUrlToContext'](_0x534d1e,{'label':_0x21849a['label'],'resourceId':_0x21849a['id']});break;case qe['FILE']:if(!(_0x534d1e instanceof File))return void this['fire']('error',{'error':new _0x54686c('ai-chat-context-invalid-data',this,{'resourceId':_0x21849a['id'],'sourceId':_0xcb2633['id'],'expectedType':'File','actualType':typeof _0x534d1e}),'resourceId':_0x21849a['id'],'sourceId':_0xcb2633['id']});await this['addFilesToContext']([_0x534d1e],{'label':_0x21849a['label'],'resourceId':_0x21849a['id']});break;case qe['TEXT']:if('object'!=typeof _0x534d1e||!('content'in _0x534d1e)||!('type'in _0x534d1e))return void this['fire']('error',{'error':new _0x54686c('ai-chat-context-invalid-data',this,{'resourceId':_0x21849a['id'],'sourceId':_0xcb2633['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x534d1e}),'resourceId':_0x21849a['id'],'sourceId':_0xcb2633['id']});_0x534d1e=We['_convertTextResourceToFile'](_0x534d1e,_0x21849a['label']),await this['addFilesToContext']([_0x534d1e],{'label':_0x21849a['label'],'resourceId':_0x21849a['id']},qe['TEXT']);break;case qe['TOOL']:break;default:this['fire']('error',{'error':new _0x54686c('ai-chat-context-unsupported-type',this,{'resourceId':_0x21849a['id'],'sourceId':_0xcb2633['id'],'resourceType':_0x21849a['type']}),'resourceId':_0x21849a['id'],'sourceId':_0xcb2633['id']});}else this['fire']('error',{'error':new _0x54686c('ai-chat-resource-no-data',this,{'resourceId':_0x21849a['id'],'sourceId':_0xcb2633['id']}),'resourceId':_0x21849a['id'],'sourceId':_0xcb2633['id']});}static['_convertTextResourceToFile'](_0x64db30,_0x3842ae){switch(_0x64db30['type']){case Fe['MARKDOWN']:return new File([_0x64db30['content']],_0x3842ae,{'type':'text/markdown'});case Fe['HTML']:return new File([_0x64db30['content']],_0x3842ae,{'type':'text/html'});default:return new File([_0x64db30['content']],_0x3842ae,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x5a349b){switch(_0x5a349b['type']){case qe['FILE']:return{'type':qe['FILE'],'id':_0x5a349b['id']};case qe['URL']:return{'type':qe['URL'],'id':_0x5a349b['id']};case qe['DOCUMENT']:return{'type':qe['DOCUMENT'],'id':_0x5a349b['id'],..._0x5a349b['selection']?.['length']&&{'selection':_0x5a349b['selection']}};case qe['TEXT']:return{'type':qe['FILE'],'id':_0x5a349b['id']};case qe['TOOL']:{const _0x1a11c7=_0x5a349b;return{'type':qe['TOOL'],'mcpServerName':_0x1a11c7['mcpServerName'],'toolName':_0x1a11c7['toolName'],'data':_0x1a11c7['data'],'id':_0x1a11c7['id']};}default:return null;}}['_addContextItem'](_0x57b21c,_0x500b17=!0x1){if(this['_pendingContextItems']['set'](_0x57b21c['uiId'],_0x57b21c),_0x57b21c['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x57b21c,'isLoading':_0x500b17}),'current-document'===_0x57b21c['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x57b21c['resourceId']){const _0x853c2b=this['_findSourceIdsByResourceId'](_0x57b21c['resourceId']);_0x853c2b&&_0x853c2b['forEach'](_0x343503=>{this['_updateResourceInContextState'](_0x343503,_0x57b21c['resourceId'],!0x0);});}}['_removeContextItem'](_0x5a89f9){const _0x5a0a2e=this['_pendingContextItems']['get'](_0x5a89f9),_0x235bd0=this['_ongoingUploads']['get'](_0x5a89f9);if(_0x235bd0&&(_0x235bd0['abort'](),this['_ongoingUploads']['delete'](_0x5a89f9)),_0x5a0a2e?.['resourceId']){const _0x4d15ed=this['_findSourceIdsByResourceId'](_0x5a0a2e['resourceId']);_0x4d15ed&&_0x4d15ed['forEach'](_0x39eeb5=>{this['_updateResourceInContextState'](_0x39eeb5,_0x5a0a2e['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x5a89f9),this['fire']('contextItemRemoved',{'uiId':_0x5a89f9,'type':_0x5a0a2e?.['type']}),'current-document'===_0x5a89f9&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x14a052,_0x2e39c6){if(this['_pendingContextItems']['has'](_0x14a052['uiId'])&&(this['_pendingContextItems']['set'](_0x14a052['uiId'],_0x14a052),this['fire']('contextItemLoadingEnded',{'contextItem':_0x14a052,'isLoading':_0x2e39c6}),_0x14a052['resourceId'])){const _0x26386d=this['_findSourceIdsByResourceId'](_0x14a052['resourceId']);_0x26386d&&_0x26386d['forEach'](_0x49f74d=>{this['_updateResourceInContextState'](_0x49f74d,_0x14a052['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x2eb82d){this['_conversationContextItems']['set'](_0x2eb82d['uiId'],_0x2eb82d);}['_setAddContextOptionsDefaultState'](){this['_addContextOptionsState']={'document':{'enabled':!0x1!==this['_config']?.['document']?.['enabled'],'isHidden':!0x1},'urls':{'enabled':!0x1!==this['_config']?.['urls']?.['enabled']},'files':{'enabled':!0x1!==this['_config']?.['files']?.['enabled']},'sources':this['_getCustomSourcesInitialState'](),'customItems':this['_config']?.['customItems']?.['map'](_0x334c80=>({..._0x334c80,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0xdfa1ea=>({..._0xdfa1ea,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x223822=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x223822,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x3a404b){for(const _0x33f8e6 of this['_pendingContextItems']['values']())if(_0x33f8e6['resourceId']===_0x3a404b)return!0x0;for(const _0x163f55 of this['_conversationContextItems']['values']())if(_0x163f55['resourceId']===_0x3a404b)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x229658){const _0x4679e7=[];for(const _0x154203 of this['_addContextOptionsState']['sources']){_0x154203['resources']['find'](_0x5520c6=>_0x5520c6['id']===_0x229658)&&_0x4679e7['push'](_0x154203['id']);}return 0x0===_0x4679e7['length']?null:_0x4679e7;}['_updateResourceInContextState'](_0x55c450,_0xdc07fb,_0x47a3ae){const _0xd9a43a=this['_addContextOptionsState']['sources']['find'](_0x16073e=>_0x16073e['id']===_0x55c450);if(!_0xd9a43a)return;const _0x72d185=_0xd9a43a['resources']['find'](_0x46bd30=>_0x46bd30['id']===_0xdc07fb);_0x72d185&&(_0x72d185['isInContext']=_0x47a3ae,this['fire']('resourceStateChanged',{'sourceId':_0x55c450,'resourceId':_0xdc07fb,'isInContext':_0x47a3ae}));}['_startUploadOperation'](_0x3691a4){this['_ongoingUploadOperations']['set'](_0x3691a4,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x4922f8){this['_ongoingUploadOperations']['delete'](_0x4922f8),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Be=['capabilitiesUpdated'];class Je extends _0x12cec9(){['_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'](_0x21087a){const _0x4e7c61={};return _0x21087a&&_0x21087a['isWebSearchEnabled']&&(_0x4e7c61['webSearch']={}),_0x21087a&&_0x21087a['isReasoningEnabled']&&(_0x4e7c61['reasoning']={}),_0x4e7c61;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x4b7af0){_0x4b7af0!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x4b7af0,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x2dfda5){_0x2dfda5!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x2dfda5,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Ke extends xe{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['attributes'];constructor(_0x5c6d1a){super(_0x5c6d1a),this['conversationId']=_0x5c6d1a['conversationId'],this['contextItems']=_0x5c6d1a['contextItems'],this['capabilities']=_0x5c6d1a['capabilities'],this['userMessage']=_0x5c6d1a['userMessage'],this['model']=_0x5c6d1a['model'],this['attributes']=_0x5c6d1a['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':We['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Je['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class _t extends _0x12cec9(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x45da69){super(),this['options']=_0x45da69,this['connector']=_0x45da69['connector'],this['chatModels']=_0x45da69['chatModels'],this['id']=_0x45da69['conversationId'],this['isFromHistory']=_0x45da69['isFromHistory'];}async['init'](_0xb76b0){try{this['chatContext']=new We({'connector':this['connector'],'config':_0xb76b0,'ownerId':this['id']}),this['chatContext']['delegate'](...He)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Je(),this['chatCapabilities']['delegate'](...Be)['to'](this),this['chatCapabilities']['init']();const _0x7532ba=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x7532ba});const _0xe79fe2=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0xe79fe2&&await this['setModel'](_0xe79fe2);}catch(_0xea9edf){const _0x597b60=new _0x54686c('ai-chat-conversation-init-failed',null,{'message':_0xea9edf['message']||_0xea9edf});_0x597b60['stack']=_0xea9edf['stack'],this['fire']('error',{'error':_0x597b60});}}async['start'](){if(this['isStarted'])throw new _0x54686c('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x54686c('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0xeadb41}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0xeadb41,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x6b560b){const _0xe059c1=new _0x54686c('ai-chat-conversation-start-failed',null,{'message':_0x6b560b['message'],'conversationId':this['id']});throw _0xe059c1['stack']=_0x6b560b['stack'],this['fire']('error',{'error':_0xe059c1}),_0xe059c1;}}async['load'](_0x393c90,_0x587dd4){try{const _0x8397ee=await this['connector']['fetchConversation'](_0x393c90)['getConversation'](),_0xfc3a70=await this['connector']['fetchConversationMessages'](_0x393c90)['getMessages'](),_0x4b7b34=_0xfc3a70[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x8397ee['id'],'title'in _0x8397ee?this['fire']('setConversationTitle',_0x8397ee['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x4341c1=(await this['chatModels']['getAll']())['find'](_0x161487=>_0x161487['id']['toLowerCase']()===_0x4b7b34['toLowerCase']());return this['selectedModel']=_0x4341c1,this['fire']('modelSelected',{'selectedModel':_0x4341c1,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0xfc3a70,_0x587dd4,_0x4b7b34),this['currentInteraction']=void 0x0,this;}catch(_0x5876a5){const _0x336ffd=new _0x54686c('ai-chat-conversation-init-from-id-failed',null,{'message':_0x5876a5['message'],'conversationId':_0x393c90});throw _0x336ffd['stack']=_0x5876a5['stack'],this['fire']('error',{'error':_0x336ffd}),_0x336ffd;}}async['_processMessagesToInteractions'](_0x2706c2,_0xcdb118,_0x5e6868){let _0x1403a6;for(const _0x43c904 of _0x2706c2)if('user'===_0x43c904['role']){const _0x404840=await this['_extractContextItems'](_0x43c904),_0x2046cb={'isReasoningEnabled':Object['hasOwn'](_0x43c904['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x43c904['capabilities'],'webSearch')};_0x1403a6=this['createInteraction']({'userMessage':_0x43c904['prompt'],'contextItems':_0x404840,'capabilities':_0x2046cb,'modelId':_0x5e6868,'attributes':_0x43c904['attributes']}),this['currentInteraction']=_0x1403a6,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x43c904['role']&&_0x1403a6){const _0x1ecbe1=[];for(const _0x555995 of _0x43c904['content'])switch(_0x555995['type']){case'text':case'modification':{const _0x482e8b=_0x1403a6['getDocumentContext']()?.['sessionId']!==_0xcdb118;_0x1403a6['currentReply']=_0x1403a6['createReply']({'type':_0x555995['type'],'isDone':!0x0,'interactionId':_0x1403a6['id'],'areActionsDisabled':_0x482e8b}),_0x1403a6['currentReply']['appendContent'](_0x555995['content']),_0x1ecbe1['length']>0x0&&(_0x1403a6['currentReply']['sources']=_0x1ecbe1['splice'](0x0));break;}case'url':_0x1ecbe1['push'](_0x555995);break;case'mcp-tool-result':{const {data:_0x15a07b,attributes:_0x3cc84e}=JSON['parse'](_0x555995['content']);_0x1403a6['_handleToolResultData']({'toolName':_0x555995['toolName'],'data':_0x15a07b,'attributes':_0x3cc84e});break;}}}}}async['_extractContextItems'](_0x424399){const _0x4c2be0=new Map();if(!_0x424399['content'])return _0x4c2be0;for(const _0x2af716 of _0x424399['content']){const _0x5ab386=await this['chatContext']['populateFromMessage'](_0x2af716);_0x5ab386&&_0x4c2be0['set'](_0x5ab386['id'],_0x5ab386);}return _0x4c2be0;}async['handleUserInteraction']({userMessage:_0x1e03c9,attributes:_0x454d0d}){if(!this['isStarted'])throw new _0x54686c('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x54686c('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x44ed11=this['chatContext']['getPendingContextItems'](),_0x3fd2d5=this['chatCapabilities']['getCapabilitiesConfig'](),_0xe0c642=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x1e03c9,'contextItems':_0x44ed11,'capabilities':_0x3fd2d5,'modelId':_0xe0c642,'attributes':_0x454d0d}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x23332a){if(_0x23332a instanceof _0x54686c)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x23332a});else{const _0x4b122f=Ue['get'](_0x23332a['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new _0x54686c(_0x4b122f,null,{'error':_0x23332a})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0xd8579b,contextItems:_0x34b732,capabilities:_0x1d4a96,modelId:_0x4e30fe,attributes:_0xf31838}){const _0x350367=new Ke({'userMessage':_0xd8579b,'contextItems':_0x34b732,'capabilities':_0x1d4a96,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x4e30fe,'attributes':_0xf31838});return _0x350367['delegate'](...ye)['to'](this),this['interactions']['push'](_0x350367),this['fire']('interactionCreated',_0x350367),_0x350367;}['getInteraction'](_0x19cd5a){return this['interactions']['find'](_0x2282c6=>_0x2282c6['id']===_0x19cd5a);}['removeInteraction'](_0x407a61){const _0x1f1dd0=this['getInteraction'](_0x407a61);_0x1f1dd0&&(_0x1f1dd0['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x1f1dd0),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x5c1a67){this['chatContext']['addCurrentDocumentToContext'](_0x5c1a67);}async['updateCurrentDocumentInContext']({content:_0x4519e6,version:_0x3b573e,sessionId:_0x7987b5,selections:_0x71fa03}){await this['chatContext']['updateCurrentDocument'](_0x4519e6,_0x3b573e,_0x7987b5,_0x71fa03);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x4c475c){this['chatContext']['addSelectionToContext'](_0x4c475c);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x24bbbb){this['chatContext']['addFilesToContext'](_0x24bbbb);}['addUrlToContext'](_0x241bf2){this['chatContext']['addUrlToContext'](_0x241bf2);}['addToolItemToContext'](_0x23b608){this['chatContext']['addToolItemToContext'](_0x23b608);}['addResourceToContext'](_0x12ca14,_0x141938){this['chatContext']['addResourceToContext'](_0x12ca14,_0x141938);}['loadSourceResources'](_0x594f93,_0x58e454,_0x53c998){return this['chatContext']['loadSourceResources'](_0x594f93,_0x58e454,_0x53c998);}['removeFromContext'](_0x3f6a5e){this['chatContext']['removeFromContext'](_0x3f6a5e);}['setWebSearch'](_0x1a3426){this['chatCapabilities']['setWebSearch'](_0x1a3426);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0xb866b){this['chatCapabilities']['setReasoning'](_0xb866b);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x177776){_0x177776?!0x1===await this['chatModels']['isAvailable'](_0x177776)&&(_0x73e170('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x177776}),_0x177776=(await this['chatModels']['getAvailableModels']())[0x0]):(_0x73e170('ai-chat-conversation-set-model-null',{'conversation':this}),_0x177776=(await this['chatModels']['getAvailableModels']())[0x0]),_0x177776['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x177776,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x177776}));}}class It extends _0x12cec9(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x2b93c6,config:_0x4913bf,locale:_0x4e1a2e}){super(),this['_connector']=_0x2b93c6,this['_config']=_0x4913bf,this['_locale']=_0x4e1a2e;}get['_availableModels'](){return this['_config']?.['displayedModels'];}get['_defaultModelId'](){return this['_config']?.['defaultModelId'];}async['getAll'](){return this['_modelsRequest']||(this['_modelsRequest']=this['_retrieveModels']()),this['_modelsRequest'];}async['getAvailableModels'](){const _0x654bca=await this['getAll']();let _0x4569ee;return _0x4569ee=this['_availableModels']?this['_filterModels'](_0x654bca,this['_availableModels']):_0x654bca['filter'](_0x492d8e=>_0x492d8e['recommended']),_0x4569ee;}async['getModel'](_0x59057a){const _0x1293d3=await this['getAll']();if(!_0x1293d3['length'])return null;if(_0x59057a){const _0x214634=this['_getModelById'](_0x1293d3,_0x59057a);if(_0x214634)return _0x214634;_0x73e170('ai-chat-model-id-unrecognized',{'modelId':_0x59057a,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x3583c2=await this['getAvailableModels']();if(!_0x3583c2['length'])return null;if(this['_defaultModelId']){const _0x4f30b0=this['_getModelById'](_0x3583c2,this['_defaultModelId']);if(_0x4f30b0)return _0x4f30b0;_0x73e170('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x3583c2[0x0]['id']});}return _0x3583c2[0x0];}async['isAvailable'](_0x4e26e8){return(await this['getAvailableModels']())['some'](_0xb04fa8=>_0xb04fa8['name']===_0x4e26e8['name']&&_0xb04fa8['provider']===_0x4e26e8['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x522f0b=this['_locale']['uiLanguage']||'en',_0x545ac6=this['_connector']['getModels'](_0x522f0b),_0x4a3ad2=await _0x545ac6['list']();this['_modelList']=_0x4a3ad2['items']['map'](_0x19b16b=>vi(_0x19b16b)?{..._0x19b16b,'name':i(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x19b16b);}catch(_0x21dd22){throw gt('ai-models-unable-to-retrieve',{'error':_0x21dd22}),_0x21dd22;}return[...this['_modelList']];}['_filterModels'](_0x38f813,_0x6599aa){let _0x784194;if(_0x6599aa){_0x784194=[];const _0x1d45f5=new Set(),_0x2b8ba4='string'==typeof _0x6599aa?[_0x6599aa['toLocaleLowerCase']()]:_0x6599aa['map'](_0x2694a1=>_0x2694a1['toLocaleLowerCase']());for(const _0xb4c46b of _0x2b8ba4)for(const _0x1956ea of _0x38f813)!_0x1d45f5['has'](_0x1956ea['id'])&&this['_isMatchingFilter'](_0x1956ea,_0xb4c46b)&&(_0x784194['push'](_0x1956ea),_0x1d45f5['add'](_0x1956ea['id']));}else _0x784194=_0x38f813;return _0x784194;}['_isMatchingFilter'](_0x52e4ce,_0x549e0c){const _0x41cbfe=_0x52e4ce['id']['toLocaleLowerCase'](),_0x3043ed=_0x52e4ce['name']['toLocaleLowerCase'](),_0xd07128=_0x52e4ce['provider']['toLocaleLowerCase']();return _0x41cbfe===_0x549e0c||_0x3043ed===_0x549e0c||vi(_0x52e4ce)&&'auto'===_0x549e0c||_0xd07128===_0x549e0c||_0x41cbfe['startsWith'](_0x549e0c);}['_getModelById'](_0x4cae47,_0xc97672){return _0x4cae47['find'](_0x3f8881=>vi(_0x3f8881)&&'auto'===_0xc97672?_0x3f8881:_0x3f8881['id']===_0xc97672)||null;}}function vi(_0x882afc){return _0x882afc['id']['startsWith']('agent');}function T(_0x2a4486){if(_0x2a4486 instanceof dt)return _0x2a4486;if(_0x2a4486?.['editors']&&_0x2a4486['editors']['get'](0x0))return _0x2a4486['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.'),_0x2a4486['editors']['get'](0x0);throw new _0x54686c('ai-get-editor-from-context-no-editor');}function Z({editor:_0x2e62a8,interaction:_0x47c46e,reply:_0x41fe4a,groups:_0x387d33,transform:_0x4d1ec9,documentCompare:_0x47ca8e,documentCompareOptions:_0x1f8648}){const _0x4abc9b=_0x47c46e['getDocumentContext']();if(!_0x4abc9b)return[];const _0x1fae18=_0x4abc9b['content'],_0x460140=_0x4abc9b['version'],_0x3280f8=_0x41fe4a['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x1a2fbd}of _0x387d33){const _0xbbe166=_0x1a2fbd['filter'](_0x4db5e0=>'new'!=_0x4db5e0['type'])['map'](_0x1012be=>St('data-id',_0x1012be['id'],_0x3280f8)),_0x5f3ee4=_0x1a2fbd['filter'](_0x1fc950=>'removed'!=_0x1fc950['type'])['map'](_0x5a9f02=>_0x5a9f02['node']['cloneNode'](!0x0));let _0x655619=null;if(_0xbbe166['length']){_0x655619=_0xbbe166[0x0]['previousSibling'];for(let _0x492852=0x0;_0x492852<_0xbbe166['length'];_0x492852++)_0x2a3aa1(_0xbbe166[_0x492852]);}if(_0x5f3ee4['length']){_0x655619||(_0x1a2fbd[0x0]['anchorId']?_0x655619=St('data-id',_0x1a2fbd[0x0]['anchorId'],_0x3280f8):(_0x655619=_0x5f3ee4['shift'](),_0x47697d(_0x3280f8,_0x655619)));for(let _0x1fd8b0=0x0;_0x1fd8b0<_0x5f3ee4['length'];_0x1fd8b0++)_0x5a8aef(_0x655619,_0x5f3ee4[_0x1fd8b0]),_0x655619=_0x5f3ee4[_0x1fd8b0];}}const _0x16aa0e=Tt(_0x3280f8),_0x169448=_0x47ca8e['getDiff'](_0x1fae18,_0x16aa0e,_0x1f8648)['getOperations']();if(_0x4d1ec9){const _0x8175c3=_0x2e62a8['model']['document']['history']['getOperations'](_0x460140),_0x45293f={'document':_0x2e62a8['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return nt(_0x169448,_0x8175c3,_0x45293f)['operationsA'];}return _0x169448;}function Y(_0x306e05,_0xd89e90){if('marker'!=_0xd89e90['type'])return;const _0x32f013=_0x306e05['model']['markers']['get'](_0xd89e90['name']);_0x32f013&&(_0xd89e90['oldRange']=_0x32f013['getRange']());}class at extends _0x3de4b5{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[q,_0x29b670];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new _0x74da33(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new It({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x42ec9a=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0xe5ae0b,_0x3332d7)=>{this['_handleUIUserMessage']({'userMessage':_0x3332d7});}),this['listenTo'](_0x42ec9a,'resizedTabs',(_0xe193aa,_0x2c5f69)=>{this['_setIsMaximized'](_0x2c5f69);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x42ec9a['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['addCurrentDocumentToChatContext']();}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x1f9325,_0x5e52a4)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x5e52a4));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0xa8ee15,_0x25c72b)=>{this['activeConversation']?.['addUrlToContext'](_0x25c72b);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x23fbe9,_0x35732f)=>{_0x35732f['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0xe952af,_0x43f5fa)=>{this['activeConversation']?.['addResourceToContext'](_0x43f5fa['source'],_0x43f5fa['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x5d4328,_0x598ea0)=>{this['_removeFromContext'](_0x598ea0);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x3927cb,_0x20cdee)=>{this['activeConversation']?.['loadSourceResources'](_0x20cdee['sourceId'],_0x20cdee['query'],_0x20cdee['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x46627e,_0x14dd17)=>{this['activeConversation']?.['setModel'](_0x14dd17);}),this['listenTo'](this['_aiChatUi'],'like',(_0x5b1b93,{replyId:_0x3d2d91})=>{console['log']('Liked\x20response',_0x3d2d91);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x102dc8,{replyId:_0x25f4dd})=>{console['log']('Disliked\x20response',_0x25f4dd);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x65368c,_0x50c206)=>{this['_insertSuggestion'](_0x50c206);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x129e18,{replyId:_0x2a64e4,partIndex:_0x569c9e})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x2a64e4,_0x569c9e);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x40d1d9,{replyId:_0x903e2e,partIndex:_0x565562})=>{const _0x587fcc=this['_getDocumentRangeForReplyChanges'](_0x903e2e,_0x565562);_0x587fcc&&'$graveyard'!=_0x587fcc['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x587fcc['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x3df237,_0x5ce62f)=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over'),this['_applySuggestion'](_0x5ce62f);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x5d5e14,{replyId:_0x58c9bb,showDiff:_0x31264c})=>{const {reply:_0x53badc}=this['getInteractionAndReplyById'](_0x58c9bb),_0x1f2ea9=_0x53badc['getContentParts']({'showDiff':_0x31264c});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x53badc['id'],'parts':_0x1f2ea9,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x502316,{replyId:_0x100ce5,partIndex:_0x21a887})=>{this['_rejectSuggestion']({'replyId':_0x100ce5,'partIndex':_0x21a887}),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['context']['plugins']['has']('AIChatBalloon')&&(this['_aiChatBalloon']=this['context']['plugins']['get']('AIChatBalloon'),this['set']('_aiChatBalloonShowDiff',!0x1),this['_aiChatBalloon']['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](this['_aiChatBalloon'],'toggleSuggestionDisplayMode',()=>{const {replyId:_0x316ba6,partIndex:_0x11e772}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x54b980}=this['getInteractionAndReplyById'](_0x316ba6),_0x376bfd=_0x54b980['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x11e772});this['_aiChatBalloon']['updateContent']({'part':_0x376bfd[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0x3281f5,partIndex:_0x308ba7}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x3281f5,'partIndex':_0x308ba7}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x172e18,partIndex:_0x2e0e63}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x172e18,'partIndex':_0x2e0e63}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x424383,partIndex:_0x8edffd}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x424383,'partIndex':_0x8edffd}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0x451908,partIndex:_0x566f59}=this['_currentPreviewedChangeGroup'],_0x576d46=this['_getPresentableSiblingContentPartIndex'](_0x451908,_0x566f59,'next');null!==_0x576d46&&this['_openBalloonFor'](_0x451908,_0x576d46);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0x3465d0,partIndex:_0x43d328}=this['_currentPreviewedChangeGroup'],_0x4fbfa2=this['_getPresentableSiblingContentPartIndex'](_0x3465d0,_0x43d328,'previous');null!==_0x4fbfa2&&this['_openBalloonFor'](_0x3465d0,_0x4fbfa2);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x1278df,{id:_0x13b7b1})=>{if('aiChatBalloon'!==_0x13b7b1)return;const {replyId:_0x42a277,partIndex:_0x220eae}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x42a277,'index':_0x220eae,'isActive':!0x1});}));}async['afterInit'](){this['context']instanceof dt?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0xb04fb5,_0x367b9e)=>{_0x367b9e['on']('ready',()=>{this['_integrateEditor'](_0x367b9e);});});const _0x55ec0f=this['context']['config']['get']('ai.chat.initialConversation');let _0x32ea89=_0x55ec0f;if('lastCreated'!=_0x55ec0f||(_0x32ea89=await this['_getLastCreatedConversationId'](),_0x32ea89))return'new'==_0x32ea89?this['_startConversationSafely']():this['loadConversation'](_0x32ea89);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_insertSuggestion'](_0x497408){const _0x51516a=T(this['context']);if(!_0x51516a['plugins']['has']('TrackChanges'))throw new _0x54686c('ai-no-track-changes',null);const _0x52fab1=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x202252,interaction:_0x537f1c}=this['getInteractionAndReplyById'](_0x497408['replyId']),_0x437745=this['_getDocumentRangeForReplyChanges'](_0x497408['replyId'],_0x497408['partIndex']),_0xe8c258=void 0x0!==_0x497408['partIndex']?[_0x202252['changeGroups'][_0x497408['partIndex']]]:_0x202252['changeGroups']['filter'](_0x1cc2f7=>'pending'==_0x1cc2f7['state']),_0xc5214d=_0xe8c258['map'](_0x2a0974=>_0x202252['changeGroups']['indexOf'](_0x2a0974));if(!_0x437745||'$graveyard'==_0x437745['range']['root']['rootName'])return void _0xc5214d['forEach'](_0x38afa9=>_0x202252['setChangeGroupState'](_0x38afa9,'outdated'));_0xc5214d['forEach'](_0x31258e=>_0x202252['setChangeGroupState'](_0x31258e,'accepted'));const _0x411574=Z({'editor':_0x51516a,'reply':_0x202252,'interaction':_0x537f1c,'groups':_0xe8c258,'transform':!0x0,'documentCompare':_0x52fab1,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x177c1d;_0x437745&&this['_scrollToSuggestionRange'](_0x437745['range']),_0x51516a['model']['change'](_0xda8c2=>{_0x177c1d=_0xda8c2['batch'],_0x51516a['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x411574),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x177c1d,{'interactionId':_0x537f1c['id'],'replyId':_0x202252['id'],'indexes':_0xc5214d['slice']()}),this['_updateRatings'](_0x202252);}['_applySuggestion'](_0x11a58c){const _0x19deb6=T(this['context']),_0x14645b=this['context']['plugins']['get'](_0x29b670),{reply:_0x35308e,interaction:_0x3b42ff}=this['getInteractionAndReplyById'](_0x11a58c['replyId']),_0x2aefb5=this['_getDocumentRangeForReplyChanges'](_0x11a58c['replyId'],_0x11a58c['partIndex']),_0x467343=void 0x0!==_0x11a58c['partIndex']?[_0x35308e['changeGroups'][_0x11a58c['partIndex']]]:_0x35308e['changeGroups']['filter'](_0x1e54cf=>'pending'==_0x1e54cf['state']),_0x947131=_0x467343['map'](_0x2a49d4=>_0x35308e['changeGroups']['indexOf'](_0x2a49d4));if(!_0x2aefb5||'$graveyard'==_0x2aefb5['range']['root']['rootName'])return void _0x947131['forEach'](_0x177c9e=>_0x35308e['setChangeGroupState'](_0x177c9e,'outdated'));_0x947131['forEach'](_0x78e612=>_0x35308e['setChangeGroupState'](_0x78e612,'accepted'));const _0x2ce6dc=Z({'editor':_0x19deb6,'reply':_0x35308e,'interaction':_0x3b42ff,'groups':_0x467343,'transform':!0x0,'documentCompare':_0x14645b,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x71071c;_0x2aefb5&&this['_scrollToSuggestionRange'](_0x2aefb5['range']),_0x19deb6['model']['change'](_0x2a7625=>{_0x71071c=_0x2a7625['batch'];for(const _0x350bfb of _0x2ce6dc)_0x350bfb['baseVersion']=_0x19deb6['model']['document']['version'],Y(_0x19deb6,_0x350bfb),_0x2a7625['batch']['addOperation'](_0x350bfb),_0x19deb6['model']['applyOperation'](_0x350bfb);}),this['_batchToChanges']['set'](_0x71071c,{'interactionId':_0x3b42ff['id'],'replyId':_0x35308e['id'],'indexes':_0x947131['slice']()}),this['_updateRatings'](_0x35308e);}['_rejectSuggestion'](_0x1c2a59){const {reply:_0xc4a843}=this['getInteractionAndReplyById'](_0x1c2a59['replyId']);_0xc4a843['setChangeGroupState'](_0x1c2a59['partIndex'],'rejected');}['_openBalloonFor'](_0x32541e,_0x217848){if(!this['_aiChatBalloon'])return;const {reply:_0x3c2f4c}=this['getInteractionAndReplyById'](_0x32541e),_0x1df440=_0x3c2f4c['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0xdfb79d,_0x9393b4;if(void 0x0!==_0x217848?(_0x9393b4=_0x1df440['find'](_0x3234ad=>_0x3234ad['index']==_0x217848),_0xdfb79d=_0x9393b4?.['index']):(_0x9393b4=_0x1df440[0x0],_0xdfb79d=_0x9393b4['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x32541e&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0xdfb79d)return;const _0x2eec59=this['_getUserPresentableContentPartDocumentRange'](_0x32541e,_0x3c2f4c,_0x9393b4);if(!_0x2eec59)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x32541e,'partIndex':_0xdfb79d},this['_scrollToSuggestionRange'](_0x2eec59,!0x0);const _0x36d218=this['_getPresentableSiblingContentPartIndex'](_0x32541e,_0xdfb79d,'next');this['_aiChatBalloon']['updateContent']({'part':_0x9393b4,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0xdfb79d,'title':i(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0xdfb79d+0x1)['toString']()),'showRotator':null!==_0x36d218,'ranges':[_0x2eec59],'areActionsDisabled':_0x3c2f4c['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x32541e,_0xdfb79d),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x32541e,'index':_0xdfb79d,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x346e74,_0xecd8d6,_0x32b81e){const {reply:_0x4742ec}=this['getInteractionAndReplyById'](_0x346e74),_0x42989a=_0x4742ec['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x42989a['length'])return null;const _0x257099=_0x42989a['findIndex'](_0x8d977f=>_0x8d977f['index']==_0xecd8d6),_0x4d3dc6='next'==_0x32b81e?0x1:-0x1;let _0x3ddbad=_0x42989a['at']((_0x257099+_0x4d3dc6)%_0x42989a['length'])['index'],_0x28da31=_0x42989a[_0x3ddbad];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x346e74,_0x4742ec,_0x28da31);){if(_0x3ddbad=_0x42989a['at']((_0x3ddbad+_0x4d3dc6)%_0x42989a['length'])['index'],_0x3ddbad===_0x257099)return null;_0x28da31=_0x42989a[_0x3ddbad];}return _0x3ddbad;}['_getUserPresentableContentPartDocumentRange'](_0xceb7b,_0x27193b,_0x19a022){const _0x158f4c=_0x27193b['changeGroups'];if(!_0x19a022['hasChanges'])return null;const _0x42ed31=_0x158f4c['find'](_0x2799b0=>_0x2799b0['index']==_0x19a022['index']);if('pending'!==_0x42ed31?.['state'])return null;const _0x5a71cf=this['_getDocumentRangeForReplyChanges'](_0xceb7b,_0x19a022['index']);if(!_0x5a71cf)return null;const {range:_0x67419e,currentIndex:_0xb9037f}=_0x5a71cf;return'$graveyard'==_0x67419e['root']['rootName']?(_0x27193b['setChangeGroupState'](_0xb9037f,'outdated'),null):_0x5a71cf['range'];}['_getDocumentRangeForReplyChanges'](_0x1a10ca,_0x113ae8){const _0x587e91=T(this['context']),{reply:_0x13459d,interaction:_0x19ffaf}=this['getInteractionAndReplyById'](_0x1a10ca),_0xcdbce1=_0x13459d['changeGroups']['filter'](_0x408854=>'pending'==_0x408854['state']),_0x20b30f=_0xcdbce1['map'](_0x21c508=>_0x13459d['changeGroups']['indexOf'](_0x21c508));void 0x0===_0x113ae8&&(_0x113ae8=_0x20b30f[0x0]);const _0x4f29d4=_0x20b30f['indexOf'](_0x113ae8);if(-0x1==_0x4f29d4)return null;const _0x3244a6=_0xcdbce1[_0x4f29d4],_0x3e8e2f=new Et([]),_0x2b5c72=new Et([]);for(const _0xc86585 of _0x3244a6['changes'])if('removed'!=_0xc86585['type']&&_0x2b5c72['children']['push'](_0xc86585['node']['cloneNode'](!0x0)),'new'!=_0xc86585['type']){const _0x60bcb6=yt(_0x523097=>At(_0x523097,'data-id')==_0xc86585['id'],_0x13459d['documentContextContent'],!0x0);_0x3e8e2f['children']['push'](_0x60bcb6['cloneNode'](!0x0));}if(0x0==_0x3e8e2f['children']['length']){if(_0x3244a6['changes'][0x0]['anchorId']){const _0x4a6cc8=St('data-id',_0x3244a6['changes'][0x0]['anchorId'],_0x13459d['documentContextContent']);_0x3e8e2f['children']['unshift'](_0x4a6cc8['cloneNode'](!0x0)),_0x2b5c72['children']['unshift'](_0x4a6cc8['cloneNode'](!0x0)),_0x4a6cc8['nextSibling']&&(_0x3e8e2f['children']['push'](_0x4a6cc8['nextSibling']['cloneNode'](!0x0)),_0x2b5c72['children']['push'](_0x4a6cc8['nextSibling']['cloneNode'](!0x0)));}else{const _0x229782=_0x13459d['documentContextContent']['children'][0x0];if(!_0x229782)return null;_0x3e8e2f['children']['push'](_0x229782['cloneNode'](!0x0)),_0x2b5c72['children']['push'](_0x229782['cloneNode'](!0x0));}}const _0x3857b5=_0x19ffaf['getDocumentContext'](),_0x258fa2=_0x587e91['data']['parse'](_0x3857b5['content']),_0x48ea75=Tt(_0x3e8e2f),_0x263e0b=_0x587e91['data']['parse'](_0x48ea75),_0x29892d=_0x587e91['data']['parse'](_0x48ea75),_0x471c45=_0x587e91['model']['createPositionAt'](_0x263e0b,0x0),_0x46a3fa=Tt(_0x2b5c72),_0x1cba27={'anchor':_0x471c45,'markDeletions':!0x1},_0x22799a=_0x587e91['plugins']['get'](_0x29b670)['getDiff'](_0x48ea75,_0x46a3fa,_0x1cba27)['getOperations']();if(!_0x22799a['length'])return null;_0x587e91['model']['change'](_0x2f108d=>{for(const _0x48dbfa of _0x22799a)if('remove'==_0x48dbfa['type']){const _0x32daed=_0x48dbfa['sourcePosition'],_0x3589a4=_0x48dbfa['howMany'],_0x441495=new et(_0x32daed,_0x3589a4);_0x2f108d['batch']['addOperation'](_0x441495),_0x587e91['model']['applyOperation'](_0x441495);}else'marker'!==_0x48dbfa['type']&&(_0x48dbfa['baseVersion']=null,_0x48dbfa['isDocumentOperation']=!0x1,_0x2f108d['batch']['addOperation'](_0x48dbfa),_0x587e91['model']['applyOperation'](_0x48dbfa));});const _0xf5c9b6=mt(_0x587e91,_0x22799a,_0x263e0b);ft(_0x587e91['model'],_0xf5c9b6);const _0x1c8406=_0xf5c9b6['getFirstRange']()['start']['path']['slice'](),_0x39c9b9=_0xf5c9b6['getFirstRange']()['end']['path']['slice'](),_0x5c50cb=[];let _0x49ddb1=_0x263e0b,_0x5cd91a=_0x29892d;for(let _0x1ee63d=0x0;_0x1ee63d<_0x39c9b9['length'];_0x1ee63d++){const _0xab24cc=_0x49ddb1['maxOffset']-_0x39c9b9[_0x1ee63d];_0x5c50cb[_0x1ee63d]=_0x5cd91a['maxOffset']-_0xab24cc,_0x49ddb1=_0x49ddb1['getChildAtOffset'](_0x39c9b9[_0x1ee63d]),_0x5cd91a=_0x5cd91a['getChildAtOffset'](_0x5c50cb[_0x1ee63d]);}const _0x132717=_0x587e91['model']['createRange'](_0x587e91['model']['createPositionFromPath'](_0x29892d,_0x1c8406),_0x587e91['model']['createPositionFromPath'](_0x29892d,_0x5c50cb)),_0xacf60f=_0x29892d['getChild'](0x0)['getAttribute'](Ct),_0x495b94=Array['from'](_0x258fa2['getChildren']())['find'](_0x5baece=>_0x5baece['getAttribute'](Ct)==_0xacf60f)['getPath'](),_0x55fa08=_0x132717['start']['path']['slice'](),_0x4ef592=_0x132717['end']['path']['slice']();_0x55fa08[0x0]=_0x495b94[0x0]+_0x55fa08[0x0],_0x4ef592[0x0]=_0x495b94[0x0]+_0x4ef592[0x0];let _0x42556f=_0x587e91['model']['createRange'](_0x587e91['model']['createPositionFromPath'](_0x587e91['model']['document']['getRoot'](),_0x55fa08),_0x587e91['model']['createPositionFromPath'](_0x587e91['model']['document']['getRoot'](),_0x4ef592));const _0x17027d=_0x587e91['model']['document']['history']['getOperations'](_0x3857b5['version']);for(const _0x293fca of _0x17027d)_0x42556f=it['_createFromRanges'](_0x42556f['getTransformedByOperation'](_0x293fca));return{'range':_0x42556f,'currentIndex':_0x113ae8};}['_integrateEditor'](_0x20abd8){if(!_0x20abd8['plugins']['has']('Undo'))return;const _0x2cdd25=_0x20abd8['commands']['get']('undo'),_0x43e2f9=_0x20abd8['commands']['get']('redo');this['listenTo'](_0x2cdd25,'revert',(_0x2591ac,_0x371681,_0x291087)=>{const _0x268e86=this['_batchToChanges']['get'](_0x371681);if(!_0x268e86)return;const _0x4cede2=this['activeConversation']['getInteraction'](_0x268e86['interactionId'])['getReply'](_0x268e86['replyId']);_0x268e86['indexes']['forEach'](_0x35f1fb=>_0x4cede2['setChangeGroupState'](_0x35f1fb,'pending')),this['_batchToChanges']['delete'](_0x371681),this['_batchToChanges']['set'](_0x291087,_0x268e86);}),this['listenTo'](_0x43e2f9,'revert',(_0x5d521e,_0x1236d7,_0x4a1624)=>{const _0x1e89c6=this['_batchToChanges']['get'](_0x1236d7);if(!_0x1e89c6)return;const _0x388ddf=this['activeConversation']['getInteraction'](_0x1e89c6['interactionId'])['getReply'](_0x1e89c6['replyId']);_0x1e89c6['indexes']['forEach'](_0x2b95d8=>_0x388ddf['setChangeGroupState'](_0x2b95d8,'accepted')),this['_batchToChanges']['delete'](_0x1236d7),this['_batchToChanges']['set'](_0x4a1624,_0x1e89c6);});}async['loadConversation'](_0x5d1f89){this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),(this['context']['plugins']['get'](pt)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x5d1f89)['getConversation'](),await this['_startConversationSafely'](_0x5d1f89),this['updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x5d1f89,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x477961){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x5d1f89}),this['_logError'](new _0x54686c('ai-chat-conversation-not-found',this,{'error':_0x477961}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}async['_getLastCreatedConversationId'](){const _0x5b0804=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x11aac7=await _0x5b0804['getConversations']();return _0x11aac7['length']?_0x11aac7[0x0]['id']:'new';}catch(_0x3c3a81){return this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x589eaf()}),this['_logError'](new _0x54686c('ai-chat-conversation-init-failed',this,{'error':_0x3c3a81})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}['handleRemovedConversation'](_0x1f3320){this['activeConversation']['id']===_0x1f3320&&this['_startConversationSafely']();}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x49000b=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x49000b),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x131eab,attributes:_0x46f71b}){await this['_handleUIUserMessage']({'userMessage':_0x131eab,'attributes':_0x46f71b});}['getGroupId'](){const _0x4e3e46=this['context']['config']['get']('collaboration.channelId');if(!_0x4e3e46)throw new _0x54686c('ai-chat-missing-channel-id',this);return _0x4e3e46;}async['_startConversationSafely'](_0x2b8222){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x2b8222);}catch(_0x4f7965){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x2b8222||_0x589eaf()}),console['error'](_0x4f7965),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x12fe4e){let _0x1cb7d3;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0x12fe4e||!this['activeConversation']?_0x1cb7d3=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x1cb7d3=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x4d1a88=this['getGroupId'](),_0xab9e13=_0x12fe4e||_0x589eaf();this['activeConversation']=new _t({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x1cb7d3,'conversationId':_0xab9e13,'group':_0x4d1a88,'getEditor':()=>T(this['context']),'isFromHistory':!!_0x12fe4e}),this['activeConversation']['delegate']('toolDataReceived','interactionStarted')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x18cd1b,_0x25f518)=>{this['_aiChatUi']['createConversation'](_0x25f518),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x12fe4e||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0xbc23bf,_0x5d8f24)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x5d8f24['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x2a35ab,_0x4e830c)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x4e830c);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x2ddb53=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x2ddb53);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x2b2102=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x2b2102);}),this['activeConversation']['on']('webSearchFinished',(_0x407ab9,_0x371e62)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x371e62,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x21edf8,_0x41c7c9)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x41c7c9,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x17a297,_0x528fff)=>{this['_aiChatUi']['removeFeedInteraction'](_0x528fff['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x395d11,_0x3a15c8,_0x510553)=>{this['updateConversationTitle'](_0x3a15c8,_0x510553);}),this['activeConversation']['on']('replyCreated',(_0x20f79a,_0x2382b7)=>{'text'===_0x2382b7['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x2382b7):this['_aiChatUi']['addFeedItemAISuggestion'](_0x2382b7);}),this['activeConversation']['on']('replyContentUpdated',async(_0x513ef8,_0x38cc02)=>{await this['_updateReplyContent']({'reply':_0x38cc02});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x10c48a,{reply:_0x47dc77,index:_0x433b72,state:_0x173e38})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x47dc77['id'],'index':_0x433b72,'state':_0x173e38}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x47dc77['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x433b72&&this['_aiChatBalloon']?.['setState'](_0x173e38);}),this['activeConversation']['on']('contextItemAdded',(_0x3ca366,_0x46ae59)=>{if(this['_aiChatUi']['addContextItem'](_0x46ae59['contextItem'],_0x46ae59['isLoading']),'selection'===_0x46ae59['contextItem']['type']){const _0x24169f=[...T(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x24169f,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x78973a,_0x463c0c)=>{this['_aiChatUi']['removeContextItem'](_0x463c0c['uiId']),'current-document'==_0x463c0c['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x463c0c['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x37ff03,_0x158df6)=>{this['_aiChatUi']['setContextItemLoading'](_0x158df6['contextItem']['uiId'],_0x158df6['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x408ba0,_0x4220cb)=>{this['_aiChatUi']['setConversationContext'](_0x4220cb['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x401222,_0x40d814)=>{this['_aiChatUi']['setAddContextOptions'](_0x40d814['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x4829ec,_0x5a567d)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x5a567d['sourceId'],_0x5a567d['source'],_0x5a567d['resources'],_0x5a567d['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x16c5a4,_0x24bb4a)=>{this['_aiChatUi']['updateResourceState'](_0x24bb4a['sourceId'],_0x24bb4a['resourceId'],_0x24bb4a['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x50e4fe,_0xa7a7d3)=>{this['_aiChatUi']['updateCapabilities'](_0xa7a7d3);}),this['activeConversation']['on']('modelSelected',async(_0x2f436c,_0x2431aa)=>{const _0x5d1b11=(await this['_aiChatModels']['getAll']())['find'](_0x5f55e5=>_0x5f55e5['id']===_0x2431aa['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x5d1b11,_0x2431aa['isDisabled']);}),this['activeConversation']['on']('error',(_0x3e728,{error:_0x269051,interactionId:_0x3ba856,fileName:_0x281882,url:_0x179442,sourceId:_0x526f58,sourceLabel:_0x3ea553})=>{const _0x2b42ce=_0x3ba856?_0x3ba856+':'+_0x589eaf():_0x589eaf();_0x269051['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':i(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x2b42ce}):_0x269051['message']['startsWith']('ai-chat-conversation-init-failed')||_0x269051['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x2b42ce}),this['_logError'](_0x269051)):_0x269051['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x281882),'id':_0x2b42ce}):_0x269051['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x179442),'id':_0x2b42ce}):_0x269051['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x2b42ce}):_0x269051['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x2b42ce}):_0x269051['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x526f58&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x526f58),this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x3ea553||'source'),'id':_0x2b42ce}),this['_logError'](_0x269051)):_0x269051['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x2b42ce}),this['_logError'](_0x269051)):_0x269051['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x2b42ce}),this['_logError'](_0x269051)):_0x269051['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x2b42ce}),this['_logError'](_0x269051)):_0x269051['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x2b42ce}),this['_logError'](_0x269051)):_0x269051['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x2b42ce}),this['_logError'](_0x269051)):_0x269051['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x2b42ce}),this['_logError'](_0x269051)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x2b42ce}),this['_logError'](_0x269051));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x12fe4e||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x184c70,attributes:_0x5055e5}){if(!this['activeConversation'])throw new _0x54686c('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x3bb062=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x3bb062);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x184c70,'attributes':_0x5055e5});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x5facf){this['_aiChatUi']['setIsMaximized'](_0x5facf);}['_logError'](_0x543453){gt(_0x543453['message']);}['_removeFromContext'](_0x4ea78c){this['activeConversation']?.['removeFromContext'](_0x4ea78c);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x3566f0){const [_0xcf1ccd,_0x55bc78]=_0x3566f0['split'](':'),_0x304ec0=this['activeConversation']['getInteraction'](_0xcf1ccd),_0x4617d9=_0x304ec0['getReply'](_0x55bc78);return{'interaction':_0x304ec0,'reply':_0x4617d9};}['_scrollToSuggestionRange'](_0x2e45ca,_0x3caec0=!0x1){const _0x1c63d8=T(this['context']),_0x398394={'target':_0x1c63d8['editing']['view']['domConverter']['viewRangeToDom'](_0x1c63d8['editing']['mapper']['toViewRange'](_0x2e45ca)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x3caec0};_0x3caec0&&(_0x398394['alignToTop']=!0x0),_0x1dbe2e(_0x398394);}['updateConversationTitle'](_0x535517,_0x42afbf=!0x1){this['_aiChatUi']['setConversationTitle'](_0x535517||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x42afbf);}async['_updateReplyContent']({reply:_0x57e580,renderingStrategy:_0x2f1644}){const {id:_0x527d5a,interactionId:_0x48aef8,isDone:_0xfe08f3,type:_0x4bb625,parsedContent:_0x39548c}=_0x57e580,_0x3a06b7=_0x48aef8+':'+_0x527d5a;if('modification'===_0x4bb625){const _0x341c78=_0x57e580['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x3a06b7,'parts':_0x341c78,'renderingStrategy':_0x2f1644,'isDone':_0xfe08f3});}else'text'===_0x4bb625&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x3a06b7,'parsedContent':_0x39548c,'renderingStrategy':_0x2f1644,'isDone':_0xfe08f3});_0xfe08f3&&_0x57e580['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x3a06b7,_0x57e580['sources']);}async['_stopLastInteraction'](){const _0x52510e=this['activeConversation']?.['lastInteraction'];_0x52510e&&(_0x52510e['stop'](),this['_aiChatUi']['stopInteraction'](_0x52510e));}async['_flushLastInteractionUI'](){const _0x40c56b=this['activeConversation']?.['lastInteraction'];if(_0x40c56b){for await(const _0x5c84e0 of _0x40c56b['replies'])await this['_updateReplyContent']({'reply':_0x5c84e0,'renderingStrategy':'static'});}}['_updateRatings'](_0x420230){const _0x40d334={'positiveCount':_0x420230['changeGroups']['filter'](_0x2405fa=>'accepted'===_0x2405fa['state'])['length'],'totalCount':_0x420230['changeGroups']['length'],'modificationId':_0x420230['id']},_0x48e60b=this['activeConversation']['getInteraction'](_0x420230['interactionId'])['messageId'];_0x48e60b&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x48e60b,_0x40d334);}['_registerToolDataCallback'](_0x376266){let _0x5cf757=null,_0x5c10db=null;this['on']('toolDataReceived',(_0xbcdf4f,_0x4334b2,_0xeafe46)=>{_0xeafe46['id']!==_0x5cf757&&(_0x5cf757=_0xeafe46['id'],_0x5c10db=this['_getAIChatInteractionAPI'](_0xeafe46)),_0x376266(_0x4334b2,_0x5c10db);});}['_getAIChatInteractionAPI'](_0x4de9d3){const _0x5a3936=this['_aiChatUi'],_0x2b5167=()=>{_0x4de9d3['resetWebSearchState'](),_0x4de9d3['resetReasoningState'](),_0x5a3936['clearLoadingMessage']();},_0xfd7567=()=>{_0x4de9d3['currentReply']&&(_0x4de9d3['currentReply']['done'](),_0x4de9d3['currentReply']=void 0x0);};return{'insertTextReply':(_0x14f0bd,_0x207804)=>{_0xfd7567(),_0x2b5167();const _0x1a5149=_0x4de9d3['currentReply']=_0x4de9d3['createReply']({'type':'text','interactionId':_0x4de9d3['id'],'content':_0x14f0bd,'id':_0x207804||_0x589eaf()});return _0xfd7567(),_0x1a5149;},'insertCustomElement':async(_0x1715d0,_0x1aa6b0)=>(_0xfd7567(),_0x2b5167(),_0x5a3936['addFeedItemCustomElement'](_0x1715d0,_0x1aa6b0||_0x589eaf())),'setLoadingMessage':_0x20efa8=>{_0x5a3936['setLoadingMessage'](_0x20efa8);},'clearLoadingMessage':()=>{_0x5a3936['clearLoadingMessage']();}};}}const R='ai-selection';class D extends _0x3de4b5{constructor(_0x3f5a80){super(_0x3f5a80),this['context']['config']['define']('ai.models.showModelSelector',!0x0);}['_outputDataProcessor'];['_displayedFakeSelectionId']=null;['_displayedFakeSelectionLocked']=!0x1;['_sessionId'];static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['sessionId'](){if(!this['_sessionId']){const _0x557f27=T(this['context']),_0x1d5294=_0x557f27['plugins']['has']('RealTimeCollaborationClient')&&_0x557f27['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x1d5294||_0x589eaf();}return this['_sessionId'];}async['getDocumentData'](){const _0x112c8a=T(this['context']),_0x2779ef=_0x112c8a['model'],_0x20b2a1=_0x112c8a['data']['toView'](_0x2779ef['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x2400c0=new Dt(_0x112c8a['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x20b2a1,_0x2400c0);let _0x43107f=await this['_getDocumentDataStringFromView'](_0x20b2a1);const _0x2c122c=this['_getMarkersInDocumentOrder'](),_0x7924b2=[];for(const _0x15e648 of _0x2c122c){const _0x4c8251='<'+_0x15e648['name']+':start></'+_0x15e648['name']+':start>',_0x2421e8=_0x43107f['indexOf'](_0x4c8251);_0x43107f=_0x43107f['substring'](0x0,_0x2421e8)+_0x43107f['substring'](_0x2421e8+_0x4c8251['length']);const _0x5c5e9a='<'+_0x15e648['name']+':end></'+_0x15e648['name']+':end>',_0x40f2a9=_0x43107f['indexOf'](_0x5c5e9a);_0x43107f=_0x43107f['substring'](0x0,_0x40f2a9)+_0x43107f['substring'](_0x40f2a9+_0x5c5e9a['length']),_0x7924b2['push']({'markerName':_0x15e648['name'],'start':_0x2421e8,'end':_0x40f2a9,'htmlFragment':_0x43107f['substring'](_0x2421e8,_0x40f2a9)});}return{'content':_0x43107f,'version':_0x112c8a['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x7924b2};}async['afterInit'](){this['context']instanceof dt?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x13a635,_0x391b9a)=>{_0x391b9a['on']('ready',()=>{this['_integrateEditor'](_0x391b9a);});});}['_setOutputDataProcessor'](_0x53600b){this['_outputDataProcessor']=_0x53600b;}async['_getDocumentDataStringFromView'](_0xb02f95){let _0x637e1f;const _0x396895=T(this['context']);if(this['_outputDataProcessor']){const _0xc5a778=_0x396895['data']['processor']['domConverter']['viewToDom'](_0xb02f95),_0x14c58b=await this['_outputDataProcessor'](_0xc5a778);_0x637e1f=_0x396895['data']['processor']['htmlWriter']['getHtml'](_0x14c58b);}else _0x637e1f=_0x396895['data']['processor']['toData'](_0xb02f95);return _0x637e1f;}['_integrateEditor'](_0xc96b1c){_0xc96b1c['conversion']['for']('editingDowncast')['markerToHighlight']({'model':R,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0xc96b1c['conversion']['for']('dataDowncast')['markerToElement']({'model':R,'view':(_0x55b41c,{writer:_0x18cdb4,options:_0x226313})=>_0x226313['convertAiChatSelectionMarker']?_0x18cdb4['createUIElement'](_0x55b41c['markerName']+':'+(_0x55b41c['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x192671,_0x28f130,_0x16ff8a=!0x1,_0x3044db=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x3044db)return!0x1;const _0x6ba3c=T(this['context'])['model'];return _0x6ba3c['change'](_0x4a01fe=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x28f130,this['_displayedFakeSelectionLocked']=_0x16ff8a;let _0x421201=0x0;for(let _0x131812 of _0x192671){const _0xfb6ad=R+':'+_0x421201;if(_0x131812['start']['isAtEnd']){const _0x297a4a=_0x131812['start']['getLastMatchingPosition'](({item:_0x3ace3a})=>!_0x6ba3c['schema']['isContent'](_0x3ace3a),{'boundaries':_0x131812});_0x131812=_0x4a01fe['createRange'](_0x297a4a,_0x131812['end']);}_0x4a01fe['addMarker'](_0xfb6ad,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x131812}),_0x421201++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x1417b2){if(this['_displayedFakeSelectionId']!=_0x1417b2)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x1c9fca=T(this['context']),_0x34f9e4=_0x1c9fca['model']['markers']['getMarkersGroup'](R);return _0x1c9fca['model']['change'](_0x3d2674=>{for(const _0x2771ce of _0x34f9e4)_0x3d2674['removeMarker'](_0x2771ce);}),!0x0;}async['modelToDataWithIds'](_0x570b05){const _0x30213f=T(this['context']),_0x98c10a=_0x30213f['data']['toView'](_0x570b05),_0x138146=new Dt(_0x30213f['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x98c10a,_0x138146),this['_getDocumentDataStringFromView'](_0x98c10a);}['_setDataIdsOnChildren'](_0x5eb28f,_0x3da923){let _0xea6385=!0x1;const _0x375419=new Set();for(const _0x41a7f0 of _0x5eb28f['getChildren']()){const _0x497cf4=_0x41a7f0['is']('emptyElement')||_0x41a7f0['is']('containerElement');if(!_0x41a7f0['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x41a7f0,_0x3da923)||_0x497cf4)&&(_0x3da923['setAttribute']('data-id',this['_nextDataId'](_0x375419),_0x41a7f0),_0xea6385=!0x0);}return _0xea6385;}['_nextDataId'](_0x4cefd9){let _0x215870;do{_0x215870='';for(let _0x14a07b=0x0;_0x14a07b<0x4;_0x14a07b++)_0x215870+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x4cefd9['has'](_0x215870));return _0x4cefd9['add'](_0x215870),_0x215870;}['getSelectionText'](){const {model:_0x797d37}=T(this['context']),_0x156485=_0x797d37['document']['selection'],_0x5a2e8c=[];for(const _0x191eff of _0x156485['getRanges']())for(const _0x107424 of _0x191eff['getItems']())_0x107424['is']('$textProxy')?_0x5a2e8c['push'](_0x107424['data']):_0x107424['is']('element')&&_0x5a2e8c['length']>0x0&&'\x20'!==_0x5a2e8c[_0x5a2e8c['length']-0x1]&&_0x5a2e8c['push']('\x20');return _0x5a2e8c['length']?'\x22'+_0x5a2e8c['join']('')['trim']()+'\x22':i(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_getMarkersInDocumentOrder'](){const _0x5b1b2f=T(this['context'])['model'];return Array['from'](_0x5b1b2f['markers']['getMarkersGroup'](R))['sort']((_0x43dae6,_0x327778)=>_0x43dae6['getStart']()['isBefore'](_0x327778['getStart']())?-0x1:_0x43dae6['getStart']()['isAfter'](_0x327778['getStart']())?0x1:0x0);}}const ut=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],bt=[...ut,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class ha{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x4b1773){this['options']={'delay':_0x4b1773['delay']??0x14,'textNodeStyle':_0x4b1773['textNodeStyle'],'onStreamUpdate':_0x4b1773['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x15fc6d,targetElement:_0x3dee86,abortSignal:_0x1f8535}){this['isStreaming']&&this['stop'](),_0x1f8535?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0xe31279(_0x15fc6d,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x1a9f3f=0x0;_0x1a9f3f<this['currentIndex'];_0x1a9f3f++)this['nodesList'][_0x1a9f3f]['shouldBeStreamed']=!0x0;do{const _0x8dd3f1=Date['now'](),_0x3becec=this['nodesList'][this['currentIndex']],_0x4d6e45=_0x8dd3f1-this['lastUpdateTime'];if(_0x3becec){_0x3becec['shouldBeStreamed']=!0x0;let _0x1e1bf9=_0x3becec['parent'];for(;_0x1e1bf9;)_0x1e1bf9['shouldBeStreamed']=!0x0,_0x1e1bf9=_0x1e1bf9['parent'];}if(_0x4d6e45<this['options']['delay'])try{const {promise:_0x1d6f45,abortController:_0x1f30f7}=Ds(this['options']['delay']-_0x4d6e45);this['timeoutAbortController']=_0x1f30f7,await _0x1d6f45;}catch(_0x384089){return;}_0x5470ef(_0x3dee86,'<'+_0x3dee86['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x3dee86['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']++,this['lastUpdateTime']=Date['now']();}while(this['currentIndex']<this['nodesList']['length']);this['currentIndex']=this['nodesList']['length'],this['isStreaming']=!0x1;}['reset'](){this['isStreaming']=!0x1,this['document']=null,this['nodesList']=[],this['currentIndex']=0x0,this['timeoutAbortController']=null;}['cleanUpAnimations']({targetElement:_0x4b06d2}){Array['from'](_0x4b06d2['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x36e999=>{_0x36e999['replaceWith'](_0x36e999['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x297ef1){let _0x2852d1='';if(function(_0x36b5a3){return _0x4d2112(_0x36b5a3);}(_0x297ef1)){for(const _0x36e7e7 of _0x297ef1['children'])_0x2852d1+=this['renderNode'](_0x36e7e7);}else{if(Ts(_0x297ef1)){if(!_0x297ef1['shouldBeStreamed'])return'';const _0x4dca1b=_0x297ef1,_0x4afc80=Object['entries'](_0x4dca1b['attribs'])['map'](([_0x1dcd83,_0x7bd428])=>_0x1dcd83+'=\x22'+_0x7bd428+'\x22')['join']('\x20');_0x2852d1+='<'+_0x4dca1b['tagName']+(_0x4afc80?'\x20'+_0x4afc80:'')+'>';for(const _0x219262 of _0x3d261d(_0x4dca1b))_0x2852d1+=this['renderNode'](_0x219262);_0x2852d1+='</'+_0x4dca1b['tagName']+'>';}else{if(!Ss(_0x297ef1))return'';if(!_0x297ef1['shouldBeStreamed'])return'';!function(_0x15a71a){if(!_0x15a71a['parent']||!Ts(_0x15a71a['parent']))return!0x1;if(!ys['includes'](_0x15a71a['parent']['tagName']))return!0x1;return!_0x63493(_0x15a71a)['match'](/^\s*[<>]\s*$/);}(_0x297ef1)?_0x2852d1+=_0x3d00aa(_0x297ef1):_0x2852d1+=_0x3d00aa(new _0x5fd8c8('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x297ef1]));}}return _0x2852d1;}['getParsedDocumentNodeList'](){const _0x48af65=[];return function(_0x51ff76,_0x2f54cc){const _0x3b99f2=_0x1fbd98=>{if(_0x2f54cc(_0x1fbd98),_0x1fbd98 instanceof _0x74a3ae)for(let _0x1e1344=0x0;_0x1e1344<_0x1fbd98['children']['length'];_0x1e1344++){const _0x3b4374=_0x1fbd98['children'][_0x1e1344];_0x3b99f2(_0x3b4374);}};for(let _0x49bdb9=0x0;_0x49bdb9<_0x51ff76['children']['length'];_0x49bdb9++)_0x3b99f2(_0x51ff76['children'][_0x49bdb9]);}(this['document'],_0xe41058=>{if(Ss(_0xe41058)){const _0x2c7f80=this['splitTextNodeIntoWordNodes'](_0xe41058);_0x2c7f80['length']&&_0x48af65['push'](..._0x2c7f80);}_0xe41058['isWordSplitSource']||_0xe41058['isWordSplitResult']||_0x48af65['push'](_0xe41058);}),_0x48af65;}['splitTextNodeIntoWordNodes'](_0x4adbec){if(_0x4adbec['isWordSplitSource']||_0x4adbec['isWordSplitResult'])return[];const _0x185393=_0x63493(_0x4adbec)['match'](/(?:\s*\S+\s*)/g),_0x3f0883=[];if(_0x185393&&_0x185393['length']>0x1){for(const _0x46a6ab of _0x185393){const _0x3c11d9=new _0x5dcbfa(_0x46a6ab);_0x3c11d9['isWordSplitResult']=!0x0,_0x17e3d4(_0x4adbec,_0x3c11d9),_0x3f0883['push'](_0x3c11d9);}_0x4adbec['isWordSplitSource']=!0x0,_0x2a3aa1(_0x4adbec);}return _0x3f0883;}}const ys=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function Ss(_0x5431a3){return _0x1f8133(_0x5431a3);}function Ts(_0x568500){return _0x1415cb(_0x568500);}function Ds(_0x27571b){const _0x1003fb=new AbortController();return{'promise':new Promise((_0x404d5c,_0x3a4e95)=>{const _0x2a1204=setTimeout(_0x404d5c,_0x27571b);_0x1003fb['signal']['addEventListener']('abort',()=>{clearTimeout(_0x2a1204),_0x3a4e95();});}),'abortController':_0x1003fb};}class Fr extends _0x25f6b6{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x441ece){super();const _0x5bce73=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0x441ece,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x5bce73['if']('isDone','ck-ai-chat__feed__item_done'),_0x5bce73['if']('isVisible','ck-hidden',_0x3b2f55=>!_0x3b2f55),'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'](_0x103ef1=>{_0x103ef1['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x5c6620,_0xd5fe56,_0x2eae75){await this['htmlStreamer']['stream']({'document':_0x5c6620,'targetElement':_0xd5fe56,'abortSignal':_0x2eae75});}}class oa extends _0x25f6b6{['showChangesToggleView'];constructor(_0x272210,_0xe5f8a1){super(_0x272210),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Zn(_0x272210),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':i(_0x272210,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0xe5f8a1['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x2d3f47=>_0x2d3f47?_0x6ecf94:_0xe8e21c),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x3ee2db=new _0x283d41();_0x3ee2db['content']=_0x239981,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0xe5f8a1['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x3ee2db,{'tag':'span','children':[i(_0x272210,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Zn extends _0x28db64{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const Or={'accepted':_0x161dde,'rejected':_0x3ada2f,'outdated':_0x3ada2f};class ws extends _0x25f6b6{['stateIconView'];constructor(_0x4eddce){super(_0x4eddce);const _0xf80196=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new Nr(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0xf80196['to']('state',_0x324629=>'ck-ai-suggestion__content-part-state_'+_0x324629),_0xf80196['if']('isVisible','ck-hidden',_0x5487a9=>!_0x5487a9)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0xf80196['to']('state',_0x27702c=>{switch(_0x27702c){case'accepted':return i(_0x4eddce,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return i(_0x4eddce,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return i(_0x4eddce,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x4c4231){this['state']=_0x4c4231;}}class Nr extends _0x283d41{constructor(){super(),this['set']('state','accepted'),this['content']=Or[this['state']],this['on']('change:state',()=>{this['content']=Or[this['state']];});}}class cs extends _0x28f204{['_applyButton'];['_suggestButton'];constructor(_0x428014,_0x361068,_0x3cff96){super(_0x428014);const _0xdbd5fc=Boolean(_0x3cff96);this['set']('isEnabled',!_0xdbd5fc),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x545d53=[];if(_0xdbd5fc){const _0x187e01=new _0x28db64(_0x428014);_0x187e01['set']({'label':i(_0x428014,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x3f0ea0}),_0x545d53['push'](_0x187e01);}else{_0x361068['includes']('applySuggestion')&&(this['_applyButton']=new _0x28db64(_0x428014),this['_applyButton']['set']({'label':i(_0x428014,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x161dde}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x545d53['push'](this['_applyButton'])),_0x361068['includes']('insertSuggestion')&&(this['_suggestButton']=new _0x28db64(_0x428014),this['_suggestButton']['set']({'label':i(_0x428014,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0xd1c008}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x545d53['push'](this['_suggestButton']));const _0x3f8141=new _0x28db64(_0x428014);_0x3f8141['set']({'label':i(_0x428014,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x3ada2f}),_0x3f8141['bind']('isEnabled')['to'](this),_0x3f8141['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x545d53['push'](_0x3f8141);}this['items']['addMany'](_0x545d53);const _0x5a5a1f=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x5a5a1f['if']('isVisible','ck-hidden',_0x4ab56b=>!_0x4ab56b)]}});}['setButtonsVisibility']({showApplyButton:_0xf0fb83,showSuggestButton:_0x3ef8af}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0xf0fb83),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x3ef8af);}}class vn extends _0x25f6b6{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0xaae1f6,{part:_0x519bc7,uiIndex:_0x1bfbf7,availableActions:_0x5a4379,areActionsDisabled:_0x145115}){super(_0xaae1f6),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new cs(_0xaae1f6,_0x5a4379,_0x145115),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x519bc7['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x519bc7['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x519bc7['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new ws(_0xaae1f6),this['titleLabelView']=new Sn(_0xaae1f6,_0x1bfbf7),this['children']=this['createCollection'](),this['children']['addMany']([this['titleLabelView'],this['toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__title']},'children':this['children']}),this['on']('change:state',(_0x313f7a,_0x311856,_0xfd3bd2,_0x591bd3)=>{'pending'===_0x591bd3?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0xfd3bd2?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0xfd3bd2),this['children']['add'](this['stateView']));});}}class Sn extends _0x25f6b6{constructor(_0x4eb281,_0x3c6f6d){super(_0x4eb281),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[i(_0x4eb281,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x3c6f6d['toString']())]});}}class as extends _0x25f6b6{['htmlStreamer'];constructor(_0x4a3585){super(_0x4a3585),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async['update']({part:_0x7cdd7d,renderingStrategy:_0x4d3550,abortSignal:_0x615259}){'streaming'===_0x4d3550?await this['htmlStreamer']['stream']({'document':_0x7cdd7d['content'],'targetElement':this['element'],'abortSignal':_0x615259}):this['element']['innerHTML']=Tt(_0x7cdd7d['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class na extends _0x25f6b6{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x350de4,{part:_0x33b583,uiIndex:_0x19cf30,areActionsDisabled:_0x540f4d,availableActions:_0x12733c}){super(_0x350de4);const _0x287a1c=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x2b5a06=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x540f4d;};this['on']('change:state',_0x2b5a06),this['on']('change:isDone',_0x2b5a06),_0x2b5a06(),this['_children']=this['createCollection'](),this['_headerView']=new vn(_0x350de4,{'part':_0x33b583,'uiIndex':_0x19cf30,'availableActions':_0x12733c,'areActionsDisabled':_0x540f4d}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...ut)['to'](this),this['_streamableContentView']=new as(_0x350de4),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x287a1c['to']('state',_0x2b5c6e=>'ck-ai-suggestion__body__content-part_'+_0x2b5c6e),_0x287a1c['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x287a1c['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x287a1c['if']('isVisible','ck-hidden',_0x41e8ae=>!_0x41e8ae)]},'children':this['_children'],'on':{'mouseenter':_0x287a1c['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x33b583['index']});}),'mouseleave':_0x287a1c['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x33b583['index']});}),'click':_0x287a1c['to'](_0x4aabed=>{const _0xe1d14e=_0x4aabed['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0xe1d14e)&&this['fire']('showChangeInText',{'index':_0x33b583['index']});})}});}async['updateContent']({part:_0x1e752c,renderingStrategy:_0x45a83d,showUnchangedParts:_0x3bd080=!0x1,abortSignal:_0x2c28de}){this['partDefinition']=_0x1e752c,this['isVisible']=this['partDefinition']['hasChanges']||_0x3bd080,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x1e752c,'renderingStrategy':_0x45a83d,'abortSignal':_0x2c28de});}['markAsDone'](){this['isDone']=!0x0;}}class z extends _0x12cec9(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x1aab25){const _0x32b157=this['createTask'](_0x1aab25);return this['queue']['push'](_0x32b157),this['_processQueue'](),_0x32b157['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(_0x498575=>{this['once']('_queueEmpty',()=>{_0x498575();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x3e87bf=this['queue']['shift']();try{await _0x3e87bf['callback'](this['_abortController']['signal']),_0x3e87bf['resolve']();}catch(_0x40c9a3){_0x3e87bf['reject'](_0x40c9a3);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x31ad94){let _0x5d6e4a,_0x372c19;const _0x343ad1=new Promise((_0x40cdee,_0x53ce3a)=>{_0x5d6e4a=_0x40cdee,_0x372c19=_0x53ce3a;});return{'callback':_0x31ad94,'resolve':_0x5d6e4a,'reject':_0x372c19,'completePromise':_0x343ad1};}}class Ze extends Fr{constructor(_0x1ddb0d){super(_0x1ddb0d),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x1ddb0d['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x5276a4){this['element']['innerHTML']=_0x5276a4;}}const ot=['applySuggestion','insertSuggestion'];class ra extends _0x25f6b6{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x1a4c48,_0x3b9475=[...ot],_0x2feda4){super(_0x1a4c48);const _0x5bd814=this['bindTemplate'],_0x1dffe6=Boolean(_0x2feda4);if(this['set']('isEnabled',!_0x1dffe6),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x1dffe6){const _0x571341=new _0x28db64(_0x1a4c48);_0x571341['set']({'label':i(_0x1a4c48,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x3f0ea0});const _0x4cf67e=new _0x25f6b6(_0x1a4c48);_0x4cf67e['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[i(_0x1a4c48,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x571341]}]}),this['children']['add'](_0x4cf67e);}else this['_applyChangesButton']=new _0x28db64(_0x1a4c48),this['_applyChangesButton']['set']({'label':i(_0x1a4c48,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x3b9475['includes']('applySuggestion'),'class':'ck-ai-button-primary'}),this['_insertSuggestionsButton']=new _0x28db64(_0x1a4c48),this['_insertSuggestionsButton']['set']({'label':i(_0x1a4c48,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x3b9475['includes']('insertSuggestion'),'class':'ck-ai-button-secondary'}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x4ec54c=>{_0x4ec54c['bind']('isEnabled')['to'](this);}),this['children']['addMany']([this['_applyChangesButton'],this['_insertSuggestionsButton']]);this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x5bd814['if']('isVisible','ck-hidden',_0x47e1ce=>!_0x47e1ce)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x5cca87){this['isVisible']=_0x5cca87;}['_switchButtonLabelsPlurality'](_0xef54f4){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0xef54f4?(this['_applyChangesButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class Sr extends _0x25f6b6{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0xac6d0b,_0x2ed856){super(_0xac6d0b),this['bodyCollection']=_0x2ed856,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',_0x2fac3c=>!_0x2fac3c)]},'children':this['children']});const _0x216bd7=new _0x25f6b6(this['locale']),_0x49da72=new _0x283d41();_0x49da72['content']=_0x395f9,_0x216bd7['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x49da72,{'tag':'span','children':[{'text':i(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x216bd7),this['_setupBalloonPanel'](_0xac6d0b);}['addSource'](_0x3b098f){this['children']['add'](new qr(this['locale'],_0x3b098f,this['balloonPanelView']));}['_setupBalloonPanel'](_0xbd27a5){this['balloonPanelView']=new _0x132eb0(_0xbd27a5),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class qr extends _0x28db64{['balloonPanelView'];['source'];constructor(_0x30c4b2,_0x33a5aa,_0x31567e){super(_0x30c4b2),this['source']=_0x33a5aa,this['balloonPanelView']=_0x31567e,this['set']({'label':_0x33a5aa['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x55236e=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x55236e['to'](()=>{window['open'](_0x33a5aa['url'],'_blank');}),'mouseenter':_0x55236e['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x55236e['to'](()=>{this['_hideTooltip']();})}}),_0x33a5aa['favicon']){const _0x4887fe=new _0x25f6b6(_0x30c4b2);_0x4887fe['setTemplate']({'tag':'img','attributes':{'src':_0x33a5aa['favicon']||_0x395f9,'alt':_0x33a5aa['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x4887fe);}else this['set']('icon',_0x395f9);}['_createTooltipContentView'](_0x321565,_0x3feb70){const _0x209639=new _0x25f6b6(_0x321565),_0xc1f475=[];let _0x210680;_0x3feb70?.['favicon']?(_0x210680=new _0x25f6b6(_0x321565),_0x210680['setTemplate']({'tag':'img','attributes':{'src':_0x3feb70['favicon'],'alt':_0x3feb70['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x210680=new _0x283d41(),_0x210680['content']=_0x395f9,_0x210680['extendTemplate']({'attributes':{'alt':_0x3feb70['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0xc1f475['push'](_0x210680);const _0x227307=new _0x25f6b6(_0x321565);_0x227307['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x3feb70['url']},'children':[{'text':new URL(_0x3feb70['url'])?.['hostname']}]}),_0xc1f475['push'](_0x227307);const _0xcba21=new _0x25f6b6(_0x321565);_0xcba21['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0xc1f475});const _0x4c17d0=new _0x25f6b6(_0x321565);return _0x4c17d0['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x3feb70['title']['length']>0x190?_0x3feb70['title']['substring'](0x0,0x190)+'...':_0x3feb70['title']}]}),_0x209639['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0xcba21,_0x4c17d0]}),_0x209639;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[_0x132eb0['defaultPositions']['northArrowSouth'],_0x132eb0['defaultPositions']['northArrowSouthWest'],_0x132eb0['defaultPositions']['northArrowSouthEast']],'limiter':document['querySelector']('.ck-ai-chat')}),this['balloonPanelView']['show']();}['_hideTooltip'](){this['balloonPanelView']['hide']();}['_updateTooltipContent'](){this['balloonPanelView']['content']['get'](0x0)?.['destroy'](),this['balloonPanelView']['content']['clear']();const _0x390e53=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x390e53);}}class ca extends _0x25f6b6{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x14541a,_0x433c60){super(_0x14541a);const {areActionsDisabled:_0x5dadb9,showUnchangedParts:_0x22c87e,availableActions:_0x10ca8f}=_0x433c60;this['_areActionsDisabled']=_0x5dadb9,this['_showUnchangedParts']=_0x22c87e,this['_availableActions']=_0x10ca8f,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new z(),this['_emptyPartsWarningView']=new Ze({'id':'empty-parts-warning','initialContent':i(_0x14541a,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new ra(_0x14541a,_0x433c60['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sr(this['locale'],_0x433c60['bodyCollection']),_0x433c60['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...ut)['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView'],this['_actionsView'],this['_sourcesView']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0x4cf1be,renderingStrategy:_0x5fae10,abortSignal:_0x8a7099}){this['_children']['length']?_0x4cf1be['forEach'](_0x2ae06f=>{const _0x4b3d50=this['_cachedContentParts']['findIndex'](_0x12db8c=>_0x12db8c['index']==_0x2ae06f['index']);-0x1===_0x4b3d50?this['_cachedContentParts']['push'](_0x2ae06f):this['_cachedContentParts'][_0x4b3d50]=_0x2ae06f;}):this['_cachedContentParts']=_0x4cf1be;const _0x1f5fa1=this['_showUnchangedParts']?_0x4cf1be:_0x4cf1be['filter'](_0x3ff453=>_0x3ff453['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x1f5fa1['length']>0x1);for(const _0x5895d2 of _0x1f5fa1)this['_updateContentPartsPromiseQueue']['enqueue'](async _0xc22f57=>{let _0x3f651a=this['getPartView'](_0x5895d2['index']);_0x3f651a||(_0x3f651a=new na(this['locale'],{'part':_0x5895d2,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x3f651a['delegate'](...ut)['to'](this),this['_children']['add'](_0x3f651a),this['hasPendingParts']=!0x0),await _0x3f651a['updateContent']({'part':_0x5895d2,'renderingStrategy':_0x5fae10,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0xc22f57}),_0x3f651a['markAsDone']();});return _0x8a7099?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x14738f,_0x25ce5d){const _0x223b5a=this['getPartView'](_0x14738f);_0x223b5a&&(_0x223b5a['state']=_0x25ce5d),this['hasPendingParts']='pending'==_0x25ce5d||Array['from'](this['_children'])['some'](_0x355a39=>'pending'==_0x355a39['state']);}['setPartActive'](_0x3e9ef8,_0x3d7990){if(!0x1===_0x3e9ef8){for(const _0x596c51 of this['_children'])_0x596c51['isActive']=!0x1;}else{const _0x4c660a=this['getPartView'](_0x3e9ef8);_0x4c660a&&(_0x4c660a['isActive']=_0x3d7990);}}['updateSources'](_0x262fb3){_0x262fb3['forEach'](_0x41dfcd=>this['_sourcesView']['addSource'](_0x41dfcd)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x273b9f){return this['_children']['find'](_0x4db11e=>_0x4db11e['partDefinition']['index']==_0x273b9f)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x50ec1d=!this['_cachedContentParts']['find'](({hasChanges:_0x4e74da})=>_0x4e74da),_0x22a789=!!this['_cachedContentParts']['find'](({hasChanges:_0x7c6104})=>!_0x7c6104);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x22a789,_0x50ec1d?this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_children']['forEach'](_0xd379c7=>_0xd379c7['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0x366455=>_0x366455['partDefinition']['hasChanges'])['length']>0x0;}}class gn extends _0x25f6b6{['bodyView'];['children'];['headerView'];constructor(_0xe33528,_0x203bfa,_0x502cdb){super(_0xe33528);const {showDiff:_0x48fdfe,areActionsDisabled:_0x3550aa,showUnchangedParts:_0x3fe4e3,availableActions:_0x2d12e0}=_0x203bfa;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new oa(_0xe33528,{'showDiff':_0x48fdfe}),this['headerView']['on']('toggleShowChanges',(_0x993703,_0x438b8e)=>{this['areChangesVisible']=_0x438b8e['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x438b8e['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new ca(_0xe33528,{'areActionsDisabled':_0x3550aa,'showUnchangedParts':!!_0x3fe4e3,'availableActions':_0x2d12e0,'bodyCollection':_0x502cdb}),this['bodyView']['delegate'](...ut)['to'](this),this['bodyView']['bind']('isTrackChangesOn')['to'](this),this['children']['add'](this['bodyView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x4ef035){await this['bodyView']['updateContentParts'](_0x4ef035);}['updateSources'](_0x16af72){this['bodyView']['updateSources'](_0x16af72);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Qe extends Fr{['containerView'];constructor(_0x437c10,_0x269b3e,_0x4ef66d){super(_0x269b3e),this['set']('isTrackChangesOn',!0x1),this['containerView']=new gn(_0x437c10,{'showDiff':_0x269b3e['showDiff'],'areActionsDisabled':_0x269b3e['areActionsDisabled'],'availableActions':_0x269b3e['availableActions']},_0x4ef66d),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x5f0738,_0xd0f9ac)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0xd0f9ac['showDiff']});}),this['containerView']['bind']('isTrackChangesOn')['to'](this),this['containerView']['on']('like',()=>{this['fire']('like',{'replyId':this['options']['id']});}),this['containerView']['on']('dislike',()=>{this['fire']('dislike',{'replyId':this['options']['id']});}),this['containerView']['on']('showChangeInText',(_0x2acd41,{index:_0x395cad})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x395cad});}),this['containerView']['on']('applySuggestion',(_0x6e62e7,{index:_0x4770c7}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x4770c7});}),this['containerView']['on']('insertSuggestion',(_0x52b0e8,{index:_0x47de3e}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x47de3e});}),this['containerView']['on']('rejectSuggestion',(_0x6c1c62,{index:_0x40fa49})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x40fa49});}),this['containerView']['on']('mouseOverSuggestion',(_0x2e4fd9,{index:_0x5149f5})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x5149f5});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x2b5af1,{index:_0x473328})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x473328});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x1ce9b2){await this['containerView']['updateContent'](_0x1ce9b2);}['updatePartState'](_0x8e89bd,_0x21f59e){this['containerView']['bodyView']['updatePartState'](_0x8e89bd,_0x21f59e);}['setPartActive'](_0x1adae4,_0x3e6315){!0x1===_0x1adae4?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x1adae4,_0x3e6315);}['updateSources'](_0x1a6336){this['containerView']['updateSources'](_0x1a6336);}['getPartView'](_0x5c469d){return this['containerView']['bodyView']['getPartView'](_0x5c469d);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class Xe extends Fr{['replyContainer'];['_bodyCollection'];constructor(_0x3c6fbe,_0x52e212,_0x1afce1){super(_0x52e212),this['_bodyCollection']=_0x1afce1,this['locale']=_0x3c6fbe,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x25f6b6(),this['replyContainer']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-chat__feed__ai-reply-container']}}),this['children']['add'](this['replyContainer']);}async['render'](){super['render'](),this['options']['initialContent']&&(await this['updateContent']({'parsedContent':ji(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x53f030,renderingStrategy:_0x12e9a9,abortSignal:_0x3385cd}){'streaming'===_0x12e9a9?await this['streamIntoElement'](_0x53f030,this['replyContainer']['element'],_0x3385cd):this['replyContainer']['element']['innerHTML']=_0x3d00aa(_0x53f030);}['updateSources'](_0x551a96){const _0x18e5e0=new Sr(this['locale'],this['_bodyCollection']);_0x18e5e0['children']['addMany'](_0x551a96['map'](_0x1c072d=>new qr(this['locale'],_0x1c072d,_0x18e5e0['balloonPanelView']))),_0x18e5e0['isVisible']=!0x0,this['children']['add'](_0x18e5e0);}}class li extends _0x39a237{constructor(_0x15d176=void 0x0){super();const _0x291c80=_0x15d176?'ck-ai-spinner_'+_0x15d176:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x291c80]}});}}const xn={'file':_0x4f5d8d,'document':_0x5e59e8,'web-resource':_0x11a450,'text':_0x4f5d8d,'selection':_0x50d8ea,'mcp-tool-context':_0x5e59e8},Ur='ck-ai-chat-context-chip',Wr='ck-ai-chat-context-chip_wide',Yr='ck-ai-chat-context-chip_document',$r='ck-ai-chat-context-chip__label',Qr='ck-ai-chat-context-chip__type-icon',Xr='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class Vo extends _0x28db64{constructor(_0x45a95a,_0x2a2325,_0x4b920f,_0x363ffc,_0x51308c=!0x1){super(_0x45a95a),this['_isAnimationOnEnterEnabled']=_0x363ffc,this['_initializeProperties'](_0x2a2325,_0x4b920f,_0x51308c),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'](_0x339872,_0x4b294b,_0xd9091){this['set']('label',_0x339872['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x339872['type']),this['set']('id',_0x339872['uiId']),this['set']('readonly',_0x4b294b),this['set']('isLoading',_0xd9091);}['_setupTemplate'](){const _0x4dfad1=this['_createIconView'](),_0x2e242b=this['_createRemoveButton'](),_0xe4baf9=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0xe4baf9),'children':this['_createTemplateChildren'](_0x4dfad1,_0x2e242b,_0xe4baf9)});}['_createTemplateAttributes'](_0x8e518b){return{'class':[Ur,_0x8e518b['if']('itemType',Yr,_0x31e5ec=>'document'==_0x31e5ec),_0x8e518b['if']('itemType',Wr,_0x5b4483=>'selection'==_0x5b4483)],'data-cke-tooltip-text':_0x8e518b['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':Xr};}['_createTemplateChildren'](_0x88d8ad,_0x23d2ca,_0x52a7bd){const _0x22ceec=this['_createLabelElement'](_0x52a7bd),_0x152f38=this['_createLoaderIcon']();return this['readonly']?[_0x88d8ad,_0x22ceec]:[_0x88d8ad,_0x152f38,_0x22ceec,_0x23d2ca];}['_createLabelElement'](_0x4fd707){return{'tag':'span','attributes':{'class':$r},'children':[{'text':_0x4fd707['to']('label')}]};}['_createRemoveButton'](){const _0x448de3=new _0x28db64(this['locale']);return _0x448de3['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x373232}),this['_setupRemoveButtonEvent'](_0x448de3),_0x448de3;}['_setupRemoveButtonEvent'](_0x471836){_0x471836['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x27c352=this['bindTemplate'],_0x43f50a=new _0x283d41();return _0x43f50a['content']=xn[this['itemType']],_0x43f50a['extendTemplate']({'attributes':{'class':[Qr,_0x27c352['if']('isLoading','ck-hidden',_0x5325e3=>_0x5325e3)]}}),_0x43f50a;}['_handleAnimationEndOnce'](_0x593df1,_0x47cc66){if(!_0x593df1)return;const _0x45317c=()=>{_0x47cc66(),_0x593df1['removeEventListener']('animationend',_0x45317c),_0x593df1['removeEventListener']('webkitAnimationEnd',_0x45317c);};_0x593df1['addEventListener']('animationend',_0x45317c),_0x593df1['addEventListener']('webkitAnimationEnd',_0x45317c);}['_createLoaderIcon'](){const _0x4e8c20=new li('small');return _0x4e8c20['bind']('isVisible')['to'](this,'isLoading',_0x2b1072=>_0x2b1072),_0x4e8c20;}}function In(_0x3c98a5){if(!_0x3c98a5)return _0x3c98a5;if(_0x3c98a5['length']<=0x78)return _0x3c98a5;const _0x1b55cb=_0x3c98a5['slice'](0x0,0x78),_0x460a63=_0x1b55cb['lastIndexOf']('\x20');return(_0x460a63>0x0?_0x1b55cb['slice'](0x0,_0x460a63):_0x1b55cb)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},an='300px';class Ro{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x5ac619,_0x1dac79,_0x2e37e3,_0x5b3d24,_0x522029){this['_locale']=_0x5ac619,this['_visibleChips']=_0x1dac79,this['_config']={...hn,..._0x2e37e3,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x2e37e3['cssClasses']}},this['_overflowChips']=new _0x207453(),this['_bodyCollection']=_0x5b3d24,this['_parentView']=_0x522029||null;}['setContainerElement'](_0x2fac0f){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x2fac0f,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 _0x2f680c=[...this['_visibleChips'],...this['_overflowChips']],_0x240b2e=this['_createCalculationContainer'](),_0xb83d2=this['_calculateOverflowInContainer'](_0x240b2e,_0x2f680c),_0x39954e=_0x240b2e['_ancestorsToRestore'];_0x39954e&&this['_restoreAncestorVisibility'](_0x39954e),_0x240b2e['remove'](),this['_applyOverflowResults'](_0x2f680c,_0xb83d2);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x13f50b({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x2f5f57=new _0x28db64(this['_locale']);_0x2f5f57['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x196913=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x196913['push'](this['_config']['cssClasses']['controlsButton']),_0x2f5f57['extendTemplate']({'attributes':{'class':_0x196913}}),_0x2f5f57;}['_createShowMoreBalloonPanelView'](){const _0x34611b=new _0x132eb0(this['_locale']);return _0x34611b['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x34611b),_0x34611b;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x44632c=>{_0x44632c['disableAnimationOnEnter']();});const _0x350dbd=new _0x25f6b6(this['_locale']);_0x350dbd['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x350dbd);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x1ea107=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x1ea107?'':'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'](_0x3350d5){const _0x51730c=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x33abd6=this['_containerElement']?.['classList'];if(_0x33abd6){const _0x55d2bb=_0x33abd6[0x0]||'',_0x5de2cc=_0x3350d5['querySelector']('.'+_0x55d2bb),_0x5220ff=_0x3350d5['querySelector'](_0x51730c);return _0x5de2cc||_0x5220ff||_0x3350d5;}return _0x3350d5['querySelector'](_0x51730c)||_0x3350d5;}['_calculateContainerWidth'](){const _0x291763=this['_parentView']?.['element']||this['_containerElement'];if(!_0x291763)return an;const _0x511225=window['getComputedStyle'](_0x291763)['width'];if('auto'===_0x511225||'0px'===_0x511225||!_0x511225){const _0x2a60cb=_0x291763['parentElement'];if(_0x2a60cb){const _0x32ab54=window['getComputedStyle'](_0x2a60cb);return'auto'!==_0x32ab54['width']?_0x32ab54['width']:an;}return an;}return _0x511225;}['_applyCalculationStyles'](_0x189cc5,_0x356b2d){this['_config']['cssClasses']['calculationContainer']&&_0x189cc5['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x189cc5['style']['width']=_0x356b2d,_0x189cc5['style']['position']='absolute',_0x189cc5['style']['top']='-9999px',_0x189cc5['style']['left']='-9999px',_0x189cc5['style']['opacity']='0',_0x189cc5['style']['pointerEvents']='none',_0x189cc5['style']['zIndex']='-1',_0x189cc5['style']['visibility']='visible\x20!important',_0x189cc5['style']['display']='block\x20!important',_0x189cc5['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x571100){_0x571100['forEach'](({element:_0x38a73a,originalDisplay:_0x3ee310,originalVisibility:_0x36385c})=>{_0x38a73a['style']['display']=_0x3ee310,_0x38a73a['style']['visibility']=_0x36385c;});}['_makeAncestorsVisible'](_0x10fc48){const _0x21f9e3=[];let _0x497c5f=_0x10fc48;for(;_0x497c5f&&_0x497c5f!==document['body'];){const _0x550d43=window['getComputedStyle'](_0x497c5f);'none'!==_0x550d43['display']&&'hidden'!==_0x550d43['visibility']||(_0x21f9e3['push']({'element':_0x497c5f,'originalDisplay':_0x497c5f['style']['display'],'originalVisibility':_0x497c5f['style']['visibility']}),_0x497c5f['style']['display']='block',_0x497c5f['style']['visibility']='visible'),_0x497c5f=_0x497c5f['parentElement'];}return _0x21f9e3;}['_createContainerElements'](){let _0x108353,_0x281cba;return this['_parentView']?.['element']?(_0x108353=this['_parentView']['element']['cloneNode'](!0x0),_0x281cba=this['_findTargetContainer'](_0x108353)):(_0x108353=document['createElement']('div'),_0x281cba=_0x108353),{'calculationContainer':_0x108353,'targetContainer':_0x281cba};}['_createCalculationContainer'](){const {calculationContainer:_0x917a97,targetContainer:_0x342a55}=this['_createContainerElements'](),_0x3d707=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x917a97,_0x3d707);const _0x557296=this['_parentView']?.['element']||this['_containerElement'],_0x4e9a63=_0x557296?.['parentElement'];_0x4e9a63?_0x4e9a63['appendChild'](_0x917a97):document['body']['appendChild'](_0x917a97),_0x917a97['_targetContainer']=_0x342a55;const _0x2ff06f=this['_makeAncestorsVisible'](_0x4e9a63||null);return _0x917a97['offsetWidth'],_0x917a97['_ancestorsToRestore']=_0x2ff06f,_0x917a97;}['_calculateOverflowInContainer'](_0x32c7d9,_0x5b838d){const _0x18f1b2=_0x32c7d9['_targetContainer']||_0x32c7d9,_0x1c1b0a=[],{rowCount:_0x1dcd0e}=this['_renderChipsAndCountRows'](_0x18f1b2,_0x5b838d);if(_0x1dcd0e<=this['_config']['maxVisibleRows'])return _0x1c1b0a;const _0x4acf81=_0x5b838d['slice']();for(;_0x4acf81['length']>0x0;){if(this['_testButtonFit'](_0x32c7d9,_0x18f1b2,_0x4acf81)){const _0x57cddc=_0x5b838d['filter'](_0x314857=>!_0x4acf81['includes'](_0x314857));_0x1c1b0a['push'](..._0x57cddc);break;}if(!_0x4acf81['pop']())break;}return _0x1c1b0a;}['_renderChipsAndCountRows'](_0x323c55,_0x41a4be){_0x323c55['innerHTML']='',_0x41a4be['forEach'](_0x556a6c=>{if(_0x556a6c['element']){const _0x287853=_0x556a6c['element']['cloneNode'](!0x0);_0x323c55['appendChild'](_0x287853);}}),_0x323c55['offsetWidth'];const _0x1f789b=_0x323c55['children'],_0x309164=[];return Array['from'](_0x1f789b)['forEach'](_0x2aea87=>{const _0x338327=_0x2aea87['getBoundingClientRect']()['top'];_0x309164['some'](_0x40238e=>Math['abs'](_0x40238e-_0x338327)<this['_config']['rowDetectionTolerance'])||_0x309164['push'](_0x338327);}),{'rowCount':_0x309164['length']};}['_createMockButton'](){const _0x37e97d=document['createElement']('button');return _0x37e97d['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x37e97d['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x37e97d['textContent']='+\x201',_0x37e97d;}['_testButtonFit'](_0x8ba7cc,_0x218c46,_0x523f5e){this['_renderChipsAndCountRows'](_0x218c46,_0x523f5e);const _0x20845f=this['_createMockButton']();_0x8ba7cc['appendChild'](_0x20845f),_0x8ba7cc['offsetWidth'];const _0x5bab2a=[..._0x218c46['children'],_0x20845f],_0x24fc38=[];_0x5bab2a['forEach'](_0x20bc85=>{const _0x58690c=_0x20bc85['getBoundingClientRect']()['top'];_0x24fc38['some'](_0x715887=>Math['abs'](_0x715887-_0x58690c)<this['_config']['rowDetectionTolerance'])||_0x24fc38['push'](_0x58690c);});const _0x94db5=_0x24fc38['length'];return _0x20845f['remove'](),_0x94db5<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x27e4bd,_0x1af197){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x27e4bd['forEach'](_0x4ea36a=>{_0x1af197['includes'](_0x4ea36a)?this['_overflowChips']['add'](_0x4ea36a):this['_visibleChips']['add'](_0x4ea36a);});}['_updateOverflowUI'](_0x52cfd2){if(_0x52cfd2>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x52cfd2>0x0&&this['_showMoreButtonView']){const _0x226b54=''+this['_config']['showMoreLabelPrefix']+(_0x52cfd2<0x63?_0x52cfd2:'99');this['_showMoreButtonView']['label']=_0x226b54;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x1158b8,_0x370ece){this['_distributeChips'](_0x1158b8,_0x370ece),this['_updateOverflowUI'](_0x370ece['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x38e631=>{_0x38e631[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 _0x514b3c=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x514b3c['width']||0x0===_0x514b3c['height'])return!0x1;const _0x25c81c=window['innerHeight']||document['documentElement']['clientHeight'],_0x141a02=window['innerWidth']||document['documentElement']['clientWidth'],_0x40d33e=0xc8;return _0x514b3c['bottom']>=-0xc8&&_0x514b3c['top']<=_0x25c81c+_0x40d33e&&_0x514b3c['right']>=-0xc8&&_0x514b3c['left']<=_0x141a02+_0x40d33e;}}const Zr='ck-ai-chat__feed__context-chips',la='ck-ai-chat-context-chips-wrapper',ua='ck-ai-chat-context-chips-wrapper-balloon',da='ck-ai-chat-controls-button',_a='ck-ai-chat-controls_context_show-more-button',Aa='ck-ai-chat-context-controls__show-more-balloon-panel';class _h extends _0x25f6b6{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x5bf65a,_0xe9df76,_0x13fe22){super(_0x5bf65a),this['_bodyCollection']=_0x13fe22,this['_createContextChips'](_0xe9df76);const _0x28e196={'cssClasses':{'showMoreButton':_a,'showMoreBalloon':Aa,'overflowContainer':ua,'controlsButton':da}};this['_overflowManager']=new Ro(_0x5bf65a,this['_contextChips'],_0x28e196,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Zr,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':la},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x53d60e=this['element']['querySelector']('.'+la);_0x53d60e&&(this['_overflowManager']['setContainerElement'](_0x53d60e),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x521051){for(const _0x52aff7 of _0x521051){const _0x4ad9ab=new Vo(this['locale'],_0x52aff7,!0x0,!0x1);this['_contextChips']['add'](_0x4ad9ab);}}}class Ye extends Fr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x5b06e2,_0x2ce75b,_0x207675){super(_0x2ce75b),this['_locale']=_0x5b06e2,this['_bodyCollection']=_0x207675,this['_createContextChipsView'](),this['_createMessageContentView'](),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__user-message']}});}['_createContextChipsView'](){this['options']['contextItems']&&this['options']['contextItems']['length']>0x0&&(this['_contextChipsView']=new _h(this['_locale'],this['options']['contextItems']['filter'](_0x142ead=>!_0x142ead['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x25f6b6(this['_locale']),this['_messageContentView']['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__message-content'}}),this['children']['add'](this['_messageContentView']);}['render'](){super['render'](),this['_messageContentView']['element']['innerHTML']=this['options']['initialContent'],this['markAsDone']();}}class Mt extends Fr{['capabilities'];constructor(_0x4698d4,_0x1237c5){super(_0x1237c5);const {isWebSearchEnabled:_0x504bdd,isReasoningEnabled:_0x477bb8}=_0x1237c5['capabilities'],_0x4fd955=[];let _0x3f1c41='';_0x504bdd&&_0x477bb8?(_0x3f1c41=i(_0x4698d4,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x4fd955['push'](aa(_0x395f9)),_0x4fd955['push'](aa(_0x6f2f23))):_0x504bdd?(_0x3f1c41=i(_0x4698d4,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x4fd955['push'](aa(_0x395f9))):_0x477bb8&&(_0x3f1c41=i(_0x4698d4,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x4fd955['push'](aa(_0x6f2f23))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x3f1c41?'':'ck-hidden']}});const _0xd433da=new _0x25f6b6();_0xd433da['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x4fd955,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x3f1c41]}]}),this['children']['add'](_0xd433da),this['capabilities']=_0x1237c5['capabilities'];}}function aa(_0x2b47e6){const _0x5efa3b=new _0x283d41();return _0x5efa3b['content']=_0x2b47e6,_0x5efa3b;}const Fs=['wheel','touchstart','pointerdown','keydown'],Us=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class $e{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x55be1e){this['element']=_0x55be1e,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x1b216e of Fs){const _0x13e60b='keydown'!==_0x1b216e;this['element']['addEventListener'](_0x1b216e,this['_onUserEvent']['bind'](this),{'passive':_0x13e60b,'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'](_0x12578f){if(this['isRunning']){if('keydown'===_0x12578f['type']){const _0x1134b6=_0x12578f['key'];if(!Us['includes'](_0x1134b6))return;}_0x12578f instanceof WheelEvent?_0x12578f['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0xcead31,scrollHeight:_0x4719b8,clientHeight:_0x2a0b7c}=this['element'];return _0x4719b8-_0xcead31-_0x2a0b7c<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class ai extends _0x25f6b6{constructor(_0x1c395f,_0x1d4f9a){super(_0x1c395f),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x1d4f9a)});}['_createSkeletonItems'](_0x3abdbb){const _0x2e023c=['ck','ck-ai-skeleton__item'];return _0x3abdbb['map'](_0x256d4b=>{let _0xfb342c='';switch(_0x256d4b['attributes']['align']){case'right':_0xfb342c='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0xfb342c='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0xfb342c='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x256d4b['tag'],'attributes':{'class':[..._0x2e023c,_0x256d4b['attributes']['class']?_0x256d4b['attributes']['class']:''],'style':'width:\x20'+_0x256d4b['attributes']['width']+';\x20height:\x20'+_0x256d4b['attributes']['height']+';'+_0xfb342c}};});}}const di={'aiFeed':[{'tag':'div','attributes':{'width':'100%','height':'72px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}},{'tag':'div','attributes':{'width':'150px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'140px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}}],'aiHistory':ta(0x5,'100%','44px','right'),'aiChatResources':ta(0x8,'100%','24px','right'),'aiReviewChecks':[{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}}]};function ta(_0xafe557,_0x44f616,_0x1858ef,_0x5a7b80){return new Array(_0xafe557)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x44f616,'height':_0x1858ef,'align':_0x5a7b80}}));}class mi extends Fr{constructor(_0x34e17c){super(_0x34e17c),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__custom-element']}});}async['render'](){super['render'](),'string'==typeof this['options']['content']?this['element']['innerHTML']=this['options']['content']:this['element']['appendChild'](this['options']['content']);}}class ui extends _0x25f6b6{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x4b6ce1,_0xe489d3){super(_0x4b6ce1),this['_bodyCollection']=_0xe489d3,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...bt)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new $e(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x3bd5bd,_0x489d5e){let _0x53c0be;return'ai-reply'===_0x3bd5bd?_0x53c0be=new Xe(this['locale'],_0x489d5e,this['_bodyCollection']):'ai-suggestion-reply'===_0x3bd5bd?(_0x53c0be=new Qe(this['locale'],_0x489d5e,this['_bodyCollection']),_0x53c0be['bind']('isTrackChangesOn')['to'](this)):_0x53c0be='user-message'===_0x3bd5bd?new Ye(this['locale'],_0x489d5e,this['_bodyCollection']):'interaction-header'===_0x3bd5bd?new Mt(this['locale'],_0x489d5e):'custom-element'===_0x3bd5bd?new mi(_0x489d5e):new Ze(_0x489d5e),this['children']['add'](_0x53c0be),_0x53c0be;}async['updateReplyItem']({id:_0x39aa7e,parsedContent:_0x3eaef1,renderingStrategy:_0x42f5eb,abortSignal:_0x5081cb}){const _0x5cef64=this['getItemById'](_0x39aa7e);if(!(_0x5cef64 instanceof Xe))throw new _0x54686c('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x5cef64,'id':_0x39aa7e,'parsedContent':_0x3eaef1});await _0x5cef64['updateContent']({'parsedContent':_0x3eaef1,'renderingStrategy':_0x42f5eb,'abortSignal':_0x5081cb});}async['updateWebSources'](_0x2cfd0b,_0x2341bf){const _0x139e37=this['getItemById'](_0x2cfd0b);if(_0x139e37 instanceof Qe)_0x139e37['updateSources'](_0x2341bf);else{if(!(_0x139e37 instanceof Xe))throw new _0x54686c('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x139e37,'id':_0x2cfd0b,'sources':_0x2341bf});_0x139e37['updateSources'](_0x2341bf);}}async['updateSuggestionItem']({id:_0x54e6c6,parts:_0x2e6225,renderingStrategy:_0xed7334,abortSignal:_0x1dbea0}){const _0x1d99db=this['getItemById'](_0x54e6c6);if(!(_0x1d99db instanceof Qe))throw new _0x54686c('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x1d99db,'id':_0x54e6c6,'parts':_0x2e6225});await _0x1d99db['updateContent']({'parts':_0x2e6225,'renderingStrategy':_0xed7334,'abortSignal':_0x1dbea0});}['updateSuggestionPartState']({id:_0x5f500d,index:_0x1ea419,state:_0x5e68e8}){const _0xf13b02=this['getItemById'](_0x5f500d);if(!(_0xf13b02 instanceof Qe))throw new _0x54686c('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x5f500d});_0xf13b02['updatePartState'](_0x1ea419,_0x5e68e8);}['setSuggestionPartActive']({id:_0x239fa8,index:_0x4754ea,isActive:_0x678e23}){const _0x5a8ec5=this['getItemById'](_0x239fa8);if(!(_0x5a8ec5 instanceof Qe))throw new _0x54686c('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x239fa8});this['children']['filter'](_0x50ca3d=>_0x50ca3d instanceof Qe)['forEach'](_0x13c529=>{_0x13c529['setPartActive'](!0x1);}),_0x5a8ec5['setPartActive'](_0x4754ea,_0x678e23);}['markItemAsDone'](_0x53ba3d){this['getItemById'](_0x53ba3d)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x305e7c=>_0x305e7c['options']['id']);}['removeItem'](_0x1a05ba){this['children']['remove'](this['getItemById'](_0x1a05ba));}['hasItem'](_0x267960){return!!this['children']['find'](_0x557aa4=>_0x557aa4['options']['id']['includes'](_0x267960));}['scrollToSuggestion'](_0x207d74,_0x35bae8){const _0x4f98dc=this['getItemById'](_0x207d74);if(!(_0x4f98dc instanceof Qe))return void _0x73e170('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x207d74,'partIndex':_0x35bae8});const _0x5bcb29=_0x4f98dc['getPartView'](_0x35bae8);_0x5bcb29?_0x59e8aa(_0x5bcb29['element'],0x14,this['element']['parentElement'],!0x0,!0x0):_0x73e170('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x207d74,'partIndex':_0x35bae8});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x20222c=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x20222c,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x462cd4=new ai(this['locale'],di['aiFeed']);return _0x462cd4['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x8d4014=>!_0x8d4014)]}}),_0x462cd4;}['_createFeedItems'](){const _0xf00db=new _0x25f6b6(this['locale']);return _0xf00db['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0xf00db;}['_createFeedLoader'](){const _0x39b51c=new _0x25f6b6(this['locale']);return _0x39b51c['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x12140d=>!_0x12140d)]},'children':this['_createLoaderChildren']()}),_0x39b51c;}['_createLoaderChildren'](){const _0x5983e3=new li();return _0x5983e3['isVisible']=!0x0,[_0x5983e3,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x22c284){const _0x46202c=this['children']['find'](_0x476bf3=>_0x476bf3['options']['id']['includes'](_0x22c284));if(!_0x46202c)throw new _0x54686c('ai-chat-feed-view-item-not-found',this,{'id':_0x22c284});return _0x46202c;}['setLoadingMessage'](_0x14880c){this['set']('loadingMessage',_0x14880c);}['toggleLoadingSkeleton'](_0x54aab8){this['set']('isLoadingSkeletonVisible',_0x54aab8);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class nh extends _0x56abe9{['filter'](){let _0x5b114f=0x0;for(const _0x40547b of this['items'])_0x5b114f+=_0x40547b['items']['length'];return{'resultsCount':_0x5b114f,'totalItemsCount':_0x5b114f};}}const ah='ck-ai-chat__prompt-input_highlighted';class _s extends _0x19cfd0{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x4572a7,_0x3beac2){super(_0x4572a7,{'queryView':{'label':'','creator':_0x17d079,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new nh(_0x4572a7),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x3beac2,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=_s['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=_s['MAX_ROWS'],this['queryView']['fieldWrapperChildren']['add'](this['_addContextButtonView']),this['_setUpAddContextButtonPositioning'](),this['extendTemplate']({'attributes':{'class':['ck','ck-ai-chat__prompt-input']}}),this['submitButtonView']=this['_createSubmitButton'](),this['submitButtonView']['bind']('isEnabled')['to'](this,'isEmpty',this,'isUploadInProgress',(_0x1d6ffc,_0x5a06f1)=>!_0x1d6ffc&&!_0x5a06f1),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x15c5b0,_0x2a1022)=>{this['isUploadInProgress']||this['isEmpty']||_0x15c5b0['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x2a1022());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x9b63c7=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x9b63c7)return this['queryView']['errorText']=i(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x509061=_0x169b70(_0x9b63c7);this['fire']('sendUserMessage',_0x509061),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x3e05e4){this['queryView']['fieldView']['set']('placeholder',_0x3e05e4);}['focus'](_0x1212e1=!0x1){super['focus'](),_0x1212e1&&(this['element']['classList']['contains'](ah)||(this['element']['classList']['add'](ah),setTimeout(()=>{this['element']['classList']['remove'](ah);},0x320)));}['_createSubmitButton'](){const _0x1414c3=new _0x28db64(this['locale']);return _0x1414c3['set']({'icon':_0x2a6e28,'label':i(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x1414c3['on']('execute',()=>{this['submit']();}),_0x1414c3;}['setIsUploadInProgress'](_0x1c602b){this['isUploadInProgress']=_0x1c602b;}['_setUpAddContextButtonPositioning'](){const _0x13ba73=this['locale'],_0x131cec=()=>{_0x4b8472['window']['requestAnimationFrame'](()=>{if(_0x23b8f5(this['element'])){const _0x40a7a9=new _0x182987(this['queryView']['fieldView']['element']),_0x41ff11=new _0x182987(this['_addContextButtonView']['element']),_0x57dd86=_0x40a7a9['width'],_0xbb6783='rtl'===_0x13ba73['uiLanguageDirection']?'right':'left';_0x40a7a9['excludeScrollbarsAndBorders']();const _0x1ec479=_0x57dd86-_0x40a7a9['width']+0x1;this['_addContextButtonView']['element']['style'][_0xbb6783]='calc('+(_0x57dd86-_0x41ff11['width']-_0x1ec479)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x131cec),this['on']('render',()=>{_0x131cec(),this['_queryViewResizeObserver']=new _0x477005(this['queryView']['fieldView']['element'],()=>{_0x131cec();});});}}const ga='ck-ai-chat__prompt-capabilities',Ia='ck-ai-chat-controls-button',Ea='ck-ai-chat-controls-button--commands',Ta='ck-ai-button-tertiary',pa='ck-ai-chat-controls__model-selection',ma='ck-ai-chat-controls__model-selection__item-name',Ca='ck-ai-chat-controls__model-selection__item-description',wa='ck-ai-chat-controls__model-selection__item-capabilities',fa='n';class vs extends _0x25f6b6{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0xa541e6){super(_0xa541e6),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelDisplayMode','selector'),this['set']('modelSelectorEnabled',!0x0),this['set']('activeModelId',null),this['set']('activeModelName',null),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelNameView']=this['_createModelNameView'](),this['_webSearchButton']=this['_createWebSearchButton'](),this['_reasoningButton']=this['_createReasoningButton'](),this['_commandsButton']=this['_createCommandsButton'](),this['_modelSelectionDropdown']['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x56bfd6=>'selector'===_0x56bfd6),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x55be58=>_0x55be58?this['_modelSelectionDropdown']['buttonView']['label']:i(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x48a20d=>_0x48a20d),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x42008f=>_0x42008f),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0xe9ddfd=>i(this['locale'],_0xe9ddfd?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x4e4657=>_0x4e4657),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x1204aa=>i(this['locale'],_0x1204aa?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[ga]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x207453(),_0x1fdd70(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x18b891,_0x4e0a05){if(_0x4e0a05)this['set']('modelDisplayMode','hidden');else{const _0x114e27=0x1===_0x18b891['length'];this['set']('modelDisplayMode',_0x114e27?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x18b891?.['length'])for(const _0x2b7ee4 of _0x18b891){const _0x307dbd=new _0x173411({'label':_0x2b7ee4['name'],'withText':!0x0,'role':'menuitemradio','id':_0x2b7ee4['id'],'model':_0x2b7ee4});_0x307dbd['bind']('isOn')['to'](this,'activeModelId',_0x1ee437=>_0x1ee437===_0x2b7ee4['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x307dbd,'labelView':new Sa(this['locale'],_0x2b7ee4)});}}['setWebSearch'](_0x266135){this['set']('webSearchActive',_0x266135);}['setReasoning'](_0x158b50){this['set']('reasoningActive',_0x158b50);}['setModel'](_0x566ef6){if(!_0x566ef6)return;this['activeModelId']=_0x566ef6['id'],this['activeModelName']=_0x566ef6['name']||_0x566ef6['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x566ef6['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x566ef6['name']);const _0x539cf2=_0x566ef6['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x539cf2),this['_webSearchButton']['set']('isVisible',_0x539cf2);const _0x4043b1=_0x566ef6['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x4043b1),this['_reasoningButton']['set']('isVisible',_0x4043b1);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x2effe1){this['set']('modelSelectorEnabled',!0x1),_0x2effe1&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x43fb8d=new _0x28db64();return _0x43fb8d['set']({'label':i(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x395f9,'class':Ia,'isToggleable':!0x0,'tooltipPosition':fa}),_0x43fb8d['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x43fb8d;}['_createReasoningButton'](){const _0x2902a2=new _0x28db64();return _0x2902a2['set']({'label':i(this['locale'],'AI_CHAT_REASONING'),'icon':_0x6f2f23,'class':Ia,'isToggleable':!0x0,'tooltipPosition':fa}),_0x2902a2['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x2902a2;}['_createCommandsButton'](){const _0x40f8b2=new _0x28db64();return _0x40f8b2['set']({'label':i(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x187a3e,'withText':!0x0,'class':Ia,'isToggleable':!0x0,'tooltip':i(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':fa}),_0x40f8b2['extendTemplate']({'attributes':{'class':[Ea]}}),_0x40f8b2['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x40f8b2;}['_createModelSelectionDropdown'](){const _0x1aab66=_0x340743(this['locale']);return _0x1aab66['set']({'panelPosition':'ne','class':[pa]}),_0x1aab66['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':fa,'class':Ta}),this['listenTo'](_0x1aab66,'execute',_0x1a3067=>{this['fire']('selectModel',_0x1a3067['source']['model']);}),_0x1aab66;}['_createModelNameView'](){const _0x4f5957=new ba(this['locale']);return _0x4f5957['bind']('text')['to'](this,'activeModelName',_0x2ffc37=>_0x2ffc37??''),_0x4f5957['bind']('isVisible')['to'](this,'modelDisplayMode',_0x1a2dc1=>'name'===_0x1a2dc1),_0x4f5957;}}let Sa=class extends _0x594a98{constructor(_0x4d4388,_0x4c370c){super();const _0x431714=this['bindTemplate'],_0x9c160b=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x431714['to']('style'),'id':_0x431714['to']('id')},'children':[{'tag':'div','attributes':{'class':[ma]},'children':[{'text':_0x431714['to']('text')}]},{'tag':'div','attributes':{'class':[Ca]},'children':[{'tag':'span','children':[{'text':_0x4c370c['description']}]}]},{'tag':'div','attributes':{'class':[wa]},'children':_0x9c160b}]}),_0x9c160b['addMany'](this['_getCapabilityParts'](_0x4d4388,_0x395f9,'AI_CHAT_SEARCH_WEB',_0x4c370c['capabilities']['webSearch']?.['enabled']??!0x1)),_0x9c160b['addMany'](this['_getCapabilityParts'](_0x4d4388,_0x6f2f23,'AI_CHAT_REASONING',_0x4c370c['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x51b9ef,_0x56eaa2,_0xa8aeb1,_0x1580b8){const _0x5ad96e=new _0x283d41();_0x5ad96e['content']=_0x56eaa2;const _0x245f2b=new _0x25f6b6(_0x51b9ef);_0x245f2b['setTemplate']({'tag':'span','children':[{'text':i(_0x51b9ef,_0xa8aeb1)+':\x20'}]});const _0x1cdc73=new _0x25f6b6(_0x51b9ef);return _0x1cdc73['setTemplate']({'tag':'span','children':[{'text':i(_0x51b9ef,_0x1580b8?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x5ad96e,_0x245f2b,_0x1cdc73];}},ba=class extends _0x25f6b6{constructor(_0x43ffd1){super(_0x43ffd1),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x1cddad=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x1cddad['if']('isVisible','ck-hidden',_0x3804b8=>!_0x3804b8)]},'children':[{'text':_0x1cddad['to']('text')}]});}};const Ra='ck-ai-chat-context-controls__url-form',Oa='ck-ai-chat-context-controls__url-input-section';class Po extends _0x25f6b6{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x40df1c){super(_0x40df1c),this['focusTracker']=new _0x49bffd(),this['keystrokes']=new _0x287999(),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 _0x596602({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['set']('withBackButton',!0x0),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x206b86=>{this['focusTracker']['add'](_0x206b86['element']),this['keystrokes']['listenTo'](_0x206b86['element']);}),_0x3b3248({'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'](_0x15ab5f){this['urlInputField']['errorText']=_0x15ab5f,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x4a2292=new _0x28db64(this['locale']);return _0x4a2292['set']({'icon':_0x40452e,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x470a40,_0x48f61e,_0x3a2b82)=>{_0x4a2292['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x3a2b82?'':'\x20ck-hidden')]});}),_0x4a2292;}['_createUrlInputField'](){const _0x1cd412=new _0x4318b8(this['locale'],th);return _0x1cd412['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x1cd412['fieldView']['set']({'placeholder':i(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x1cd412;}['_createConfirmButton'](){const _0x1d26eb=new _0x28db64(this['locale']);return _0x1d26eb['set']({'icon':_0x5d07bd,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x1d26eb;}['_setupTemplate'](){const _0x298e42=new _0x214d1d(this['locale'],{'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x298e42['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Ra,'tabindex':'-1'},'children':[_0x298e42,{'tag':'div','attributes':{'class':Oa},'children':[this['urlInputField'],this['confirmButton']]}]});}['_setupEventHandlers'](){this['backButton']['on']('execute',()=>{this['clear'](),this['fire']('cancel');}),this['urlInputField']['fieldView']['on']('input',()=>{this['clearError'](),this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}),this['on']('submit',_0xf2e5ef=>{_0xf2e5ef['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x132c47,_0xbe2d43)=>{this['clear'](),this['fire']('cancel'),_0xbe2d43();});}['_handleSubmit'](){const _0x59f40f=this['getValue']()['trim']();_0x59f40f?this['_isValidUrl'](_0x59f40f)?(this['clearError'](),this['fire']('submitUrl',_0x59f40f)):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x5e9a97=this['getValue']()['trim'](),_0x4e41d5=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x5e9a97['length']>0x0&&!_0x4e41d5;}['_isValidUrl'](_0x7939df){try{return!!new URL(_0x7939df);}catch{return!0x1;}}}const ka='ck-ai-chat-resources__item',Na='ck-ai-chat-resources__item--in-context',va='ck-ai-chat-resources__item-title',ya='ck-ai-chat-resources__item__icon';class hc extends _0x1cf10a{['resource'];['_titleView'];['_iconView'];constructor(_0x4e28bf,_0x247e5b){super(_0x4e28bf),this['resource']=_0x247e5b,this['set']('isInContext',!!_0x247e5b['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x5bfa2e){if(_0x5bfa2e['isInContext'])return _0x5d07bd;switch(_0x5bfa2e['type']){case qe['DOCUMENT']:return _0x5e59e8;case qe['URL']:return _0x11a450;case qe['FILE']:case qe['TEXT']:return _0x4f5d8d;default:return _0xc05306;}}['highlightText'](_0x237e33){if(!_0x237e33||''===_0x237e33['trim']())return void this['_titleView']['highlightText'](null);const _0x1fdfec=new RegExp(_0x2fe64e(_0x237e33),'gi');this['_titleView']['highlightText'](_0x1fdfec);}['updateResourceState'](_0x518357){this['resource']['isInContext']=_0x518357,this['isInContext']=_0x518357,this['_updateIcon']();}['_createTitleView'](){const _0x5a1ae4=new _0x139c4b();return _0x5a1ae4['text']=this['resource']['label'],_0x5a1ae4['extendTemplate']({'tag':'span','attributes':{'class':[va]}}),_0x5a1ae4;}['_createIconView'](){const _0x20fbba=new _0x283d41();return _0x20fbba['content']=this['getResourceIcon'](this['resource']),_0x20fbba;}['_setupTemplate'](){const _0x10527e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[ka,_0x10527e['if']('isVisible','ck-hidden',_0x224c6b=>!_0x224c6b),_0x10527e['if']('isInContext',Na)]},'children':[{'tag':'div','attributes':{'class':[ya]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x10527e['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const xa='ck-ai-chat-resources__list';class Lr extends _0x56abe9{['_source'];constructor(_0x2b79fd,_0x4b1ac9){super(_0x2b79fd),this['_source']=_0x4b1ac9,this['extendTemplate']({'attributes':{'class':[xa]}});}['setResources'](_0x21827c,_0x326441){this['items']['clear']();let _0x83bf71=_0x21827c;if(this['_source']['useDefaultFiltering']&&_0x326441&&''!==_0x326441['trim']()){const _0x4bdd22=new RegExp(_0x326441['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x83bf71=_0x21827c['filter'](_0x2d0b5c=>_0x4bdd22['test'](_0x2d0b5c['label']));}for(const _0x15a893 of _0x83bf71){const _0x1f0b29=new hc(this['locale'],_0x15a893);_0x1f0b29['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x15a893);}),this['items']['add'](_0x1f0b29);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x326441);}['highlightText'](_0x526c31){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x3fb4f4=>{_0x3fb4f4['highlightText'](_0x526c31);});}['updateResourceState'](_0x13289f,_0x43eeff){for(const _0x20d5d9 of this['items']){const _0x4cc563=_0x20d5d9;_0x4cc563['resource']['id']===_0x13289f&&_0x4cc563['updateResourceState'](_0x43eeff);}}['_handleResourceSelection'](_0x592b77,_0x56e387){this['fire']('addResourceToContext',{'source':_0x592b77,'resource':_0x56e387});}}class Tr extends _0x4318b8{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0xa39c0f){const t=_0xa39c0f['t'],_0x55e14d={'showResetButton':!0x0,'showIcon':!0x0,'creator':th,'label':i(_0xa39c0f,'AI_CHAT_SEARCH_RESOURCES')};super(_0xa39c0f,_0x55e14d['creator']),this['label']=_0x55e14d['label'],this['_viewConfig']=_0x55e14d,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0xa39c0f,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x55bb7a){this['fire']('search',_0x55bb7a);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x283d41(),this['iconView']['content']=_0x1a07b3,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x3d0685,t){this['resetButtonView']=new _0x28db64(_0x3d0685),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x58fd68,'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',_0x11b4fc=>!_0x11b4fc),this['fieldWrapperChildren']['add'](this['resetButtonView']),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-reset'}});}['_setupEventListeners'](){this['listenTo'](this['fieldView'],'input',()=>{this['search'](this['fieldView']['element']['value']);}),this['bind']('isEnabled')['to'](this);}}class lc extends _0x25f6b6{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x2f9f35,_0x5ce79b){super(_0x2f9f35),this['_source']=_0x5ce79b['source'],this['_searchInputVisibleFrom']=_0x5ce79b['searchInputVisibleFrom']??0x7,this['set']('isLoading',!0x0),this['_searchView']=this['_createSearchView'](),this['_searchSection']=this['_createSearchSection'](),this['_resourcesListView']=this['_createResourcesListView'](),this['_skeletonLoader']=this['_createSkeletonView'](),this['children']=new _0x3fe74c([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new Tr(this['locale']);}['_createSearchSection'](){const _0x10d117=new _0x25f6b6(this['locale']);return _0x10d117['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x1794bc,_0x4b3d99)=>{this['loadResources'](_0x4b3d99),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x4b3d99);}),_0x10d117;}['_createResourcesListView'](){const _0x14a3bb=new Lr(this['locale'],this['_source']);return _0x14a3bb['delegate']('addResourceToContext')['to'](this),_0x14a3bb['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x14a3bb;}['_createSkeletonView'](){const _0x5a4548=new ai(this['locale'],di['aiChatResources']);return _0x5a4548['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x4a89a4=>!_0x4a89a4)]}}),_0x5a4548;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x5b1cff){const _0x2e1245=_0x589eaf();this['_latestLoadResourcesUid']=_0x2e1245,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x5b1cff,'uid':_0x2e1245}),this['isLoading']=!0x0;}['setResources'](_0x258998,_0x318491){if(_0x318491&&_0x318491!==this['_latestLoadResourcesUid'])return;const _0x2721ba=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x258998,_0x2721ba),_0x258998['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x1ba308,_0xee7cb2){this['_resourcesListView']['updateResourceState'](_0x1ba308,_0xee7cb2);}}const La='ck-ai-chat-context-controls__source-balloon-panel',Da='ck-button-icon\x20ck-button-back',Pa='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Oo{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x85f8a0,_0x458b73,_0x2d9fe9){this['_locale']=_0x85f8a0,this['_bodyCollection']=_0x458b73,this['_config']=_0x2d9fe9;}['showSourceResourcesBalloon']({source:_0x1ea49b,withBackButton:_0x2ab219}){let _0x2e62a0=this['_sourceResourceBalloons']['get'](_0x1ea49b['id']);_0x2e62a0||(_0x2e62a0=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x1ea49b['id'],_0x2e62a0),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x2e62a0)),this['_addSourceResourceContent']({'balloonPanel':_0x2e62a0,'source':_0x1ea49b,'withBackButton':_0x2ab219}),_0x2e62a0['show']();const _0x2100b4=this['_config']['getTargetElement']();_0x2100b4&&_0x2e62a0['pin']({'target':_0x2100b4,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x48717f,_0x17aa81,_0xbaedf6){const _0x432e5d=this['_sourceResourceBalloons']['get'](_0x48717f);if(!_0x432e5d)return;const _0x1dc8e4=this['_getResourcesViewFromBalloon'](_0x432e5d);_0x1dc8e4&&(_0x1dc8e4['setResources'](_0x17aa81,_0xbaedf6),_0x1dc8e4['once']('change:isLoading',()=>{_0x432e5d['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x1fabf1){const _0x5458fe=this['_sourceResourceBalloons']['get'](_0x1fabf1);_0x5458fe&&requestAnimationFrame(()=>{_0x5458fe['hide'](),this['_sourceResourceBalloons']['delete'](_0x1fabf1),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x9fbd27 of this['_sourceResourceBalloons']['values']())if(_0x9fbd27['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x2c6f47,_0x372ad3,_0xdf9a87){const _0xac0a7f=this['_sourceResourceBalloons']['get'](_0x2c6f47);if(!_0xac0a7f||!_0xac0a7f['isVisible'])return;const _0x1ed3be=this['_config']['getTargetElement']();if(!_0x1ed3be)return;_0xac0a7f['pin']({'target':_0x1ed3be,'limiter':this['_config']['getLimiterElement']()});const _0x59ab53=this['_getResourcesViewFromBalloon'](_0xac0a7f);_0x59ab53&&_0x59ab53['updateResourceState'](_0x372ad3,_0xdf9a87);}['destroy'](){for(const _0x33420a of this['_sourceResourceBalloons']['values']())_0x33420a['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x1275c1=new _0x132eb0(this['_locale']);return _0x1275c1['extendTemplate']({'attributes':{'class':La}}),this['_bodyCollection']['add'](_0x1275c1),_0x1275c1;}['_addSourceResourceContent']({balloonPanel:_0x5b011a,source:_0x22a5c0,withBackButton:_0x51f996}){_0x5b011a['content']['clear']();const _0x1113c6=this['_createBalloonHeader']({'balloonPanel':_0x5b011a,'source':_0x22a5c0,'withBackButton':_0x51f996});_0x5b011a['content']['add'](_0x1113c6);const _0x242dc5=this['_createBalloonResourcesView'](_0x22a5c0);_0x5b011a['content']['add'](_0x242dc5);}['_createBalloonHeader']({balloonPanel:_0x8e56b6,source:_0x51ed62,withBackButton:_0x16ef6b}){const _0x29f191=new _0x214d1d(this['_locale'],{'label':_0x51ed62['label'],'class':Pa});return _0x16ef6b&&_0x29f191['children']['add'](this['_createBackButton'](_0x8e56b6),0x0),_0x29f191;}['_createBackButton'](_0x1b6a0d){const _0x3701d6=new _0x28db64(this['_locale']);return _0x3701d6['set']({'icon':_0x40452e,'tooltip':i(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Da}),_0x3701d6['on']('execute',()=>{_0x1b6a0d['hide'](),this['_config']['onBackToContext']();}),_0x3701d6;}['_createBalloonResourcesView'](_0x3cbc0d){const _0x3812f9=new lc(this['_locale'],{'source':_0x3cbc0d,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x3812f9['on']('loadSourceResources',(_0x4bfeba,_0x5009a8)=>{this['_config']['onLoadSourceResources'](_0x5009a8);}),_0x3812f9['on']('addResourceToContext',(_0x431b21,_0x2e385c)=>{this['_config']['onResourceSelected'](_0x2e385c['source'],_0x2e385c['resource']),this['closeSourceResourceBalloon'](_0x3cbc0d['id']);}),_0x3812f9;}['_getResourcesViewFromBalloon'](_0x48f27d){const _0x1cf62c=_0x48f27d['content']['get'](0x1);return _0x1cf62c instanceof lc?_0x1cf62c:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x3f4abb){_0x13f50b({'emitter':_0x3f4abb,'contextElements':[_0x3f4abb['element']],'callback':()=>{_0x3f4abb['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x3f4abb['isVisible']});}}const xs=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Uo='ck-ai-chat-context-controls',Lo='ck-ai-chat-context-controls__pending-contexts',No='ck-ai-chat-context-controls__add-context-balloon-panel',Mo='ck-ai-chat-context-controls__add-context-button',Ho='ck-ai-chat-context-controls__url-balloon-panel',jo='ck-ai-chat-context-controls__balloon-button',Fo='ck-ai-chat-context-controls__balloon-button-source',Xo='ck-ai-chat-controls-button',Do='ck-ai-chat-context-chips-wrapper-balloon',$o='ck-ai-chat-controls_context_show-more-button',Wo='ck-ai-chat-context-controls__show-more-balloon-panel',qo='ck-ai-chat',zo=[_0x132eb0['defaultPositions']['northArrowSouthWest'],_0x132eb0['defaultPositions']['northArrowSouth'],_0x132eb0['defaultPositions']['northArrowSouthEast'],_0x132eb0['defaultPositions']['southArrowNorthWest'],_0x132eb0['defaultPositions']['southArrowNorth'],_0x132eb0['defaultPositions']['southArrowNorthEast']];class Is extends _0x25f6b6{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x107b47,_0x2228d6){super(_0x107b47),this['bodyCollection']=_0x2228d6['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x107b47),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x107b47),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x107b47),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x107b47,_0x2228d6);const _0x442882={'cssClasses':{'showMoreButton':$o,'showMoreBalloon':Wo,'overflowContainer':Do,'controlsButton':Xo}};this['_overflowManager']=new Ro(_0x107b47,this['_currentContextsChips'],_0x442882,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'](_0x225785,_0x4147bf){const _0x52da61=this['_createContextButton'](_0x225785,'current',!0x0,_0x4147bf);this['_addContextToCollection'](_0x52da61,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x3aa8be){this['_removeContextFromCollection'](_0x3aa8be,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x3aa8be,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x58e365,_0x36f98d){let _0x3b2288=this['_currentContextsChips']['find'](_0x413898=>_0x413898['id']===_0x58e365);_0x3b2288||(_0x3b2288=this['_overflowManager']['overflowChips']['find'](_0x140667=>_0x140667['id']===_0x58e365)),_0x3b2288&&(_0x3b2288['isLoading']=_0x36f98d);}['setConversationContext'](_0x21d561){this['_conversationContextsChips']['clear']();for(const _0x1e5acf of _0x21d561){const _0x52bd02=this['_createContextButton'](_0x1e5acf,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x52bd02,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x315f4c,_0x147cf8,_0x1f64dc){this['_resourcesBalloonView']['updateResourceState'](_0x315f4c,_0x147cf8,_0x1f64dc);}['hideAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x1);}['showAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x0);}['hideUrlBalloonPanel'](){this['_urlBalloonPanelView']['hide'](),this['addContextButtonView']['isOn']=!0x1,this['_urlInputView']&&this['_urlInputView']['clear']();}['showUrlBalloonPanel'](){this['_urlBalloonPanelView']['show'](),this['addContextButtonView']['isOn']=!0x0;}['_showSourceResourcesBalloon']({source:_0x415a26,withBackButton:_0x33a9b2}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x415a26,'withBackButton':_0x33a9b2}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x47f8a0,_0x438ff1,_0x81e3e1,_0x5e5a02){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x47f8a0,_0x81e3e1,_0x5e5a02);}['closeSourceResourceBalloon'](_0x2ceb79){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x2ceb79),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x316907){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x316907),this['_setAddContextButtonEnabled'](_0x316907);}['_setAddContextButtonEnabled'](_0x2ca55d){const _0x41b6f9=!_0x2ca55d['document']['isHidden']&&_0x2ca55d['document']['enabled'],_0x4c1394=_0x2ca55d['urls']['enabled'],_0x45b4c5=_0x2ca55d['files']['enabled'],_0x277267=_0x2ca55d['sources']['length']>0x0,_0x35e01e=_0x2ca55d['customItems']&&_0x2ca55d['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x41b6f9||_0x4c1394||_0x45b4c5||_0x277267||_0x35e01e;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Uo,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Lo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x32a4be){const _0x3d0db4=new _0x28db64(_0x32a4be);return _0x3d0db4['set']({'label':i(_0x32a4be,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Xo+'\x20'+Mo,'icon':_0xe48ba7,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x3d0db4;}['_createAddContextBalloonPanelView'](_0xa08e56){return this['_createBaseBalloonPanel'](_0xa08e56,No);}['_createUrlBalloonPanelView'](_0xd305d1){const _0x10a333=this['_createBaseBalloonPanel'](_0xd305d1,Ho);return this['_addUrlContent'](_0x10a333,_0xd305d1),_0x10a333;}['_createResourcesBalloonView'](_0x3d9b0d,_0x244454){const _0x16150c={'searchInputVisibleFrom':_0x244454['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo});},'onResourceSelected':(_0x432582,_0x9b83d2)=>{this['fire']('addResourceToContext',{'source':_0x432582,'resource':_0x9b83d2});},'onLoadSourceResources':_0x38c985=>{this['fire']('loadSourceResources',_0x38c985);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Oo(_0x3d9b0d,_0x244454['bodyCollection'],_0x16150c);}['_getLimiterElement'](){return this['element']?.['closest']('.'+qo)||document['body'];}['_createBaseBalloonPanel'](_0x1e71d4,_0x415e23){const _0x35add8=new _0x132eb0(_0x1e71d4);return _0x35add8['extendTemplate']({'attributes':{'class':_0x415e23}}),this['bodyCollection']['add'](_0x35add8),_0x35add8;}['_setBalloonPanelContent'](_0x128f4a,_0x49aff5,_0x112bf9){if(_0x128f4a['content']['clear'](),!_0x112bf9['document']['isHidden']&&_0x112bf9['document']['enabled']){const _0x31bfd2=this['_createBalloonButton'](_0x49aff5,{'label':i(_0x49aff5,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x5e59e8});_0x31bfd2['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x128f4a['content']['add'](_0x31bfd2);}if(_0x112bf9['urls']['enabled']){const _0xadf1a9=this['_createBalloonButton'](_0x49aff5,{'label':i(_0x49aff5,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x11a450});_0xadf1a9['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo}),this['_urlInputView']['focus']();}),_0x128f4a['content']['add'](_0xadf1a9);}if(_0x112bf9['files']['enabled']){const _0x549355=new _0x7b6044(_0x49aff5);_0x549355['set']({'label':i(_0x49aff5,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x5e20bd,'withText':!0x0,'tooltip':!0x0,'class':jo,'allowMultipleFiles':!0x0}),_0x549355['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x549355['on']('done',(_0x1a5822,_0x46d944)=>{this['fire']('addFileToContext',_0x46d944);}),_0x549355['tooltip']=!0x0,_0x128f4a['content']['add'](_0x549355);}for(const _0x595cb9 of _0x112bf9['sources']){const _0x2766b4=this['_createBalloonButton'](_0x49aff5,{'label':_0x595cb9['label'],'icon':_0x595cb9['icon']||_0xc05306,'type':'source'});_0x128f4a['content']['add'](_0x2766b4),_0x2766b4['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x595cb9,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x176442 of _0x112bf9['customItems']||[]){const _0x358dbb=this['_createBalloonButton'](_0x49aff5,{'label':_0x176442['label'],'icon':_0x176442['icon']||_0xc05306,'type':'customItem'});_0x128f4a['content']['add'](_0x358dbb),_0x358dbb['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x176442);});}this['_hasExactlyOneSource']=0x1===_0x128f4a['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x363078,_0x369de6){this['_urlInputView']=new Po(_0x369de6),this['_urlInputView']['on']('submitUrl',(_0xdb435,_0x1a844a)=>{this['_handleUrlSubmit'](_0x1a844a);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo});}),_0x363078['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x8335cc,_0x2f7928){const _0x179488='source'===_0x2f7928['type']?new Ha(_0x8335cc):new _0x28db64(_0x8335cc);return _0x179488['set']({'label':_0x2f7928['label'],'icon':_0x2f7928['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':jo}),_0x179488;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x13f50b({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x12b8e6){const _0x2efb46=this['_addContextBalloonConfig'];_0x2efb46['buttonView']['isOn']=_0x12b8e6,_0x12b8e6?_0x2efb46['balloonView']['show']():_0x2efb46['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x12e2c7,buttonView:_0x30629c,hideMethod:_0x93d369}=this['_addContextBalloonConfig'];_0x13f50b({'emitter':_0x12e2c7,'contextElements':[_0x12e2c7['element'],_0x30629c['element']],'callback':()=>{_0x93d369();},'activator':()=>_0x30629c['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x4fa193,_0x214bf0,_0x1d2ba1=!0x1,_0x486910=!0x1){const _0x29486b='conversation'===_0x214bf0||!0x0===_0x4fa193['isReadOnly'],_0x44a264=new Vo(this['locale'],_0x4fa193,_0x29486b,_0x1d2ba1,_0x486910);return _0x29486b||_0x44a264['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x44a264['id']);}),_0x44a264;}['_addContextToCollection'](_0x118db4,_0x58b372){_0x58b372['add'](_0x118db4,0x0);}['_removeContextFromCollection'](_0x409de2,_0x46ce9a){const _0x2ba55d=_0x46ce9a['find'](_0x28f896=>_0x28f896['id']===_0x409de2);_0x2ba55d&&_0x46ce9a['remove'](_0x2ba55d);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x6cd277){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x6cd277);}}class Ha extends _0x28db64{['arrowView'];constructor(_0x149e2d){super(_0x149e2d),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Fo]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x31d742=new _0x283d41();return _0x31d742['content']=_0x4f22f1,_0x31d742['extendTemplate']({'attributes':{'class':Fo+'__arrow'}}),_0x31d742;}}class Cs extends _0x25f6b6{['_cancelButtonView'];['_loaderView'];constructor(_0x4d9f86){super(_0x4d9f86),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 _0x45b5e9=new _0x28db64(this['locale']);return _0x45b5e9['set']({'label':i(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0xaf27a6}),_0x45b5e9['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x45b5e9;}['_createLoaderView'](){const _0x31140f=new _0x25f6b6(this['locale']);return _0x31140f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}}]},{'text':i(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x31140f;}}class pi extends _0x25f6b6{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x23baa7,_0x58c71c){super(_0x23baa7),this['_contextPanelView']=this['_createContextPanelView'](_0x23baa7,{'bodyCollection':_0x58c71c['bodyCollection'],'searchInputVisibleFrom':_0x58c71c['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x23baa7),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x23baa7),this['_loaderView']=this['_createLoaderView'](_0x23baa7),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x23baa7),this['_shouldRestorePromptInputFocus']=!0x1,this['_promptInputView']['delegate']('sendUserMessage')['to'](this),this['_loaderView']['delegate']('abortPromptStream')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleWebSearch')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleReasoning')['to'](this),this['_promptCapabilitiesView']['delegate']('selectModel')['to'](this),this['_contextPanelView']['delegate'](...xs)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x371c7c=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x371c7c['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x371c7c['if']('isLoading','ck-hidden',_0x417b69=>_0x417b69||!this['isModelAvailable']),_0x371c7c['if']('isModelAvailable','ck-hidden',_0x200ca8=>!_0x200ca8||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x371c7c['if']('isLoading','ck-hidden',_0x3cc384=>!_0x3cc384)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x371c7c['if']('isModelAvailable','ck-hidden',_0x547cc8=>_0x547cc8)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x13f50b({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x21f0c6,_0x5b3e16){return new Is(_0x21f0c6,_0x5b3e16);}['_createPromptInputView'](_0x4d08af){return new _s(_0x4d08af,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x1167fc){return new vs(_0x1167fc);}['_createLoaderView'](_0xca8f53){return new Cs(_0xca8f53);}['_createModelUnavailableMessageView'](_0x4555cd){const _0x277086=new As(_0x4555cd);return _0x277086['delegate']('startConversation')['to'](this),_0x277086;}['_handlePromptInputFocus'](_0x2a52d1,_0x10cab5,_0x2d5991){_0x2d5991?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x3076a2,_0x12678f){this['_contextPanelView']['addContextItem'](_0x3076a2,_0x12678f);}['removeContextItem'](_0x3cd195){this['_contextPanelView']['removeContextItem'](_0x3cd195);}['setContextItemLoading'](_0xe85944,_0xd19e8c){this['_contextPanelView']['setContextItemLoading'](_0xe85944,_0xd19e8c);}['setIsUploadInProgress'](_0x39c4f8){this['_promptInputView']['setIsUploadInProgress'](_0x39c4f8);}['setConversationContext'](_0x37befd){this['_contextPanelView']['setConversationContext'](_0x37befd);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0xa8b486,_0x3480e2,_0x40846d){this['_contextPanelView']['updateResourceState'](_0xa8b486,_0x3480e2,_0x40846d);}['setWebSearch'](_0x1d83d7){this['_promptCapabilitiesView']['setWebSearch'](_0x1d83d7);}['setReasoning'](_0x58a95c){this['_promptCapabilitiesView']['setReasoning'](_0x58a95c);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x5e0a1d){this['_contextPanelView']['setAddContextOptions'](_0x5e0a1d);}['setInputPlaceholder'](_0x1443ba){this['_promptInputView']['setPlaceholderText'](_0x1443ba);}['setModelList'](_0x2f8f71,_0x15961f){this['_promptCapabilitiesView']['setModelList'](_0x2f8f71,_0x15961f);}['setModel'](_0x2307a2){_0x2307a2?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x2307a2)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x20ecb3){this['_promptCapabilitiesView']['disableModelSelector'](_0x20ecb3);}['populateSourceResourceBalloon'](_0x2da5bd,_0x4444d0,_0xf528e,_0x25e654){this['_contextPanelView']['populateSourceResourceBalloon'](_0x2da5bd,_0x4444d0,_0xf528e,_0x25e654);}['closeSourceResourceBalloon'](_0x264d1b){this['_contextPanelView']['closeSourceResourceBalloon'](_0x264d1b);}['focusPromptInput'](_0xb3f01e=!0x1){this['_promptInputView']['focus'](_0xb3f01e);}['setPromptInputValue'](_0x17c014){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x17c014;}}class As extends _0x25f6b6{constructor(_0x39b18f){super(_0x39b18f);const _0x5cf971=new _0x28db64(_0x39b18f);_0x5cf971['set']({'label':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x5cf971['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x5cf971]}]});}}class wi extends _0x214d1d{['conversationStartButton'];['resizeButton'];constructor(_0x1d05e7,_0x4cbaa8){super(_0x1d05e7,{'label':i(_0x1d05e7,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':vt}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x1d05e7),this['children']['add'](this['conversationStartButton']),_0x4cbaa8&&(this['resizeButton']=Hs(_0x1d05e7,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x28a7b1){const _0x3798ab=new _0x28db64(_0x28a7b1);return _0x3798ab['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x5deb17,'class':'ck-ai-chat__start-conversation'}),_0x3798ab['on']('execute',()=>{this['fire']('startConversation');}),_0x3798ab;}}class fi extends _0x25f6b6{constructor(_0x5b3c73){super(_0x5b3c73),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':i(_0x5b3c73,'AI_DISCLAIMER_TEXT')}]}]});}}class Pt extends _0x25f6b6{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x5f1862,_0x561b9c){super(_0x5f1862),this['_bodyCollection']=new _0x74da33(_0x5f1862),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new wi(_0x5f1862,_0x561b9c['showResizeButton']),this['chatHeader']['delegate'](...bt)['to'](this),this['chatFeed']=new ui(_0x5f1862,this['_bodyCollection']),this['chatFeed']['delegate'](...bt)['to'](this),this['chatControls']=new pi(_0x5f1862,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x561b9c['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...bt)['to'](this),this['chatDisclaimer']=new fi(_0x5f1862),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x5f1862['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x5cd107,_0x309620,_0x180eda,_0x56d60b){this['chatControls']['populateSourceResourceBalloon'](_0x5cd107,_0x309620,_0x180eda,_0x56d60b);}['closeSourceResourceBalloon'](_0x1ab8d3){this['chatControls']['closeSourceResourceBalloon'](_0x1ab8d3);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class ct extends _0x3de4b5{static get['requires'](){return[pt];}['_view'];static get['pluginName'](){return'AIChatUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['feedItemRenderingStrategy']='streaming';['showDiff']=!0x0;['_promiseQueue'];['_interactionPromiseResolver'];['_titleAnimationInterval']=void 0x0;['_isTrackChangesCommandValueBound']=!0x1;constructor(_0x197c8d){super(_0x197c8d);const _0x581af3=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new z(),this['_view']=new Pt(this['context']['locale'],{'showResizeButton':_0x581af3['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...bt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x26c75b,{showDiff:_0x1dcc64})=>{this['showDiff']=_0x1dcc64;}),_0x581af3['view']['addTab']({'id':'chat','buttonLabel':i(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':vt,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x17b13c=>_0x17b13c),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x39980c=>_0x39980c),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x35ba5c){const _0x4890e7=this['context']['config']['get']('ai.chat.welcomeMessage')??i(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x35ba5c['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x4890e7}),this['fire']('conversationCreated');}['addFeedItemStaticMessage']({id:_0xd7b65b,staticMessage:_0x30297f}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0xd7b65b,'initialContent':'<p>'+_0x30297f+'</p>'});}['addFeedItemUserMessage'](_0x27384b){const _0x568f1a=_0x27384b['attributes']?.['displayedPrompt']||_0x27384b['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x27384b['contextItems']['values']()),'initialContent':'<p>'+_0x568f1a+'</p>','id':_0x27384b['id']});}['addFeedItemError']({errorMessage:_0x17f026,id:_0x4a5b2a}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x17f026+'</p>','id':_0x4a5b2a});}['addFeedItemAIReply'](_0x247654){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x247654['interactionId']+':'+_0x247654['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x516530){const _0x242772=T(this['context']);let _0x40c8a5=_0x242772['config']['get']('ai.availableReplyActions')||[...ot];if(_0x242772['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x28d8a8=_0x242772['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x28d8a8,'value');}}else _0x40c8a5=_0x40c8a5['filter'](_0x22c747=>'insertSuggestion'!=_0x22c747);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x516530['interactionId']+':'+_0x516530['id'],'areActionsDisabled':_0x516530['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x40c8a5}),this['clearLoadingMessage']();});}['addFeedInteractionHeader'](_0x187b9d,_0x4461fd){const _0x1b300d=this['_view']['chatFeed']['children']['last'];if(_0x1b300d instanceof Mt)return this['_view']['chatFeed']['children']['remove'](_0x1b300d),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x187b9d['id'],'capabilities':{'isWebSearchEnabled':_0x1b300d['capabilities']['isWebSearchEnabled']||_0x4461fd['isWebSearchEnabled'],'isReasoningEnabled':_0x1b300d['capabilities']['isReasoningEnabled']||_0x4461fd['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x187b9d['id'],'capabilities':_0x4461fd});}async['addFeedItemCustomElement'](_0x4befe2,_0x52ace1){let _0x3b07cd;return await this['_promiseQueue']['enqueue'](async()=>{_0x3b07cd=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x4befe2,'id':_0x52ace1});}),_0x3b07cd;}['removeFeedItem'](_0x2d0a45){this['_view']['chatFeed']['removeItem'](_0x2d0a45);}['hasFeedItem'](_0x362daa){return this['_view']['chatFeed']['hasItem'](_0x362daa);}['updateFeedInteractionHeader'](_0x75dc05){const _0x3183ea=this['_view']['chatFeed']['children']['find'](_0x588c99=>_0x588c99['options']['id']==_0x75dc05['id']&&_0x588c99 instanceof Mt);_0x3183ea&&_0x3183ea['set']('isVisible',_0x75dc05['isVisible']);}async['updateFeedItemAIReplyContent'](_0x17925e){const _0x4116de=_0x17925e['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x37bad8=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x17925e,'abortSignal':_0x37bad8,'renderingStrategy':_0x4116de}),_0x17925e['isDone']&&this['markFeedItemAsDone'](_0x17925e['id']);});}['updateFeedItemAIReplySources'](_0x2d08ec,_0x5afff5){this['_view']['chatFeed']['updateWebSources'](_0x2d08ec,_0x5afff5);}async['updateFeedItemAIReplySuggestionContent'](_0x9ed837){const _0x5010a7=_0x9ed837['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x30e6c2=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x9ed837,'abortSignal':_0x30e6c2,'renderingStrategy':_0x5010a7}),_0x9ed837['isDone']&&this['markFeedItemAsDone'](_0x9ed837['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x34b366){this['_view']['chatFeed']['updateSuggestionPartState'](_0x34b366);}['setFeedItemAIReplySuggestionPartActive'](_0x482782){this['_view']['chatFeed']['setSuggestionPartActive'](_0x482782);}['markFeedItemAsDone'](_0x125dcc){this['_view']['chatFeed']['markItemAsDone'](_0x125dcc);}['removeFeedInteraction'](_0x516a39){this['_view']['chatFeed']['getItemIds']()['filter'](_0x245f1c=>_0x245f1c['startsWith'](_0x516a39))['forEach'](_0x5e806b=>this['_view']['chatFeed']['removeItem'](_0x5e806b));}['startInteraction'](){const _0x299178=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x299178),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x679923){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x9939d0=>_0x9939d0['startsWith'](_0x679923['id']))['forEach'](_0x5f1e78=>this['markFeedItemAsDone'](_0x5f1e78)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x4c74eb,_0x2bfb75){this['_view']['chatControls']['addContextItem'](_0x4c74eb,_0x2bfb75);}['removeContextItem'](_0x945ec5){this['_view']['chatControls']['removeContextItem'](_0x945ec5);}['setContextItemLoading'](_0x3a9cb2,_0x3562ca){this['_view']['chatControls']['setContextItemLoading'](_0x3a9cb2,_0x3562ca);}['setIsUploadInProgress'](_0x265b53){this['_view']['chatControls']['setIsUploadInProgress'](_0x265b53);}['setConversationContext'](_0x1ef28d){this['_view']['chatControls']['setConversationContext'](_0x1ef28d);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x5ef302,_0x110646,_0x3e0825){this['_view']['chatControls']['updateResourceState'](_0x5ef302,_0x110646,_0x3e0825);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x46cdf9){this['_view']['chatControls']['setAddContextOptions'](_0x46cdf9);}['updateCapabilities'](_0x627a0d){this['_view']['chatControls']['setWebSearch'](_0x627a0d['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x627a0d['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x627a0d));}['setSelectedModel'](_0x3438e9,_0x5b4117){this['_view']['chatControls']['setModel'](_0x3438e9),_0x5b4117&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x25cfc1){this['feedItemRenderingStrategy']=_0x25cfc1;}['toggleLoadingSkeleton'](_0x28fc20){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x28fc20);}['resetConversationTitle'](){this['setConversationTitle'](i(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x18362e,_0x1a593d=!0x1){if(_0x1a593d&&!Rt()&&_0x18362e['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x18362e);this['_view']['chatHeader']['label']=_0x18362e;}['setLoadingMessage'](_0x1aab9f){this['_view']['chatFeed']['setLoadingMessage'](_0x1aab9f);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x44f82c){let _0x3d466f=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x44f82c[_0x3d466f],_0x3d466f++,_0x3d466f===_0x44f82c['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x316a3d){this['_view']['chatHeader']['isMaximized']=_0x316a3d;}['prepareLoadingMessage'](_0x55198e){return _0x55198e['isWebSearchEnabled']&&_0x55198e['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x55198e['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x55198e['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x5296d7){return _0x5296d7?_0x5296d7['isWebSearchEnabled']&&_0x5296d7['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x5296d7['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x5296d7['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x3a9982,_0xa9c5e8,_0x4c2477,_0x44bd35){this['_view']['populateSourceResourceBalloon'](_0x3a9982,_0xa9c5e8,_0x4c2477,_0x44bd35);}['closeSourceResourceBalloon'](_0x2f2770){this['_view']['closeSourceResourceBalloon'](_0x2f2770);}['setPromptInputValue'](_0x606c1b){this['_view']['chatControls']['setPromptInputValue'](_0x606c1b);}['focusPromptInput'](_0x18ce52=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x18ce52);}['scrollFeedToSuggestion'](_0x45c4d3,_0x5e4ac3){this['_view']['chatFeed']['scrollToSuggestion'](_0x45c4d3,_0x5e4ac3);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class yi extends _0x56abe9{['sections'];constructor(_0x130ac7,_0x273d97){super(_0x130ac7),this['sections']=_0x273d97,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x5bc35b){let _0xe0ecd5=0x0,_0x424bd3=0x0;for(const _0x32fc6c of this['sections']){const {resultsCount:_0x2779fc,totalItemsCount:_0x45c15e}=_0x32fc6c['filter'](_0x5bc35b);_0xe0ecd5+=_0x2779fc,_0x424bd3+=_0x45c15e;}return{'resultsCount':_0xe0ecd5,'totalItemsCount':_0x424bd3};}}class Ei extends _0x1cf10a{['title'];['itemsViews'];['_itemsListView'];constructor(_0x10a28b,{title:_0x500a01,items:_0x51226a}){super(_0x10a28b);const _0x23880c=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x500a01,this['itemsViews']=_0x51226a;const _0x5f03c9=new _0x25f6b6(_0x10a28b);_0x5f03c9['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x56abe9(_0x10a28b),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x23880c['if']('isVisible','ck-hidden',_0x576b20=>!_0x576b20)]},'children':[_0x5f03c9,this['_itemsListView']]});}['filter'](_0x4ab7e7){const _0x5bdff6=this['itemsViews']['length'];let _0x4dc1b6=0x0;for(const _0x46b3dd of this['itemsViews']){if(_0x4ab7e7){const _0x58094c=_0x46b3dd['isMatching'](_0x4ab7e7);_0x46b3dd['isVisible']=!!_0x58094c,_0x46b3dd['highlightText'](_0x4ab7e7);}else _0x46b3dd['isVisible']=!0x0,_0x46b3dd['highlightText'](null);_0x46b3dd['isVisible']&&_0x4dc1b6++;}return this['isVisible']=_0x4dc1b6>0x0,{'resultsCount':_0x4dc1b6,'totalItemsCount':_0x5bdff6};}['getItem'](_0x47fd35){return this['itemsViews']['find'](_0x4829be=>_0x4829be['id']===_0x47fd35);}['removeItem'](_0xf94de){const _0x4ef3f5=this['itemsViews']['indexOf'](_0xf94de);-0x1!==_0x4ef3f5&&(this['itemsViews']['splice'](_0x4ef3f5,0x1),this['_itemsListView']['items']['remove'](_0xf94de));}}class Ri extends/* #__PURE__ -- @preserve */
27
- _0x4d7972(_0x1cf10a){['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(_0x449b65,_0x2e175b){super(_0x449b65);const _0x1b00ed=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x2e175b['pinned']),this['set']('loadingState',null),this['id']=_0x2e175b['id'];const {title:_0x4bee4b,createdAt:_0x2d0131,active:_0x106a45=!0x1}=_0x2e175b;this['_titleView']=new _0x139c4b(),this['_titleView']['text']=_0x4bee4b,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x4b1459=this['_createCheckView'](),_0x116611=this['_createPinButtonView'](_0x449b65),_0x3e2c93=this['_createMenuDropdownView'](),_0x3b7b7a=this['_createEditInputView'](_0x449b65,_0x4bee4b),_0x2fda5b=this['_createAcceptEditButtonView'](_0x449b65,_0x3b7b7a),_0x31c7e4=this['_createCancelEditButtonView'](_0x449b65,_0x3b7b7a);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x116611),this['actions']['add'](_0x3e2c93),this['on']('change:isEdit',(_0xb89e65,_0x2b36ad,_0x28903a)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x28903a?(this['actions']['add'](_0x2fda5b),this['actions']['add'](_0x31c7e4),this['mainContent']['add'](_0x3b7b7a),_0x3b7b7a['element']['focus']()):(this['actions']['add'](_0x116611),this['actions']['add'](_0x3e2c93),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x106a45?'ck-ai-chat-history__item--active':'',_0x1b00ed['if']('isVisible','ck-hidden',_0x30d579=>!_0x30d579),_0x1b00ed['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',_0x1b00ed['if']('loadingState','ck-hidden',_0x9dae0d=>!!_0x9dae0d)]},'children':_0x106a45?[_0x4b1459]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x1b00ed['if']('loadingState','ck-hidden',_0x66cb1c=>!_0x66cb1c)]},'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',_0x1b00ed['if']('loadingState','ck-hidden',_0x1de0d6=>!!_0x1de0d6)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x1b00ed['if']('loadingState','ck-hidden',_0x5f01e4=>!_0x5f01e4)]},'children':[{'text':_0x1b00ed['to']('loadingState',_0x19ddfd=>_0x19ddfd?i(this['locale'],Ri['LOADING_LABELS'][_0x19ddfd]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x2d0131]}]},{'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'](_0x5e7b60){this['_titleView']['text']=_0x169b70(_0x5e7b60);}['updateLoadingState'](_0x16f683,_0x443a6c){this['set']('loadingState',_0x443a6c?_0x16f683:null);}['_createCheckView'](){const _0x47da9b=new _0x283d41();return _0x47da9b['set']({'content':_0x13f61e}),_0x47da9b;}['_createPinButtonView'](_0x15f268){const _0x2282b6=new _0x28db64(_0x15f268);return _0x2282b6['set']({'label':i(_0x15f268,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x194933,'withText':!0x1,'tooltip':!0x0}),_0x2282b6['bind']('isOn')['to'](this,'pinned'),_0x2282b6['on']('execute',()=>{const _0x3045b8=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x3045b8});}),_0x2282b6;}['_createMenuDropdownView'](){const _0x2c2563=_0x340743(this['locale'],_0x5c73fa),_0x52feeb=_0x2c2563['panelView']['children'];_0x2c2563['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x38a34c}),_0x2c2563['panelPosition']='sw';const _0x30fae5=new _0x28db64(this['locale']);_0x30fae5['label']=i(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x30fae5['withText']=!0x0,_0x30fae5['on']('execute',()=>{this['isEdit']=!0x0;});const _0x28858f=new _0x28db64(this['locale']);_0x28858f['label']=i(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x28858f['withText']=!0x0,_0x28858f['on']('execute',()=>{this['showConfirm'](i(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x1f38db=new _0x56abe9(this['locale']),_0x4b4cb9=new _0x1cf10a(this['locale']);_0x4b4cb9['children']['add'](_0x30fae5);const _0x499b9e=new _0x1cf10a(this['locale']);return _0x499b9e['children']['add'](_0x28858f),_0x1f38db['items']['addMany']([_0x4b4cb9,_0x499b9e]),_0x52feeb['add'](_0x1f38db),_0x2c2563;}['_createEditInputView'](_0xdcee54,_0x5f127c){const _0x1ee257=new _0x19df65(_0xdcee54),_0x78ef7=_0x1ee257['bindTemplate'];return _0x1ee257['value']=_0x5f127c,_0x1ee257['extendTemplate']({'on':{'keydown':_0x78ef7['to'](_0x2de706=>{'Enter'==_0x2de706['key']&&this['_commitEditInputValue'](_0x1ee257);})}}),_0x1ee257;}['_createAcceptEditButtonView'](_0x4ba6c3,_0x179423){const _0x4aa971=new _0x28db64(_0x4ba6c3);return _0x4aa971['set']({'icon':_0x13f61e,'withText':!0x1,'tooltip':i(_0x4ba6c3,'AI_CHAT_HISTORY_ACCEPT')}),_0x4aa971['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x4aa971['on']('execute',()=>{this['_commitEditInputValue'](_0x179423);}),_0x4aa971;}['_commitEditInputValue'](_0x23bee0){const _0x2f41e0=_0x23bee0['element']['value']||'';this['_titleView']['text']=_0x2f41e0,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x2f41e0});}['_createCancelEditButtonView'](_0x5ec4f6,_0x34b15e){const _0x471d33=new _0x28db64(_0x5ec4f6);return _0x471d33['set']({'icon':_0x58fd68,'withText':!0x1,'tooltip':i(_0x5ec4f6,'AI_CHAT_HISTORY_CANCEL')}),_0x471d33['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x471d33['on']('execute',()=>{this['isEdit']=!0x1,_0x34b15e['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x471d33;}['_createSpinnerView'](){const _0x5c76a9=new li('tiny');return _0x5c76a9['isVisible']=!0x0,_0x5c76a9;}['isMatching'](_0x48d909){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x48d909)?{'title':!0x0}:null;}['highlightText'](_0x3c1d16){this['_titleView']['highlightText'](_0x3c1d16);}}class wt extends _0x25f6b6{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0xa6f52f,_0xaf8c20){super(_0xa6f52f),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x49de72=new _0x214d1d(_0xa6f52f,{'label':i(_0xa6f52f,'AI_CHAT_HISTORY_HEADING'),'icon':Nt,'class':'ck-ai-header\x20ck-ai-header_history'});_0xaf8c20&&(this['resizeButton']=Hs(_0xa6f52f,this),_0x49de72['children']['add'](this['resizeButton'])),this['sectionsView']=new yi(_0xa6f52f,[]),this['sectionsView']['delegate'](...Mi)['to'](this),this['mainErrorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),this['mainErrorView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isMainErrorViewVisible','ck-hidden',_0x5d8a29=>!_0x5d8a29)]}}),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':[_0x49de72,{'tag':'div','attributes':{'class':['ck-ai-chat-history__content']},'children':[this['skeletonView'],this['mainErrorView'],this['emptyView'],this['searchView']]}]});}['_updateViewVisibility'](){this['isSearchViewVisible']=!this['isLoading']&&this['hasItems'],this['isEmptyViewVisible']=!this['isLoading']&&!this['hasItems']&&!this['errorMessage'],this['isMainErrorViewVisible']=!this['isSearchViewVisible']&&!!this['errorMessage'];}['_createSearchView'](){const _0x2287c4=new _0x39747a(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x422051=>i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x422051),'secondary':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x14f5ab=this['_createErrorView']();return _0x14f5ab['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x2b5f47=>!_0x2b5f47)]}}),_0x2287c4['on']('render',()=>{_0x2287c4['children']['add'](_0x14f5ab,0x1);}),_0x2287c4['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x37298c=>!_0x37298c)]}}),_0x2287c4;}['_createSkeletonView'](){const _0x44441e=new ai(this['locale'],di['aiHistory']);return _0x44441e['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x4d4962=>!_0x4d4962)]}}),_0x44441e;}['_createErrorView'](){const _0x46f934=new _0x25f6b6(this['locale']),_0x2ab093=new _0x28db64(this['locale']);_0x2ab093['set']({'withText':!0x1,'icon':_0x58fd68,'class':'ck-ai-notification_error__dismiss-button'}),_0x2ab093['bind']('isVisible')['to'](this,'hasItems',_0x1bb817=>!!_0x1bb817),_0x2ab093['on']('execute',()=>{this['errorMessage']='';});const _0x2d229c=this['bindTemplate'];return _0x46f934['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x2d229c['to']('errorMessage')}]},_0x2ab093]}),_0x46f934;}['_createEmptyStateView'](){const _0x21fbff=new _0x28db64(this['locale']);_0x21fbff['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x5deb17,'class':'ck-ai-chat__start-conversation'}),_0x21fbff['on']('execute',()=>{this['fire']('openChat');});const _0x30ed91=new _0x25f6b6(this['locale']);return _0x30ed91['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x5d896d=>!_0x5d896d)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[i(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x21fbff]}),_0x30ed91;}['_createListItemViews'](_0x1242c3,_0x465f43){const _0x5629f0=[];for(const _0x39ce38 of _0x1242c3){const _0x58395b=new Ri(_0x465f43,_0x39ce38);_0x58395b['delegate'](...Mi)['to'](this),_0x5629f0['push'](_0x58395b);}return _0x5629f0;}['updateHistoryItemsWithCategories'](_0x2c2338){const _0x15bb2b=this['locale']||'en',_0x724301=[];for(const _0x4f3e44 of _0x2c2338){const _0x31dc1f=this['_createListItemViews'](_0x4f3e44['items'],_0x15bb2b);_0x724301['push'](new Ei(_0x15bb2b,{'title':_0x4f3e44['title'],'items':_0x31dc1f}));}this['sectionsView']['sections']=_0x724301,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x724301),this['hasItems']=_0x2c2338['some'](_0x407c8d=>_0x407c8d['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x5ad2ff){for(const _0x5edf76 of this['sectionsView']['sections']){const _0x325d5c=_0x5edf76['getItem'](_0x5ad2ff);if(_0x325d5c){if(_0x5edf76['removeItem'](_0x325d5c),0x0===_0x5edf76['itemsViews']['length']){const _0x3d3100=this['sectionsView']['sections']['indexOf'](_0x5edf76);-0x1!==_0x3d3100&&(this['sectionsView']['sections']['splice'](_0x3d3100,0x1),this['sectionsView']['items']['remove'](_0x5edf76));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x2aa089,_0x2a94dd){for(const _0x4b0782 of this['sectionsView']['sections']){const _0x5eeed5=_0x4b0782['getItem'](_0x2aa089);if(_0x5eeed5){_0x5eeed5['updateTitle'](_0x2a94dd);break;}}}['updateItemLoadingState'](_0x506dee,_0x50957b,_0x299dbb){for(const _0x304ad5 of this['sectionsView']['sections']){const _0x401ae4=_0x304ad5['getItem'](_0x506dee);if(_0x401ae4){_0x401ae4['updateLoadingState'](_0x50957b,_0x299dbb);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x35f914=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x35f914);}}}const Mi=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class xt extends _0x3de4b5{static get['requires'](){return[pt];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x275083){super(_0x275083);const _0x37e420=this['context']['plugins']['get']('AITabs');this['_historyView']=new wt(this['context']['locale'],_0x37e420['showResizeButton']),this['_historyView']['delegate'](...Mi)['to'](this),_0x37e420['view']['addTab']({'id':'history','buttonLabel':i(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Nt,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x2fb255){this['_historyView']['removeHistoryItem'](_0x2fb255);}['updateItems'](_0x2962fa){this['_historyView']['updateHistoryItemsWithCategories'](_0x2962fa);}['updateItemTitle'](_0x2e3e28,_0x4f2d91){this['_historyView']['updateItemTitle'](_0x2e3e28,_0x4f2d91);}['updateItemLoadingState'](_0x49364f,_0x58a0c7,_0xde9cc0){this['_historyView']['updateItemLoadingState'](_0x49364f,_0x58a0c7,_0xde9cc0);}['setLoadingSkeleton'](_0x4b5f5c){this['_historyView']['isLoading']=_0x4b5f5c;}['showError'](_0x5238bc){this['_historyView']['errorMessage']=_0x5238bc;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x549401){this['_historyView']['isMaximized']=_0x549401;}}class nr extends ts(){['id'];['createdAt'];constructor({id:_0x2c7948,title:_0x78387,createdAt:_0x176bfe,updatedAt:_0x215804,pinned:_0xdf37b7}){super(),this['id']=_0x2c7948,this['createdAt']=new Date(_0x176bfe),this['set']('title',_0x78387),this['set']('updatedAt',_0x215804?new Date(_0x215804):null),this['set']('pinned',_0xdf37b7||!0x1);}['updateTitle'](_0x54a499){this['set']('title',_0x169b70(_0x54a499)),this['updatedAt']=new Date();}['updatePinned'](_0x2e408e){this['set']('pinned',_0x2e408e),this['updatedAt']=new Date();}}class Ht extends _0x12cec9(){['items']=[];['connector'];['group'];constructor({connector:_0x3da72e,group:_0x6b5eb2}){super(),this['connector']=_0x3da72e,this['group']=_0x6b5eb2;}async['init'](){try{const _0x578fec=this['connector']['fetchConversations'](this['group']),_0xa35982=await _0x578fec['getConversations']();this['loadItems'](_0xa35982);}catch(_0x1e3222){this['fire']('error',{'error':_0x1e3222,'operation':'init'});}}['addItem'](_0x28e2d9){this['items']['push'](_0x28e2d9);}async['removeItem'](_0x522365){const _0x386b20=this['items']['findIndex'](_0x3b60af=>_0x3b60af['id']===_0x522365);if(-0x1===_0x386b20)return!0x1;try{return await this['connector']['deleteConversation'](_0x522365)['execute'](),this['items']['splice'](_0x386b20,0x1),this['fire']('itemRemoved',{'itemId':_0x522365}),!0x0;}catch(_0x4d67e8){return this['fire']('error',{'error':_0x4d67e8,'operation':'removeItem','itemId':_0x522365}),!0x1;}}['getItem'](_0x421c28){return this['items']['find'](_0xa5a4ee=>_0xa5a4ee['id']===_0x421c28);}async['updateItemTitle'](_0x17646e,_0x35c58a){const _0x47aacd=this['getItem'](_0x17646e);if(!_0x47aacd)return!0x1;try{return await this['connector']['updateConversation'](_0x17646e,{'title':_0x35c58a})['getResult'](),_0x47aacd['updateTitle'](_0x35c58a),this['fire']('itemUpdated',{'itemId':_0x17646e,'updates':{'title':_0x35c58a}}),!0x0;}catch(_0x513936){return this['fire']('error',{'error':_0x513936,'operation':'updateItemTitle','itemId':_0x17646e}),!0x1;}}async['updateItemPinned'](_0xd6511e,_0x1180c9){const _0x22d6ab=this['getItem'](_0xd6511e);if(!_0x22d6ab)return!0x1;try{return await this['connector']['updateConversation'](_0xd6511e,{'pinned':_0x1180c9})['getResult'](),_0x22d6ab['updatePinned'](_0x1180c9),this['fire']('itemUpdated',{'itemId':_0xd6511e,'updates':{'pinned':_0x1180c9}}),!0x0;}catch(_0x46a699){return this['fire']('error',{'error':_0x46a699,'operation':'updateItemPinned','itemId':_0xd6511e}),!0x1;}}['loadItems'](_0xc00137){try{this['items']=[],_0xc00137['map'](_0x56e145=>{this['addItem'](new nr(_0x56e145));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x22243d){this['fire']('error',{'error':_0x22243d,'operation':'loadItems'});}}['getItems'](_0x2f22d0={}){const _0x3fad7d=void 0x0!==_0x2f22d0['pinned']&&_0x2f22d0['pinned'],_0x1b4efa=_0x2f22d0['from']?new Date(_0x2f22d0['from']['getFullYear'](),_0x2f22d0['from']['getMonth'](),_0x2f22d0['from']['getDate']()):null,_0x3de3b5=_0x2f22d0['to']?new Date(_0x2f22d0['to']['getFullYear'](),_0x2f22d0['to']['getMonth'](),_0x2f22d0['to']['getDate']()):null;return this['items']['filter'](_0x37804e=>{if(_0x37804e['pinned']!==_0x3fad7d)return!0x1;if(_0x3de3b5){const _0x21a6f8=new Date(_0x37804e['createdAt']['getFullYear'](),_0x37804e['createdAt']['getMonth'](),_0x37804e['createdAt']['getDate']());return _0x1b4efa?_0x1b4efa['getTime']()===_0x3de3b5['getTime']()?_0x21a6f8['getTime']()===_0x1b4efa['getTime']():_0x21a6f8<_0x3de3b5&&_0x21a6f8>=_0x1b4efa:_0x21a6f8<_0x3de3b5;}return!0x0;});}}class jt extends _0x3de4b5{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[q,at,xt,pt];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](q),this['_aiChatHistoryUi']=this['context']['plugins']['get'](xt),this['_aiChatController']=this['context']['plugins']['get'](at);const _0x13fb5e=this['context']['plugins']['get'](pt);try{const _0x4c9be1=this['_aiChatController']['getGroupId']();this['history']=new Ht({'connector':this['_aiConnector'],'group':_0x4c9be1}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x2a0676,_0x507d5c)=>{this['_setItemLoading'](_0x507d5c['id'],'remove'),this['_handleRemove'](_0x507d5c['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0xb5ca07,_0xb32e60)=>{this['_setItemLoading'](_0xb32e60['id'],'rename'),this['_handleEditTitle'](_0xb32e60['id'],_0xb32e60['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x1743bd,_0x5a246c)=>{void 0x0!==_0x5a246c['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x5a246c['itemId'],_0x5a246c['updates']['title']),void 0x0!==_0x5a246c['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x5a246c['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x1fe373,_0x3650c5)=>{this['_aiChatController']['handleRemovedConversation'](_0x3650c5['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x3650c5['itemId']),this['_clearItemLoading'](_0x3650c5['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x3667a0,_0x15cbaf)=>{this['_handleHistoryErrorUI'](_0x15cbaf['error'],_0x15cbaf['operation'],_0x15cbaf['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x41becc,_0x19f884)=>{this['_handleSelectConversation'](_0x19f884['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0xa9ed3,_0x1307b4)=>{const _0x480948=_0x1307b4['pinned']?'pin':'unpin';this['_setItemLoading'](_0x1307b4['id'],_0x480948),this['_handleTogglePin'](_0x1307b4['id'],_0x1307b4['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x13fb5e['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x13fb5e['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x13fb5e,'resizedTabs',(_0x1518f3,_0x5626d0)=>{this['_setIsMaximized'](_0x5626d0);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x13fb5e['resize']();});}catch(_0x311628){this['_handleHistoryErrorUI'](_0x311628,'init');}}async['_handleEditTitle'](_0x2bea70,_0x10007f){await this['history']['updateItemTitle'](_0x2bea70,_0x10007f);}async['_handleTogglePin'](_0x54a6ef,_0x53ac6d){await this['history']['updateItemPinned'](_0x54a6ef,_0x53ac6d);}async['_handleRemove'](_0x282ab7){await this['history']['removeItem'](_0x282ab7);}async['_handleSelectConversation'](_0x164abc){await this['_aiChatController']['loadConversation'](_0x164abc);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x5d9678=this['_aiChatController']['activeConversation']?.['id'],_0x48da47=this['_getCategorizedItems']()['map'](_0xaeeb0a=>({'title':_0xaeeb0a['title'],'items':_0xaeeb0a['items']['map'](_0x3e084e=>({'id':_0x3e084e['id'],'title':_0x3e084e['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x3e084e['createdAt'])['toLocaleDateString'](),'active':_0x3e084e['id']===_0x5d9678,'pinned':_0x3e084e['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x48da47);}['_setItemLoading'](_0x178bb5,_0x4e2474){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x178bb5,_0x4e2474,!0x0);}['_clearItemLoading'](_0x358db3){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x358db3,null,!0x1);}['_handleHistoryErrorUI'](_0x5bf69d,_0x575956,_0x1593bd){const _0x42f447=this['_generateErrorMessage'](_0x575956,_0x1593bd);this['_aiChatHistoryUi']['showError'](_0x42f447),_0x1593bd&&this['_clearItemLoading'](_0x1593bd),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x1ffb8,_0x48cb9c){const _0x3c1765=_0x48cb9c?this['history']['getItem'](_0x48cb9c):null,_0x47a593=_0x3c1765?.['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x1ffb8){case'updateItemTitle':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x47a593);case'updateItemPinned':{const _0x2bf816=i(this['context']['locale'],_0x3c1765?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x2bf816,_0x47a593]);}case'removeItem':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x47a593);case'init':case'loadItems':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x1f04e7=new Date(),_0x2d7381=new Date(_0x1f04e7['getFullYear'](),_0x1f04e7['getMonth'](),_0x1f04e7['getDate']()),_0xd4d0f6=new Date(_0x2d7381);_0xd4d0f6['setDate'](_0xd4d0f6['getDate']()-0x1);const _0x1a985d=new Date(_0x2d7381);_0x1a985d['setDate'](_0x1a985d['getDate']()-0xe);const _0x1e2c86=this['history']['getItems']({'pinned':!0x0}),_0x569eab=this['history']['getItems']({'from':_0x2d7381,'to':_0x2d7381}),_0x202ec1=this['history']['getItems']({'from':_0xd4d0f6,'to':_0xd4d0f6}),_0xf36a26=this['history']['getItems']({'from':_0x1a985d,'to':_0xd4d0f6}),_0xe5d8d9=this['history']['getItems']({'to':_0x1a985d}),_0x53a241=[];return _0x1e2c86['length']>0x0&&_0x53a241['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x1e2c86}),_0x569eab['length']>0x0&&_0x53a241['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x569eab}),_0x202ec1['length']>0x0&&_0x53a241['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x202ec1}),_0xf36a26['length']>0x0&&_0x53a241['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0xf36a26}),_0xe5d8d9['length']>0x0&&_0x53a241['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0xe5d8d9}),_0x53a241;}['_setIsMaximized'](_0x5e5b35){this['_aiChatHistoryUi']['setIsMaximized'](_0x5e5b35);}}class ht extends _0x3de4b5{static get['requires'](){return[jt,xt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ma extends _0x3de4b5{static get['requires'](){return[at,D,ct,ht];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x485ac2){super(_0x485ac2),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),this['context']['config']['define']('ai.chat.initialConversation','new');}async['addSelectionToChatContext'](){await this['context']['plugins']['get'](at)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](at)['startConversation']();}async['sendMessage']({message:_0x46c0eb,attributes:_0x16b558}){await this['context']['plugins']['get'](at)['sendMessage']({'message':_0x46c0eb,'attributes':_0x16b558});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](at)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](at)['focusPromptInput']();}['registerToolDataCallback'](_0x22a724){this['context']['plugins']['get'](at)['_registerToolDataCallback'](_0x22a724);}}class fs extends _0x28db64{['id'];constructor(_0x1c1c19,_0xabffda){super(_0x1c1c19);const {id:_0x477165,type:_0x410ff8,icon:_0x44cc7f}=_0xabffda;this['id']=_0x477165,this['set']({'label':_0xabffda['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0xabffda['id']}}),_0x44cc7f?this['icon']=_0x44cc7f:'chat'===_0x410ff8?this['icon']=_0x4e54e3:'review'===_0x410ff8?this['icon']=_0x3f4a47:'translate'===_0x410ff8&&(this['icon']=Vt);}}class kt extends _0x25f6b6{['listView'];constructor(_0xc6e26f,_0x4e56c2){super(_0xc6e26f);const _0x4d39dc=_0x4e56c2['map'](_0x579d39=>{const _0x444a75=new _0x1cf10a(this['locale']),_0x5bae6e=new fs(this['locale'],_0x579d39);return _0x444a75['children']['add'](_0x5bae6e),_0x5bae6e['delegate']('execute')['to'](this),_0x444a75;});this['listView']=new _0x56abe9(this['locale']),this['listView']['items']['addMany'](_0x4d39dc),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const Ut='chat-shortcuts';var Ua=function(_0x19bb95){return _0x19bb95['CHAT']='chat',_0x19bb95['REVIEW']='review',_0x19bb95['TRANSLATE']='translate',_0x19bb95;}({});class Va extends _0x3de4b5{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[ct];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](ct),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x55e560=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x55e560['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x55e560,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x324b1d=Object['values'](Ua);this['_shortcuts']['forEach'](_0x419481=>{let _0x5b0369=!0x0;if(_0x419481['id']&&_0x419481['label']&&_0x324b1d['includes'](_0x419481['type'])?'chat'===_0x419481['type']&&(_0x5b0369='string'==typeof _0x419481['prompt']):_0x5b0369=!0x1,!_0x5b0369)throw new _0x54686c('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x419481});});}['_injectShortcuts'](){const _0x3daffd=this['context']['plugins']['get'](ct);this['_shortcutsView']=new kt(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x3daffd['addFeedItemCustomElement'](this['_shortcutsView']['element'],Ut),this['_shortcutsView']['on']('execute',_0x49eb75=>{const _0x371f3f=_0x49eb75['source']['id'];this['_executeShortcut'](_0x371f3f);});}['_removeShortcuts'](){const _0x30d331=this['context']['plugins']['get'](ct);_0x30d331['hasFeedItem'](Ut)&&_0x30d331['removeFeedItem'](Ut),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x48fae3){const _0x1c2feb=this['_shortcuts']['find'](_0x354f3f=>_0x354f3f['id']===_0x48fae3),_0xb702a7=_0x1c2feb['type'];'chat'===_0xb702a7?this['_runChatShortcut'](_0x1c2feb):'review'===_0xb702a7?_0x1c2feb['check']?this['_runReviewShortcut'](_0x1c2feb):this['_switchTab']('reviewMode'):'translate'===_0xb702a7&&(_0x1c2feb['language']?this['_runTranslateShortcut'](_0x1c2feb):this['_switchTab']('translate'));}['_switchTab'](_0x43760f){if(!this['context']['plugins']['has']('AITabs'))throw new _0x54686c('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x43760f});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x43760f);}async['_runChatShortcut']({prompt:_0x33b26e,draftMode:_0x311acc,useWebSearch:_0x1dfb37=!0x1,useReasoning:_0x2d692f=!0x1,model:_0x175c9b}){const _0x517be4=this['context']['plugins']['get']('AIChat'),_0x172770=this['context']['plugins']['get']('AIChatController'),_0x1d6b9d=_0x172770['activeConversation'];let _0x3587f5;_0x3587f5=_0x175c9b?await _0x1d6b9d['chatModels']['getModel'](_0x175c9b):await _0x1d6b9d['chatModels']['getDefault'](),_0x3587f5&&await _0x1d6b9d['setModel'](_0x3587f5),_0x1d6b9d['setWebSearch'](_0x1dfb37),_0x1d6b9d['setReasoning'](_0x2d692f),_0x172770['addCurrentDocumentToChatContext'](),_0x311acc?(this['_aiChatUI']['setPromptInputValue'](_0x33b26e),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x517be4['sendMessage']({'message':_0x33b26e});}['_runReviewShortcut']({check:_0x3e6bb8,model:_0x5bcc13,prompt:_0x2260dc,params:_0x24e5cb}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new _0x54686c('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x5da44b={'id':_0x3e6bb8,'isCustom':'custom'===_0x3e6bb8};_0x5bcc13&&_0x2260dc&&(_0x5da44b['args']={'model':_0x5bcc13,'prompt':_0x2260dc}),_0x24e5cb&&(_0x5da44b['params']=_0x24e5cb),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x5da44b);}['_runTranslateShortcut']({language:_0x392eff}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new _0x54686c('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x392eff,'args':{'language':_0x392eff}});}}class io extends Lt{constructor(_0x4d09b7){super(_0x4d09b7);const _0x3c6b6d=_0x4d09b7['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x3c6b6d,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x17a177=this['editor']['plugins']['get']('AITabs')['view'];_0x17a177['isVisible']=!_0x17a177['isVisible'];}}class qt extends _0x558b99{static get['requires'](){return[pt];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x5b7e43=this['editor'];_0x5b7e43['commands']['add']('toggleAi',new io(_0x5b7e43)),_0x5b7e43['ui']['componentFactory']['add']('toggleAi',()=>{const _0x1b583d=this['_createAIUIButton'](_0x28db64);return _0x1b583d['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x1b583d;}),_0x5b7e43['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x432dd4=this['_createAIUIButton'](_0x42f0b4);return _0x432dd4['set']({'role':'menuitemcheckbox'}),_0x432dd4;});}['_createAIUIButton'](_0x4fe073){const _0x541374=this['editor'],_0x13abe6=_0x541374['commands']['get']('toggleAi'),_0x191bd5=new _0x4fe073(_0x541374['locale']);return _0x191bd5['set']({'label':i(_0x541374['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x2533ea,'isToggleable':!0x0}),_0x191bd5['bind']('isEnabled')['to'](_0x13abe6),_0x191bd5['bind']('isOn')['to'](_0x13abe6,'value',_0x3e32ec=>!!_0x3e32ec),this['listenTo'](_0x191bd5,'execute',()=>{_0x13abe6['execute']();}),_0x191bd5;}}const F=['applySuggestion','insertSuggestion','showNext','showPrevious'];class ls extends _0x25f6b6{['_errorView'];constructor(_0x2e7805){super(_0x2e7805),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x1bb76a){this['showError'](_0x1bb76a);}['showError'](_0x3537d3){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x3537d3,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x272365=new _0x25f6b6(this['locale']),_0x445f8e=new _0x25f6b6(this['locale']);return _0x445f8e['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x272365['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x328c41=>!_0x328c41)]},'children':[_0x445f8e]}),_0x272365;}}const $=0xa;class Q extends _0x3de4b5{static get['requires'](){return[D];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_isUpdatingMarkers']=!0x1;['open'](_0x4b9761){const {id:_0x33cd19}=this['_currentConfig']??{};this['_currentConfig']=_0x4b9761;const {id:_0x48f0e2}=this['_currentConfig'];this['isOpen']&&_0x33cd19===_0x48f0e2?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x3ec4f7=T(this['context'])['plugins']['get']('Dialog');_0x3ec4f7['isOpen']&&this['_currentConfig']&&_0x3ec4f7['id']===this['_currentConfig']['id']&&_0x3ec4f7['hide']();}['_updateDialog'](){const _0x2007a8=T(this['context'])['plugins']['get']('Dialog'),{icon:_0x382a24,title:_0x847d3a}=this['_currentConfig'];_0x2007a8['view']?.['headerView']&&(_0x2007a8['view']['headerView']['label']=_0x847d3a,_0x2007a8['view']['headerView']['iconView']&&_0x382a24&&(_0x2007a8['view']['headerView']['iconView']['content']=_0x382a24)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x2007a8['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](D)['showFakeVisualSelection'](this['_currentConfig']['ranges'],'ai-balloon-'+this['_currentConfig']['index'],!0x0,!0x0);}['_hideFakeVisualSelection'](_0x40d086){this['context']['plugins']['get'](D)['hideFakeVisualSelection']('ai-balloon-'+_0x40d086);}['_showDialog'](){const _0xcffd8a=T(this['context'])['plugins']['get']('Dialog'),{id:_0x139d90,title:_0x5b0896,icon:_0x55a36f,class:_0x104ade,mainView:_0x1d3c08}=this['_currentConfig'];_0x1d3c08['delegate'](...F)['to'](this),_0xcffd8a['show']({'title':_0x5b0896,'icon':_0x55a36f,'hasCloseButton':!0x0,'id':_0x139d90,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x104ade||''),'content':_0x1d3c08,'onShow':_0xa4d5dd=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x116da9=this['_getSelectionElements']();_0x116da9&&_0x116da9[0x0]&&_0x1dbe2e({'target':_0x116da9[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0xa4d5dd['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x139d90});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](this['_currentConfig']['index']),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x139d90}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x2c3ba2,_0x35e650){if(!_0x35e650)return null;const _0x4e9e61=this['_getSelectionElements']();if(!_0x4e9e61||0x0===_0x4e9e61['length'])return{'left':Math['round'](_0x35e650['left']+_0x35e650['width']/0x2-_0x2c3ba2['width']/0x2),'top':Math['round'](_0x35e650['top']+_0x35e650['height']/0x2-_0x2c3ba2['height']/0x2)};const _0x54055b=Math['round'](_0x35e650['left']+_0x35e650['width']/0x2-_0x2c3ba2['width']/0x2),_0x5e5bc0=_0x4e9e61['map'](_0x4148cf=>new _0x182987(_0x4148cf)),_0x122b36=_0x2c3ba2['height'];return{'left':_0x54055b,'top':this['_calculateOptimalTopPosition'](_0x5e5bc0,_0x122b36,_0x35e650)};}['_calculateOptimalTopPosition'](_0x2f49e0,_0x1e0b47,_0x596b77){const _0x560926=new _0x182987(_0x4b8472['window']),_0x1f083c=_0x2f49e0['map'](_0x20b492=>_0x20b492['getVisible']())['filter'](_0x3ad2bb=>_0x3ad2bb),_0x272a7c=_0x182987['getBoundingRect'](_0x1f083c);if(!_0x272a7c)return Math['round'](_0x596b77['top']+_0x596b77['height']/0x2);const _0x366c03=_0x560926['getIntersection'](_0x272a7c);if(!_0x366c03)return Math['round'](_0x596b77['top']+_0x596b77['height']/0x2);const _0x2e35c2=_0x596b77['getVisible'](),_0x296919=_0x2e35c2&&_0x272a7c['height']>_0x2e35c2['height'],_0x1fc3c5=_0x366c03['top'],_0x220f09=_0x366c03['bottom'];if(_0x296919){const _0x48e2fe=(_0x2e35c2||_0x560926)['height']/0x2-_0x1e0b47/0x2,_0x18fac5=_0x1fc3c5-$-_0x596b77['top'],_0x4f5541=_0x596b77['bottom']-_0x220f09-$;return _0x18fac5>=_0x1e0b47?Math['max']($,_0x1fc3c5-_0x1e0b47-$):_0x4f5541>=_0x1e0b47?_0x220f09+$:Math['max']($,_0x48e2fe);}const _0x5e56fe=_0x1fc3c5-_0x1e0b47,_0xbebd77=_0x596b77['bottom']-_0x220f09-$,_0x212e39=_0x1fc3c5-$-_0x596b77['top'];let _0x1eade0;if(_0xbebd77>=_0x1e0b47)_0x1eade0=_0x220f09+$;else{if(_0x212e39>=_0x1e0b47)_0x1eade0=_0x5e56fe-$;else _0x1eade0=_0x1fc3c5+_0x272a7c['height']/0x2-_0x1e0b47/0x2;}return _0x1eade0;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x3df711=T(this['context']);this['listenTo'](_0x3df711['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x1e23c0,data:{newRange:_0x4b54e5}}of _0x3df711['model']['document']['differ']['getChangedMarkers']())if(_0x1e23c0['startsWith'](R+':')&&(_0x4b54e5&&(_0x4b54e5['start']['isEqual'](_0x4b54e5['end'])||'$graveyard'==_0x4b54e5['root']['rootName'])||null==_0x4b54e5)){const _0x321882=i(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x321882),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x974a65=T(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x974a65['model']['document']);}['_getSelectionElements'](){const _0x1deebf=T(this['context']);return _0x133f0e(_0x1deebf['editing'],[..._0x1deebf['model']['markers']['getMarkersGroup']('ai-selection'),..._0x1deebf['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class us extends _0x28f204{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x393319,_0x55cf54={}){super(_0x393319),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x55cf54};const _0x13c259=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x13c259?'ck-ai-mini-toolbar\x20ck-hidden':'ck-ai-mini-toolbar',this['_config']['showCopy']&&(this['_setupCopyButton'](),this['items']['add'](this['copyButton'])),this['_config']['showChanges']&&(this['_setupShowChangesButton'](),this['items']['add'](this['showChangesButton'])),this['_setupRatingButtons'](),this['_config']['showLike']&&this['items']['add'](this['likeButton']),this['_config']['showDislike']&&this['items']['add'](this['dislikeButton']),this['_config']['customView']&&this['items']['addMany'](this['_config']['customView']);}['toggleShowChangesEnabled'](_0x1174c0){this['showChangesButton']['isEnabled']=_0x1174c0;}['_setupRatingButtons'](){this['likeButton']=new _0x28db64(this['locale']),this['likeButton']['set']({'icon':_0x37c703,'label':i(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x28db64(this['locale']),this['dislikeButton']['set']({'icon':_0x4bfbd1,'label':i(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x28db64(this['locale']),this['copyButton']['set']({'icon':_0x1e31e5,'label':i(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x3ddb75=new _0x283d41();_0x3ddb75['set']({'content':_0x5d07bd}),_0x3ddb75['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'](_0x3ddb75);}['_setupShowChangesButton'](){this['showChangesButton']=new _0x28db64(this['locale']),this['showChangesButton']['set']({'icon':_0x37b528,'label':i(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':'ck-ai-button-tertiary'}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x1791a5=>_0x1791a5?_0x477b28:_0x37b528),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class lt extends ls{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x37e3a8,_0x14f0cd){super(_0x37e3a8);const _0x1f8cf4=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new _0x49bffd(),this['_keystrokes']=new _0x287999(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x596602({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x14f0cd,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new as(_0x37e3a8),this['_partToolbarView']=new cs(_0x37e3a8,_0x14f0cd['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x14f0cd),this['_stateView']=new ws(_0x37e3a8),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new us(_0x37e3a8,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new ms(_0x37e3a8,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x21abeb,_0x1e5900,_0x1a1f74,_0xfab20e)=>{let _0x42e456,_0x4d32c5;'pending'===_0xfab20e?(_0x42e456=this['_partToolbarView'],_0x4d32c5=this['_stateView']):(_0x42e456=this['_stateView'],_0x4d32c5=this['_partToolbarView']),this['_stateView']['setState'](_0x1a1f74),_0x42e456['isVisible']=!0x1,_0x4d32c5['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x1f8cf4['to']('_state',_0x51a35=>'ck-ai-chat-balloon-main_state_'+_0x51a35)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x14f0cd);});}['render'](){super['render'](),this['nextButtonView']['render'](),this['previousButtonView']['render'](),this['_focusTracker']['add'](this['element']),this['_focusTracker']['add'](this['nextButtonView']),this['_focusTracker']['add'](this['previousButtonView']),this['_focusTracker']['add'](this['_miniToolbarView']),this['_focusTracker']['add'](this['_partToolbarView']),this['_keystrokes']['listenTo'](this['element']),this['_keystrokes']['listenTo'](this['nextButtonView']['element']),this['_keystrokes']['listenTo'](this['previousButtonView']['element']),this['_focusables']['addMany']([this['nextButtonView'],this['previousButtonView'],this['_partToolbarView'],this['_miniToolbarView']]);}['destroy'](){super['destroy'](),this['previousButtonView']['destroy'](),this['nextButtonView']['destroy']();}['focus'](){this['focusCycler']['focusFirst']();}['focusLast'](){this['focusCycler']['focusLast']();}async['updateContent'](_0x5e7f9b){_0x5e7f9b?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x5e7f9b);}['setState'](_0x43e1a3){this['_state']=_0x43e1a3;}['showError'](_0x5f44c6){super['showError'](_0x5f44c6),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x403602){super['showBlockingError'](_0x403602),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x4520ab){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x4520ab;}['togglePartToolbarEnabled'](_0x47676d){this['_partToolbarView']['isEnabled']=_0x47676d;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x3657fc,showSuggestButton:_0x340872}){_0x3657fc=_0x3657fc&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x340872=_0x340872&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x3657fc,'showSuggestButton':_0x340872});}['_createNextButtonView'](){const _0x33dd93=new _0x28db64(this['locale']);return _0x33dd93['set']({'icon':_0x2d9b3b,'label':i(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x33dd93['on']('execute',()=>{this['fire']('showNext');}),_0x33dd93;}['_createPreviousButtonView'](){const _0x51742f=new _0x28db64(this['locale']);return _0x51742f['set']({'icon':_0x10f0b1,'label':i(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x51742f['on']('execute',()=>{this['fire']('showPrevious');}),_0x51742f;}}class ms extends _0x25f6b6{constructor(_0x49892f,_0x13da44){super(_0x49892f),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x13da44});}}class Ot extends _0x558b99{static get['requires'](){return[_0x14d881,Q];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x4688d4){super(_0x4688d4),this['set']('showDiff',!0x1);}['open'](_0x10758b){const _0x3bd655=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x3bd655['plugins']['get']('AIBalloon')['open']({..._0x10758b,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x10758b['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x10758b['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x4c6709){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x4c6709);}['setState'](_0xbc4fb4){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0xbc4fb4);}['_createChatBalloonView'](){const _0x387fcd=this['editor'],_0x621680=_0x387fcd['plugins']['get']('AIBalloon'),_0xc75dea=_0x387fcd['commands']['get']('trackChanges');let _0x493c17=_0x387fcd['config']['get']('ai.availableReplyActions')||[...ot];_0x387fcd['plugins']['has']('TrackChanges')||(_0x493c17=_0x493c17['filter'](_0x27f148=>'insertSuggestion'!=_0x27f148));const _0x27ccce=new lt(_0x387fcd['locale'],{'availableActions':_0x493c17,'showApplyButton':!0x0,'showSuggestButton':!!_0xc75dea});return _0x27ccce['bind']('showDiff')['to'](this),_0x27ccce['delegate'](...ut)['to'](this),_0x27ccce['delegate']('showPrevious','showNext')['to'](this),_0x621680['delegate']('dialogClosed')['to'](this),_0x27ccce['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x27ccce['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x27ccce['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0xc75dea&&_0x27ccce['bind']('isTrackChangesOn')['to'](_0xc75dea,'value'),_0x27ccce['render'](),_0x27ccce;}['_toggleRotatorButtonsInDialogHeader'](_0x3173eb){const _0x56566c=this['editor'],_0x1884c9=_0x56566c['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x3173eb),_0x1884c9['has'](this['_chatBalloonView']['previousButtonView'])||(_0x1884c9['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x56566c['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x1884c9['remove'](this['_chatBalloonView']['previousButtonView']),_0x1884c9['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class Ba extends _0x558b99{static get['requires'](){return[qt,Ot,zt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Zt(_0x43e805){const {editor:_0x2bd609,action:_0xe9c8cf,withText:_0x3cfb35=!0x1,withIcon:_0x3e943d=!0x0,isInDropdown:_0x3336c1=!0x0,shouldPreventFocus:_0x5dfcd4=!0x1}=_0x43e805;return()=>{const _0x2bbe7d=_0x2bd609['locale'],_0x21b295=new _0x28db64(_0x2bbe7d),_0x38605e=_0x21b295['bindTemplate'];_0x3336c1&&_0x21b295['extendTemplate']({'on':{'mouseenter':_0x38605e['to'](()=>{_0x5dfcd4&&_0x5dfcd4()||_0x21b295['focus']();})}});const _0x45b596=_0xe9c8cf['icon']??_0xe9c8cf['parent']?.['icon'];return _0x21b295['set']({'label':_0xe9c8cf['displayedPrompt'],'withText':_0x3cfb35,'role':'menuitem','icon':_0x3e943d?_0x45b596??_0x12fe1f:void 0x0,'tooltip':!_0x3cfb35,'class':'ck-ai-quick-actions-button','isEnabled':_0xe9c8cf['isEnabled']}),_0x21b295['on']('execute',()=>{_0x2bd609['editing']['view']['focus'](),_0x2bd609['commands']['execute']('aiQuickAction',_0xe9c8cf);}),_0x21b295;};}class Ps extends _0x484834{['arrowView'];constructor(_0x2c7aaf,_0x576b03){super(_0x2c7aaf,_0x576b03);const _0x3742d4=this['bindTemplate'];this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':['ck-dropdown-menu-list__nested-menu__button'],'aria-haspopup':!0x0,'aria-expanded':this['bindTemplate']['to']('isOn',_0x1936bd=>String(_0x1936bd)),'data-cke-tooltip-disabled':_0x3742d4['to']('isOn')},'on':{'mouseenter':_0x3742d4['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x50b399=new _0x283d41();return _0x50b399['content']=_0x4f22f1,_0x50b399['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x50b399;}}class Ls extends _0x56abe9{['_allListItems'];['_allSearchableItems'];constructor(_0x153ccb,_0x287527,_0x5a9093){super(_0x153ccb),this['_allListItems']=_0x287527,this['_allSearchableItems']=_0x5a9093;}['filter'](_0x5ae10d){if(!_0x5ae10d)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x466a85=_0x5ae10d['source']['toLowerCase']()['trim'](),_0x2dea5d=this['_allSearchableItems']['filter'](_0x4722f7=>(_0x4722f7['groupLabel']?_0x4722f7['label']+'\x20('+_0x4722f7['groupLabel']+')':_0x4722f7['label'])['toLowerCase']()['includes'](_0x466a85));return this['items']['clear'](),this['items']['addMany'](_0x2dea5d['sort']((_0x5ed37e,_0x4747bb)=>{const _0x38e355=_0x5ed37e['groupLabel'],_0x1010c5=_0x4747bb['groupLabel'];return _0x38e355||_0x1010c5?_0x38e355?0x1:-0x1:0x0;})['map'](_0x255477=>_0x255477['item'])),this['_highlightQuery'](_0x466a85,_0x2dea5d),{'resultsCount':_0x2dea5d['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0xe80ad6,_0x37d193){if(!_0xe80ad6)return;const _0xb6405b=new RegExp(_0x2fe64e(_0xe80ad6),'gi');_0x37d193['forEach'](_0xeff9a=>{_0xeff9a['highlightViews']&&_0xeff9a['highlightViews']['forEach'](_0x2db5ce=>{'function'==typeof _0x2db5ce['highlightText']&&_0x2db5ce['highlightText'](_0xb6405b);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x1c8324=>{_0x1c8324['highlightViews']&&_0x1c8324['highlightViews']['forEach'](_0x11c7c2=>{'function'==typeof _0x11c7c2['highlightText']&&_0x11c7c2['highlightText'](null);});});}}const Qs='menu',Gs='menuitem';class co extends _0x25f6b6{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x146492,_0x18083c,_0x10a7b1,_0x2a2f4,_0x55ea80=!0x1){const _0x57e2bc=_0x146492['locale'];super(_0x57e2bc),this['_bodyCollection']=_0x2a2f4,this['_hasSearch']=_0x55ea80;const _0x4bdfa0=this['_createListItems'](_0x146492,_0x18083c,_0x10a7b1);this['optionsListView']=new Ls(_0x57e2bc,_0x4bdfa0,this['_allSearchableItems']),this['optionsListView']['role']=Qs,this['optionsListView']['items']['addMany'](_0x4bdfa0),this['focusTracker']=new _0x49bffd(),this['keystrokes']=new _0x287999(),_0x55ea80&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x4bdfa0,this['focusCycler']=new _0x596602({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x55ea80&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x54778b=_0x55ea80&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x3fe74c(_0x54778b),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x57e2bc['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x39747a(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':i(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':i(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x57370c=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x57370c);}['_createListItems'](_0x4f6c58,_0x3680a4,_0x200127){const _0x5df3ff=new _0x3fe74c();return _0x3680a4['forEach'](_0x3e5900=>{if('actions'in _0x3e5900){const {listItem:_0x1c866a}=this['_createActionGroupButton'](_0x4f6c58,_0x3e5900,_0x200127);_0x5df3ff['add'](_0x1c866a),_0x3e5900['actions']['forEach'](_0xc6201b=>{this['_createActionButton'](_0x4f6c58,_0xc6201b,_0x3e5900['label'],_0x3e5900['icon']);const {listItem:_0x4778fc,highlightViews:_0x3c36bb}=this['_createSearchResultActionButton'](_0x4f6c58,_0xc6201b,_0x3e5900['label'],_0x3e5900['icon']);this['_allSearchableItems']['push']({'item':_0x4778fc,'label':_0xc6201b['displayedPrompt'],'groupLabel':_0x3e5900['label'],'highlightViews':_0x3c36bb});});}else{const {listItem:_0x27627d}=this['_createActionButton'](_0x4f6c58,_0x3e5900);_0x5df3ff['add'](_0x27627d);const _0x3d412d=_0x27627d['children']['first'];if(_0x3d412d){const {listItem:_0x38841e,highlightViews:_0xb62ff0}=this['_createSearchResultActionButton'](_0x4f6c58,_0x3e5900);this['_allSearchableItems']['push']({'item':_0x38841e,'label':_0x3d412d['label']||'','highlightViews':_0xb62ff0});}}}),_0x5df3ff;}['_createActionButton'](_0x361721,_0x4aabdb,_0x285b5e,_0x213fad){const _0x26816f=new _0x1cf10a(this['locale']);if(_0x285b5e&&_0x213fad){const _0xa70cd9=new _0x28db64(this['locale']),_0x416281=_0xa70cd9['bindTemplate'],_0x56c258=new _0x139c4b();_0x56c258['text']=_0x4aabdb['displayedPrompt'];const _0x37698d=new _0x139c4b();_0x37698d['text']=_0x285b5e;const _0x25b7b2=new _0x283d41();_0x25b7b2['content']=_0x213fad,_0x25b7b2['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x2a5c77=new _0x25f6b6(this['locale']);_0x2a5c77['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x58137a=new _0x25f6b6(this['locale']);return _0x58137a['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0xa70cd9['set']({'label':_0x4aabdb['displayedPrompt']+'\x20('+_0x285b5e+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0xa70cd9['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-button_with-group'],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x56c258,_0x2a5c77,_0x25b7b2,_0x37698d,_0x58137a],'on':{'mouseenter':_0x416281['to'](()=>{this['_isSearchFocused']()||_0xa70cd9['focus']();}),'click':_0x416281['to'](()=>{_0xa70cd9['fire']('execute');})}}),_0xa70cd9['on']('execute',()=>{_0x361721['editing']['view']['focus'](),_0x361721['commands']['execute']('aiQuickAction',_0x4aabdb);}),_0x26816f['children']['add'](_0xa70cd9),{'listItem':_0x26816f,'highlightViews':[_0x56c258,_0x37698d]};}{const _0x4abb4f=new _0x4a5be9(),_0x3f7941=new _0x28db64(this['locale'],_0x4abb4f),_0x4ceb50=_0x3f7941['bindTemplate'],_0x3476c3=_0x4aabdb['icon']??_0x4aabdb['parent']?.['icon'],_0x3da11f=void 0x0!==_0x4aabdb['icon'];return _0x3f7941['set']({'label':_0x4aabdb['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':_0x3da11f?_0x3476c3??_0x12fe1f:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x3f7941['extendTemplate']({'on':{'mouseenter':_0x4ceb50['to'](()=>{this['_isSearchFocused']()||_0x3f7941['focus']();})}}),_0x3f7941['on']('execute',()=>{_0x361721['editing']['view']['focus'](),_0x361721['commands']['execute']('aiQuickAction',_0x4aabdb);}),_0x26816f['children']['add'](_0x3f7941),{'listItem':_0x26816f,'highlightViews':[_0x4abb4f]};}}['_createSearchResultActionButton'](_0xaea42c,_0xebf988,_0x50063c,_0x5709f6){return _0x50063c&&_0x5709f6?this['_createSearchResultGroupedActionButton'](_0xaea42c,_0xebf988,_0x50063c,_0x5709f6):this['_createSearchResultIndividualActionButton'](_0xaea42c,_0xebf988);}['_createSearchResultGroupedActionButton'](_0x111f06,_0x56ebed,_0x1ed5dd,_0x57b606){const _0x355d11=new _0x1cf10a(this['locale']),_0x29600d=new _0x28db64(this['locale']),_0x107603=_0x29600d['bindTemplate'],{view:_0x19296d,highlightView:_0xbc8b54}=this['_createSearchResultGroupRow'](_0x1ed5dd,_0x57b606),{view:_0x1c628e,highlightView:_0x128195}=this['_createSearchResultActionRow'](_0x56ebed['displayedPrompt']),_0x217428=this['_createSearchResultContentView'](_0x19296d,_0x1c628e);return _0x29600d['set']({'label':_0x56ebed['displayedPrompt'],'withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button\x20ck-ai-quick-actions-search-result-button_with-group','tooltip':!0x1}),_0x29600d['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-search-result-button','ck-ai-quick-actions-search-result-button_with-group'],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x217428],'on':{'mouseenter':_0x107603['to'](()=>{this['_isSearchFocused']()||_0x29600d['focus']();}),'click':_0x107603['to'](()=>{this['_handleSearchResultButtonClick'](_0x29600d);})}}),this['_setupActionButtonExecution'](_0x29600d,_0x111f06,_0x56ebed),_0x355d11['children']['add'](_0x29600d),{'listItem':_0x355d11,'highlightViews':[_0xbc8b54,_0x128195]};}['_createSearchResultIndividualActionButton'](_0x56ee59,_0xc0de94){const _0x3a2960=new _0x1cf10a(this['locale']),_0x376e96=new _0x4a5be9(),_0x5b284e=new _0x28db64(this['locale'],_0x376e96),_0x1bd90d=_0x5b284e['bindTemplate'];return _0x5b284e['set']({'label':_0xc0de94['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x5b284e['extendTemplate']({'on':{'mouseenter':_0x1bd90d['to'](()=>{this['_isSearchFocused']()||_0x5b284e['focus']();})}}),this['_setupActionButtonExecution'](_0x5b284e,_0x56ee59,_0xc0de94),_0x3a2960['children']['add'](_0x5b284e),{'listItem':_0x3a2960,'highlightViews':[_0x376e96]};}['_createSearchResultGroupRow'](_0x31e2e9,_0x316761){const _0x4fc9a5=new _0x25f6b6(this['locale']),_0x10f0ac=new _0x283d41();_0x10f0ac['content']=_0x316761,_0x10f0ac['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x186533=new _0x139c4b();return _0x186533['text']=_0x31e2e9,_0x4fc9a5['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x10f0ac,_0x186533]}),{'view':_0x4fc9a5,'highlightView':_0x186533};}['_createSearchResultActionRow'](_0x2684fe){const _0x3dcda9=new _0x25f6b6(this['locale']),_0x27bde0=new _0x139c4b();return _0x27bde0['text']=_0x2684fe,_0x3dcda9['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x27bde0]}),{'view':_0x3dcda9,'highlightView':_0x27bde0};}['_createSearchResultContentView'](_0x429996,_0x135235){const _0x150fe9=new _0x25f6b6(this['locale']);return _0x150fe9['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x429996,_0x135235]}),_0x150fe9;}['_setupActionButtonExecution'](_0x33d820,_0x1e1c3a,_0x22efbd){_0x33d820['on']('execute',()=>{_0x1e1c3a['editing']['view']['focus'](),_0x1e1c3a['commands']['execute']('aiQuickAction',_0x22efbd);});}['_createActionGroupButton'](_0x1c66cd,_0x217a61,_0x39ae7a){const _0x42c273=new _0x1cf10a(this['locale']),_0xc0be43=new _0x4a5be9(),_0x1c60ec=new Ps(this['locale'],_0xc0be43),_0x52b382=_0x1c60ec['bindTemplate'],_0x1ea76f=this['_getPanelKeystroke'](_0x39ae7a),_0x183d59=this['_createGroupActionsList'](_0x1c66cd,_0x217a61['actions'],_0x39ae7a);_0x1c60ec['set']({'label':_0x217a61['label'],'withText':!0x0,'role':Gs,'icon':_0x217a61['icon']??_0x12fe1f,'isEnabled':_0x217a61['actions']['some'](_0x430f01=>_0x430f01['isEnabled'])}),_0x1c60ec['extendTemplate']({'on':{'mouseenter':_0x52b382['to'](()=>{this['_isSearchFocused']()||_0x1c60ec['focus']();})}});const _0x3ee013=new _0x132eb0(this['locale']);return _0x3ee013['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x52b382['to'](_0x5880f9=>{this['_handlePanelKeydown'](_0x5880f9,_0x1ea76f,_0x1c60ec,_0x3ee013);})}}),_0x1c60ec['bind']('isOn')['to'](_0x3ee013,'isVisible'),this['_bodyCollection']['add'](_0x3ee013),_0x3ee013['content']['add'](_0x183d59),this['_setupGroupMenuBehavior'](_0x1c60ec,_0x3ee013),_0x42c273['children']['add'](_0x1c60ec),{'listItem':_0x42c273,'highlightView':_0xc0be43};}['_createGroupActionsList'](_0x13961a,_0x7b9a51,_0x4a324e){const _0x51fe8c=new _0x56abe9(this['locale']);return _0x51fe8c['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x7b9a51['forEach'](_0x2650dc=>{const _0x4b9bce=new _0x1cf10a(this['locale']),_0x4ac079=Zt({'editor':_0x13961a,'action':_0x2650dc,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x4b9bce['children']['add'](_0x4ac079),_0x4a324e['focusTracker']['add'](_0x4ac079),_0x51fe8c['items']['add'](_0x4b9bce);}),_0x51fe8c;}['_setupGroupMenuBehavior'](_0x23eb42,_0x3ce05c){const _0x1ad3e3=_0x23eb42['bindTemplate'],_0x4730f5=this['_getButtonKeystroke'](_0x23eb42);_0x23eb42['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x1ad3e3['to'](()=>{this['_showNestedPanel'](_0x3ce05c,_0x23eb42);}),'mouseleave':_0x1ad3e3['to'](_0x38a36e=>{const _0x110525=_0x38a36e['relatedTarget'];this['_isMovingToNestedMenu'](_0x110525,_0x3ce05c)||this['_hideNestedPanel'](_0x3ce05c);}),'keydown':_0x1ad3e3['to'](_0x58b96d=>{_0x58b96d['key']==_0x4730f5&&(this['_showNestedPanel'](_0x3ce05c,_0x23eb42),_0x3ce05c['content']['get'](0x0)['focus']());})}}),_0x3ce05c['on']('render',()=>{_0x3ce05c['element']?.['addEventListener']('mouseleave',_0xa26fb9=>{const _0x4d0b67=_0xa26fb9['relatedTarget'];_0x23eb42['element']?.['contains'](_0x4d0b67)||this['_isMovingToNestedMenu'](_0x4d0b67,_0x3ce05c)||this['_hideNestedPanel'](_0x3ce05c);});});}['_showNestedPanel'](_0x5f3cf0,_0x31b7a2){this['_openNestedPanels']['forEach'](_0x403512=>{_0x403512!==_0x5f3cf0&&_0x403512['isVisible']&&_0x403512['hide']();}),_0x5f3cf0['show'](),_0x5f3cf0['pin']({'positions':[_0x20372a['eastSouth']],'target':_0x31b7a2['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x5f3cf0);}['_hideNestedPanel'](_0x19619a){_0x19619a['hide'](),this['_openNestedPanels']['delete'](_0x19619a);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0xd6430d=>_0xd6430d['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x174382,_0x27e9e3){if(!_0x174382)return!0x1;if(_0x27e9e3['element']?.['contains'](_0x174382))return!0x0;const _0x240677=_0x174382;return _0x240677['closest']&&(null!==_0x240677['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x240677['closest']('.ck-ai-quick-actions-group-list')||null!==_0x240677['closest']('.ck-ai-quick-actions-group-button'));}['resetSearch'](){this['_searchTextView']&&this['_searchTextView']['reset']();}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['_searchTextView']?this['_searchTextView']['focus']():this['optionsListView']['focus']();}['_getPanelKeystroke'](_0x3d7ff9){return'rtl'===_0x3d7ff9['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x129001){return'rtl'===_0x129001['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x36318f,_0x5ac76e,_0x998fc9,_0x4efd2d){_0x36318f['key']==_0x5ac76e&&(_0x998fc9['focus'](),this['_hideNestedPanel'](_0x4efd2d));}['_handleSearchResultButtonClick'](_0x3dedd2){_0x3dedd2['fire']('execute');}}function Xt(_0xd20e90){const {editor:_0xe64b38,content:_0x395e59,buttonDefinition:_0x3e5831,bodyCollection:_0x5a667f,hasSearch:_0xa1b48c=!0x1}=_0xd20e90;return()=>{const _0x3dd9d5=_0xe64b38['locale'],_0x3f7f74=_0x340743(_0x3dd9d5);_0x3f7f74['buttonView']['set']({'icon':_0x3e5831['icon']??_0x12fe1f,'label':_0x3e5831['label'],'tooltip':!0x0}),_0x3f7f74['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x4c610f=new co(_0xe64b38,_0x395e59,_0x3f7f74,_0x5a667f,_0xa1b48c);if(_0x3f7f74['panelView']['children']['add'](_0x4c610f),_0xa1b48c){const _0x58d839='ai-quick-actions-dropdown-selection';_0x3f7f74['on']('change:isOpen',(_0x33ca35,_0x103044,_0x23123a)=>{if(_0x23123a){if(_0xe64b38['plugins']['has']('AIEditing')){const _0x109dd4=_0xe64b38['plugins']['get'](D),_0x1fc716=_0xe64b38['model']['document']['selection'],_0x3fd98f=Array['from'](_0x1fc716['getRanges']());_0x3fd98f['length']>0x0&&_0x109dd4['showFakeVisualSelection'](_0x3fd98f,_0x58d839,!0x1,!0x0);}}else _0xe64b38['plugins']['has']('AIEditing')&&_0xe64b38['plugins']['get'](D)['hideFakeVisualSelection'](_0x58d839),_0x4c610f['resetSearch']();});}return _0x3f7f74;};}const ee='<task>For\x20given\x20selected\x20part\x20of\x20HTML\x20document\x20you\x20must\x20explain\x20the\x20meaning\x20of\x20it\x27s\x20content\x20clearly\x20and\x20in\x20plain\x20language.</task><rules>1.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is:-\x20If\x20it\x20looks\x20like\x20a\x20definition\x20explain\x20the\x20concept\x20in\x20simple\x20terms.-\x20If\x20it\x20looks\x20like\x20a\x20description\x20clarify\x20what\x20it\x20is\x20describing\x20and\x20why\x20it\x20matters.-\x20If\x20it\x20contains\x20technical\x20terms\x20or\x20jargon\x20break\x20them\x20down\x20into\x20everyday\x20language.-\x20If\x20it\x20looks\x20instructional\x20restate\x20as\x20clear\x20steps\x20someone\x20can\x20follow.-\x20If\x20it\x20provides\x20examples\x20explain\x20what\x20the\x20example\x20shows\x20and\x20why\x20it\x27s\x20relevant.-\x20If\x20it\x20presents\x20an\x20argument\x20or\x20claim\x20restate\x20the\x20claim\x20neutrally\x20and\x20explain\x20its\x20purpose.-\x20If\x20it\x20is\x20narrative/story-like\x20explain\x20what\x20event\x20or\x20situation\x20is\x20being\x20described.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20explain\x20what\x20the\x20data\x20indicates.-\x20If\x20it\x20is\x20a\x20quotation\x20explain\x20the\x20meaning\x20of\x20the\x20quote\x20in\x20context.-\x20If\x20it\x20compares/contrasts\x20things\x20explain\x20the\x20key\x20differences\x20or\x20similarities\x20simply.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20give\x20a\x20clear,\x20plain-language\x20explanation\x20of\x20its\x20meaning,\x20focusing\x20on\x20usefulness.2.\x20Provide\x20context\x20if\x20the\x20meaning\x20could\x20be\x20unclear\x20without\x20it.\x20(e.g.,\x20explain\x20where\x20such\x20a\x20term\x20might\x20be\x20used,\x20or\x20why\x20it\x20is\x20important).3.\x20Keep\x20the\x20explanation\x20short\x20but\x20complete\x20(2–5\x20sentences).Avoid\x20overly\x20technical\x20detail\x20unless\x20it\x20is\x20necessary\x20for\x20understanding.4.\x20Do\x20not\x20simply\x20repeat\x20the\x20original\x20text\x20—\x20restate\x20and\x20expand\x20it\x20in\x20plain\x20words.5.\x20If\x20possible,\x20add\x20a\x20short\x20example\x20or\x20analogy\x20to\x20make\x20it\x20easier\x20to\x20understand.6.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20explanation.7.\x20Your\x20explanation\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20explanation.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',ie='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20summarize\x20its\x20content\x20in\x20a\x20few\x20sentences,\x20keeping\x20only\x20the\x20essential\x20meaning.</task><rules>1.\x20Your\x20summary\x20should\x20be\x20short\x20and\x20clear:-\x20Aim\x20for\x202–4\x20sentences\x20unless\x20the\x20text\x20is\x20extremely\x20short.-\x20Focus\x20on\x20capturing\x20the\x20main\x20idea(s)\x20without\x20unnecessary\x20detail.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20summary\x20style:-\x20If\x20it\x20is\x20descriptive\x20condense\x20the\x20description\x20into\x20its\x20core\x20idea.-\x20If\x20it\x20is\x20argumentative\x20or\x20opinion-based\x20summarize\x20the\x20main\x20claim\x20and\x20reasoning\x20neutrally.-\x20If\x20it\x20is\x20narrative/story-like\x20capture\x20the\x20main\x20event\x20or\x20outcome\x20without\x20side\x20details.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20summarize\x20what\x20the\x20data\x20shows\x20in\x20plain\x20language.-\x20If\x20it\x20is\x20instructional\x20restate\x20the\x20overall\x20purpose\x20of\x20the\x20steps\x20without\x20listing\x20every\x20step.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20provide\x20a\x20general\x20concise\x20summary.3.\x20Provide\x20context\x20if\x20necessary\x20for\x20clarity:-\x20Mention\x20the\x20subject\x20or\x20topic\x20explicitly\x20so\x20the\x20summary\x20can\x20stand\x20alone.4.\x20Do\x20not\x20simply\x20copy\x20sentences\x20from\x20the\x20original\x20text\x20—\x20rephrase\x20in\x20plain\x20language.5.\x20Avoid\x20adding\x20new\x20information\x20or\x20interpretation\x20not\x20present\x20in\x20the\x20text.6.\x20Summarize\x20in\x20a\x20way\x20that\x20would\x20make\x20sense\x20to\x20someone\x20who\x20has\x20not\x20read\x20the\x20original\x20text.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20summary.8.\x20Your\x20summary\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20summary.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',ne='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20extract\x20and\x20present\x20the\x20key\x20points\x20from\x20its\x20content.</task><rules>1.\x20Present\x20the\x20output\x20as\x20a\x20clear,\x20structured\x20list\x20(bullets\x20or\x20numbered).-\x20Each\x20point\x20should\x20be\x20concise\x20(one\x20sentence\x20or\x20less).-\x20Do\x20not\x20merge\x20distinct\x20ideas\x20into\x20one\x20bullet.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20extraction\x20style:-\x20If\x20it\x20is\x20descriptive\x20capture\x20the\x20main\x20attributes\x20or\x20features.-\x20If\x20it\x20is\x20argumentative\x20extract\x20the\x20main\x20claim\x20and\x20supporting\x20reasons\x20separately.-\x20If\x20it\x20is\x20narrative/story-like\x20extract\x20the\x20main\x20events\x20in\x20chronological\x20order.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20highlight\x20the\x20most\x20important\x20facts\x20or\x20numbers.-\x20If\x20it\x20is\x20instructional\x20list\x20the\x20steps\x20or\x20main\x20actions\x20in\x20simplified\x20form.-\x20If\x20it\x20provides\x20comparisons\x20extract\x20the\x20contrasted\x20items\x20and\x20their\x20differences/similarities.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20category\x20above\x20extract\x20the\x20main\x20ideas\x20in\x20plain,\x20short\x20statements.3.\x20Keep\x20the\x20list\x20between\x203–7\x20items\x20where\x20possible.-\x20If\x20the\x20text\x20is\x20very\x20short,\x20fewer\x20items\x20are\x20fine.-\x20If\x20it\x20is\x20very\x20long,\x20focus\x20on\x20the\x20most\x20important\x20ideas\x20only.4.\x20Do\x20not\x20copy\x20long\x20text\x20fragments\x20—\x20restate\x20in\x20simple\x20words.5.\x20Do\x20not\x20add\x20interpretation,\x20evaluation,\x20or\x20commentary\x20beyond\x20the\x20text.6.\x20Ensure\x20the\x20list\x20can\x20stand\x20alone\x20without\x20requiring\x20the\x20reader\x20to\x20see\x20the\x20original\x20document.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20key\x20points.8.\x20Your\x20key\x20points\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20extracted\x20key\x20points.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>';var Qt=function(_0x3475d0){return _0x3475d0['CHAT']='CHAT',_0x3475d0['ACTION']='ACTION',_0x3475d0['REVIEW']='REVIEW',_0x3475d0;}({}),Ga=function(_0x392d4e){return _0x392d4e['CHAT']='AIChat',_0x392d4e['ACTION']='AIActions',_0x392d4e['REVIEW']='AIReviewMode',_0x392d4e;}({});class ii extends _0x558b99{static get['requires'](){return[te,q];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x4e8ede=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x4e8ede),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x373f0d){return function(_0x19da1a){const _0x294fe7=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x19da1a['uiLanguage']),_0x3f6f7b=_0x294fe7||'English',_0x4e03bb=[{'id':'ask-ai','displayedPrompt':i(_0x19da1a,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Gt},{'id':'chat-commands','label':i(_0x19da1a,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Gt,'actions':[{'id':'explain','displayedPrompt':i(_0x19da1a,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':ee['replace']('%0',_0x3f6f7b),'type':'CHAT'},{'id':'summarize','displayedPrompt':i(_0x19da1a,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':ie['replace']('%0',_0x3f6f7b),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':i(_0x19da1a,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':ne['replace']('%0',_0x3f6f7b),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':i(_0x19da1a,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Bt},{'id':'continue','displayedPrompt':i(_0x19da1a,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Ft},{'id':'fix-grammar','displayedPrompt':i(_0x19da1a,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Wt},{'id':'adjust-length','label':i(_0x19da1a,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Kt,'actions':[{'id':'make-shorter','displayedPrompt':i(_0x19da1a,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':i(_0x19da1a,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':i(_0x19da1a,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Yt,'actions':[{'id':'make-tone-casual','displayedPrompt':i(_0x19da1a,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':i(_0x19da1a,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':i(_0x19da1a,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':i(_0x19da1a,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':i(_0x19da1a,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':i(_0x19da1a,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Vt,'actions':[{'id':'translate-to-english','displayedPrompt':i(_0x19da1a,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':i(_0x19da1a,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':i(_0x19da1a,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':i(_0x19da1a,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':i(_0x19da1a,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':i(_0x19da1a,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':i(_0x19da1a,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':i(_0x19da1a,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':i(_0x19da1a,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':i(_0x19da1a,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':i(_0x19da1a,'AI_QUICK_ACTIONS_OTHER'),'icon':Jt,'actions':[]}];return _0x4e03bb;}(_0x373f0d);}async['_getDefaultAndCustomActions'](){const _0x304f42=ii['getDefaultQuickActions'](this['editor']['locale']),_0x1f7799=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0xb37437=[];try{_0xb37437=await new It({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0x48b09c){const _0x17cbb3=new _0x54686c('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x48b09c});gt(_0x17cbb3['message']);}finally{const _0x42b65c=_0x1f7799['map'](_0x49c0b5=>({..._0x49c0b5,'icon':void 0x0}));_0x304f42['find'](_0x3684f1=>'other'===_0x3684f1['id'])['actions']['push'](..._0x42b65c),_0x304f42['forEach'](_0x32d290=>{if('actions'in _0x32d290)_0x32d290['actions']['forEach'](_0x6abdf8=>{if(_0x6abdf8['isEnabled']=!!_0xb37437['find'](_0x2b2d0f=>_0x2b2d0f['id']===_0x6abdf8['model'])||void 0x0===_0x6abdf8['model'],!_0x6abdf8['isEnabled']){const _0x315520=new _0x54686c('ai-quick-actions-unavailable-model',this,{'actionId':_0x6abdf8['id'],'modelId':_0x6abdf8['model']});gt(_0x315520['message']);}});else{if(_0x32d290['isEnabled']=!!_0xb37437['find'](_0x529a03=>_0x529a03['id']===_0x32d290['model'])||void 0x0===_0x32d290['model'],!_0x32d290['isEnabled']){const _0x3b0b62=new _0x54686c('ai-quick-actions-unavailable-model',this,{'actionId':_0x32d290['id'],'modelId':_0x32d290['model']});gt(_0x3b0b62['message']);}}});}return _0x304f42;}['_initializeQuickActionsComponentsAndCommands'](){const _0x5b76e5=new _0x74da33(this['editor']['locale']);_0x5b76e5['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x5b76e5),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x5b76e5);}['_initializeQuickActionsDropdown'](_0x1a2bdc){const _0x1bdcd5=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Xt({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x12fe1f,'label':i(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x1a2bdc,'hasSearch':_0x1bdcd5}));}['_prepareQuickActionsDefinition'](_0x292fdf){this['_quickActionsDefinition']=_0x292fdf['map'](_0x37c979=>{if('actions'in _0x37c979){const _0x26786e=_0x37c979;return{..._0x26786e,'actions':_0x26786e['actions']['map'](_0x17e051=>{const {actions:_0x48556f,..._0x3d487b}=_0x26786e;return{..._0x17e051,'parent':_0x3d487b};})['filter'](_0x509e35=>this['_shouldIncludeAction'](_0x509e35))};}return _0x37c979;})['filter'](_0x19e6fa=>'actions'in _0x19e6fa?_0x19e6fa['actions']['length']>0x0:this['_shouldIncludeAction'](_0x19e6fa));}['_shouldIncludeAction'](_0x108d72){const _0x366a70=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ga[_0x108d72['type']])&&!_0x366a70['includes'](_0x108d72['id'])&&!('CHAT'===_0x108d72['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x17a9ad){this['_quickActionsDefinition']['forEach'](_0x2a2e32=>{if('actions'in _0x2a2e32){const _0x55e7f2=Xt({'editor':this['editor'],'content':_0x2a2e32['actions'],'buttonDefinition':_0x2a2e32,'bodyCollection':_0x17a9ad});this['editor']['ui']['componentFactory']['add'](_0x2a2e32['id'],_0x55e7f2),_0x2a2e32['actions']['forEach'](_0x1b6176=>{const _0x56bfdc=Zt({'editor':this['editor'],'action':_0x1b6176});this['editor']['ui']['componentFactory']['add'](_0x1b6176['id'],_0x56bfdc);});}else{const _0x127a90=Zt({'editor':this['editor'],'action':_0x2a2e32,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x2a2e32['id'],_0x127a90);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x382f9d=>{const _0x3882b5=new _0x2e7068(_0x382f9d),_0x3dd710=i(_0x382f9d,'AI_QUICK_ACTIONS_HEADING');_0x3882b5['buttonView']['set']({'label':_0x3dd710,'icon':_0x12fe1f});const _0x1cd319=new _0x3d7509(_0x382f9d);_0x1cd319['set']({'ariaLabel':_0x3dd710,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x3a524a=>{if('actions'in _0x3a524a){const _0x113869=_0x3a524a,_0x3d85f1=new _0x11788c(_0x382f9d,_0x3882b5),_0x1abf89=new _0x2e7068(_0x382f9d),_0x592c54=new _0x3d7509(_0x382f9d);_0x1abf89['buttonView']['set']({'label':_0x113869['label'],'icon':_0x113869['icon']}),_0x113869['actions']['forEach'](_0x173ec0=>{const _0x87651c=new _0x11788c(_0x382f9d,_0x1abf89),_0x18ba9a=new _0x42f0b4(_0x382f9d);_0x18ba9a['set']({'label':_0x173ec0['displayedPrompt'],'icon':_0x173ec0['icon'],'role':'menuitem','isEnabled':_0x173ec0['isEnabled']}),_0x18ba9a['on']('execute',()=>{this['_executeQuickAction'](_0x173ec0);}),_0x18ba9a['delegate']('execute')['to'](_0x1abf89),_0x87651c['children']['add'](_0x18ba9a),_0x592c54['items']['add'](_0x87651c);}),_0x1abf89['panelView']['children']['add'](_0x592c54),_0x3d85f1['children']['add'](_0x1abf89),_0x1cd319['items']['add'](_0x3d85f1);}else{const _0x32376b=_0x3a524a,_0x461eff=new _0x11788c(_0x382f9d,_0x3882b5),_0x589ef5=new _0x42f0b4(_0x382f9d);_0x589ef5['set']({'label':_0x32376b['displayedPrompt'],'icon':_0x32376b['icon'],'role':'menuitem','isEnabled':_0x32376b['isEnabled']}),_0x589ef5['on']('execute',()=>{this['_executeQuickAction'](_0x32376b);}),_0x589ef5['delegate']('execute')['to'](_0x3882b5),_0x461eff['children']['add'](_0x589ef5),_0x1cd319['items']['add'](_0x461eff);}});const _0x227bbf=Object['values'](Ga)['some'](_0x2028ec=>this['editor']['plugins']['has'](_0x2028ec));return _0x3882b5['set']({'isEnabled':_0x227bbf}),_0x3882b5['panelView']['children']['add'](_0x1cd319),_0x3882b5;});}['_executeQuickAction'](_0xb17141){const _0x30fdea=this['editor'];_0x30fdea['editing']['view']['focus'](),_0x30fdea['commands']['execute']('aiQuickAction',_0xb17141);const _0x6e0de7=_0x30fdea['ui']['view']['menuBarView'];_0x6e0de7&&_0x6e0de7['close']&&_0x6e0de7['close']();}}class ci extends Lt{['execute'](_0xe89662){switch(this['_expandSelectionIfCollapsed'](),_0xe89662['type']){case Qt['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x51ca6b=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x54686c('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x51ca6b});}this['_handleAIChatAction'](_0xe89662);break;case Qt['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x46ddbd=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x54686c('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x46ddbd});}this['_handleAIActionsAction'](_0xe89662);break;case Qt['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x48efd4=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x54686c('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x48efd4});}this['_handleAIReviewAction'](_0xe89662);}}async['_handleAIChatAction'](_0x51f563){const _0x59150c=this['editor']['plugins']['get']('AIChat'),_0x5b5df4=this['editor']['plugins']['get']('AIChatController'),_0x5e188b=this['editor']['plugins']['get']('AITabs')['view'];if(_0x5e188b['isVisible']||(_0x5e188b['isVisible']=!0x0),'chat'!==_0x5e188b['activeTab']&&_0x5e188b['activateTab']('chat'),'ask-ai'===_0x51f563['id'])_0x5b5df4['removeSelectionFromChatContext'](),await _0x59150c['addSelectionToChatContext'](),_0x59150c['focusPromptInput']();else await _0x59150c['startConversation'](),_0x5b5df4['removeSelectionFromChatContext'](),await _0x59150c['addSelectionToChatContext'](),_0x59150c['focusPromptInput'](),await _0x59150c['sendMessage']({'message':_0x51f563['prompt']||_0x51f563['displayedPrompt'],'attributes':{'quickActionData':{'id':_0x51f563['id']},'displayedPrompt':_0x51f563['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x1c7bc4=this['editor'],_0x5a0d71=_0x1c7bc4['model']['document']['selection'];if(!_0x5a0d71['isCollapsed'])return;const _0x461114=_0x97da1c(_0x5a0d71['getSelectedBlocks']())||_0x1c7bc4['model']['schema']['getLimitElement'](_0x5a0d71);_0x1c7bc4['model']['change'](_0x388eeb=>{_0x388eeb['setSelection'](_0x461114,'in');});}['_handleAIActionsActionLabel'](_0x76e3bb){return _0x76e3bb['parent']?.['label']&&'other'!==_0x76e3bb['parent']?.['id']?_0x76e3bb['parent']['label']+':\x20'+_0x76e3bb['displayedPrompt']:_0x76e3bb['displayedPrompt'];}async['_handleAIActionsAction'](_0x36c95b){const _0x3fa00d=this['editor']['plugins']['get']('AIActions'),_0x4de707=_0x36c95b['prompt']?{'userMessage':_0x36c95b['prompt'],'model':_0x36c95b['model']}:{'actionName':_0x36c95b['actionName']||_0x36c95b['id'],'args':_0x36c95b['args']},_0x22cbd0=this['_handleAIActionsActionLabel'](_0x36c95b);await _0x3fa00d['executeAction'](_0x4de707,_0x22cbd0,_0x36c95b['icon']);}async['_handleAIReviewAction'](_0x561264){console['log']('handleAIReviewAction',_0x561264);}}class ti extends _0x558b99{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x8e1ae2=this['editor'],_0x1e8a60=new ci(this['editor']);if(_0x8e1ae2['commands']['add']('aiQuickAction',_0x1e8a60),_0x8e1ae2['plugins']['has']('AIChat')){const _0x591a57=this['editor']['plugins']['get']('AIChat');_0x8e1ae2['model']['document']['selection']['on']('change:range',(_0xd32ffc,_0x5dec3e)=>{_0x5dec3e['directChange']&&_0x591a57['removeSelectionFromChatContext']();});}}}class De extends Ge{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x3b132c=this['documentContextContent']['children']['map'](_0x282d12=>({'node':_0x282d12,'id':At(_0x282d12,'data-id')})),_0x39f992=this['parsedMergedContent']['children']['map'](_0x41e757=>({'node':_0x41e757,'id':At(_0x41e757,'data-id')||_0x589eaf()})),_0x364741=_0xaf8377(_0x3b132c,_0x39f992,{'comparator':(_0x1435ec,_0x28dad9)=>_0x1435ec['id']==_0x28dad9['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x364741['length']&&_0x364741[_0x364741['length']-0x1]['removed'];)_0x364741['pop']();}const _0x5d39fb=_0x364741['map'](_0x2fa2fe=>{const _0xef370=_0x2fa2fe['added']?'new':_0x2fa2fe['removed']?'removed':'modified';return{'node':_0x2fa2fe['value'][0x0]['node'],'type':_0xef370,'id':_0x2fa2fe['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x5d39fb,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x654f28,_0x4986cd){return _0x4986cd;}}class W extends xe{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x3b79d0){super(_0x3b79d0),this['content']=_0x3b79d0['content'],this['version']=_0x3b79d0['version'],this['actionName']=_0x3b79d0['actionName'],this['args']=_0x3b79d0['args'],this['userMessage']=_0x3b79d0['userMessage'],this['model']=_0x3b79d0['model'];}async['sendRequest'](){return this['actionName']?this['connector']['executeAction']({'content':this['content'],'actionName':this['actionName'],'args':this['args']}):this['connector']['executeCustomAction']({'content':this['content'],'message':this['userMessage'],'model':this['model'],'outputFormat':'html'});}['getDocumentContext'](){return{'type':qe['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x4de33a){const _0x5b4599=new De({'editor':this['editor'],'documentContextContent':this['content'],..._0x4de33a});return this['replies']['push'](_0x5b4599),_0x5b4599['delegate'](...ye)['to'](this),this['fire']('replyCreated',_0x5b4599),_0x5b4599;}}class Bn extends _0x28f204{constructor(_0x213dec,_0xed89d4=!0x0,_0x54975a=!0x0){super(_0x213dec),this['set']('isEnabled',!0x1),_0xed89d4&&(this['applyButton']=this['_createButton'](i(_0x213dec,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x54975a&&(this['suggestButton']=this['_createButton'](i(_0x213dec,'AI_BALLOON_SUGGEST_BUTTON'),_0xed89d4?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0xed89d4,'showSuggestButton':_0x54975a}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x40f3dc,showSuggestButton:_0x45527c}){this['applyButton']&&(this['applyButton']['isVisible']=_0x40f3dc),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x45527c);}['_createButton'](_0x535bd5,_0x126daf){const _0x592028=new _0x28db64(this['locale']);return _0x592028['set']({'label':_0x535bd5,'class':_0x126daf,'isVisible':!0x0,'withText':!0x0}),_0x592028;}}class yn extends _0x25f6b6{constructor(_0x24cb29){super(_0x24cb29),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':i(_0x24cb29,'AI_DISCLAIMER_TEXT')}]}]});}}class Nn extends _0x25f6b6{constructor(_0x78683c){super(_0x78683c),this['set']('isVisible',!0x0);const _0x245c0d=new li('small');_0x245c0d['isVisible']=!0x0;const _0x230ea2=new _0x25f6b6(this['locale']);_0x230ea2['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[i(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0xe3a551=>!_0xe3a551)]},'children':[_0x245c0d,_0x230ea2]});}}class rt extends ls{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x28dc88,_0x4a1d61){super(_0x28dc88),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x4a1d61,this['_focusTracker']=new _0x49bffd(),this['_keystrokes']=new _0x287999(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x596602({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x3fe74c(),this['_addContentWrapper'](_0x4a1d61),this['_addDisclaimerView'](),this['_addToolbar'](_0x4a1d61),this['_focusables']['clear'](),this['_focusables']['addMany']([this['_toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-main']},'children':this['_dialogContent']}),this['on']('change:isTrackChangesOn',()=>{this['_toggleToolbarButtonsVisibility'](_0x4a1d61);});}['render'](){super['render']();for(const _0x2b8ce9 of this['_focusables'])this['_focusTracker']['add'](_0x2b8ce9['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x58dc1a){-0x1===_0x58dc1a?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x312345){this['_isLoading']=_0x312345;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x432eed){super['showError'](_0x432eed),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x2b9732){super['showBlockingError'](_0x2b9732),this['setErrorState']();}['addMiniToolbarItem'](_0x5550ee){this['_miniToolbarView']['items']['has'](_0x5550ee)||this['_miniToolbarView']['items']['add'](_0x5550ee);}['removeMiniToolbarItem'](_0x3fe389){this['_miniToolbarView']['items']['has'](_0x3fe389)&&this['_miniToolbarView']['items']['remove'](_0x3fe389);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x923e15,showSuggestButton:_0x47b460}){_0x923e15=_0x923e15&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x47b460=_0x47b460&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x923e15,'showSuggestButton':_0x47b460});}async['updateContent'](_0x3b0a06){await this['_streamableContentView']['update'](_0x3b0a06);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x1af9d6){this['_contentWrapper']=new _0x25f6b6(this['locale']),this['_contentWrapper']['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content-wrapper']},'children':[this['_createLoaderView'](),this['_createStreamableContentView']()]},this['_createMiniToolbar'](_0x1af9d6['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new yn(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x349d3f,showSuggestButton:_0x42a62b}){this['_toolbarView']=new Bn(this['locale'],_0x349d3f,_0x42a62b),this['_toolbarView']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['_toolbarView']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_toolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',this,'_hasError',(_0x4b170d,_0x120cae,_0x491a73)=>!(_0x4b170d||_0x120cae||_0x491a73)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x349d3f,'showSuggestButton':_0x42a62b}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x4039c1){return this['_miniToolbarView']=new us(this['locale'],_0x4039c1),this['_miniToolbarView']['delegate'](...ut)['to'](this),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['_miniToolbarView']['isShowChangesOn']=!this['_miniToolbarView']['isShowChangesOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':this['_miniToolbarView']['isShowChangesOn']});}),this['_miniToolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',(_0x210de2,_0x4330b1)=>!(_0x210de2||_0x4330b1)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new Nn(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new as(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x1fc562=new _0x28db64(this['locale']),_0x4982f3=new _0x28db64(this['locale']),_0xdf9644=new Ln(this['locale']),_0x42ba69=new _0x28db64(this['locale']);_0x1fc562['set']({'icon':_0x19fd2d,'label':i(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x4982f3['set']({'icon':_0x40452e,'tooltip':i(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x42ba69['set']({'icon':_0x3efd11,'tooltip':i(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x1fc562['bind']('isEnabled')['to'](this,'isBusy',_0x314c9f=>!_0x314c9f),_0x1fc562['on']('execute',()=>{this['fire']('tryAgain');}),_0x4982f3['bind']('isEnabled')['to'](this,'isBusy',_0x29440f=>!_0x29440f),_0x4982f3['on']('execute',()=>{this['fire']('showPrevious');}),_0x42ba69['bind']('isEnabled')['to'](this,'isBusy',_0x1d475b=>!_0x1d475b),_0x42ba69['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x4982f3,this['_navigationCounter']=_0xdf9644,this['_navigationNextButton']=_0x42ba69,this['_navigationTryAgainButton']=_0x1fc562;}['updateMiniToolbarButtons'](_0x3c8e91,_0x56554f){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x204d1d=_0x3c8e91>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x204d1d){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x50061d=_0x3c8e91-_0x56554f;this['_navigationCounter']['setInteractionCount'](_0x50061d+'/'+_0x3c8e91),this['_navigationPreviousButton']['isEnabled']=_0x56554f<_0x3c8e91-0x1,this['_navigationNextButton']['isEnabled']=_0x56554f>0x0;}else this['removeMiniToolbarItem'](this['_navigationPreviousButton']),this['removeMiniToolbarItem'](this['_navigationCounter']),this['removeMiniToolbarItem'](this['_navigationNextButton']);}['disableMiniToolbarButtons'](){this['_navigationTryAgainButton']['isEnabled']=!0x1,this['_navigationPreviousButton']['isEnabled']=!0x1,this['_navigationNextButton']['isEnabled']=!0x1;}['startAutoScroll'](){this['_initializeScrollManager'](),this['_scrollManager']&&this['_scrollManager']['start']();}['stopAutoScroll'](){this['_scrollManager']&&this['_scrollManager']['stop']();}['toggleIsLoading'](_0x15b08a){this['_isLoading']=_0x15b08a;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x562865=this['_getScrollableElement']();_0x562865&&!this['_scrollManager']&&(this['_scrollManager']=new $e(_0x562865));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class Ln extends _0x25f6b6{constructor(_0x49a6c8){super(_0x49a6c8);const _0x471f72=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x471f72['to']('interactionCount')}]});}['setInteractionCount'](_0xd79f7){this['set']('interactionCount',_0xd79f7);}}class ri extends _0x558b99{static get['requires'](){return[q,_0x14d881,D,Q,_0x29b670];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_promiseQueue'];['_bodyCollection'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}['_actionsBalloonView'];constructor(_0x15b9e9){super(_0x15b9e9),this['_bodyCollection']=new _0x74da33(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new z();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x1f11a0,_0x1f0b11,_0x3f132d){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x2e3a9a,anchorData:_0x30ca6f}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x1f11a0,_0x2e3a9a,_0x30ca6f,_0x1f0b11,_0x3f132d);}}const {modelFragment:_0x93734e,anchorData:_0xa02b}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x1f11a0,_0x93734e,_0xa02b,_0x1f0b11,_0x3f132d);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x5808c=this['editor']['plugins']['has']('TrackChanges');let _0x4d2157=this['editor']['config']['get']('ai.availableReplyActions')||[...ot];_0x5808c||(_0x4d2157=_0x4d2157['filter'](_0x1c577a=>'insertSuggestion'!=_0x1c577a));const _0x208ce0=this['editor']['commands']['get']('trackChanges'),_0x1e2c54=new rt(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x5808c,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x4d2157});return _0x1e2c54['bind']('isBusy')['to'](this),_0x208ce0&&_0x1e2c54['bind']('isTrackChangesOn')['to'](_0x208ce0,'value'),_0x1e2c54['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x1e2c54['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x1e2c54['on']('showNext',()=>{this['_navigateToNext']();}),_0x1e2c54;}['_getExecuteDataRegular'](){const _0x462a92=this['editor']['model']['document']['selection'];if(_0x462a92['isCollapsed']){const _0xe5a9c=_0x97da1c(_0x462a92['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x462a92);this['editor']['model']['change'](_0x116908=>{_0x116908['setSelection'](_0xe5a9c,'in');});}const _0x31352b=_0x462a92['getFirstRange'](),_0x225104=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x462a92),_0x31352b['start'],_0x31352b['end']);this['_copyMarkersToFragment'](_0x225104,_0x462a92,{'isTableSelection':!0x1});const _0x1c3174=_0x462a92['getFirstRange']()['start'],_0x4bcca8=new Map();let _0x15150d=_0x225104;for(let _0xba4284=0x0;_0xba4284<_0x1c3174['path']['length'];_0xba4284++)_0x4bcca8['set'](_0x15150d,_0x1c3174['path'][_0xba4284]),_0x15150d=_0x15150d['getChild'](0x0);return{'modelFragment':_0x225104,'anchorData':_0x4bcca8};}['_getExecuteDataInTable'](){const _0x30637d=this['editor']['model']['document']['selection'],_0x411921=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x4262ea=_0x30637d['getFirstRange']()['start']['parent']['parent'],_0x18d28a=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x4262ea),this['editor']['model']['createPositionAfter'](_0x4262ea)),_0xf6922c=this['_wrapWithCommonAncestors'](_0x411921,_0x18d28a['start'],_0x18d28a['end']);this['_copyMarkersToFragment'](_0xf6922c,_0x30637d,{'isTableSelection':!0x0});const _0x25d744=_0x30637d['getFirstRange']()['start'],_0x387dd5=new Map();let _0x26a228=_0xf6922c;for(let _0x28f17a=0x0;_0x28f17a<_0x25d744['path']['length'];_0x28f17a++)if(_0x387dd5['set'](_0x26a228,_0x25d744['path'][_0x28f17a]),_0x28f17a<_0x25d744['path']['length']-0x1)_0x26a228=_0x26a228['getChild'](0x0);else{let _0x3687ed=_0x26a228['nextSibling'];for(;_0x3687ed;)_0x387dd5['set'](_0x3687ed,_0x25d744['path'][_0x28f17a]),_0x3687ed=_0x3687ed['nextSibling'];}return{'modelFragment':_0xf6922c,'anchorData':_0x387dd5};}async['_executeAction'](_0x52527b,_0x10ec7e,_0x19ea61,_0x30dcce,_0x2d73b8){const _0x38870b=this['editor']['plugins']['get'](D),_0x38ad90=this['editor']['plugins']['get'](Q),_0x24c873=this['editor']['model']['document']['selection'],_0x2f153c=await _0x38870b['modelToDataWithIds'](_0x10ec7e),_0x129a74=this['editor']['model']['document']['version'],_0x386c5a=[..._0x24c873['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),_0x38ad90['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x30dcce,'icon':_0x2d73b8||_0x12fe1f,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x386c5a,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x38ad90),this['_interactionParams']={'action':_0x52527b,'content':_0x2f153c,'version':_0x129a74,'aiBalloon':_0x38ad90,'modelFragment':_0x10ec7e,'anchorData':_0x19ea61},this['_setupApplyListeners'](),this['listenTo'](_0x38ad90,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x38ad90,'dialogClosed',(_0x2ff8bf,{id:_0x1c88dd})=>{if('aiActionsBalloon'===_0x1c88dd){if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x51291f=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x1726d3=_0x51291f['changeGroups'][0x0];_0x1726d3&&'pending'===_0x1726d3['state']&&_0x51291f['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x38ad90);}}),this['_createInteraction'](_0x2f153c,_0x129a74,_0x38ad90,_0x52527b);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x2b903e,anchorData:_0x34026a}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x2b903e,_0x34026a,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x2b903e,_0x34026a,!0x0);});}['_wrapWithCommonAncestors'](_0x5b23da,_0x49179b,_0x2f095f){const _0x2533f5=this['editor']['model']['createRange'](_0x49179b,_0x2f095f)['getCommonAncestor'](),_0xaaa15a=_0x2533f5['is']('documentFragment')?[]:_0x2533f5['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0xaaa15a['length']){const _0x5f3743=_0xaaa15a['map'](_0x4838de=>_0x4838de['_clone'](!0x1));for(let _0x5dc473=0x1;_0x5dc473<_0x5f3743['length'];_0x5dc473++)_0x5f3743[_0x5dc473-0x1]['_appendChild'](_0x5f3743[_0x5dc473]);return _0x5f3743[_0x5f3743['length']-0x1]['_appendChild'](_0x5b23da),new tt(_0x5f3743[0x0]);}return _0x5b23da;}['_copyMarkersToFragment'](_0x339fc1,_0x3008ee,_0x8da918={'isTableSelection':!0x1}){const _0x24e0e0=this['editor']['model'],_0x651888=Array['from'](_0x3008ee['getRanges']()),_0x262613=_0x3008ee['getFirstRange']()['start'];for(const _0x1c8931 of _0x24e0e0['markers']){if(_0x1c8931['name']['startsWith'](R)||!_0x1c8931['affectsData'])continue;const _0x4b219d=_0x1c8931['getRange']();if(!_0x651888['some'](_0x2bb7c3=>_0x2bb7c3['containsRange'](_0x4b219d,!0x0)))continue;const _0x424dc4=this['_regularCalculateMarkerPath'](_0x4b219d['start'],_0x262613,_0x8da918['isTableSelection']),_0xc725c2=this['_regularCalculateMarkerPath'](_0x4b219d['end'],_0x262613,_0x8da918['isTableSelection']),_0x5d47a5=_0x24e0e0['createPositionFromPath'](_0x339fc1,_0x424dc4),_0x914aa7=_0x24e0e0['createPositionFromPath'](_0x339fc1,_0xc725c2);if(!_0x5d47a5['isEqual'](_0x914aa7)){const _0x3bc2eb=_0x24e0e0['createRange'](_0x5d47a5,_0x914aa7);_0x339fc1['markers']['set'](_0x1c8931['name'],_0x3bc2eb);}}}['_regularCalculateMarkerPath'](_0x19e122,_0x1c9e9f,_0x1c5c1d=!0x1){const _0x2794a2=[..._0x19e122['path']['slice']()];for(let _0x2db5f2=0x0;_0x2db5f2<Math['max'](_0x1c9e9f['path']['length'],_0x19e122['path']['length']);_0x2db5f2++){const _0x16afe9=_0x1c9e9f['path'][_0x2db5f2]||0x0,_0x22848c=(_0x19e122['path'][_0x2db5f2]||0x0)-_0x16afe9;if(_0x2794a2[_0x2db5f2]=_0x22848c,0x0!==_0x22848c&&!_0x1c5c1d)break;}return _0x2794a2;}async['_createInteraction'](_0x394f97,_0xc35f24,_0x4ff8cc,_0x3a7ca4){const _0x2b7559=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x3a7ca4,'content':_0x394f97,'version':_0xc35f24,'aiBalloon':_0x4ff8cc,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x362215=new W({'connector':this['_aiConnector'],'editor':_0x2b7559,'content':_0x394f97,'version':_0xc35f24,..._0x3a7ca4});this['_interactions']['push'](_0x362215);const _0x49e65b=(_0x1ffa05,_0x43d845=!0x1,_0x2e5465='streaming')=>this['_promiseQueue']['enqueue'](async _0x4108a6=>{try{const _0x2481c9=J({'editor':_0x2b7559,'changeGroups':_0x1ffa05['changeGroups'],'documentContextContent':_0x1ffa05['documentContextContent'],'showDiff':_0x43d845,'trimUnchanged':!0x1});_0x2481c9['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x2481c9[0x0],'renderingStrategy':_0x2e5465,'abortSignal':_0x4108a6});}catch(_0x455612){if(this['_isAbortError'](_0x455612))return;throw _0x455612;}});this['_interaction']['on']('replyCreated',(_0x2c8fb6,_0x202f3f)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x49e65b(_0x202f3f)['catch'](_0x4f5e80=>{this['_isAbortError'](_0x4f5e80)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x4f5e80),this['_setErrorState'](_0x362215));});}),this['_interaction']['on']('replyContentUpdated',(_0x319464,_0xe649d6)=>{_0x49e65b(_0xe649d6)['catch'](_0x16b126=>{this['_isAbortError'](_0x16b126)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x16b126),this['_setErrorState'](_0x362215));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x426576){this['_isAbortError'](_0x426576)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x426576),this['_setErrorState'](_0x362215));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x1ea46b,{showDiff:_0x5d0d8a})=>{try{this['_balloonShowDiff']=_0x5d0d8a;const _0x457496=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x457496&&await _0x49e65b(_0x457496,_0x5d0d8a,'static');}catch(_0x5d291a){this['_isAbortError'](_0x5d291a)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x5d291a),this['_setErrorState'](_0x362215));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0xc2c3c6,{reply:_0x38e9e6})=>{const _0x276f40={'positiveCount':_0x38e9e6['changeGroups']['filter'](_0x57e51a=>'accepted'===_0x57e51a['state'])['length'],'totalCount':_0x38e9e6['changeGroups']['length']},_0xa91b49=this['_interaction']['actionCallId'],_0x387a5e=this['_interaction']['actionName'];_0x387a5e?this['_aiConnector']['upsertAIActionRating'](_0x387a5e,_0xa91b49,_0x276f40):this['_aiConnector']['upsertCustomAIActionRating'](_0xa91b49,_0x276f40);}),this['_setLoadingState']();try{const _0x2e24fd=await this['_interaction']['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x2e24fd;}catch(_0x34f7b6){if(this['_isAbortError'](_0x34f7b6))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x362215);}}['_applyChanges'](_0x5f3cf5,_0x27e6ed,_0xf73154){const _0x46f451=this['editor'];if(_0xf73154&&!_0x46f451['plugins']['has']('TrackChanges'))throw new _0x54686c('ai-no-track-changes',null);const _0x36d2bd=this['editor']['plugins']['get'](_0x29b670),_0x13cc24=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x13cc24||!_0x13cc24['replies']['length'])return;const _0x33c693=_0x13cc24['replies'][_0x13cc24['replies']['length']-0x1],_0x367cc7=_0x33c693['changeGroups'];_0x33c693['setChangeGroupState'](0x0,'accepted');let _0x570391=Z({'editor':_0x46f451,'reply':_0x33c693,'interaction':_0x13cc24,'groups':_0x367cc7,'transform':!0x1,'documentCompare':_0x36d2bd,'documentCompareOptions':{'anchor':_0x46f451['model']['createPositionAt'](_0x5f3cf5,0x0),'markDeletions':_0xf73154}});_0x570391=this['_filterOperationsOutsideRange'](_0x570391,_0x27e6ed);for(const _0x422bf2 of _0x570391)this['_anchorOperation'](_0x27e6ed,_0x422bf2,_0x46f451['model']['document']['getRoot']());const _0x1eacd1=_0x13cc24['getDocumentContext']()['version'],_0x2e1882=_0x46f451['model']['document']['history']['getOperations'](_0x1eacd1),_0x15e7d2={'document':_0x46f451['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x22d423=nt(_0x570391,_0x2e1882,_0x15e7d2)['operationsA'];_0x46f451['model']['change'](_0x2b4e63=>{if(_0x2b4e63['setSelection'](_0x46f451['model']['document']['selection']['focus']),_0xf73154)_0x46f451['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x22d423);else{for(const _0x21ed1c of _0x22d423)_0x21ed1c['baseVersion']=_0x46f451['model']['document']['version'],Y(_0x46f451,_0x21ed1c),_0x2b4e63['batch']['addOperation'](_0x21ed1c),_0x46f451['model']['applyOperation'](_0x21ed1c);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x4691cc,_0x88ffc9){return _0x4691cc['filter'](_0x3d6cdb=>{if('rename'==_0x3d6cdb['type']){const _0x2ec45c=_0x3d6cdb['position']['nodeAfter'];return!_0x88ffc9['has'](_0x2ec45c);}if(_0x3d6cdb['type']['indexOf']('Attribute')>-0x1){const _0x10e34b=_0x3d6cdb['range']['start']['nodeAfter'];return!_0x88ffc9['has'](_0x10e34b);}return!0x0;});}['_anchorOperation'](_0x156d5b,_0x2692b4,_0x5aa35e){const _0x36d3fd=_0x2692b4['clone']();for(const _0x442175 in _0x2692b4){const _0x3bc1cb=_0x2692b4[_0x442175];_0x3bc1cb instanceof it?_0x2692b4[_0x442175]=new it(_0xfe81aa(_0x3bc1cb['start']),_0xfe81aa(_0x3bc1cb['end'])):_0x3bc1cb instanceof st&&(_0x2692b4[_0x442175]=_0xfe81aa(_0x3bc1cb));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x36d3fd['type'])){if(_0x36d3fd['isDocumentOperation']=!0x1,_0x36d3fd['baseVersion']=null,'remove'==_0x36d3fd['type']){const _0x34312b=_0x36d3fd['sourcePosition'],_0x3f6cb7=_0x36d3fd['howMany'];new et(_0x34312b,_0x3f6cb7)['_execute']();}else _0x36d3fd['_execute']();}function _0xfe81aa(_0x38949d){if('$graveyard'==_0x38949d['root']['rootName'])return _0x38949d;const _0x47f7d2=[];let _0x559a12=_0x38949d['root'];for(let _0x3766a2=0x0;_0x3766a2<_0x38949d['path']['length'];_0x3766a2++){const _0x1fbab2=_0x156d5b['get'](_0x559a12)||0x0;_0x47f7d2[_0x3766a2]=_0x38949d['path'][_0x3766a2]+_0x1fbab2,_0x559a12=_0x559a12['getChildAtOffset'](_0x38949d['path'][_0x3766a2]);}return new st(_0x5aa35e,_0x47f7d2,_0x38949d['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x178d70,content:_0x122510,version:_0x424bb5,aiBalloon:_0x4b01dd}=this['_interactionParams'];this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),this['_actionsBalloonView']['showLoader'](),this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),this['stopListening'](this['_actionsBalloonView']),this['_setupApplyListeners'](),this['_createInteraction'](_0x122510,_0x424bb5,_0x4b01dd,_0x178d70)['catch'](_0x19e788=>{this['_isAbortError'](_0x19e788)||console['error']('Error\x20refreshing\x20interaction:',_0x19e788);});}['_isAbortError'](_0x9c53d6){return!!_0x9c53d6['message']&&_0x9c53d6['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['_interactionParams']&&this['_actionsBalloonView']['stopAutoScroll']();}['_navigateToPrevious'](){const _0x5a7f6a=this['_interactions']['length'];this['_currentInteractionIndex']<_0x5a7f6a-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x2e1847){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x2e1847;const _0x2fb72c=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x2fb72c)return;if(_0x2fb72c['hasError'])return this['_setErrorState'](_0x2fb72c),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x2fb72c['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x3db897=_0x2fb72c['replies'][_0x2fb72c['replies']['length']-0x1];if(_0x3db897){const _0x3109f1=this['editor'];try{const _0xfa2a80=J({'editor':_0x3109f1,'changeGroups':_0x3db897['changeGroups'],'documentContextContent':_0x3db897['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x1bb842=>setTimeout(_0x1bb842,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0xfa2a80[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x40f461){this['_isAbortError'](_0x40f461)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x40f461);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x5b11be){const _0x45a1f4=i(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x45a1f4),_0x5b11be['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],this['_actionsBalloonView']['setErrorState'](),this['_actionsBalloonView']['toggleIsLoading'](!0x0);}['_clearErrorState'](){this['_actionsBalloonView']['hideError'](),this['_actionsBalloonView']['toggleIsLoading'](!0x1);}async['_clearLoadingState'](){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,this['_actionsBalloonView']['setIsLoading'](!0x1);}}class Fa extends _0x558b99{static get['requires'](){return[ii,ti,ri];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x166a4c){super(_0x166a4c),_0x166a4c['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class Ys extends _0x25f6b6{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x139608,_0x58c19a){super(_0x139608),this['id']=_0x58c19a,this['set']('status','pending'),this['set']('changeId',_0x58c19a),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['outdatedButtonView']=this['_createOutdatedButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['set']('showDiff',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-result',this['bindTemplate']['if']('isActive','ck-ai_review__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click'),'mouseover':this['bindTemplate']['to']('mouseover'),'mouseout':this['bindTemplate']['to']('mouseout')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView'],this['outdatedButtonView']]},this['infoButtonView']]}]}),this['on']('click',(_0x6f1cf,_0x1f31aa)=>{_0x1f31aa&&_0x1f31aa['target']&&'A'===_0x1f31aa['target']['tagName']&&_0x1f31aa['preventDefault'](),this['fire']('activateChange',{'id':_0x58c19a,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x58c19a,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x58c19a,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x131080=new _0x25f6b6(this['locale']);return _0x131080['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai_review__check-run-result-response',this['bindTemplate']['if']('showDiff','ck-hidden',_0x242d1f=>!_0x242d1f)]}}),_0x131080;}['_createAcceptButtonView'](){const _0x2bec57=new _0x28db64(this['locale']);return _0x2bec57['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x2bec57['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x528e02=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x528e02['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x53cfd5=>'pending'!==_0x53cfd5&&'accepted'!==_0x53cfd5),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-accept-button',_0x5cd648=>'pending'===_0x5cd648),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x1e2f56=>'accepted'===_0x1e2f56)]}}),this['on']('change:status',(_0x3bafbc,_0x399a63,_0x3b76ed)=>{_0x2bec57['isEnabled']='pending'===_0x3b76ed,'accepted'===_0x3b76ed&&(_0x2bec57['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x2bec57['icon']=_0x13f61e);}),_0x2bec57;}['_createDismissButtonView'](){const _0x33c488=new _0x28db64(this['locale']);return _0x33c488['set']({'label':i(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x33c488['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x42e098=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x42e098['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary',this['bindTemplate']['if']('status','ck-hidden',_0x29dc9d=>'pending'!==_0x29dc9d&&'rejected'!==_0x29dc9d),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x44770e=>'pending'===_0x44770e),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x344b06=>'rejected'===_0x344b06)]}}),this['on']('change:status',(_0x489c47,_0x411477,_0x3fb1e8)=>{_0x33c488['isEnabled']='pending'===_0x3fb1e8,'rejected'===_0x3fb1e8&&(_0x33c488['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x33c488['icon']=_0x58fd68);}),_0x33c488;}['_createInfoButtonView'](){const _0x4e3f22=new _0x28db64(this['locale']);return _0x4e3f22['set']({'label':i(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x3f0ea0,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x4e3f22['bind']('isOn')['to'](this,'isInfoToggleOn',_0x320afa=>_0x320afa),_0x4e3f22['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x4e3f22;}['_createOutdatedButtonView'](){const _0x17dbd4=new _0x28db64(this['locale']);return _0x17dbd4['set']({'label':i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':tc,'withText':!0x0,'isEnabled':!0x1}),_0x17dbd4['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x3ff605=>'outdated'!==_0x3ff605)],'disabled':'disabled'}}),_0x17dbd4;}}class me extends _0x132eb0{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x2988d6,_0xc4bd){super(_0x2988d6),this['set']({'isVisible':!0x1,'position':'arrow_se','class':null,'top':0x0,'left':0x0}),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-reset'],'tabindex':'-1'}}),this['set']('isDiffActive',!0x1),this['content']['add'](this['_createContentView']()),_0xc4bd['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x4db743){this['resultItemView']['changeId']=_0x4db743['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x4db743['contentDiffed'];}['showBalloon'](_0x3f7e2d,_0x39ac5a,_0x142be3,_0x54c3ba,_0x3f0b51,_0x3c83cf){const _0x448233=_0x39ac5a();if(!_0x448233)return;this['updateContent'](_0x3f7e2d),this['show']();const _0x307f49=Array['from'](_0x448233['getClientRects']())['reverse'](),_0x240d76=this['_getPointedRectIndexFromEvent'](_0x142be3,_0x307f49),_0x35d69d=_0x307f49[_0x240d76??0x0];'click'===_0x54c3ba?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x39ac5a(),_0x240d76,_0x3f7e2d['id'],_0x3f0b51,_0x3c83cf)||_0x35d69d})):'hover'===_0x54c3ba&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x39ac5a(),_0x240d76,_0x3f7e2d['id'])||_0x35d69d}));}['hideBalloon'](){this['hide'](),this['unpin'](),this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetElement']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange',{'origin':'balloon'});}['_setupClickOutsideHandler'](){_0x13f50b({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x15c8ab=[this['element']];return this['_pinnedTargetElement']&&_0x15c8ab['push'](this['_pinnedTargetElement']),_0x15c8ab;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x53c151=new _0x25f6b6();return this['resultItemView']=new Ys(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x53c151['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai_review-balloon-panel-suggestion',this['bindTemplate']['if']('isDiffActive','ck-ai_review-balloon-panel-suggestion_diff-active')]},'children':[{'tag':'p','attributes':{'class':['ck-ai_review__suggestion-text']},'children':[this['resultItemView']]}]}),_0x53c151;}['_getBestRectPositionOnClick'](_0x4ee6b7,_0x140c39,_0x427495,_0xcb7205,_0x16f132){if(!_0x4ee6b7)return null;const _0x16045d=this['position']['replace']('arrow_',''),_0x859860=Array['from'](_0x4ee6b7['getClientRects']());let _0x5c2752,_0x4520c2=_0x859860['reverse']();return void 0x0!==_0x140c39&&this['_isPinnedRectVisible'](_0x4520c2[_0x140c39],_0xcb7205,_0x16f132)?(_0x5c2752=_0x4520c2[_0x140c39],this['_pinnedRectIndex']=_0x140c39):this['_isPinnedRectVisible'](_0x4520c2[0x0],_0xcb7205,_0x16f132)&&void 0x0===_0x140c39?_0x5c2752=_0x4520c2[0x0]:(_0x4520c2='s'==_0x16045d[0x0]?[..._0x859860]['reverse']():_0x859860,_0x4520c2['forEach'](_0x135f86=>{this['_isPinnedRectVisible'](_0x135f86,_0xcb7205,_0x16f132)&&(_0x5c2752=_0x135f86);})),this['_pinnedTargetChangeId']=_0x427495,this['_pinnedTargetElement']=_0x4ee6b7,_0x5c2752||_0x4ee6b7['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x39aab4,_0x1eab26,_0x3a594c){if(!_0x39aab4)return null;const _0x56a7cb=Array['from'](_0x39aab4['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x1eab26&&this['_pinnedTargetChangeId']!==_0x3a594c)return this['_pinnedRectIndex']=_0x1eab26,this['_pinnedTargetElement']=_0x39aab4,this['_pinnedTargetChangeId']=_0x3a594c,_0x56a7cb[_0x1eab26];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x3a594c){if(_0x39aab4!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x56a7cb[this['_pinnedRectIndex']];}return void 0x0!==_0x1eab26&&this['_pinnedTargetChangeId']!==_0x3a594c?(this['_pinnedRectIndex']=_0x1eab26,this['_pinnedTargetElement']=_0x39aab4,this['_pinnedTargetChangeId']=_0x3a594c,_0x56a7cb[_0x1eab26]):_0x39aab4['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0xc35418,_0x4cb30b){if(_0xc35418)for(let _0x37412e=0x0;_0x37412e<_0x4cb30b['length'];_0x37412e++){const _0x34e7c9=_0x4cb30b[_0x37412e];if(_0xc35418['clientX']>=_0x34e7c9['left']-0x3&&_0xc35418['clientX']<=_0x34e7c9['right']+0x3&&_0xc35418['clientY']>=_0x34e7c9['top']-0x3&&_0xc35418['clientY']<=_0x34e7c9['bottom']+0x3)return _0x37412e;}}['_isPinnedRectVisible'](_0x2bb652,_0x5635c6,_0x2ec465){const _0x14615a=new _0x182987(_0x2bb652),_0x2614d3=_0x5635c6||document['documentElement'],_0x1fdef9=_0x14615a['getIntersection'](_0x48c4b5(_0x2ec465)),_0x46d71d=new _0x182987(_0x2614d3)['getIntersection'](_0x14615a);return!!(_0x1fdef9&&_0x46d71d&&_0x14615a['width']>0x0);}}const ih=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class Me extends _0x3de4b5{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[pt];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5e9bab){super(_0x5e9bab),this['_bodyCollection']=new _0x74da33(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...ih)['to'](this),this['_balloonSuggestionView']=new me(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x5e0bc8=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x5e0bc8);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x359302){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x265827=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x359302,_0x265827);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x5ed77c){_0x5ed77c&&('error-general'!==_0x5ed77c['status']?'error-chunk'!==_0x5ed77c['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x5968ab){this['_mainView']['addCheckRunResult'](_0x5968ab);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x73470b){this['_mainView']['showGeneralReviewCoreErrorView'](_0x73470b??i(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x48c8cc,_0x28499f){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x48c8cc,_0x28499f);}['setActiveStateInResults'](_0x359c4b){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x13bc11=>{_0x13bc11['id']===_0x359c4b&&_0x13bc11['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x5f3b63=>_0x5f3b63['setItemAsInactive']());}['updateChangeState'](_0xafbecc,_0x2f4a2e){'accepted'===_0x2f4a2e||'rejected'===_0x2f4a2e||'outdated'===_0x2f4a2e?this['_mainView']['reviewCheckResultsView']['hideResult'](_0xafbecc,_0x2f4a2e):this['_mainView']['reviewCheckResultsView']['showResult'](_0xafbecc,_0x2f4a2e);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x21b35b,_0x5acefb,_0x209031,_0x38f60c,_0xb0b0e6,_0x9d9b16){this['_balloonSuggestionView']['showBalloon'](_0x21b35b,_0x5acefb,_0x209031,_0x38f60c,_0xb0b0e6,_0x9d9b16);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x28193f){const _0x1d8666=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x4c324e=>_0x4c324e['id']===_0x28193f);return _0x1d8666?_0x1d8666['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class sh extends _0x25f6b6{constructor(_0x78f025){super(_0x78f025),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x5537fe=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x5537fe['if']('isVisible','ck-hidden',_0x3785b9=>!_0x3785b9)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x5537fe['to']('errorMessage')}]}]});}}class Ae extends _0x25f6b6{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x5e0e84,_0x471d6e){super(_0x5e0e84),this['reviewCoreHeader']=_0x471d6e['header'],this['generalErrorView']=new sh(_0x5e0e84),this['reviewCheckListView']=_0x471d6e['list'],this['reviewCheckListView']['delegate'](...ih)['to'](this),this['reviewCheckResultsView']=_0x471d6e['results'],this['reviewCheckResultsView']['delegate'](...ih)['to'](this),this['reviewCompletedView']=_0x471d6e['completed'],this['reviewCompletedView']['delegate']('finishReview')['to'](this),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isLoading',!0x1),this['reviewCheckResultsView']['set']('isResultReady',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewCoreHeader'],this['generalErrorView'],this['reviewCheckListView'],this['reviewCheckResultsView'],this['reviewCompletedView']]});}['showReviewCheckListView'](){this['reviewCheckListView']['resetAllParameterizedChecks'](),this['reviewCheckListView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1);}['showReviewCheckResultsView'](){this['hideActionsWhenResultIsReady'](),this['reviewCheckResultsView']['resetErrorState'](),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['clearResults'](),this['reviewCheckResultsView']['set']('isLoading',!0x0),this['reviewCheckResultsView']['set']('isCompleted',!0x1);}['addCheckRunResult'](_0x44db19){this['reviewCheckResultsView']['addResult'](_0x44db19),this['reviewCheckResultsView']['set']('isLoading',!0x1);}['showReviewCompletedView'](){this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isCompleted',!0x0),this['reviewCheckListView']['set']('isVisible',!0x1);}['showActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']?(this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1)):this['reviewCheckResultsView']['isResultReady']=!0x0;}['showNoChangesView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x0);}['hideActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x1;}['showGeneralReviewCoreErrorView'](_0x17fab5){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x17fab5;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class vr extends _0x28db64{constructor(_0x3dd463,_0x3411e1){super(_0x3411e1),this['set']({'label':_0x3dd463,'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class Ve extends _0x1cf10a{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x3ec12a,_0x224b88){super(_0x3ec12a),this['_contents']=_0x224b88,this['_resultViews']=new _0x3fe74c(),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_acceptAllButtonView']=this['_createAcceptAllButtonView'](),this['_exitReviewButtonView']=this['_createExitReviewButtonView'](),this['_toggleDiffButtonView']=this['_createToggleDiffButtonView'](),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['_resultsHeader']=this['_createResultHeaderView'](),this['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new fi(_0x3ec12a),this['set']('isLoading',!0x1),this['set']('isToggleDiffOn',!0x1),this['set']('isResultReady',!0x1),this['set']('headerTitle',''),this['set']('headerSubtitle',''),this['set']('isError',!0x1),this['set']('showErrorMessage',!0x1),this['set']('errorType','general'),this['set']('isCompleted',!0x1);const _0x546687=this['_createCombinedSkeletonLoader'](),_0x5cf56f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x5cf56f['if']('isLoading','ck-ai_review__check-run_loading',_0x413edf=>_0x413edf),_0x5cf56f['if']('isResultReady','ck-ai_review__check-run_ready',_0x3271fb=>_0x3271fb),_0x5cf56f['if']('isVisible','ck-hidden',_0x1f1b09=>!_0x1f1b09)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x1c4369=>_0x1c4369)]},'children':this['_resultViews']},_0x546687]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x2996ba){const _0x3dcfc2=new Ys(this['locale'],_0x2996ba['id']);_0x3dcfc2['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x3dcfc2),_0x3dcfc2['resultResponseView']['element']['innerHTML']=_0x2996ba['contentDiffed'];}['hideResult'](_0x2f13b4,_0x28b1b7){if('pending'===_0x28b1b7)return;const _0x5a8d03=this['_resultViews']['find'](_0x284485=>_0x284485['id']===_0x2f13b4);_0x5a8d03&&(_0x5a8d03['status']=_0x28b1b7,_0x5a8d03['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x207b05,_0x2df4a2){if('pending'!==_0x2df4a2)return;const _0x46b50a=this['_resultViews']['find'](_0x5bb899=>_0x5bb899['id']===_0x207b05);_0x46b50a&&(_0x46b50a['status']=_0x2df4a2,_0x46b50a['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x325efd,_0x3eb7ab){this['headerTitle']=_0x325efd,this['headerSubtitle']=_0x3eb7ab||'';}['showChunkErrorMessage'](){this['errorType']='chunk',this['showErrorMessage']=!0x0;}['showGeneralErrorMessage'](){this['isError']=!0x0,this['errorType']='general',this['showErrorMessage']=!0x0;}['resetErrorState'](){this['isError']=!0x1,this['errorType']='general',this['showErrorMessage']=!0x1;}['_createSkeletonLoader'](){return new ai(this['locale'],di['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x2eb812=new _0x25f6b6(this['locale']),_0x49fda8=[];for(let _0x5e02e2=0x0;_0x5e02e2<0x10;_0x5e02e2++){const _0x5db331=this['_createSkeletonLoader']();_0x5db331['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x49fda8['push'](_0x5db331);}return _0x2eb812['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x542d98=>!_0x542d98)]},'children':_0x49fda8}),_0x2eb812;}['_createErrorView'](){const _0x3f2a18=new _0x25f6b6(this['locale']),_0x3f1412=new _0x28db64(this['locale']),t=this['locale']['t'];return _0x3f2a18['delegate']('retryReview')['to'](this),_0x3f1412['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai_review__check-run-error-retry-button'}),_0x3f1412['on']('execute',()=>{this['fire']('retryReview');}),_0x3f2a18['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x3901ab=>!_0x3901ab),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x18e013=>'chunk'===_0x18e013)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error','ck-ai-notification__full-width','ck-ai_review__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-notification_warning',_0x25395e=>'chunk'===_0x25395e)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x2a939d=>'general'!==_0x2a939d)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x115177=>'chunk'!==_0x115177)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x3f1412]}),_0x3f2a18;}['_createCancelButtonView'](){const _0x2f3605=new _0x28db64(this['locale']);return _0x2f3605['set']({'label':i(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0xaf27a6}),_0x2f3605['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x477df2=>_0x477df2),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x32051f=>_0x32051f)]}}),_0x2f3605['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x2f3605;}['_createToggleDiffButtonView'](){const _0x4309a=new _0x28db64(this['locale']);_0x4309a['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x4309a['bind']('isEnabled')['to'](this,'isError',_0x5ba26a=>!_0x5ba26a),_0x4309a['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x131794=>!_0x131794),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1e8918=>_0x1e8918)]}});const _0x3b9a3c=i(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x5836ee=i(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x4309a['bind']('isOn')['to'](this,'isToggleDiffOn',_0x21d7ba=>_0x21d7ba),_0x4309a['bind']('icon')['to'](this,'isToggleDiffOn',_0x19f21a=>_0x19f21a?_0x146a4f:_0x541710),_0x4309a['bind']('label')['to'](this,'isToggleDiffOn',_0xaa0f2c=>_0xaa0f2c?_0x3b9a3c:_0x5836ee),_0x4309a['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x4309a;}['_createAcceptAllButtonView'](){const _0x151da6=new _0x28db64(this['locale']);return _0x151da6['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x151da6['bind']('isEnabled')['to'](this,'isError',_0x11a1ba=>!_0x11a1ba),_0x151da6['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x4df53c=>!_0x4df53c),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5b9ec9=>_0x5b9ec9)]}}),_0x151da6['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x151da6;}['_createExitReviewButtonView'](){const _0x3046bf=new _0x28db64(this['locale']);return _0x3046bf['set']({'label':i(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x3046bf['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary','ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x3f316a=>!_0x3f316a),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x74c377=>_0x74c377)]}}),_0x3046bf['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x3046bf;}['_createResultHeaderView'](){const _0x3b668d=new _0x25f6b6(this['locale']),_0x32e28b=this['_createTitleView']();return _0x3b668d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x4891f1=>_0x4891f1)]},'children':[_0x32e28b,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x3b668d;}['_createTitleView'](){const _0x4f8a05=new _0x25f6b6(this['locale']),_0x4e3a18=new li();return _0x4e3a18['bind']('isVisible')['to'](this,'isResultReady',_0x4cc335=>!_0x4cc335),_0x4f8a05['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x4e3a18,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x43a036=>_0x43a036)]},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]},{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x59a6dd=>!_0x59a6dd)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x4f8a05;}['_createFinishReviewButtonView'](){const _0x5019be=new vr(i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x5019be['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x59bb9b=>!_0x59bb9b)]}}),_0x5019be['delegate']('finishReview')['to'](this),_0x5019be;}}class be extends _0x1cf10a{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x38df3f,_0x1e43ba){super(_0x38df3f),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x1e43ba['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x1e43ba['headerText']);const _0x12979d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x12979d['if']('isVisible','ck-hidden',_0x564094=>!_0x564094)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai_review__review-completed-content-text']},'children':[{'text':_0x1e43ba['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x1b0b06){const _0x18db7f=new vr(_0x1b0b06,this['locale']);return _0x18db7f['delegate']('finishReview')['to'](this),_0x18db7f;}['_createResultHeaderView'](_0x29dadc){const _0x2e7a90=new _0x25f6b6(this['locale']);return _0x2e7a90['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title']},'children':[{'text':_0x29dadc}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x2e7a90;}}class Dr extends _0x25f6b6{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x439a9b,_0x4f1f1d){super(_0x439a9b),this['_defaultValue']=_0x4f1f1d['default']||(_0x4f1f1d['data']['length']>0x0?_0x4f1f1d['data'][0x0]['id']:''),this['_defaultLabel']=_0x4f1f1d['data']['find'](_0x5404e5=>_0x5404e5['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x340743(this['locale']);const _0xd24d99=this['_prepareListOptions'](_0x4f1f1d['data']);_0x1fdd70(this['_dropdownView'],_0xd24d99,{'role':'menu','ariaLabel':_0x4f1f1d['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x4a6c2b=>{_0x4a6c2b['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x5cb151=>{this['formValue']=_0x5cb151['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x5cb151['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai_review__check-list-item-parameterized-form-element','ck-ai_review__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x5efbc3=[]){const _0x3c94ba=new _0x207453();this['resetToDefault']();for(const _0x59b399 of _0x5efbc3){const _0x102724=new _0x173411({'label':_0x59b399['label'],'withText':!0x0,'role':'menuitemradio','id':_0x59b399['id'],'model':_0x59b399});_0x102724['bind']('isOn')['to'](this,'formValue',_0x15acfc=>_0x15acfc===_0x102724['id']);const _0x35754b={'type':'button','model':_0x102724};_0x3c94ba['add'](_0x35754b);}return _0x3c94ba;}}class sc extends _0x1cf10a{['_formItem']=null;constructor(_0x2b0901,_0x40a9ca,_0x140c4f){super(_0x2b0901),this['argsKey']=_0x40a9ca?.['argsKey'];if('dropdown'===_0x40a9ca['formType'])this['_formItem']=new Dr(this['locale'],_0x40a9ca);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x401b5a=new _0x273186(this['locale'],{'children':[this['_formItem']],'class':[_0x140c4f?'ck-form__row_with-submit':'']});_0x140c4f&&_0x401b5a['children']['add'](_0x140c4f),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x401b5a]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class po extends _0x247703{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0xecead3){super(_0xecead3),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x287999(),this['minRows']=po['MIN_ROWS'],this['maxRows']=po['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-prompt-input','class':['ck','ck-review__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class cc extends _0x25f6b6{['focusTracker']=new _0x49bffd();['keystrokes']=new _0x287999();['focusCycler'];['_focusables']=new _0x3fe74c();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x65e670,_0xdd2383,_0x2b7273=!0x1){super(_0x65e670),this['_check']=_0xdd2383,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0xdd2383['defaultModel']?_0xdd2383['defaultModel']['id']:'',this['_defaultLabel']=_0xdd2383['defaultModel']?_0xdd2383['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x4318b8(this['locale'],()=>new po(_0x65e670)),this['promptInputView']['fieldView']['bind']('value')['to'](this,'prompt'),this['promptInputView']['fieldView']['on']('input',()=>{this['prompt']=this['promptInputView']['fieldView']['element']['value'];}),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelSelectionDropdownItems']=new _0x207453(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x2b7273),_0x1fdd70(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x273186(this['locale'],{'children':[this['promptInputView']]}),new _0x273186(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x5198bf,_0xd21dfe)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0xd21dfe()):_0xd21dfe();}),this['focusCycler']=new _0x596602({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}));}['render'](){super['render'](),([this['promptInputView'],this['_modelSelectionDropdown'],this['cancelButtonView'],this['submitButtonView']]['forEach'](_0x41bf46=>{this['_focusables']['add'](_0x41bf46),this['focusTracker']['add'](_0x41bf46['element']);}),this['keystrokes']['listenTo'](this['element']));}get['modelDefaultValue'](){return this['_defaultValue'];}get['modelDefaultLabel'](){return this['_defaultLabel'];}['resetToDefault'](){this['prompt']='',this['modelId']=this['modelDefaultValue'],this['_modelSelectionDropdown']['buttonView']['label']=this['modelDefaultLabel'],this['resetFormValidationStatus']();}['resetFormValidationStatus'](){this['promptInputView']['errorText']='';}['_isValid'](){this['resetFormValidationStatus']();for(const _0x7cfeb3 of this['_getFormValidators']()){const _0x5de6f4=_0x7cfeb3();if(_0x5de6f4)return this['promptInputView']['errorText']=_0x5de6f4,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return i(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x327724=new _0x28db64(this['locale']),t=this['locale']['t'];return _0x327724['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x327724['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x327724;}['_createCancelButtonView'](){const _0x4eae1c=new _0x28db64(this['locale']),t=this['locale']['t'];return _0x4eae1c['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary'}),_0x4eae1c['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5f1888=>{_0x5f1888['stopPropagation']();})}}),_0x4eae1c['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x4eae1c;}['_setModelList'](_0x4c53bf){this['_modelSelectionDropdownItems']['clear']();const _0x754300=this['_check']['models'];if(_0x4c53bf)this['set']('modelDisplayMode','hidden');else{const _0x614c30=0x1===_0x754300['length'];this['set']('modelDisplayMode',_0x614c30?'name':'selector');}if(this['resetToDefault'](),_0x754300?.['length']){0x1===_0x754300['length']&&this['set']('activeModelName',_0x754300[0x0]['name']||_0x754300[0x0]['id']);for(const _0x25fb74 of _0x754300){const _0x85b78f=new _0x173411({'label':_0x25fb74['name'],'withText':!0x0,'role':'menuitemradio','id':_0x25fb74['id'],'model':_0x25fb74});_0x85b78f['bind']('isOn')['to'](this,'modelId',_0x5f1edd=>_0x5f1edd===_0x25fb74['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x85b78f,'labelView':new ko(this['locale'],_0x25fb74)});}}}['_createModelSelectionDropdown'](){const _0x1779f1=_0x340743(this['locale']);return _0x1779f1['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x1779f1['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),_0x1779f1['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x1dcb26=>'selector'===_0x1dcb26),this['listenTo'](_0x1779f1,'execute',_0x2e597d=>{this['modelId']=_0x2e597d['source']['model']['id'],_0x1779f1['buttonView']['label']=_0x2e597d['source']['label'];}),_0x1779f1;}['_createModelNameView'](){const _0xa900f4=new _o(this['locale']);return _0xa900f4['bind']('text')['to'](this,'activeModelName',_0x30bb56=>_0x30bb56??''),_0xa900f4['bind']('isVisible')['to'](this,'modelDisplayMode',_0x1ed3c0=>'name'===_0x1ed3c0),_0xa900f4;}['_createActionsFooterView'](){const _0x325725=new _0x25f6b6(this['locale']);return _0x325725['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0x325725;}}class _o extends _0x25f6b6{constructor(_0x5ad506){super(_0x5ad506),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x1be5cc=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x1be5cc['if']('isVisible','ck-hidden',_0x2f1f06=>!_0x2f1f06)]},'children':[{'text':_0x1be5cc['to']('text')}]});}}class ko extends _0x594a98{constructor(_0x540fb8,_0x394623){super();const _0x1bcf4d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x1bcf4d['to']('style'),'id':_0x1bcf4d['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x1bcf4d['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x394623['description']||'']}]}]});}}class ec extends _0x1cf10a{['_formItemsCollection']=new _0x3fe74c();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0xdf0e14,_0x4d1ed4,_0x1a8ff2,_0x21e92f=!0x1){super(_0xdf0e14),this['_hideModels']=_0x21e92f,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x4d1ed4['isParameterized']);const _0x3a5c28=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai_review__check-list-item_selected',_0x516b0d=>_0x516b0d),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0xcf7677=>_0xcf7677)],'style':{'--ck-ai-review-check-list-item-index':_0x1a8ff2}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-list-item-title-text']},'children':[{'text':_0x4d1ed4['title']}]},_0x3a5c28]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x4d1ed4['description']?[{'text':_0x4d1ed4['description']}]:[]}]}]},..._0x4d1ed4['isParameterized']?[this['_createParameterizedView'](_0x4d1ed4)]:[],...'custom'===_0x4d1ed4['id']?[this['_createCustomView'](_0x4d1ed4,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x4d1ed4['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x4d1ed4['id'],'args':_0x4d1ed4['useArgs']?_0x4d1ed4['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x13f50b({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x3a357e=>{_0x3a357e['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x26b82b=new _0x283d41();return _0x26b82b['content']=_0x4df6ac,_0x26b82b['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x26b82b;}['_createParameterizedView'](_0x5c08ea){const _0x101b0a=new _0x25f6b6(),_0x5ebc88=this['_createFormView'](_0x5c08ea);return _0x101b0a['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x2a29e5=>!_0x2a29e5)]},'children':[_0x5ebc88]}),_0x101b0a;}['_createFormView'](_0x18e2e8){const _0x38ab06=new _0x25f6b6(),_0x388ff3=Array['isArray'](_0x18e2e8['options'])?_0x18e2e8['options']:[],_0x32ebf6=new _0x28db64(this['locale']),t=this['locale']['t'];_0x32ebf6['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x32ebf6['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xb93ac0=>{_0xb93ac0['stopPropagation']();})}}),_0x32ebf6['on']('execute',()=>{const _0x145fa6=[],_0x426b74={};this['_formItemsCollection']['forEach'](_0x4e724d=>{_0x145fa6['push'](_0x4e724d['value']),_0x18e2e8['useArgs']&&_0x18e2e8['options']&&(_0x426b74[_0x4e724d['argsKey']]=_0x4e724d['value']);}),this['fire']('runReviewCheck',{'id':_0x18e2e8['id'],'params':_0x145fa6['length']?_0x145fa6:void 0x0,'args':Object['keys'](_0x426b74)['length']?_0x426b74:void 0x0});});const _0x37b30c=_0x388ff3['length'];return _0x388ff3['forEach']((_0x5189d2,_0x47db55)=>{const _0x86d769=_0x47db55===_0x37b30c-0x1;this['_formItemsCollection']['add'](new sc(this['locale'],_0x5189d2,_0x86d769?_0x32ebf6:null));}),_0x38ab06['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x38ab06;}['_createCustomView'](_0x1829b2,_0x11b803=!0x1){return this['_customCheckView']=new cc(this['locale'],_0x1829b2,_0x11b803),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-parameterized','ck-ai_review__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x527436=>!_0x527436)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x2794ed,_0x59d5a2,_0x9a2c2a)=>{_0x9a2c2a||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class je extends _0x1cf10a{['_checkViews'];constructor(_0x3f7a3a){super(_0x3f7a3a),this['_checkViews']=new _0x3fe74c(),this['_setupTemplate']();}['setChecks'](_0x44fec8,_0xcb9243=!0x1){this['_checkViews']['clear']();for(const [_0x3f1519,_0x3ce818]of _0x44fec8['entries']()){const _0x305f06=new ec(this['locale'],_0x3ce818,_0x3f1519,_0xcb9243);_0x305f06['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x305f06);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x56bdfd of this['_checkViews'])_0x56bdfd instanceof ec&&_0x56bdfd['resetToDefault']();}['_setupTemplate'](){const _0x2eb341=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x2eb341['if']('isVisible','ck-hidden',_0x46ec09=>!_0x46ec09)]},'children':this['_checkViews']});}}class ge extends Me{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x4ac5bc=this['context']['locale'],_0x5c0973=new _0x214d1d(_0x4ac5bc,{'label':i(_0x4ac5bc,'AI_REVIEW_MODE'),'icon':_0x2dc573,'class':'ck-ai-header\x20ck-ai-header_review'});return new Ae(this['context']['locale'],{'header':_0x5c0973,'list':new je(_0x4ac5bc),'results':new Ve(_0x4ac5bc,{'generalErrorText':i(_0x4ac5bc,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new be(_0x4ac5bc,{'headerText':i(_0x4ac5bc,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':i(_0x4ac5bc,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0x4ac5bc,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x340a1f=this['context']['plugins']['get']('AITabs');_0x340a1f['view']['on']('activateTab',(_0x516ff3,_0x50d6d8)=>{'reviewMode'===_0x50d6d8?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x340a1f['view']['addTab']({'id':'reviewMode','buttonLabel':i(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x2dc573,'order':0x0,'content':this['_mainView']});}}const fe='review-';class de extends _0x3de4b5{static get['requires'](){return[_0x29b670,D];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];constructor(_0x352122){super(_0x352122),this['_domEmitter']=new(_0x3d476c())(),this['_eventEmitter']=new(_0x12cec9())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x2c4b2b=T(this['context']);_0x2c4b2b['conversion']['for']('editingDowncast')['markerToElement']({'model':fe+'insert','view':(_0x59aa63,{writer:_0x1c5e4c})=>{const _0x2f2613=this['_markers']['get'](_0x59aa63['markerName']),_0x5c2be7={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x2f2613?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x59aa63['markerName']};return _0x1c5e4c['createUIElement']('span',_0x5c2be7,function(_0x5db7a3){const _0x43b886=this['toDomElement'](_0x5db7a3);return _0x43b886['innerHTML']=_0x2f2613?.['content']?.['asString']||'',_0x43b886;});}}),_0x2c4b2b['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-only','view':_0x3983bb=>{const _0x4874c0=this['_markers']['get'](_0x3983bb['markerName']),_0x153f85=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x4874c0?.['id']||'')&&_0x153f85['push']('ck-ai_review__change_active'),{'classes':_0x153f85,'attributes':{'data-marker-id':_0x3983bb['markerName']}};}}),_0x2c4b2b['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-context','view':_0x42fd9e=>{const _0x28bcf0=this['_markers']['get'](_0x42fd9e['markerName']),_0x2d41ba=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x28bcf0?.['id']||'')&&_0x2d41ba['push']('ck-ai_review__change_active'),{'classes':_0x2d41ba,'attributes':{'data-marker-id':_0x42fd9e['markerName']}};}}),_0x2c4b2b['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-text','view':_0x7fc12f=>{const _0xcc74f0=this['_markers']['get'](_0x7fc12f['markerName']),_0x323e03=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0xcc74f0?.['id']||'')&&_0x323e03['push']('ck-ai_review__change_active'),{'classes':_0x323e03,'attributes':{'data-marker-id':_0x7fc12f['markerName']}};}}),_0x2c4b2b['conversion']['for']('dataDowncast')['markerToElement']({'model':fe+'suggestion-context','view':(_0x20a745,{writer:_0x452ebd})=>_0x452ebd['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x20a745['isOpening']?'start':'end')})}),_0x2c4b2b['conversion']['for']('downcast')['attributeToAttribute']({'model':Ct,'view':_0x3b8ea2});const _0x1a016d=_0x2c4b2b['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x1a016d,'mouseup',(_0x4c7b58,_0x38d3f1)=>{const _0x3c6466=_0x38d3f1['target'],_0x3f2bc2=this['_findMarkerElement'](_0x3c6466);if(!_0x3f2bc2)return;const _0x52b8a7=_0x3f2bc2['getAttribute']('data-marker-id'),_0x4d834e=_0x52b8a7['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x52b8a7,'changeId':_0x4d834e,'markerElement':()=>this['_findMarkerElementById'](_0x52b8a7),'domEvent':_0x38d3f1});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x1a016d,'mouseover',(_0x57aca2,_0x2b560a)=>{const _0x1789f1=_0x2b560a['target'],_0x2d3a04=_0x2b560a['relatedTarget'];let _0x2c946d=this['_findMarkerElement'](_0x1789f1);if(!_0x2c946d&&_0x2d3a04&&(_0x2c946d=this['_findMarkerElement'](_0x2d3a04)),!_0x2c946d)return;const _0x141122=_0x2c946d['getAttribute']('data-marker-id'),_0x563c2b=_0x141122['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x563c2b,'markerElement':()=>this['_findMarkerElementById'](_0x141122),'domEvent':_0x2b560a});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x3dc05e((_0x221d1,_0x10f680)=>{const _0x2d3d51=_0x10f680['target'];if(this['_findMarkerElement'](_0x2d3d51))return;_0x2d3d51['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x2c4b2b['model']['document']['registerPostFixer'](_0x54a957=>this['_validateMarkers'](_0x2c4b2b,_0x54a957)),_0x2c4b2b['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x2c4b2b));}['getDocumentData'](){const _0xe1ad5=this['context']['plugins']['get']('AIEditing'),_0x28a065=T(this['context']),_0x267e32=_0x28a065['model'],_0x511f1e=new tt();for(const _0x41ce38 of _0x267e32['document']['getRoot']()['getChildren']()){const _0x499252=_0x41ce38['_clone'](!0x0);_0x511f1e['_appendChild'](_0x499252);}for(const _0x2ac02c of _0x267e32['markers'])_0x511f1e['markers']['set'](_0x2ac02c['name'],this['_changeRangeOwnerDocument'](_0x2ac02c['getRange']()['clone'](),_0x511f1e));const _0x40be5e=new _0x18a58a({'ignoreElementEnd':!0x0,'startPosition':_0x267e32['createPositionAt'](_0x511f1e,0x0)}),_0x4eee52=new Set(),_0x1b74a4=new Map();for(const {item:_0x143531}of _0x40be5e){if(!_0x143531['is']('$textProxy'))continue;const _0x51f085=_0x143531['parent'];if(_0x51f085&&_0x51f085['is']('element')){const _0x1966dc=this['_upsertDataId'](_0x51f085,()=>_0xe1ad5['_nextDataId'](_0x4eee52));_0x4eee52['add'](_0x1966dc);for(const _0x5f2d0d of _0x51f085['getChildren']())_0x5f2d0d['is']('element')&&_0x4eee52['add'](this['_upsertDataId'](_0x5f2d0d,()=>_0xe1ad5['_nextDataId'](_0x4eee52)));let _0xf0ab12=_0x51f085;for(;_0xf0ab12['parent']&&!_0xf0ab12['parent']['is']('documentFragment');)_0xf0ab12=_0xf0ab12['parent'],_0xf0ab12['hasAttribute'](Ct)&&_0xf0ab12['_removeAttribute'](Ct);_0x1b74a4['set'](_0x1966dc,{'path':_0x51f085['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0xf0ab12['_clone'](!0x0),_0x1966dc,_0x28a065['data'])}),_0x40be5e['jumpTo'](_0x267e32['createPositionAfter'](_0x51f085));}}return{'content':_0x28a065['data']['processor']['toData'](_0x28a065['data']['toView'](_0x511f1e)),'version':_0x28a065['model']['document']['version'],'elements':_0x1b74a4};}['diffContent'](_0x8f2ef9,_0x2bdf8e,_0x1df5d4=!0x1){const _0x2c537a=[],_0x3c015f=T(this['context']),_0x135f5b=_0x3c015f['data']['parse'](_0x2bdf8e,'$documentFragment'),_0x358b88=_0x3c015f['data']['parse'](_0x8f2ef9,'$documentFragment'),_0x9645fc=_0x3c015f['model']['createPositionAt'](_0x358b88,0x0);if(this['_haveSingleTopLevelElement'](_0x135f5b)){if(!this['_hasSameTopLevelElement'](_0x358b88,_0x135f5b))return _0x2c537a;}else{const _0x4fbda5=_0x3c015f['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x358b88,_0x4fbda5)||!this['_haveOnlyInlineContent'](_0x135f5b,_0x4fbda5))return _0x2c537a;}const _0x48af4e=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x8f2ef9,_0x2bdf8e,{'anchor':_0x9645fc,'markDeletions':!0x0})['getOperations']()['filter'](_0x2d1ec0=>'insert'===_0x2d1ec0['type']||'marker'===_0x2d1ec0['type']&&_0x2d1ec0['name']['startsWith']('$markedRemove')),_0x4672b1=this['_groupAdjacentOperations'](_0x48af4e),_0x3a94e3=[];if(_0x1df5d4){if(_0x4672b1['length']){const _0x51374b=_0x4672b1[0x0]['operations'][0x0],_0x3368a9='insert'===_0x51374b['type']?_0x51374b['position']:_0x51374b['newRange']['start'],_0x557cb6=this['_getPositionLimitingRange'](_0x3368a9,_0x3c015f,'inside'),_0x19ce98=_0x557cb6?_0x135f5b['getChild'](0x0)['getChildren']():_0x135f5b['getChildren'](),_0x2f6829=_0x557cb6||_0x3c015f['model']['createRangeIn'](_0x358b88),_0x10d36d=[new _0x3f2bd2('$markedRemove:synthetic'+_0x589eaf(),null,_0x2f6829,_0x3c015f['model']['document']['model']['markers'],!0x0,_0x3c015f['model']['document']['version']+0x1),new _0x58153c(_0x2f6829['end'],_0x19ce98,_0x3c015f['model']['document']['version']+0x2)];_0x3a94e3['push']({'operations':_0x10d36d,'operationsIsolated':_0x10d36d,'groupOffset':0x0});}}else _0x3a94e3['push'](..._0x4672b1);let _0x546aa2=0x0;return _0x3c015f['model']['change'](_0x2092cd=>{for(let _0x1d4007=0x0;_0x1d4007<_0x3a94e3['length'];_0x1d4007++){const _0x1f20e5=_0x3a94e3[_0x1d4007],_0x404494=_0x2092cd['createDocumentFragment']();for(const _0x345e31 of _0x358b88['getChildren']())_0x2092cd['append'](_0x345e31['_clone'](!0x0),_0x404494);for(const _0x367f69 of _0x1f20e5['operationsIsolated'])if('insert'===_0x367f69['type']){const _0x52b6bc=_0x367f69;_0x52b6bc['baseVersion']=null,_0x52b6bc['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x52b6bc,_0x404494),_0x2092cd['batch']['addOperation'](_0x367f69),_0x3c015f['model']['applyOperation'](_0x367f69);const _0x5b2c3a='suggestion:insertion:id:authorId:'+_0x546aa2++,_0x31f474=_0x3c015f['model']['createRange'](_0x52b6bc['position'],_0x52b6bc['position']['getShiftedBy'](_0x52b6bc['howMany']));_0x404494['markers']['set'](_0x5b2c3a,_0x31f474);}else{if('marker'===_0x367f69['type']&&_0x367f69['name']['startsWith']('$markedRemove')){const _0x2433a6=_0x367f69,_0x5f2c74='suggestion:deletion:id:authorId:'+_0x546aa2++;this['_changeOperationOwnerDocument'](_0x2433a6,_0x404494),_0x404494['markers']['set'](_0x5f2c74,_0x2433a6['newRange']);}}if(_0x1df5d4)_0x2c537a['push']({..._0x1f20e5,'context':this['_createGetContentFn'](_0x358b88,_0x3c015f['data']),'content':this['_createGetContentFn'](_0x358b88,_0x3c015f['data'])});else{const _0x365685=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x1f20e5['operationsIsolated'][0x0]),_0x404494),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x1f20e5['operationsIsolated'][_0x1f20e5['operationsIsolated']['length']-0x1]),_0x404494));_0x404494['markers']['set'](fe+'suggestion-context',new it(_0x365685['start'],_0x365685['end'])),_0x2c537a['push']({..._0x1f20e5,'context':this['_createGetContextFn'](_0x404494,_0x3c015f['data'],{'ellipsisBefore':_0x365685['hasContentBefore'],'ellipsisAfter':_0x365685['hasContentAfter']}),'content':this['_createGetContentFn'](_0x404494,_0x3c015f['data'])});}}}),_0x2c537a;}['markChangePositionInEditorContent'](_0x51f7b7,_0x439e77){if(!_0x51f7b7['length'])return;const _0x5e0539=_0x51f7b7[0x0]['parent']['id'],_0x45c9d5=_0x439e77['elements']['get'](_0x5e0539);if(!_0x45c9d5)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x5e0539);const _0x2ff7f7=_0x45c9d5['path'],_0x2b0fc7=T(this['context']),_0x3f0168=_0x2b0fc7['model']['document']['history']['getOperations'](_0x439e77['version']),_0x373de4=[];for(const _0x4084df of _0x51f7b7){const _0x38e4fd=_0x4084df['operationsIsolated']['map'](_0x594b8b=>this['_translateOperationToEditorContent'](_0x594b8b,_0x2ff7f7,_0x2b0fc7['model']['document']['getRoots']()[0x0]));if(!_0x38e4fd||!_0x38e4fd['length'])continue;const _0x46c5d9=_0x38e4fd['every'](_0x6de001=>'marker'===_0x6de001['type']&&_0x6de001['name']['startsWith']('$markedRemove')),_0x1b38f2={'document':_0x2b0fc7['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x303717=nt(_0x38e4fd,_0x3f0168,_0x1b38f2)['operationsA'];for(const _0x179455 of _0x303717)if('insert'===_0x179455['type']){const _0x597ab1=_0x179455,_0x478706=_0x597ab1['nodes'];_0x2b0fc7['model']['change'](_0x124898=>{const _0x427641=_0x124898['createDocumentFragment']();for(const _0x38b5ad of _0x478706)_0x124898['append'](_0x38b5ad['_clone'](!0x0),_0x427641);_0x373de4['push']({'start':_0x597ab1['position'],'end':_0x597ab1['position'],'type':'insert','groupId':_0x4084df['id'],'content':{'asString':this['_createGetContentFn'](_0x427641,_0x2b0fc7['data'])(),'asFragment':_0x427641}});});}else{if('marker'===_0x179455['type']&&_0x179455['name']['startsWith']('$markedRemove')){const _0x4c617d=_0x179455;let _0x1c1065='remove-text';if(_0x46c5d9){const _0x95dbef=this['_findAdjacentContextDistance'](_0x4c617d['newRange']['start'],'backward',_0x2b0fc7['model']['schema']),_0x141ce0=this['_findAdjacentContextDistance'](_0x4c617d['newRange']['end'],'forward',_0x2b0fc7['model']['schema']);if(_0x95dbef||_0x141ce0){const _0xe84d28=_0x4c617d['newRange']['start']['getShiftedBy'](-_0x95dbef),_0x1e4957=_0x4c617d['newRange']['end']['getShiftedBy'](_0x141ce0);_0x373de4['push']({'start':_0xe84d28,'end':_0x1e4957,'groupId':_0x4084df['id'],'type':'remove-context'});}else _0x1c1065='remove-only';}_0x373de4['push']({'start':_0x4c617d['newRange']['start'],'end':_0x4c617d['newRange']['end'],'groupId':_0x4084df['id'],'type':_0x1c1065});}}}this['_insertMarkers'](_0x373de4);}['clearAllMarkers'](){const _0x37693c=T(this['context']);_0x37693c['model']['change'](_0x2b969b=>{for(const _0x37d3d3 of this['_markers']['keys']())_0x37693c['model']['markers']['get'](_0x37d3d3)&&_0x2b969b['removeMarker'](_0x37d3d3);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){T(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){T(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x4d9747){const _0x16ac55=T(this['context']),_0x14ea6f=_0x16ac55['model'],_0x38cd6b=_0x4d9747['map'](_0x418c02=>this['_getMarkersDataForGroup'](_0x418c02))['flat']();_0x14ea6f['change'](_0x1a7c0d=>{for(const _0x33065e of _0x38cd6b){const _0x2dcfe7=_0x16ac55['model']['markers']['get'](_0x33065e['id']);if(_0x2dcfe7){if('insert'===_0x33065e['type']){if(!_0x33065e['content'])continue;_0x14ea6f['insertContent'](_0x33065e['content']['asFragment']||null,_0x2dcfe7['getRange']()['start']);}else'remove-text'!==_0x33065e['type']&&'remove-only'!==_0x33065e['type']||_0x14ea6f['deleteContent'](_0x14ea6f['createSelection'](_0x2dcfe7['getRange']()));_0x1a7c0d['removeMarker'](_0x33065e['id']),this['_markers']['delete'](_0x33065e['id']);}}});}['rejectChange'](_0x98002b){const _0x556fec=T(this['context']),_0x2a017a=this['_getMarkersDataForGroup'](_0x98002b);_0x556fec['model']['change'](_0x3abc27=>{for(const _0x59a75c of _0x2a017a)_0x3abc27['removeMarker'](_0x59a75c['id']),this['_markers']['delete'](_0x59a75c['id']);});}['getEditor'](){return T(this['context']);}['getMarkerElementForChange'](_0x4811c4){const _0x2739df=Array['from'](this['_markers']['values']())['filter'](_0x23d0c9=>_0x23d0c9['groupId']===_0x4811c4);if(!_0x2739df['length'])return null;const _0x3ddf5d=0x1===_0x2739df['length']?_0x2739df[0x0]:this['_sortMarkers'](_0x2739df)[0x0],_0x2fb4ca=T(this['context'])['model']['markers']['get'](_0x3ddf5d['id']);if(!_0x2fb4ca)return null;return{'modelRange':_0x2fb4ca['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x3ddf5d['id'])};}['getContentElementForChange'](_0x3560ea){const _0x4aa667=Array['from'](this['_markers']['values']())['filter'](_0x5d15ff=>_0x5d15ff['groupId']===_0x3560ea);if(!_0x4aa667['length'])return null;const _0x55b532=0x1===_0x4aa667['length']?_0x4aa667[0x0]:this['_sortMarkers'](_0x4aa667)[0x0],_0xb568c0=T(this['context']),_0x249e49=_0xb568c0['model']['markers']['get'](_0x55b532['id']);if(!_0x249e49)return null;const _0x132543=_0x249e49['getRange'](),_0x20ca6f=_0xb568c0['editing']['view']['getDomRoot']();if(!_0x20ca6f||!_0x132543)return null;let _0x44a201=_0x132543['start']['parent'];for(;_0x44a201['parent']&&'$root'!==_0x44a201['parent']['name'];)_0x44a201=_0x44a201['parent'];if(!_0x44a201||!_0x44a201['name'])return null;const _0x21b219=_0x20ca6f['querySelector']('[data-marker-id=\x22'+_0x55b532['id']+'\x22]');if(!_0x21b219)return null;let _0x56a65a=null;_0xb568c0['model']['change'](_0x181ba5=>{_0x56a65a=_0x181ba5['createDocumentFragment'](),_0x181ba5['append'](_0x44a201['_clone'](!0x0),_0x56a65a);});const _0x3d0ffc=_0xb568c0['data']['toView'](_0x56a65a)['getChild'](0x0);return _0x21b219['closest'](_0x3d0ffc['name']);}['reactivateMarkers'](_0x2ac5bb){const _0x2c0424=this['_getMarkersDataForGroup'](_0x2ac5bb);if(!_0x2c0424['length'])return;const _0x4f2083=Array['from'](this['_activeMarkers'])['sort'](),_0x47b998=Array['from'](new Set(_0x2c0424['map'](_0x18d20c=>_0x18d20c['id'])))['sort']();_0x4f2083['join']('|')!==_0x47b998['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x2ac5bb));}['setMarkersInElementAsActive'](_0x12c8fa){const _0x2afa91=this['_getMarkersDataForGroup'](_0x12c8fa);if(!_0x2afa91['length'])return;const _0x565384=T(this['context']),_0xdfb9e1=new Set(_0x2afa91['map'](_0x3e2cf5=>_0x3e2cf5['id'])),_0x722845=Array['from'](_0xdfb9e1['values']())['map'](_0x46cbed=>_0x565384['model']['markers']['get'](_0x46cbed))['filter'](_0x44b084=>!!_0x44b084);_0xdfb9e1['forEach'](_0x231edd=>{this['_activeMarkers']['add'](_0x231edd);}),_0x565384['model']['change'](()=>{_0x722845['forEach'](_0x55b01f=>{_0x565384['editing']['reconvertMarker'](_0x55b01f);});});}['setAllMarkersAsInactive'](){const _0x14d342=Array['from'](this['_activeMarkers']);if(!_0x14d342['length'])return;this['_activeMarkers']['clear']();const _0x1473a5=T(this['context']),_0x17e3e0=_0x14d342['map'](_0x404df0=>_0x1473a5['model']['markers']['get'](_0x404df0))['filter'](_0x4844cd=>!!_0x4844cd);_0x1473a5['model']['change'](()=>{_0x17e3e0['forEach'](_0x10f26d=>{_0x1473a5['editing']['reconvertMarker'](_0x10f26d);});});}['_getPositionLimitingRange'](_0x2bca45,_0x47d90e,_0xa421b5='outside'){if(!_0x2bca45)return null;let _0x3e7771=_0x2bca45['parent'];for(;_0x3e7771&&_0x3e7771['parent']&&'$root'!==_0x3e7771['parent']['name']&&!_0x47d90e['model']['schema']['isLimit'](_0x3e7771)&&!_0x47d90e['model']['schema']['isBlock'](_0x3e7771);)_0x3e7771=_0x3e7771['parent'];if(!_0x3e7771||!_0x3e7771['name']||'$root'===_0x3e7771['name'])return null;let _0x92e91b=null;return _0x47d90e['model']['change'](_0x203bb4=>{_0x92e91b='inside'===_0xa421b5?_0x203bb4['createRangeIn'](_0x3e7771):_0x203bb4['createRangeOn'](_0x3e7771);}),_0x92e91b;}['_validateMarkers'](_0x3802ed,_0x31fa83){const _0x2215f3=Array['from'](this['_markers']['keys']()),_0x3e6906=new Map();for(const _0x50f5af of _0x2215f3){const _0x5e1095=_0x3802ed['model']['markers']['get'](_0x50f5af);if(!_0x5e1095)continue;const _0x4e0532=_0x5e1095['getStart']()['path'][0x0];_0x3e6906['has'](_0x4e0532)||_0x3e6906['set'](_0x4e0532,[]),_0x3e6906['get'](_0x4e0532)['push'](_0x5e1095);}const _0x13c9c8=new Set();for(const _0x1cd1ac of _0x3802ed['model']['document']['differ']['getChanges']()){let _0x3f558e=-0x1,_0x55ea42=null;if('insert'===_0x1cd1ac['type'])_0x55ea42=new it(_0x1cd1ac['position'],_0x1cd1ac['position']['getShiftedBy'](_0x1cd1ac['length'])),_0x3f558e=_0x1cd1ac['position']['path'][0x0];else{if('remove'!==_0x1cd1ac['type'])continue;_0x55ea42=new it(_0x1cd1ac['position']),_0x3f558e=_0x1cd1ac['position']['path'][0x0];}const _0x16f1fa=_0x3e6906['get'](_0x3f558e)||[];if(_0x16f1fa['length']){for(const _0x506925 of _0x16f1fa)if(_0x55ea42['root']['rootName']===_0x506925['getRange']()['root']['rootName']&&('insert'!==_0x1cd1ac['type']||!_0x55ea42['containsRange'](_0x506925['getRange']()))&&(_0x55ea42['isIntersecting'](_0x506925['getRange']())||_0x55ea42['start']['isTouching'](_0x506925['getRange']()['end'])||_0x55ea42['end']['isTouching'](_0x506925['getRange']()['start']))){const _0x3d079f=this['_parseMarkerName'](_0x506925['name']);Array['from'](this['_markers']['values']())['filter'](_0x30e335=>_0x30e335['groupId']===_0x3d079f['groupId'])['forEach'](_0x3ae96b=>_0x13c9c8['add'](_0x3ae96b['id']));}}}if(_0x13c9c8['size']){for(const _0x5b3160 of _0x13c9c8)_0x31fa83['removeMarker'](_0x5b3160);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x5980ef){for(const {name:_0x5a8069,data:_0x3fc045}of _0x5980ef['model']['document']['differ']['getChangedMarkers']()){if(!_0x5a8069['startsWith'](fe))continue;const _0x23db4a=_0x3fc045['oldRange'],_0x377de7=_0x3fc045['newRange'],_0x4e55d9=_0x23db4a&&'$graveyard'===_0x23db4a['root']['rootName'],_0x1b5b95=_0x377de7&&'$graveyard'===_0x377de7['root']['rootName'];if(_0x4e55d9&&_0x1b5b95)continue;const _0x500b77=this['_parseMarkerName'](_0x5a8069);this['_markers']['get'](_0x5a8069)&&(_0x1b5b95||!_0x377de7?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x5a8069,'changeId':_0x500b77['groupId']}):_0x4e55d9&&_0x377de7&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x5a8069,'changeId':_0x500b77['groupId']}));}}['_parseMarkerName'](_0x354f49){const _0x57cd3e=_0x354f49['split'](':'),_0x11bf8c=(_0x57cd3e[0x1]||'')['split']('_');return{'prefix':_0x57cd3e[0x0],'groupId':_0x11bf8c[0x0],'suffix':_0x11bf8c[0x1]};}['_translateOperationToEditorContent'](_0x3ea9bd,_0x4c44c6,_0x18b37d){if('insert'===_0x3ea9bd['type']){const _0x488dbc=_0x3ea9bd;return new _0x58153c(this['_changePosition'](_0x4c44c6['concat'](_0x488dbc['position']['offset']),_0x18b37d),_0x488dbc['nodes'],_0x488dbc['baseVersion']);}if('marker'===_0x3ea9bd['type']&&_0x3ea9bd['name']['startsWith']('$markedRemove')){const _0x1a02b9=_0x3ea9bd;return new _0x3f2bd2(_0x1a02b9['name'],_0x1a02b9['oldRange'],this['_changeRange'](_0x1a02b9['newRange'],_0x4c44c6['concat'](_0x1a02b9['newRange']['start']['offset']),_0x4c44c6['concat'](_0x1a02b9['newRange']['end']['offset']),_0x18b37d),_0x1a02b9['_markers'],_0x1a02b9['affectsData'],_0x1a02b9['baseVersion']);}return _0x3ea9bd;}['_groupAdjacentOperations'](_0x4f20e9){if(!_0x4f20e9['length'])return[];const _0x14d2f6=[];let _0x293b0e=0x0,_0x6a0072=0x0,_0x5925db=[];for(let _0x4d6c5e=0x0;_0x4d6c5e<=_0x4f20e9['length'];_0x4d6c5e++){const _0x740e36=_0x4f20e9[_0x4d6c5e],_0x4fd474=_0x4f20e9[_0x4d6c5e-0x1];!_0x740e36||_0x4fd474&&!this['_getOperationEnd'](_0x4fd474)['isTouching'](this['_getOperationStart'](_0x740e36))?(_0x14d2f6['push']({'operations':_0x5925db,'operationsIsolated':_0x5925db['map'](_0x4e1840=>this['_shiftOperation'](_0x4e1840['clone'](),-_0x6a0072)),'groupOffset':_0x293b0e}),_0x5925db=_0x740e36?[_0x740e36]:[],_0x6a0072+=_0x293b0e,_0x293b0e=0x0):_0x5925db['push'](_0x740e36),_0x740e36&&'insert'===_0x740e36['type']&&(_0x293b0e+=_0x740e36['howMany']);}return _0x14d2f6;}['_findAdjacentContextDistance'](_0x236efc,_0x32482b,_0x14eb6a,_0x5daa8f=0x1){const _0x11b653=new _0x18a58a({'startPosition':_0x236efc,'direction':_0x32482b});let _0x42a06f=0x0;for(let _0x3f1203=0x0;_0x3f1203<_0x5daa8f;_0x3f1203++){let _0x24a1bd=0x0,_0x55a5a1=!0x1,_0x425094='forward'===_0x32482b?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x5dbce0}of _0x11b653)if(_0x5dbce0['is']('$textProxy')){const _0x359343=_0x425094['exec'](_0x5dbce0['data']);if(_0x359343&&_0x359343['length']){if(_0x24a1bd+='forward'===_0x32482b?_0x359343['index']+_0x359343[0x0]['length']:_0x5dbce0['data']['length']-_0x359343['index'],_0x359343[0x0]['length']!==_0x5dbce0['data']['length'])break;_0x55a5a1=!0x0,_0x425094='forward'===_0x32482b?/^\w+/:/\w+$/;}else{if(_0x55a5a1)break;_0x24a1bd+=_0x5dbce0['offsetSize'];}}else{if(_0x5dbce0['is']('element')){_0x14eb6a['isInline'](_0x5dbce0)&&!_0x55a5a1&&(_0x24a1bd+=0x1);break;}}_0x42a06f+=_0x24a1bd,_0x11b653['jumpTo'](_0x236efc['getShiftedBy']('forward'===_0x32482b?_0x42a06f:-_0x42a06f));}return _0x42a06f;}['_getChangeContext'](_0x5aaa8c,_0x5b650d){const _0x330dce=T(this['context'])['model']['schema'],_0x17e62a=this['_findAdjacentContextDistance'](_0x5aaa8c,'backward',_0x330dce,0x6),_0x530760=this['_findAdjacentContextDistance'](_0x5b650d,'forward',_0x330dce,0x6),_0x2084cb=_0x5aaa8c['getShiftedBy'](-_0x17e62a),_0x2e4acf=_0x5b650d['getShiftedBy'](_0x530760);return{'start':_0x2084cb,'end':_0x2e4acf,'hasContentBefore':!_0x2084cb['isAtStart'],'hasContentAfter':!_0x2e4acf['isAtEnd']};}['_insertMarkers'](_0x4080d4){const _0x21f41a=this['context']['plugins']['get']('AIEditing'),_0x52d111=new Set();T(this['context'])['model']['change'](_0x3b763f=>{for(const _0x493873 of _0x4080d4){const _0x2277e4=''+fe+_0x493873['type']+':'+_0x493873['groupId']+'_'+_0x21f41a['_nextDataId'](_0x52d111);this['_markers']['set'](_0x2277e4,{'id':_0x2277e4,'groupId':_0x493873['groupId'],'type':_0x493873['type'],'content':_0x493873['content']}),_0x3b763f['addMarker'](_0x2277e4,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3b763f['createRange'](_0x493873['start'],_0x493873['end'])});}});}['_createGetContextFn'](_0x4a9571,_0x569179,_0x531e8a){let _0x506968='';return()=>{if(!_0x506968){const _0x2e5630=_0x569179['toView'](_0x4a9571,{'showSuggestionHighlights':!0x0});let _0x4ebeea=_0x2e5630['getChild'](0x0);if(_0x4ebeea['is']('containerElement')||(_0x4ebeea=_0x2e5630),!_0x4ebeea)return'';let _0x4471f3=!0x1;const _0x4dc834=[];for(const _0x4ca6ad of _0x4ebeea['getChildren']())_0x4ca6ad['is']('element','span')&&_0x4ca6ad['hasClass']('ck-ai_review-marker_context-end')&&(_0x4471f3=!0x1),_0x4471f3&&_0x4dc834['push'](_0x4ca6ad),_0x4ca6ad['is']('element','span')&&_0x4ca6ad['hasClass']('ck-ai_review-marker_context-start')&&(_0x4471f3=!0x0);_0x4ebeea['_removeChildren'](0x0,_0x4ebeea['childCount']),_0x531e8a?.['ellipsisBefore']&&_0x4ebeea['_appendChild']('…'),_0x4ebeea['_appendChild'](_0x4dc834),_0x531e8a?.['ellipsisAfter']&&_0x4ebeea['_appendChild']('…');const _0x285203=_0x569179['htmlProcessor']['domConverter']['viewToDom'](_0x2e5630),_0x52e326=_0x569179['htmlProcessor']['htmlWriter']['getHtml'](_0x285203);_0x506968=_0x52e326;}return _0x506968;};}['_createGetContentFn'](_0x1ef624,_0x1c5024){let _0x526b0b='';return()=>(_0x526b0b||(_0x526b0b=_0x1c5024['stringify'](_0x1ef624,{'showSuggestionHighlights':!0x0})),_0x526b0b);}['_createGetContentUsingDataIdFn'](_0xef20c3,_0x1b8717,_0x3866dd){let _0x1febb4='';return()=>{if(!_0x1febb4){const _0x1004e5=_0x3866dd['toView'](new tt(_0xef20c3)),_0x49f95c=_0x3866dd['htmlProcessor']['domConverter']['viewToDom'](_0x1004e5)['querySelector']('[data-id=\x22'+_0x1b8717+'\x22]');_0x1febb4=_0x49f95c?.['outerHTML']||'';}return _0x1febb4;};}['_findMarkerElement'](_0x130706,_0x456aa7=0x5){let _0x4b5dff=_0x130706,_0x51d8b0=null;for(let _0x50cc85=0x0;_0x50cc85<_0x456aa7&&_0x4b5dff;_0x50cc85++){if(!_0x4b5dff['className']){_0x4b5dff=_0x4b5dff['parentElement'];continue;}if(!(''+_0x4b5dff['className'])['includes']('ck-ai_review-marker_')){_0x4b5dff=_0x4b5dff['parentElement'];continue;}if(!_0x4b5dff['getAttribute']('data-marker-id'))break;_0x51d8b0=_0x4b5dff;break;}return _0x51d8b0;}['_findMarkerElementById'](_0x194661){const _0x38ee22=T(this['context']),_0x158f2a=_0x38ee22['model']['markers']['get'](_0x194661);return _0x158f2a?_0x301572(_0x38ee22['editing'],_0x158f2a):null;}['_getMarkersDataForGroup'](_0x3e4671){return Array['from'](this['_markers']['values']())['filter'](_0x2e4d4e=>_0x2e4d4e['groupId']===_0x3e4671);}['_getOperationStart'](_0x5b6ed7){return'insert'===_0x5b6ed7['type']?_0x5b6ed7['position']:_0x5b6ed7['newRange']['start'];}['_getOperationEnd'](_0x5eef86,_0x33ad18=!0x1){return'insert'===_0x5eef86['type']?_0x33ad18?_0x5eef86['position']:_0x5eef86['position']['getShiftedBy'](_0x5eef86['howMany']):_0x5eef86['newRange']['end'];}['_shiftOperation'](_0x228907,_0x43a0bb){return'insert'===_0x228907['type']?_0x228907['position']=_0x228907['position']['getShiftedBy'](_0x43a0bb):'marker'===_0x228907['type']&&_0x228907['newRange']&&(_0x228907['newRange']=new it(_0x228907['newRange']['start']['getShiftedBy'](_0x43a0bb),_0x228907['newRange']['end']['getShiftedBy'](_0x43a0bb))),_0x228907;}['_changeOperationOwnerDocument'](_0x3a32b8,_0x42a612){'insert'===_0x3a32b8['type']?_0x3a32b8['position']=this['_changePositionOwnerDocument'](_0x3a32b8['position'],_0x42a612):'marker'===_0x3a32b8['type']&&_0x3a32b8['newRange']&&(_0x3a32b8['newRange']=this['_changeRangeOwnerDocument'](_0x3a32b8['newRange'],_0x42a612));}['_changePositionOwnerDocument'](_0x4ced8e,_0x291ff8){return new st(_0x291ff8,_0x4ced8e['path']);}['_changeRangeOwnerDocument'](_0x3fa91c,_0x2efc65){return new it(this['_changePositionOwnerDocument'](_0x3fa91c['start'],_0x2efc65),this['_changePositionOwnerDocument'](_0x3fa91c['end'],_0x2efc65));}['_changePosition'](_0x1fe486,_0x1ed679){return new st(_0x1ed679,[..._0x1fe486]);}['_changeRange'](_0x168360,_0x69a061,_0xb7904e,_0x167a12){return new it(this['_changePosition'](_0x69a061,_0x167a12),this['_changePosition'](_0xb7904e,_0x167a12));}['_sortMarkers'](_0x4b5691){const _0x3eaa7c=_0x5aea82=>{switch(_0x5aea82){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x4b5691['sort']((_0x4226fb,_0x3ac75f)=>_0x3eaa7c(_0x4226fb['type'])-_0x3eaa7c(_0x3ac75f['type']));}['_hasSameTopLevelElement'](_0x3aa087,_0xf3be08){const _0x381801=_0x3aa087['getChild'](0x0),_0x5a6c37=_0xf3be08['getChild'](0x0);return!(!_0x381801||!_0x5a6c37)&&((!_0x381801['is']('element')||!_0x5a6c37['is']('element')||_0x381801['name']===_0x5a6c37['name'])&&!(_0x381801['is']('element')&&!_0x5a6c37['is']('element')||!_0x381801['is']('element')&&_0x5a6c37['is']('element')));}['_haveSingleTopLevelElement'](_0x22dbf5){return 0x1===_0x22dbf5['childCount'];}['_haveOnlyInlineContent'](_0x3ea9a1,_0x31052a){for(const _0x45958f of _0x3ea9a1['getChildren']())if(_0x45958f['is']('element')&&!_0x31052a['isInline'](_0x45958f))return!0x1;return!0x0;}['_upsertDataId'](_0x67996f,_0xd86860){let _0x51f64c=_0x67996f['getAttribute'](Ct);return _0x51f64c||(_0x51f64c=_0xd86860(),_0x67996f['_setAttribute'](Ct,_0x51f64c)),_0x51f64c;}}class Os extends _0x12cec9(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x2aae2c,contentNew:_0x2ff7c8,contentInitial:_0x486032,documentVersion:_0x403a3b}){super(),this['id']=_0x2aae2c,this['contentNew']=_0x2ff7c8,this['contentInitial']=_0x486032,this['documentVersion']=_0x403a3b;}}class Ks extends ts(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x1f509d,_0x267f04,_0x14e25d){super(),this['id']=_0x1f509d,this['parent']=_0x14e25d,this['_data']=_0x267f04,this['set']('isActivated',!0x1),this['set']('isRated',!0x1),this['set']('status','pending'),this['on']('change:status',()=>{'pending'!==this['status']&&this['isActivated']&&(this['isActivated']=!0x1);});}get['contentDiffed'](){return this['_data']['context']();}get['operations'](){return this['_data']['operations'];}get['operationsIsolated'](){return this['_data']['operationsIsolated'];}}class Ws extends ts(){['id']=_0x589eaf();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x5eba3c,_0x3884dc,_0x3415a6,_0x29007b,_0x321ffc){super(),this['_sourceCheck']=_0x3884dc,this['_documentData']=_0x5eba3c,this['_aiConnector']=_0x3415a6,this['_reviewParams']=_0x29007b,this['_reviewArgs']=_0x321ffc,this['on']('change:status',(_0x26e592,_0x453e5e,_0x36413a)=>{'aborted'==_0x36413a&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x36413a,'run':this,'error':this['_currentError']});}),this['set']('status','initialized');}get['documentData'](){return this['_documentData'];}get['processedResultsCount'](){return this['_results']['size'];}get['title'](){return this['_sourceCheck']['title'];}get['subTitle'](){return'';}get['reviewName'](){return this['_sourceCheck']['id'];}get['hasModifications'](){return!this['_changes']['every'](_0x22b60a=>'pending'===_0x22b60a['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x3213ae){this['_documentData']=_0x3213ae;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x5f4c28=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x52c497 of _0x5f4c28)'unmodified'!==_0x52c497['data']['operation']&&('error'!==_0x52c497['data']['operation']?'review-metadata'!==_0x52c497['event']?this['_addReviewCheckResult'](_0x52c497['data']['dataId'],_0x52c497['data']['textDelta']):this['callId']=_0x52c497['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']||0x0===this['_changes']['length']?this['status']='unmodified':this['status']='ready');}catch(_0x4c272c){this['_currentError']=_0x4c272c,_0x4c272c instanceof Error&&_0x4c272c['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'](_0x3a99f7,_0x6d6216){const _0x5aa49e=this['_results']['get'](_0x3a99f7);if(!_0x5aa49e)return;if(0x0===_0x6d6216['length'])return;const _0x34d3d2=[];_0x6d6216['forEach']((_0x1a2e43,_0x4fa9fc)=>{const _0x37c02c=new Ks(_0x5aa49e['id']+'-'+_0x4fa9fc,_0x1a2e43,_0x5aa49e);_0x37c02c['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x37c02c,'status':_0x37c02c['status']});}),_0x37c02c['on']('change:isActivated',()=>{_0x37c02c['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x37c02c}):this['fire']('reviewCheckResultDeactivated',{'change':_0x37c02c});}),this['_changes']['push'](_0x37c02c),_0x34d3d2['push'](_0x37c02c);}),this['fire']('reviewCheckResultReady',{'changes':_0x34d3d2,'result':_0x5aa49e,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x462a8b){const _0x2567e5=this['_changes']['find'](_0x2daaeb=>_0x2daaeb['id']===_0x462a8b);return!(!_0x2567e5||'pending'!==_0x2567e5['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x38f520=>!0x0===_0x38f520['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x51bca0=>'pending'===_0x51bca0['status']);}['getChangeById'](_0x33ef14){return this['_changes']['find'](_0xb1b1f5=>_0xb1b1f5['id']===_0x33ef14);}['markAllChangesAsAccepted'](){for(const _0x313176 of this['_changes'])'pending'===_0x313176['status']&&(_0x313176['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x48cc2c){const _0x117dd5=this['_changes']['find'](_0xbb92a9=>_0xbb92a9['id']===_0x48cc2c);_0x117dd5&&'pending'===_0x117dd5['status']&&(_0x117dd5['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x5f5875){const _0x3591c3=this['_changes']['find'](_0x14564d=>_0x14564d['id']===_0x5f5875);_0x3591c3&&'pending'===_0x3591c3['status']&&(_0x3591c3['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x1d4219){const _0x40455e=this['_changes']['find'](_0x1bbaeb=>_0x1bbaeb['id']===_0x1d4219);_0x40455e&&'pending'===_0x40455e['status']&&(_0x40455e['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x4771b2){const _0x561391=this['_changes']['find'](_0x3ba2a4=>_0x3ba2a4['id']===_0x4771b2);_0x561391&&'outdated'===_0x561391['status']&&(_0x561391['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x59a997){this['_changes']['filter'](_0x3413eb=>_0x3413eb['isActivated']&&_0x3413eb['id']!==_0x59a997)['forEach'](_0x4a9aba=>{_0x4a9aba['isActivated']=!0x1;});const _0x3aedbb=this['_changes']['find'](_0x259b3a=>_0x259b3a['id']===_0x59a997);_0x3aedbb&&'pending'===_0x3aedbb['status']&&(_0x3aedbb['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x4b7e31=>_0x4b7e31['isActivated'])['forEach'](_0x447918=>{_0x447918['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x1832ec){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x577f26;if(_0x1832ec){const _0x43fa1b=this['_changes']['find'](_0x41184e=>_0x41184e['id']===_0x1832ec);if(_0x43fa1b&&_0x43fa1b['isRated'])return;_0x43fa1b&&(_0x577f26=_0x43fa1b['parent']['id'],_0x43fa1b['isRated']=!0x0);}const _0x516195={'positiveCount':this['_changes']['filter'](_0x395371=>'accepted'===_0x395371['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x516195,this['callId'],_0x577f26);}['_addReviewCheckResult'](_0x15d442,_0x2510c0){const _0x3fedc3=this['_documentData']['elements']['get'](_0x15d442);if(!_0x3fedc3)return;const _0x456a09=_0x3fedc3['getContent']();if(_0x456a09===_0x2510c0)return;const _0x18e96b=new Os({'id':_0x15d442,'contentInitial':_0x456a09,'contentNew':_0x2510c0,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x18e96b['id'],_0x18e96b),this['fire']('reviewCheckResultAdded',{'result':_0x18e96b,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x5e8b51=>'pending'===_0x5e8b51['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x457adf=>'pending'===_0x457adf['status'])['length']&&(this['status']='finished'));}}class si extends Ws{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x17df2e=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x32ab8a=0x0;_0x32ab8a<this['_reviewParams']['length'];_0x32ab8a++){if(!this['_reviewParams'][_0x32ab8a]||!this['_sourceCheck']['options'][_0x32ab8a])continue;const _0x3f90ce=this['_sourceCheck']['options'][_0x32ab8a],_0x1c186c=_0x3f90ce['data']?.['find'](_0x27ff74=>_0x27ff74['id']===this['_reviewParams'][_0x32ab8a]);_0x1c186c&&_0x17df2e['push'](_0x1c186c['label']);}return _0x17df2e['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x5e217f,_0x1554b4,_0x48b532){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x1554b4,_0x5e217f,_0x48b532);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class ve extends _0x3de4b5{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[q];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_initRequiredPlugins'](),this['_aiReviewCheckList']=await this['_getChecksList'](),this['listenTo'](this['_aiReviewCoreUi'],'getReviewCheckList',()=>{this['_aiReviewCoreUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewCoreUi'],'runReviewCheck',async(_0x40589c,_0x44894a)=>{const _0xb4a871=this['_aiReviewCheckList']['getCheckById'](_0x44894a['id']);if(_0xb4a871){this['_onReviewCheckRun'](_0x44894a),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x44894a,_0xb4a871),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0xf41f24,_0x51751c)=>{switch(_0x51751c['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x51751c);break;case'finished':this['_onCheckRunFinished']();break;case'ready':this['_aiReviewCoreUi']['showActionsWhenResultIsReady']();break;case'unmodified':this['_aiReviewCoreUi']['showNoChangesView']();break;case'error-general':this['_aiReviewCoreUi']['showGeneralResultsErrorView'](),this['_logError'](new _0x54686c('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new _0x54686c('ai-review-mode-check-run-chunk-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'aborted':this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewRunLeave'](!0x0);}'ready'!==_0x51751c['status']&&'error-chunk'!==_0x51751c['status']&&'error-general'!==_0x51751c['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x7f0e31,_0x4f314c)=>{if(!this['_currentReviewCheckRun'])throw new _0x54686c('ai-review-mode-no-current-check-run',this);const _0x1b3460=this['_diffContent'](_0x4f314c['result']['contentInitial'],_0x4f314c['result']['contentNew']);_0x4f314c['source']['addResultChanges'](_0x4f314c['result']['id'],_0x1b3460);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x294531,_0x5d022b)=>{for(const _0x459ddb of _0x5d022b['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x459ddb);this['_markChangePositionInEditorContent'](_0x5d022b['changes'],_0x5d022b['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x3d4468,_0x4a8892)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x4a8892['change']['id'],_0x4a8892['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x18e6f0,_0x324ecd)=>{this['_onReviewCheckResultActivated'](_0x324ecd);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x9288d0){_0x9288d0 instanceof Error&&_0x9288d0['message']['includes']('ai-request-aborted')||(_0x9288d0 instanceof _0x54686c?this['_logError'](_0x9288d0):this['_logError'](new _0x54686c('ai-review-mode-check-run-failed',this,void 0x0,_0x9288d0)));}}else this['_logError'](new _0x54686c('ai-review-mode-source-check-not-found',this,{'checkId':_0x44894a['id']}));}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReview',()=>{this['_onReviewRunLeave']();}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReviewCoreResultList',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewCoreUi'],'finishReview',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x44e67f=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x44e67f['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x44e67f['map'](_0x441c0d=>_0x441c0d['id']));const _0x34e649=this['_currentReviewCheckRun'];_0x34e649['markAllChangesAsAccepted'](),_0x34e649['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0xffbb82,_0x39b9ae)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x39b9ae['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x39b9ae['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x39b9ae['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x39b9ae['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x3b58f3,_0x22ca18)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x22ca18['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x22ca18['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x22ca18['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x22ca18['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&(this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_currentReviewCheckRun']['updateDocumentData'](this['_aiReviewCoreEditing']['getDocumentData']()),await this['_currentReviewCheckRun']['restart']());}),this['listenTo'](this['_aiReviewCoreUi'],'activateChange',(_0x1fe542,_0x3ef04d)=>{this['_onActivateChange'](_0x3ef04d);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0xb0f97a,_0x163e0a)=>{this['_onDeactivateChange'](_0x163e0a);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0xbbcd6c,_0x50db04)=>{this['_onChangeMarkerClicked'](_0xbbcd6c,_0x50db04);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x708aeb,_0x2d1b1a)=>{this['_onChangeMarkerHovered'](_0x708aeb,_0x2d1b1a);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x56ffdf,_0x20c9a1)=>{this['_onChangeMarkerRemoved'](_0x56ffdf,_0x20c9a1);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x30ed3d,_0xcbd25a)=>{this['_onChangeMarkerRestored'](_0x30ed3d,_0xcbd25a);});}['_createReviewCheckRun'](_0x384720,_0x5656f1){return new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0x5656f1,this['_aiConnector'],_0x384720['params'],_0x384720['args']);}['_onChangeMarkerRemoved'](_0x1afdc9,_0x3d3e3c){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x3d3e3c['changeId']);}['_onChangeMarkerRestored'](_0x132add,_0x155d7b){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x155d7b['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x99d360=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x99d360&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x2fa371=this['_aiReviewCoreEditing']['getEditor']();_0x2fa371&&_0x2fa371['editing']['view']['change'](_0x8dab86=>{const _0x1ca139=_0x2fa371['editing']['view']['document']['getRoot']();_0x8dab86['removeClass']('ck-ai_review-diff',_0x1ca139),_0x8dab86['removeClass']('ck-ai_review-highlights',_0x1ca139),_0x8dab86['removeClass']('ck-ai-translate-mode-content',_0x1ca139);});}['_getTranslationWithDefault'](_0x15057f,_0x28633a){const _0x2f0802=i(this['context']['locale'],_0x15057f);return _0x2f0802===_0x15057f?_0x28633a:_0x2f0802;}['_logError'](_0x1ecc0e,_0x139712=!0x1){gt(_0x1ecc0e['message']),_0x139712||(_0x1ecc0e['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x58d861){if('content'===this['_changeActivationSource']){const _0x339799=this['_aiReviewCoreUi']['getChangeElement'](_0x58d861);_0x339799&&_0x59e8aa(_0x339799['closest']('.ck-ai_review__check-run-result')||_0x339799);}else{if('panel'===this['_changeActivationSource']){const _0xb39159=this['_getChangeContentElement'](_0x58d861);if(!_0xb39159)return;_0x1dbe2e({'target':_0xb39159,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}const we=[{'id':'custom','commandId':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','commandId':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','commandId':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','commandId':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'length','commandId':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'tone','commandId':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]}];class Js{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x5e0e8c){this['id']=_0x5e0e8c['id'],this['commandId']=_0x5e0e8c['commandId'],this['title']=_0x5e0e8c['title'],this['description']=_0x5e0e8c['description'],this['isParameterized']=_0x5e0e8c['isParameterized'],this['useArgs']=_0x5e0e8c['useArgs'],this['options']=_0x5e0e8c['options'],this['args']=_0x5e0e8c['args'];}}class vo extends ts(){['_checks']=[];['setupChecks'](_0x923e7b){this['_checks']=_0x923e7b['map'](_0x24763d=>new Js(_0x24763d));}get['checks'](){return this['_checks'];}['getCheckById'](_0x4a8f76){return this['checks']['find'](_0x2818b8=>_0x2818b8['id']===_0x4a8f76);}['removeCheckById'](_0x486dcb){this['_checks']=this['_checks']['filter'](_0xebfd6=>_0xebfd6['id']!==_0x486dcb);}}class ke extends Js{['_models']=[];['_defaultModel']=null;constructor(_0x3d7285,_0x42de54,_0x2cad01){super(_0x3d7285),this['_models']=_0x42de54,this['_defaultModel']=_0x2cad01;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class Ie extends Js{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x34557d,_0x418dd0,_0x1883bd){super(_0x34557d),this['prompt']=_0x34557d['prompt'],this['model']=_0x34557d['model'],this['model']?this['_defaultModel']=_0x418dd0['find'](_0x29d9e0=>_0x29d9e0['id']===this['model'])||null:this['_defaultModel']=_0x1883bd;}get['defaultModel'](){return this['_defaultModel'];}}class _e extends vo{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x157014,_0x5d34d5,_0x2afa52){super(),this['_allModels']=_0x157014,this['_recommendedModels']=_0x5d34d5,this['_defaultModel']=_0x2afa52;}['setupChecks'](_0x4d2520){this['_checks']=_0x4d2520['map'](_0x10c479=>!0x0===_0x10c479['isExtra']?new Ie(_0x10c479,this['_allModels'],this['_defaultModel']):'custom'===_0x10c479['id']?new ke(_0x10c479,this['_recommendedModels'],this['_defaultModel']):new Js(_0x10c479));}}class Ce extends Ws{['_prompt'];['_model'];constructor(_0x502192,_0x4daeeb,_0x40af2a,_0x423d00,_0x106e6d){super(_0x40af2a,_0x423d00,_0x106e6d),this['_prompt']=_0x502192,this['_model']=_0x4daeeb;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x31ecc8,_0x2f7d03,_0x2b8df0){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x2f7d03,_0x31ecc8,_0x2b8df0);}}class Re extends Ce{get['subTitle'](){return'';}set['prompt'](_0x300ed3){this['_prompt']=_0x300ed3;}set['model'](_0x5e9067){this['_model']=_0x5e9067;}}class pe extends ve{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x35f6df){super(_0x35f6df),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',we['map'](_0x33361e=>_0x33361e['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x56788c,_0x1b1b2a)=>{this['_isDiffOn']=_0x1b1b2a['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x5856df,_0x1d7e43){return _0x5856df['isCustom']?new Ce(_0x5856df['args']['prompt'],_0x5856df['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x1d7e43,this['_aiConnector']):_0x1d7e43['isExtra']?new Re(_0x1d7e43['prompt'],_0x1d7e43['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x1d7e43,this['_aiConnector']):new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0x1d7e43,this['_aiConnector'],_0x5856df['params'],_0x5856df['args']);}['_onReviewCheckResultActivated'](_0x45389b){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x45389b['change']['id']),this['_scrollToChange'](_0x45389b['change']['id']);const _0x1d4bc7=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x45389b['change']['id']);if(!_0x1d4bc7)return;const _0x55ab27=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x45389b['change'],()=>_0x1d4bc7['getElement'](),void 0x0,'click',_0x55ab27?.['editing']?.['view']?.['getDomRoot'](),_0x55ab27?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x45389b['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x5adfec){this['_currentReviewCheckRun']&&'click'===_0x5adfec['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x5adfec['id']));}['_onDeactivateChange'](_0x39a034){this['_currentReviewCheckRun']&&'balloon'===_0x39a034['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x113039,_0x35d611){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x35d611['changeId']);const _0x5662c4=this['_currentReviewCheckRun']['getChangeById'](_0x35d611['changeId']);if(!_0x5662c4)return;const _0x48fe71=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x5662c4,_0x35d611['markerElement'],_0x35d611['domEvent'],'click',_0x48fe71?.['editing']?.['view']?.['getDomRoot'](),_0x48fe71?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x2b85af,_0xb5347b){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x1c1284=this['_currentReviewCheckRun']['getChangeById'](_0xb5347b['changeId']);if(!_0x1c1284)return;const _0x229fef=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x1c1284,_0xb5347b['markerElement'],_0xb5347b['domEvent'],'hover',_0x229fef?.['editing']?.['view']?.['getDomRoot'](),_0x229fef?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x3cf21e){const _0x3655d6=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x3cf21e);return _0x3655d6?_0x3655d6['getElement']():null;}['_markChangePositionInEditorContent'](_0x2106f0,_0x8d44cc){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x2106f0,_0x8d44cc);}['_diffContent'](_0x552418,_0x379148){return this['_aiReviewCoreEditing']['diffContent'](_0x552418,_0x379148);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x3f4f4d){const _0x21f6f1=this['_aiReviewCoreEditing']['getEditor']();_0x3f4f4d?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x21f6f1&&_0x21f6f1['editing']['view']['change'](_0xb2b4d=>{const _0x24f4ed=_0x21f6f1['editing']['view']['document']['getRoot']();for(const _0x509c09 of _0x24f4ed['getClassNames']())_0x509c09['startsWith']('ck-ai_review-')&&_0xb2b4d['removeClass'](_0x509c09,_0x24f4ed);_0xb2b4d['addClass'](_0x3f4f4d?'ck-ai_review-diff':'ck-ai_review-highlights',_0x24f4ed);});}async['_getChecksList'](){const _0x2e14ac=[...we,...this['_getExtraChecks']()],_0x14afa1=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x14afa1,_0x2e14ac);let _0x82984e=_0x2e14ac;this['_hasDefaultAvailableCommands']||(_0x82984e=_0x14afa1['map'](_0x5f3bb8=>_0x2e14ac['find'](_0x379caf=>_0x379caf['id']===_0x5f3bb8))['filter'](_0x57b744=>!!_0x57b744)),_0x82984e=_0x82984e['map'](_0x221108=>_0x221108['isExtra']?_0x221108:this['_translateReviewCheck'](_0x221108));const _0x35daec=_0x82984e['some'](_0x3bc14b=>_0x3bc14b['isExtra']||'custom'===_0x3bc14b['id']);let _0x58ddc8=[],_0x4c2850=[],_0x22e3ee=null;if(_0x35daec){const _0x539528=await this['_getModels']();_0x58ddc8=_0x539528['all'],_0x4c2850=_0x539528['recommended'],_0x22e3ee=_0x539528['default'];}const _0x2fffc9=new _e(_0x58ddc8,_0x4c2850,_0x22e3ee);return _0x2fffc9['setupChecks'](_0x82984e),_0x35daec&&this['_filterChecksWithMissingModel'](_0x2fffc9),_0x2fffc9;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x175bd8=>({'id':_0x175bd8['id'],'commandId':_0x175bd8['id'],'title':_0x175bd8['label'],'description':_0x175bd8['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x175bd8['prompt'],'model':_0x175bd8['model']}));}['_logErrorForNonExistentChecks'](_0x5414b1,_0x5216d8){const _0x213037=_0x5414b1['filter'](_0x4dfa8d=>!_0x5216d8['some'](_0x39d099=>_0x39d099['id']===_0x4dfa8d));_0x213037['length']&&this['_logError'](new _0x54686c('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x213037['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x3a9ff6=new It({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x3a9ff6['getAll'](),'recommended':await _0x3a9ff6['getAvailableModels'](),'default':await _0x3a9ff6['getDefault']()};}catch(_0x239f3d){return this['_logError'](new _0x54686c('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x239f3d)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x32aab5){const _0x203d0e='AI_REVIEW_CHECK_'+_0x32aab5['id']['toUpperCase']()['replaceAll']('-','_'),_0x4e7f1b={..._0x32aab5,'title':this['_getTranslationWithDefault'](_0x203d0e+'_TITLE',_0x32aab5['title']),'description':this['_getTranslationWithDefault'](_0x203d0e+'_DESCRIPTION',_0x32aab5['description'])};return _0x32aab5['options']&&(_0x4e7f1b['options']=_0x32aab5['options']['map'](_0x315a8a=>({..._0x315a8a,'label':this['_getTranslationWithDefault'](_0x203d0e+'_OPTIONS_LABEL',_0x315a8a['label']||''),'data':_0x315a8a['data']?_0x315a8a['data']['map'](_0x52519e=>({..._0x52519e,'label':this['_getTranslationWithDefault'](_0x203d0e+'_OPTIONS_DATA_'+_0x52519e['id']['toUpperCase'](),_0x52519e['label'])})):void 0x0}))),_0x4e7f1b;}['_filterChecksWithMissingModel'](_0x13686a){const _0x3682d4=[];_0x13686a['checks']['forEach'](_0x1047c0=>{(_0x1047c0 instanceof Ie&&!_0x1047c0['defaultModel']||_0x1047c0 instanceof ke&&!_0x1047c0['models']['length'])&&_0x3682d4['push'](_0x1047c0['id']);}),_0x3682d4['length']&&_0x3682d4['forEach'](_0x640e9d=>{_0x13686a['removeCheckById'](_0x640e9d),this['_logError'](new _0x54686c('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x640e9d}),!0x0);});}}class Ka extends _0x3de4b5{static get['requires'](){return[pe,ge,de];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class jr extends Js{get['apiId'](){return'translate';}}class Pe extends vo{['setupChecks'](_0x373614){this['_checks']=_0x373614['map'](_0x3ff9a0=>new jr(_0x3ff9a0));}}class Se extends si{['_title'];constructor(_0x461199,_0x2c774e,_0x58457b,_0x1711f5,_0x5e43b0,_0x5ef37f){super(_0x461199,_0x2c774e,_0x58457b,_0x5e43b0,_0x5ef37f),this['_title']=_0x1711f5;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class rr extends ve{static get['pluginName'](){return'AITranslateController';}constructor(_0x3abada){super(_0x3abada),this['context']['config']['define']('ai.translate.languages',[{'label':'English','id':'english'},{'label':'Spanish','id':'spanish'},{'label':'French','id':'french'},{'label':'German','id':'german'},{'label':'Chinese\x20(Simplified)','id':'chinese'},{'label':'Japanese','id':'japanese'},{'label':'Russian','id':'russian'},{'label':'Portuguese','id':'portuguese'},{'label':'Korean','id':'korean'},{'label':'Italian','id':'italian'}]);}['_onCheckRunFinished'](){this['_onReviewRunLeave'](!0x0);}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AITranslateUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x255e8d,_0x2e0604){return new Se(this['_aiReviewCoreEditing']['getDocumentData'](),_0x2e0604,this['_aiConnector'],i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x255e8d['params'],_0x255e8d['args']);}['_onReviewCheckResultActivated'](_0x551748){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x551748['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x551748['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x5f31f0){this['_currentReviewCheckRun']&&('hover'===_0x5f31f0['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x5f31f0['id'])),'click'===_0x5f31f0['uiInteraction']&&this['_scrollToChange'](_0x5f31f0['id']));}['_onDeactivateChange'](_0x5bef2e){this['_currentReviewCheckRun']&&'panel'===_0x5bef2e['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x5dff24,_0x694f6c){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x694f6c['changeId']),this['_scrollToChange'](_0x694f6c['changeId']));}['_onChangeMarkerHovered'](_0x1584a5,_0x29a1e5){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x29a1e5['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x29a1e5['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x1c6781){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x1c6781);}['_markChangePositionInEditorContent'](_0x39163c,_0x5511b7){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x39163c,_0x5511b7);}['_diffContent'](_0x1c9997,_0x36850){return this['_aiReviewCoreEditing']['diffContent'](_0x1c9997,_0x36850,!0x0);}['_onReviewCheckRun'](){const _0x440e47=this['_aiReviewCoreEditing']['getEditor']();_0x440e47&&_0x440e47['editing']['view']['change'](_0x105677=>{const _0x5b5b6b=_0x440e47['editing']['view']['document']['getRoot']();for(const _0x54613b of _0x5b5b6b['getClassNames']())(_0x54613b['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0x54613b)&&_0x105677['removeClass'](_0x54613b,_0x5b5b6b);_0x105677['addClass']('ck-ai-translate-mode-content',_0x5b5b6b);});}async['_getChecksList'](){const _0x28ffe7=[],_0x3d5c5b=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x2ee52d of _0x3d5c5b)_0x28ffe7['push']({'title':_0x2ee52d['label'],'id':_0x2ee52d['id'],'commandId':_0x2ee52d['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x2ee52d['id']}});const _0x1ac08c=new Pe();return _0x1ac08c['setupChecks'](this['_translateChecks'](_0x28ffe7)),_0x1ac08c;}['_translateChecks'](_0x334162){return _0x334162['map'](_0x4fc9cf=>{const _0x222281='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x4fc9cf['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x4fc9cf,'title':this['_getTranslationWithDefault'](_0x222281,_0x4fc9cf['title'])};});}}class Le extends Ve{constructor(_0x5329e1,_0x304308){super(_0x5329e1,_0x304308),this['on']('set:isLoading',(_0x4457c7,_0xe2e68,_0x18226c)=>{_0x18226c&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x5ba979,_0x130ac0,_0x2bf7ff)=>{_0x2bf7ff&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x1b04cc=super['_createAcceptAllButtonView']();return _0x1b04cc['set']('label',i(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x1b04cc;}['_createExitReviewButtonView'](){const _0x303282=super['_createExitReviewButtonView']();return _0x303282['set']('label',i(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x303282;}}class Ne extends je{['_setupTemplate'](){const _0x4edc6b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x4edc6b['if']('isVisible','ck-hidden',_0xe68312=>!_0xe68312)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':i(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':i(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x4edc6b['if']('isVisible','ck-hidden',_0x238b71=>!_0x238b71)]},'children':this['_checkViews']}]});}}class tr extends Me{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x3ff038=this['context']['locale'],_0x389901=new _0x214d1d(_0x3ff038,{'label':i(_0x3ff038,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x1cce89,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x22b4ed=new Ae(_0x3ff038,{'header':_0x389901,'list':new Ne(_0x3ff038),'results':new Le(_0x3ff038,{'generalErrorText':i(_0x3ff038,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new be(_0x3ff038,{'headerText':i(_0x3ff038,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':i(_0x3ff038,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0x3ff038,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x22b4ed['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x22b4ed;}['registerTab'](){const _0xc69beb=this['context']['plugins']['get']('AITabs');_0xc69beb['view']['on']('activateTab',(_0x4f8255,_0x4b6a67)=>{'translate'===_0x4b6a67?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0xc69beb['view']['addTab']({'id':'translate','buttonLabel':i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x1cce89,'order':0x0,'content':this['_mainView']});}}class Wa extends _0x3de4b5{static get['requires'](){return[rr,tr,de];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{ri as AIActions,K as AIAdapter,$n as AIAssistant,n as AIAssistantUI,Q as AIBalloon,Ma as AIChat,at as AIChatController,ht as AIChatHistory,jt as AIChatHistoryController,xt as AIChatHistoryUI,Va as AIChatShortcuts,ct as AIChatUI,q as AIConnector,D as AIEditing,Ba as AIEditorIntegration,Qt as AIQuickActionType,Fa as AIQuickActions,ii as AIQuickActionsUI,er as AIRequestError,Js as AIReviewCheck,Os as AIReviewCheckResult,Ws as AIReviewCheckRun,Ka as AIReviewMode,ve as AIReviewModeController,de as AIReviewModeEditing,ge as AIReviewModeUI,pt as AITabs,ar as AITextAdapter,qt as AIToggleButtonUI,Wa as AITranslate,rr as AITranslateController,tr as AITranslateUI,Xn as AWSTextAdapter,Qn as OpenAITextAdapter,E as ShowAIAssistantCommand,io as ToggleAICommand,Hs as createResizeButton,qn as getDefaultAICommands};
23
+ import{Plugin as _0x241f5a,Command as Ut,ContextPlugin as _0x118815,Editor as dt}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x5614d4,IconCheck as _0x1cd2e2,IconError as _0x3d2dec,IconSubmit as _0x349858,IconAIHistory as mt,IconMagicWand as _0x3c71fd,IconRobotPencil as _0xb06f9,IconMaximize as _0x5521e7,IconMinimize as _0x5bfc92,IconShowChangesOn as _0x34d7d0,IconShowChangesOff as _0x4218b0,IconDocument as _0x20ff08,IconBoxWithCross as _0x1c0feb,IconBoxWithCheck as _0x2b1fdc,IconBoxWithMarker as _0x3ecbda,IconInfo as tc,IconLoupe as _0x1fb99b,IconCancel as _0x187b85,IconStop as _0x49c145,IconAIChat as Ft,IconPlus as _0x377ed9,IconPin as _0x125ef8,IconThreeHorizontalDots as _0x22e1a7,IconChevronDown as _0x1ee736,IconChevronUp as _0x5c42c1,IconOutdated as _0x257152,IconEye as _0x3a16b6,IconEyeCrossedOut as _0x2b26c,IconChevronRight as _0x2ef869,IconAIReview as _0x143feb,IconAITranslate as _0x3515b8}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x2e2dc8,CKEditorError as _0x542443,ObservableMixin as ts,global as it,isVisible as _0x2e19a7,Rect as ot,Collection as _0x4b06b7,FocusTracker as _0x510dfd,KeystrokeHandler as _0x394cf5,first as _0xd78d7,logWarning as _0x23c4c9,logError as Ct,toArray as _0x498aeb,EmitterMixin as _0x204e9f,scrollViewportToShowTarget as st,scrollAncestorsToShowTarget as _0x88b018,ResizeObserver as _0x9cd70,_isMotionReduced as Pt,getConstrainedViewportRect as _0x2279c2,DomEmitterMixin as _0x400351}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x3da665,ButtonView as _0x5bfd84,View as _0x15a8cb,SpinnerView as _0x1e066a,IconView as _0x2ae97e,AutocompleteView as _0x322b7b,ListView as _0x236991,ListItemGroupView as _0x3c320d,ListItemView as _0x5e9d54,ButtonLabelView as _0x59760a,FocusCycler as _0x5a99d2,createLabeledTextarea as _0x11d52f,Dialog as _0x1017f8,createDropdown as _0x29ed58,addMenuToDropdown as _0x359042,MenuBarMenuView as _0x538ac7,MenuBarMenuListItemButtonView as _0x302890,DialogViewPosition as _0x2be176,MenuBarMenuListView as _0x255377,MenuBarMenuListItemView as _0x199d14,BodyCollection as _0x49fddd,BalloonPanelView as _0x1ddc71,clickOutsideHandler as _0x4daaf2,addListToDropdown as _0x48b098,UIModel as _0x129df2,submitHandler as _0x251698,LabeledFieldView as _0x1a087b,createLabeledInputText as th,FormHeaderView as _0x2e3f47,HighlightedTextView as _0x258b31,ViewCollection as _0x152ab6,FileDialogButtonView as _0x4834b0,InputTextView as _0x406518,SearchTextView as _0x230635,ListItemButtonView as _0x1426e0,ButtonLabelWithHighlightView as _0x5d3d48,DropdownMenuPanelPositioningFunctions as _0x50490e,BalloonToolbar as te,FormRowView as _0x294a7c,TextareaView as _0x59ba6f}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x1a7e12,ClipboardMarkersUtils as _0x3b2626}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x195c6c,ViewDataTransfer as _0xed8390,ViewUpcastWriter as _0x971b42,Matcher as _0x405f3f,_DetachOperation as _0x5de5b5,_insertIntoModelNodeList as _0x1aa9ab,_removeFromModelNodeList as to,ModelRange as _0x561be6,transformOperationSets as _0x359a53,ViewDowncastWriter as Nt,ModelDocumentFragment as _0x53b4ba,ModelPosition as _0x18c733,ModelTreeWalker as _0x266ef3,MarkerOperation as _0x2b53fb,InsertOperation as _0x147757}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x3060e9,escape as _0x1052a4,escapeRegExp as _0x249f4a,debounce as _0x5a61ef}from'es-toolkit/compat';import{createParser as $t}from'eventsource-parser';import{parseDocument as _0x4a7826}from'htmlparser2';import{isTag as _0x512964,findOne as xt,getParent as _0x4b34c6,findAll as _0x5269a1,removeElement as _0xb8c25a,replaceElement as _0x390c69,prepend as _0x11de48,prependChild as _0x52afa8,appendChild as _0xce27f2,append as _0x59a323,find as _0x3dc1d7,isComment as _0x434d7d,getChildren as _0x260bf8,textContent as _0x25d39e}from'domutils';import _0x3688ac from'dom-serializer';import{Document as Rt,Element as _0x1075d8,Text as _0x2ef03d,cloneNode as _0x255d9a,isDocument as _0x14eea4,isText as _0x59e3c1,NodeWithChildren as _0x673436}from'domhandler';import{MarkdownGfmMdToHtml as _0x33c75d}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0xf7c114,DocumentCompare as _0x143aa3,DATA_ID_MODEL_ATTRIBUTE as Et,ConfirmMixin as _0x52eed7,LateFocusDropdownButtonView as _0x26095f,getAllMarkersDomElementsSorted as tt,SuggestionsConversion as qt,DATA_ID_VIEW_ATTRIBUTE as _0x53de42,getMarkerDomElement as _0x25a0d4}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x282866}from'es-toolkit';import _0x308f05 from'morphdom';import{IconWeb as _0x1ce37c,IconClose as _0x4affb1,IconDocument as _0x51d2a2,IconSelection as _0x16211b,IconFileUpload as _0x56f9a2,IconLink as _0x5acb26,IconBulb as _0x10c759,IconAI as _0xe3a7aa,IconPreviousArrow as _0x3c7600,IconCheck as _0x15208f,IconDocumentOutline as _0x4da3a3,IconPaperClip as _0xb33e07,IconBrowseFiles as _0x555a1a,IconDropdownArrow as _0x4e1794,IconAIChat as _0x294a94,IconAIReview as _0x283d0c,IconAITranslate as Vt,IconAIAskAI as _0x57100f,IconThumbUp as _0x502ea4,IconThumbDown as _0x4cfb74,IconCopy as _0x2f6fb4,IconShowChangesOff as _0x43cdc5,IconShowChangesOn as _0x5e9a92,IconAIQuickActions as _0x9e3e58,IconAIChatCommands as Gt,IconAIImproveWriting as Bt,IconAIContinueWriting as zt,IconAIGrammarCheck as Wt,IconAIAdjustLength as Kt,IconAIChangeTone as Yt,IconAIOther as Jt,IconRefresh as _0x5c8076,IconNextArrow as _0x40af26}from'@ckeditor/ckeditor5-icons/dist/index.js';import{diffArrays as _0x57cf13}from'diff';const x='_ungrouppedCommands';function o(_0x422a93,_0x2b4075){const _0x481aa4=(0x0,_0x2b4075['t'])('Other');return _0x422a93['length']?'groupId'in _0x422a93[0x0]?_0x422a93:[{'groupId':x,'groupLabel':_0x481aa4,'order':0x1/0x0,'commands':_0x422a93}]:[{'groupId':x,'groupLabel':_0x481aa4,'order':0x1/0x0,'commands':[]}];}const Kn=globalThis['DataTransfer'],f='ai-ui';class a extends _0x241f5a{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x1e9f06}=this,_0x3be726=['ck-fake-ai-selection'];_0x1e9f06['config']['get']('ai.assistant.useTheme')&&_0x3be726['push']('ck-ai-assistant-ui_theme'),_0x1e9f06['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x3be726,'priority':0xc}}),_0x1e9f06['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x30603e,{writer:_0x324744})=>{if(!_0x30603e['markerRange']['isCollapsed'])return null;const _0x347786=_0x324744['createUIElement']('span');return _0x324744['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x347786),_0x347786;}});}['afterInit'](){!async function(_0x1f2569){const _0x2da766=_0x282350([0x6e,0x41,0x37,0x79,0x75,0x72,0x67,0x4f,0x48,0x62,0x5a,0x76,0x44,0x70,0x6c,0x52,0x6b,0x4a,0x73,0x63,0x64,0x49,0x43,0x6d,0x38,0x36,0x6f,0x50,0x57,0x78,0x39,0x32,0x66,0x31,0x71,0x46,0x30,0x4c,0x61,0x53,0x58,0x33,0x4e,0x47,0x77,0x54,0x4d,0x4b,0x34,0x6a,0x56,0x74,0x59,0x55,0x42,0x51,0x69,0x35,0x7a,0x68,0x65,0x45]),_0x3da1d7=0x3dffc4e1,_0x4c1fe5=0x3df84329^_0x3da1d7,_0x3dc9aa=window[_0x282350([0x44,0x61,0x74,0x65])][_0x282350([0x6e,0x6f,0x77])](),_0x31132d=_0x1f2569[_0x282350([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x127122=new window[(_0x282350([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5bd34=>{_0x31132d[_0x282350([0x6f,0x6e,0x63,0x65])](_0x282350([0x72,0x65,0x61,0x64,0x79]),_0x5bd34);}),_0x18da63={[_0x282350([0x6b,0x74,0x79])]:_0x282350([0x45,0x43]),[_0x282350([0x75,0x73,0x65])]:_0x282350([0x73,0x69,0x67]),[_0x282350([0x63,0x72,0x76])]:_0x282350([0x50,0x2d,0x32,0x35,0x36]),[_0x282350([0x78])]:_0x282350([0x69,0x43,0x6a,0x4f,0x43,0x76,0x44,0x46,0x49,0x36,0x6c,0x51,0x48,0x48,0x54,0x31,0x38,0x6a,0x56,0x77,0x52,0x66,0x6b,0x66,0x48,0x51,0x32,0x61,0x5f,0x4d,0x79,0x6d,0x54,0x33,0x35,0x4c,0x51,0x56,0x6f,0x46,0x53,0x41,0x49]),[_0x282350([0x79])]:_0x282350([0x6b,0x58,0x49,0x79,0x4a,0x34,0x65,0x76,0x74,0x43,0x45,0x46,0x52,0x6d,0x78,0x4b,0x53,0x55,0x70,0x4b,0x39,0x66,0x44,0x57,0x34,0x35,0x39,0x76,0x58,0x4f,0x76,0x56,0x72,0x68,0x66,0x36,0x75,0x51,0x41,0x65,0x4f,0x69,0x6f]),[_0x282350([0x61,0x6c,0x67])]:_0x282350([0x45,0x53,0x32,0x35,0x36])},_0x3d81a3=_0x31132d[_0x282350([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x282350([0x67,0x65,0x74])](_0x282350([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x3d0613(){let _0x56efa6,_0x533f76=null,_0xd278b5=null;try{if(_0x3d81a3==_0x282350([0x47,0x50,0x4c]))return _0x282350([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x56efa6=_0x2fee7c(),!_0x56efa6)return _0x282350([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x56efa6[_0x282350([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0xd278b5=_0x2b58df(_0x56efa6[_0x282350([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x56efa6[_0x282350([0x6a,0x74,0x69])])),await _0x328f70()?_0x204108()?_0x204e87()?_0x282350([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x1e20fa()?(_0x56efa6[_0x282350([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x282350([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x533f76=_0x231d25(_0x282350([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0xe84e13()):_0x282350([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x282350([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x282350([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x282350([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x204e87(){const _0x21726a=[_0x282350([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x282350([0x74,0x72,0x69,0x61,0x6c])][_0x282350([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x56efa6[_0x282350([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x3dc9aa/0x3e8:0xe10*_0x4c1fe5;return _0x56efa6[_0x282350([0x65,0x78,0x70])]<_0x21726a;}function _0x204108(){const _0x3d3f4b=_0x56efa6[_0x282350([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x3d3f4b&&(!!_0x3d3f4b[_0x282350([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x282350([0x2a]))||!!_0x3d3f4b[_0x282350([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x282350([0x41,0x49])));}function _0x1e20fa(){const _0x3408df=_0x56efa6[_0x282350([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x3408df||0x0==_0x3408df[_0x282350([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x69f774}=new URL(window[_0x282350([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x3408df[_0x282350([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x69f774))return!0x0;const _0x2ff827=_0x69f774[_0x282350([0x73,0x70,0x6c,0x69,0x74])](_0x282350([0x2e]));return _0x3408df[_0x282350([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x30a5ee=>_0x30a5ee[_0x282350([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x282350([0x2a])))[_0x282350([0x6d,0x61,0x70])](_0x1cb602=>_0x1cb602[_0x282350([0x73,0x70,0x6c,0x69,0x74])](_0x282350([0x2e])))[_0x282350([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x12f9f7=>_0x12f9f7[_0x282350([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x2ff827[_0x282350([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x282350([0x6d,0x61,0x70])](_0x1a946f=>Array(_0x2ff827[_0x282350([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x1a946f[_0x282350([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x282350([0x66,0x69,0x6c,0x6c])](_0x1a946f[0x0]===_0x282350([0x2a])?_0x282350([0x2a]):'')[_0x282350([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x1a946f))[_0x282350([0x73,0x6f,0x6d,0x65])](_0xa6af09=>_0x2ff827[_0x282350([0x65,0x76,0x65,0x72,0x79])]((_0x2847f6,_0x3ca89d)=>_0xa6af09[_0x3ca89d]===_0x2847f6||_0xa6af09[_0x3ca89d]===_0x282350([0x2a])));}function _0xe84e13(){return _0x533f76&&_0xd278b5?new window[(_0x282350([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3151b3,_0x35f2b6)=>{_0x533f76[_0x282350([0x74,0x68,0x65,0x6e])](_0x3151b3,_0x35f2b6),_0xd278b5[_0x282350([0x74,0x68,0x65,0x6e])](_0x340a67=>{_0x340a67!=_0x282350([0x56,0x61,0x6c,0x69,0x64])&&_0x3151b3(_0x340a67);},_0x35f2b6);}):_0x533f76||_0xd278b5||_0x282350([0x56,0x61,0x6c,0x69,0x64]);}}function _0x2b58df(_0x238880,_0x3773b1){return new window[(_0x282350([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2b9372=>{if(_0x222e83())return _0x2b9372(_0x282350([0x56,0x61,0x6c,0x69,0x64]));_0x136923(),_0x31132d[_0x282350([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x282350([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x4b5035=!0x1;const _0x40b7c6=_0x2e2dc8();function _0x4f7ff4(_0x14c2f2){return!!_0x14c2f2&&(typeof _0x14c2f2===_0x282350([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x14c2f2===_0x282350([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x14c2f2[_0x282350([0x74,0x68,0x65,0x6e])]===_0x282350([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x14c2f2[_0x282350([0x63,0x61,0x74,0x63,0x68])]===_0x282350([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x180d64(_0x595e34){_0x447c51(_0x595e34)[_0x282350([0x74,0x68,0x65,0x6e])](_0x274ab3=>{if(!_0x274ab3||_0x274ab3[_0x282350([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x282350([0x6f,0x6b]))return _0x282350([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x2fb0a9(_0x40decf(_0x40b7c6+_0x3773b1))!=_0x274ab3[_0x282350([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x282350([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x282350([0x56,0x61,0x6c,0x69,0x64]);})[_0x282350([0x74,0x68,0x65,0x6e])](_0x2fc51b=>(_0x13c0b9(),_0x2fc51b),()=>{const _0x26dd64=_0x13f1f5();return null==_0x26dd64?(_0x13c0b9(),_0x282350([0x56,0x61,0x6c,0x69,0x64])):_0x282350(_0x3dc9aa-_0x26dd64>(0x19f340e1^_0x3da1d7)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x282350([0x74,0x68,0x65,0x6e])](_0x2b9372)[_0x282350([0x63,0x61,0x74,0x63,0x68])](()=>{_0x2b9372(_0x282350([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x20d57f=0x3dc92a61^_0x3da1d7;function _0x13c0b9(){const _0x2c874f=_0x282350([0x6c,0x6c,0x63,0x74,0x2d])+_0x2fb0a9(_0x40decf(_0x238880)),_0x13ec7a=_0x5a68e7(_0x2fb0a9(window[_0x282350([0x4d,0x61,0x74,0x68])][_0x282350([0x63,0x65,0x69,0x6c])](_0x3dc9aa/_0x20d57f)));window[_0x282350([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x282350([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x2c874f,_0x13ec7a);}function _0x13f1f5(){const _0x408594=_0x282350([0x6c,0x6c,0x63,0x74,0x2d])+_0x2fb0a9(_0x40decf(_0x238880)),_0x28131a=window[_0x282350([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x282350([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x408594);return _0x28131a?window[_0x282350([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5a68e7(_0x28131a),0x10)*_0x20d57f:null;}function _0x447c51(_0x1e13e6){return new window[(_0x282350([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x29a577,_0x4d6ffc)=>{_0x1e13e6[_0x282350([0x74,0x68,0x65,0x6e])](_0x29a577,_0x4d6ffc),window[_0x282350([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x4d6ffc,0x3dfe1021^_0x3da1d7);});}}_0x31132d[_0x282350([0x6f,0x6e])](_0x282350([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x54c97a,_0x131ac2)=>{if(_0x131ac2[0x0]!=_0x238880)return _0x2b9372(_0x282350([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x131ac2[0x1]={..._0x131ac2[0x1],[_0x282350([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x40b7c6};},{[_0x282350([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x282350([0x68,0x69,0x67,0x68])}),_0x31132d[_0x282350([0x6f,0x6e])](_0x282350([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x525b0e=>{_0x4f7ff4(_0x525b0e[_0x282350([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x4b5035=!0x0,_0x180d64(_0x525b0e[_0x282350([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x282350([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x282350([0x6c,0x6f,0x77])}),_0x127122[_0x282350([0x74,0x68,0x65,0x6e])](()=>{_0x4b5035||_0x2b9372(_0x282350([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x222e83(){return _0x31132d[_0x282350([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x282350([0x76,0x69,0x65,0x77])][_0x282350([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x282350([0x61,0x75,0x74,0x6f]);}function _0x136923(){_0x31132d[_0x282350([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x282350([0x76,0x69,0x65,0x77])][_0x282350([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x282350([0x61,0x75,0x74,0x6f]);}}function _0x231d25(_0xe09466){const _0x2da034=[new window[(_0x282350([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x19b312=>setTimeout(_0x19b312,0x3df6fa2d^_0x3da1d7)),_0x127122[_0x282350([0x74,0x68,0x65,0x6e])](()=>new window[(_0x282350([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x250a66=>{let _0x533d77=0x0;_0x31132d[_0x282350([0x6d,0x6f,0x64,0x65,0x6c])][_0x282350([0x6f,0x6e])](_0x282350([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0xfedcc7,_0x1f41db)=>{_0x1f41db[0x0][_0x282350([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x533d77++,_0x533d77==(0x3dffc109^_0x3da1d7)&&(_0x250a66(),_0xfedcc7[_0x282350([0x6f,0x66,0x66])]());});}))];return window[_0x282350([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x282350([0x72,0x61,0x63,0x65])](_0x2da034)[_0x282350([0x74,0x68,0x65,0x6e])](()=>_0xe09466);}async function _0x4b2188(){await _0x127122,_0x31132d[_0x282350([0x6d,0x6f,0x64,0x65,0x6c])][_0x282350([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x3591d7,_0x31132d[_0x282350([0x6d,0x6f,0x64,0x65,0x6c])][_0x282350([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x3591d7,_0x31132d[_0x282350([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x282350([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x50ee08(_0x536feb){const _0x14435a=_0x331fad();_0x31132d[_0x14435a]=_0x282350([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x536feb,_0x536feb!=_0x282350([0x56,0x61,0x6c,0x69,0x64])&&_0x4b2188();}function _0x331fad(){const _0x32a61e=window[_0x282350([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x282350([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x282350([0x6e,0x6f,0x77])]())[_0x282350([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x282350([0x2e]),'');let _0x1aa360=_0x282350([0x6e]);for(let _0x498b5b=0x0;_0x498b5b<_0x32a61e[_0x282350([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x498b5b+=0x2){let _0x12f43b=window[_0x282350([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x32a61e[_0x282350([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x498b5b,_0x498b5b+0x2));_0x12f43b>=_0x2da766[_0x282350([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x12f43b-=_0x2da766[_0x282350([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x1aa360+=_0x2da766[_0x12f43b];}return _0x1aa360;}function _0x2fee7c(){const _0x1292eb=_0x3d81a3[_0x282350([0x73,0x70,0x6c,0x69,0x74])](_0x282350([0x2e]));if(0x3!=_0x1292eb[_0x282350([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0xf02128(_0x1292eb[0x1]);function _0xf02128(_0x1f184a){const _0x56e121=_0x302143(_0x1f184a);return _0x56e121&&_0x1161bb()?_0x56e121:null;function _0x1161bb(){const _0x562a08=_0x56e121[_0x282350([0x6a,0x74,0x69])],_0x429546=window[_0x282350([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x562a08[_0x282350([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x562a08[_0x282350([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x2a45e5={..._0x56e121,[_0x282350([0x6a,0x74,0x69])]:_0x562a08[_0x282350([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x562a08[_0x282350([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x2a45e5[_0x282350([0x76,0x63])],_0x40decf(_0x2a45e5)==_0x429546;}}}async function _0x328f70(){let _0x37b09d=!0x0;try{const _0x131734=_0x3d81a3[_0x282350([0x73,0x70,0x6c,0x69,0x74])](_0x282350([0x2e])),[_0x4c0b67,_0xa78c25,_0x2fee25]=_0x131734;return _0x3f03c1(_0x4c0b67),await _0x3717b7(_0x4c0b67,_0xa78c25,_0x2fee25),_0x37b09d;}catch{return!0x1;}function _0x3f03c1(_0xfad86c){const _0x4d7739=_0x302143(_0xfad86c);_0x4d7739&&_0x4d7739[_0x282350([0x61,0x6c,0x67])]==_0x282350([0x45,0x53,0x32,0x35,0x36])||(_0x37b09d=!0x1);}async function _0x3717b7(_0x25de1f,_0x12e9b6,_0x4e7e5d){const _0x4468ae=window[_0x282350([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x282350([0x66,0x72,0x6f,0x6d])](_0xddd475(_0x4e7e5d),_0x417231=>_0x417231[_0x282350([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x37253b=new window[(_0x282350([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x282350([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x25de1f+_0x282350([0x2e])+_0x12e9b6),_0x20e1ed=window[_0x282350([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x282350([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x20e1ed)return;const _0xb1610c=await _0x20e1ed[_0x282350([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x282350([0x6a,0x77,0x6b]),_0x18da63,{[_0x282350([0x6e,0x61,0x6d,0x65])]:_0x282350([0x45,0x43,0x44,0x53,0x41]),[_0x282350([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x282350([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x282350([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x20e1ed[_0x282350([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x282350([0x6e,0x61,0x6d,0x65])]:_0x282350([0x45,0x43,0x44,0x53,0x41]),[_0x282350([0x68,0x61,0x73,0x68])]:{[_0x282350([0x6e,0x61,0x6d,0x65])]:_0x282350([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0xb1610c,_0x4468ae,_0x37253b)||(_0x37b09d=!0x1);}}function _0x302143(_0x56c9cf){return _0x56c9cf[_0x282350([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x282350([0x65,0x79]))?JSON[_0x282350([0x70,0x61,0x72,0x73,0x65])](_0xddd475(_0x56c9cf)):null;}function _0xddd475(_0x84507b){return window[_0x282350([0x61,0x74,0x6f,0x62])](_0x84507b[_0x282350([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x282350([0x2b]))[_0x282350([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x282350([0x2f])));}function _0x40decf(_0x1d35c4){let _0x3c3e78=0x1505;function _0x580517(_0x5ce314){for(let _0x4e67a2=0x0;_0x4e67a2<_0x5ce314[_0x282350([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4e67a2++){const _0x4bfc1b=_0x5ce314[_0x282350([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x4e67a2);_0x3c3e78=(_0x3c3e78<<0x5)+_0x3c3e78+_0x4bfc1b,_0x3c3e78&=_0x3c3e78;}}function _0x18b374(_0x9f0f02){Array[_0x282350([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x9f0f02)?_0x9f0f02[_0x282350([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x18b374):_0x9f0f02&&typeof _0x9f0f02==_0x282350([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x282350([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x9f0f02)[_0x282350([0x73,0x6f,0x72,0x74])]()[_0x282350([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x4b9c62,_0x25a0a3])=>{_0x580517(_0x4b9c62),_0x18b374(_0x25a0a3);}):_0x580517(window[_0x282350([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x9f0f02));}return _0x18b374(_0x1d35c4),_0x3c3e78>>>0x0;}function _0x2fb0a9(_0x5281db){return _0x5281db[_0x282350([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x282350([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x282350([0x30]));}function _0x5a68e7(_0x565f74){return _0x565f74[_0x282350([0x73,0x70,0x6c,0x69,0x74])]('')[_0x282350([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x282350([0x6a,0x6f,0x69,0x6e])]('');}function _0x3591d7(){}function _0x282350(_0x5232dd){return _0x5232dd['map'](_0x1e57b4=>String['fromCharCode'](_0x1e57b4))['join']('');}_0x50ee08(await _0x3d0613());}(this);}['showFakeVisualSelection'](){const _0x39481a=this['editor']['model'];_0x39481a['change'](_0x1b2bec=>{const _0x104aca=_0x39481a['document']['selection']['getRanges']();let _0x2e3563=0x0;for(const _0x203047 of _0x104aca){const _0x17a602=f+':'+_0x2e3563;if(_0x39481a['markers']['has'](_0x17a602))_0x1b2bec['updateMarker'](_0x17a602,{'range':_0x203047});else{if(_0x203047['start']['isAtEnd']){const _0x3ef784=_0x203047['start']['getLastMatchingPosition'](({item:_0x4cb874})=>!_0x39481a['schema']['isContent'](_0x4cb874),{'boundaries':_0x203047});_0x1b2bec['addMarker'](_0x17a602,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1b2bec['createRange'](_0x3ef784,_0x203047['end'])});}else _0x1b2bec['addMarker'](_0x17a602,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x203047});}_0x2e3563++;}});}['hideFakeVisualSelection'](){const _0x33c19e=this['editor']['model'],_0x500a4f=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x500a4f['length']&&_0x33c19e['change'](_0x519ecb=>{_0x500a4f['forEach'](_0x105368=>{_0x519ecb['removeMarker'](_0x105368);});});}['insertContent'](_0x54c3e9,_0x2a74cb){const _0x455588=this['_getAISelection'](),_0x266b9d=_0x2a74cb||_0x455588['getFirstRange']();this['editor']['model']['canEditAt'](_0x266b9d)&&this['editor']['model']['change'](_0x3a55f3=>{this['hideFakeVisualSelection'](),_0x2a74cb||this['_resetContentOfSelectedTableCells'](_0x3a55f3,_0x455588),this['_pasteHTMLUsingClipboard']({'insertAt':_0x266b9d,'writer':_0x3a55f3,'html':_0x54c3e9});});}['insertContentBelow'](_0x27395a){const {model:_0x1e17c0}=this['editor'],_0x40e50a=this['_getAISelection']();_0x1e17c0['change'](()=>{const _0x241125=this['_prepareTableInsertBelowPosition'](_0x27395a,_0x40e50a)||this['_getDefaultInsertBelowPosition'](_0x40e50a);this['insertContent'](_0x27395a,_0x241125);});}['_getAISelection'](){const _0x533255=this['editor']['model'],_0x58bb6c=Array['from'](_0x533255['markers']['getMarkersGroup'](f))['map'](_0x1c0a20=>_0x1c0a20['getRange']());return _0x533255['createSelection'](_0x58bb6c);}['_pasteHTMLUsingClipboard']({writer:_0x2f9ac3,html:_0x1a950e,insertAt:_0x181b1d}){const {view:_0x7d42fa}=this['editor']['editing'],_0x48d0ed=this['editor']['plugins']['get'](_0x1a7e12),_0x35de4c=new Kn();_0x35de4c['setData']('text/html',_0x1a950e);const _0x3a7727=new ClipboardEvent('paste',{'clipboardData':_0x35de4c}),_0x5c86ba=new _0x195c6c(_0x7d42fa,_0x3a7727,{'dataTransfer':new _0xed8390(_0x35de4c)});_0x2f9ac3['setSelection'](_0x181b1d);const _0x7092f3=(_0x4766c3,_0x17cfbe)=>{_0x17cfbe['resultRange']&&_0x2f9ac3['setSelection'](_0x17cfbe['resultRange']);};_0x48d0ed['once']('contentInsertion',_0x7092f3,{'priority':'lowest'}),_0x7d42fa['document']['fire']('paste',_0x5c86ba),_0x48d0ed['off']('contentInsertion',_0x7092f3);}['_getDefaultInsertBelowPosition'](_0x6636a){const {model:_0x427459}=this['editor'],_0x59e2f6=Array['from'](_0x6636a['getSelectedBlocks']());return _0x59e2f6['length']?_0x427459['createPositionAfter'](_0x59e2f6['pop']()):_0x6636a['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x55fdb4,_0x133258){const {model:_0x435b75,plugins:_0x59433f}=this['editor'];if(_0x59433f['has']('TableUtils')){const _0x2fe642=_0x59433f['get']('TableUtils')['getSelectedTableCells'](_0x133258);if(_0x2fe642['length']){const _0x2d7f35=this['_getTableRowCountFromContent'](_0x55fdb4),_0x23ad2e=this['_createEmptyTableRows'](_0x2fe642,_0x2d7f35);return _0x435b75['createPositionAt'](_0x23ad2e,0x0);}}return null;}['_getTableRowCountFromContent'](_0x189a6b){const _0x419ccf=this['editor']['plugins']['get']('TableUtils'),_0x29be1a=this['editor']['data']['parse'](_0x189a6b),_0x45fbcb=Array['from'](_0x29be1a['getChildren']())['filter'](_0x1519d4=>_0x1519d4['is']('element','table'));let _0xc1717e=0x0;return _0x45fbcb['forEach'](_0x46adea=>{_0xc1717e+=_0x419ccf['getRows'](_0x46adea);}),_0xc1717e;}['_createEmptyTableRows'](_0x3b8d87,_0xb8e4f7){const _0x5246db=this['editor']['plugins']['get']('TableUtils'),_0x43e3b0=_0x5246db['getRowIndexes'](_0x3b8d87),_0x377021=_0x5246db['getColumnIndexes'](_0x3b8d87),_0x43c28c=_0x43e3b0['last']+0x1,_0xdffa81=_0x377021['first'],_0x1b768d=_0x3b8d87[0x0]['findAncestor']('table');for(let _0x3ea610=0x0;_0x3ea610<_0xb8e4f7;_0x3ea610++)_0x5246db['insertRows'](_0x1b768d,{'at':_0x43c28c});return _0x1b768d['getChild'](_0x43c28c)['getChild'](_0xdffa81);}['_resetContentOfSelectedTableCells'](_0x59bcd7,_0x1d2419){const {plugins:_0x51d489}=this['editor'],{model:_0xa1a8c}=_0x59bcd7;if(!_0x51d489['has']('TableUtils'))return;_0x51d489['get']('TableUtils')['getSelectedTableCells'](_0x1d2419)['length']&&_0xa1a8c['deleteContent'](_0x1d2419);}}class K extends _0x241f5a{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x542443('aiadapter-text-adapter-not-set',null);}}class er extends Error{constructor(_0x3905c2){super(_0x3905c2),this['name']='AIRequestError';}}function Wn(_0x2301fa,_0x2fba2a,_0x2026cc){const t=_0x2301fa['t'];switch(_0x2fba2a){case'Edit\x20or\x20review':return t('Edit\x20or\x20review');case'Improve\x20writing':return t('Improve\x20writing');case'Make\x20shorter':return t('Make\x20shorter');case'Make\x20longer':return t('Make\x20longer');case'Simplify\x20language':return t('Simplify\x20language');case'Generate\x20from\x20selection':return t('Generate\x20from\x20selection');case'Summarize':return t('Summarize');case'Continue':return t('Continue');case'Change\x20tone':return t('Change\x20tone');case'Professional':return t('Professional');case'Casual':return t('Casual');case'Direct':return t('Direct');case'Confident':return t('Confident');case'Friendly':return t('Friendly');case'Change\x20style':return t('Change\x20style');case'Business':return t('Business');case'Legal':return t('Legal');case'Journalism':return t('Journalism');case'Poetic':return t('Poetic');case'Translate':return t('Translate');case'English':return t('English');case'Spanish':return t('Spanish');case'German':return t('German');case'Portuguese':return t('Portuguese');case'French':return t('French');case'Simplified\x20Chinese':return t('Simplified\x20Chinese');case'Hindi':return t('Hindi');case'Arabic':return t('Arabic');case'AI\x20Assistant':return t('AI\x20Assistant');case'AI\x20Commands':return t('AI\x20Commands');case'Ask\x20AI\x20to\x20edit\x20or\x20generate':return t('Ask\x20AI\x20to\x20edit\x20or\x20generate');case'Ask\x20AI\x20to\x20improve\x20generated\x20text':return t('Ask\x20AI\x20to\x20improve\x20generated\x20text');case'Copy':return t('Copy');case'Submit':return t('Submit');case'Insert\x20below':return t('Insert\x20below');case'Try\x20again':return t('Try\x20again');case'Stop':return t('Stop');case'AI\x20is\x20writing...':return t('AI\x20is\x20writing...');case'AI\x20is\x20writing':return t('AI\x20is\x20writing');case'Generated\x20content:\x20%0':return t('Generated\x20content:\x20%0',_0x2026cc);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2026cc);case'History':return t('History');case'Empty\x20history':return t('Empty\x20history');case'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':return t('Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.');case'Prompt\x20history':return t('Prompt\x20history');case'Clear':return t('Clear');case'AI_REPLACE_CONTENT':return t({'id':'AI_REPLACE_CONTENT','string':'Replace'});case'AI_INSERT_CONTENT':return t({'id':'AI_INSERT_CONTENT','string':'Insert'});case'AI_ERROR_GET_HEADERS':return t({'id':'AI_ERROR_GET_HEADERS','string':'Preparing\x20request\x20headers\x20failed'});case'AI_ERROR_GET_PARAMETERS':return t({'id':'AI_ERROR_GET_PARAMETERS','string':'Preparing\x20request\x20parameters\x20failed'});case'AI_ERROR_UNSUPPORTED_MODEL':return t({'id':'AI_ERROR_UNSUPPORTED_MODEL','string':'The\x20requested\x20AI\x20model\x20(\x22%0\x22)\x20is\x20not\x20supported'},_0x2026cc);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_AWS_NOT_SUPPORTED':return t({'id':'AI_ERROR_AWS_NOT_SUPPORTED','string':'The\x20AWS\x20integration\x20is\x20no\x20longer\x20supported.\x20Please\x20contact\x20the\x20support.'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x2fba2a;}}class E extends Ut{['_commandDefinitions'];constructor(_0xa05c59,_0xd869a0){super(_0xa05c59),this['_commandDefinitions']=_0xd869a0,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0xbcf63,_0x3b01d8,_0x1d993c)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0x1d993c));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x47a6c2,_0x1c2e7,_0x752ecb)=>{this['enabledCommandsIds']=_0x752ecb?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x8aa42f=this['editor']['model'];this['_hasContext']=function(_0x1dd5e9){const _0x4f0938=_0x1dd5e9['document']['selection'];return _0x4f0938['isCollapsed']?0x0!==[..._0x4f0938['getSelectedBlocks']()]['length']&&![..._0x4f0938['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x1dd5e9['hasContent'](_0x4f0938['getFirstRange']());}(_0x8aa42f);const _0x30c3a2=_0x8aa42f['document']['selection'],_0x135b2a=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x1dea47 of _0x30c3a2['getRanges']())for(const _0x37663a of _0x1dea47['getItems']())if(_0x37663a['is']('element')&&_0x135b2a['includes'](_0x37663a['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x389fc4='',_0x3d1755='',_0x1e6105='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x389fc4,_0x3d1755,_0x1e6105);}}function ns(_0x128345,_0x1f57e0){const _0x716945=new Set();for(const _0x36d971 of _0x128345['values']())(_0x1f57e0||!0x1===_0x36d971['requiresContent'])&&_0x716945['add'](_0x36d971['id']);return Array['from'](_0x716945);}const hs=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
24
+ ts(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x48581b,_0x443466,_0x157625){super(),this['editor']=_0x48581b,this['textAdapter']=_0x443466,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x157625,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x810569,_0x23324d,_0x55deaf)=>{this['view']['value']=this['_sanitizeHTML'](_0x55deaf);}),this['listenTo'](this['view'],'submitPrompt',(_0x21371e,_0x33ed63)=>{const _0x330823=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x33ed63,_0x330823,'custom');}),this['listenTo'](this['view'],'tryAgainEvent',()=>{this['view']['prompt']=this['previousLabel'],this['_handleQuery'](this['previousQuery'],this['previousContext'],this['previousActionId'],this['previousLabel']);}),this['listenTo'](this['view'],'stopProcessing',()=>{this['stopProcessing']();});}['destroy'](){this['stopListening']();}async['updateView']({actionId:_0x880691,query:_0x1f0b72,htmlContent:_0x1a6fd7,label:_0x30f1be,mainActionLabel:_0x222b94}){this['view']['prompt']=_0x30f1be,this['view']['mainAction']=_0x222b94,this['initialContext']=_0x1a6fd7,_0x1f0b72&&(this['view']['isRendered']?this['_handleQuery'](_0x1f0b72,_0x1a6fd7,_0x880691,_0x30f1be):this['view']['once']('render',()=>{this['_handleQuery'](_0x1f0b72,_0x1a6fd7,_0x880691,_0x30f1be);}));}['stopProcessing'](){this['isProcessing']&&(this['isProcessing']=!0x1,this['view']['finishProcessing'](),this['textAdapter']['abort']());}['reset'](){this['initialContext']='',this['currentContext']='',this['currentResponse']='',this['previousContext']='',this['previousQuery']='',this['previousLabel']='',this['previousActionId']=void 0x0,this['view']['reset'](),this['stopProcessing']();}async['_handleQuery'](_0x3115da,_0x4bcd29,_0xf87f82,_0x4dd4a4){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x4bcd29,this['previousQuery']=_0x3115da,this['previousLabel']=_0x4dd4a4||_0x3115da,this['previousActionId']=_0xf87f82,new Promise(_0x3767cd=>{this['textAdapter']['makeRequest']({'query':_0x3115da,'context':_0x4bcd29,'onData':_0x3d9ba7=>{this['currentResponse']=_0x3d9ba7,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0xf87f82})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x2847a2=>{_0x2847a2 instanceof er?this['view']['handleError'](_0x2847a2['message']):this['view']['handleError'](),_0x3767cd();})['finally'](()=>{this['stopProcessing'](),_0x3767cd();});});}['_parseAndNormalizeContent'](_0x554cb4,_0x149283=!0x1){const _0xdfdaef=hs['exec'](_0x554cb4);_0x554cb4=_0xdfdaef?_0x554cb4['substring'](_0xdfdaef[0x1]['length']):_0x554cb4['length']<0x64&&!_0x149283?'':this['_stripMarkdownSyntax'](_0x554cb4);const _0x528eb9=this['_domParser']['parseFromString'](_0x554cb4,'text/html');if(_0xdfdaef){const _0x3f4948=Array['from'](_0x528eb9['body']['childNodes']);_0x3f4948['reverse']();for(const _0x323efa of _0x3f4948){if(_0x323efa['nodeType']==Node['ELEMENT_NODE'])break;_0x323efa['remove']();}}const _0x5e6726=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x528eb9['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x5e6726);const _0xade3dd=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x2ec593=this['editor']['data']['toModel'](_0x5e6726);return _0xade3dd||_0x2ec593['markers']['clear'](),this['editor']['data']['stringify'](_0x2ec593);}['_normalizeResponseHeadings'](_0x3e36e9){const _0x47d3c3=new _0x971b42(this['editor']['editing']['view']['document']),_0x4f7d19=new _0x405f3f({'name':/^h[1-5]$/}),_0x4201f6=[];let _0x51d145=!0x1;for(const _0xae70c7 of _0x3e36e9)_0xae70c7['is']('element')&&_0x4f7d19['match'](_0xae70c7)&&(_0x4201f6['push'](_0xae70c7),'h1'==_0xae70c7['name']&&(_0x51d145=!0x0));if(_0x51d145){for(const _0x2b52fd of _0x4201f6)_0x47d3c3['rename']('h'+(parseInt(_0x2b52fd['name'][0x1])+0x1),_0x2b52fd);}}['_isH1TagSupportEnabled'](){const {data:_0x3ebb49,editing:_0x50f4e0}=this['editor'],_0x189921=_0x3ebb49['htmlProcessor']['toView']('<h1></h1>'),_0x5dffce=_0x3ebb49['toView'](_0x3ebb49['toModel'](_0x189921));return!!_0x50f4e0['view']['domConverter']['viewToDom'](_0x5dffce)['querySelector']('h1');}['_sanitizeHTML'](_0x22c362){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x22c362),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x4b0c23){const _0x115363=_0x4b0c23['trim']();return _0x115363['startsWith']('```html')?_0x115363['endsWith']('```')?_0x115363['substring'](0x7,_0x115363['length']-0x3):_0x115363['substring'](0x7):_0x4b0c23;}}const _={'REPLACE':'replace','INSERT':'insert'};class Pr extends _0x3da665{constructor(_0x127db6){super(_0x127db6),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x65842c=>Wn(_0x127db6,'AI_'+_0x65842c['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Wn(_0x127db6,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Wn(_0x127db6,'Try\x20again')),this['stopButton']=this['_createButton'](Wn(_0x127db6,'Stop'));const _0x120903=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x120903['if']('isVisible','ck-hidden',_0x39ec71=>!_0x39ec71)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x168424,_0xb13c2c){const _0x1896ad=new _0x5bfd84(this['locale']);return _0x1896ad['set']({'label':_0x168424,'class':_0xb13c2c||'','isVisible':!0x0,'withText':!0x0}),_0x1896ad;}}class Vr extends _0x15a8cb{['contentFieldView'];['copyButtonView'];constructor(_0x19730a,_0x45c7a0=''){super(_0x19730a),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x50f81d=this['bindTemplate'];this['contentFieldView']=new Yn(_0x19730a,_0x45c7a0),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x50f81d['if']('isVisible','ck-hidden',_0x5cf4e=>!_0x5cf4e)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x50f81d['if']('isProcessing','ck-ai-form__content-area--processing')]},'children':[this['contentFieldView'],{'tag':'div','attributes':{'class':['ck','ck-ai-form__copy-button-wrapper']},'children':[this['copyButtonView']]}]}]});}['render'](){super['render'](),this['value']&&this['contentFieldView']['setContent'](this['value']);let _0x3972cc=!0x1;this['on']('change:value',(_0x330e77,_0x52409f,_0x41c13f)=>{const _0x2e550d=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x41c13f),this['isProcessing']&&_0x2e550d&&!_0x3972cc&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x4844b9,_0x7692f,_0x39814)=>{_0x3972cc=!0x1,_0x39814?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x3972cc=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x3972cc=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x379fd6=this['locale'],_0xa111f9=new _0x5bfd84(this['locale']),_0x43447b='ck-ai-form__copy-button';return _0xa111f9['set']({'label':Wn(_0x379fd6,'Copy'),'icon':_0x5614d4,'class':_0x43447b,'tooltip':!0x0}),_0xa111f9['bind']('isVisible')['to'](this,'value',_0x35dd3f=>!!_0x35dd3f),_0xa111f9['bind']('isEnabled')['to'](this,'isProcessing',_0xe4699d=>!_0xe4699d),_0xa111f9['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0xa111f9['icon']=_0x1cd2e2,_0xa111f9['class']=_0x43447b+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0xa111f9['icon']=_0x5614d4,_0xa111f9['class']=_0x43447b;},0x3e8);}),_0xa111f9;}['_copyHTMLToClipboard'](_0x14a128){const {window:_0x2a6d1f,document:_0x404a51}=it;if(_0x2a6d1f['ClipboardItem']){const {Blob:_0x38c2eb,ClipboardItem:_0xc005d2}=_0x2a6d1f,_0x50cf93=[new _0xc005d2({'text/html':new _0x38c2eb([_0x14a128['innerHTML']],{'type':'text/html'}),'text/plain':new _0x38c2eb([_0x14a128['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x50cf93);}else{const _0x1b5bfa=_0x404a51['createElement']('div');_0x1b5bfa['style']['position']='absolute',_0x1b5bfa['style']['left']='-9999px',_0x1b5bfa['innerHTML']='<span>[</span>'+_0x14a128['innerHTML']+'<span>]</span>',_0x404a51['body']['appendChild'](_0x1b5bfa);const _0x494fe1=_0x404a51['createRange']();_0x494fe1['setStartAfter'](_0x1b5bfa['firstElementChild']),_0x494fe1['setEndBefore'](_0x1b5bfa['lastElementChild']);const _0x3802fb=_0x2a6d1f['getSelection']();_0x3802fb['removeAllRanges'](),_0x3802fb['addRange'](_0x494fe1),_0x404a51['execCommand']('copy'),_0x1b5bfa['remove']();}}}class Yn extends _0x15a8cb{constructor(_0x171952,_0x91582f=''){super(_0x171952),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x91582f,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x3627b2){this['element']['innerHTML']=_0x3627b2;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x3343b4=new _0x15a8cb(),_0x1eabd1=this['locale'],_0x2176c5=new _0x1e066a();return _0x2176c5['isVisible']=!0x0,_0x3343b4['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x2176c5,{'text':Wn(_0x1eabd1,'AI\x20is\x20writing...')}]}),_0x3343b4['render'](),_0x3343b4;}}class Cr extends _0x15a8cb{constructor(_0x56762d,_0x46a837=''){super(_0x56762d);const _0x35fa78=new _0x2ae97e(),_0x5ac103=this['bindTemplate'];this['set']('text',_0x46a837),_0x35fa78['content']=_0x3d2dec,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x35fa78,{'text':_0x5ac103['to']('text')}]});}}class Hr extends _0x322b7b{['submitButtonView'];['showHistoryButtonView'];constructor(_0x444403,_0x4e6352){super(_0x444403,_0x4e6352),this['queryView']['fieldView']['minRows']=0x1,this['queryView']['fieldView']['maxRows']=0x3,this['submitButtonView']=this['_createSubmitButton'](),this['showHistoryButtonView']=this['_createShowHistoryButton'](),this['focusableChildren']['add'](this['showHistoryButtonView'],0x1),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['showHistoryButtonView']),this['children']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x1bc4ae,_0x5ad6df)=>{_0x1bc4ae['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x5ad6df());});}['_createSubmitButton'](){const _0x1eebf7=new _0x5bfd84(this['locale']),_0xf8784a=this['locale'];return _0x1eebf7['set']({'icon':_0x349858,'label':Wn(_0xf8784a,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x1eebf7['on']('execute',()=>{this['submit']();}),_0x1eebf7['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x4052f1,_0x583abd)=>!_0x4052f1&&_0x583abd),_0x1eebf7;}['_createShowHistoryButton'](){const _0x131358=new _0x5bfd84(this['locale']),_0x5286dc=this['resultsView'],_0x3535f6=this['locale'];_0x131358['set']({'label':Wn(_0x3535f6,'History'),'withText':!0x1,'icon':mt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x131358['bind']('isOn')['to'](_0x5286dc,'isVisible'),_0x131358['bind']('isEnabled')['to'](this,'isEnabled'),_0x131358['on']('execute',()=>{_0x5286dc['isVisible']=!_0x5286dc['isVisible'],_0x5286dc['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x422b17=()=>{it['window']['requestAnimationFrame'](()=>{if(_0x2e19a7(this['element'])){const _0x7efea2=new ot(this['queryView']['fieldView']['element']),_0x5dbbc1=_0x7efea2['width'],_0x5e4c91='rtl'===_0x3535f6['uiLanguageDirection']?'left':'right';_0x7efea2['excludeScrollbarsAndBorders'](),_0x131358['element']['style'][_0x5e4c91]=_0x5dbbc1-_0x7efea2['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x422b17),this['on']('render',_0x422b17),_0x131358;}['submit'](){const _0x5024f1=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x5024f1);}['focus'](_0x173d13){-0x1===_0x173d13?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Rr extends _0x236991{['historyGroupView'];['clearHistoryButton'];constructor(_0x50172b){super(_0x50172b),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x3c320d(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Wn(_0x50172b,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x37679c=0x0;for(const _0x4f461b of this['items'])_0x37679c+=_0x4f461b['items']['length'];return{'resultsCount':_0x37679c,'totalItemsCount':_0x37679c};}['_createClearHistoryButton'](){const _0x439ab8=this['locale'],_0x5dde0e=new _0x5bfd84(this['locale']);return _0x5dde0e['set']({'label':'('+Wn(_0x439ab8,'Clear')+')','withText':!0x0}),_0x5dde0e['on']('execute',()=>this['fire']('clearHistory')),_0x5dde0e;}}class Br extends _0x5e9d54{constructor(_0x3582ac){super();const _0x94ecc0=new _0x59760a(),_0x3dba5a=new _0x5bfd84(this['locale'],_0x94ecc0);this['children']['add'](_0x3dba5a),_0x3dba5a['set']({'label':_0x3582ac['prompt'],'withText':!0x0}),_0x3dba5a['on']('execute',()=>{this['fire']('execute',{'value':_0x3060e9(_0x3582ac['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class Tr extends _0x4b06b7{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x1e83f8,_0x39c014)=>{const _0x350d8d=go(_0x39c014['prompt']);for(const _0xfb52ad of this)if(_0xfb52ad!=_0x39c014&&go(_0xfb52ad['prompt'])===_0x350d8d){this['remove'](_0xfb52ad);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x958468=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0x958468));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0x24d577=>_0x24d577)));}}function go(_0x1dbde0){return _0x1dbde0['toLowerCase']()['trim']();}class k extends _0x15a8cb{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x59a3cc,_0xc9e263,_0x2ccf15=''){super(_0x59a3cc),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',_['REPLACE']),this['_promptHistory']=new Tr(),this['errorView']=new Cr(_0x59a3cc),this['contentArea']=new Vr(_0x59a3cc,_0x2ccf15),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new _0x510dfd(),this['keystrokes']=new _0x394cf5(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x5a99d2({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0x342113=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0xc9e263],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x342113['if']('isError','ck-hidden',_0x49b729=>!_0x49b729)]},'children':[this['errorView']]},this['contentArea'],this['toolbar'],this['promptView']]}]});}['render'](){super['render'](),this['focusTracker']['add'](this['contentArea']['element']),this['focusTracker']['add'](this['contentArea']['copyButtonView']['element']),this['focusTracker']['add'](this['toolbar']['element']),this['focusTracker']['add'](this['promptView']['element']),this['keystrokes']['listenTo'](this['element']);}['focus'](_0xf1fc5f=0x1){-0x1===_0xf1fc5f?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['reset'](){this['prompt']='',this['value']='',this['isError']=!0x1,this['promptView']['reset'](),this['contentArea']['isVisible']=!0x1,this['toolbar']['isVisible']=!0x1;}['_createPromptView'](){const _0x2d59ab=this['locale'],_0x1a2068=new Hr(_0x2d59ab,{'queryView':{'label':Wn(_0x2d59ab,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x11d52f,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Wn(_0x2d59ab,'Empty\x20history'),'secondary':Wn(_0x2d59ab,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x1a2068['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x53342b,_0x18f289)=>_0x53342b&&!_0x18f289),this['listenTo'](_0x1a2068,'submit',(_0x361110,_0x2c3dde)=>{this['prompt']=_0x2c3dde;const _0x535902=_0x1052a4(_0x2c3dde);this['fire']('submitPrompt',_0x535902),_0x2c3dde['trim']()&&this['_promptHistory']['add']({'prompt':_0x535902},0x0);},{'priority':'high'}),_0x1a2068;}['_createHistoryView'](){const _0x4d2e79=new Rr(this['locale']);return _0x4d2e79['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Br),_0x4d2e79['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x4d2e79;}['_createToolbar'](){const _0x4f1ff2=new Pr(this['locale']);return _0x4f1ff2['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x196901,_0x47a31d,_0x323595)=>_0x196901&&!_0x47a31d&&!!_0x323595),_0x4f1ff2['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x4f1ff2['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x5e33fe,_0x44125d,_0x22a686)=>_0x5e33fe&&!_0x44125d&&!!_0x22a686),_0x4f1ff2['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x4f1ff2['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x4d1ef2,_0x553f87)=>_0x4d1ef2&&!_0x553f87),_0x4f1ff2['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x4f1ff2['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x4f1ff2['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x4f1ff2;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x55f549=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Wn(_0x55f549,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x172333){const _0x3765c9=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x172333||Wn(_0x3765c9,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x241f5a{['licenseKey'];['_licenseKeyCheckInterval'];['_dialog'];['_formView'];['_aiAdapter'];['_aiAssistantController'];['_uiCssClasses']='';static get['pluginName'](){return'AIAssistantUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[_0x3b2626,a,K,_0x1017f8];}constructor(_0x27b461){super(_0x27b461),_0x27b461['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x27b461['config']['define']('ai.assistant.contentAreaCssClass',''),_0x27b461['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x27b461['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x40c875}=this;this['_aiAdapter']=_0x40c875['plugins']['get'](K),this['_dialog']=_0x40c875['plugins']['get'](_0x1017f8),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x3369f8=new E(_0x40c875,Array['from'](this['_commandDefinitions']['values']()));_0x40c875['commands']['add']('showAIAssistant',_0x3369f8),_0x40c875['ui']['componentFactory']['add']('aiCommands',_0x704564=>{const _0x47f877=_0x29ed58(_0x704564);return _0x47f877['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x47f877['buttonView']['set']({'label':Wn(_0x704564,'AI\x20Commands'),'icon':_0x3c71fd,'tooltip':!0x0}),_0x47f877['on']('execute',_0xcaf961=>this['_onExecute'](_0xcaf961['source']['id'])),_0x359042(_0x47f877,_0x40c875['ui']['view']['body'],function(_0x53d093){const _0x3e877b=o(_0x53d093['config']['get']('ai.assistant.commands'),_0x53d093['locale']),_0x107cc5=B(_0x53d093,_0x3e877b)['filter'](_0x50d021=>_0x50d021['commands']['length']);if(0x1===_0x107cc5['length'])return B(_0x53d093,_0x107cc5[0x0]['commands'])['map'](_0x116aa2=>({'id':_0x116aa2['id'],'label':_0x116aa2['label']}));return _0x107cc5['map'](_0x3a628b=>{const {groupId:_0x3d0fd5,groupLabel:_0x3e3f65,commands:_0x3dc26a}=_0x3a628b,_0x171924=B(_0x53d093,_0x3dc26a)['map'](_0x3845da=>({'id':_0x3845da['id'],'label':_0x3845da['label']}));return{'id':_0x3d0fd5,'menu':_0x3e3f65||_0x3d0fd5,'children':_0x171924};});}(_0x40c875),{'ariaLabel':Wn(_0x704564,'AI\x20Commands')}),_0x47f877['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x3369f8['on']('change:enabledCommandsIds',_0x52eec9),_0x47f877['menuView']['once']('render',_0x52eec9),_0x47f877;function _0x52eec9(){_0x47f877['isEnabled']=_0x3369f8['enabledCommandsIds']['length']>0x0;for(const _0xf2f632 of _0x47f877['menuView']['buttons'])_0xf2f632['isEnabled']=_0x3369f8['enabledCommandsIds']['includes'](_0xf2f632['id']);}}),_0x40c875['ui']['componentFactory']['add']('menuBar:aiCommands',_0x4c4107=>{const _0x15374a=new _0x538ac7(_0x4c4107);_0x15374a['buttonView']['set']({'label':Wn(_0x4c4107,'AI\x20Commands'),'icon':_0x3c71fd}),_0x15374a['bind']('isEnabled')['to'](_0x3369f8,'enabledCommandsIds',_0x5c11c9=>_0x5c11c9['length']>0x0);const _0x54bc86=o(_0x40c875['config']['get']('ai.assistant.commands'),_0x4c4107);return this['_populateMenuBarMenu'](_0x3369f8,_0x15374a,_0x54bc86,_0x4044ec=>this['_onExecute'](_0x4044ec)),_0x15374a;}),_0x40c875['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x2e3e6d=this['_createAIAssistantUIButton'](_0x5bfd84);return _0x2e3e6d['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x2e3e6d;}),_0x40c875['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x39bff8=this['_createAIAssistantUIButton'](_0x302890);return _0x39bff8['set']({'role':'menuitemcheckbox'}),_0x39bff8;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x32740e=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x328955;for(const _0x1b2f69 in _0x32740e){const _0x2b91b9=_0x1b2f69,_0x49d691=_0x32740e[_0x2b91b9];if('aiLicenseKeyValid'==_0x49d691||'aiLicenseKeyInvalid'==_0x49d691||'aiLicenseKeyExpired'==_0x49d691||'aiLicenseKeyDomainLimit'==_0x49d691||'aiLicenseKeyNotAllowed'==_0x49d691||'aiLicenseKeyEvaluationLimit'==_0x49d691||'aiLicenseKeyUsageLimit'==_0x49d691){delete _0x32740e[_0x2b91b9],_0x328955=_0x49d691,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x328955&&_0x32740e['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x328955&&_0x32740e['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x328955&&_0x32740e['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x328955&&_0x32740e['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x328955&&_0x32740e['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x328955&&_0x32740e['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x26be7a='',_0x23f294='',_0x52111b='custom'){const _0xaabba5=this['editor'],_0x2002f1=_0xaabba5['editing']['view'],_0x3a8098=_0xaabba5['plugins']['get'](a),_0x28c4cc=_0xaabba5['plugins']['get'](_0x3b2626);_0x3a8098['showFakeVisualSelection']();const _0x3d6761=new w(),_0x383d3d=new ClipboardEvent('copy',{'clipboardData':_0x3d6761}),_0x55f375=new _0xed8390(_0x3d6761),_0x39417c=new _0x195c6c(_0x2002f1,_0x383d3d,{'dataTransfer':_0x55f375});_0x28c4cc['_forceMarkersCopy']('comment',()=>{_0x2002f1['document']['fire']('copy',_0x39417c);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0xaabba5,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x75ff55=_0x55f375['getData']('text/html');const _0x23beeb=_0xaabba5['model']['document']['selection'],_0x266503=Array['from'](_0x23beeb['getRanges']());0x1===_0x266503['length']&&_0x266503[0x0]['isFlat']&&!_0x23beeb['getSelectedElement']()&&''!==_0x75ff55['replace'](/&nbsp;/g,'')['trim']()&&(_0x75ff55='<p>'+_0x75ff55+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x52111b,'query':_0x26be7a,'htmlContent':_0x75ff55,'label':_0x23f294,'mainActionLabel':_[_0xaabba5['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0xb06f9,'title':Wn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x2be176['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x3a8098['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0xa0b82b=new Map(),_0x5b0445=o(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x2072c6 of _0x5b0445)for(const _0x10a1d1 of _0x2072c6['commands'])_0xa0b82b['set'](_0x10a1d1['id'],{..._0x10a1d1,'groupId':_0x2072c6['groupId'],'groupLabel':_0x2072c6['groupLabel']||_0x2072c6['groupId']});return _0xa0b82b;}['_createAIAssistantUIButton'](_0x2b3be6){const _0x13ea4f=this['editor'],_0x4feb44=_0x13ea4f['commands']['get']('showAIAssistant'),_0x385bcb=new _0x2b3be6(_0x13ea4f['locale']);return _0x385bcb['set']({'label':Wn(_0x13ea4f['locale'],'AI\x20Assistant'),'icon':_0xb06f9,'isToggleable':!0x0}),_0x385bcb['bind']('isEnabled')['to'](_0x4feb44),_0x385bcb['bind']('isOn')['to'](this['_dialog'],'id',_0x501a7a=>'aiAssistant'===_0x501a7a),this['listenTo'](_0x385bcb,'execute',()=>{_0x385bcb['isOn']?this['hideUI']():_0x4feb44['execute']();}),_0x385bcb;}['_initView'](){const _0x1363ee=this['editor']['plugins']['get'](a);this['_formView']=new k(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.assistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x1363ee['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x1363ee['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x8f77b4,ui:{ariaLiveAnnouncer:_0x1ad6fd}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x41b869,_0x1a091c,_0x3ef1e6)=>{const _0xf25ac9=this['_aiAssistantController']['currentContext'];_0x3ef1e6?_0x1ad6fd['announce'](Wn(_0x8f77b4,'AI\x20is\x20writing')):_0xf25ac9&&_0x1ad6fd['announce'](Wn(_0x8f77b4,'Generated\x20content:\x20%0',_0xf25ac9),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x3d1166,_0x52af7d,_0x3904a0)=>{if(_0x3904a0){const _0x22a61b=this['_formView']['errorView']['text'];_0x1ad6fd['announce'](Wn(_0x8f77b4,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x22a61b));}});}['_onExecute'](_0x55c711){const _0x409080=this['_commandDefinitions']['get'](_0x55c711),_0x335a0c=this['editor'],_0x338cef=_0x335a0c['model']['document']['selection'],_0x32a61c=_0x335a0c['commands']['get']('showAIAssistant'),_0x59f86f=_0x335a0c['plugins']['get'](a),_0x18d659=''+(_0x409080['groupId']!==x?_0x409080['groupLabel']+':\x20':'')+_0x409080['label'];if(!0x1!==_0x409080['requiresContent']&&_0x338cef['isCollapsed']){const _0x2584be=_0xd78d7(_0x338cef['getSelectedBlocks']())||_0x335a0c['model']['schema']['getLimitElement'](_0x338cef);_0x335a0c['model']['change'](_0x19ab8b=>{_0x19ab8b['setSelection'](_0x2584be,'in');});}_0x59f86f['showFakeVisualSelection'](),_0x32a61c['execute'](_0x409080['prompt'],_0x18d659,'command:'+_0x55c711);}['_populateMenuBarMenu'](_0x5ea364,_0x4fc399,_0x4f6b7a,_0x2647c3){const _0x97014a=this['editor'],_0x5aa23e=_0x97014a['locale'],_0x585838=new _0x255377(_0x5aa23e),_0x3b5e1c=B(_0x97014a,_0x4f6b7a)['filter'](_0x15dce0=>_0x15dce0['commands']['length']);0x1===_0x3b5e1c['length']?this['_getMenuBarGroupButtons']({'command':_0x5ea364,'commands':_0x3b5e1c[0x0]['commands'],'parentMenuView':_0x4fc399,'onExecute':_0x2647c3})['forEach'](_0x5c7745=>_0x585838['items']['add'](_0x5c7745)):_0x3b5e1c['forEach'](({groupId:_0x74c7a2,groupLabel:_0x5e88ea,commands:_0x145d57})=>{const _0x421285=new _0x199d14(_0x5aa23e,_0x4fc399),_0x53bff6=new _0x538ac7(_0x5aa23e),_0x266d54=new _0x255377(_0x5aa23e),_0x466682=this['_getMenuBarGroupButtons']({'command':_0x5ea364,'commands':_0x145d57,'parentMenuView':_0x53bff6,'onExecute':_0x2647c3});_0x53bff6['buttonView']['set']({'label':_0x5e88ea||_0x74c7a2}),_0x53bff6['delegate']('execute')['to'](_0x4fc399),_0x266d54['items']['addMany'](_0x466682),_0x53bff6['panelView']['children']['add'](_0x266d54),_0x421285['children']['add'](_0x53bff6),_0x585838['items']['add'](_0x421285);}),_0x4fc399['panelView']['children']['add'](_0x585838);}['_getMenuBarGroupButtons']({command:_0x5de5ae,commands:_0x2f04d2,parentMenuView:_0x29800b,onExecute:_0x10c27e}){const _0x37ab2f=this['editor'],_0x4e8273=_0x37ab2f['locale'];return B(_0x37ab2f,_0x2f04d2)['map'](_0x28b024=>{const _0xdbd35a=new _0x199d14(_0x4e8273,_0x29800b),_0x38eef6=new _0x302890(_0x4e8273);return _0x38eef6['set']({'label':_0x28b024['label']}),_0x38eef6['delegate']('execute')['to'](_0x29800b),_0x38eef6['on']('execute',()=>_0x10c27e(_0x28b024['id'])),_0x38eef6['bind']('isEnabled')['to'](_0x5de5ae,'enabledCommandsIds',_0x1320ec=>_0x1320ec['includes'](_0x28b024['id'])),_0xdbd35a['children']['add'](_0x38eef6),_0xdbd35a;});}}function U(_0x49f8a7,_0x4f67fc){return void 0x0!==_0x49f8a7['order']&&void 0x0===_0x4f67fc['order']?0x1:void 0x0===_0x49f8a7['order']&&void 0x0!==_0x4f67fc['order']?-0x1:void 0x0!==_0x49f8a7['order']&&void 0x0!==_0x4f67fc['order']?_0x49f8a7['order']-_0x4f67fc['order']:0x0;}function B(_0x10fd01,_0x2073dc){_0x2073dc['sort'](U);const _0x36e57b={},_0x69424d=[];for(const _0xcf2145 of _0x2073dc)if(void 0x0!==_0xcf2145['order']){if(_0xcf2145['order']in _0x36e57b)throw new _0x542443('ai-commands-config-order-collision',_0x10fd01,{'conflictingDefinitions':[_0xcf2145,_0x36e57b[_0xcf2145['order']]]});_0x36e57b[_0xcf2145['order']]=_0xcf2145,_0x69424d['splice'](_0xcf2145['order'],0x0,_0xcf2145);}else _0x69424d['push'](_0xcf2145);return _0x69424d;}class $n extends _0x241f5a{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4941b6){super(_0x4941b6);const _0x12a836=_0x4941b6['config'],_0x35d061=_0x4941b6['locale'];_0x12a836['define']('ai.assistant.preserveComments',!0x0),_0x12a836['define']('ai.assistant.commands',qn(_0x35d061)),_0x12a836['define']('ai.assistant.extraCommandGroups',[]),_0x12a836['define']('ai.assistant.removeCommands',[]);let _0x22d8db=o(_0x12a836['get']('ai.assistant.commands'),_0x35d061);const _0x394934=_0x12a836['get']('ai.assistant.extraCommandGroups'),_0x40b4b5=_0x12a836['get']('ai.assistant.removeCommands');_0x394934['forEach'](_0x558961=>{const _0x12ed8d=_0x22d8db['find'](_0x3b5ba9=>_0x3b5ba9['groupId']===_0x558961['groupId']);_0x12ed8d?_0x12ed8d['commands']=_0x12ed8d['commands']['concat'](_0x558961['commands']):_0x22d8db['push'](_0x558961);}),_0x22d8db=_0x22d8db['filter'](_0xaac787=>!_0x40b4b5['includes'](_0xaac787['groupId'])),_0x22d8db['forEach'](_0x429d9a=>{_0x429d9a['commands']=_0x429d9a['commands']['filter'](_0x4750d9=>!_0x40b4b5['includes'](_0x4750d9['id']));}),_0x12a836['set']('ai.assistant.commands',_0x22d8db);}}function qn(_0x209ad3){return[{'groupId':'editOrReview','groupLabel':Wn(_0x209ad3,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Wn(_0x209ad3,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Wn(_0x209ad3,'Make\x20shorter'),'prompt':'Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.'},{'id':'makeLonger','label':Wn(_0x209ad3,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Wn(_0x209ad3,'Simplify\x20language'),'prompt':'Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.'}]},{'groupId':'generate','groupLabel':Wn(_0x209ad3,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Wn(_0x209ad3,'Summarize'),'prompt':'Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.'},{'id':'continue','label':Wn(_0x209ad3,'Continue'),'prompt':'Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.'}]},{'groupId':'changeTone','groupLabel':Wn(_0x209ad3,'Change\x20tone'),'commands':[{'id':'professional','label':Wn(_0x209ad3,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Wn(_0x209ad3,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Wn(_0x209ad3,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Wn(_0x209ad3,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Wn(_0x209ad3,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Wn(_0x209ad3,'Change\x20style'),'commands':[{'id':'business','label':Wn(_0x209ad3,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Wn(_0x209ad3,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Wn(_0x209ad3,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Wn(_0x209ad3,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Wn(_0x209ad3,'Translate'),'commands':[{'id':'translateEnglish','label':Wn(_0x209ad3,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Wn(_0x209ad3,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Wn(_0x209ad3,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Wn(_0x209ad3,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Wn(_0x209ad3,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Wn(_0x209ad3,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Wn(_0x209ad3,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Wn(_0x209ad3,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ar extends _0x241f5a{['abortController'];static get['requires'](){return[K];}constructor(_0x30c0da){super(_0x30c0da),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](K)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x3bbd2b){return this['sendRequest'](_0x3bbd2b)['catch'](_0x12aba1=>{if(_0x12aba1 instanceof er)return Promise['reject'](_0x12aba1);if('AbortError'==_0x12aba1['name'])return Promise['resolve']();throw console['error'](_0x12aba1),new _0x542443('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x51422b,_0x494564){const _0x1d1e04=this['editor']['locale'],_0x1eaa12={'Content-Type':'application/json'};if('object'==typeof _0x51422b)Object['assign'](_0x1eaa12,_0x51422b);else{if(_0x51422b)try{const _0x11be72=await _0x51422b(_0x494564);Object['assign'](_0x1eaa12,_0x11be72);}catch{return Promise['reject'](new er(Wn(_0x1d1e04,'AI_ERROR_GET_HEADERS')));}}return _0x1eaa12;}async['_prepareRequestParameters'](_0x3a58a9,_0x2f7aca){const _0x2ddd2d=this['editor']['locale'];if('object'==typeof _0x3a58a9)return _0x3a58a9;try{return await _0x3a58a9(_0x2f7aca);}catch{return Promise['reject'](new er(Wn(_0x2ddd2d,'AI_ERROR_GET_PARAMETERS')));}}}class Qn extends ar{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x4adfa0){super(_0x4adfa0),_0x4adfa0['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x4adfa0['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x4adfa0['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x4adfa0['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x4adfa0['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x4adfa0['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x3f30f6,context:_0x2f02ab,onData:_0x5b68c7,actionId:_0x5d62ce}){const _0x1642e2=this['editor']['locale'],_0x490163=await this['prepareMessages'](_0x3f30f6,_0x2f02ab,_0x5d62ce),_0x5907ca=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x5d62ce),_0x205774=await this['_prepareRequestParameters'](this['_requestParameters'],_0x5d62ce),_0x4118ca={'messages':_0x490163,..._0x205774},_0xcf95e8={'method':'POST','headers':_0x5907ca,'body':JSON['stringify'](_0x4118ca),'signal':this['abortController']['signal']},_0x48de6d=await fetch(this['_apiUrl'],_0xcf95e8);if(_0x48de6d['ok'])return _0x205774['stream']?await this['_readStreamableResponse'](_0x48de6d,_0x5b68c7):await this['_readStaticResponse'](_0x48de6d,_0x5b68c7),Promise['resolve']();{const _0x39c164=await _0x48de6d['text']();return _0x39c164['includes']('context_length_exceeded')?Promise['reject'](new er(Wn(_0x1642e2,'AI_ERROR_CONTEXT_LENGTH'))):_0x39c164['includes']('Moderation')?Promise['reject'](new er(Wn(_0x1642e2,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x39c164));}}async['prepareMessages'](_0x18067b,_0x139461,_0x498696){let _0x3e1135,_0x33fb38;return _0x139461?(_0x3e1135='Your\x20task\x20is\x20to\x20execute\x20the\x20instruction\x20using\x20the\x20provided\x20HTML\x20content.\x20Follow\x20the\x20instruction\x20closely.\x20Your\x20answer\x20must\x20be\x20a\x20properly\x20formatted\x20HTML\x20code.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x33fb38='Instruction:\x0a'+_0x18067b+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x139461):(_0x3e1135='Your\x20task\x20is\x20to\x20generate\x20HTML\x20content\x20accordingly\x20to\x20the\x20given\x20instruction.\x20Never\x20include\x20<img>\x20tag\x20in\x20your\x20response\x20even\x20if\x20asked\x20for.\x20Your\x20answer\x20must\x20be\x20a\x20well-structured\x20and\x20properly\x20formatted\x20HTML\x20code.\x20Answer\x20only\x20with\x20the\x20generated\x20HTML\x20content.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x33fb38=_0x18067b),[{'role':'system','content':_0x3e1135},{'role':'user','content':_0x33fb38}];}async['_readStreamableResponse'](_0x27cf36,_0x340902){const _0x1dac3e=_0x27cf36['body']['getReader'](),_0x5ba49d=new TextDecoder();let _0x2782a0='',_0x4b9bab='',_0x478a4a='',_0x4179d8=!0x1;for(;!_0x4179d8;){const {done:_0x10705d,value:_0x85082c}=await _0x1dac3e['read'](),_0x1ffb48=_0x2782a0+_0x5ba49d['decode'](_0x85082c);let _0x228e42='';_0x4179d8=_0x10705d;try{_0x228e42=this['_cleanUpData'](_0x1ffb48),_0x2782a0='';}catch{_0x2782a0=_0x1ffb48;continue;}_0x4b9bab+=_0x228e42,!_0x4179d8&&this['_isBufferIncomplete'](_0x4b9bab)||_0x4b9bab&&(_0x478a4a+=_0x4b9bab,_0x4b9bab='',_0x340902(_0x478a4a));}return Promise['resolve']();}async['_readStaticResponse'](_0x23af14,_0x56d1eb){return _0x56d1eb((await _0x23af14['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x3873c2){const _0x47c7d8=_0x3873c2['split']('<')['length']!==_0x3873c2['split']('>')['length'],_0x136213=_0x3873c2['length']<0x1e;return _0x47c7d8&&_0x136213;}['_cleanUpData'](_0x2d4e61){return _0x2d4e61['split'](/\n(?![^{]*\})/g)['map'](_0x45f8cc=>_0x45f8cc['replace']('data:\x20',''))['filter'](_0x108d94=>_0x108d94&&_0x108d94['length']>0x0&&'[DONE]'!==_0x108d94)['map'](_0xd52283=>{const {choices:_0x48b1a7}=JSON['parse'](_0xd52283);if(_0x48b1a7[0x0]?.['delta']?.['content'])return _0x48b1a7[0x0]['delta']['content'];})['filter'](_0x981a8e=>_0x981a8e)['join']('');}}class Xn extends ar{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),_0x23c4c9('ai-aws-adapter-not-supported');}async['sendRequest'](_0xc3bb42){throw Ct('ai-aws-adapter-not-supported'),new er(Wn(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class ia extends _0x5bfd84{constructor(_0x1d32e5,_0xb75ff3={}){super(_0x1d32e5),this['isToggleable']=!0x0,this['set']('side',_0xb75ff3['side']||'top');const _0x13e4de=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x498aeb(_0xb75ff3['class']||[]),_0x13e4de['to']('side',_0x142204=>'ck-tab-button_'+_0x142204),_0x13e4de['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x15a8cb{['children'];constructor(_0x4b6089,_0x6b35ca={}){super(_0x4b6089);const _0x422d04=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x498aeb(_0x6b35ca['class']||[]),_0x422d04['to']('class'),_0x422d04['if']('isVisible','ck-hidden',_0x1c7c10=>!_0x1c7c10)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x15a8cb{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x1cade6,_0x1e552b={}){super(_0x1cade6),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x1e552b['side']||'top'),this['set']('isMaximized',!0x1);const _0x4c3a21=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x498aeb(_0x1e552b['class']||[]),_0x4c3a21['to']('side',_0x311a42=>'ck-tabs_'+_0x311a42),_0x4c3a21['to']('class'),_0x4c3a21['to']('isMaximized',_0x1ba263=>_0x1ba263?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x4c3a21['to']('side',_0x5257b1=>'ck-tabs__buttons-container_'+_0x5257b1)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x4c3a21['to']('side',_0x1628da=>'ck-tabs__panels-container_'+_0x1628da)]},'children':this['panelViews']},..._0x498aeb(_0x1e552b['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x22f82a){const _0x5809b9=this['_tabs']['get'](_0x22f82a);return _0x5809b9||null;}['addTab'](_0x58ffeb){const _0x58a796=this['_setupButton']({'id':_0x58ffeb['id'],'label':_0x58ffeb['buttonLabel'],'icon':_0x58ffeb['buttonIcon'],'order':_0x58ffeb['order']}),_0x5e68da=new ea(this['locale']);return _0x5e68da['render'](),_0x58ffeb['content']&&_0x5e68da['children']['add'](_0x58ffeb['content']),this['panelViews']['add'](_0x5e68da),this['_tabs']['set'](_0x58ffeb['id'],{'button':_0x58a796,'panel':_0x5e68da,'order':void 0x0!==_0x58ffeb['order']?_0x58ffeb['order']:null}),this['fire']('addTab:'+_0x58ffeb['id'],{'id':_0x58ffeb['id'],'button':_0x58a796,'panel':_0x5e68da}),null===this['activeTab']?this['activateTab'](_0x58ffeb['id']):this['_hidePanel'](_0x58ffeb['id']),{'button':_0x58a796,'panel':_0x5e68da};}['activateTab'](_0x32d00c){if(null!==_0x32d00c&&!this['getTab'](_0x32d00c))throw new _0x542443('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x32d00c});this['activeTab']!==_0x32d00c&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x32d00c,_0x32d00c&&this['_showPanel'](_0x32d00c),this['fire']('activateTab:'+_0x32d00c,_0x32d00c));}['showTab'](_0x1b7ac4){if(!this['getTab'](_0x1b7ac4))throw new _0x542443('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x1b7ac4});this['_showPanel'](_0x1b7ac4),this['_showButton'](_0x1b7ac4),this['fire']('show:'+_0x1b7ac4,_0x1b7ac4);}['hideTab'](_0x53a4c5){if(!this['getTab'](_0x53a4c5))throw new _0x542443('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x53a4c5});const _0x31dc44=this['activeTab'];this['_hidePanel'](_0x53a4c5),this['_hideButton'](_0x53a4c5);const _0x4b386a=this['getTabIds']();_0x31dc44===_0x53a4c5&&_0x4b386a['length']>0x1&&this['activateTab'](_0x4b386a['find'](_0x1e3cfc=>_0x1e3cfc!==_0x53a4c5)),this['fire']('hide:'+_0x53a4c5,_0x53a4c5);}['_getPanel'](_0x578b8a){const _0x301a54=this['_tabs']['get'](_0x578b8a);return _0x301a54?_0x301a54['panel']:null;}['_showPanel'](_0x196b1d){null!==this['activeTab']&&this['activeTab']!==_0x196b1d||this['_getPanel'](_0x196b1d)['show']();}['_hidePanel'](_0x1addea){const _0x25f8ed=this['_getPanel'](_0x1addea);_0x25f8ed['isVisible']&&(this['activeTab']===_0x1addea&&(this['activeTab']=null),_0x25f8ed['hide']());}['_getButton'](_0x4be4bd){const _0x4e9170=this['_tabs']['get'](_0x4be4bd);return _0x4e9170?_0x4e9170['button']:null;}['_showButton'](_0x991c9d){this['_getButton'](_0x991c9d)['show']();}['_hideButton'](_0x4b19de){this['_getButton'](_0x4b19de)['hide']();}['_setupButton'](_0x2f56b3){const _0xba8f84=new ia(this['locale'],{'side':this['side']}),_0x2a3d33=this['buttonViews'];if(_0xba8f84['set']({'label':_0x2f56b3['label'],'icon':_0x2f56b3['icon'],'tooltip':!0x0,'withText':!0x0}),_0xba8f84['bind']('isOn')['to'](this,'activeTab',_0x15d21f=>_0x15d21f===_0x2f56b3['id']),_0xba8f84['bind']('side')['to'](this,'side'),_0x2f56b3['order']){const _0x35933c=[...this['_tabs']]['reduce']((_0x4d8462,_0x21c9d4)=>{const _0x50e169=_0x21c9d4[0x0],{order:_0x18c477}=_0x21c9d4[0x1];return!_0x18c477||_0x18c477>_0x2f56b3['order']?_0x4d8462:_0x18c477>=_0x4d8462['order']?{'id':_0x50e169,'order':_0x18c477}:_0x4d8462;},{'id':'','order':0x0}),_0x2174e1=_0x2a3d33['getIndex'](this['_getButton'](_0x35933c['id']));_0x2a3d33['add'](_0xba8f84,_0x2174e1+0x1);}else _0x2a3d33['add'](_0xba8f84);return _0xba8f84['on']('execute',()=>{this['activateTab'](_0x2f56b3['id']);}),_0xba8f84;}}const ni=['overlay','sidebar','custom'],oi=['left','right'];class hi extends ss{constructor(_0x413153,_0x54488a={}){super(_0x413153,_0x54488a),this['set']('type',_0x54488a['type']||'sidebar'),this['set']('side',_0x54488a['side']||'right'),this['set']('isVisible',_0x54488a['visibleByDefault']??!0x0);const _0x35d1b2=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x35d1b2['if']('type','ck-ai-tabs__overlay',_0x380007=>'overlay'===_0x380007),_0x35d1b2['if']('type','ck-ai-tabs__sidebar',_0x4c20ae=>'sidebar'===_0x4c20ae),_0x35d1b2['if']('isVisible','ck-hidden',_0x5952b2=>!_0x5952b2)]}}),this['buttonViews']['on']('add',(_0xd00984,_0x52df40)=>{_0x52df40['set']('withText',!0x1);});}}class _t extends _0x118815{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4c6df2){super(_0x4c6df2);const _0x5efb2f=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x5efb2f)throw new _0x542443('ai-tabs-configuration-not-found');if(void 0x0!==_0x5efb2f['showResizeButton']&&(this['showResizeButton']=_0x5efb2f['showResizeButton']),'sidebar'!==_0x5efb2f['type']&&'overlay'!==_0x5efb2f['type']||_0x5efb2f['side']&&(this['side']=_0x5efb2f['side']),'sidebar'===_0x5efb2f['type']){if(this['container']=_0x5efb2f['element'],this['set']('type','sidebar'),!this['container'])throw new _0x542443('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x5efb2f['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new hi(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x5efb2f['visibleByDefault']||_0x5efb2f['visibleByDefault']}),this['view']['render'](),this['view']['bind']('side')['to'](this,'side'),this['view']['bind']('type')['to'](this,'type'),this['container']&&this['container']['appendChild'](this['view']['element']),this['context']instanceof dt&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x5566bc){if(_0x5566bc&&this['type']!==_0x5566bc){if(!ni['includes'](_0x5566bc))throw new _0x542443('ai-tabs-unsupported-ui-type');this['type']=_0x5566bc;}}['switchSide'](_0x58214d){if(_0x58214d&&this['side']!==_0x58214d){if(!oi['includes'](_0x58214d))throw new _0x542443('ai-tabs-unsupported-ui-side');this['side']=_0x58214d;}}['resize'](){this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class S extends _0x118815{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x260cf2){super(_0x260cf2),this['context']['config']['define']('ai.serviceUrl','https://ai.cke-cs.com/v1'),this['_apiUrl']=this['context']['config']['get']('ai.serviceUrl'),this['_token']=null,this['_decoder']=new TextDecoder();}['init'](){const _0x494c24=this['context']['plugins']['get']('CloudServices');if(!_0x494c24['token'])throw new _0x542443('ai-missing-token',this);this['_token']=_0x494c24['token'];}['startConversation'](_0x18778f,_0x53f05d){const _0x2af6c4=this['_sendApiRequest']('/conversations','POST',{'id':_0x18778f,'group':_0x53f05d});return{'getConversation':async()=>(await _0x2af6c4['request'])['json'](),'abortController':_0x2af6c4['abortController']};}['queryAssistant']({message:_0x31eced,conversationId:_0x59f661,parts:_0x2715cd,capabilities:_0x2a1fee,model:_0x3de276,attributes:_0xe97ffb}){const _0x4e4170={'prompt':_0x31eced,'content':_0x2715cd,'model':_0x3de276,..._0x2a1fee&&{'capabilities':_0x2a1fee},..._0xe97ffb&&{'attributes':_0xe97ffb}},_0x13669c=this['_sendApiRequest']('/conversations/'+_0x59f661+'/messages','POST',_0x4e4170);return{'getStream':async()=>{const _0x1cc07a=(await _0x13669c['request'])['body'];return this['_getStreamReader'](_0x1cc07a);},'abortController':_0x13669c['abortController']};}['executeCustomAction']({content:_0x468dfb,message:_0x2ccd2c,model:_0xfefb43,outputFormat:_0x3a51f6}){const _0x215690={'content':[{'type':'text','content':_0x468dfb}],'prompt':_0x2ccd2c,'model':_0xfefb43,'outputFormat':_0x3a51f6},_0x2b40e1=this['_sendApiRequest']('/actions/custom/calls','POST',_0x215690);return{'getStream':async()=>{const _0x472ba1=(await _0x2b40e1['request'])['body'];return this['_getStreamReader'](_0x472ba1);},'abortController':_0x2b40e1['abortController']};}['executeAction']({actionName:_0x2a7241,content:_0x389a0a,args:_0x4725e1}){const _0x2d5c4c={'content':[{'type':'text','content':_0x389a0a}],'args':_0x4725e1},_0x124f54=this['_sendApiRequest']('/actions/system/'+_0x2a7241+'/calls','POST',_0x2d5c4c);return{'getStream':async()=>{const _0x3af984=(await _0x124f54['request'])['body'];return this['_getStreamReader'](_0x3af984);},'abortController':_0x124f54['abortController']};}['uploadFile'](_0x4357e9,_0x4b8c2c,_0x2cd211){const _0x55c320=new FormData();_0x55c320['append']('file',_0x4b8c2c,_0x4b8c2c['name']),_0x2cd211&&_0x55c320['append']('attributes',JSON['stringify'](_0x2cd211));const _0x388109=this['_sendApiRequest']('/conversations/'+_0x4357e9+'/files','POST',_0x55c320);return{'getId':async()=>(await _0x388109['request'])['json'](),'abortController':_0x388109['abortController']};}['fetchDocument'](_0x40b4de,_0x1961e6){const _0x4cdf02=this['_sendApiRequest']('/conversations/'+_0x40b4de+'/documents/'+_0x1961e6,'GET');return{'getDocument':async()=>(await _0x4cdf02['request'])['json'](),'abortController':_0x4cdf02['abortController']};}['uploadDocument'](_0x202245,_0x459684,_0x204c1b){const _0x2ab3c6={'content':_0x459684};_0x204c1b&&(_0x2ab3c6['attributes']=_0x204c1b);const _0x261504=this['_sendApiRequest']('/conversations/'+_0x202245+'/documents','POST',_0x2ab3c6);return{'getId':async()=>(await _0x261504['request'])['json'](),'abortController':_0x261504['abortController']};}['fetchConversations'](_0x27a480,_0x3c4ea9={}){const _0x1dc7c6=new URLSearchParams();_0x1dc7c6['append']('group',_0x27a480),_0x1dc7c6['append']('excludeEmpty',!0x1!==_0x3c4ea9['excludeEmpty']?'true':'false'),_0x1dc7c6['append']('limit',_0x3c4ea9['limit']?_0x3c4ea9['limit']['toString']():'100'),_0x1dc7c6['append']('sortBy',_0x3c4ea9['sortBy']?_0x3c4ea9['sortBy']:'createdAt'),_0x1dc7c6['append']('order',_0x3c4ea9['order']?_0x3c4ea9['order']:'desc');const _0x4c70e6=this['_sendApiRequest']('/conversations?'+_0x1dc7c6['toString'](),'GET');return{'getConversations':async()=>{const _0x141534=await _0x4c70e6['request'];return(await _0x141534['json']())['items'];},'abortController':_0x4c70e6['abortController']};}['deleteConversation'](_0x569fdc){const _0x53d005=this['_sendApiRequest']('/conversations/'+_0x569fdc,'DELETE');return{'execute':async()=>{await _0x53d005['request'];},'abortController':_0x53d005['abortController']};}['updateConversation'](_0x5127b8,_0x5494b1){const _0x58c3f3=this['_sendApiRequest']('/conversations/'+_0x5127b8,'PATCH',_0x5494b1);return{'getResult':async()=>(await _0x58c3f3['request'],_0x5494b1),'abortController':_0x58c3f3['abortController']};}['fetchConversation'](_0x39cc47){const _0x54521a=this['_sendApiRequest']('/conversations/'+_0x39cc47,'GET');return{'getConversation':async()=>(await _0x54521a['request'])['json'](),'abortController':_0x54521a['abortController']};}['fetchConversationMessages'](_0x252f8f){const _0x1b6093=this['_sendApiRequest']('/conversations/'+_0x252f8f+'/messages','GET');return{'getMessages':async()=>{const _0x40ef14=await _0x1b6093['request'];return(await _0x40ef14['json']())['items'];},'abortController':_0x1b6093['abortController']};}['uploadUrl'](_0x18006e,_0x20c7f7,_0x2cd00a){const _0x1a82f3=this['_sendApiRequest']('/conversations/'+_0x18006e+'/web-resources','POST',{'url':_0x20c7f7,'attributes':_0x2cd00a});return{'getId':async()=>(await _0x1a82f3['request'])['json'](),'abortController':_0x1a82f3['abortController']};}['getModels'](_0x497940='en'){const _0x4ac8f5=new URLSearchParams();_0x4ac8f5['append']('language',_0x497940);const _0x318bea='/models/1?'+_0x4ac8f5['toString'](),_0x2af66a=this['_sendApiRequest'](_0x318bea,'GET');return{'list':async()=>await(await _0x2af66a['request'])['json'](),'abortController':_0x2af66a['abortController']};}['deleteFile'](_0x32e1ee,_0x1daf00){const _0x54f48f=this['_sendApiRequest']('/conversations/'+_0x32e1ee+'/files/'+_0x1daf00,'DELETE');return{'execute':async()=>{await _0x54f48f['request'];},'abortController':_0x54f48f['abortController']};}['deleteDocument'](_0x149bf1,_0x337ce7){const _0x44f030=this['_sendApiRequest']('/conversations/'+_0x149bf1+'/documents/'+_0x337ce7,'DELETE');return{'execute':async()=>{await _0x44f030['request'];},'abortController':_0x44f030['abortController']};}['deleteWebResource'](_0x5614af,_0x474c53){const _0x29d10d=this['_sendApiRequest']('/conversations/'+_0x5614af+'/web-resources/'+_0x474c53,'DELETE');return{'execute':async()=>{await _0x29d10d['request'];},'abortController':_0x29d10d['abortController']};}['callSystemReview']({reviewName:_0x13df65,content:_0x52d8e0,args:_0x136211}){const _0x7748f2=this['_sendApiRequest']('/reviews/system/'+_0x13df65+'/calls','POST',{'content':[{'type':'text','content':_0x52d8e0}],'args':_0x136211});return{'getStream':async()=>{const _0x4a8e17=(await _0x7748f2['request'])['body'];return this['_getStreamReader'](_0x4a8e17);},'abortController':_0x7748f2['abortController']};}['callCustomReview']({content:_0x2097f8,prompt:_0x3daa36,model:_0x198331}){const _0x3df1c3=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x2097f8}],'prompt':_0x3daa36,'model':_0x198331});return{'getStream':async()=>{const _0x2f7cf8=(await _0x3df1c3['request'])['body'];return this['_getStreamReader'](_0x2f7cf8);},'abortController':_0x3df1c3['abortController']};}['upsertAIChatRating'](_0x5e49f7,_0x467d74,_0x1523d3){const _0x20a46a=this['_sendApiRequest']('/conversations/'+_0x5e49f7+'/messages/'+_0x467d74+'/ratings','PUT',{'positiveCount':_0x1523d3['positiveCount'],'totalCount':_0x1523d3['totalCount'],'modificationId':_0x1523d3['modificationId']});return{'execute':async()=>{await _0x20a46a['request'];},'abortController':_0x20a46a['abortController']};}['upsertAIActionRating'](_0x3b2225,_0x443735,_0x54e615){const _0x5d577b=this['_sendApiRequest']('/actions/system/'+_0x3b2225+'/calls/'+_0x443735+'/ratings','PUT',{'positiveCount':_0x54e615['positiveCount'],'totalCount':_0x54e615['totalCount']});return{'execute':async()=>{await _0x5d577b['request'];},'abortController':_0x5d577b['abortController']};}['upsertCustomAIActionRating'](_0x49f524,_0xfc29d5){const _0x1b08bd=this['_sendApiRequest']('/actions/custom/calls/'+_0x49f524+'/ratings','PUT',{'positiveCount':_0xfc29d5['positiveCount'],'totalCount':_0xfc29d5['totalCount']});return{'execute':async()=>{await _0x1b08bd['request'];},'abortController':_0x1b08bd['abortController']};}['upsertAIReviewRating'](_0x397bc4,_0x3d5235,_0x24dfef,_0x53ffbc){const _0x4623d5=this['_sendApiRequest']('/reviews/system/'+_0x397bc4+'/calls/'+_0x3d5235+'/ratings','PUT',{'positiveCount':_0x24dfef['positiveCount'],'totalCount':_0x24dfef['totalCount'],'dataId':_0x53ffbc});return{'execute':async()=>{await _0x4623d5['request'];},'abortController':_0x4623d5['abortController']};}['upsertCustomAIReviewRating'](_0xae1011,_0x3ab122,_0x15a35a){const _0x547efa=this['_sendApiRequest']('/reviews/custom/calls/'+_0xae1011+'/ratings','PUT',{'positiveCount':_0x3ab122['positiveCount'],'totalCount':_0x3ab122['totalCount'],'dataId':_0x15a35a});return{'execute':async()=>{await _0x547efa['request'];},'abortController':_0x547efa['abortController']};}['_sendApiRequest'](_0x3400bd,_0x113d34,_0x4c908d){const _0x1b945f=new AbortController(),_0x326615=_0x4c908d instanceof FormData,_0x47424b={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x4c908d&&!_0x326615&&(_0x47424b['Content-Type']='application/json');const _0x18ab02={'method':_0x113d34,'headers':_0x47424b,'signal':_0x1b945f['signal']};return _0x4c908d&&(_0x18ab02['body']=_0x326615?_0x4c908d:JSON['stringify'](_0x4c908d)),{'request':fetch(''+this['_apiUrl']+_0x3400bd,_0x18ab02)['catch'](_0x5f4391=>{this['_handleError'](_0x5f4391);})['then'](_0x203eda=>_0x203eda['ok']?_0x203eda:_0x203eda['json']()['then'](_0x4ec00c=>{throw{'url':this['_apiUrl'],'path':_0x3400bd,'method':_0x113d34,'body':_0x4c908d,'status':(_0x203eda||{})['status'],'statusText':(_0x203eda||{})['statusText'],'code':_0x4ec00c['code'],'message':_0x4ec00c['message'],'traceId':_0x4ec00c['traceId']};})),'abortController':_0x1b945f};}async*['_getStreamReader'](_0x353733){const _0x328ac6=[],_0x45933c=_0x353733['getReader'](),_0x2c3053=$t({'onError':_0x127d51=>{this['_handleError'](_0x127d51);},'onEvent':_0x3ca2b3=>{_0x3ca2b3['data']=JSON['parse'](_0x3ca2b3['data']),_0x328ac6['push'](_0x3ca2b3);}});try{let _0x5d34cd=!0x1;for(;!_0x5d34cd;){const {done:_0x17e348,value:_0x28321d}=await _0x45933c['read']();_0x17e348&&(_0x5d34cd=!0x0),_0x2c3053['feed'](this['_decoder']['decode'](_0x28321d,{'stream':!0x0})),yield*_0x328ac6,_0x328ac6['length']=0x0;}}catch(_0x48a9ef){this['_handleError'](_0x48a9ef);}finally{_0x45933c['releaseLock'](),_0x2c3053['reset']();}}['_handleError'](_0x4f8180){if(_0x4f8180 instanceof _0x542443)throw _0x4f8180;if(_0x4f8180 instanceof Error&&'AbortError'===_0x4f8180['name'])throw new _0x542443('ai-request-aborted',this,{'originalError':_0x4f8180});throw new _0x542443('ai-request-failed',this,{'originalError':_0x4f8180});}}function i(_0x1ef15d,_0x30f31b,_0x10bb2c){const t=_0x1ef15d['t'];switch(_0x30f31b){case'AI_SUGGESTION_HEADER_TITLE':return t({'id':'AI_SUGGESTION_HEADER_TITLE','string':'Proposed\x20changes'});case'AI_SUGGESTION_BUTTON_SHOW_CHANGES':return t({'id':'AI_SUGGESTION_BUTTON_SHOW_CHANGES','string':'Show\x20details'});case'AI_MINI_TOOLBAR_LIKE':return t({'id':'AI_MINI_TOOLBAR_LIKE','string':'I\x20like\x20this\x20response'});case'AI_MINI_TOOLBAR_DISLIKE':return t({'id':'AI_MINI_TOOLBAR_DISLIKE','string':'I\x20don\x27t\x20like\x20this\x20response'});case'AI_MINI_TOOLBAR_COPY':return t({'id':'AI_MINI_TOOLBAR_COPY','string':'Copy\x20to\x20clipboard'});case'AI_SUGGESTION_CONTENT_PART_TITLE':return t({'id':'AI_SUGGESTION_CONTENT_PART_TITLE','string':'Change\x20%0'},_0x10bb2c);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});case'AI_SUGGESTION_CONTENT_PART_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_OUTDATED','string':'Change\x20is\x20outdated'});case'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED':return t({'id':'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED','string':'Change\x20is\x20already\x20applied'});case'AI_SUGGESTION_CONTENT_PART_APPLY':return t({'id':'AI_SUGGESTION_CONTENT_PART_APPLY','string':'Apply\x20change'});case'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION','string':'Add\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_REJECT':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECT','string':'Reject\x20change'});case'AI_SUGGESTION_CONTENT_PART_REMOVED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REMOVED','string':'Removed\x20content.\x20Use\x20\x22Show\x20details\x22\x20to\x20learn\x20more.'});case'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED','string':'Approved'});case'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED','string':'Rejected'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED','string':'Outdated'});case'AI_DISCLAIMER_TEXT':return t({'id':'AI_DISCLAIMER_TEXT','string':'AI\x20can\x20make\x20mistakes.\x20Please\x20double-check\x20responses.'});case'AI_TABS_LABEL_MAXIMIZE':return t({'id':'AI_TABS_LABEL_MAXIMIZE','string':'Maximize'});case'AI_TABS_LABEL_MINIMIZE':return t({'id':'AI_TABS_LABEL_MINIMIZE','string':'Minimize'});case'AI_CHAT_HEADING':return t({'id':'AI_CHAT_HEADING','string':'Chat'});case'AI_CHAT_SOURCES_HEADER':return t({'id':'AI_CHAT_SOURCES_HEADER','string':'Sources'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi!\x20I\x20can\x20help\x20you\x20draft,\x20rewrite,\x20and\x20improve\x20your\x20text,\x20explore\x20ideas,\x20research\x20topics,\x20and\x20solve\x20problems.\x20How\x20can\x20I\x20help\x20right\x20now?'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'The\x20request\x20was\x20aborted.'});case'AI_CHAT_GENERIC_ERROR':return t({'id':'AI_CHAT_GENERIC_ERROR','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_START_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_START_CONVERSATION','string':'Unable\x20to\x20start\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION','string':'Unable\x20to\x20load\x20chosen\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE','string':'Failed\x20to\x20upload\x20files:\x20%0.\x20Please\x20try\x20again.'},_0x10bb2c);case'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES','string':'Unable\x20to\x20load\x20resources\x20from\x20%0.\x20Please\x20try\x20again.'},_0x10bb2c);case'AI_CHAT_RESOURCE_LOAD_FAILED':return t({'id':'AI_CHAT_RESOURCE_LOAD_FAILED','string':'Failed\x20to\x20load\x20resource.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_CURRENT_DOCUMENT':return t({'id':'AI_CHAT_CONTEXT_CURRENT_DOCUMENT','string':'Current\x20document'});case'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT','string':'Remove\x20from\x20context'});case'AI_CHAT_CONTEXT_ADD_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_ADD_CONTEXT','string':'Add\x20context'});case'AI_CHAT_CONTEXT_URL_LABEL':return t({'id':'AI_CHAT_CONTEXT_URL_LABEL','string':'URL'});case'AI_CHAT_CONTEXT_FILE_LABEL':return t({'id':'AI_CHAT_CONTEXT_FILE_LABEL','string':'File'});case'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL':return t({'id':'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL','string':'Current\x20context'});case'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL':return t({'id':'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL','string':'Selected\x20content'});case'AI_CHAT_SEARCH_WEB':return t({'id':'AI_CHAT_SEARCH_WEB','string':'Web\x20search'});case'AI_CHAT_ENABLE_WEB_SEARCH':return t({'id':'AI_CHAT_ENABLE_WEB_SEARCH','string':'Enable\x20web\x20search'});case'AI_CHAT_DISABLE_WEB_SEARCH':return t({'id':'AI_CHAT_DISABLE_WEB_SEARCH','string':'Disable\x20web\x20search'});case'AI_CHAT_REASONING':return t({'id':'AI_CHAT_REASONING','string':'Reasoning'});case'AI_CHAT_ENABLE_REASONING':return t({'id':'AI_CHAT_ENABLE_REASONING','string':'Enable\x20reasoning'});case'AI_CHAT_DISABLE_REASONING':return t({'id':'AI_CHAT_DISABLE_REASONING','string':'Disable\x20reasoning'});case'AI_CHAT_COMMANDS':return t({'id':'AI_CHAT_COMMANDS','string':'Commands'});case'AI_CHAT_SEARCH_RESOURCES':return t({'id':'AI_CHAT_SEARCH_RESOURCES','string':'Search\x20resources'});case'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT','string':'Back\x20to\x20context\x20options'});case'AI_CHAT_CONTEXT_URL_ADD_URL':return t({'id':'AI_CHAT_CONTEXT_URL_ADD_URL','string':'Add\x20URL'});case'AI_CHAT_CONTEXT_URL_PLACEHOLDER':return t({'id':'AI_CHAT_CONTEXT_URL_PLACEHOLDER','string':'Add\x20URL...'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL','string':'Failed\x20to\x20upload\x20URL:\x20%0.\x20Please\x20try\x20again.'},_0x10bb2c);case'AI_CHAT_CONTEXT_INVALID_DATA':return t({'id':'AI_CHAT_CONTEXT_INVALID_DATA','string':'Invalid\x20context\x20data\x20type\x20for\x20the\x20selected\x20resource.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE','string':'Unsupported\x20resource\x20type.\x20Only\x20files\x20and\x20URLs\x20are\x20supported.'});case'AI_CHAT_CONTEXT_URL_EMPTY_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_EMPTY_ERROR','string':'URL\x20cannot\x20be\x20empty.'});case'AI_CHAT_CONTEXT_URL_INVALID_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_INVALID_ERROR','string':'Please\x20enter\x20a\x20valid\x20URL.'});case'AI_CHAT_INVALID_REQUEST':return t({'id':'AI_CHAT_INVALID_REQUEST','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE','string':'The\x20file\x20type\x20is\x20not\x20supported.\x20Please\x20upload\x20a\x20different\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_LARGE':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_LARGE','string':'The\x20file\x20is\x20too\x20large.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES','string':'The\x20file\x20has\x20too\x20many\x20pages.\x20Please\x20upload\x20a\x20file\x20with\x20fewer\x20pages.'});case'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED':return t({'id':'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED','string':'The\x20form\x20data\x20size\x20limits\x20are\x20exceeded.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR','string':'AI\x20is\x20preparing\x20a\x20response...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH','string':'AI\x20is\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REASONING','string':'AI\x20is\x20using\x20reasoning\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING','string':'AI\x20is\x20using\x20reasoning\x20and\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH','string':'Scanned\x20the\x20internet\x20for\x20insights'});case'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING','string':'AI\x20used\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING','string':'AI\x20used\x20search\x20and\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR','string':'Ask\x20AI\x20anything...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH','string':'Ask\x20AI\x20anything\x20(web\x20search\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING','string':'Ask\x20AI\x20anything\x20(reasoning\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING','string':'Ask\x20AI\x20anything\x20(web\x20search\x20and\x20reasoning\x20enabled)...'});case'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL','string':'Suggest\x20all'},_0x10bb2c);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x10bb2c);case'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL','string':'Apply\x20all'});case'AI_CHAT_SUGGESTION_ACTION_APPLY':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY','string':'Apply'});case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x10bb2c);case'AI_CHAT_MODEL_SELECTOR_GROUP':return t({'id':'AI_CHAT_MODEL_SELECTOR_GROUP','string':'Models'});case'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP':return t({'id':'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP','string':'Select\x20a\x20model'});case'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP':return t({'id':'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP','string':'Start\x20a\x20new\x20conversation\x20to\x20change\x20the\x20model'});case'AI_CHAT_CAPABILITIES_YES':return t({'id':'AI_CHAT_CAPABILITIES_YES','string':'Yes'});case'AI_CHAT_CAPABILITIES_NO':return t({'id':'AI_CHAT_CAPABILITIES_NO','string':'No'});case'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT':return t({'id':'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT','string':'The\x20selected\x20model\x20is\x20no\x20longer\x20available,\x20so\x20you\x20cannot\x20continue\x20this\x20conversation.\x20Please\x20'});case'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON':return t({'id':'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON','string':'start\x20a\x20new\x20one.'});case'AI_CHAT_CONTEXT_SOURCES_LABEL':return t({'id':'AI_CHAT_CONTEXT_SOURCES_LABEL','string':'Sources'});case'AI_CHAT_HISTORY_HEADING':return t({'id':'AI_CHAT_HISTORY_HEADING','string':'Chat\x20History'});case'AI_CHAT_HISTORY_SEARCH_LABEL':return t({'id':'AI_CHAT_HISTORY_SEARCH_LABEL','string':'Search\x20history'});case'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY':return t({'id':'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY','string':'No\x20chats\x20were\x20found\x20matching\x20\x22%0\x22.'},_0x10bb2c);case'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY':return t({'id':'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY','string':'Please\x20try\x20a\x20different\x20phrase\x20or\x20check\x20the\x20spelling.'});case'AI_CHAT_HISTORY_EMPTY_MESSAGE':return t({'id':'AI_CHAT_HISTORY_EMPTY_MESSAGE','string':'Your\x20chat\x20history\x20for\x20current\x20document\x20will\x20appear\x20here.'});case'AI_CHAT_HISTORY_GO_TO_CHAT_BUTTON':return t({'id':'AI_CHAT_HISTORY_GO_TO_CHAT_BUTTON','string':'Go\x20to\x20chat'});case'AI_CHAT_HISTORY_PIN_BUTTON':return t({'id':'AI_CHAT_HISTORY_PIN_BUTTON','string':'Pin'});case'AI_CHAT_HISTORY_SHOW_MORE_ITEMS':return t({'id':'AI_CHAT_HISTORY_SHOW_MORE_ITEMS','string':'Show\x20more\x20items'});case'AI_CHAT_HISTORY_EDIT_NAME':return t({'id':'AI_CHAT_HISTORY_EDIT_NAME','string':'Edit\x20name'});case'AI_CHAT_HISTORY_REMOVE':return t({'id':'AI_CHAT_HISTORY_REMOVE','string':'Remove'});case'AI_CHAT_HISTORY_REMOVE_CONFIRM':return t({'id':'AI_CHAT_HISTORY_REMOVE_CONFIRM','string':'Do\x20you\x20want\x20to\x20remove\x20this\x20chat?'});case'AI_CHAT_HISTORY_ACCEPT':return t({'id':'AI_CHAT_HISTORY_ACCEPT','string':'Accept'});case'AI_CHAT_HISTORY_CANCEL':return t({'id':'AI_CHAT_HISTORY_CANCEL','string':'Cancel'});case'AI_CHAT_HISTORY_LOADING_REMOVING':return t({'id':'AI_CHAT_HISTORY_LOADING_REMOVING','string':'Removing\x20the\x20chat...'});case'AI_CHAT_HISTORY_LOADING_RENAMING':return t({'id':'AI_CHAT_HISTORY_LOADING_RENAMING','string':'Renaming\x20the\x20chat...'});case'AI_CHAT_HISTORY_LOADING_PINNING':return t({'id':'AI_CHAT_HISTORY_LOADING_PINNING','string':'Pinning\x20the\x20chat...'});case'AI_CHAT_HISTORY_LOADING_UNPINNING':return t({'id':'AI_CHAT_HISTORY_LOADING_UNPINNING','string':'Unpinning\x20the\x20chat...'});case'AI_CHAT_HISTORY_CATEGORY_PINNED':return t({'id':'AI_CHAT_HISTORY_CATEGORY_PINNED','string':'Pinned'});case'AI_CHAT_HISTORY_CATEGORY_TODAY':return t({'id':'AI_CHAT_HISTORY_CATEGORY_TODAY','string':'Today'});case'AI_CHAT_HISTORY_CATEGORY_YESTERDAY':return t({'id':'AI_CHAT_HISTORY_CATEGORY_YESTERDAY','string':'Yesterday'});case'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS':return t({'id':'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS','string':'Last\x2014\x20days'});case'AI_CHAT_HISTORY_CATEGORY_LATER':return t({'id':'AI_CHAT_HISTORY_CATEGORY_LATER','string':'Later'});case'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE':return t({'id':'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE','string':'Failed\x20to\x20change\x20the\x20\x22%0\x22\x20chat\x20name.\x20Please\x20try\x20again\x20later.'},_0x10bb2c);case'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED':return t({'id':'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED','string':'Failed\x20to\x20%0\x20the\x20\x22%1\x22\x20chat.\x20Please\x20try\x20again\x20later.'},_0x10bb2c);case'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM':return t({'id':'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM','string':'Failed\x20to\x20delete\x20the\x20\x22%0\x22\x20chat.\x20Please\x20try\x20again\x20later.'},_0x10bb2c);case'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS':return t({'id':'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS','string':'Failed\x20to\x20load\x20the\x20chat\x20history.\x20Please\x20try\x20again\x20later.'});case'AI_CHAT_HISTORY_ERROR_GENERIC':return t({'id':'AI_CHAT_HISTORY_ERROR_GENERIC','string':'Something\x20went\x20wrong.\x20Please\x20try\x20again\x20later.'});case'AI_CHAT_HISTORY_PIN_ACTION':return t({'id':'AI_CHAT_HISTORY_PIN_ACTION','string':'pin'});case'AI_CHAT_HISTORY_UNPIN_ACTION':return t({'id':'AI_CHAT_HISTORY_UNPIN_ACTION','string':'unpin'});case'AI_BALLOON_HEADER_TITLE':return t({'id':'AI_BALLOON_HEADER_TITLE','string':'Change\x20%0'},_0x10bb2c);case'AI_BALLOON_APPLY_BUTTON':return t({'id':'AI_BALLOON_APPLY_BUTTON','string':'Apply'});case'AI_BALLOON_SUGGEST_BUTTON':return t({'id':'AI_BALLOON_SUGGEST_BUTTON','string':'Suggest'});case'AI_BALLOON_NEXT_LABEL':return t({'id':'AI_BALLOON_NEXT_LABEL','string':'Next'});case'AI_BALLOON_PREVIOUS_LABEL':return t({'id':'AI_BALLOON_PREVIOUS_LABEL','string':'Previous'});case'AI_SUGGESTION_NO_PARTS_WARNING':return t({'id':'AI_SUGGESTION_NO_PARTS_WARNING','string':'This\x20change\x20is\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20of\x20the\x20changes\x20are\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Retry'});case'AI_ACTIONS_PREVIOUS_INTERACTION':return t({'id':'AI_ACTIONS_PREVIOUS_INTERACTION','string':'Previous'});case'AI_ACTIONS_NEXT_INTERACTION':return t({'id':'AI_ACTIONS_NEXT_INTERACTION','string':'Next'});case'AI_MODEL_NAME_AUTO':return t({'id':'AI_MODEL_NAME_AUTO','string':'Auto'});case'AI_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});case'AI_QUICK_ACTIONS_SEARCH':return t({'id':'AI_QUICK_ACTIONS_SEARCH','string':'Search\x20AI\x20commands'});case'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND','string':'No\x20AI\x20commands\x20found'});case'AI_QUICK_ACTIONS_ASK_AI':return t({'id':'AI_QUICK_ACTIONS_ASK_AI','string':'Ask\x20AI'});case'AI_QUICK_ACTIONS_CHAT_COMMANDS':return t({'id':'AI_QUICK_ACTIONS_CHAT_COMMANDS','string':'Chat\x20commands'});case'AI_QUICK_ACTIONS_IMPROVE_WRITING':return t({'id':'AI_QUICK_ACTIONS_IMPROVE_WRITING','string':'Improve\x20writing'});case'AI_QUICK_ACTIONS_CONTINUE_WRITING':return t({'id':'AI_QUICK_ACTIONS_CONTINUE_WRITING','string':'Continue\x20writing'});case'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING':return t({'id':'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING','string':'Fix\x20grammar\x20&\x20spelling'});case'AI_QUICK_ACTIONS_ADJUST_LENGTH':return t({'id':'AI_QUICK_ACTIONS_ADJUST_LENGTH','string':'Adjust\x20length'});case'AI_QUICK_ACTIONS_CHANGE_TONE':return t({'id':'AI_QUICK_ACTIONS_CHANGE_TONE','string':'Change\x20tone'});case'AI_QUICK_ACTIONS_TRANSLATE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE','string':'Translate'});case'AI_QUICK_ACTIONS_EXPLAIN':return t({'id':'AI_QUICK_ACTIONS_EXPLAIN','string':'Explain'});case'AI_QUICK_ACTIONS_SUMMARIZE':return t({'id':'AI_QUICK_ACTIONS_SUMMARIZE','string':'Summarize'});case'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS':return t({'id':'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS','string':'Highlight\x20key\x20points'});case'AI_QUICK_ACTIONS_MAKE_SHORTER':return t({'id':'AI_QUICK_ACTIONS_MAKE_SHORTER','string':'Make\x20shorter'});case'AI_QUICK_ACTIONS_MAKE_LONGER':return t({'id':'AI_QUICK_ACTIONS_MAKE_LONGER','string':'Make\x20longer'});case'AI_QUICK_ACTIONS_MORE_CASUAL':return t({'id':'AI_QUICK_ACTIONS_MORE_CASUAL','string':'More\x20casual'});case'AI_QUICK_ACTIONS_MORE_DIRECT':return t({'id':'AI_QUICK_ACTIONS_MORE_DIRECT','string':'More\x20direct'});case'AI_QUICK_ACTIONS_MORE_FRIENDLY':return t({'id':'AI_QUICK_ACTIONS_MORE_FRIENDLY','string':'More\x20friendly'});case'AI_QUICK_ACTIONS_MORE_CONFIDENT':return t({'id':'AI_QUICK_ACTIONS_MORE_CONFIDENT','string':'More\x20confident'});case'AI_QUICK_ACTIONS_MORE_PROFESSIONAL':return t({'id':'AI_QUICK_ACTIONS_MORE_PROFESSIONAL','string':'More\x20professional'});case'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT':return t({'id':'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT','string':'Adjust\x20based\x20on\x20the\x20rest\x20of\x20the\x20document'});case'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH','string':'English'});case'AI_QUICK_ACTIONS_TRANSLATE_CHINESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_QUICK_ACTIONS_TRANSLATE_FRENCH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_FRENCH','string':'French'});case'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE','string':'Japanese'});case'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE','string':'Portuguese'});case'AI_QUICK_ACTIONS_TRANSLATE_KOREAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_KOREAN','string':'Korean'});case'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN','string':'Italian'});case'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN','string':'Russian'});case'AI_QUICK_ACTIONS_TRANSLATE_SPANISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_SPANISH','string':'Spanish'});case'AI_QUICK_ACTIONS_TRANSLATE_GERMAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_GERMAN','string':'German'});case'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','string':'%0\x20plugin\x20is\x20required\x20but\x20not\x20found.'},_0x10bb2c);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});case'AI_ACTIONS_GENERIC_ERROR':return t({'id':'AI_ACTIONS_GENERIC_ERROR','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20response.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_BALLOON_SELECTION_REMOVED_ERROR':return t({'id':'AI_BALLOON_SELECTION_REMOVED_ERROR','string':'Changes\x20cannot\x20be\x20applied.\x20The\x20original\x20content\x20no\x20longer\x20exists.'});case'AI_REVIEW_MODE_STOP_GENERATING':return t({'id':'AI_REVIEW_MODE_STOP_GENERATING','string':'Stop\x20generating'});case'AI_REVIEW_MODE_HIDE_CHANGES':return t({'id':'AI_REVIEW_MODE_HIDE_CHANGES','string':'Hide\x20changes'});case'AI_REVIEW_MODE_SHOW_CHANGES':return t({'id':'AI_REVIEW_MODE_SHOW_CHANGES','string':'Show\x20changes'});case'AI_REVIEW_MODE_ACCEPT_ALL':return t({'id':'AI_REVIEW_MODE_ACCEPT_ALL','string':'Accept\x20all'});case'AI_REVIEW_MODE_EXIT_REVIEW':return t({'id':'AI_REVIEW_MODE_EXIT_REVIEW','string':'Exit\x20review'});case'AI_REVIEW_MODE_ACCEPT_CHANGE':return t({'id':'AI_REVIEW_MODE_ACCEPT_CHANGE','string':'Accept'});case'AI_REVIEW_MODE_DISMISS_CHANGE':return t({'id':'AI_REVIEW_MODE_DISMISS_CHANGE','string':'Dismiss'});case'AI_REVIEW_MODE_LEARN_MORE':return t({'id':'AI_REVIEW_MODE_LEARN_MORE','string':'Learn\x20more'});case'AI_REVIEW_MODE_COMPLETED_TEXT':return t({'id':'AI_REVIEW_MODE_COMPLETED_TEXT','string':'There\x27s\x20nothing\x20left\x20to\x20review.'});case'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT':return t({'id':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20changes\x20to\x20suggest.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE':return t({'id':'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE','string':'AI\x20Review\x20initialized\x20with\x20errors.\x20Some\x20features\x20may\x20not\x20be\x20available\x20or\x20work\x20properly.'});case'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20whole\x20review\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE','string':'Not\x20everything\x20went\x20through,\x20but\x20the\x20completed\x20items\x20are\x20listed\x20below.'});case'AI_REVIEW_MODE':return t({'id':'AI_REVIEW_MODE','string':'Review'});case'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR':return t({'id':'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR','string':'Prompt\x20must\x20not\x20be\x20empty'});case'AI_REVIEW_CHECK_CUSTOM_TITLE':return t({'id':'AI_REVIEW_CHECK_CUSTOM_TITLE','string':'Custom\x20command'});case'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION','string':'Enter\x20a\x20custom\x20command\x20for\x20a\x20specific\x20review.'});case'AI_REVIEW_CHECK_CORRECTNESS_TITLE':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_TITLE','string':'Proofread'});case'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION','string':'Check\x20the\x20text\x20for\x20errors\x20in\x20grammar,\x20spelling,\x20and\x20punctuation.'});case'AI_REVIEW_CHECK_CLARITY_TITLE':return t({'id':'AI_REVIEW_CHECK_CLARITY_TITLE','string':'Improve\x20clarity'});case'AI_REVIEW_CHECK_CLARITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CLARITY_DESCRIPTION','string':'Improve\x20the\x20logical\x20structure\x20and\x20precision\x20for\x20clearer\x20message.'});case'AI_REVIEW_CHECK_READABILITY_TITLE':return t({'id':'AI_REVIEW_CHECK_READABILITY_TITLE','string':'Improve\x20readability'});case'AI_REVIEW_CHECK_READABILITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_READABILITY_DESCRIPTION','string':'Adjust\x20sentence\x20structure\x20and\x20word\x20choice\x20for\x20an\x20easier\x20read.'});case'AI_REVIEW_CHECK_MAKE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TITLE','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_DESCRIPTION','string':'Shorten\x20or\x20lengthen\x20the\x20text\x20as\x20needed.'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER','string':'Longer'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER','string':'Shorter'});case'AI_REVIEW_CHECK_MAKE_TONE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_TITLE','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION','string':'Modify\x20the\x20text\x20to\x20a\x20desired\x20tone\x20and\x20style.'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL','string':'Casual'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT','string':'Direct'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY','string':'Friendly'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT','string':'Confident'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL','string':'Professional'});case'AI_REVIEW_CHECK_TRANSLATE_TITLE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_TITLE','string':'Translate'});case'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION','string':'Translate\x20the\x20text\x20into\x20another\x20language.'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL','string':'Select\x20language'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH','string':'English'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH','string':'Spanish'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH','string':'French'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN','string':'German'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE','string':'Japanese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN','string':'Russian'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE','string':'Portuguese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN','string':'Korean'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN','string':'Italian'});case'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED','string':'Accepted'});case'AI_REVIEW_MODE_CHECK_STATUS_REJECTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_REJECTED','string':'Dismissed'});case'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED','string':'Outdated'});case'AI_TOGGLE_BUTTON_LABEL':return t({'id':'AI_TOGGLE_BUTTON_LABEL','string':'AI'});case'AI_TRANSLATE_ACCEPT_ALL':return t({'id':'AI_TRANSLATE_ACCEPT_ALL','string':'Accept\x20translation'});case'AI_TRANSLATE_FINISH_HEADER_TITLE':return t({'id':'AI_TRANSLATE_FINISH_HEADER_TITLE','string':'Translation\x20complete.\x20Finish\x20when\x20ready.'});case'AI_TRANSLATE_EMPTY_RESULTS_TEXT':return t({'id':'AI_TRANSLATE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20translations\x20to\x20review.'});case'AI_TRANSLATE_FINISH_BUTTON_LABEL':return t({'id':'AI_TRANSLATE_FINISH_BUTTON_LABEL','string':'Finish\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE','string':'Content\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION','string':'A\x20dedicated\x20mode\x20for\x20translating\x20the\x20entire\x20text.'});case'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE','string':'Translating\x20to'});case'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE','string':'Translated\x20to'});case'AI_TRANSLATE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_TRANSLATE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20translations\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE','string':'This\x20conversation\x20is\x20loaded\x20from\x20chat\x20history\x20from\x20a\x20previous\x20session,\x20so\x20you\x20can’t\x20apply,\x20reject,\x20or\x20suggest\x20changes.'});case'AI_SUGGESTION_DISABLED_FEED_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_FEED_MESSAGE','string':'Actions\x20aren’t\x20available\x20for\x20changes\x20from\x20a\x20previous\x20session.'});default:return _0x30f31b;}}function Ri(_0x4f363c,_0x49aea5){const _0x4d2288=new _0x5bfd84(_0x4f363c),_0x6ed15b=i(_0x4f363c,'AI_TABS_LABEL_MINIMIZE'),_0x25bbfe=i(_0x4f363c,'AI_TABS_LABEL_MAXIMIZE');return _0x4d2288['set']({'withText':!0x1,'icon':_0x5521e7,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary'}),_0x4d2288['bind']('label')['to'](_0x49aea5,'isMaximized',_0x5eda04=>_0x5eda04?_0x6ed15b:_0x25bbfe),_0x4d2288['bind']('icon')['to'](_0x49aea5,'isMaximized',_0x2166ee=>_0x2166ee?_0x5bfc92:_0x5521e7),_0x4d2288['bind']('isOn')['to'](_0x49aea5,'isMaximized'),_0x4d2288['on']('execute',()=>{_0x49aea5['fire']('resizeTabs');}),_0x4d2288;}function Ni(_0x560268){return _0x4a7826(_0x560268);}function Dt(_0x3b3736){return _0x3688ac(_0x3b3736);}function bt(_0xe13cb5,_0x47a9ef,_0x56906b){const _0x38c211=null!==_0x47a9ef?_0x2a0052=>_0x2a0052['attribs'][_0xe13cb5]===_0x47a9ef:_0x8a299d=>Boolean(_0x8a299d['attribs'][_0xe13cb5]);return xt(_0x3d05a1=>_0x512964(_0x3d05a1)&&_0x38c211(_0x3d05a1),_0x56906b);}function Ji(_0x377a1f,_0x400d49,_0x582dfc){const _0x2ef168=null!==_0x400d49?_0xe4b4a=>_0xe4b4a['attribs'][_0x377a1f]===_0x400d49:_0x2af562=>Boolean(_0x2af562['attribs'][_0x377a1f]);return _0x5269a1(_0x36afa9=>_0x512964(_0x36afa9)&&_0x2ef168(_0x36afa9),_0x582dfc);}function Ot(_0x476018,_0xd1e093){return _0x476018&&_0x512964(_0x476018)?_0x476018['attribs'][_0xd1e093]:null;}function Ns(_0x847689,_0x524895,_0x4aa68d){_0x512964(_0x847689)&&(null===_0x4aa68d?delete _0x847689['attribs'][_0x524895]:_0x847689['attribs'][_0x524895]=_0x4aa68d);}function Xi(_0x551b2d,_0xd1c481,_0xf138cf){const _0x446fcc=_0xd1c481['cloneNode'](!0x0);'beforebegin'===_0xf138cf?_0x11de48(_0x551b2d,_0x446fcc):'afterbegin'===_0xf138cf?_0x52afa8(_0x551b2d,_0x446fcc):'beforeend'===_0xf138cf?_0xce27f2(_0x551b2d,_0x446fcc):'afterend'===_0xf138cf&&_0x59a323(_0x551b2d,_0x446fcc);}function Pi(_0x4c1ff0){const _0x1957aa=[];let _0xeebec2=_0x4c1ff0;for(;_0xeebec2;)_0xeebec2=_0x4b34c6(_0xeebec2),_0xeebec2&&_0x1957aa['push'](_0xeebec2);return _0x1957aa;}function zn(_0x635218){return _0x635218['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Ds(_0x5bb4f0){let _0x28b48c=0x0;for(;_0x5bb4f0['parentNode'];)_0x5bb4f0=_0x5bb4f0['parentNode'],_0x28b48c++;return _0x28b48c;}function Ss(_0x1cb2ec){const _0x352dea=[];let _0x5c21a5=_0x1cb2ec['nextSibling'];for(;_0x5c21a5;)_0x352dea['push'](_0x5c21a5),_0x5c21a5=_0x5c21a5['nextSibling'];_0x352dea['forEach'](_0x564f10=>{_0xb8c25a(_0x564f10);});}class Wi extends/* #__PURE__ -- @preserve */
25
+ ts(){['_m2html'];constructor(){super(),this['_m2html']=new _0x33c75d();}['convertMarkdownToHTML'](_0x7da885){const _0x39e855=this['_m2html']['parse'](_0x7da885);return this['parseAndNormalizeHTML'](_0x39e855);}['parseAndNormalizeHTML'](_0x7feecf){return this['_parseHTML'](_0x7feecf);}['_parseHTML'](_0x2df0b7){const _0x1b8087=Ni('<dummy>'+_0x2df0b7['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x1b8087['children']=_0x1b8087['children'][0x0]['children'],_0x1b8087;}}class qi extends/* #__PURE__ -- @preserve */
26
+ ts(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0xa0886f){super(),this['_generateUid']=_0xa0886f||_0x2e2dc8;}['merge'](_0x5d7fb4,_0x78bc7a,_0x56b85a){const _0x12125c=_0x5d7fb4['cloneNode'](!0x0);if(0x0===_0x78bc7a['childNodes']['length']){const _0x4995f1=[];return Ji('data-id','new-element',_0x12125c)['forEach'](_0x3b74bd=>{const _0x460954=this['_generateUid']();Ns(_0x3b74bd,'data-id',_0x460954),_0x4995f1['push'](_0x460954);}),this['_removeSpecialComments'](_0x12125c),{'parsedContent':_0x12125c,'newNodeIds':_0x4995f1,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x56b85a&&_0x56b85a['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x12125c),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Ji('data-id',null,_0x78bc7a)['map'](_0x203dbc=>Ot(_0x203dbc,'data-id'))['filter'](_0x5f0588=>!!_0x5f0588));let _0x1d6db9=-0x1,_0x44f693=!0x1;const _0x53841e=_0x12125c['childNodes'],_0x10399e=Array['from'](_0x53841e)['filter'](_0x59fe81=>!(0x3===_0x59fe81['nodeType']&&''===Dt(_0x59fe81)['trim']())),_0x1ad534=_0x10399e['length'];for(let _0x57134c=0x0;_0x57134c<_0x1ad534;_0x57134c++){const _0x326ed5=_0x10399e[_0x57134c],_0x3bdef3=_0x10399e[_0x57134c+0x1];if(this['_isNewNode'](_0x326ed5)){if(-0x1===_0x1d6db9&&(_0x1d6db9=_0x57134c),this['_markWrappedElements'](_0x326ed5),!this['_isNewNode'](_0x3bdef3)){const [_0x3919b9,_0x77fc86]=this['_findReferenceNode'](_0x326ed5,_0x44f693,_0x78bc7a);if(_0x3919b9){const _0x1dce24=Array['from'](_0x10399e)['slice'](_0x1d6db9,_0x57134c+0x1);this['_insertNodes'](_0x3919b9,_0x1dce24,_0x77fc86),_0x1d6db9=-0x1;}}}else{if(this['_isExistingContentComment'](_0x326ed5))_0x44f693=!0x0;else{if(this['_isExistingNode'](_0x326ed5)){const _0x46d52d=Ot(_0x326ed5,'data-id');if(_0x46d52d&&this['_existingDataIds']['has'](_0x46d52d)){const _0x3b5182=bt('data-id',_0x46d52d,_0x78bc7a);this['_replaceNode'](_0x3b5182,_0x326ed5);}if(this['_touchedNodesState']['removedIds']['includes'](_0x46d52d)){const _0x493841=this['_touchedNodesState']['removedIds']['indexOf'](_0x46d52d);this['_touchedNodesState']['removedIds']['splice'](_0x493841,0x1);}}else{if(this['_isDelNode'](_0x326ed5)){const _0x46986a=Ot(_0x326ed5,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x46986a)||this['_storeDeletedElementIds'](_0x326ed5);}}}}}for(const _0x5ca526 of this['_touchedNodesState']['removedIds']){const _0x54d289=bt('data-id',_0x5ca526,_0x78bc7a);if(_0x54d289){if(_0x56b85a&&_0x56b85a['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x5ca526;const _0x4a87ac=_0x56b85a['replaceRemovedWith']['cloneNode'](!0x0);Ns(_0x4a87ac,'data-id',_0x5ca526),Ns(_0x4a87ac,'data-removed','true'),_0x390c69(_0x54d289,_0x4a87ac);}else _0xb8c25a(_0x54d289);}}if(Ji('data-wrapped-id',null,_0x78bc7a)['forEach'](_0x4771d9=>{const _0x5ca2d7=bt('data-id',Ot(_0x4771d9,'data-wrapped-id'),_0x78bc7a);var _0x45ac48,_0x289142;_0x5ca2d7&&(_0x289142=_0x4771d9,_0xb8c25a(_0x45ac48=_0x5ca2d7),_0x390c69(_0x289142,_0x45ac48));}),Ji('data-id','new-element',_0x78bc7a)['forEach'](_0x1eb6ae=>{const _0x27a263=this['_getUid'](_0x1eb6ae);Ns(_0x1eb6ae,'data-id',_0x27a263),this['_touchedNodesState']['newIds']['push'](_0x27a263);}),this['_removeSpecialComments'](_0x78bc7a),_0x56b85a&&_0x56b85a['markUnstableElements']&&this['_markUnstableElements'](_0x78bc7a,_0x56b85a['markUnstableElementsDepth']||0x0),_0x56b85a&&_0x56b85a['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x2630c6=bt('data-id',this['_touchedNodesState']['lastTouchedId'],_0x78bc7a);for(;_0x2630c6;)Ss(_0x2630c6),_0x2630c6=_0x2630c6['parentNode'];}return{'parsedContent':_0x78bc7a,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x23c270,_0x44d601,_0x4d3c81){for(const _0x207203 of _0x44d601){const _0x495b9a=this['_getUid'](_0x207203);Ns(_0x207203,'data-id',_0x495b9a),this['_touchedNodesState']['newIds']['push'](_0x495b9a),this['_touchedNodesState']['lastTouchedId']=_0x495b9a;}const _0x4c7263='afterbegin'===_0x4d3c81||'afterend'===_0x4d3c81?_0x44d601['reverse']():_0x44d601;for(const _0x4407cb of _0x4c7263)Xi(_0x23c270,_0x4407cb,_0x4d3c81);}['_replaceNode'](_0x3bc066,_0x359a91){if(!_0x3bc066)return;if(_0x65883a=_0x359a91,zn(Dt(_0x3bc066))===zn(Dt(_0x65883a)))return;var _0x65883a;const _0x14a679=this['_getUid'](_0x3bc066);Ns(_0x359a91,'data-id',_0x14a679),this['_touchedNodesState']['modifiedIds']['push'](_0x14a679),this['_touchedNodesState']['lastTouchedId']=_0x14a679,_0x390c69(_0x3bc066,_0x359a91['cloneNode'](!0x0));}['_findReferenceNode'](_0x58e731,_0x128aee,_0x479aa5){const _0x1a6516=this['_findPrevElementWithDataId'](_0x58e731,!0x1);if(_0x1a6516){const _0x17e200=this['_getNodeDataId'](_0x1a6516),_0x19b6b1=bt('data-id',_0x17e200,_0x479aa5);if(_0x19b6b1)return[_0x19b6b1,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x17e200);}const _0x4633b9=this['_findNextElementWithDataId'](_0x58e731,!0x1);if(_0x4633b9){const _0xd5e72a=this['_getNodeDataId'](_0x4633b9),_0x52e2d4=bt('data-id',_0xd5e72a,_0x479aa5);if(_0x52e2d4)return[_0x52e2d4,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0xd5e72a);}return _0x128aee?_0x58e731['nextSibling']?this['_findFallbackReferenceNode'](_0x58e731,_0x479aa5):[_0x479aa5['childNodes'][_0x479aa5['childNodes']['length']-0x1],'afterend']:[_0x479aa5['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x38c25a,_0x151785){const _0x896109=[],_0x5062f2=this['_findPrevElementWithDataId'](_0x38c25a,!0x0);if(_0x5062f2){const _0x370c62=bt('data-id',this['_getNodeDataId'](_0x5062f2),_0x151785);_0x370c62&&_0x896109['push']([_0x370c62,'afterend']);}const _0x179b95=this['_findNextElementWithDataId'](_0x38c25a,!0x0);if(_0x179b95){const _0x200030=bt('data-id',this['_getNodeDataId'](_0x179b95),_0x151785);_0x200030&&_0x896109['push']([_0x200030,'beforebegin']);}if(_0x896109['length']>0x1)return Ds(_0x896109[0x0][0x0])<=Ds(_0x896109[0x1][0x0])?_0x896109[0x0]:_0x896109[0x1];return 0x1===_0x896109['length']?_0x896109[0x0]:[_0x151785['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x42e5f0,_0x32c29f){let _0x4acc0e=_0x42e5f0['nextSibling'],_0x35fd37=null,_0x458424=!0x1;for(;_0x4acc0e;){if(_0x434d7d(_0x4acc0e)){if(this['_isDelNode'](_0x4acc0e)&&(_0x35fd37=_0x4acc0e),this['_isExistingContentComment'](_0x4acc0e)&&_0x32c29f&&!_0x458424){_0x458424=!0x0,_0x4acc0e=_0x4acc0e['nextSibling'];continue;}break;}const _0x28044b=Ot(_0x4acc0e,'data-id');if(_0x28044b&&'new-element'!==_0x28044b&&this['_existingDataIds']['has'](_0x28044b)){_0x35fd37=_0x4acc0e;break;}_0x4acc0e=_0x4acc0e['nextSibling'];}return _0x35fd37;}['_findPrevElementWithDataId'](_0x3dba07,_0x18b9f1){let _0x1ed987=_0x3dba07['previousSibling'],_0x25117d=null,_0x7b5c16=!0x1;for(;_0x1ed987;){if(_0x434d7d(_0x1ed987)){if(this['_isDelNode'](_0x1ed987)&&(_0x25117d=_0x1ed987),this['_isExistingContentComment'](_0x1ed987)&&_0x18b9f1&&!_0x7b5c16){_0x7b5c16=!0x0,_0x1ed987=_0x1ed987['previousSibling'];continue;}break;}const _0x3ea83b=Ot(_0x1ed987,'data-id');if(_0x3ea83b&&'new-element'!==_0x3ea83b&&this['_existingDataIds']['has'](_0x3ea83b)){_0x25117d=_0x1ed987;break;}_0x1ed987=_0x1ed987['previousSibling'];}return _0x25117d;}['_markWrappedElements'](_0x5ac3bf){_0x512964(_0x5ac3bf)&&Ji('data-id',null,_0x5ac3bf)['forEach'](_0x2e63b6=>{this['_isExistingNode'](_0x2e63b6)&&!this['_hasWrappedParent'](_0x2e63b6)&&(Ns(_0x2e63b6,'data-wrapped-id',Ot(_0x2e63b6,'data-id')),Ns(_0x2e63b6,'data-id',null));});}['_getNodeDataId'](_0x2c818a){if(!_0x2c818a)return null;if(_0x512964(_0x2c818a))return Ot(_0x2c818a,'data-id');if(_0x434d7d(_0x2c818a)){const _0x34c858=Dt(_0x2c818a)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x34c858&&_0x34c858[0x1])return _0x34c858[0x1];}return null;}['_storeDeletedElementIds'](_0x25442b){if(_0x434d7d(_0x25442b)){const _0x1707a3=Dt(_0x25442b)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x1707a3&&_0x1707a3[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x1707a3[0x1]);}}['_getUid'](_0x4e3a41){return this['_isExistingNode'](_0x4e3a41)?Ot(_0x4e3a41,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x3e7a43){(function(_0x5a517f){return _0x3dc1d7(_0x2ee923=>_0x434d7d(_0x2ee923),_0x5a517f,!0x0,0x1/0x0);}(_0x3e7a43)['filter'](_0x37d884=>this['_isDelNode'](_0x37d884)||this['_isExistingContentComment'](_0x37d884))['forEach'](_0x413c73=>{_0xb8c25a(_0x413c73);}));}['_markLastTagElementUnstable'](_0x285cb1){const _0x56f4a8=_0x285cb1['childNodes'],_0x501385=_0x56f4a8[_0x56f4a8['length']-0x1];_0x501385&&_0x512964(_0x501385)&&Ns(_0x501385,'data-unstable','true');}['_markUnstableElements'](_0x2777b9,_0x412115){const _0xc4d06c=bt('data-unstable','true',_0x2777b9);if(!_0xc4d06c)return;const _0x4729a3=Pi(_0xc4d06c)['slice'](0x0,-0x1),_0x7af62b=_0x4729a3['length'];let _0x337980=_0xc4d06c;if(_0x7af62b>_0x412115){let _0x3d0193=_0x7af62b,_0x38061b=null;for(;_0x3d0193>_0x412115&&_0x3d0193>=0x0;)_0x3d0193--,_0x38061b=_0x4729a3[_0x3d0193];_0x38061b&&(_0x337980=_0x38061b,Ns(_0xc4d06c,'data-unstable',null),Ns(_0x38061b,'data-unstable','true'));}else{if(_0x7af62b<_0x412115){let _0x3ad7ee=_0x7af62b,_0xc39050=_0xc4d06c;for(;_0x3ad7ee<_0x412115;){const _0x3d348e=_0xc39050['childNodes']['filter'](_0x4d4a06=>_0x512964(_0x4d4a06));if(0x0===_0x3d348e['length'])break;_0x3ad7ee++,_0xc39050=_0x3d348e[_0x3d348e['length']-0x1];}_0xc39050&&(_0x337980=_0xc39050,Ns(_0xc4d06c,'data-unstable',null),Ns(_0xc39050,'data-unstable','true'));}}let _0x11c95d=_0x337980;for(;_0x11c95d;){for(;_0x11c95d['nextSibling'];)_0x11c95d=_0x11c95d['nextSibling'],_0x512964(_0x11c95d)&&Ns(_0x11c95d,'data-unstable','true');_0x11c95d=_0x11c95d['parentNode'];}}['_isNewNode'](_0xd80554){return Boolean('new-element'===Ot(_0xd80554,'data-id'));}['_isExistingNode'](_0x445f94){return Boolean((Ot(_0x445f94,'data-id')||'')['length']>0x0&&'new-element'!==Ot(_0x445f94,'data-id'));}['_isDelNode'](_0x540cc3){return!!_0x540cc3&&Boolean(_0x434d7d(_0x540cc3)&&Dt(_0x540cc3)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x460f93){let _0x15aeee=_0x460f93['parentNode'];for(;_0x15aeee;){if(Ot(_0x15aeee,'data-wrapped-id'))return!0x0;_0x15aeee=_0x15aeee['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x893692){return Boolean(_0x434d7d(_0x893692)&&Dt(_0x893692)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function q({editor:_0x1bf8f6,changeGroups:_0x275565,documentContextContent:_0x195d91,showDiff:_0xf15e1d,trimUnchanged:_0x5a55f0=!0x0}){return _0x275565['map'](_0x296ebe=>{const _0x2d1856=new Rt([]),_0x2ef9cf=new Rt([]);for(const _0x4bdcc7 of _0x296ebe['changes'])if(_0xf15e1d&&'removed'==_0x4bdcc7['type']||_0x2ef9cf['children']['push'](_0x4bdcc7['node']['cloneNode'](!0x0)),'new'!=_0x4bdcc7['type']&&(_0xf15e1d||'removed'!=_0x4bdcc7['type'])){const _0x2ff1c8=xt(_0x1e8457=>Ot(_0x1e8457,'data-id')==_0x4bdcc7['id'],_0x195d91,!0x0);_0x2ff1c8&&_0x2d1856['children']['push'](_0x2ff1c8['cloneNode'](!0x0));}const {content:_0x9840b9,hasChanges:_0x56e2e8}=function(_0x5d8c8e,_0x56aeaf,_0x3b6cd3,_0xa1ad40,_0x276807=!0x0){const _0x412983=_0x5d8c8e['plugins']['get']('DocumentCompare'),_0x2ff099=Dt(_0x56aeaf),_0x426d08=Dt(_0x3b6cd3),_0x4f6f52=_0x5d8c8e['data']['parse'](_0x2ff099,'$root'),_0x22d21b=_0x5d8c8e['model']['createPositionAt'](_0x4f6f52,0x0),_0x483468=_0x412983['getDiff'](_0x2ff099,_0x426d08,{'anchor':_0x22d21b,'markDeletions':_0xa1ad40}),_0x208396=_0x483468['getOperations']();if(0x0==_0x208396['length'])return{'content':_0x56aeaf['cloneNode'](!0x0),'hasChanges':!0x1};_0xa1ad40?function(_0x240a76,_0x5bcb6f,_0xe0c508){if(0x0==_0x240a76['length'])return;const _0x1dafbf=_0xe0c508['plugins']['get']('DocumentCompare'),_0x58a71f=_0xe0c508['plugins']['get']('SuggestionsConversion');_0xe0c508['model']['change'](_0x5e9e66=>{const _0x5b026b=new Set();for(let _0x129940=0x0;_0x129940<_0x240a76['length'];_0x129940++){const _0x3ab487=_0x240a76[_0x129940];if(_0x3ab487['baseVersion']=null,_0x3ab487['isDocumentOperation']=!0x1,_0x1dafbf['isMarkedRemoveOperation'](_0x3ab487)){const _0x269d29=_0xf7c114(_0x3ab487['newRange'],_0xe0c508['model']),_0x3b7615='suggestion:deletion:'+_0x2e2dc8()+':$aiSuggestion';_0x5bcb6f['markers']['set'](_0x3b7615,_0x269d29);}else switch(_0x3ab487['type']){case'rename':{if(_0x3ab487['oldName']==_0x3ab487['newName'])break;_0x5e9e66['batch']['addOperation'](_0x3ab487),_0xe0c508['model']['applyOperation'](_0x3ab487);const _0x40bf30='$elementName',_0x10476c=_0x3ab487['position'],_0xcd8600=_0xe0c508['model']['createRange'](_0x10476c,_0xe0c508['model']['createPositionAt'](_0x10476c['nodeAfter'],'end')),_0x4b5006='suggestion:attribute:'+_0x40bf30+':'+_0x2e2dc8()+':$aiSuggestion';_0x5bcb6f['markers']['set'](_0x4b5006,_0xcd8600);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x3ab487['oldValue']==_0x3ab487['newValue'])break;_0x5e9e66['batch']['addOperation'](_0x3ab487),_0xe0c508['model']['applyOperation'](_0x3ab487);const _0x4f5c84=_0x3ab487['key'];if(!_0x58a71f['isRegisteredAttribute'](_0x4f5c84))break;const _0x31e691=_0xf7c114(_0x3ab487['range'],_0xe0c508['model']),_0x3ead00='suggestion:attribute:'+_0x4f5c84+':'+_0x2e2dc8()+':$aiSuggestion';_0x5bcb6f['markers']['set'](_0x3ead00,_0x31e691);break;}case'insert':{_0x5e9e66['batch']['addOperation'](_0x3ab487),_0xe0c508['model']['applyOperation'](_0x3ab487);if(_0x240a76[_0x129940+0x1]&&'move'==_0x240a76[_0x129940+0x1]['type']){no(_0x5bcb6f,_0x3ab487);break;}const _0x515daf=_0x3ab487['position'],_0x3341aa=_0x3ab487['howMany'],_0x112e30=_0xf7c114(_0xe0c508['model']['createRange'](_0x515daf,_0x515daf['getShiftedBy'](_0x3341aa)),_0xe0c508['model']),_0x12cb01='suggestion:insertion:'+_0x2e2dc8()+':$aiSuggestion';_0x5bcb6f['markers']['set'](_0x12cb01,_0x112e30);break;}case'split':{_0x5e9e66['batch']['addOperation'](_0x3ab487),_0xe0c508['model']['applyOperation'](_0x3ab487);const _0x37b306=_0x3ab487['splitPosition'],_0x117de4=_0x3ab487['moveTargetPosition'],_0x2fad40=_0xe0c508['model']['createRange'](_0x37b306,_0x117de4),_0x4912a8='suggestion:insertion:'+_0x2e2dc8()+':$aiSuggestion';_0x5bcb6f['markers']['set'](_0x4912a8,_0x2fad40);break;}case'move':{_0x5e9e66['batch']['addOperation'](_0x3ab487),_0xe0c508['model']['applyOperation'](_0x3ab487),_0x240a76[_0x129940-0x1]&&'insert'==_0x240a76[_0x129940-0x1]['type']&&no(_0x5bcb6f,_0x3ab487);const _0x487418=_0x3ab487['getMovedRangeStart'](),_0x38e3ce=_0x3ab487['howMany'];for(let _0x48a1e5=0x0;_0x48a1e5<_0x38e3ce;_0x48a1e5++){const _0x19cfc4=_0x487418['getShiftedBy'](_0x48a1e5)['nodeAfter'];_0x5b026b['add'](_0x19cfc4);}break;}case'remove':{const _0x528b02=_0x3ab487['sourcePosition'],_0x2bae97=_0x3ab487['howMany'],_0x5de677=new _0x5de5b5(_0x528b02,_0x2bae97);_0x5e9e66['batch']['addOperation'](_0x5de677),_0xe0c508['model']['applyOperation'](_0x5de677);break;}}}for(const _0x343c90 of _0x5b026b){const _0x21ad05=_0xe0c508['model']['createRangeOn'](_0x343c90),_0x4ad6f8='suggestion:formatBlock:$fakeWrap:'+_0x2e2dc8()+':$aiSuggestion';_0x5bcb6f['markers']['set'](_0x4ad6f8,_0xf7c114(_0x21ad05,_0xe0c508['model']));}});}(_0x208396,_0x4f6f52,_0x5d8c8e):_0x5d8c8e['model']['change'](_0x3e7c2f=>{for(const _0x1afcd4 of _0x208396)if('remove'==_0x1afcd4['type']){const _0x1b141=_0x1afcd4['sourcePosition'],_0x44c71b=_0x1afcd4['howMany'],_0x20f448=new _0x5de5b5(_0x1b141,_0x44c71b);_0x3e7c2f['batch']['addOperation'](_0x20f448),_0x5d8c8e['model']['applyOperation'](_0x20f448);}else{if('marker'==_0x1afcd4['type']){const _0x4b82e5=_0x1afcd4['name'],_0x3daa9f=_0x1afcd4['newRange'];null!==_0x3daa9f?_0x4f6f52['markers']['set'](_0x4b82e5,_0x3daa9f):_0x4f6f52['markers']['delete'](_0x4b82e5);}else _0x1afcd4['baseVersion']=null,_0x1afcd4['isDocumentOperation']=!0x1,_0x3e7c2f['batch']['addOperation'](_0x1afcd4),_0x5d8c8e['model']['applyOperation'](_0x1afcd4);}});if(_0x276807){const _0xa608a0=vt(_0x5d8c8e,_0x208396,_0x4f6f52);St(_0x5d8c8e['model'],_0xa608a0),function(_0x4707cd,_0x10fb86){const _0x26985c=_0x10fb86['getFirstRange']()['start'];let _0x2b2bfd=_0x10fb86['getFirstRange']()['end'];const _0x5d1e25=_0x26985c['root'];(_0x2b2bfd['textNode']||_0x2b2bfd['nodeAfter']&&_0x2b2bfd['nodeAfter']['is']('$text'))&&(_0x1aa9ab(_0x2b2bfd,'...'),_0x2b2bfd=_0x2b2bfd['getShiftedBy'](0x3)),(_0x26985c['textNode']||_0x26985c['nodeBefore']&&_0x26985c['nodeBefore']['is']('$text'))&&(_0x1aa9ab(_0x26985c,'...'),function(_0x30e8c2,_0x36fd01,_0x4a0807){for(let [_0x3fbb41,_0x1b3a9d]of _0x30e8c2['markers']){const _0x36b5c3=_0x1b3a9d['_getTransformedByInsertion'](_0x36fd01,_0x4a0807,!0x1);_0x1b3a9d=_0x36b5c3[0x0],_0x30e8c2['markers']['set'](_0x3fbb41,_0x1b3a9d);}}(_0x5d1e25,_0x26985c,0x3),_0x26985c['parent']==_0x2b2bfd['parent']&&(_0x2b2bfd=_0x2b2bfd['getShiftedBy'](0x3)));const _0x2cd9ac=_0x4707cd['createRange'](_0x4707cd['createPositionAt'](_0x5d1e25,0x0),_0x26985c),_0x21fa77=_0x4707cd['createRange'](_0x2b2bfd,_0x4707cd['createPositionAt'](_0x5d1e25,'end')),_0x13b7e9=[..._0x2cd9ac['getMinimalFlatRanges'](),..._0x21fa77['getMinimalFlatRanges']()];_0x13b7e9['reverse']();for(const _0x46d753 of _0x13b7e9)to(_0x46d753),Jn(_0x5d1e25,_0x46d753);}(_0x5d8c8e['model'],_0xa608a0);}const _0x17d09c=_0x5d8c8e['data']['stringify'](_0x4f6f52,{'showSuggestionHighlights':!0x0});return{'content':Ni(_0x17d09c),'hasChanges':!0x0};}(_0x1bf8f6,_0x2d1856,_0x2ef9cf,_0xf15e1d,_0x5a55f0);return{'type':_0x296ebe['changes'][0x0]['type'],'index':_0x296ebe['index'],'content':_0x9840b9,'hasChanges':_0x56e2e8};});}function no(_0x240891,_0x27d561){for(const [_0x119a2e,_0xc153e4]of _0x240891['markers']){const _0x2435f2=_0x561be6['_createFromRanges'](_0xc153e4['getTransformedByOperation'](_0x27d561));_0x240891['markers']['set'](_0x119a2e,_0x2435f2);}}function vt(_0x42711c,_0x518fed,_0x1fb3a3){const _0x473127=_0x42711c['plugins']['get']('DocumentCompare');let _0x481ebf=_0x42711c['model']['createPositionAt'](_0x1fb3a3,Number['POSITIVE_INFINITY']),_0x5d2c56=_0x42711c['model']['createPositionAt'](_0x1fb3a3,0x0);for(const _0x5f0912 of _0x518fed){let _0x388991,_0xbfbe1e;if(_0x473127['isMarkedRemoveOperation'](_0x5f0912))_0x388991=_0x5f0912['newRange']['start'],_0xbfbe1e=_0x5f0912['newRange']['end'];else switch(_0x481ebf=_0x481ebf['getTransformedByOperation'](_0x5f0912),_0x5d2c56=_0x5d2c56['getTransformedByOperation'](_0x5f0912),_0x5f0912['type']){case'rename':_0x388991=_0x5f0912['position'],_0xbfbe1e=_0x388991['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x388991=_0x5f0912['range']['start'],_0xbfbe1e=_0x5f0912['range']['end'];break;case'insert':_0x388991=_0x5f0912['position'],_0xbfbe1e=_0x388991['getShiftedBy'](_0x5f0912['howMany']);break;case'split':_0x388991=_0x5f0912['splitPosition'],_0xbfbe1e=_0x5f0912['moveTargetPosition'];break;case'merge':{const _0x210b26=_0x5f0912['targetPosition']['path']['slice'](0x0,-0x1);_0x388991=_0x42711c['model']['createPositionFromPath'](_0x1fb3a3,_0x210b26),_0xbfbe1e=_0x388991['getShiftedBy'](0x1);break;}case'remove':{const _0x41ff85=_0x5f0912['howMany'],_0x2a058c=_0x5f0912['sourcePosition']['_getTransformedByInsertion'](_0x5f0912['targetPosition'],_0x41ff85),_0x51db7d=_0x5f0912['getMovedRangeStart']();'remove'==_0x5f0912['type']?(_0x388991=_0x2a058c,_0xbfbe1e=_0x2a058c):(_0x388991=_0x51db7d,_0xbfbe1e=_0x51db7d['getShiftedBy'](_0x41ff85));break;}}_0x388991&&_0x388991['isBefore'](_0x481ebf)&&(_0x481ebf=_0x388991['clone'](),_0x481ebf['stickiness']='toNone'),_0xbfbe1e&&_0xbfbe1e['isAfter'](_0x5d2c56)&&(_0x5d2c56=_0xbfbe1e['clone'](),_0x5d2c56['stickiness']='toNone');}return _0x42711c['model']['createSelection'](_0x42711c['model']['createRange'](_0x481ebf,_0x5d2c56));}function St(_0xce8744,_0x1db302){ro(_0xce8744,_0x1db302,'forward');const _0xcd6a0b=_0x1db302['getFirstRange']();_0x1db302['setTo']([]),_0x1db302['setTo'](_0xcd6a0b,{'backward':!0x0}),ro(_0xce8744,_0x1db302,'backward');}function ro(_0x5e9f05,_0x3b4ff7,_0x52ee86){let _0x5a47cb=0x14;for(;_0x5a47cb;){_0x5e9f05['modifySelection'](_0x3b4ff7,{'unit':'word','direction':_0x52ee86}),_0x5a47cb--;const _0x38f5f5=_0x3b4ff7['focus']['forward'==_0x52ee86?'nodeBefore':'nodeAfter'];if(_0x38f5f5&&_0x38f5f5['is']('element')&&_0x5e9f05['schema']['isBlock'](_0x38f5f5)&&_0x5e9f05['schema']['isObject'](_0x38f5f5))break;}}function Jn(_0x203604,_0x5c096d){for(const [_0x25c3db,_0x36ca31]of _0x203604['markers']){const _0x30b8a4=_0x36ca31['_getTransformedByDeletion'](_0x5c096d['start'],_0x5c096d['end']['offset']-_0x5c096d['start']['offset']);null!=_0x30b8a4?_0x203604['markers']['set'](_0x25c3db,_0x30b8a4):_0x203604['markers']['delete'](_0x25c3db);}}class Ge extends ts(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new Rt([]);['parsedMergedContent']=new Rt([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x5853be,content:_0x557c7b='',isDone:_0x465de5=!0x1,interactionId:_0x154467,areActionsDisabled:_0x25a07f,documentContextContent:_0x2ea42e,editor:_0x8bd7bd,id:_0x1efa40}){super(),this['id']=_0x1efa40||_0x2e2dc8(),this['interactionId']=_0x154467,this['type']=_0x5853be,this['areActionsDisabled']=!!_0x25a07f,this['editor']=_0x8bd7bd,this['aiResponseParser']=new Wi(),this['aiResponseApplier']=new qi(),this['documentContextContent']=Ni(_0x2ea42e||''),this['set']('isDone',_0x465de5),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x557c7b);}['appendContent'](_0x8c9bee){this['set']('content',this['content']+_0x8c9bee);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x476cad,_0x4d532f){this['changeGroups'][_0x476cad]['state']=_0x4d532f,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x476cad,'state':_0x4d532f});}['getContentParts']({showDiff:_0x5849d2,groupIndex:_0x5e572c}){if(!this['editor'])throw new _0x542443('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x16463b=this['_getCachedContentParts'](_0x5849d2,_0x5e572c);if(_0x16463b)return _0x16463b;let _0x159bf4=[];if(void 0x0===_0x5e572c)_0x159bf4=this['changeGroups'];else{const _0x161972=this['changeGroups']['find'](({index:_0x8fb594})=>_0x8fb594===_0x5e572c);if(!_0x161972)throw new _0x542443('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x5e572c});_0x159bf4=[_0x161972];}const _0x3227aa=q({'editor':this['editor'],'showDiff':_0x5849d2,'changeGroups':_0x159bf4,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x5849d2,_0x3227aa),_0x3227aa;}['_getCachedContentParts'](_0x1e85b8,_0x5221a4){const _0x17dba0=_0x1e85b8?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x17dba0]['length'])return null;const _0xf21e6c=this['cachedSuggestionContentParts'][_0x17dba0];if(void 0x0===_0x5221a4)return _0xf21e6c['length']>0x0&&_0xf21e6c['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x1e85b8,null),null):_0x282866(_0xf21e6c);{const _0x286260=_0xf21e6c['find'](({index:_0x5ebc86})=>_0x5ebc86===_0x5221a4);if(_0x286260)return[_0x282866(_0x286260)];}return null;}['_setCachedContentParts'](_0x53f144,_0x989d6c){const _0x54a1c3=_0x53f144?'withDiff':'withoutDiff';_0x989d6c?_0x989d6c['forEach'](_0x5ee30d=>{const _0x2b25c0=this['cachedSuggestionContentParts'][_0x54a1c3],_0x1b2668=_0x2b25c0['find'](({index:_0x5b5792})=>_0x5b5792===_0x5ee30d['index']);if(_0x1b2668){const _0x15bad1=_0x2b25c0['indexOf'](_0x1b2668);_0x2b25c0['splice'](_0x15bad1,0x1,_0x5ee30d);}else _0x2b25c0['push'](_0x5ee30d);}):this['cachedSuggestionContentParts'][_0x54a1c3]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0xc64aa1=this['changeGroups'];this['updateChangeGroups']();const _0x502ed0=this['_getDifferentChangeGroups'](_0xc64aa1,this['changeGroups']);(_0x502ed0['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x502ed0),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x53b6f7,_0x2553d1){const _0x4850ae=[];for(const _0x1e4efd of _0x2553d1){const _0x289645=_0x53b6f7[_0x1e4efd['index']];_0x289645?_0x289645['changes']['length']!==_0x1e4efd['changes']['length']?_0x4850ae['push'](_0x1e4efd):_0x289645['changes']['forEach']((_0x2543bf,_0x4909f9)=>{const _0x20c8ed=_0x1e4efd['changes'][_0x4909f9];_0x2543bf['id']!==_0x20c8ed['id']&&_0x4850ae['push'](_0x1e4efd);}):_0x4850ae['push'](_0x1e4efd);}return _0x4850ae;}['updateChangeGroups'](){const _0x3a68a7=new _0x1075d8('p',{},[new _0x1075d8('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x2ef03d(i(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x34bf6d=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x3a68a7,'cutAfterLastChange':!this['isDone']});if(!_0x34bf6d['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x34bf6d['parsedContent'];let _0x2bf6d5=[];if(_0x5269a1(_0x4fafb9=>{const _0x22a689=Ot(_0x4fafb9,'data-id');if(!_0x22a689||!_0x3bc61b(_0x22a689))return!0x1;const _0x40d1b7=[_0x4fafb9,...Pi(_0x4fafb9)]['at'](-0x2);if(_0x4fafb9!=_0x40d1b7){const _0x44e48c=Ot(_0x40d1b7,'data-id');_0x3bc61b(_0x44e48c)||(_0x2bf6d5['push']({'node':_0x40d1b7,'id':_0x44e48c,'type':'modified'}),_0x34bf6d['modifiedNodeIds']['push'](_0x44e48c));}else _0x34bf6d['modifiedNodeIds']['includes'](_0x22a689)?_0x2bf6d5['push']({'node':_0x4fafb9,'type':'modified','id':_0x22a689}):_0x34bf6d['newNodeIds']['includes'](_0x22a689)?_0x2bf6d5['push']({'node':_0x4fafb9,'type':'new','id':_0x22a689,'anchorId':Ot(_0x4fafb9['previousSibling'],'data-id')}):_0x2bf6d5['push']({'node':_0x4fafb9,'type':'removed','id':_0x22a689});return!0x0;},this['parsedMergedContent']),_0x2bf6d5=_0x2bf6d5['filter'](({node:_0x50e01e})=>[...Pi(_0x50e01e),_0x50e01e]['every'](_0x5597fe=>!Ot(_0x5597fe,'data-unstable'))),0x0==_0x2bf6d5['length'])return;const _0x1c0a41=[[_0x2bf6d5[0x0]]];for(let _0x116dcd=0x1;_0x116dcd<_0x2bf6d5['length'];_0x116dcd++){const _0xef9605=_0x1c0a41[_0x1c0a41['length']-0x1],_0x2f18bb=_0xef9605[_0xef9605['length']-0x1];_0x2bf6d5[_0x116dcd]['node']['previousSibling']==_0x2f18bb['node']&&'modified'!=_0x2bf6d5[_0x116dcd]['type']&&'modified'!=_0x2f18bb['type']?_0xef9605['push'](_0x2bf6d5[_0x116dcd]):_0x1c0a41['push']([_0x2bf6d5[_0x116dcd]]);}for(const _0xb55760 of _0x1c0a41){const _0x71accc=_0xb55760[0x0],_0x566713=_0xb55760[_0xb55760['length']-0x1],_0x477937=_0x4fc0b0(_0x71accc['node']['previousSibling']);_0x477937&&_0xb55760['unshift'](_0x477937);const _0x2e83b0=_0x4fc0b0(_0x566713['node']['nextSibling']);_0x2e83b0&&_0xb55760['push'](_0x2e83b0);}function _0x3bc61b(_0x25c97e){return _0x34bf6d['modifiedNodeIds']['includes'](_0x25c97e)||_0x34bf6d['newNodeIds']['includes'](_0x25c97e)||_0x34bf6d['removedNodeIds']['includes'](_0x25c97e);}function _0x4fc0b0(_0x4a4ba2){if(_0x4a4ba2&&Ot(_0x4a4ba2,'data-id')&&!Ot(_0x4a4ba2,'data-unstable')){const _0x8ca893=Ot(_0x4a4ba2,'data-id');if(!_0x3bc61b(_0x8ca893))return{'node':_0x4a4ba2,'type':'context','id':_0x8ca893};}return null;}this['changeGroups']=_0x1c0a41['map']((_0x1fadf5,_0x4844d4)=>({'changes':_0x1fadf5,'state':'pending','index':_0x4844d4}));}}const ye=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class xe extends _0x204e9f(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0xd91b20,editor:_0x6bf241}){super(),this['id']=_0x2e2dc8(),this['connector']=_0xd91b20,this['isStopped']=!0x0,this['editor']=_0x6bf241;}async['start'](){const _0xa57a3b=[];let _0x3e055f,_0x13e9c9,_0x9b1c1e;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x6c9711=await this['currentRequest']['getStream']();for await(const _0x4381b4 of _0x6c9711){if(this['isStopped'])return;if('error'==_0x4381b4['event'])return void this['fire']('error',{'error':new _0x542443('ai-chat-interaction-error',this)});switch(_0x4381b4['event']){case'message-metadata':this['messageId']=_0x4381b4['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x4381b4['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x4381b4['data']['conversationTitle'],!0x0);break;case'source':_0xa57a3b['push'](_0x4381b4['data']['source']);break;case'web-search':this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));break;case'reasoning':this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));break;case'modification-delta':case'text-delta':this['resetReasoningState'](),this['resetWebSearchState'](),_0x3e055f='modification-delta'==_0x4381b4['event']?'modification':'text',_0x13e9c9='modification-delta'==_0x4381b4['event']?_0x4381b4['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x3e055f&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x3e055f,'interactionId':this['id'],'id':_0x13e9c9}),'modification'==_0x3e055f&&(this['currentReply']['sources']=_0xa57a3b['splice'](0x0))),this['currentReply']['appendContent'](_0x4381b4['data']['textDelta']);break;case'mcp-tool-result':_0x9b1c1e=JSON['parse'](_0x4381b4['data']['result']),this['_handleToolResultData']({'toolName':_0x4381b4['data']['toolName'],'data':_0x9b1c1e['data'],'attributes':_0x9b1c1e['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x4381b4['data']['toolName'],'data':_0x4381b4['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0xa57a3b['length']>0x0&&(this['currentReply']['sources']=_0xa57a3b['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x594594){return this['replies']['find'](_0x564732=>_0x564732['id']===_0x594594);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x5a9c9b=>_0x5a9c9b['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x3ba4da){const _0x3bb0b6=new Ge({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x3ba4da});return this['replies']['push'](_0x3bb0b6),_0x3bb0b6['delegate'](...ye)['to'](this),this['fire']('replyCreated',_0x3bb0b6),_0x3bb0b6;}['setConversationTitle'](_0x2d49ba,_0x572d6c=!0x1){this['fire']('setConversationTitle',_0x2d49ba,_0x572d6c);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x2c61d4){this['fire']('toolDataReceived',{'type':'result','toolName':_0x2c61d4['toolName'],'data':structuredClone(_0x2c61d4['data']||{}),'attributes':structuredClone(_0x2c61d4['attributes']||{})},this);}['_handleToolNotificationData'](_0x42c73e){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x42c73e['toolName'],'data':structuredClone(_0x42c73e['data'])},this);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var qe=function(_0x42a786){return _0x42a786['TOOL']='mcp-tool-context',_0x42a786['FILE']='file',_0x42a786['DOCUMENT']='document',_0x42a786['URL']='web-resource',_0x42a786['TEXT']='text',_0x42a786['SELECTION']='selection',_0x42a786;}({}),Fe=function(_0x4501c6){return _0x4501c6['TEXT']='text',_0x4501c6['MARKDOWN']='markdown',_0x4501c6['HTML']='html',_0x4501c6;}({});const Oe=new Map([['usage-limits-exceeded','ai-usage-limits-exceeded'],['rate-limits-exceeded','ai-rate-limits-exceeded'],['invalid-content-type','ai-invalid-content-type'],['invalid-request-data','ai-chat-invalid-request'],['model-already-set','ai-chat-model-already-set'],['model-not-found','ai-chat-model-not-found'],['unsafe-content-detected','ai-chat-unsafe-content-detected'],['unsupported-content-type','ai-chat-unsupported-content-type'],['content-too-large','ai-chat-content-too-large'],['unsupported-file-type','ai-chat-context-unsupported-file-type'],['file-too-large','ai-chat-context-file-too-large'],['file-too-many-pages','ai-chat-context-file-too-many-pages'],['form-data-size-limits-exceeded','ai-chat-context-form-data-size-limits-exceeded']]),He=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class We extends ts(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x28ee7f,config:_0x4eaf8a,ownerId:_0x1409d8}){super(),this['_connector']=_0x28ee7f,this['_config']=_0x4eaf8a,this['_ownerId']=_0x1409d8;}['init'](){this['_pendingContextItems']=new Map(),this['_conversationContextItems']=new Map(),this['_ongoingUploads']=new Map(),this['_ongoingUploadOperations']=new Map(),this['_setAddContextOptionsDefaultState']();}['getPendingContextItems'](){return this['_pendingContextItems'];}async['populateFromMessage'](_0x23794b){const _0x473c4f=await this['_createContextItemFromContent'](_0x23794b);return this['_addToConversationContextItem'](_0x473c4f),'current-document'===_0x473c4f['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x473c4f;}async['_createContextItemFromContent'](_0xb71f48){if(_0xb71f48['type']===qe['DOCUMENT']){const _0x254cf9=await this['_connector']['fetchDocument'](this['_ownerId'],_0xb71f48['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0xb71f48['type'],'content':_0x254cf9['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x254cf9['attributes']?.['version'],'sessionId':_0x254cf9['attributes']?.['sessionId']};}if(_0xb71f48['type']===qe['TOOL'])return{'id':_0xb71f48['id'],'uiId':_0xb71f48['id'],'label':_0xb71f48['data']?.['label']||_0xb71f48['id'],'type':qe['TOOL'],'mcpServerName':_0xb71f48['mcpServerName'],'toolName':_0xb71f48['toolName'],'data':_0xb71f48['data']||{}};return{'id':_0xb71f48['id'],'uiId':_0xb71f48['id'],'label':_0xb71f48['attributes']?.['label']||_0xb71f48['name']||_0xb71f48['url']||_0xb71f48['id'],'type':_0xb71f48['type'],..._0xb71f48?.['attributes']?.['resourceId']?{'resourceId':_0xb71f48['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0xdd46f9){const _0x34ace2=this['_pendingContextItems']['get'](_0xdd46f9);_0x34ace2?.['isReadOnly']||this['_removeContextItem'](_0xdd46f9);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x14e08b of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x14e08b['uiId']);const _0x980211=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x980211&&this['_addContextItem']({..._0x980211,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x76c6ec){for(const _0x16412d of _0x76c6ec['values']())this['_addToConversationContextItem'](_0x16412d);this['clearPendingContextItems'](),this['fire']('contextSent',{'contextItems':Array['from'](this['getSentContextItems']()['values']())});}['isCurrentDocumentInContext'](){return this['_pendingContextItems']['has']('current-document');}['isSelectionInContext'](){return this['_pendingContextItems']['has']('selection');}['isCurrentDocumentInConversation'](){return this['_conversationContextItems']['has']('current-document');}static['mapContextItemsToRequestData'](_0x12bb07){return Array['from'](_0x12bb07['values']())['map'](_0x3258c2=>this['_mapContextItemToRequestData'](_0x3258c2))['filter'](_0x2d2c4e=>null!==_0x2d2c4e);}async['addFilesToContext'](_0x3a19a4,_0x1874c0,_0x3ca267=qe['FILE']){const _0x55108b='files-'+_0x2e2dc8();this['_startUploadOperation'](_0x55108b);try{await Promise['all'](_0x3a19a4['map'](async _0x432514=>{const _0x899174='file-'+_0x2e2dc8(),_0x490274=_0x1052a4(_0x432514['name']);try{this['_addContextItem']({'type':_0x3ca267,'label':_0x1874c0?.['label']||_0x490274,'uiId':_0x899174,'resourceId':_0x1874c0?.['resourceId']},!0x0);const _0x54417d=this['_connector']['uploadFile'](this['_ownerId'],_0x432514,_0x1874c0);this['_ongoingUploads']['set'](_0x899174,_0x54417d['abortController']);const {id:_0x2bf9bd}=await _0x54417d['getId']();this['_ongoingUploads']['delete'](_0x899174),this['_finishContextItemLoading']({'type':_0x3ca267,'id':_0x2bf9bd,'label':_0x1874c0?.['label']||_0x490274,'uiId':_0x899174,'resourceId':_0x1874c0?.['resourceId']},!0x1);}catch(_0x13fac9){this['_ongoingUploads']['delete'](_0x899174);if(!(_0x13fac9 instanceof _0x542443&&_0x13fac9['message']['startsWith']('ai-request-aborted'))){const _0x3f1b40=Oe['get'](_0x13fac9['code'])||'ai-chat-file-upload-failed',_0x3a71f3=new _0x542443(_0x3f1b40,null,{'fileName':_0x490274,..._0x13fac9});_0x3a71f3['stack']=_0x13fac9['stack'],this['fire']('error',{'error':_0x3a71f3});}this['_removeContextItem'](_0x899174);}}));}finally{this['_finishUploadOperation'](_0x55108b);}}['addCurrentDocumentToContext'](_0x41f7ed){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x3f847e={'type':qe['DOCUMENT'],'uiId':'current-document','label':_0x41f7ed,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x3f847e);}async['updateCurrentDocument'](_0x57d811,_0x2b08c2,_0x3f4476,_0x3dbbd0){const _0x1c3000=this['_pendingContextItems']['get']('current-document');if(_0x1c3000&&_0x57d811){_0x1c3000['selection']=_0x3dbbd0?_0x3dbbd0['map'](_0x10ff1c=>({'start':_0x10ff1c['start'],'end':_0x10ff1c['end']})):[];try{if(_0x1c3000['version']===_0x2b08c2)return;const {id:_0x45fb4a}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x57d811,{'version':_0x2b08c2,'sessionId':_0x3f4476})['getId']();_0x1c3000['id']=_0x45fb4a,_0x1c3000['content']=_0x57d811,_0x1c3000['version']=_0x2b08c2,_0x1c3000['sessionId']=_0x3f4476;}catch(_0x33ace0){const _0x281eff=new _0x542443('ai-chat-document-upload-failed',null);_0x281eff['stack']=_0x33ace0['stack'],this['fire']('error',{'error':_0x281eff});}}}['addSelectionToContext'](_0x1e7064){this['_addContextItem']({'type':qe['SELECTION'],'label':_0x1e7064,'uiId':'selection','content':_0x1e7064});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x340a88,_0x9a7298){const _0x584358='url-'+_0x2e2dc8();this['_startUploadOperation'](_0x584358);const _0xf261e0='url-'+_0x2e2dc8();try{this['_addContextItem']({'type':qe['URL'],'label':_0x9a7298?.['label']||_0x340a88,'uiId':_0xf261e0,'resourceId':_0x9a7298?.['resourceId']},!0x0);const _0x50fe80=this['_connector']['uploadUrl'](this['_ownerId'],_0x340a88,_0x9a7298);this['_ongoingUploads']['set'](_0xf261e0,_0x50fe80['abortController']);const {id:_0x321031}=await _0x50fe80['getId']();this['_ongoingUploads']['delete'](_0xf261e0),this['_finishContextItemLoading']({'type':qe['URL'],'id':_0x321031,'label':_0x9a7298?.['label']||_0x340a88,'uiId':_0xf261e0,'resourceId':_0x9a7298?.['resourceId']},!0x1);}catch(_0x3d0219){this['_ongoingUploads']['delete'](_0xf261e0),(_0x3d0219['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x542443('ai-chat-url-upload-failed',this,{'url':_0x340a88,'originalError':_0x3d0219}),'url':_0x340a88}),this['_removeContextItem'](_0xf261e0));}finally{this['_finishUploadOperation'](_0x584358);}}['addToolItemToContext'](_0x3338d1){_0x3338d1['id']=_0x3338d1['id']??_0x2e2dc8()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x3338d1['uiId'],_0x3338d1),this['fire']('contextItemAdded',{'contextItem':_0x3338d1,'isLoading':!0x1});}async['loadSourceResources'](_0x43d1b8,_0xc4628d,_0x4f5311){const _0x47c522=this['_addContextOptionsState']['sources']['find'](_0x27ae2e=>_0x27ae2e['id']===_0x43d1b8);if(!_0x47c522)return this['fire']('error',{'error':new _0x542443('ai-chat-source-not-found',this,{'sourceId':_0x43d1b8}),'sourceId':_0x43d1b8}),[];try{const _0x293884=(await _0x47c522['getResources'](_0xc4628d))['map'](_0x147a6a=>{const _0x44318c=this['_isResourceInContext'](_0x147a6a['id']);return{..._0x147a6a,'isInContext':_0x44318c};});return _0x47c522['resources']=_0x293884,this['fire']('sourceResourcesLoaded',{'sourceId':_0x43d1b8,'source':_0x47c522,'resources':_0x293884,'uid':_0x4f5311}),_0x293884;}catch(_0x4a9dc3){return this['fire']('error',{'error':new _0x542443('ai-chat-source-resources-load-failed',this,{'sourceId':_0x43d1b8,'originalError':_0x4a9dc3}),'sourceId':_0x43d1b8,'sourceLabel':_0x47c522['label']}),[];}}async['addResourceToContext'](_0xa9ca89,_0x273af1){if(this['_isResourceInContext'](_0x273af1['id']))return;let _0x18c1e3=_0x273af1['data'];if(!_0x18c1e3&&_0xa9ca89['getData'])try{_0x18c1e3=await _0xa9ca89['getData'](_0x273af1['id']);}catch(_0x3744d5){return void this['fire']('error',{'error':new _0x542443('ai-chat-resource-load-failed',this,{'resourceId':_0x273af1['id'],'sourceId':_0xa9ca89['id'],'originalError':_0x3744d5}),'resourceId':_0x273af1['id'],'sourceId':_0xa9ca89['id']});}if(_0x18c1e3)switch(_0x273af1['type']){case qe['URL']:if('string'!=typeof _0x18c1e3)return void this['fire']('error',{'error':new _0x542443('ai-chat-context-invalid-data',this,{'resourceId':_0x273af1['id'],'sourceId':_0xa9ca89['id'],'expectedType':'string','actualType':typeof _0x18c1e3}),'resourceId':_0x273af1['id'],'sourceId':_0xa9ca89['id']});await this['addUrlToContext'](_0x18c1e3,{'label':_0x273af1['label'],'resourceId':_0x273af1['id']});break;case qe['FILE']:if(!(_0x18c1e3 instanceof File))return void this['fire']('error',{'error':new _0x542443('ai-chat-context-invalid-data',this,{'resourceId':_0x273af1['id'],'sourceId':_0xa9ca89['id'],'expectedType':'File','actualType':typeof _0x18c1e3}),'resourceId':_0x273af1['id'],'sourceId':_0xa9ca89['id']});await this['addFilesToContext']([_0x18c1e3],{'label':_0x273af1['label'],'resourceId':_0x273af1['id']});break;case qe['TEXT']:if('object'!=typeof _0x18c1e3||!('content'in _0x18c1e3)||!('type'in _0x18c1e3))return void this['fire']('error',{'error':new _0x542443('ai-chat-context-invalid-data',this,{'resourceId':_0x273af1['id'],'sourceId':_0xa9ca89['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x18c1e3}),'resourceId':_0x273af1['id'],'sourceId':_0xa9ca89['id']});_0x18c1e3=We['_convertTextResourceToFile'](_0x18c1e3,_0x273af1['label']),await this['addFilesToContext']([_0x18c1e3],{'label':_0x273af1['label'],'resourceId':_0x273af1['id']},qe['TEXT']);break;case qe['TOOL']:break;default:this['fire']('error',{'error':new _0x542443('ai-chat-context-unsupported-type',this,{'resourceId':_0x273af1['id'],'sourceId':_0xa9ca89['id'],'resourceType':_0x273af1['type']}),'resourceId':_0x273af1['id'],'sourceId':_0xa9ca89['id']});}else this['fire']('error',{'error':new _0x542443('ai-chat-resource-no-data',this,{'resourceId':_0x273af1['id'],'sourceId':_0xa9ca89['id']}),'resourceId':_0x273af1['id'],'sourceId':_0xa9ca89['id']});}static['_convertTextResourceToFile'](_0x3a45b1,_0x177df5){switch(_0x3a45b1['type']){case Fe['MARKDOWN']:return new File([_0x3a45b1['content']],_0x177df5,{'type':'text/markdown'});case Fe['HTML']:return new File([_0x3a45b1['content']],_0x177df5,{'type':'text/html'});default:return new File([_0x3a45b1['content']],_0x177df5,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x193559){switch(_0x193559['type']){case qe['FILE']:return{'type':qe['FILE'],'id':_0x193559['id']};case qe['URL']:return{'type':qe['URL'],'id':_0x193559['id']};case qe['DOCUMENT']:return{'type':qe['DOCUMENT'],'id':_0x193559['id'],..._0x193559['selection']?.['length']&&{'selection':_0x193559['selection']}};case qe['TEXT']:return{'type':qe['FILE'],'id':_0x193559['id']};case qe['TOOL']:{const _0x5617cd=_0x193559;return{'type':qe['TOOL'],'mcpServerName':_0x5617cd['mcpServerName'],'toolName':_0x5617cd['toolName'],'data':_0x5617cd['data'],'id':_0x5617cd['id']};}default:return null;}}['_addContextItem'](_0x183757,_0x451bdc=!0x1){if(this['_pendingContextItems']['set'](_0x183757['uiId'],_0x183757),_0x183757['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x183757,'isLoading':_0x451bdc}),'current-document'===_0x183757['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x183757['resourceId']){const _0xb3bb11=this['_findSourceIdsByResourceId'](_0x183757['resourceId']);_0xb3bb11&&_0xb3bb11['forEach'](_0x401724=>{this['_updateResourceInContextState'](_0x401724,_0x183757['resourceId'],!0x0);});}}['_removeContextItem'](_0x37a9bd){const _0x9cc782=this['_pendingContextItems']['get'](_0x37a9bd),_0x6758d7=this['_ongoingUploads']['get'](_0x37a9bd);if(_0x6758d7&&(_0x6758d7['abort'](),this['_ongoingUploads']['delete'](_0x37a9bd)),_0x9cc782?.['resourceId']){const _0x39f113=this['_findSourceIdsByResourceId'](_0x9cc782['resourceId']);_0x39f113&&_0x39f113['forEach'](_0x1884b8=>{this['_updateResourceInContextState'](_0x1884b8,_0x9cc782['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x37a9bd),this['fire']('contextItemRemoved',{'uiId':_0x37a9bd,'type':_0x9cc782?.['type']}),'current-document'===_0x37a9bd&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x383618,_0x202c06){if(this['_pendingContextItems']['has'](_0x383618['uiId'])&&(this['_pendingContextItems']['set'](_0x383618['uiId'],_0x383618),this['fire']('contextItemLoadingEnded',{'contextItem':_0x383618,'isLoading':_0x202c06}),_0x383618['resourceId'])){const _0x51f979=this['_findSourceIdsByResourceId'](_0x383618['resourceId']);_0x51f979&&_0x51f979['forEach'](_0x1aa060=>{this['_updateResourceInContextState'](_0x1aa060,_0x383618['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x225b0e){this['_conversationContextItems']['set'](_0x225b0e['uiId'],_0x225b0e);}['_setAddContextOptionsDefaultState'](){this['_addContextOptionsState']={'document':{'enabled':!0x1!==this['_config']?.['document']?.['enabled'],'isHidden':!0x1},'urls':{'enabled':!0x1!==this['_config']?.['urls']?.['enabled']},'files':{'enabled':!0x1!==this['_config']?.['files']?.['enabled']},'sources':this['_getCustomSourcesInitialState'](),'customItems':this['_config']?.['customItems']?.['map'](_0x388686=>({..._0x388686,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x457aaf=>({..._0x457aaf,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x5e97f0=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x5e97f0,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0xcdc125){for(const _0x3e2dc0 of this['_pendingContextItems']['values']())if(_0x3e2dc0['resourceId']===_0xcdc125)return!0x0;for(const _0x3c4dcb of this['_conversationContextItems']['values']())if(_0x3c4dcb['resourceId']===_0xcdc125)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x4cd791){const _0x44ac5b=[];for(const _0x426d81 of this['_addContextOptionsState']['sources']){_0x426d81['resources']['find'](_0x5a24e7=>_0x5a24e7['id']===_0x4cd791)&&_0x44ac5b['push'](_0x426d81['id']);}return 0x0===_0x44ac5b['length']?null:_0x44ac5b;}['_updateResourceInContextState'](_0x3b2f66,_0x5e2c2f,_0x1fda6e){const _0x28d65b=this['_addContextOptionsState']['sources']['find'](_0xebdc5b=>_0xebdc5b['id']===_0x3b2f66);if(!_0x28d65b)return;const _0x1ce2a0=_0x28d65b['resources']['find'](_0xcd5040=>_0xcd5040['id']===_0x5e2c2f);_0x1ce2a0&&(_0x1ce2a0['isInContext']=_0x1fda6e,this['fire']('resourceStateChanged',{'sourceId':_0x3b2f66,'resourceId':_0x5e2c2f,'isInContext':_0x1fda6e}));}['_startUploadOperation'](_0xbdb9fb){this['_ongoingUploadOperations']['set'](_0xbdb9fb,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x5ead11){this['_ongoingUploadOperations']['delete'](_0x5ead11),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Be=['capabilitiesUpdated'];class Je extends _0x204e9f(){['_isWebSearchEnabled'];['_isReasoningEnabled'];constructor(){super(),this['_isWebSearchEnabled']=!0x1,this['_isReasoningEnabled']=!0x1;}['init'](){this['reset']();}['reset'](){this['setWebSearch'](!0x1),this['setReasoning'](!0x1);}['getCapabilitiesConfig'](){return{'isWebSearchEnabled':this['_isWebSearchEnabled'],'isReasoningEnabled':this['_isReasoningEnabled']};}static['getCapabilitiesRequestData'](_0x2f3039){const _0x15cad4={};return _0x2f3039&&_0x2f3039['isWebSearchEnabled']&&(_0x15cad4['webSearch']={}),_0x2f3039&&_0x2f3039['isReasoningEnabled']&&(_0x15cad4['reasoning']={}),_0x15cad4;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x33e119){_0x33e119!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x33e119,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x1733ee){_0x1733ee!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x1733ee,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Ke extends xe{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['attributes'];constructor(_0x437ffc){super(_0x437ffc),this['conversationId']=_0x437ffc['conversationId'],this['contextItems']=_0x437ffc['contextItems'],this['capabilities']=_0x437ffc['capabilities'],this['userMessage']=_0x437ffc['userMessage'],this['model']=_0x437ffc['model'],this['attributes']=_0x437ffc['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':We['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Je['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class yt extends _0x204e9f(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0xa84393){super(),this['options']=_0xa84393,this['connector']=_0xa84393['connector'],this['chatModels']=_0xa84393['chatModels'],this['id']=_0xa84393['conversationId'],this['isFromHistory']=_0xa84393['isFromHistory'];}async['init'](_0xbd0a44){try{this['chatContext']=new We({'connector':this['connector'],'config':_0xbd0a44,'ownerId':this['id']}),this['chatContext']['delegate'](...He)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Je(),this['chatCapabilities']['delegate'](...Be)['to'](this),this['chatCapabilities']['init']();const _0x1634c8=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x1634c8});const _0x434e7a=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x434e7a&&await this['setModel'](_0x434e7a);}catch(_0x2c4294){const _0x27bab2=new _0x542443('ai-chat-conversation-init-failed',null,{'message':_0x2c4294['message']||_0x2c4294});_0x27bab2['stack']=_0x2c4294['stack'],this['fire']('error',{'error':_0x27bab2});}}async['start'](){if(this['isStarted'])throw new _0x542443('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x542443('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x148aac}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x148aac,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x324b09){const _0x5b6457=new _0x542443('ai-chat-conversation-start-failed',null,{'message':_0x324b09['message'],'conversationId':this['id']});throw _0x5b6457['stack']=_0x324b09['stack'],this['fire']('error',{'error':_0x5b6457}),_0x5b6457;}}async['load'](_0x103006,_0x3968f2){try{const _0x2ec190=await this['connector']['fetchConversation'](_0x103006)['getConversation'](),_0x4f4aac=await this['connector']['fetchConversationMessages'](_0x103006)['getMessages'](),_0x523658=_0x4f4aac[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x2ec190['id'],'title'in _0x2ec190?this['fire']('setConversationTitle',_0x2ec190['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0xe03fe6=(await this['chatModels']['getAll']())['find'](_0x19517a=>_0x19517a['id']['toLowerCase']()===_0x523658['toLowerCase']());return this['selectedModel']=_0xe03fe6,this['fire']('modelSelected',{'selectedModel':_0xe03fe6,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x4f4aac,_0x3968f2,_0x523658),this['currentInteraction']=void 0x0,this;}catch(_0x5983b2){const _0x109314=new _0x542443('ai-chat-conversation-init-from-id-failed',null,{'message':_0x5983b2['message'],'conversationId':_0x103006});throw _0x109314['stack']=_0x5983b2['stack'],this['fire']('error',{'error':_0x109314}),_0x109314;}}async['_processMessagesToInteractions'](_0x21dbf0,_0x17b61e,_0x411791){let _0x535093;for(const _0x13a016 of _0x21dbf0)if('user'===_0x13a016['role']){const _0x40748c=await this['_extractContextItems'](_0x13a016),_0x3db0e7={'isReasoningEnabled':Object['hasOwn'](_0x13a016['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x13a016['capabilities'],'webSearch')};_0x535093=this['createInteraction']({'userMessage':_0x13a016['prompt'],'contextItems':_0x40748c,'capabilities':_0x3db0e7,'modelId':_0x411791,'attributes':_0x13a016['attributes']}),this['currentInteraction']=_0x535093,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x13a016['role']&&_0x535093){const _0x5a6c1f=[];for(const _0x2236b1 of _0x13a016['content'])switch(_0x2236b1['type']){case'text':case'modification':{const _0x3e67ee=_0x535093['getDocumentContext']()?.['sessionId']!==_0x17b61e;_0x535093['currentReply']=_0x535093['createReply']({'type':_0x2236b1['type'],'isDone':!0x0,'interactionId':_0x535093['id'],'areActionsDisabled':_0x3e67ee}),_0x535093['currentReply']['appendContent'](_0x2236b1['content']),_0x5a6c1f['length']>0x0&&(_0x535093['currentReply']['sources']=_0x5a6c1f['splice'](0x0));break;}case'url':_0x5a6c1f['push'](_0x2236b1);break;case'mcp-tool-result':{const {data:_0x102970,attributes:_0x374da6}=JSON['parse'](_0x2236b1['content']);_0x535093['_handleToolResultData']({'toolName':_0x2236b1['toolName'],'data':_0x102970,'attributes':_0x374da6});break;}}}}}async['_extractContextItems'](_0x1d680c){const _0x205832=new Map();if(!_0x1d680c['content'])return _0x205832;for(const _0x5741cc of _0x1d680c['content']){const _0x3356e8=await this['chatContext']['populateFromMessage'](_0x5741cc);_0x3356e8&&_0x205832['set'](_0x3356e8['id'],_0x3356e8);}return _0x205832;}async['handleUserInteraction']({userMessage:_0xe25b33,attributes:_0x233c4e}){if(!this['isStarted'])throw new _0x542443('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x542443('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x3eb669=this['chatContext']['getPendingContextItems'](),_0x279e59=this['chatCapabilities']['getCapabilitiesConfig'](),_0x4b358a=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0xe25b33,'contextItems':_0x3eb669,'capabilities':_0x279e59,'modelId':_0x4b358a,'attributes':_0x233c4e}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x1d27a2){if(_0x1d27a2 instanceof _0x542443)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x1d27a2});else{const _0x190b30=Oe['get'](_0x1d27a2['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new _0x542443(_0x190b30,null,{'error':_0x1d27a2})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x56491f,contextItems:_0x46daaa,capabilities:_0x37e7d7,modelId:_0x13b47c,attributes:_0x1b82ba}){const _0x25d6cc=new Ke({'userMessage':_0x56491f,'contextItems':_0x46daaa,'capabilities':_0x37e7d7,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x13b47c,'attributes':_0x1b82ba});return _0x25d6cc['delegate'](...ye)['to'](this),this['interactions']['push'](_0x25d6cc),this['fire']('interactionCreated',_0x25d6cc),_0x25d6cc;}['getInteraction'](_0x5b3de0){return this['interactions']['find'](_0x22741a=>_0x22741a['id']===_0x5b3de0);}['removeInteraction'](_0x514f06){const _0x7e32e7=this['getInteraction'](_0x514f06);_0x7e32e7&&(_0x7e32e7['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x7e32e7),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x181fce){this['chatContext']['addCurrentDocumentToContext'](_0x181fce);}async['updateCurrentDocumentInContext']({content:_0x4652f3,version:_0x320a37,sessionId:_0x3cac41,selections:_0x53c5b1}){await this['chatContext']['updateCurrentDocument'](_0x4652f3,_0x320a37,_0x3cac41,_0x53c5b1);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x143704){this['chatContext']['addSelectionToContext'](_0x143704);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x50090e){this['chatContext']['addFilesToContext'](_0x50090e);}['addUrlToContext'](_0xd3cf7f){this['chatContext']['addUrlToContext'](_0xd3cf7f);}['addToolItemToContext'](_0x5774f9){this['chatContext']['addToolItemToContext'](_0x5774f9);}['addResourceToContext'](_0x23d67d,_0x3a374f){this['chatContext']['addResourceToContext'](_0x23d67d,_0x3a374f);}['loadSourceResources'](_0x305ca5,_0x360f66,_0x1678ee){return this['chatContext']['loadSourceResources'](_0x305ca5,_0x360f66,_0x1678ee);}['removeFromContext'](_0x48332a){this['chatContext']['removeFromContext'](_0x48332a);}['setWebSearch'](_0x594d09){this['chatCapabilities']['setWebSearch'](_0x594d09);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x1a0735){this['chatCapabilities']['setReasoning'](_0x1a0735);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x5b033f){_0x5b033f?!0x1===await this['chatModels']['isAvailable'](_0x5b033f)&&(_0x23c4c9('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x5b033f}),_0x5b033f=(await this['chatModels']['getAvailableModels']())[0x0]):(_0x23c4c9('ai-chat-conversation-set-model-null',{'conversation':this}),_0x5b033f=(await this['chatModels']['getAvailableModels']())[0x0]),_0x5b033f['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x5b033f,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x5b033f}));}}class At extends _0x204e9f(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x3d4f90,config:_0x1cb9d3,locale:_0x41689f}){super(),this['_connector']=_0x3d4f90,this['_config']=_0x1cb9d3,this['_locale']=_0x41689f;}get['_availableModels'](){return this['_config']?.['displayedModels'];}get['_defaultModelId'](){return this['_config']?.['defaultModelId'];}async['getAll'](){return this['_modelsRequest']||(this['_modelsRequest']=this['_retrieveModels']()),this['_modelsRequest'];}async['getAvailableModels'](){const _0x245e1c=await this['getAll']();let _0x113169;return _0x113169=this['_availableModels']?this['_filterModels'](_0x245e1c,this['_availableModels']):_0x245e1c['filter'](_0x2db8b9=>_0x2db8b9['recommended']),_0x113169;}async['getModel'](_0x304076){const _0x781bb=await this['getAll']();if(!_0x781bb['length'])return null;if(_0x304076){const _0x1850c1=this['_getModelById'](_0x781bb,_0x304076);if(_0x1850c1)return _0x1850c1;_0x23c4c9('ai-chat-model-id-unrecognized',{'modelId':_0x304076,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x47bad8=await this['getAvailableModels']();if(!_0x47bad8['length'])return null;if(this['_defaultModelId']){const _0x39af13=this['_getModelById'](_0x47bad8,this['_defaultModelId']);if(_0x39af13)return _0x39af13;_0x23c4c9('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x47bad8[0x0]['id']});}return _0x47bad8[0x0];}async['isAvailable'](_0x707184){return(await this['getAvailableModels']())['some'](_0x4e9ca6=>_0x4e9ca6['name']===_0x707184['name']&&_0x4e9ca6['provider']===_0x707184['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x17ccdc=this['_locale']['uiLanguage']||'en',_0x3a7047=this['_connector']['getModels'](_0x17ccdc),_0x3db6ad=await _0x3a7047['list']();this['_modelList']=_0x3db6ad['items']['map'](_0x4bd5b3=>Mi(_0x4bd5b3)?{..._0x4bd5b3,'name':i(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x4bd5b3);}catch(_0x4880de){throw Ct('ai-models-unable-to-retrieve',{'error':_0x4880de}),_0x4880de;}return[...this['_modelList']];}['_filterModels'](_0x582a57,_0x42dcf1){let _0x4d600c;if(_0x42dcf1){_0x4d600c=[];const _0x6b9275=new Set(),_0x97ac4a='string'==typeof _0x42dcf1?[_0x42dcf1['toLocaleLowerCase']()]:_0x42dcf1['map'](_0x44ffa4=>_0x44ffa4['toLocaleLowerCase']());for(const _0x3ae5b3 of _0x97ac4a)for(const _0x5500e4 of _0x582a57)!_0x6b9275['has'](_0x5500e4['id'])&&this['_isMatchingFilter'](_0x5500e4,_0x3ae5b3)&&(_0x4d600c['push'](_0x5500e4),_0x6b9275['add'](_0x5500e4['id']));}else _0x4d600c=_0x582a57;return _0x4d600c;}['_isMatchingFilter'](_0x3be5eb,_0x312f48){const _0x5a7204=_0x3be5eb['id']['toLocaleLowerCase'](),_0x28817a=_0x3be5eb['name']['toLocaleLowerCase'](),_0x1996c3=_0x3be5eb['provider']['toLocaleLowerCase']();return _0x5a7204===_0x312f48||_0x28817a===_0x312f48||Mi(_0x3be5eb)&&'auto'===_0x312f48||_0x1996c3===_0x312f48||_0x5a7204['startsWith'](_0x312f48);}['_getModelById'](_0x4056da,_0x2c9b60){return _0x4056da['find'](_0x504313=>Mi(_0x504313)&&'auto'===_0x2c9b60?_0x504313:_0x504313['id']===_0x2c9b60)||null;}}function Mi(_0x29b4ed){return _0x29b4ed['id']['startsWith']('agent');}function et(_0x4b46e2){if(_0x4b46e2 instanceof dt)return _0x4b46e2;if(_0x4b46e2?.['editors']&&_0x4b46e2['editors']['get'](0x0))return _0x4b46e2['editors']['length']>0x1&&console['warn']('AIChat:\x20Multiple\x20editor\x20instances\x20detected.\x20Only\x20the\x20first\x20editor\x20instance\x20will\x20be\x20used\x20for\x20AI\x20operations.\x20This\x20configuration\x20is\x20not\x20fully\x20supported\x20and\x20may\x20lead\x20to\x20unexpected\x20behavior.'),_0x4b46e2['editors']['get'](0x0);throw new _0x542443('ai-get-editor-from-context-no-editor');}function W({editor:_0x5c793,interaction:_0x5d0c05,reply:_0x1b8a76,groups:_0x2729c5,transform:_0x10dec5,documentCompare:_0x2f385b,documentCompareOptions:_0x1b589e}){const _0x4044af=_0x5d0c05['getDocumentContext']();if(!_0x4044af)return[];const _0xcc9e9e=_0x4044af['content'],_0x30a3e0=_0x4044af['version'],_0x5e0dd5=_0x1b8a76['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x4d1e60}of _0x2729c5){const _0x48ee2f=_0x4d1e60['filter'](_0x552f73=>'new'!=_0x552f73['type'])['map'](_0x22b8f1=>bt('data-id',_0x22b8f1['id'],_0x5e0dd5)),_0x569efd=_0x4d1e60['filter'](_0x4b8122=>'removed'!=_0x4b8122['type'])['map'](_0x54935e=>_0x54935e['node']['cloneNode'](!0x0));let _0x6fec68=null;if(_0x48ee2f['length']){_0x6fec68=_0x48ee2f[0x0]['previousSibling'];for(let _0x36c202=0x0;_0x36c202<_0x48ee2f['length'];_0x36c202++)_0xb8c25a(_0x48ee2f[_0x36c202]);}if(_0x569efd['length']){_0x6fec68||(_0x4d1e60[0x0]['anchorId']?_0x6fec68=bt('data-id',_0x4d1e60[0x0]['anchorId'],_0x5e0dd5):(_0x6fec68=_0x569efd['shift'](),_0x52afa8(_0x5e0dd5,_0x6fec68)));for(let _0x1a747d=0x0;_0x1a747d<_0x569efd['length'];_0x1a747d++)_0x59a323(_0x6fec68,_0x569efd[_0x1a747d]),_0x6fec68=_0x569efd[_0x1a747d];}}const _0x5aa615=Dt(_0x5e0dd5),_0x4eba8f=_0x2f385b['getDiff'](_0xcc9e9e,_0x5aa615,_0x1b589e)['getOperations']();if(_0x10dec5){const _0x5ec1f2=_0x5c793['model']['document']['history']['getOperations'](_0x30a3e0),_0x4a9452={'document':_0x5c793['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x359a53(_0x4eba8f,_0x5ec1f2,_0x4a9452)['operationsA'];}return _0x4eba8f;}function V(_0x2c77ad,_0x26a26c){if('marker'!=_0x26a26c['type'])return;const _0x3b1596=_0x2c77ad['model']['markers']['get'](_0x26a26c['name']);_0x3b1596&&(_0x26a26c['oldRange']=_0x3b1596['getRange']());}class ht extends _0x118815{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[S,_0x143aa3];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new _0x49fddd(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new At({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x4dd847=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0xfc760a,_0x3d648b)=>{this['_handleUIUserMessage']({'userMessage':_0x3d648b});}),this['listenTo'](_0x4dd847,'resizedTabs',(_0x43627d,_0x378944)=>{this['_setIsMaximized'](_0x378944);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x4dd847['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['addCurrentDocumentToChatContext']();}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x449949,_0x4e7945)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x4e7945));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x5469b3,_0x8bb70a)=>{this['activeConversation']?.['addUrlToContext'](_0x8bb70a);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x5f5b9d,_0x4a5491)=>{_0x4a5491['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x14e072,_0x4d9560)=>{this['activeConversation']?.['addResourceToContext'](_0x4d9560['source'],_0x4d9560['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x27c966,_0x2eb23c)=>{this['_removeFromContext'](_0x2eb23c);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x105e70,_0x47851a)=>{this['activeConversation']?.['loadSourceResources'](_0x47851a['sourceId'],_0x47851a['query'],_0x47851a['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x5592f8,_0x2cd039)=>{this['activeConversation']?.['setModel'](_0x2cd039);}),this['listenTo'](this['_aiChatUi'],'like',(_0x2a237f,{replyId:_0x167031})=>{console['log']('Liked\x20response',_0x167031);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x3a82ea,{replyId:_0x50c5bc})=>{console['log']('Disliked\x20response',_0x50c5bc);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x542afc,_0x56e85e)=>{this['_insertSuggestion'](_0x56e85e);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x5721eb,{replyId:_0x4e1d68,partIndex:_0x24a5a1})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x4e1d68,_0x24a5a1);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x699b4b,{replyId:_0x20a5d0,partIndex:_0x7be5c0})=>{const _0x28d59a=this['_getDocumentRangeForReplyChanges'](_0x20a5d0,_0x7be5c0);_0x28d59a&&'$graveyard'!=_0x28d59a['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x28d59a['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x3cfd49,_0x2a5187)=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over'),this['_applySuggestion'](_0x2a5187);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x1cd942,{replyId:_0x2c49fe,showDiff:_0x4639c8})=>{const {reply:_0x56a068}=this['getInteractionAndReplyById'](_0x2c49fe),_0x5a2444=_0x56a068['getContentParts']({'showDiff':_0x4639c8});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x56a068['id'],'parts':_0x5a2444,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x3e0490,{replyId:_0x345463,partIndex:_0x336537})=>{this['_rejectSuggestion']({'replyId':_0x345463,'partIndex':_0x336537}),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['context']['plugins']['has']('AIChatBalloon')&&(this['_aiChatBalloon']=this['context']['plugins']['get']('AIChatBalloon'),this['set']('_aiChatBalloonShowDiff',!0x1),this['_aiChatBalloon']['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](this['_aiChatBalloon'],'toggleSuggestionDisplayMode',()=>{const {replyId:_0x4d219a,partIndex:_0x2b946a}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x389c54}=this['getInteractionAndReplyById'](_0x4d219a),_0x1039c7=_0x389c54['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x2b946a});this['_aiChatBalloon']['updateContent']({'part':_0x1039c7[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0x2f0562,partIndex:_0x92c683}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x2f0562,'partIndex':_0x92c683}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x55b12d,partIndex:_0x1636a8}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x55b12d,'partIndex':_0x1636a8}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x39dd3c,partIndex:_0x2dd88a}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x39dd3c,'partIndex':_0x2dd88a}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0xc0b315,partIndex:_0x3a13d4}=this['_currentPreviewedChangeGroup'],_0x2e53bf=this['_getPresentableSiblingContentPartIndex'](_0xc0b315,_0x3a13d4,'next');null!==_0x2e53bf&&this['_openBalloonFor'](_0xc0b315,_0x2e53bf);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0x4c41cb,partIndex:_0x5edee9}=this['_currentPreviewedChangeGroup'],_0x18fb10=this['_getPresentableSiblingContentPartIndex'](_0x4c41cb,_0x5edee9,'previous');null!==_0x18fb10&&this['_openBalloonFor'](_0x4c41cb,_0x18fb10);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x405283,{id:_0x474bd2})=>{if('aiChatBalloon'!==_0x474bd2)return;const {replyId:_0x90bb7e,partIndex:_0x153003}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x90bb7e,'index':_0x153003,'isActive':!0x1});}));}async['afterInit'](){this['context']instanceof dt?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x1c9575,_0xb81fd9)=>{_0xb81fd9['on']('ready',()=>{this['_integrateEditor'](_0xb81fd9);});});const _0x468657=this['context']['config']['get']('ai.chat.initialConversation');let _0x155367=_0x468657;if('lastCreated'!=_0x468657||(_0x155367=await this['_getLastCreatedConversationId'](),_0x155367))return'new'==_0x155367?this['_startConversationSafely']():this['loadConversation'](_0x155367);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_insertSuggestion'](_0x5570b0){const _0x4cddd9=et(this['context']);if(!_0x4cddd9['plugins']['has']('TrackChanges'))throw new _0x542443('ai-no-track-changes',null);const _0x1d601d=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x2cc192,interaction:_0x54667b}=this['getInteractionAndReplyById'](_0x5570b0['replyId']),_0x2bd5f2=this['_getDocumentRangeForReplyChanges'](_0x5570b0['replyId'],_0x5570b0['partIndex']),_0x5304b1=void 0x0!==_0x5570b0['partIndex']?[_0x2cc192['changeGroups'][_0x5570b0['partIndex']]]:_0x2cc192['changeGroups']['filter'](_0x3c447f=>'pending'==_0x3c447f['state']),_0x4b623f=_0x5304b1['map'](_0x332aec=>_0x2cc192['changeGroups']['indexOf'](_0x332aec));if(!_0x2bd5f2||'$graveyard'==_0x2bd5f2['range']['root']['rootName'])return void _0x4b623f['forEach'](_0x29cb71=>_0x2cc192['setChangeGroupState'](_0x29cb71,'outdated'));_0x4b623f['forEach'](_0x2f98f2=>_0x2cc192['setChangeGroupState'](_0x2f98f2,'accepted'));const _0x304e85=W({'editor':_0x4cddd9,'reply':_0x2cc192,'interaction':_0x54667b,'groups':_0x5304b1,'transform':!0x0,'documentCompare':_0x1d601d,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x2fa8b2;_0x2bd5f2&&this['_scrollToSuggestionRange'](_0x2bd5f2['range']),_0x4cddd9['model']['change'](_0x5684ad=>{_0x2fa8b2=_0x5684ad['batch'],_0x4cddd9['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x304e85),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x2fa8b2,{'interactionId':_0x54667b['id'],'replyId':_0x2cc192['id'],'indexes':_0x4b623f['slice']()}),this['_updateRatings'](_0x2cc192);}['_applySuggestion'](_0x565e96){const _0x5c9bc0=et(this['context']),_0x2133b5=this['context']['plugins']['get'](_0x143aa3),{reply:_0x31a0f3,interaction:_0x4af452}=this['getInteractionAndReplyById'](_0x565e96['replyId']),_0xe3e65b=this['_getDocumentRangeForReplyChanges'](_0x565e96['replyId'],_0x565e96['partIndex']),_0x425965=void 0x0!==_0x565e96['partIndex']?[_0x31a0f3['changeGroups'][_0x565e96['partIndex']]]:_0x31a0f3['changeGroups']['filter'](_0x93b7a0=>'pending'==_0x93b7a0['state']),_0x2525bd=_0x425965['map'](_0x376b3c=>_0x31a0f3['changeGroups']['indexOf'](_0x376b3c));if(!_0xe3e65b||'$graveyard'==_0xe3e65b['range']['root']['rootName'])return void _0x2525bd['forEach'](_0x5848fa=>_0x31a0f3['setChangeGroupState'](_0x5848fa,'outdated'));_0x2525bd['forEach'](_0x6065d1=>_0x31a0f3['setChangeGroupState'](_0x6065d1,'accepted'));const _0x559123=W({'editor':_0x5c9bc0,'reply':_0x31a0f3,'interaction':_0x4af452,'groups':_0x425965,'transform':!0x0,'documentCompare':_0x2133b5,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0xdf6dc3;_0xe3e65b&&this['_scrollToSuggestionRange'](_0xe3e65b['range']),_0x5c9bc0['model']['change'](_0x9605e3=>{_0xdf6dc3=_0x9605e3['batch'];for(const _0x3de23e of _0x559123)_0x3de23e['baseVersion']=_0x5c9bc0['model']['document']['version'],V(_0x5c9bc0,_0x3de23e),_0x9605e3['batch']['addOperation'](_0x3de23e),_0x5c9bc0['model']['applyOperation'](_0x3de23e);}),this['_batchToChanges']['set'](_0xdf6dc3,{'interactionId':_0x4af452['id'],'replyId':_0x31a0f3['id'],'indexes':_0x2525bd['slice']()}),this['_updateRatings'](_0x31a0f3);}['_rejectSuggestion'](_0x2c95c8){const {reply:_0x1719ea}=this['getInteractionAndReplyById'](_0x2c95c8['replyId']);_0x1719ea['setChangeGroupState'](_0x2c95c8['partIndex'],'rejected');}['_openBalloonFor'](_0x3af545,_0x4a9c94){if(!this['_aiChatBalloon'])return;const {reply:_0x5b3ba9}=this['getInteractionAndReplyById'](_0x3af545),_0x5ab7ca=_0x5b3ba9['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x188e7a,_0x5ada55;if(void 0x0!==_0x4a9c94?(_0x5ada55=_0x5ab7ca['find'](_0x5151da=>_0x5151da['index']==_0x4a9c94),_0x188e7a=_0x5ada55?.['index']):(_0x5ada55=_0x5ab7ca[0x0],_0x188e7a=_0x5ada55['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x3af545&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x188e7a)return;const _0x5d8e0d=this['_getUserPresentableContentPartDocumentRange'](_0x3af545,_0x5b3ba9,_0x5ada55);if(!_0x5d8e0d)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x3af545,'partIndex':_0x188e7a},this['_scrollToSuggestionRange'](_0x5d8e0d,!0x0);const _0x5c3387=this['_getPresentableSiblingContentPartIndex'](_0x3af545,_0x188e7a,'next');this['_aiChatBalloon']['updateContent']({'part':_0x5ada55,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x188e7a,'title':i(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x188e7a+0x1)['toString']()),'showRotator':null!==_0x5c3387,'ranges':[_0x5d8e0d],'areActionsDisabled':_0x5b3ba9['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x3af545,_0x188e7a),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x3af545,'index':_0x188e7a,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x1fae87,_0x565934,_0x366858){const {reply:_0x3c8e37}=this['getInteractionAndReplyById'](_0x1fae87),_0x179356=_0x3c8e37['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x179356['length'])return null;const _0x2ff46e=_0x179356['findIndex'](_0x278339=>_0x278339['index']==_0x565934),_0x4d9ae9='next'==_0x366858?0x1:-0x1;let _0x1ab7dd=_0x179356['at']((_0x2ff46e+_0x4d9ae9)%_0x179356['length'])['index'],_0x5f38b2=_0x179356[_0x1ab7dd];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x1fae87,_0x3c8e37,_0x5f38b2);){if(_0x1ab7dd=_0x179356['at']((_0x1ab7dd+_0x4d9ae9)%_0x179356['length'])['index'],_0x1ab7dd===_0x2ff46e)return null;_0x5f38b2=_0x179356[_0x1ab7dd];}return _0x1ab7dd;}['_getUserPresentableContentPartDocumentRange'](_0x63cbb3,_0x30fcd7,_0x1516ec){const _0x91f169=_0x30fcd7['changeGroups'];if(!_0x1516ec['hasChanges'])return null;const _0x8e0628=_0x91f169['find'](_0x2f7b3c=>_0x2f7b3c['index']==_0x1516ec['index']);if('pending'!==_0x8e0628?.['state'])return null;const _0xfd7a5c=this['_getDocumentRangeForReplyChanges'](_0x63cbb3,_0x1516ec['index']);if(!_0xfd7a5c)return null;const {range:_0x1cc19b,currentIndex:_0x447ed4}=_0xfd7a5c;return'$graveyard'==_0x1cc19b['root']['rootName']?(_0x30fcd7['setChangeGroupState'](_0x447ed4,'outdated'),null):_0xfd7a5c['range'];}['_getDocumentRangeForReplyChanges'](_0x3315fd,_0x63bd8e){const _0x968b5e=et(this['context']),{reply:_0x28a2ca,interaction:_0x417b8a}=this['getInteractionAndReplyById'](_0x3315fd),_0x1e2030=_0x28a2ca['changeGroups']['filter'](_0x1c0d1a=>'pending'==_0x1c0d1a['state']),_0x178f77=_0x1e2030['map'](_0x4dcdb0=>_0x28a2ca['changeGroups']['indexOf'](_0x4dcdb0));void 0x0===_0x63bd8e&&(_0x63bd8e=_0x178f77[0x0]);const _0x2b7208=_0x178f77['indexOf'](_0x63bd8e);if(-0x1==_0x2b7208)return null;const _0x5ec1a9=_0x1e2030[_0x2b7208],_0x2a577f=new Rt([]),_0x5ae6a3=new Rt([]);for(const _0x214dbc of _0x5ec1a9['changes'])if('removed'!=_0x214dbc['type']&&_0x5ae6a3['children']['push'](_0x214dbc['node']['cloneNode'](!0x0)),'new'!=_0x214dbc['type']){const _0x13ca40=xt(_0x4fe190=>Ot(_0x4fe190,'data-id')==_0x214dbc['id'],_0x28a2ca['documentContextContent'],!0x0);_0x2a577f['children']['push'](_0x13ca40['cloneNode'](!0x0));}if(0x0==_0x2a577f['children']['length']){if(_0x5ec1a9['changes'][0x0]['anchorId']){const _0x25507c=bt('data-id',_0x5ec1a9['changes'][0x0]['anchorId'],_0x28a2ca['documentContextContent']);_0x2a577f['children']['unshift'](_0x25507c['cloneNode'](!0x0)),_0x5ae6a3['children']['unshift'](_0x25507c['cloneNode'](!0x0)),_0x25507c['nextSibling']&&(_0x2a577f['children']['push'](_0x25507c['nextSibling']['cloneNode'](!0x0)),_0x5ae6a3['children']['push'](_0x25507c['nextSibling']['cloneNode'](!0x0)));}else{const _0x579162=_0x28a2ca['documentContextContent']['children'][0x0];if(!_0x579162)return null;_0x2a577f['children']['push'](_0x579162['cloneNode'](!0x0)),_0x5ae6a3['children']['push'](_0x579162['cloneNode'](!0x0));}}const _0x3e4041=_0x417b8a['getDocumentContext'](),_0x138813=_0x968b5e['data']['parse'](_0x3e4041['content']),_0xe07159=Dt(_0x2a577f),_0x38d860=_0x968b5e['data']['parse'](_0xe07159),_0x5639c8=_0x968b5e['data']['parse'](_0xe07159),_0x511390=_0x968b5e['model']['createPositionAt'](_0x38d860,0x0),_0x2068e7=Dt(_0x5ae6a3),_0x1b2b95={'anchor':_0x511390,'markDeletions':!0x1},_0xc06dfb=_0x968b5e['plugins']['get'](_0x143aa3)['getDiff'](_0xe07159,_0x2068e7,_0x1b2b95)['getOperations']();if(!_0xc06dfb['length'])return null;_0x968b5e['model']['change'](_0x2e94e5=>{for(const _0x4e6e43 of _0xc06dfb)if('remove'==_0x4e6e43['type']){const _0x5431c5=_0x4e6e43['sourcePosition'],_0x1d210b=_0x4e6e43['howMany'],_0x5dc496=new _0x5de5b5(_0x5431c5,_0x1d210b);_0x2e94e5['batch']['addOperation'](_0x5dc496),_0x968b5e['model']['applyOperation'](_0x5dc496);}else'marker'!==_0x4e6e43['type']&&(_0x4e6e43['baseVersion']=null,_0x4e6e43['isDocumentOperation']=!0x1,_0x2e94e5['batch']['addOperation'](_0x4e6e43),_0x968b5e['model']['applyOperation'](_0x4e6e43));});const _0x2e99a4=vt(_0x968b5e,_0xc06dfb,_0x38d860);St(_0x968b5e['model'],_0x2e99a4);const _0x5e18e9=_0x2e99a4['getFirstRange']()['start']['path']['slice'](),_0x512c11=_0x2e99a4['getFirstRange']()['end']['path']['slice'](),_0x3da5af=[];let _0x341c5a=_0x38d860,_0x1a711e=_0x5639c8;for(let _0x2d0b2f=0x0;_0x2d0b2f<_0x512c11['length'];_0x2d0b2f++){const _0x4354e7=_0x341c5a['maxOffset']-_0x512c11[_0x2d0b2f];_0x3da5af[_0x2d0b2f]=_0x1a711e['maxOffset']-_0x4354e7,_0x341c5a=_0x341c5a['getChildAtOffset'](_0x512c11[_0x2d0b2f]),_0x1a711e=_0x1a711e['getChildAtOffset'](_0x3da5af[_0x2d0b2f]);}const _0x580b8c=_0x968b5e['model']['createRange'](_0x968b5e['model']['createPositionFromPath'](_0x5639c8,_0x5e18e9),_0x968b5e['model']['createPositionFromPath'](_0x5639c8,_0x3da5af)),_0x56f52e=_0x5639c8['getChild'](0x0)['getAttribute'](Et),_0x4cb18f=Array['from'](_0x138813['getChildren']())['find'](_0x472fad=>_0x472fad['getAttribute'](Et)==_0x56f52e)['getPath'](),_0x275a5b=_0x580b8c['start']['path']['slice'](),_0x5e5f31=_0x580b8c['end']['path']['slice']();_0x275a5b[0x0]=_0x4cb18f[0x0]+_0x275a5b[0x0],_0x5e5f31[0x0]=_0x4cb18f[0x0]+_0x5e5f31[0x0];let _0x376e7a=_0x968b5e['model']['createRange'](_0x968b5e['model']['createPositionFromPath'](_0x968b5e['model']['document']['getRoot'](),_0x275a5b),_0x968b5e['model']['createPositionFromPath'](_0x968b5e['model']['document']['getRoot'](),_0x5e5f31));const _0x5727e9=_0x968b5e['model']['document']['history']['getOperations'](_0x3e4041['version']);for(const _0x5625ff of _0x5727e9)_0x376e7a=_0x561be6['_createFromRanges'](_0x376e7a['getTransformedByOperation'](_0x5625ff));return{'range':_0x376e7a,'currentIndex':_0x63bd8e};}['_integrateEditor'](_0x30b913){if(!_0x30b913['plugins']['has']('Undo'))return;const _0x5b7b77=_0x30b913['commands']['get']('undo'),_0x1acc67=_0x30b913['commands']['get']('redo');this['listenTo'](_0x5b7b77,'revert',(_0x2f7128,_0x222b9d,_0x3d64cf)=>{const _0x44c53b=this['_batchToChanges']['get'](_0x222b9d);if(!_0x44c53b)return;const _0x75f7b3=this['activeConversation']['getInteraction'](_0x44c53b['interactionId'])['getReply'](_0x44c53b['replyId']);_0x44c53b['indexes']['forEach'](_0x1691be=>_0x75f7b3['setChangeGroupState'](_0x1691be,'pending')),this['_batchToChanges']['delete'](_0x222b9d),this['_batchToChanges']['set'](_0x3d64cf,_0x44c53b);}),this['listenTo'](_0x1acc67,'revert',(_0xc95e2c,_0x1b9519,_0x50fb9f)=>{const _0x4e4e03=this['_batchToChanges']['get'](_0x1b9519);if(!_0x4e4e03)return;const _0x21e793=this['activeConversation']['getInteraction'](_0x4e4e03['interactionId'])['getReply'](_0x4e4e03['replyId']);_0x4e4e03['indexes']['forEach'](_0x5df410=>_0x21e793['setChangeGroupState'](_0x5df410,'accepted')),this['_batchToChanges']['delete'](_0x1b9519),this['_batchToChanges']['set'](_0x50fb9f,_0x4e4e03);});}async['loadConversation'](_0x1cf9c8){this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),(this['context']['plugins']['get'](_t)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x1cf9c8)['getConversation'](),await this['_startConversationSafely'](_0x1cf9c8),this['updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x1cf9c8,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x3c1047){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x1cf9c8}),this['_logError'](new _0x542443('ai-chat-conversation-not-found',this,{'error':_0x3c1047}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}async['_getLastCreatedConversationId'](){const _0x5e2cc3=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x10e351=await _0x5e2cc3['getConversations']();return _0x10e351['length']?_0x10e351[0x0]['id']:'new';}catch(_0x2f5c04){return this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x2e2dc8()}),this['_logError'](new _0x542443('ai-chat-conversation-init-failed',this,{'error':_0x2f5c04})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}['handleRemovedConversation'](_0x2b8ea0){this['activeConversation']['id']===_0x2b8ea0&&this['_startConversationSafely']();}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x1d6bbb=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x1d6bbb),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x3d1553,attributes:_0x29be9b}){await this['_handleUIUserMessage']({'userMessage':_0x3d1553,'attributes':_0x29be9b});}['getGroupId'](){const _0x2430e4=this['context']['config']['get']('collaboration.channelId');if(!_0x2430e4)throw new _0x542443('ai-chat-missing-channel-id',this);return _0x2430e4;}async['_startConversationSafely'](_0x293054){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x293054);}catch(_0x50e556){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x293054||_0x2e2dc8()}),console['error'](_0x50e556),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x4a932e){let _0x114aa5;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0x4a932e||!this['activeConversation']?_0x114aa5=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x114aa5=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x13bd38=this['getGroupId'](),_0x4efcd1=_0x4a932e||_0x2e2dc8();this['activeConversation']=new yt({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x114aa5,'conversationId':_0x4efcd1,'group':_0x13bd38,'getEditor':()=>et(this['context']),'isFromHistory':!!_0x4a932e}),this['activeConversation']['delegate']('toolDataReceived','interactionStarted')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x517c7c,_0x3e1263)=>{this['_aiChatUi']['createConversation'](_0x3e1263),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x4a932e||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x7db5e4,_0x41634b)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x41634b['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x477254,_0x4f9b5f)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x4f9b5f);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x5db7d9=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x5db7d9);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x184554=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x184554);}),this['activeConversation']['on']('webSearchFinished',(_0x1c7b56,_0x3fdd40)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x3fdd40,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x2d6e37,_0x2c81ef)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x2c81ef,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x3f7f55,_0x54767b)=>{this['_aiChatUi']['removeFeedInteraction'](_0x54767b['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x10aba5,_0x1bb7a0,_0x557c52)=>{this['updateConversationTitle'](_0x1bb7a0,_0x557c52);}),this['activeConversation']['on']('replyCreated',(_0x2a7f79,_0x1a57ec)=>{'text'===_0x1a57ec['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x1a57ec):this['_aiChatUi']['addFeedItemAISuggestion'](_0x1a57ec);}),this['activeConversation']['on']('replyContentUpdated',async(_0x57c9c6,_0x50d159)=>{await this['_updateReplyContent']({'reply':_0x50d159});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x5e924d,{reply:_0x4635cd,index:_0x3621d3,state:_0x199bda})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x4635cd['id'],'index':_0x3621d3,'state':_0x199bda}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x4635cd['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x3621d3&&this['_aiChatBalloon']?.['setState'](_0x199bda);}),this['activeConversation']['on']('contextItemAdded',(_0x3f3e96,_0x4b852d)=>{if(this['_aiChatUi']['addContextItem'](_0x4b852d['contextItem'],_0x4b852d['isLoading']),'selection'===_0x4b852d['contextItem']['type']){const _0xbb2d91=[...et(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0xbb2d91,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x2f0f89,_0x10e083)=>{this['_aiChatUi']['removeContextItem'](_0x10e083['uiId']),'current-document'==_0x10e083['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x10e083['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x580df3,_0x144dad)=>{this['_aiChatUi']['setContextItemLoading'](_0x144dad['contextItem']['uiId'],_0x144dad['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x2837f6,_0x22038f)=>{this['_aiChatUi']['setConversationContext'](_0x22038f['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x5170eb,_0x35150f)=>{this['_aiChatUi']['setAddContextOptions'](_0x35150f['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x5282cd,_0x52fe92)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x52fe92['sourceId'],_0x52fe92['source'],_0x52fe92['resources'],_0x52fe92['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x3b20c7,_0x3ea5e6)=>{this['_aiChatUi']['updateResourceState'](_0x3ea5e6['sourceId'],_0x3ea5e6['resourceId'],_0x3ea5e6['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x3d06ad,_0x53109c)=>{this['_aiChatUi']['updateCapabilities'](_0x53109c);}),this['activeConversation']['on']('modelSelected',async(_0x4f9830,_0x4728ea)=>{const _0x300c08=(await this['_aiChatModels']['getAll']())['find'](_0x4fed32=>_0x4fed32['id']===_0x4728ea['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x300c08,_0x4728ea['isDisabled']);}),this['activeConversation']['on']('error',(_0x57ff47,{error:_0x4c9cd5,interactionId:_0x4fae35,fileName:_0x5e3abe,url:_0x5e7490,sourceId:_0xa14f03,sourceLabel:_0x406ef6})=>{const _0x29fe43=_0x4fae35?_0x4fae35+':'+_0x2e2dc8():_0x2e2dc8();_0x4c9cd5['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':i(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x29fe43}):_0x4c9cd5['message']['startsWith']('ai-chat-conversation-init-failed')||_0x4c9cd5['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x29fe43}),this['_logError'](_0x4c9cd5)):_0x4c9cd5['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x5e3abe),'id':_0x29fe43}):_0x4c9cd5['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x5e7490),'id':_0x29fe43}):_0x4c9cd5['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x29fe43}):_0x4c9cd5['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x29fe43}):_0x4c9cd5['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0xa14f03&&this['_aiChatUi']['closeSourceResourceBalloon'](_0xa14f03),this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x406ef6||'source'),'id':_0x29fe43}),this['_logError'](_0x4c9cd5)):_0x4c9cd5['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x29fe43}),this['_logError'](_0x4c9cd5)):_0x4c9cd5['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x29fe43}),this['_logError'](_0x4c9cd5)):_0x4c9cd5['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x29fe43}),this['_logError'](_0x4c9cd5)):_0x4c9cd5['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x29fe43}),this['_logError'](_0x4c9cd5)):_0x4c9cd5['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x29fe43}),this['_logError'](_0x4c9cd5)):_0x4c9cd5['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x29fe43}),this['_logError'](_0x4c9cd5)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x29fe43}),this['_logError'](_0x4c9cd5));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x4a932e||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x586105,attributes:_0x53baa2}){if(!this['activeConversation'])throw new _0x542443('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x26524a=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x26524a);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x586105,'attributes':_0x53baa2});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x3dad53){this['_aiChatUi']['setIsMaximized'](_0x3dad53);}['_logError'](_0x2a9064){Ct(_0x2a9064['message']);}['_removeFromContext'](_0xd0f453){this['activeConversation']?.['removeFromContext'](_0xd0f453);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x14dfda){const [_0x517813,_0xfaeef0]=_0x14dfda['split'](':'),_0x24eec6=this['activeConversation']['getInteraction'](_0x517813),_0x2a0f97=_0x24eec6['getReply'](_0xfaeef0);return{'interaction':_0x24eec6,'reply':_0x2a0f97};}['_scrollToSuggestionRange'](_0x4a8950,_0x1472d5=!0x1){const _0x1c578f=et(this['context']),_0x94a946={'target':_0x1c578f['editing']['view']['domConverter']['viewRangeToDom'](_0x1c578f['editing']['mapper']['toViewRange'](_0x4a8950)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x1472d5};_0x1472d5&&(_0x94a946['alignToTop']=!0x0),st(_0x94a946);}['updateConversationTitle'](_0x625b05,_0x1c1a4e=!0x1){this['_aiChatUi']['setConversationTitle'](_0x625b05||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x1c1a4e);}async['_updateReplyContent']({reply:_0x481e28,renderingStrategy:_0x2a701f}){const {id:_0x1f6b79,interactionId:_0xfdc074,isDone:_0x5cc79a,type:_0x122a23,parsedContent:_0x533771}=_0x481e28,_0x5ec5b8=_0xfdc074+':'+_0x1f6b79;if('modification'===_0x122a23){const _0x2962ea=_0x481e28['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x5ec5b8,'parts':_0x2962ea,'renderingStrategy':_0x2a701f,'isDone':_0x5cc79a});}else'text'===_0x122a23&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x5ec5b8,'parsedContent':_0x533771,'renderingStrategy':_0x2a701f,'isDone':_0x5cc79a});_0x5cc79a&&_0x481e28['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x5ec5b8,_0x481e28['sources']);}async['_stopLastInteraction'](){const _0x2862f1=this['activeConversation']?.['lastInteraction'];_0x2862f1&&(_0x2862f1['stop'](),this['_aiChatUi']['stopInteraction'](_0x2862f1));}async['_flushLastInteractionUI'](){const _0x296a1c=this['activeConversation']?.['lastInteraction'];if(_0x296a1c){for await(const _0x1e7c1e of _0x296a1c['replies'])await this['_updateReplyContent']({'reply':_0x1e7c1e,'renderingStrategy':'static'});}}['_updateRatings'](_0x265f0a){const _0x1f5230={'positiveCount':_0x265f0a['changeGroups']['filter'](_0x394505=>'accepted'===_0x394505['state'])['length'],'totalCount':_0x265f0a['changeGroups']['length'],'modificationId':_0x265f0a['id']},_0x27e09c=this['activeConversation']['getInteraction'](_0x265f0a['interactionId'])['messageId'];_0x27e09c&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x27e09c,_0x1f5230);}['_registerToolDataCallback'](_0x4d46c3){let _0x1cee84=null,_0x7b33=null;this['on']('toolDataReceived',(_0x1b4148,_0x2afaa5,_0x99612e)=>{_0x99612e['id']!==_0x1cee84&&(_0x1cee84=_0x99612e['id'],_0x7b33=this['_getAIChatInteractionAPI'](_0x99612e)),_0x4d46c3(_0x2afaa5,_0x7b33);});}['_getAIChatInteractionAPI'](_0x3e9f78){const _0x5f4546=this['_aiChatUi'],_0x510885=()=>{_0x3e9f78['resetWebSearchState'](),_0x3e9f78['resetReasoningState'](),_0x5f4546['clearLoadingMessage']();},_0x54ef47=()=>{_0x3e9f78['currentReply']&&(_0x3e9f78['currentReply']['done'](),_0x3e9f78['currentReply']=void 0x0);};return{'insertTextReply':(_0x230a1c,_0x2b303c)=>{_0x54ef47(),_0x510885();const _0x4ae4d3=_0x3e9f78['currentReply']=_0x3e9f78['createReply']({'type':'text','interactionId':_0x3e9f78['id'],'content':_0x230a1c,'id':_0x2b303c||_0x2e2dc8()});return _0x54ef47(),_0x4ae4d3;},'insertCustomElement':async(_0x38138e,_0x3d8c02)=>(_0x54ef47(),_0x510885(),_0x5f4546['addFeedItemCustomElement'](_0x38138e,_0x3d8c02||_0x2e2dc8())),'setLoadingMessage':_0x494d57=>{_0x5f4546['setLoadingMessage'](_0x494d57);},'clearLoadingMessage':()=>{_0x5f4546['clearLoadingMessage']();}};}}const F='ai-selection';class D extends _0x118815{constructor(_0x30bd8a){super(_0x30bd8a),this['context']['config']['define']('ai.models.showModelSelector',!0x0);}['_outputDataProcessor'];['_displayedFakeSelectionId']=null;['_displayedFakeSelectionLocked']=!0x1;['_sessionId'];static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['sessionId'](){if(!this['_sessionId']){const _0x142f82=et(this['context']),_0x5759f8=_0x142f82['plugins']['has']('RealTimeCollaborationClient')&&_0x142f82['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x5759f8||_0x2e2dc8();}return this['_sessionId'];}async['getDocumentData'](){const _0x13d80f=et(this['context']),_0x1fdd68=_0x13d80f['model'],_0x44fb94=_0x13d80f['data']['toView'](_0x1fdd68['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x20b5a6=new Nt(_0x13d80f['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x44fb94,_0x20b5a6);let _0x1bffeb=await this['_getDocumentDataStringFromView'](_0x44fb94);const _0x53d36e=this['_getMarkersInDocumentOrder'](),_0x432c3a=[];for(const _0xb975b6 of _0x53d36e){const _0x575b32='<'+_0xb975b6['name']+':start></'+_0xb975b6['name']+':start>',_0x470f12=_0x1bffeb['indexOf'](_0x575b32);_0x1bffeb=_0x1bffeb['substring'](0x0,_0x470f12)+_0x1bffeb['substring'](_0x470f12+_0x575b32['length']);const _0x291d02='<'+_0xb975b6['name']+':end></'+_0xb975b6['name']+':end>',_0x31e0b9=_0x1bffeb['indexOf'](_0x291d02);_0x1bffeb=_0x1bffeb['substring'](0x0,_0x31e0b9)+_0x1bffeb['substring'](_0x31e0b9+_0x291d02['length']),_0x432c3a['push']({'markerName':_0xb975b6['name'],'start':_0x470f12,'end':_0x31e0b9,'htmlFragment':_0x1bffeb['substring'](_0x470f12,_0x31e0b9)});}return{'content':_0x1bffeb,'version':_0x13d80f['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x432c3a};}async['afterInit'](){this['context']instanceof dt?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x50f530,_0x537ac4)=>{_0x537ac4['on']('ready',()=>{this['_integrateEditor'](_0x537ac4);});});}['_setOutputDataProcessor'](_0x3a3be6){this['_outputDataProcessor']=_0x3a3be6;}async['_getDocumentDataStringFromView'](_0x27bdf2){let _0xe73b13;const _0x4c8c69=et(this['context']);if(this['_outputDataProcessor']){const _0x4f21b8=_0x4c8c69['data']['processor']['domConverter']['viewToDom'](_0x27bdf2),_0x328478=await this['_outputDataProcessor'](_0x4f21b8);_0xe73b13=_0x4c8c69['data']['processor']['htmlWriter']['getHtml'](_0x328478);}else _0xe73b13=_0x4c8c69['data']['processor']['toData'](_0x27bdf2);return _0xe73b13;}['_integrateEditor'](_0x4a30c5){_0x4a30c5['conversion']['for']('editingDowncast')['markerToHighlight']({'model':F,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x4a30c5['conversion']['for']('dataDowncast')['markerToElement']({'model':F,'view':(_0x50cb57,{writer:_0x4bac55,options:_0x43b08d})=>_0x43b08d['convertAiChatSelectionMarker']?_0x4bac55['createUIElement'](_0x50cb57['markerName']+':'+(_0x50cb57['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x1abbb5,_0x14f52f,_0x2528fd=!0x1,_0x2d4d6f=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x2d4d6f)return!0x1;const _0x44f416=et(this['context'])['model'];return _0x44f416['change'](_0x5e42ab=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x14f52f,this['_displayedFakeSelectionLocked']=_0x2528fd;let _0x24fb39=0x0;for(let _0x1c3b87 of _0x1abbb5){const _0x2be7a3=F+':'+_0x24fb39;if(_0x1c3b87['start']['isAtEnd']){const _0x14b40b=_0x1c3b87['start']['getLastMatchingPosition'](({item:_0x48b0ad})=>!_0x44f416['schema']['isContent'](_0x48b0ad),{'boundaries':_0x1c3b87});_0x1c3b87=_0x5e42ab['createRange'](_0x14b40b,_0x1c3b87['end']);}_0x5e42ab['addMarker'](_0x2be7a3,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1c3b87}),_0x24fb39++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x291e2f){if(this['_displayedFakeSelectionId']!=_0x291e2f)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x592fcd=et(this['context']),_0x3b8f2e=_0x592fcd['model']['markers']['getMarkersGroup'](F);return _0x592fcd['model']['change'](_0x14c8b3=>{for(const _0x113632 of _0x3b8f2e)_0x14c8b3['removeMarker'](_0x113632);}),!0x0;}async['modelToDataWithIds'](_0x5efe71){const _0x25bcb4=et(this['context']),_0xac1692=_0x25bcb4['data']['toView'](_0x5efe71),_0x3786eb=new Nt(_0x25bcb4['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0xac1692,_0x3786eb),this['_getDocumentDataStringFromView'](_0xac1692);}['_setDataIdsOnChildren'](_0x1e33ef,_0x443e4f){let _0x358daa=!0x1;const _0x593d09=new Set();for(const _0x5858b0 of _0x1e33ef['getChildren']()){const _0x5280a5=_0x5858b0['is']('emptyElement')||_0x5858b0['is']('containerElement');if(!_0x5858b0['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x5858b0,_0x443e4f)||_0x5280a5)&&(_0x443e4f['setAttribute']('data-id',this['_nextDataId'](_0x593d09),_0x5858b0),_0x358daa=!0x0);}return _0x358daa;}['_nextDataId'](_0x2e1c6c){let _0x59cf3e;do{_0x59cf3e='';for(let _0x433126=0x0;_0x433126<0x4;_0x433126++)_0x59cf3e+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x2e1c6c['has'](_0x59cf3e));return _0x2e1c6c['add'](_0x59cf3e),_0x59cf3e;}['getSelectionText'](){const {model:_0x574ce4}=et(this['context']),_0x6792f1=_0x574ce4['document']['selection'],_0x56656f=[];for(const _0x22c3bd of _0x6792f1['getRanges']())for(const _0x2c4a18 of _0x22c3bd['getItems']())_0x2c4a18['is']('$textProxy')?_0x56656f['push'](_0x2c4a18['data']):_0x2c4a18['is']('element')&&_0x56656f['length']>0x0&&'\x20'!==_0x56656f[_0x56656f['length']-0x1]&&_0x56656f['push']('\x20');return _0x56656f['length']?'\x22'+_0x56656f['join']('')['trim']()+'\x22':i(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_getMarkersInDocumentOrder'](){const _0xe1c2c3=et(this['context'])['model'];return Array['from'](_0xe1c2c3['markers']['getMarkersGroup'](F))['sort']((_0x124f1a,_0x450b84)=>_0x124f1a['getStart']()['isBefore'](_0x450b84['getStart']())?-0x1:_0x124f1a['getStart']()['isAfter'](_0x450b84['getStart']())?0x1:0x0);}}const pt=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],Lt=[...pt,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class ha{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0xcc2a48){this['options']={'delay':_0xcc2a48['delay']??0x14,'textNodeStyle':_0xcc2a48['textNodeStyle'],'onStreamUpdate':_0xcc2a48['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x578622,targetElement:_0x4eefca,abortSignal:_0x5dfe23}){this['isStreaming']&&this['stop'](),_0x5dfe23?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x255d9a(_0x578622,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x2fa4c6=0x0;_0x2fa4c6<this['currentIndex'];_0x2fa4c6++)this['nodesList'][_0x2fa4c6]['shouldBeStreamed']=!0x0;do{const _0x29897b=Date['now'](),_0x1eea94=this['nodesList'][this['currentIndex']],_0x250939=_0x29897b-this['lastUpdateTime'];if(_0x1eea94){_0x1eea94['shouldBeStreamed']=!0x0;let _0x33b20f=_0x1eea94['parent'];for(;_0x33b20f;)_0x33b20f['shouldBeStreamed']=!0x0,_0x33b20f=_0x33b20f['parent'];}if(_0x250939<this['options']['delay'])try{const {promise:_0x12d7de,abortController:_0x423257}=Us(this['options']['delay']-_0x250939);this['timeoutAbortController']=_0x423257,await _0x12d7de;}catch(_0x2ae047){return;}_0x308f05(_0x4eefca,'<'+_0x4eefca['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x4eefca['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']++,this['lastUpdateTime']=Date['now']();}while(this['currentIndex']<this['nodesList']['length']);this['currentIndex']=this['nodesList']['length'],this['isStreaming']=!0x1;}['reset'](){this['isStreaming']=!0x1,this['document']=null,this['nodesList']=[],this['currentIndex']=0x0,this['timeoutAbortController']=null;}['cleanUpAnimations']({targetElement:_0x59aacc}){Array['from'](_0x59aacc['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0xc68a66=>{_0xc68a66['replaceWith'](_0xc68a66['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x3183ee){let _0xe79405='';if(function(_0x14643c){return _0x14eea4(_0x14643c);}(_0x3183ee)){for(const _0x245d39 of _0x3183ee['children'])_0xe79405+=this['renderNode'](_0x245d39);}else{if(Ls(_0x3183ee)){if(!_0x3183ee['shouldBeStreamed'])return'';const _0x15cf12=_0x3183ee,_0x5e9e0f=Object['entries'](_0x15cf12['attribs'])['map'](([_0x2aa08e,_0x1850ad])=>_0x2aa08e+'=\x22'+_0x1850ad+'\x22')['join']('\x20');_0xe79405+='<'+_0x15cf12['tagName']+(_0x5e9e0f?'\x20'+_0x5e9e0f:'')+'>';for(const _0x2f5831 of _0x260bf8(_0x15cf12))_0xe79405+=this['renderNode'](_0x2f5831);_0xe79405+='</'+_0x15cf12['tagName']+'>';}else{if(!Ts(_0x3183ee))return'';if(!_0x3183ee['shouldBeStreamed'])return'';!function(_0x10315c){if(!_0x10315c['parent']||!Ls(_0x10315c['parent']))return!0x1;if(!ys['includes'](_0x10315c['parent']['tagName']))return!0x1;return!_0x25d39e(_0x10315c)['match'](/^\s*[<>]\s*$/);}(_0x3183ee)?_0xe79405+=_0x3688ac(_0x3183ee):_0xe79405+=_0x3688ac(new _0x1075d8('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x3183ee]));}}return _0xe79405;}['getParsedDocumentNodeList'](){const _0x46065c=[];return function(_0x1c6977,_0xcb192f){const _0x5eb4de=_0x12c3f7=>{if(_0xcb192f(_0x12c3f7),_0x12c3f7 instanceof _0x673436)for(let _0x11d34b=0x0;_0x11d34b<_0x12c3f7['children']['length'];_0x11d34b++){const _0x2ad065=_0x12c3f7['children'][_0x11d34b];_0x5eb4de(_0x2ad065);}};for(let _0x226460=0x0;_0x226460<_0x1c6977['children']['length'];_0x226460++)_0x5eb4de(_0x1c6977['children'][_0x226460]);}(this['document'],_0x1013e1=>{if(Ts(_0x1013e1)){const _0x1326fc=this['splitTextNodeIntoWordNodes'](_0x1013e1);_0x1326fc['length']&&_0x46065c['push'](..._0x1326fc);}_0x1013e1['isWordSplitSource']||_0x1013e1['isWordSplitResult']||_0x46065c['push'](_0x1013e1);}),_0x46065c;}['splitTextNodeIntoWordNodes'](_0x58a7dc){if(_0x58a7dc['isWordSplitSource']||_0x58a7dc['isWordSplitResult'])return[];const _0x28181c=_0x25d39e(_0x58a7dc)['match'](/(?:\s*\S+\s*)/g),_0xc12f84=[];if(_0x28181c&&_0x28181c['length']>0x1){for(const _0x6659db of _0x28181c){const _0x35a002=new _0x2ef03d(_0x6659db);_0x35a002['isWordSplitResult']=!0x0,_0x11de48(_0x58a7dc,_0x35a002),_0xc12f84['push'](_0x35a002);}_0x58a7dc['isWordSplitSource']=!0x0,_0xb8c25a(_0x58a7dc);}return _0xc12f84;}}const ys=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function Ts(_0x424a00){return _0x59e3c1(_0x424a00);}function Ls(_0x37d65e){return _0x512964(_0x37d65e);}function Us(_0x408ff7){const _0x3ab26d=new AbortController();return{'promise':new Promise((_0x367f29,_0x32b592)=>{const _0x4e9d06=setTimeout(_0x367f29,_0x408ff7);_0x3ab26d['signal']['addEventListener']('abort',()=>{clearTimeout(_0x4e9d06),_0x32b592();});}),'abortController':_0x3ab26d};}class Fr extends _0x15a8cb{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x5491a7){super();const _0x2ce0f1=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0x5491a7,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x2ce0f1['if']('isDone','ck-ai-chat__feed__item_done'),_0x2ce0f1['if']('isVisible','ck-hidden',_0x2339fe=>!_0x2339fe),'ck-ai-chat__feed__text-item'],'data-cke-ai-id':this['options']['id']},'children':this['children']});}['markAsDone'](){this['htmlStreamer']['cleanUpAnimations']({'targetElement':this['element']}),this['element']['querySelectorAll']('[data-id]')['forEach'](_0x353467=>{_0x353467['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x3ee0cd,_0x287167,_0x3f946f){await this['htmlStreamer']['stream']({'document':_0x3ee0cd,'targetElement':_0x287167,'abortSignal':_0x3f946f});}}class oa extends _0x15a8cb{['showChangesToggleView'];constructor(_0x569a78,_0x53ac8b){super(_0x569a78),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Zn(_0x569a78),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':i(_0x569a78,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x53ac8b['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x6fae46=>_0x6fae46?_0x34d7d0:_0x4218b0),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x4e3472=new _0x2ae97e();_0x4e3472['content']=_0x20ff08,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x53ac8b['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x4e3472,{'tag':'span','children':[i(_0x569a78,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Zn extends _0x5bfd84{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const Or={'accepted':_0x2b1fdc,'rejected':_0x1c0feb,'outdated':_0x1c0feb};class ps extends _0x15a8cb{['stateIconView'];constructor(_0x4440c7){super(_0x4440c7);const _0x287378=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new Nr(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x287378['to']('state',_0x183827=>'ck-ai-suggestion__content-part-state_'+_0x183827),_0x287378['if']('isVisible','ck-hidden',_0x14d28f=>!_0x14d28f)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x287378['to']('state',_0x5ef376=>{switch(_0x5ef376){case'accepted':return i(_0x4440c7,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return i(_0x4440c7,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return i(_0x4440c7,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x3e89fe){this['state']=_0x3e89fe;}}class Nr extends _0x2ae97e{constructor(){super(),this['set']('state','accepted'),this['content']=Or[this['state']],this['on']('change:state',()=>{this['content']=Or[this['state']];});}}class us extends _0x3da665{['_applyButton'];['_suggestButton'];constructor(_0x29908f,_0x1dc735,_0x3b2d2b){super(_0x29908f);const _0x25b652=Boolean(_0x3b2d2b);this['set']('isEnabled',!_0x25b652),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0xe9bd23=[];if(_0x25b652){const _0x3a96f9=new _0x5bfd84(_0x29908f);_0x3a96f9['set']({'label':i(_0x29908f,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':tc}),_0xe9bd23['push'](_0x3a96f9);}else{_0x1dc735['includes']('applySuggestion')&&(this['_applyButton']=new _0x5bfd84(_0x29908f),this['_applyButton']['set']({'label':i(_0x29908f,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x2b1fdc}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0xe9bd23['push'](this['_applyButton'])),_0x1dc735['includes']('insertSuggestion')&&(this['_suggestButton']=new _0x5bfd84(_0x29908f),this['_suggestButton']['set']({'label':i(_0x29908f,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x3ecbda}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0xe9bd23['push'](this['_suggestButton']));const _0x187fdc=new _0x5bfd84(_0x29908f);_0x187fdc['set']({'label':i(_0x29908f,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x1c0feb}),_0x187fdc['bind']('isEnabled')['to'](this),_0x187fdc['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0xe9bd23['push'](_0x187fdc);}this['items']['addMany'](_0xe9bd23);const _0x59bd9f=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x59bd9f['if']('isVisible','ck-hidden',_0x2dce25=>!_0x2dce25)]}});}['setButtonsVisibility']({showApplyButton:_0x4a6b9a,showSuggestButton:_0x16035d}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x4a6b9a),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x16035d);}}class vn extends _0x15a8cb{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x21cf2a,{part:_0x2f4026,uiIndex:_0x4397db,availableActions:_0x3e2b9,areActionsDisabled:_0x1539b3}){super(_0x21cf2a),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new us(_0x21cf2a,_0x3e2b9,_0x1539b3),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x2f4026['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x2f4026['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x2f4026['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new ps(_0x21cf2a),this['titleLabelView']=new Sn(_0x21cf2a,_0x4397db),this['children']=this['createCollection'](),this['children']['addMany']([this['titleLabelView'],this['toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__title']},'children':this['children']}),this['on']('change:state',(_0x1868d3,_0x4efb59,_0x10613e,_0x32544d)=>{'pending'===_0x32544d?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x10613e?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x10613e),this['children']['add'](this['stateView']));});}}class Sn extends _0x15a8cb{constructor(_0x5bf311,_0x4b88d6){super(_0x5bf311),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[i(_0x5bf311,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x4b88d6['toString']())]});}}class as extends _0x15a8cb{['htmlStreamer'];constructor(_0x228f90){super(_0x228f90),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async['update']({part:_0x11f288,renderingStrategy:_0xd715d5,abortSignal:_0x8e1de1}){'streaming'===_0xd715d5?await this['htmlStreamer']['stream']({'document':_0x11f288['content'],'targetElement':this['element'],'abortSignal':_0x8e1de1}):this['element']['innerHTML']=Dt(_0x11f288['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class na extends _0x15a8cb{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x4a6a13,{part:_0x570b98,uiIndex:_0x2bbbf0,areActionsDisabled:_0x4ac7df,availableActions:_0x43e314}){super(_0x4a6a13);const _0x5f4362=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x379077=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x4ac7df;};this['on']('change:state',_0x379077),this['on']('change:isDone',_0x379077),_0x379077(),this['_children']=this['createCollection'](),this['_headerView']=new vn(_0x4a6a13,{'part':_0x570b98,'uiIndex':_0x2bbbf0,'availableActions':_0x43e314,'areActionsDisabled':_0x4ac7df}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...pt)['to'](this),this['_streamableContentView']=new as(_0x4a6a13),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x5f4362['to']('state',_0x1c312f=>'ck-ai-suggestion__body__content-part_'+_0x1c312f),_0x5f4362['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x5f4362['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x5f4362['if']('isVisible','ck-hidden',_0x4df12f=>!_0x4df12f)]},'children':this['_children'],'on':{'mouseenter':_0x5f4362['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x570b98['index']});}),'mouseleave':_0x5f4362['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x570b98['index']});}),'click':_0x5f4362['to'](_0x1c1ac8=>{const _0x26bfd2=_0x1c1ac8['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x26bfd2)&&this['fire']('showChangeInText',{'index':_0x570b98['index']});})}});}async['updateContent']({part:_0x377834,renderingStrategy:_0xe27aea,showUnchangedParts:_0x1df418=!0x1,abortSignal:_0x2bf099}){this['partDefinition']=_0x377834,this['isVisible']=this['partDefinition']['hasChanges']||_0x1df418,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x377834,'renderingStrategy':_0xe27aea,'abortSignal':_0x2bf099});}['markAsDone'](){this['isDone']=!0x0;}}class N extends _0x204e9f(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x1d7d00){const _0x14df49=this['createTask'](_0x1d7d00);return this['queue']['push'](_0x14df49),this['_processQueue'](),_0x14df49['completePromise'];}['abort'](){this['isProcessing']&&(this['_abortController']['abort'](),this['_abortController']=void 0x0,this['queue']=[],this['fire']('_queueEmpty'),this['isProcessing']=!0x1);}get['queueEmptyPromise'](){return this['queue']['length']||this['isProcessing']?new Promise(_0x2027cf=>{this['once']('_queueEmpty',()=>{_0x2027cf();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x48e29b=this['queue']['shift']();try{await _0x48e29b['callback'](this['_abortController']['signal']),_0x48e29b['resolve']();}catch(_0x306a7c){_0x48e29b['reject'](_0x306a7c);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x5ddcc0){let _0x12e6c6,_0x361913;const _0x46bac2=new Promise((_0x6462cc,_0xeb7cc1)=>{_0x12e6c6=_0x6462cc,_0x361913=_0xeb7cc1;});return{'callback':_0x5ddcc0,'resolve':_0x12e6c6,'reject':_0x361913,'completePromise':_0x46bac2};}}class Ze extends Fr{constructor(_0x29be2b){super(_0x29be2b),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x29be2b['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x1a0f15){this['element']['innerHTML']=_0x1a0f15;}}const X=['applySuggestion','insertSuggestion'];class ra extends _0x15a8cb{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x55e7c0,_0x4177f1=[...X],_0x37da93){super(_0x55e7c0);const _0x29a052=this['bindTemplate'],_0x4ac430=Boolean(_0x37da93);if(this['set']('isEnabled',!_0x4ac430),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x4ac430){const _0x3c6e69=new _0x5bfd84(_0x55e7c0);_0x3c6e69['set']({'label':i(_0x55e7c0,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':tc});const _0x1b7608=new _0x15a8cb(_0x55e7c0);_0x1b7608['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[i(_0x55e7c0,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x3c6e69]}]}),this['children']['add'](_0x1b7608);}else this['_applyChangesButton']=new _0x5bfd84(_0x55e7c0),this['_applyChangesButton']['set']({'label':i(_0x55e7c0,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x4177f1['includes']('applySuggestion'),'class':'ck-ai-button-primary'}),this['_insertSuggestionsButton']=new _0x5bfd84(_0x55e7c0),this['_insertSuggestionsButton']['set']({'label':i(_0x55e7c0,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x4177f1['includes']('insertSuggestion'),'class':'ck-ai-button-secondary'}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x3ef3d7=>{_0x3ef3d7['bind']('isEnabled')['to'](this);}),this['children']['addMany']([this['_applyChangesButton'],this['_insertSuggestionsButton']]);this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x29a052['if']('isVisible','ck-hidden',_0x169a80=>!_0x169a80)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x42d936){this['isVisible']=_0x42d936;}['_switchButtonLabelsPlurality'](_0x54cd68){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x54cd68?(this['_applyChangesButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class Sr extends _0x15a8cb{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x1aedfa,_0x4f44c6){super(_0x1aedfa),this['bodyCollection']=_0x4f44c6,this['children']=this['createCollection'](),this['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources',this['bindTemplate']['if']('isVisible','ck-hidden',_0x4acfc6=>!_0x4acfc6)]},'children':this['children']});const _0xcac83e=new _0x15a8cb(this['locale']),_0x4f3bb7=new _0x2ae97e();_0x4f3bb7['content']=_0x1ce37c,_0xcac83e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x4f3bb7,{'tag':'span','children':[{'text':i(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0xcac83e),this['_setupBalloonPanel'](_0x1aedfa);}['addSource'](_0x4fa0ab){this['children']['add'](new qr(this['locale'],_0x4fa0ab,this['balloonPanelView']));}['_setupBalloonPanel'](_0x37aa30){this['balloonPanelView']=new _0x1ddc71(_0x37aa30),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class qr extends _0x5bfd84{['balloonPanelView'];['source'];constructor(_0x485dfb,_0x351726,_0x154771){super(_0x485dfb),this['source']=_0x351726,this['balloonPanelView']=_0x154771,this['set']({'label':_0x351726['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x17209b=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x17209b['to'](()=>{window['open'](_0x351726['url'],'_blank');}),'mouseenter':_0x17209b['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x17209b['to'](()=>{this['_hideTooltip']();})}}),_0x351726['favicon']){const _0x4ecc64=new _0x15a8cb(_0x485dfb);_0x4ecc64['setTemplate']({'tag':'img','attributes':{'src':_0x351726['favicon']||_0x1ce37c,'alt':_0x351726['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x4ecc64);}else this['set']('icon',_0x1ce37c);}['_createTooltipContentView'](_0x35792f,_0x4edb6f){const _0x58d9e0=new _0x15a8cb(_0x35792f),_0x6e6625=[];let _0x2aebce;_0x4edb6f?.['favicon']?(_0x2aebce=new _0x15a8cb(_0x35792f),_0x2aebce['setTemplate']({'tag':'img','attributes':{'src':_0x4edb6f['favicon'],'alt':_0x4edb6f['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x2aebce=new _0x2ae97e(),_0x2aebce['content']=_0x1ce37c,_0x2aebce['extendTemplate']({'attributes':{'alt':_0x4edb6f['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x6e6625['push'](_0x2aebce);const _0x5bf09e=new _0x15a8cb(_0x35792f);_0x5bf09e['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x4edb6f['url']},'children':[{'text':new URL(_0x4edb6f['url'])?.['hostname']}]}),_0x6e6625['push'](_0x5bf09e);const _0x477d20=new _0x15a8cb(_0x35792f);_0x477d20['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x6e6625});const _0x5930e8=new _0x15a8cb(_0x35792f);return _0x5930e8['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x4edb6f['title']['length']>0x190?_0x4edb6f['title']['substring'](0x0,0x190)+'...':_0x4edb6f['title']}]}),_0x58d9e0['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x477d20,_0x5930e8]}),_0x58d9e0;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[_0x1ddc71['defaultPositions']['northArrowSouth'],_0x1ddc71['defaultPositions']['northArrowSouthWest'],_0x1ddc71['defaultPositions']['northArrowSouthEast']],'limiter':document['querySelector']('.ck-ai-chat')}),this['balloonPanelView']['show']();}['_hideTooltip'](){this['balloonPanelView']['hide']();}['_updateTooltipContent'](){this['balloonPanelView']['content']['get'](0x0)?.['destroy'](),this['balloonPanelView']['content']['clear']();const _0x3e26ef=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x3e26ef);}}class ca extends _0x15a8cb{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x373fee,_0x3b60a7){super(_0x373fee);const {areActionsDisabled:_0x3a314a,showUnchangedParts:_0x3ddd5a,availableActions:_0x3ea4a3}=_0x3b60a7;this['_areActionsDisabled']=_0x3a314a,this['_showUnchangedParts']=_0x3ddd5a,this['_availableActions']=_0x3ea4a3,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new N(),this['_emptyPartsWarningView']=new Ze({'id':'empty-parts-warning','initialContent':i(_0x373fee,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new ra(_0x373fee,_0x3b60a7['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sr(this['locale'],_0x3b60a7['bodyCollection']),_0x3b60a7['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...pt)['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView'],this['_actionsView'],this['_sourcesView']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0x2d91fb,renderingStrategy:_0x20cc4a,abortSignal:_0x344508}){this['_children']['length']?_0x2d91fb['forEach'](_0x24d64c=>{const _0x560698=this['_cachedContentParts']['findIndex'](_0x4792e8=>_0x4792e8['index']==_0x24d64c['index']);-0x1===_0x560698?this['_cachedContentParts']['push'](_0x24d64c):this['_cachedContentParts'][_0x560698]=_0x24d64c;}):this['_cachedContentParts']=_0x2d91fb;const _0x41dff5=this['_showUnchangedParts']?_0x2d91fb:_0x2d91fb['filter'](_0xb1aeb5=>_0xb1aeb5['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x41dff5['length']>0x1);for(const _0x5dbfe8 of _0x41dff5)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x442633=>{let _0x3a3d4c=this['getPartView'](_0x5dbfe8['index']);_0x3a3d4c||(_0x3a3d4c=new na(this['locale'],{'part':_0x5dbfe8,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x3a3d4c['delegate'](...pt)['to'](this),this['_children']['add'](_0x3a3d4c),this['hasPendingParts']=!0x0),await _0x3a3d4c['updateContent']({'part':_0x5dbfe8,'renderingStrategy':_0x20cc4a,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x442633}),_0x3a3d4c['markAsDone']();});return _0x344508?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x317fb8,_0x1e18eb){const _0x2d01c1=this['getPartView'](_0x317fb8);_0x2d01c1&&(_0x2d01c1['state']=_0x1e18eb),this['hasPendingParts']='pending'==_0x1e18eb||Array['from'](this['_children'])['some'](_0x586e84=>'pending'==_0x586e84['state']);}['setPartActive'](_0xed12e0,_0x32ca66){if(!0x1===_0xed12e0){for(const _0x541d24 of this['_children'])_0x541d24['isActive']=!0x1;}else{const _0xcad786=this['getPartView'](_0xed12e0);_0xcad786&&(_0xcad786['isActive']=_0x32ca66);}}['updateSources'](_0x472215){_0x472215['forEach'](_0x22b6c8=>this['_sourcesView']['addSource'](_0x22b6c8)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x4aeb1c){return this['_children']['find'](_0x20c50c=>_0x20c50c['partDefinition']['index']==_0x4aeb1c)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x1d1558=!this['_cachedContentParts']['find'](({hasChanges:_0x390aec})=>_0x390aec),_0x39dfcd=!!this['_cachedContentParts']['find'](({hasChanges:_0x5dd484})=>!_0x5dd484);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x39dfcd,_0x1d1558?this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_children']['forEach'](_0x4090e=>_0x4090e['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0xd3a308=>_0xd3a308['partDefinition']['hasChanges'])['length']>0x0;}}class gn extends _0x15a8cb{['bodyView'];['children'];['headerView'];constructor(_0x1b8586,_0x13aab2,_0x42dac5){super(_0x1b8586);const {showDiff:_0xf6eb07,areActionsDisabled:_0x512fc6,showUnchangedParts:_0x4c938c,availableActions:_0x1a898b}=_0x13aab2;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new oa(_0x1b8586,{'showDiff':_0xf6eb07}),this['headerView']['on']('toggleShowChanges',(_0x2f2d19,_0x1f2444)=>{this['areChangesVisible']=_0x1f2444['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x1f2444['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new ca(_0x1b8586,{'areActionsDisabled':_0x512fc6,'showUnchangedParts':!!_0x4c938c,'availableActions':_0x1a898b,'bodyCollection':_0x42dac5}),this['bodyView']['delegate'](...pt)['to'](this),this['bodyView']['bind']('isTrackChangesOn')['to'](this),this['children']['add'](this['bodyView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x2249ff){await this['bodyView']['updateContentParts'](_0x2249ff);}['updateSources'](_0x2ef30d){this['bodyView']['updateSources'](_0x2ef30d);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Qe extends Fr{['containerView'];constructor(_0x439e27,_0x3843d0,_0x48eb47){super(_0x3843d0),this['set']('isTrackChangesOn',!0x1),this['containerView']=new gn(_0x439e27,{'showDiff':_0x3843d0['showDiff'],'areActionsDisabled':_0x3843d0['areActionsDisabled'],'availableActions':_0x3843d0['availableActions']},_0x48eb47),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x1f78aa,_0x6c70b6)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x6c70b6['showDiff']});}),this['containerView']['bind']('isTrackChangesOn')['to'](this),this['containerView']['on']('like',()=>{this['fire']('like',{'replyId':this['options']['id']});}),this['containerView']['on']('dislike',()=>{this['fire']('dislike',{'replyId':this['options']['id']});}),this['containerView']['on']('showChangeInText',(_0x1c7ba0,{index:_0x11831f})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x11831f});}),this['containerView']['on']('applySuggestion',(_0x4b920d,{index:_0x5ce7cb}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x5ce7cb});}),this['containerView']['on']('insertSuggestion',(_0x4abf7e,{index:_0x535821}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x535821});}),this['containerView']['on']('rejectSuggestion',(_0x129449,{index:_0x3e2259})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3e2259});}),this['containerView']['on']('mouseOverSuggestion',(_0x2bb5c2,{index:_0x459413})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x459413});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x421a26,{index:_0x569834})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x569834});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x526a37){await this['containerView']['updateContent'](_0x526a37);}['updatePartState'](_0x138625,_0x37537b){this['containerView']['bodyView']['updatePartState'](_0x138625,_0x37537b);}['setPartActive'](_0x40ee24,_0x5c24b5){!0x1===_0x40ee24?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x40ee24,_0x5c24b5);}['updateSources'](_0x5a0d8c){this['containerView']['updateSources'](_0x5a0d8c);}['getPartView'](_0x14a429){return this['containerView']['bodyView']['getPartView'](_0x14a429);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class Xe extends Fr{['replyContainer'];['_bodyCollection'];constructor(_0x2b1445,_0x213516,_0x131628){super(_0x213516),this['_bodyCollection']=_0x131628,this['locale']=_0x2b1445,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x15a8cb(),this['replyContainer']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-chat__feed__ai-reply-container']}}),this['children']['add'](this['replyContainer']);}async['render'](){super['render'](),this['options']['initialContent']&&(await this['updateContent']({'parsedContent':Ni(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x48422b,renderingStrategy:_0x4e8fdb,abortSignal:_0xbc0891}){'streaming'===_0x4e8fdb?await this['streamIntoElement'](_0x48422b,this['replyContainer']['element'],_0xbc0891):this['replyContainer']['element']['innerHTML']=_0x3688ac(_0x48422b);}['updateSources'](_0x48d7a2){const _0x4cdbaf=new Sr(this['locale'],this['_bodyCollection']);_0x4cdbaf['children']['addMany'](_0x48d7a2['map'](_0x1f211e=>new qr(this['locale'],_0x1f211e,_0x4cdbaf['balloonPanelView']))),_0x4cdbaf['isVisible']=!0x0,this['children']['add'](_0x4cdbaf);}}class Ci extends _0x1e066a{constructor(_0x31a8cf=void 0x0){super();const _0xb34e8c=_0x31a8cf?'ck-ai-spinner_'+_0x31a8cf:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0xb34e8c]}});}}const xn={'file':_0x56f9a2,'document':_0x51d2a2,'web-resource':_0x5acb26,'text':_0x56f9a2,'selection':_0x16211b,'mcp-tool-context':_0x51d2a2},Wr='ck-ai-chat-context-chip',Yr='ck-ai-chat-context-chip_wide',$r='ck-ai-chat-context-chip_document',Qr='ck-ai-chat-context-chip__label',Xr='ck-ai-chat-context-chip__type-icon',Zr='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class Vo extends _0x5bfd84{constructor(_0xe954ba,_0x5c6d39,_0x424a4b,_0xf2b8df,_0x819149=!0x1){super(_0xe954ba),this['_isAnimationOnEnterEnabled']=_0xf2b8df,this['_initializeProperties'](_0x5c6d39,_0x424a4b,_0x819149),this['_setupTemplate']();}['render'](){super['render'](),this['_isAnimationOnEnterEnabled']&&this['element']&&(this['element']['classList']['add']('ck-ai-chat-context-chip_new-chip'),this['_handleAnimationEndOnce'](this['element'],()=>{this['element']&&this['element']['classList']['remove']('ck-ai-chat-context-chip_new-chip');}));}['disableAnimationOnEnter'](){this['_isAnimationOnEnterEnabled']=!0x1,this['element']&&this['element']['classList']['remove']('ck-ai-chat-context-chip_new-chip');}['_initializeProperties'](_0x2245be,_0x5e6cc2,_0x510595){this['set']('label',_0x2245be['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x2245be['type']),this['set']('id',_0x2245be['uiId']),this['set']('readonly',_0x5e6cc2),this['set']('isLoading',_0x510595);}['_setupTemplate'](){const _0x53fe88=this['_createIconView'](),_0x1fe64d=this['_createRemoveButton'](),_0x4f01a0=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x4f01a0),'children':this['_createTemplateChildren'](_0x53fe88,_0x1fe64d,_0x4f01a0)});}['_createTemplateAttributes'](_0x2065f7){return{'class':[Wr,_0x2065f7['if']('itemType',$r,_0x2c2846=>'document'==_0x2c2846),_0x2065f7['if']('itemType',Yr,_0x1dfe0c=>'selection'==_0x1dfe0c)],'data-cke-tooltip-text':_0x2065f7['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':Zr};}['_createTemplateChildren'](_0x56e4d2,_0x1c258e,_0xc9436f){const _0x22952c=this['_createLabelElement'](_0xc9436f),_0x2e24f4=this['_createLoaderIcon']();return this['readonly']?[_0x56e4d2,_0x22952c]:[_0x56e4d2,_0x2e24f4,_0x22952c,_0x1c258e];}['_createLabelElement'](_0x2629d0){return{'tag':'span','attributes':{'class':Qr},'children':[{'text':_0x2629d0['to']('label')}]};}['_createRemoveButton'](){const _0x167f66=new _0x5bfd84(this['locale']);return _0x167f66['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x4affb1}),this['_setupRemoveButtonEvent'](_0x167f66),_0x167f66;}['_setupRemoveButtonEvent'](_0x142cb0){_0x142cb0['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x34950e=this['bindTemplate'],_0x435513=new _0x2ae97e();return _0x435513['content']=xn[this['itemType']],_0x435513['extendTemplate']({'attributes':{'class':[Xr,_0x34950e['if']('isLoading','ck-hidden',_0x53cd32=>_0x53cd32)]}}),_0x435513;}['_handleAnimationEndOnce'](_0x303487,_0x138a6a){if(!_0x303487)return;const _0x3899c8=()=>{_0x138a6a(),_0x303487['removeEventListener']('animationend',_0x3899c8),_0x303487['removeEventListener']('webkitAnimationEnd',_0x3899c8);};_0x303487['addEventListener']('animationend',_0x3899c8),_0x303487['addEventListener']('webkitAnimationEnd',_0x3899c8);}['_createLoaderIcon'](){const _0x21589b=new Ci('small');return _0x21589b['bind']('isVisible')['to'](this,'isLoading',_0x3bf3fd=>_0x3bf3fd),_0x21589b;}}function In(_0x3b6435){if(!_0x3b6435)return _0x3b6435;if(_0x3b6435['length']<=0x78)return _0x3b6435;const _0x5b544b=_0x3b6435['slice'](0x0,0x78),_0x159a93=_0x5b544b['lastIndexOf']('\x20');return(_0x159a93>0x0?_0x5b544b['slice'](0x0,_0x159a93):_0x5b544b)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},an='300px';class Po{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x424584,_0x3cbfb7,_0x30f605,_0x32a6a2,_0x5ecce5){this['_locale']=_0x424584,this['_visibleChips']=_0x3cbfb7,this['_config']={...hn,..._0x30f605,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x30f605['cssClasses']}},this['_overflowChips']=new _0x4b06b7(),this['_bodyCollection']=_0x32a6a2,this['_parentView']=_0x5ecce5||null;}['setContainerElement'](_0x5e2e39){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x5e2e39,this['_setupVisibilityObserver']();}get['showMoreButtonView'](){return this['_showMoreButtonView'];}get['overflowChips'](){return this['_overflowChips'];}['reorganizeChips'](){requestAnimationFrame(()=>{this['_checkAndHandleOverflow']();});}['showBalloonPanel'](){this['_showMoreButtonView']&&this['_showMoreBalloonPanelView']&&(this['_updateBalloonContent'](),this['_showMoreButtonView']['isOn']=!0x0,this['_showMoreBalloonPanelView']['show'](),this['_showMoreBalloonPanelView']['pin']({'target':this['_showMoreButtonView']['element'],'limiter':document['querySelector']('.ck-ai-chat')}));}['hideBalloonPanel'](){this['_showMoreButtonView']&&this['_showMoreBalloonPanelView']&&(this['_showMoreButtonView']['isOn']=!0x1,this['_showMoreBalloonPanelView']['hide']());}['clear'](){this['_overflowChips']['clear'](),this['hideBalloonPanel'](),this['_updateShowMoreButtonVisibility'](),this['_showMoreButtonView']&&(this['_showMoreButtonView']['label']=''),this['_showMoreBalloonPanelView']&&this['_showMoreBalloonPanelView']['content']['clear']();}['destroy'](){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_showMoreButtonView']&&(this['_showMoreButtonView']['destroy'](),this['_showMoreButtonView']=null),this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['destroy'](),this['_showMoreBalloonPanelView']=null);}['_checkAndHandleOverflow'](){if(!this['_containerElement'])return;if(!this['_isContainerVisible']())return void(this['_pendingCalculation']=!0x0);this['_pendingCalculation']=!0x1;const _0x221496=[...this['_visibleChips'],...this['_overflowChips']],_0x1e9341=this['_createCalculationContainer'](),_0x532e1e=this['_calculateOverflowInContainer'](_0x1e9341,_0x221496),_0x50f309=_0x1e9341['_ancestorsToRestore'];_0x50f309&&this['_restoreAncestorVisibility'](_0x50f309),_0x1e9341['remove'](),this['_applyOverflowResults'](_0x221496,_0x532e1e);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x4daaf2({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x50300d=new _0x5bfd84(this['_locale']);_0x50300d['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0xf64a68=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0xf64a68['push'](this['_config']['cssClasses']['controlsButton']),_0x50300d['extendTemplate']({'attributes':{'class':_0xf64a68}}),_0x50300d;}['_createShowMoreBalloonPanelView'](){const _0x3a3945=new _0x1ddc71(this['_locale']);return _0x3a3945['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x3a3945),_0x3a3945;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x8dbf04=>{_0x8dbf04['disableAnimationOnEnter']();});const _0x533878=new _0x15a8cb(this['_locale']);_0x533878['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x533878);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x440e66=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x440e66?'':'none');}['_repinBalloonPanel'](){this['_showMoreButtonView']?.['isOn']&&this['_showMoreBalloonPanelView']?.['isVisible']&&this['_showMoreButtonView']['element']&&this['_showMoreBalloonPanelView']['pin']({'target':this['_showMoreButtonView']['element'],'limiter':document['querySelector']('.ck-ai-chat')});}['_findTargetContainer'](_0x2ed225){const _0x6e79bd=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x529e0f=this['_containerElement']?.['classList'];if(_0x529e0f){const _0x2a13bd=_0x529e0f[0x0]||'',_0xe79135=_0x2ed225['querySelector']('.'+_0x2a13bd),_0x1048f8=_0x2ed225['querySelector'](_0x6e79bd);return _0xe79135||_0x1048f8||_0x2ed225;}return _0x2ed225['querySelector'](_0x6e79bd)||_0x2ed225;}['_calculateContainerWidth'](){const _0x4104f9=this['_parentView']?.['element']||this['_containerElement'];if(!_0x4104f9)return an;const _0x41b873=window['getComputedStyle'](_0x4104f9)['width'];if('auto'===_0x41b873||'0px'===_0x41b873||!_0x41b873){const _0x2ae4ba=_0x4104f9['parentElement'];if(_0x2ae4ba){const _0x237681=window['getComputedStyle'](_0x2ae4ba);return'auto'!==_0x237681['width']?_0x237681['width']:an;}return an;}return _0x41b873;}['_applyCalculationStyles'](_0x227c19,_0x100311){this['_config']['cssClasses']['calculationContainer']&&_0x227c19['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x227c19['style']['width']=_0x100311,_0x227c19['style']['position']='absolute',_0x227c19['style']['top']='-9999px',_0x227c19['style']['left']='-9999px',_0x227c19['style']['opacity']='0',_0x227c19['style']['pointerEvents']='none',_0x227c19['style']['zIndex']='-1',_0x227c19['style']['visibility']='visible\x20!important',_0x227c19['style']['display']='block\x20!important',_0x227c19['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x193c9f){_0x193c9f['forEach'](({element:_0x346b35,originalDisplay:_0x2d2e5f,originalVisibility:_0x5f3d9d})=>{_0x346b35['style']['display']=_0x2d2e5f,_0x346b35['style']['visibility']=_0x5f3d9d;});}['_makeAncestorsVisible'](_0x30a9f1){const _0x3e0056=[];let _0x16cd86=_0x30a9f1;for(;_0x16cd86&&_0x16cd86!==document['body'];){const _0x5254a9=window['getComputedStyle'](_0x16cd86);'none'!==_0x5254a9['display']&&'hidden'!==_0x5254a9['visibility']||(_0x3e0056['push']({'element':_0x16cd86,'originalDisplay':_0x16cd86['style']['display'],'originalVisibility':_0x16cd86['style']['visibility']}),_0x16cd86['style']['display']='block',_0x16cd86['style']['visibility']='visible'),_0x16cd86=_0x16cd86['parentElement'];}return _0x3e0056;}['_createContainerElements'](){let _0x2293ba,_0x51d641;return this['_parentView']?.['element']?(_0x2293ba=this['_parentView']['element']['cloneNode'](!0x0),_0x51d641=this['_findTargetContainer'](_0x2293ba)):(_0x2293ba=document['createElement']('div'),_0x51d641=_0x2293ba),{'calculationContainer':_0x2293ba,'targetContainer':_0x51d641};}['_createCalculationContainer'](){const {calculationContainer:_0x504965,targetContainer:_0x36d238}=this['_createContainerElements'](),_0xb3ca5a=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x504965,_0xb3ca5a);const _0x3d73af=this['_parentView']?.['element']||this['_containerElement'],_0x4ef37a=_0x3d73af?.['parentElement'];_0x4ef37a?_0x4ef37a['appendChild'](_0x504965):document['body']['appendChild'](_0x504965),_0x504965['_targetContainer']=_0x36d238;const _0x51c1b9=this['_makeAncestorsVisible'](_0x4ef37a||null);return _0x504965['offsetWidth'],_0x504965['_ancestorsToRestore']=_0x51c1b9,_0x504965;}['_calculateOverflowInContainer'](_0x51b451,_0x548008){const _0x4e1a24=_0x51b451['_targetContainer']||_0x51b451,_0x586c89=[],{rowCount:_0x4bf650}=this['_renderChipsAndCountRows'](_0x4e1a24,_0x548008);if(_0x4bf650<=this['_config']['maxVisibleRows'])return _0x586c89;const _0xce4b33=_0x548008['slice']();for(;_0xce4b33['length']>0x0;){if(this['_testButtonFit'](_0x51b451,_0x4e1a24,_0xce4b33)){const _0x51e856=_0x548008['filter'](_0x4d08aa=>!_0xce4b33['includes'](_0x4d08aa));_0x586c89['push'](..._0x51e856);break;}if(!_0xce4b33['pop']())break;}return _0x586c89;}['_renderChipsAndCountRows'](_0xee5190,_0x355be2){_0xee5190['innerHTML']='',_0x355be2['forEach'](_0x59625c=>{if(_0x59625c['element']){const _0x198983=_0x59625c['element']['cloneNode'](!0x0);_0xee5190['appendChild'](_0x198983);}}),_0xee5190['offsetWidth'];const _0x2f1ff7=_0xee5190['children'],_0x526f8b=[];return Array['from'](_0x2f1ff7)['forEach'](_0xc6ca27=>{const _0x33b694=_0xc6ca27['getBoundingClientRect']()['top'];_0x526f8b['some'](_0x491f8a=>Math['abs'](_0x491f8a-_0x33b694)<this['_config']['rowDetectionTolerance'])||_0x526f8b['push'](_0x33b694);}),{'rowCount':_0x526f8b['length']};}['_createMockButton'](){const _0x5b603e=document['createElement']('button');return _0x5b603e['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x5b603e['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x5b603e['textContent']='+\x201',_0x5b603e;}['_testButtonFit'](_0x346f0d,_0x53bd33,_0xc458a3){this['_renderChipsAndCountRows'](_0x53bd33,_0xc458a3);const _0x397b77=this['_createMockButton']();_0x346f0d['appendChild'](_0x397b77),_0x346f0d['offsetWidth'];const _0x27ef5d=[..._0x53bd33['children'],_0x397b77],_0x50b790=[];_0x27ef5d['forEach'](_0x726b1=>{const _0x22c58e=_0x726b1['getBoundingClientRect']()['top'];_0x50b790['some'](_0x4e9cc9=>Math['abs'](_0x4e9cc9-_0x22c58e)<this['_config']['rowDetectionTolerance'])||_0x50b790['push'](_0x22c58e);});const _0x2cd5b9=_0x50b790['length'];return _0x397b77['remove'](),_0x2cd5b9<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x542dc9,_0x372ab3){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x542dc9['forEach'](_0x512703=>{_0x372ab3['includes'](_0x512703)?this['_overflowChips']['add'](_0x512703):this['_visibleChips']['add'](_0x512703);});}['_updateOverflowUI'](_0x21cdb2){if(_0x21cdb2>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x21cdb2>0x0&&this['_showMoreButtonView']){const _0x2c1553=''+this['_config']['showMoreLabelPrefix']+(_0x21cdb2<0x63?_0x21cdb2:'99');this['_showMoreButtonView']['label']=_0x2c1553;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x5bf3e2,_0x2d3ca2){this['_distributeChips'](_0x5bf3e2,_0x2d3ca2),this['_updateOverflowUI'](_0x2d3ca2['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x4fda0c=>{_0x4fda0c[0x0]['isIntersecting']&&this['_pendingCalculation']&&requestAnimationFrame(()=>{this['_checkAndHandleOverflow']();});},{'threshold':0.01,'rootMargin':'50px'}),this['_intersectionObserver']['observe'](this['_containerElement']));}['_isContainerVisible'](){if(!this['_containerElement'])return!0x1;if(!this['_containerElement']['isConnected'])return!0x1;const _0x21039a=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x21039a['width']||0x0===_0x21039a['height'])return!0x1;const _0x18e5e2=window['innerHeight']||document['documentElement']['clientHeight'],_0x5b8148=window['innerWidth']||document['documentElement']['clientWidth'],_0x450101=0xc8;return _0x21039a['bottom']>=-0xc8&&_0x21039a['top']<=_0x18e5e2+_0x450101&&_0x21039a['right']>=-0xc8&&_0x21039a['left']<=_0x5b8148+_0x450101;}}const la='ck-ai-chat__feed__context-chips',ua='ck-ai-chat-context-chips-wrapper',da='ck-ai-chat-context-chips-wrapper-balloon',_a='ck-ai-chat-controls-button',Aa='ck-ai-chat-controls_context_show-more-button',ga='ck-ai-chat-context-controls__show-more-balloon-panel';class _h extends _0x15a8cb{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x5b8cae,_0x1677de,_0x33cd87){super(_0x5b8cae),this['_bodyCollection']=_0x33cd87,this['_createContextChips'](_0x1677de);const _0x44ecc2={'cssClasses':{'showMoreButton':Aa,'showMoreBalloon':ga,'overflowContainer':da,'controlsButton':_a}};this['_overflowManager']=new Po(_0x5b8cae,this['_contextChips'],_0x44ecc2,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[la,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':ua},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x49ac2a=this['element']['querySelector']('.'+ua);_0x49ac2a&&(this['_overflowManager']['setContainerElement'](_0x49ac2a),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x5e18aa){for(const _0x19c8ac of _0x5e18aa){const _0x453106=new Vo(this['locale'],_0x19c8ac,!0x0,!0x1);this['_contextChips']['add'](_0x453106);}}}class Ye extends Fr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x534ac0,_0x5c8f02,_0x34cffa){super(_0x5c8f02),this['_locale']=_0x534ac0,this['_bodyCollection']=_0x34cffa,this['_createContextChipsView'](),this['_createMessageContentView'](),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__user-message']}});}['_createContextChipsView'](){this['options']['contextItems']&&this['options']['contextItems']['length']>0x0&&(this['_contextChipsView']=new _h(this['_locale'],this['options']['contextItems']['filter'](_0xf3e8cd=>!_0xf3e8cd['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x15a8cb(this['_locale']),this['_messageContentView']['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__message-content'}}),this['children']['add'](this['_messageContentView']);}['render'](){super['render'](),this['_messageContentView']['element']['innerHTML']=this['options']['initialContent'],this['markAsDone']();}}class Ht extends Fr{['capabilities'];constructor(_0x369739,_0x10324d){super(_0x10324d);const {isWebSearchEnabled:_0x5133b7,isReasoningEnabled:_0x2ab334}=_0x10324d['capabilities'],_0x177fe6=[];let _0x28b943='';_0x5133b7&&_0x2ab334?(_0x28b943=i(_0x369739,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x177fe6['push'](aa(_0x1ce37c)),_0x177fe6['push'](aa(_0x10c759))):_0x5133b7?(_0x28b943=i(_0x369739,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x177fe6['push'](aa(_0x1ce37c))):_0x2ab334&&(_0x28b943=i(_0x369739,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x177fe6['push'](aa(_0x10c759))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x28b943?'':'ck-hidden']}});const _0x3e628e=new _0x15a8cb();_0x3e628e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x177fe6,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x28b943]}]}),this['children']['add'](_0x3e628e),this['capabilities']=_0x10324d['capabilities'];}}function aa(_0x228591){const _0x186e84=new _0x2ae97e();return _0x186e84['content']=_0x228591,_0x186e84;}const Fs=['wheel','touchstart','pointerdown','keydown'],qs=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class $e{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x55a26f){this['element']=_0x55a26f,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x3737a0 of Fs){const _0x1001f4='keydown'!==_0x3737a0;this['element']['addEventListener'](_0x3737a0,this['_onUserEvent']['bind'](this),{'passive':_0x1001f4,'signal':this['abortController']['signal']});}}['start'](){this['isRunning']||(this['isRunning']=!0x0,this['isUserPaused']=!0x1,this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}['stop'](){requestAnimationFrame(()=>{this['_stop']();});}['destroy'](){this['_stop'](),this['abortController']['abort']();}['_stop'](){null!==this['animationFrameId']&&(cancelAnimationFrame(this['animationFrameId']),this['animationFrameId']=null),this['isRunning']&&(this['isRunning']=!0x1),this['isUserPaused']=!0x1;}['_onUserEvent'](_0x31e537){if(this['isRunning']){if('keydown'===_0x31e537['type']){const _0x55a000=_0x31e537['key'];if(!qs['includes'](_0x55a000))return;}_0x31e537 instanceof WheelEvent?_0x31e537['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x33cdad,scrollHeight:_0x5743c5,clientHeight:_0x24c246}=this['element'];return _0x5743c5-_0x33cdad-_0x24c246<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class Ei extends _0x15a8cb{constructor(_0x381be5,_0x46c703){super(_0x381be5),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x46c703)});}['_createSkeletonItems'](_0x59354c){const _0x50a0a1=['ck','ck-ai-skeleton__item'];return _0x59354c['map'](_0x47625e=>{let _0x5a6afc='';switch(_0x47625e['attributes']['align']){case'right':_0x5a6afc='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x5a6afc='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x5a6afc='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x47625e['tag'],'attributes':{'class':[..._0x50a0a1,_0x47625e['attributes']['class']?_0x47625e['attributes']['class']:''],'style':'width:\x20'+_0x47625e['attributes']['width']+';\x20height:\x20'+_0x47625e['attributes']['height']+';'+_0x5a6afc}};});}}const Si={'aiFeed':[{'tag':'div','attributes':{'width':'100%','height':'72px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}},{'tag':'div','attributes':{'width':'150px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'140px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}}],'aiHistory':ta(0x5,'100%','44px','right'),'aiChatResources':ta(0x8,'100%','24px','right'),'aiReviewChecks':[{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}}]};function ta(_0x23c427,_0x289315,_0x4ec8ec,_0x3745d6){return new Array(_0x23c427)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x289315,'height':_0x4ec8ec,'align':_0x3745d6}}));}class vi extends Fr{constructor(_0x555a29){super(_0x555a29),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__custom-element']}});}async['render'](){super['render'](),'string'==typeof this['options']['content']?this['element']['innerHTML']=this['options']['content']:this['element']['appendChild'](this['options']['content']);}}class ji extends _0x15a8cb{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x543dd4,_0x55e0ff){super(_0x543dd4),this['_bodyCollection']=_0x55e0ff,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Lt)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new $e(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x2e6f71,_0x53cbac){let _0xce022a;return'ai-reply'===_0x2e6f71?_0xce022a=new Xe(this['locale'],_0x53cbac,this['_bodyCollection']):'ai-suggestion-reply'===_0x2e6f71?(_0xce022a=new Qe(this['locale'],_0x53cbac,this['_bodyCollection']),_0xce022a['bind']('isTrackChangesOn')['to'](this)):_0xce022a='user-message'===_0x2e6f71?new Ye(this['locale'],_0x53cbac,this['_bodyCollection']):'interaction-header'===_0x2e6f71?new Ht(this['locale'],_0x53cbac):'custom-element'===_0x2e6f71?new vi(_0x53cbac):new Ze(_0x53cbac),this['children']['add'](_0xce022a),_0xce022a;}async['updateReplyItem']({id:_0x326eb8,parsedContent:_0x21f4a5,renderingStrategy:_0x5344f0,abortSignal:_0x5aba14}){const _0x234b35=this['getItemById'](_0x326eb8);if(!(_0x234b35 instanceof Xe))throw new _0x542443('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x234b35,'id':_0x326eb8,'parsedContent':_0x21f4a5});await _0x234b35['updateContent']({'parsedContent':_0x21f4a5,'renderingStrategy':_0x5344f0,'abortSignal':_0x5aba14});}async['updateWebSources'](_0x1ece46,_0x319870){const _0x68377a=this['getItemById'](_0x1ece46);if(_0x68377a instanceof Qe)_0x68377a['updateSources'](_0x319870);else{if(!(_0x68377a instanceof Xe))throw new _0x542443('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x68377a,'id':_0x1ece46,'sources':_0x319870});_0x68377a['updateSources'](_0x319870);}}async['updateSuggestionItem']({id:_0x4af279,parts:_0x20bbe2,renderingStrategy:_0x1efe83,abortSignal:_0x302183}){const _0x1ad148=this['getItemById'](_0x4af279);if(!(_0x1ad148 instanceof Qe))throw new _0x542443('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x1ad148,'id':_0x4af279,'parts':_0x20bbe2});await _0x1ad148['updateContent']({'parts':_0x20bbe2,'renderingStrategy':_0x1efe83,'abortSignal':_0x302183});}['updateSuggestionPartState']({id:_0x905b1a,index:_0x587b8e,state:_0x542a19}){const _0x4088fc=this['getItemById'](_0x905b1a);if(!(_0x4088fc instanceof Qe))throw new _0x542443('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x905b1a});_0x4088fc['updatePartState'](_0x587b8e,_0x542a19);}['setSuggestionPartActive']({id:_0x25f27e,index:_0x22e4af,isActive:_0x2d510e}){const _0x37e038=this['getItemById'](_0x25f27e);if(!(_0x37e038 instanceof Qe))throw new _0x542443('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x25f27e});this['children']['filter'](_0x34df6a=>_0x34df6a instanceof Qe)['forEach'](_0x7f36a0=>{_0x7f36a0['setPartActive'](!0x1);}),_0x37e038['setPartActive'](_0x22e4af,_0x2d510e);}['markItemAsDone'](_0x288354){this['getItemById'](_0x288354)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x5c4225=>_0x5c4225['options']['id']);}['removeItem'](_0x4d697b){this['children']['remove'](this['getItemById'](_0x4d697b));}['hasItem'](_0x23cb70){return!!this['children']['find'](_0x5a8ad2=>_0x5a8ad2['options']['id']['includes'](_0x23cb70));}['scrollToSuggestion'](_0x5ddc7a,_0x494797){const _0x486b50=this['getItemById'](_0x5ddc7a);if(!(_0x486b50 instanceof Qe))return void _0x23c4c9('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x5ddc7a,'partIndex':_0x494797});const _0x35e014=_0x486b50['getPartView'](_0x494797);_0x35e014?_0x88b018(_0x35e014['element'],0x14,this['element']['parentElement'],!0x0,!0x0):_0x23c4c9('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x5ddc7a,'partIndex':_0x494797});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x26fda4=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x26fda4,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x3bfd02=new Ei(this['locale'],Si['aiFeed']);return _0x3bfd02['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x58db41=>!_0x58db41)]}}),_0x3bfd02;}['_createFeedItems'](){const _0x5987fd=new _0x15a8cb(this['locale']);return _0x5987fd['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x5987fd;}['_createFeedLoader'](){const _0x36522f=new _0x15a8cb(this['locale']);return _0x36522f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0xe94d6b=>!_0xe94d6b)]},'children':this['_createLoaderChildren']()}),_0x36522f;}['_createLoaderChildren'](){const _0x38b781=new Ci();return _0x38b781['isVisible']=!0x0,[_0x38b781,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x9d9dd2){const _0x5c2d58=this['children']['find'](_0x4fe3a7=>_0x4fe3a7['options']['id']['includes'](_0x9d9dd2));if(!_0x5c2d58)throw new _0x542443('ai-chat-feed-view-item-not-found',this,{'id':_0x9d9dd2});return _0x5c2d58;}['setLoadingMessage'](_0x54a7d9){this['set']('loadingMessage',_0x54a7d9);}['toggleLoadingSkeleton'](_0x460b4e){this['set']('isLoadingSkeletonVisible',_0x460b4e);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class nh extends _0x236991{['filter'](){let _0x681bff=0x0;for(const _0x2a5db0 of this['items'])_0x681bff+=_0x2a5db0['items']['length'];return{'resultsCount':_0x681bff,'totalItemsCount':_0x681bff};}}const ah='ck-ai-chat__prompt-input_highlighted';class _s extends _0x322b7b{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x51216c,_0x5a5660){super(_0x51216c,{'queryView':{'label':'','creator':_0x11d52f,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new nh(_0x51216c),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x5a5660,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=_s['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=_s['MAX_ROWS'],this['queryView']['fieldWrapperChildren']['add'](this['_addContextButtonView']),this['_setUpAddContextButtonPositioning'](),this['extendTemplate']({'attributes':{'class':['ck','ck-ai-chat__prompt-input']}}),this['submitButtonView']=this['_createSubmitButton'](),this['submitButtonView']['bind']('isEnabled')['to'](this,'isEmpty',this,'isUploadInProgress',(_0x12640f,_0x1b1f69)=>!_0x12640f&&!_0x1b1f69),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x25042a,_0x3d3e82)=>{this['isUploadInProgress']||this['isEmpty']||_0x25042a['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x3d3e82());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x496f5e=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x496f5e)return this['queryView']['errorText']=i(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0xc32c13=_0x1052a4(_0x496f5e);this['fire']('sendUserMessage',_0xc32c13),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x13c4f1){this['queryView']['fieldView']['set']('placeholder',_0x13c4f1);}['focus'](_0x3e1b16=!0x1){super['focus'](),_0x3e1b16&&(this['element']['classList']['contains'](ah)||(this['element']['classList']['add'](ah),setTimeout(()=>{this['element']['classList']['remove'](ah);},0x320)));}['_createSubmitButton'](){const _0x14ba03=new _0x5bfd84(this['locale']);return _0x14ba03['set']({'icon':_0x349858,'label':i(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x14ba03['on']('execute',()=>{this['submit']();}),_0x14ba03;}['setIsUploadInProgress'](_0x3ab8c0){this['isUploadInProgress']=_0x3ab8c0;}['_setUpAddContextButtonPositioning'](){const _0xc67e88=this['locale'],_0x167f49=()=>{it['window']['requestAnimationFrame'](()=>{if(_0x2e19a7(this['element'])){const _0x505150=new ot(this['queryView']['fieldView']['element']),_0x255992=new ot(this['_addContextButtonView']['element']),_0x41c3d7=_0x505150['width'],_0x2188ec='rtl'===_0xc67e88['uiLanguageDirection']?'right':'left';_0x505150['excludeScrollbarsAndBorders']();const _0x93871d=_0x41c3d7-_0x505150['width']+0x1;this['_addContextButtonView']['element']['style'][_0x2188ec]='calc('+(_0x41c3d7-_0x255992['width']-_0x93871d)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x167f49),this['on']('render',()=>{_0x167f49(),this['_queryViewResizeObserver']=new _0x9cd70(this['queryView']['fieldView']['element'],()=>{_0x167f49();});});}}const Ia='ck-ai-chat__prompt-capabilities',Ea='ck-ai-chat-controls-button',Ta='ck-ai-chat-controls-button--commands',pa='ck-ai-button-tertiary',ma='ck-ai-chat-controls__model-selection',Ca='ck-ai-chat-controls__model-selection__item-name',wa='ck-ai-chat-controls__model-selection__item-description',fa='ck-ai-chat-controls__model-selection__item-capabilities',Sa='n';class vs extends _0x15a8cb{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x89de3){super(_0x89de3),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelDisplayMode','selector'),this['set']('modelSelectorEnabled',!0x0),this['set']('activeModelId',null),this['set']('activeModelName',null),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelNameView']=this['_createModelNameView'](),this['_webSearchButton']=this['_createWebSearchButton'](),this['_reasoningButton']=this['_createReasoningButton'](),this['_commandsButton']=this['_createCommandsButton'](),this['_modelSelectionDropdown']['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x4ea7a6=>'selector'===_0x4ea7a6),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0xa3e69c=>_0xa3e69c?this['_modelSelectionDropdown']['buttonView']['label']:i(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x162435=>_0x162435),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x3b99a0=>_0x3b99a0),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x18816f=>i(this['locale'],_0x18816f?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x2dd2dc=>_0x2dd2dc),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x18c75c=>i(this['locale'],_0x18c75c?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[Ia]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x4b06b7(),_0x48b098(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x45748b,_0x22c4fd){if(_0x22c4fd)this['set']('modelDisplayMode','hidden');else{const _0x58f5db=0x1===_0x45748b['length'];this['set']('modelDisplayMode',_0x58f5db?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x45748b?.['length'])for(const _0x573a23 of _0x45748b){const _0x777bcd=new _0x129df2({'label':_0x573a23['name'],'withText':!0x0,'role':'menuitemradio','id':_0x573a23['id'],'model':_0x573a23});_0x777bcd['bind']('isOn')['to'](this,'activeModelId',_0x5b5523=>_0x5b5523===_0x573a23['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x777bcd,'labelView':new ba(this['locale'],_0x573a23)});}}['setWebSearch'](_0x531172){this['set']('webSearchActive',_0x531172);}['setReasoning'](_0x11af17){this['set']('reasoningActive',_0x11af17);}['setModel'](_0x13cbd5){if(!_0x13cbd5)return;this['activeModelId']=_0x13cbd5['id'],this['activeModelName']=_0x13cbd5['name']||_0x13cbd5['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x13cbd5['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x13cbd5['name']);const _0x38cfef=_0x13cbd5['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x38cfef),this['_webSearchButton']['set']('isVisible',_0x38cfef);const _0x3490c8=_0x13cbd5['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x3490c8),this['_reasoningButton']['set']('isVisible',_0x3490c8);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x24de96){this['set']('modelSelectorEnabled',!0x1),_0x24de96&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x13e91b=new _0x5bfd84();return _0x13e91b['set']({'label':i(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x1ce37c,'class':Ea,'isToggleable':!0x0,'tooltipPosition':Sa}),_0x13e91b['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x13e91b;}['_createReasoningButton'](){const _0x41c4a7=new _0x5bfd84();return _0x41c4a7['set']({'label':i(this['locale'],'AI_CHAT_REASONING'),'icon':_0x10c759,'class':Ea,'isToggleable':!0x0,'tooltipPosition':Sa}),_0x41c4a7['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x41c4a7;}['_createCommandsButton'](){const _0x5d4a57=new _0x5bfd84();return _0x5d4a57['set']({'label':i(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0xe3a7aa,'withText':!0x0,'class':Ea,'isToggleable':!0x0,'tooltip':i(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':Sa}),_0x5d4a57['extendTemplate']({'attributes':{'class':[Ta]}}),_0x5d4a57['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x5d4a57;}['_createModelSelectionDropdown'](){const _0x230afd=_0x29ed58(this['locale']);return _0x230afd['set']({'panelPosition':'ne','class':[ma]}),_0x230afd['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Sa,'class':pa}),this['listenTo'](_0x230afd,'execute',_0x5dc8b8=>{this['fire']('selectModel',_0x5dc8b8['source']['model']);}),_0x230afd;}['_createModelNameView'](){const _0x358363=new Ra(this['locale']);return _0x358363['bind']('text')['to'](this,'activeModelName',_0x36390a=>_0x36390a??''),_0x358363['bind']('isVisible')['to'](this,'modelDisplayMode',_0x1e91b8=>'name'===_0x1e91b8),_0x358363;}}let ba=class extends _0x59760a{constructor(_0x3df08f,_0x243a2a){super();const _0x55099c=this['bindTemplate'],_0x55ef34=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x55099c['to']('style'),'id':_0x55099c['to']('id')},'children':[{'tag':'div','attributes':{'class':[Ca]},'children':[{'text':_0x55099c['to']('text')}]},{'tag':'div','attributes':{'class':[wa]},'children':[{'tag':'span','children':[{'text':_0x243a2a['description']}]}]},{'tag':'div','attributes':{'class':[fa]},'children':_0x55ef34}]}),_0x55ef34['addMany'](this['_getCapabilityParts'](_0x3df08f,_0x1ce37c,'AI_CHAT_SEARCH_WEB',_0x243a2a['capabilities']['webSearch']?.['enabled']??!0x1)),_0x55ef34['addMany'](this['_getCapabilityParts'](_0x3df08f,_0x10c759,'AI_CHAT_REASONING',_0x243a2a['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x4e15b3,_0xbd8015,_0x16a875,_0x92e3b2){const _0x5989ca=new _0x2ae97e();_0x5989ca['content']=_0xbd8015;const _0x257642=new _0x15a8cb(_0x4e15b3);_0x257642['setTemplate']({'tag':'span','children':[{'text':i(_0x4e15b3,_0x16a875)+':\x20'}]});const _0xf05d7b=new _0x15a8cb(_0x4e15b3);return _0xf05d7b['setTemplate']({'tag':'span','children':[{'text':i(_0x4e15b3,_0x92e3b2?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x5989ca,_0x257642,_0xf05d7b];}},Ra=class extends _0x15a8cb{constructor(_0x5091d2){super(_0x5091d2),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x41fc55=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x41fc55['if']('isVisible','ck-hidden',_0x4ceeda=>!_0x4ceeda)]},'children':[{'text':_0x41fc55['to']('text')}]});}};const Oa='ck-ai-chat-context-controls__url-form',ka='ck-ai-chat-context-controls__url-input-section';class Io extends _0x15a8cb{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x3ced6a){super(_0x3ced6a),this['focusTracker']=new _0x510dfd(),this['keystrokes']=new _0x394cf5(),this['backButton']=this['_createBackButton'](),this['urlInputField']=this['_createUrlInputField'](),this['confirmButton']=this['_createConfirmButton'](),this['_focusables']=this['createCollection']([this['backButton'],this['urlInputField'],this['confirmButton']]),this['focusCycler']=new _0x5a99d2({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['set']('withBackButton',!0x0),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x1a25d3=>{this['focusTracker']['add'](_0x1a25d3['element']),this['keystrokes']['listenTo'](_0x1a25d3['element']);}),_0x251698({'view':this}),this['focus']();}['destroy'](){super['destroy'](),this['focusTracker']['destroy'](),this['keystrokes']['destroy']();}['focus'](){this['urlInputField']['focus']();}['getValue'](){return this['urlInputField']['fieldView']['element']?.['value']?.['trim']()||'';}['clear'](){this['urlInputField']['fieldView']['element']['value']='',this['urlInputField']['errorText']=null,this['confirmButton']['isEnabled']=!0x1;}['setError'](_0x13fbd8){this['urlInputField']['errorText']=_0x13fbd8,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x5ea867=new _0x5bfd84(this['locale']);return _0x5ea867['set']({'icon':_0x3c7600,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x35aaf6,_0x406503,_0x335aaa)=>{_0x5ea867['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x335aaa?'':'\x20ck-hidden')]});}),_0x5ea867;}['_createUrlInputField'](){const _0x49daf1=new _0x1a087b(this['locale'],th);return _0x49daf1['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x49daf1['fieldView']['set']({'placeholder':i(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x49daf1;}['_createConfirmButton'](){const _0x418daa=new _0x5bfd84(this['locale']);return _0x418daa['set']({'icon':_0x15208f,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x418daa;}['_setupTemplate'](){const _0x14e333=new _0x2e3f47(this['locale'],{'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x14e333['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Oa,'tabindex':'-1'},'children':[_0x14e333,{'tag':'div','attributes':{'class':ka},'children':[this['urlInputField'],this['confirmButton']]}]});}['_setupEventHandlers'](){this['backButton']['on']('execute',()=>{this['clear'](),this['fire']('cancel');}),this['urlInputField']['fieldView']['on']('input',()=>{this['clearError'](),this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}),this['on']('submit',_0x381db9=>{_0x381db9['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x3254d4,_0x469a89)=>{this['clear'](),this['fire']('cancel'),_0x469a89();});}['_handleSubmit'](){const _0x28e81b=this['getValue']()['trim']();_0x28e81b?this['_isValidUrl'](_0x28e81b)?(this['clearError'](),this['fire']('submitUrl',_0x28e81b)):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x21a817=this['getValue']()['trim'](),_0x178a5e=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x21a817['length']>0x0&&!_0x178a5e;}['_isValidUrl'](_0x1aecb7){try{return!!new URL(_0x1aecb7);}catch{return!0x1;}}}const Na='ck-ai-chat-resources__item',va='ck-ai-chat-resources__item--in-context',ya='ck-ai-chat-resources__item-title',xa='ck-ai-chat-resources__item__icon';class hc extends _0x5e9d54{['resource'];['_titleView'];['_iconView'];constructor(_0x32a790,_0x45097b){super(_0x32a790),this['resource']=_0x45097b,this['set']('isInContext',!!_0x45097b['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x36ebe9){if(_0x36ebe9['isInContext'])return _0x15208f;switch(_0x36ebe9['type']){case qe['DOCUMENT']:return _0x51d2a2;case qe['URL']:return _0x5acb26;case qe['FILE']:case qe['TEXT']:return _0x56f9a2;default:return _0x4da3a3;}}['highlightText'](_0x1463d1){if(!_0x1463d1||''===_0x1463d1['trim']())return void this['_titleView']['highlightText'](null);const _0x241dd0=new RegExp(_0x249f4a(_0x1463d1),'gi');this['_titleView']['highlightText'](_0x241dd0);}['updateResourceState'](_0x165743){this['resource']['isInContext']=_0x165743,this['isInContext']=_0x165743,this['_updateIcon']();}['_createTitleView'](){const _0xf21661=new _0x258b31();return _0xf21661['text']=this['resource']['label'],_0xf21661['extendTemplate']({'tag':'span','attributes':{'class':[ya]}}),_0xf21661;}['_createIconView'](){const _0x46a926=new _0x2ae97e();return _0x46a926['content']=this['getResourceIcon'](this['resource']),_0x46a926;}['_setupTemplate'](){const _0x3a1ffb=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[Na,_0x3a1ffb['if']('isVisible','ck-hidden',_0x54d514=>!_0x54d514),_0x3a1ffb['if']('isInContext',va)]},'children':[{'tag':'div','attributes':{'class':[xa]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x3a1ffb['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const La='ck-ai-chat-resources__list';class Lr extends _0x236991{['_source'];constructor(_0xfcd3c5,_0xa46bf2){super(_0xfcd3c5),this['_source']=_0xa46bf2,this['extendTemplate']({'attributes':{'class':[La]}});}['setResources'](_0x181d7d,_0x367c04){this['items']['clear']();let _0x39c91b=_0x181d7d;if(this['_source']['useDefaultFiltering']&&_0x367c04&&''!==_0x367c04['trim']()){const _0x339af6=new RegExp(_0x367c04['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x39c91b=_0x181d7d['filter'](_0x2b5e11=>_0x339af6['test'](_0x2b5e11['label']));}for(const _0x273c36 of _0x39c91b){const _0x378f46=new hc(this['locale'],_0x273c36);_0x378f46['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x273c36);}),this['items']['add'](_0x378f46);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x367c04);}['highlightText'](_0x1bccef){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x291e0d=>{_0x291e0d['highlightText'](_0x1bccef);});}['updateResourceState'](_0x54d543,_0x38f060){for(const _0x42b075 of this['items']){const _0x550fd7=_0x42b075;_0x550fd7['resource']['id']===_0x54d543&&_0x550fd7['updateResourceState'](_0x38f060);}}['_handleResourceSelection'](_0x52188f,_0x20f959){this['fire']('addResourceToContext',{'source':_0x52188f,'resource':_0x20f959});}}class Ur extends _0x1a087b{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x4f9272){const t=_0x4f9272['t'],_0x1829f8={'showResetButton':!0x0,'showIcon':!0x0,'creator':th,'label':i(_0x4f9272,'AI_CHAT_SEARCH_RESOURCES')};super(_0x4f9272,_0x1829f8['creator']),this['label']=_0x1829f8['label'],this['_viewConfig']=_0x1829f8,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x4f9272,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x4e0c1a){this['fire']('search',_0x4e0c1a);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x2ae97e(),this['iconView']['content']=_0x1fb99b,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x204d28,t){this['resetButtonView']=new _0x5bfd84(_0x204d28),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x187b85,'class':'ck-search__reset','isVisible':!0x1,'tooltip':!0x0}),this['resetButtonView']['on']('execute',()=>{this['reset'](),this['focus'](),this['fire']('reset');}),this['resetButtonView']['bind']('isVisible')['to'](this['fieldView'],'isEmpty',_0x36ae44=>!_0x36ae44),this['fieldWrapperChildren']['add'](this['resetButtonView']),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-reset'}});}['_setupEventListeners'](){this['listenTo'](this['fieldView'],'input',()=>{this['search'](this['fieldView']['element']['value']);}),this['bind']('isEnabled')['to'](this);}}class lc extends _0x15a8cb{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x549055,_0x7b9ddc){super(_0x549055),this['_source']=_0x7b9ddc['source'],this['_searchInputVisibleFrom']=_0x7b9ddc['searchInputVisibleFrom']??0x7,this['set']('isLoading',!0x0),this['_searchView']=this['_createSearchView'](),this['_searchSection']=this['_createSearchSection'](),this['_resourcesListView']=this['_createResourcesListView'](),this['_skeletonLoader']=this['_createSkeletonView'](),this['children']=new _0x152ab6([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new Ur(this['locale']);}['_createSearchSection'](){const _0x5ee788=new _0x15a8cb(this['locale']);return _0x5ee788['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x2d6542,_0x599d76)=>{this['loadResources'](_0x599d76),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x599d76);}),_0x5ee788;}['_createResourcesListView'](){const _0x253021=new Lr(this['locale'],this['_source']);return _0x253021['delegate']('addResourceToContext')['to'](this),_0x253021['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x253021;}['_createSkeletonView'](){const _0x279603=new Ei(this['locale'],Si['aiChatResources']);return _0x279603['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x4268ea=>!_0x4268ea)]}}),_0x279603;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x245fa2){const _0x1388d2=_0x2e2dc8();this['_latestLoadResourcesUid']=_0x1388d2,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x245fa2,'uid':_0x1388d2}),this['isLoading']=!0x0;}['setResources'](_0x2ce795,_0x3dc6c0){if(_0x3dc6c0&&_0x3dc6c0!==this['_latestLoadResourcesUid'])return;const _0x94356a=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x2ce795,_0x94356a),_0x2ce795['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x4fa840,_0x164415){this['_resourcesListView']['updateResourceState'](_0x4fa840,_0x164415);}}const Da='ck-ai-chat-context-controls__source-balloon-panel',Pa='ck-button-icon\x20ck-button-back',Ha='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Ro{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x27ce6c,_0x50812d,_0x55c481){this['_locale']=_0x27ce6c,this['_bodyCollection']=_0x50812d,this['_config']=_0x55c481;}['showSourceResourcesBalloon']({source:_0x16fabd,withBackButton:_0x425f44}){let _0x1f3b3e=this['_sourceResourceBalloons']['get'](_0x16fabd['id']);_0x1f3b3e||(_0x1f3b3e=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x16fabd['id'],_0x1f3b3e),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x1f3b3e)),this['_addSourceResourceContent']({'balloonPanel':_0x1f3b3e,'source':_0x16fabd,'withBackButton':_0x425f44}),_0x1f3b3e['show']();const _0x286673=this['_config']['getTargetElement']();_0x286673&&_0x1f3b3e['pin']({'target':_0x286673,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x224aed,_0x31d8ba,_0x2e3db5){const _0x4213fe=this['_sourceResourceBalloons']['get'](_0x224aed);if(!_0x4213fe)return;const _0x48fa00=this['_getResourcesViewFromBalloon'](_0x4213fe);_0x48fa00&&(_0x48fa00['setResources'](_0x31d8ba,_0x2e3db5),_0x48fa00['once']('change:isLoading',()=>{_0x4213fe['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x217681){const _0x5ca216=this['_sourceResourceBalloons']['get'](_0x217681);_0x5ca216&&requestAnimationFrame(()=>{_0x5ca216['hide'](),this['_sourceResourceBalloons']['delete'](_0x217681),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x49acbd of this['_sourceResourceBalloons']['values']())if(_0x49acbd['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x25dd34,_0x14b08c,_0xf50a84){const _0x552938=this['_sourceResourceBalloons']['get'](_0x25dd34);if(!_0x552938||!_0x552938['isVisible'])return;const _0x1acb2b=this['_config']['getTargetElement']();if(!_0x1acb2b)return;_0x552938['pin']({'target':_0x1acb2b,'limiter':this['_config']['getLimiterElement']()});const _0x570648=this['_getResourcesViewFromBalloon'](_0x552938);_0x570648&&_0x570648['updateResourceState'](_0x14b08c,_0xf50a84);}['destroy'](){for(const _0x4cc2ea of this['_sourceResourceBalloons']['values']())_0x4cc2ea['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x423837=new _0x1ddc71(this['_locale']);return _0x423837['extendTemplate']({'attributes':{'class':Da}}),this['_bodyCollection']['add'](_0x423837),_0x423837;}['_addSourceResourceContent']({balloonPanel:_0x4bb65d,source:_0x3d8ab7,withBackButton:_0x31a91a}){_0x4bb65d['content']['clear']();const _0x996a48=this['_createBalloonHeader']({'balloonPanel':_0x4bb65d,'source':_0x3d8ab7,'withBackButton':_0x31a91a});_0x4bb65d['content']['add'](_0x996a48);const _0x5ce18f=this['_createBalloonResourcesView'](_0x3d8ab7);_0x4bb65d['content']['add'](_0x5ce18f);}['_createBalloonHeader']({balloonPanel:_0x494a3c,source:_0x59ed97,withBackButton:_0x50e3a2}){const _0x42e268=new _0x2e3f47(this['_locale'],{'label':_0x59ed97['label'],'class':Ha});return _0x50e3a2&&_0x42e268['children']['add'](this['_createBackButton'](_0x494a3c),0x0),_0x42e268;}['_createBackButton'](_0x46eb66){const _0x23d64f=new _0x5bfd84(this['_locale']);return _0x23d64f['set']({'icon':_0x3c7600,'tooltip':i(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Pa}),_0x23d64f['on']('execute',()=>{_0x46eb66['hide'](),this['_config']['onBackToContext']();}),_0x23d64f;}['_createBalloonResourcesView'](_0x21e875){const _0x1d67d3=new lc(this['_locale'],{'source':_0x21e875,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x1d67d3['on']('loadSourceResources',(_0x4b167e,_0x52b4a7)=>{this['_config']['onLoadSourceResources'](_0x52b4a7);}),_0x1d67d3['on']('addResourceToContext',(_0x548d9e,_0x3899f3)=>{this['_config']['onResourceSelected'](_0x3899f3['source'],_0x3899f3['resource']),this['closeSourceResourceBalloon'](_0x21e875['id']);}),_0x1d67d3;}['_getResourcesViewFromBalloon'](_0x495180){const _0x5b4b85=_0x495180['content']['get'](0x1);return _0x5b4b85 instanceof lc?_0x5b4b85:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0xa9f6bd){_0x4daaf2({'emitter':_0xa9f6bd,'contextElements':[_0xa9f6bd['element']],'callback':()=>{_0xa9f6bd['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0xa9f6bd['isVisible']});}}const xs=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Oo='ck-ai-chat-context-controls',Uo='ck-ai-chat-context-controls__pending-contexts',Lo='ck-ai-chat-context-controls__add-context-balloon-panel',No='ck-ai-chat-context-controls__add-context-button',Mo='ck-ai-chat-context-controls__url-balloon-panel',Ho='ck-ai-chat-context-controls__balloon-button',jo='ck-ai-chat-context-controls__balloon-button-source',Fo='ck-ai-chat-controls-button',Xo='ck-ai-chat-context-chips-wrapper-balloon',yo='ck-ai-chat-controls_context_show-more-button',Do='ck-ai-chat-context-controls__show-more-balloon-panel',$o='ck-ai-chat',Wo=[_0x1ddc71['defaultPositions']['northArrowSouthWest'],_0x1ddc71['defaultPositions']['northArrowSouth'],_0x1ddc71['defaultPositions']['northArrowSouthEast'],_0x1ddc71['defaultPositions']['southArrowNorthWest'],_0x1ddc71['defaultPositions']['southArrowNorth'],_0x1ddc71['defaultPositions']['southArrowNorthEast']];class Is extends _0x15a8cb{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x19f5bf,_0xfdadf){super(_0x19f5bf),this['bodyCollection']=_0xfdadf['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x19f5bf),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x19f5bf),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x19f5bf),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x19f5bf,_0xfdadf);const _0x290de1={'cssClasses':{'showMoreButton':yo,'showMoreBalloon':Do,'overflowContainer':Xo,'controlsButton':Fo}};this['_overflowManager']=new Po(_0x19f5bf,this['_currentContextsChips'],_0x290de1,this['bodyCollection'],this),this['_addContextBalloonConfig']={'buttonView':this['addContextButtonView'],'balloonView':this['_addContextBalloonPanelView'],'hideMethod':this['hideAddContextBalloonPanel']['bind'](this),'showMethod':this['showAddContextBalloonPanel']['bind'](this)},this['_setupTemplate'](),this['_bindEventHandlers']();}['render'](){super['render'](),this['_setupAllBalloonClickOutsideHandlers'](),this['_overflowManager']['setContainerElement'](this['element']),this['_overflowManager']['reorganizeChips']();}['destroy'](){super['destroy'](),this['_overflowManager']['destroy'](),this['_resourcesBalloonView']['destroy']();}['addContextItem'](_0x20977c,_0xc99bbb){const _0x54abec=this['_createContextButton'](_0x20977c,'current',!0x0,_0xc99bbb);this['_addContextToCollection'](_0x54abec,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x4948ff){this['_removeContextFromCollection'](_0x4948ff,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x4948ff,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x8f4386,_0x137250){let _0xe88a08=this['_currentContextsChips']['find'](_0x5c4546=>_0x5c4546['id']===_0x8f4386);_0xe88a08||(_0xe88a08=this['_overflowManager']['overflowChips']['find'](_0x3db014=>_0x3db014['id']===_0x8f4386)),_0xe88a08&&(_0xe88a08['isLoading']=_0x137250);}['setConversationContext'](_0x1be2c5){this['_conversationContextsChips']['clear']();for(const _0x124c1d of _0x1be2c5){const _0x42da92=this['_createContextButton'](_0x124c1d,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x42da92,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x4b55d6,_0x55fdd6,_0x42be0a){this['_resourcesBalloonView']['updateResourceState'](_0x4b55d6,_0x55fdd6,_0x42be0a);}['hideAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x1);}['showAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x0);}['hideUrlBalloonPanel'](){this['_urlBalloonPanelView']['hide'](),this['addContextButtonView']['isOn']=!0x1,this['_urlInputView']&&this['_urlInputView']['clear']();}['showUrlBalloonPanel'](){this['_urlBalloonPanelView']['show'](),this['addContextButtonView']['isOn']=!0x0;}['_showSourceResourcesBalloon']({source:_0x3f3d9d,withBackButton:_0x4f6bb2}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x3f3d9d,'withBackButton':_0x4f6bb2}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x3f428f,_0x5468a5,_0x495c65,_0x322209){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x3f428f,_0x495c65,_0x322209);}['closeSourceResourceBalloon'](_0x399d2c){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x399d2c),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0xa542aa){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0xa542aa),this['_setAddContextButtonEnabled'](_0xa542aa);}['_setAddContextButtonEnabled'](_0x44a10e){const _0x1f7808=!_0x44a10e['document']['isHidden']&&_0x44a10e['document']['enabled'],_0x56f5c0=_0x44a10e['urls']['enabled'],_0x2035f9=_0x44a10e['files']['enabled'],_0x22d3d6=_0x44a10e['sources']['length']>0x0,_0xa4b991=_0x44a10e['customItems']&&_0x44a10e['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x1f7808||_0x56f5c0||_0x2035f9||_0x22d3d6||_0xa4b991;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Oo,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Uo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x487c9c){const _0x35c3cb=new _0x5bfd84(_0x487c9c);return _0x35c3cb['set']({'label':i(_0x487c9c,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Fo+'\x20'+No,'icon':_0xb33e07,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x35c3cb;}['_createAddContextBalloonPanelView'](_0x2baa73){return this['_createBaseBalloonPanel'](_0x2baa73,Lo);}['_createUrlBalloonPanelView'](_0x4e785a){const _0x1c1ee1=this['_createBaseBalloonPanel'](_0x4e785a,Mo);return this['_addUrlContent'](_0x1c1ee1,_0x4e785a),_0x1c1ee1;}['_createResourcesBalloonView'](_0xf28d12,_0x390144){const _0x5088c6={'searchInputVisibleFrom':_0x390144['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wo});},'onResourceSelected':(_0xed85e0,_0x15efd0)=>{this['fire']('addResourceToContext',{'source':_0xed85e0,'resource':_0x15efd0});},'onLoadSourceResources':_0x206357=>{this['fire']('loadSourceResources',_0x206357);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Ro(_0xf28d12,_0x390144['bodyCollection'],_0x5088c6);}['_getLimiterElement'](){return this['element']?.['closest']('.'+$o)||document['body'];}['_createBaseBalloonPanel'](_0x4fc702,_0xc7d9b){const _0x5cbc96=new _0x1ddc71(_0x4fc702);return _0x5cbc96['extendTemplate']({'attributes':{'class':_0xc7d9b}}),this['bodyCollection']['add'](_0x5cbc96),_0x5cbc96;}['_setBalloonPanelContent'](_0x351bf7,_0xda2c83,_0x15fcba){if(_0x351bf7['content']['clear'](),!_0x15fcba['document']['isHidden']&&_0x15fcba['document']['enabled']){const _0x297546=this['_createBalloonButton'](_0xda2c83,{'label':i(_0xda2c83,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x51d2a2});_0x297546['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x351bf7['content']['add'](_0x297546);}if(_0x15fcba['urls']['enabled']){const _0x1a34b1=this['_createBalloonButton'](_0xda2c83,{'label':i(_0xda2c83,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x5acb26});_0x1a34b1['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wo}),this['_urlInputView']['focus']();}),_0x351bf7['content']['add'](_0x1a34b1);}if(_0x15fcba['files']['enabled']){const _0x329048=new _0x4834b0(_0xda2c83);_0x329048['set']({'label':i(_0xda2c83,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x555a1a,'withText':!0x0,'tooltip':!0x0,'class':Ho,'allowMultipleFiles':!0x0}),_0x329048['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x329048['on']('done',(_0x54cf1d,_0x12aa1a)=>{this['fire']('addFileToContext',_0x12aa1a);}),_0x329048['tooltip']=!0x0,_0x351bf7['content']['add'](_0x329048);}for(const _0x1be4c5 of _0x15fcba['sources']){const _0x2bc65d=this['_createBalloonButton'](_0xda2c83,{'label':_0x1be4c5['label'],'icon':_0x1be4c5['icon']||_0x4da3a3,'type':'source'});_0x351bf7['content']['add'](_0x2bc65d),_0x2bc65d['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x1be4c5,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0xd154ca of _0x15fcba['customItems']||[]){const _0x543210=this['_createBalloonButton'](_0xda2c83,{'label':_0xd154ca['label'],'icon':_0xd154ca['icon']||_0x4da3a3,'type':'customItem'});_0x351bf7['content']['add'](_0x543210),_0x543210['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0xd154ca);});}this['_hasExactlyOneSource']=0x1===_0x351bf7['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x4961c9,_0x4e4ad1){this['_urlInputView']=new Io(_0x4e4ad1),this['_urlInputView']['on']('submitUrl',(_0x4ebf1d,_0x5a5649)=>{this['_handleUrlSubmit'](_0x5a5649);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wo}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wo});}),_0x4961c9['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0xef98bb,_0x4afbd7){const _0xcb8b1b='source'===_0x4afbd7['type']?new Ma(_0xef98bb):new _0x5bfd84(_0xef98bb);return _0xcb8b1b['set']({'label':_0x4afbd7['label'],'icon':_0x4afbd7['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Ho}),_0xcb8b1b;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x4daaf2({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x59a4cf){const _0x1bb1f1=this['_addContextBalloonConfig'];_0x1bb1f1['buttonView']['isOn']=_0x59a4cf,_0x59a4cf?_0x1bb1f1['balloonView']['show']():_0x1bb1f1['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0xb04b48,buttonView:_0x5e6365,hideMethod:_0x405131}=this['_addContextBalloonConfig'];_0x4daaf2({'emitter':_0xb04b48,'contextElements':[_0xb04b48['element'],_0x5e6365['element']],'callback':()=>{_0x405131();},'activator':()=>_0x5e6365['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x277633,_0x2a9802,_0x2ce262=!0x1,_0x5d15c4=!0x1){const _0x5d9bde='conversation'===_0x2a9802||!0x0===_0x277633['isReadOnly'],_0x4e3734=new Vo(this['locale'],_0x277633,_0x5d9bde,_0x2ce262,_0x5d15c4);return _0x5d9bde||_0x4e3734['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x4e3734['id']);}),_0x4e3734;}['_addContextToCollection'](_0x46a1a1,_0x5de129){_0x5de129['add'](_0x46a1a1,0x0);}['_removeContextFromCollection'](_0x554fd9,_0x2a1a8d){const _0x27b019=_0x2a1a8d['find'](_0x4067e3=>_0x4067e3['id']===_0x554fd9);_0x27b019&&_0x2a1a8d['remove'](_0x27b019);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wo}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x55255e){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x55255e);}}class Ma extends _0x5bfd84{['arrowView'];constructor(_0x11c3d3){super(_0x11c3d3),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[jo]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x30c943=new _0x2ae97e();return _0x30c943['content']=_0x4e1794,_0x30c943['extendTemplate']({'attributes':{'class':jo+'__arrow'}}),_0x30c943;}}class Cs extends _0x15a8cb{['_cancelButtonView'];['_loaderView'];constructor(_0xdc349f){super(_0xdc349f),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_loaderView']=this['_createLoaderView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-loader-wrapper','ck-reset_all']},'children':[this['_loaderView'],this['_cancelButtonView']]});}['_createCancelButtonView'](){const _0x581c75=new _0x5bfd84(this['locale']);return _0x581c75['set']({'label':i(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x49c145}),_0x581c75['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x581c75;}['_createLoaderView'](){const _0x2e02b1=new _0x15a8cb(this['locale']);return _0x2e02b1['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}}]},{'text':i(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x2e02b1;}}class xi extends _0x15a8cb{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x194728,_0x50f0ff){super(_0x194728),this['_contextPanelView']=this['_createContextPanelView'](_0x194728,{'bodyCollection':_0x50f0ff['bodyCollection'],'searchInputVisibleFrom':_0x50f0ff['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x194728),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x194728),this['_loaderView']=this['_createLoaderView'](_0x194728),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x194728),this['_shouldRestorePromptInputFocus']=!0x1,this['_promptInputView']['delegate']('sendUserMessage')['to'](this),this['_loaderView']['delegate']('abortPromptStream')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleWebSearch')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleReasoning')['to'](this),this['_promptCapabilitiesView']['delegate']('selectModel')['to'](this),this['_contextPanelView']['delegate'](...xs)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x53bd13=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x53bd13['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x53bd13['if']('isLoading','ck-hidden',_0x25c3d4=>_0x25c3d4||!this['isModelAvailable']),_0x53bd13['if']('isModelAvailable','ck-hidden',_0x28935f=>!_0x28935f||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x53bd13['if']('isLoading','ck-hidden',_0x4e9fb5=>!_0x4e9fb5)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x53bd13['if']('isModelAvailable','ck-hidden',_0x8c1299=>_0x8c1299)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x4daaf2({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x51749a,_0x34182c){return new Is(_0x51749a,_0x34182c);}['_createPromptInputView'](_0x3d9818){return new _s(_0x3d9818,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x1b0ec4){return new vs(_0x1b0ec4);}['_createLoaderView'](_0x37b2b2){return new Cs(_0x37b2b2);}['_createModelUnavailableMessageView'](_0xc70916){const _0x8d48f=new As(_0xc70916);return _0x8d48f['delegate']('startConversation')['to'](this),_0x8d48f;}['_handlePromptInputFocus'](_0x4eb2af,_0x23deac,_0x4ef11b){_0x4ef11b?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x534b37,_0xf17c83){this['_contextPanelView']['addContextItem'](_0x534b37,_0xf17c83);}['removeContextItem'](_0x4f0698){this['_contextPanelView']['removeContextItem'](_0x4f0698);}['setContextItemLoading'](_0x4707f6,_0x4cd636){this['_contextPanelView']['setContextItemLoading'](_0x4707f6,_0x4cd636);}['setIsUploadInProgress'](_0x512304){this['_promptInputView']['setIsUploadInProgress'](_0x512304);}['setConversationContext'](_0x4e6638){this['_contextPanelView']['setConversationContext'](_0x4e6638);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x13cc08,_0xec16a5,_0x1c0a21){this['_contextPanelView']['updateResourceState'](_0x13cc08,_0xec16a5,_0x1c0a21);}['setWebSearch'](_0x4e6ea9){this['_promptCapabilitiesView']['setWebSearch'](_0x4e6ea9);}['setReasoning'](_0x1f2583){this['_promptCapabilitiesView']['setReasoning'](_0x1f2583);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x1eec05){this['_contextPanelView']['setAddContextOptions'](_0x1eec05);}['setInputPlaceholder'](_0x17d72f){this['_promptInputView']['setPlaceholderText'](_0x17d72f);}['setModelList'](_0x31251c,_0x108256){this['_promptCapabilitiesView']['setModelList'](_0x31251c,_0x108256);}['setModel'](_0x4c38c2){_0x4c38c2?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x4c38c2)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x499044){this['_promptCapabilitiesView']['disableModelSelector'](_0x499044);}['populateSourceResourceBalloon'](_0x34c26c,_0x432ae2,_0x467db1,_0x559d97){this['_contextPanelView']['populateSourceResourceBalloon'](_0x34c26c,_0x432ae2,_0x467db1,_0x559d97);}['closeSourceResourceBalloon'](_0x543e90){this['_contextPanelView']['closeSourceResourceBalloon'](_0x543e90);}['focusPromptInput'](_0x2e95e9=!0x1){this['_promptInputView']['focus'](_0x2e95e9);}['setPromptInputValue'](_0x3c661c){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x3c661c;}}class As extends _0x15a8cb{constructor(_0x2335e9){super(_0x2335e9);const _0x40e2ff=new _0x5bfd84(_0x2335e9);_0x40e2ff['set']({'label':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x40e2ff['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x40e2ff]}]});}}class Bi extends _0x2e3f47{['conversationStartButton'];['resizeButton'];constructor(_0x5b0018,_0x17c514){super(_0x5b0018,{'label':i(_0x5b0018,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':Ft}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x5b0018),this['children']['add'](this['conversationStartButton']),_0x17c514&&(this['resizeButton']=Ri(_0x5b0018,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x41d70d){const _0x3a7c12=new _0x5bfd84(_0x41d70d);return _0x3a7c12['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x377ed9,'class':'ck-ai-chat__start-conversation'}),_0x3a7c12['on']('execute',()=>{this['fire']('startConversation');}),_0x3a7c12;}}class Fi extends _0x15a8cb{constructor(_0x51683c){super(_0x51683c),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':i(_0x51683c,'AI_DISCLAIMER_TEXT')}]}]});}}class Mt extends _0x15a8cb{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x426ab5,_0x2ce84b){super(_0x426ab5),this['_bodyCollection']=new _0x49fddd(_0x426ab5),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new Bi(_0x426ab5,_0x2ce84b['showResizeButton']),this['chatHeader']['delegate'](...Lt)['to'](this),this['chatFeed']=new ji(_0x426ab5,this['_bodyCollection']),this['chatFeed']['delegate'](...Lt)['to'](this),this['chatControls']=new xi(_0x426ab5,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x2ce84b['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...Lt)['to'](this),this['chatDisclaimer']=new Fi(_0x426ab5),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x426ab5['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x188b0d,_0x42f424,_0x2eef2a,_0x4a7d3c){this['chatControls']['populateSourceResourceBalloon'](_0x188b0d,_0x42f424,_0x2eef2a,_0x4a7d3c);}['closeSourceResourceBalloon'](_0x59deb0){this['chatControls']['closeSourceResourceBalloon'](_0x59deb0);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class ut extends _0x118815{static get['requires'](){return[_t];}['_view'];static get['pluginName'](){return'AIChatUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['feedItemRenderingStrategy']='streaming';['showDiff']=!0x0;['_promiseQueue'];['_interactionPromiseResolver'];['_titleAnimationInterval']=void 0x0;['_isTrackChangesCommandValueBound']=!0x1;constructor(_0x473f78){super(_0x473f78);const _0x4f67fd=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new N(),this['_view']=new Mt(this['context']['locale'],{'showResizeButton':_0x4f67fd['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...Lt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x18960b,{showDiff:_0x14cc94})=>{this['showDiff']=_0x14cc94;}),_0x4f67fd['view']['addTab']({'id':'chat','buttonLabel':i(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':Ft,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x183434=>_0x183434),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x401463=>_0x401463),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x1d11d3){const _0x19eeb3=this['context']['config']['get']('ai.chat.welcomeMessage')??i(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x1d11d3['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x19eeb3}),this['fire']('conversationCreated');}['addFeedItemStaticMessage']({id:_0x2102cc,staticMessage:_0x5ca152}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x2102cc,'initialContent':'<p>'+_0x5ca152+'</p>'});}['addFeedItemUserMessage'](_0x3786a9){const _0x3b60d9=_0x3786a9['attributes']?.['displayedPrompt']||_0x3786a9['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x3786a9['contextItems']['values']()),'initialContent':'<p>'+_0x3b60d9+'</p>','id':_0x3786a9['id']});}['addFeedItemError']({errorMessage:_0x475ffa,id:_0x584590}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x475ffa+'</p>','id':_0x584590});}['addFeedItemAIReply'](_0x17383b){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x17383b['interactionId']+':'+_0x17383b['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0xc1c18d){const _0x42b4bb=et(this['context']);let _0x183724=_0x42b4bb['config']['get']('ai.availableReplyActions')||[...X];if(_0x42b4bb['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x29d8c9=_0x42b4bb['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x29d8c9,'value');}}else _0x183724=_0x183724['filter'](_0x4137c3=>'insertSuggestion'!=_0x4137c3);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0xc1c18d['interactionId']+':'+_0xc1c18d['id'],'areActionsDisabled':_0xc1c18d['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x183724}),this['clearLoadingMessage']();});}['addFeedInteractionHeader'](_0x261dda,_0x33d44d){const _0x1681cb=this['_view']['chatFeed']['children']['last'];if(_0x1681cb instanceof Ht)return this['_view']['chatFeed']['children']['remove'](_0x1681cb),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x261dda['id'],'capabilities':{'isWebSearchEnabled':_0x1681cb['capabilities']['isWebSearchEnabled']||_0x33d44d['isWebSearchEnabled'],'isReasoningEnabled':_0x1681cb['capabilities']['isReasoningEnabled']||_0x33d44d['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x261dda['id'],'capabilities':_0x33d44d});}async['addFeedItemCustomElement'](_0x203eb8,_0x6db6b8){let _0x1eb061;return await this['_promiseQueue']['enqueue'](async()=>{_0x1eb061=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x203eb8,'id':_0x6db6b8});}),_0x1eb061;}['removeFeedItem'](_0x568041){this['_view']['chatFeed']['removeItem'](_0x568041);}['hasFeedItem'](_0x580240){return this['_view']['chatFeed']['hasItem'](_0x580240);}['updateFeedInteractionHeader'](_0xa76ff6){const _0xb2dabb=this['_view']['chatFeed']['children']['find'](_0x12d143=>_0x12d143['options']['id']==_0xa76ff6['id']&&_0x12d143 instanceof Ht);_0xb2dabb&&_0xb2dabb['set']('isVisible',_0xa76ff6['isVisible']);}async['updateFeedItemAIReplyContent'](_0x325a95){const _0x1f930d=_0x325a95['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x3783a2=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x325a95,'abortSignal':_0x3783a2,'renderingStrategy':_0x1f930d}),_0x325a95['isDone']&&this['markFeedItemAsDone'](_0x325a95['id']);});}['updateFeedItemAIReplySources'](_0x11faa3,_0x29b11b){this['_view']['chatFeed']['updateWebSources'](_0x11faa3,_0x29b11b);}async['updateFeedItemAIReplySuggestionContent'](_0x1948e3){const _0x2fe490=_0x1948e3['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x406e8d=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x1948e3,'abortSignal':_0x406e8d,'renderingStrategy':_0x2fe490}),_0x1948e3['isDone']&&this['markFeedItemAsDone'](_0x1948e3['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x348951){this['_view']['chatFeed']['updateSuggestionPartState'](_0x348951);}['setFeedItemAIReplySuggestionPartActive'](_0x4dfbcf){this['_view']['chatFeed']['setSuggestionPartActive'](_0x4dfbcf);}['markFeedItemAsDone'](_0x1e21cf){this['_view']['chatFeed']['markItemAsDone'](_0x1e21cf);}['removeFeedInteraction'](_0x27a16b){this['_view']['chatFeed']['getItemIds']()['filter'](_0x358d28=>_0x358d28['startsWith'](_0x27a16b))['forEach'](_0x15e411=>this['_view']['chatFeed']['removeItem'](_0x15e411));}['startInteraction'](){const _0x2b2c0e=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x2b2c0e),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x70a178){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x3fc0c0=>_0x3fc0c0['startsWith'](_0x70a178['id']))['forEach'](_0x3ceca3=>this['markFeedItemAsDone'](_0x3ceca3)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x559df4,_0x49ec93){this['_view']['chatControls']['addContextItem'](_0x559df4,_0x49ec93);}['removeContextItem'](_0x5f5a06){this['_view']['chatControls']['removeContextItem'](_0x5f5a06);}['setContextItemLoading'](_0x31d134,_0x3bde14){this['_view']['chatControls']['setContextItemLoading'](_0x31d134,_0x3bde14);}['setIsUploadInProgress'](_0x2d8e51){this['_view']['chatControls']['setIsUploadInProgress'](_0x2d8e51);}['setConversationContext'](_0x42cf14){this['_view']['chatControls']['setConversationContext'](_0x42cf14);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x455d78,_0xc421e7,_0x53e9c9){this['_view']['chatControls']['updateResourceState'](_0x455d78,_0xc421e7,_0x53e9c9);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x7facb6){this['_view']['chatControls']['setAddContextOptions'](_0x7facb6);}['updateCapabilities'](_0x14054f){this['_view']['chatControls']['setWebSearch'](_0x14054f['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x14054f['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x14054f));}['setSelectedModel'](_0x3e915d,_0x2cbd5f){this['_view']['chatControls']['setModel'](_0x3e915d),_0x2cbd5f&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x2be16d){this['feedItemRenderingStrategy']=_0x2be16d;}['toggleLoadingSkeleton'](_0x16da25){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x16da25);}['resetConversationTitle'](){this['setConversationTitle'](i(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x4e00af,_0x85fe43=!0x1){if(_0x85fe43&&!Pt()&&_0x4e00af['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x4e00af);this['_view']['chatHeader']['label']=_0x4e00af;}['setLoadingMessage'](_0x330ba0){this['_view']['chatFeed']['setLoadingMessage'](_0x330ba0);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x3803ed){let _0x13cbd9=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x3803ed[_0x13cbd9],_0x13cbd9++,_0x13cbd9===_0x3803ed['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x2ffb69){this['_view']['chatHeader']['isMaximized']=_0x2ffb69;}['prepareLoadingMessage'](_0x4b3ba8){return _0x4b3ba8['isWebSearchEnabled']&&_0x4b3ba8['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x4b3ba8['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x4b3ba8['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x547f53){return _0x547f53?_0x547f53['isWebSearchEnabled']&&_0x547f53['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x547f53['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x547f53['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x3e2d69,_0x1310a0,_0x3c335e,_0x4f8bc4){this['_view']['populateSourceResourceBalloon'](_0x3e2d69,_0x1310a0,_0x3c335e,_0x4f8bc4);}['closeSourceResourceBalloon'](_0x12bd7){this['_view']['closeSourceResourceBalloon'](_0x12bd7);}['setPromptInputValue'](_0x5383ae){this['_view']['chatControls']['setPromptInputValue'](_0x5383ae);}['focusPromptInput'](_0x12824b=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x12824b);}['scrollFeedToSuggestion'](_0x40bd3e,_0x170667){this['_view']['chatFeed']['scrollToSuggestion'](_0x40bd3e,_0x170667);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class bi extends _0x236991{['sections'];constructor(_0x59203c,_0x391d9d){super(_0x59203c),this['sections']=_0x391d9d,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x59af59){let _0x2df113=0x0,_0xb0c448=0x0;for(const _0x2c7751 of this['sections']){const {resultsCount:_0x5e106f,totalItemsCount:_0x183043}=_0x2c7751['filter'](_0x59af59);_0x2df113+=_0x5e106f,_0xb0c448+=_0x183043;}return{'resultsCount':_0x2df113,'totalItemsCount':_0xb0c448};}}class yi extends _0x5e9d54{['title'];['itemsViews'];['_itemsListView'];constructor(_0x73324b,{title:_0x29062a,items:_0x7c6993}){super(_0x73324b);const _0x597bf6=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x29062a,this['itemsViews']=_0x7c6993;const _0x5061da=new _0x15a8cb(_0x73324b);_0x5061da['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x236991(_0x73324b),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x597bf6['if']('isVisible','ck-hidden',_0x28a3b7=>!_0x28a3b7)]},'children':[_0x5061da,this['_itemsListView']]});}['filter'](_0x3d13dc){const _0x1f5979=this['itemsViews']['length'];let _0xd113b3=0x0;for(const _0xd08a4f of this['itemsViews']){if(_0x3d13dc){const _0x252dc2=_0xd08a4f['isMatching'](_0x3d13dc);_0xd08a4f['isVisible']=!!_0x252dc2,_0xd08a4f['highlightText'](_0x3d13dc);}else _0xd08a4f['isVisible']=!0x0,_0xd08a4f['highlightText'](null);_0xd08a4f['isVisible']&&_0xd113b3++;}return this['isVisible']=_0xd113b3>0x0,{'resultsCount':_0xd113b3,'totalItemsCount':_0x1f5979};}['getItem'](_0x22cb2f){return this['itemsViews']['find'](_0x36d01d=>_0x36d01d['id']===_0x22cb2f);}['removeItem'](_0x54eb52){const _0x25eb6d=this['itemsViews']['indexOf'](_0x54eb52);-0x1!==_0x25eb6d&&(this['itemsViews']['splice'](_0x25eb6d,0x1),this['_itemsListView']['items']['remove'](_0x54eb52));}}class gi extends/* #__PURE__ -- @preserve */
27
+ _0x52eed7(_0x5e9d54){['id'];static ['LOADING_LABELS']={'remove':'AI_CHAT_HISTORY_LOADING_REMOVING','rename':'AI_CHAT_HISTORY_LOADING_RENAMING','pin':'AI_CHAT_HISTORY_LOADING_PINNING','unpin':'AI_CHAT_HISTORY_LOADING_UNPINNING'};['actions'];['mainContent'];['_titleView'];constructor(_0x34d89a,_0x284315){super(_0x34d89a);const _0x1d3926=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x284315['pinned']),this['set']('loadingState',null),this['id']=_0x284315['id'];const {title:_0x4f29b2,createdAt:_0x26dbc8,active:_0x443bf9=!0x1}=_0x284315;this['_titleView']=new _0x258b31(),this['_titleView']['text']=_0x4f29b2,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x54bdde=this['_createCheckView'](),_0xd8fda3=this['_createPinButtonView'](_0x34d89a),_0x32300e=this['_createMenuDropdownView'](),_0x267c2e=this['_createEditInputView'](_0x34d89a,_0x4f29b2),_0x47c8c3=this['_createAcceptEditButtonView'](_0x34d89a,_0x267c2e),_0x2dfb8c=this['_createCancelEditButtonView'](_0x34d89a,_0x267c2e);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0xd8fda3),this['actions']['add'](_0x32300e),this['on']('change:isEdit',(_0x46d317,_0x17cf0b,_0x1f5856)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x1f5856?(this['actions']['add'](_0x47c8c3),this['actions']['add'](_0x2dfb8c),this['mainContent']['add'](_0x267c2e),_0x267c2e['element']['focus']()):(this['actions']['add'](_0xd8fda3),this['actions']['add'](_0x32300e),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x443bf9?'ck-ai-chat-history__item--active':'',_0x1d3926['if']('isVisible','ck-hidden',_0x22cefb=>!_0x22cefb),_0x1d3926['if']('isEdit','ck-ai-chat-history__item--edit')],'role':'listitem'},'children':[{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-check-container']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-check',_0x1d3926['if']('loadingState','ck-hidden',_0x53cd20=>!!_0x53cd20)]},'children':_0x443bf9?[_0x54bdde]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x1d3926['if']('loadingState','ck-hidden',_0x4741b5=>!_0x4741b5)]},'children':[this['_createSpinnerView']()]}]},{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-row']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-content']},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-title',_0x1d3926['if']('loadingState','ck-hidden',_0x449c1d=>!!_0x449c1d)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x1d3926['if']('loadingState','ck-hidden',_0x5aa6a9=>!_0x5aa6a9)]},'children':[{'text':_0x1d3926['to']('loadingState',_0x174516=>_0x174516?i(this['locale'],gi['LOADING_LABELS'][_0x174516]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x26dbc8]}]},{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-actions']},'children':this['actions']}]}]}),this['on']('click',()=>{this['isEdit']||this['fire']('selectConversation',{'id':this['id']});});}['updateTitle'](_0x2bb2ff){this['_titleView']['text']=_0x1052a4(_0x2bb2ff);}['updateLoadingState'](_0x37b637,_0x4dc2f7){this['set']('loadingState',_0x4dc2f7?_0x37b637:null);}['_createCheckView'](){const _0x9468ff=new _0x2ae97e();return _0x9468ff['set']({'content':_0x1cd2e2}),_0x9468ff;}['_createPinButtonView'](_0x4cfc46){const _0x54b8c8=new _0x5bfd84(_0x4cfc46);return _0x54b8c8['set']({'label':i(_0x4cfc46,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x125ef8,'withText':!0x1,'tooltip':!0x0}),_0x54b8c8['bind']('isOn')['to'](this,'pinned'),_0x54b8c8['on']('execute',()=>{const _0x15a595=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x15a595});}),_0x54b8c8;}['_createMenuDropdownView'](){const _0x2ce2e5=_0x29ed58(this['locale'],_0x26095f),_0x555dd2=_0x2ce2e5['panelView']['children'];_0x2ce2e5['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x22e1a7}),_0x2ce2e5['panelPosition']='sw';const _0x5d0c70=new _0x5bfd84(this['locale']);_0x5d0c70['label']=i(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x5d0c70['withText']=!0x0,_0x5d0c70['on']('execute',()=>{this['isEdit']=!0x0;});const _0x25d905=new _0x5bfd84(this['locale']);_0x25d905['label']=i(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x25d905['withText']=!0x0,_0x25d905['on']('execute',()=>{this['showConfirm'](i(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x106dd5=new _0x236991(this['locale']),_0x503888=new _0x5e9d54(this['locale']);_0x503888['children']['add'](_0x5d0c70);const _0x441b93=new _0x5e9d54(this['locale']);return _0x441b93['children']['add'](_0x25d905),_0x106dd5['items']['addMany']([_0x503888,_0x441b93]),_0x555dd2['add'](_0x106dd5),_0x2ce2e5;}['_createEditInputView'](_0x282e67,_0x62805e){const _0x50d41d=new _0x406518(_0x282e67),_0x532a94=_0x50d41d['bindTemplate'];return _0x50d41d['value']=_0x62805e,_0x50d41d['extendTemplate']({'on':{'keydown':_0x532a94['to'](_0x5bc677=>{'Enter'==_0x5bc677['key']&&this['_commitEditInputValue'](_0x50d41d);})}}),_0x50d41d;}['_createAcceptEditButtonView'](_0x2cbf1b,_0x77691a){const _0x3230bb=new _0x5bfd84(_0x2cbf1b);return _0x3230bb['set']({'icon':_0x1cd2e2,'withText':!0x1,'tooltip':i(_0x2cbf1b,'AI_CHAT_HISTORY_ACCEPT')}),_0x3230bb['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x3230bb['on']('execute',()=>{this['_commitEditInputValue'](_0x77691a);}),_0x3230bb;}['_commitEditInputValue'](_0x1caf88){const _0x59f612=_0x1caf88['element']['value']||'';this['_titleView']['text']=_0x59f612,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x59f612});}['_createCancelEditButtonView'](_0x765e5e,_0x1227d2){const _0x5a3bb6=new _0x5bfd84(_0x765e5e);return _0x5a3bb6['set']({'icon':_0x187b85,'withText':!0x1,'tooltip':i(_0x765e5e,'AI_CHAT_HISTORY_CANCEL')}),_0x5a3bb6['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x5a3bb6['on']('execute',()=>{this['isEdit']=!0x1,_0x1227d2['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x5a3bb6;}['_createSpinnerView'](){const _0x180076=new Ci('tiny');return _0x180076['isVisible']=!0x0,_0x180076;}['isMatching'](_0x3bedd1){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x3bedd1)?{'title':!0x0}:null;}['highlightText'](_0x3b3ec5){this['_titleView']['highlightText'](_0x3b3ec5);}}class It extends _0x15a8cb{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x264a20,_0x2423a3){super(_0x264a20),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x21de3c=new _0x2e3f47(_0x264a20,{'label':i(_0x264a20,'AI_CHAT_HISTORY_HEADING'),'icon':mt,'class':'ck-ai-header\x20ck-ai-header_history'});_0x2423a3&&(this['resizeButton']=Ri(_0x264a20,this),_0x21de3c['children']['add'](this['resizeButton'])),this['sectionsView']=new bi(_0x264a20,[]),this['sectionsView']['delegate'](...Hi)['to'](this),this['mainErrorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),this['mainErrorView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isMainErrorViewVisible','ck-hidden',_0x155cd4=>!_0x155cd4)]}}),this['on']('change:isLoading',()=>this['_updateViewVisibility']()),this['on']('change:hasItems',()=>this['_updateViewVisibility']()),this['on']('change:errorMessage',()=>this['_updateViewVisibility']()),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat-history','ck-rounded-corners'],'dir':'ltr'},'children':[_0x21de3c,{'tag':'div','attributes':{'class':['ck-ai-chat-history__content']},'children':[this['skeletonView'],this['mainErrorView'],this['emptyView'],this['searchView']]}]});}['_updateViewVisibility'](){this['isSearchViewVisible']=!this['isLoading']&&this['hasItems'],this['isEmptyViewVisible']=!this['isLoading']&&!this['hasItems']&&!this['errorMessage'],this['isMainErrorViewVisible']=!this['isSearchViewVisible']&&!!this['errorMessage'];}['_createSearchView'](){const _0x2d5eac=new _0x230635(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x2f2309=>i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x2f2309),'secondary':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x36ec84=this['_createErrorView']();return _0x36ec84['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x7a5f43=>!_0x7a5f43)]}}),_0x2d5eac['on']('render',()=>{_0x2d5eac['children']['add'](_0x36ec84,0x1);}),_0x2d5eac['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x569ff1=>!_0x569ff1)]}}),_0x2d5eac;}['_createSkeletonView'](){const _0x31924a=new Ei(this['locale'],Si['aiHistory']);return _0x31924a['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x588a05=>!_0x588a05)]}}),_0x31924a;}['_createErrorView'](){const _0x48e658=new _0x15a8cb(this['locale']),_0x52214b=new _0x5bfd84(this['locale']);_0x52214b['set']({'withText':!0x1,'icon':_0x187b85,'class':'ck-ai-notification_error__dismiss-button'}),_0x52214b['bind']('isVisible')['to'](this,'hasItems',_0x5dd312=>!!_0x5dd312),_0x52214b['on']('execute',()=>{this['errorMessage']='';});const _0x513081=this['bindTemplate'];return _0x48e658['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x513081['to']('errorMessage')}]},_0x52214b]}),_0x48e658;}['_createEmptyStateView'](){const _0x139e5e=new _0x5bfd84(this['locale']);_0x139e5e['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x377ed9,'class':'ck-ai-chat__start-conversation'}),_0x139e5e['on']('execute',()=>{this['fire']('openChat');});const _0x10b44a=new _0x15a8cb(this['locale']);return _0x10b44a['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x4b24cd=>!_0x4b24cd)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[i(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x139e5e]}),_0x10b44a;}['_createListItemViews'](_0x2a81f9,_0x3ff5aa){const _0x143ca5=[];for(const _0x142cfa of _0x2a81f9){const _0x49d2c2=new gi(_0x3ff5aa,_0x142cfa);_0x49d2c2['delegate'](...Hi)['to'](this),_0x143ca5['push'](_0x49d2c2);}return _0x143ca5;}['updateHistoryItemsWithCategories'](_0x29e722){const _0x5a0c5d=this['locale']||'en',_0x248409=[];for(const _0x509dea of _0x29e722){const _0x1a3378=this['_createListItemViews'](_0x509dea['items'],_0x5a0c5d);_0x248409['push'](new yi(_0x5a0c5d,{'title':_0x509dea['title'],'items':_0x1a3378}));}this['sectionsView']['sections']=_0x248409,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x248409),this['hasItems']=_0x29e722['some'](_0x5a6f2e=>_0x5a6f2e['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x5de28c){for(const _0x356943 of this['sectionsView']['sections']){const _0xcbc0bb=_0x356943['getItem'](_0x5de28c);if(_0xcbc0bb){if(_0x356943['removeItem'](_0xcbc0bb),0x0===_0x356943['itemsViews']['length']){const _0x4d3367=this['sectionsView']['sections']['indexOf'](_0x356943);-0x1!==_0x4d3367&&(this['sectionsView']['sections']['splice'](_0x4d3367,0x1),this['sectionsView']['items']['remove'](_0x356943));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x5ed1d6,_0x1a0f8e){for(const _0x3f2401 of this['sectionsView']['sections']){const _0x2201bb=_0x3f2401['getItem'](_0x5ed1d6);if(_0x2201bb){_0x2201bb['updateTitle'](_0x1a0f8e);break;}}}['updateItemLoadingState'](_0x58c615,_0x494e73,_0x741c2e){for(const _0x4fec3d of this['sectionsView']['sections']){const _0xbbe3c3=_0x4fec3d['getItem'](_0x58c615);if(_0xbbe3c3){_0xbbe3c3['updateLoadingState'](_0x494e73,_0x741c2e);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x52d97f=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x52d97f);}}}const Hi=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class ct extends _0x118815{static get['requires'](){return[_t];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x36d0f8){super(_0x36d0f8);const _0x2d97ed=this['context']['plugins']['get']('AITabs');this['_historyView']=new It(this['context']['locale'],_0x2d97ed['showResizeButton']),this['_historyView']['delegate'](...Hi)['to'](this),_0x2d97ed['view']['addTab']({'id':'history','buttonLabel':i(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':mt,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0xd86a76){this['_historyView']['removeHistoryItem'](_0xd86a76);}['updateItems'](_0x295850){this['_historyView']['updateHistoryItemsWithCategories'](_0x295850);}['updateItemTitle'](_0x150407,_0x41d7e4){this['_historyView']['updateItemTitle'](_0x150407,_0x41d7e4);}['updateItemLoadingState'](_0x45aa4f,_0x1cdd2b,_0x312308){this['_historyView']['updateItemLoadingState'](_0x45aa4f,_0x1cdd2b,_0x312308);}['setLoadingSkeleton'](_0x490a38){this['_historyView']['isLoading']=_0x490a38;}['showError'](_0x1440ef){this['_historyView']['errorMessage']=_0x1440ef;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x26a727){this['_historyView']['isMaximized']=_0x26a727;}}class Ue extends ts(){['id'];['createdAt'];constructor({id:_0x488d0a,title:_0x3e6165,createdAt:_0x46eb2f,updatedAt:_0x1f283d,pinned:_0x1f2465}){super(),this['id']=_0x488d0a,this['createdAt']=new Date(_0x46eb2f),this['set']('title',_0x3e6165),this['set']('updatedAt',_0x1f283d?new Date(_0x1f283d):null),this['set']('pinned',_0x1f2465||!0x1);}['updateTitle'](_0x30e55a){this['set']('title',_0x1052a4(_0x30e55a)),this['updatedAt']=new Date();}['updatePinned'](_0x5539bd){this['set']('pinned',_0x5539bd),this['updatedAt']=new Date();}}class Tt extends _0x204e9f(){['items']=[];['connector'];['group'];constructor({connector:_0x1a94e6,group:_0x177757}){super(),this['connector']=_0x1a94e6,this['group']=_0x177757;}async['init'](){try{const _0x454a55=this['connector']['fetchConversations'](this['group']),_0x54d68a=await _0x454a55['getConversations']();this['loadItems'](_0x54d68a);}catch(_0x4aa0ab){this['fire']('error',{'error':_0x4aa0ab,'operation':'init'});}}['addItem'](_0x1a55aa){this['items']['push'](_0x1a55aa);}async['removeItem'](_0x3d00ce){const _0x46e526=this['items']['findIndex'](_0x3e847d=>_0x3e847d['id']===_0x3d00ce);if(-0x1===_0x46e526)return!0x1;try{return await this['connector']['deleteConversation'](_0x3d00ce)['execute'](),this['items']['splice'](_0x46e526,0x1),this['fire']('itemRemoved',{'itemId':_0x3d00ce}),!0x0;}catch(_0x36b4c){return this['fire']('error',{'error':_0x36b4c,'operation':'removeItem','itemId':_0x3d00ce}),!0x1;}}['getItem'](_0x59e4d8){return this['items']['find'](_0x4032a8=>_0x4032a8['id']===_0x59e4d8);}async['updateItemTitle'](_0x5b1481,_0x21918a){const _0xcc66c5=this['getItem'](_0x5b1481);if(!_0xcc66c5)return!0x1;try{return await this['connector']['updateConversation'](_0x5b1481,{'title':_0x21918a})['getResult'](),_0xcc66c5['updateTitle'](_0x21918a),this['fire']('itemUpdated',{'itemId':_0x5b1481,'updates':{'title':_0x21918a}}),!0x0;}catch(_0x449901){return this['fire']('error',{'error':_0x449901,'operation':'updateItemTitle','itemId':_0x5b1481}),!0x1;}}async['updateItemPinned'](_0x5abeb0,_0x2d728f){const _0x5e790f=this['getItem'](_0x5abeb0);if(!_0x5e790f)return!0x1;try{return await this['connector']['updateConversation'](_0x5abeb0,{'pinned':_0x2d728f})['getResult'](),_0x5e790f['updatePinned'](_0x2d728f),this['fire']('itemUpdated',{'itemId':_0x5abeb0,'updates':{'pinned':_0x2d728f}}),!0x0;}catch(_0x2fff69){return this['fire']('error',{'error':_0x2fff69,'operation':'updateItemPinned','itemId':_0x5abeb0}),!0x1;}}['loadItems'](_0x4b1879){try{this['items']=[],_0x4b1879['map'](_0x4d3ad0=>{this['addItem'](new Ue(_0x4d3ad0));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x143a39){this['fire']('error',{'error':_0x143a39,'operation':'loadItems'});}}['getItems'](_0x21acd5={}){const _0x16dc40=void 0x0!==_0x21acd5['pinned']&&_0x21acd5['pinned'],_0x67703c=_0x21acd5['from']?new Date(_0x21acd5['from']['getFullYear'](),_0x21acd5['from']['getMonth'](),_0x21acd5['from']['getDate']()):null,_0x9e3575=_0x21acd5['to']?new Date(_0x21acd5['to']['getFullYear'](),_0x21acd5['to']['getMonth'](),_0x21acd5['to']['getDate']()):null;return this['items']['filter'](_0x4860e7=>{if(_0x4860e7['pinned']!==_0x16dc40)return!0x1;if(_0x9e3575){const _0x18e944=new Date(_0x4860e7['createdAt']['getFullYear'](),_0x4860e7['createdAt']['getMonth'](),_0x4860e7['createdAt']['getDate']());return _0x67703c?_0x67703c['getTime']()===_0x9e3575['getTime']()?_0x18e944['getTime']()===_0x67703c['getTime']():_0x18e944<_0x9e3575&&_0x18e944>=_0x67703c:_0x18e944<_0x9e3575;}return!0x0;});}}class rt extends _0x118815{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[S,ht,ct,_t];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](S),this['_aiChatHistoryUi']=this['context']['plugins']['get'](ct),this['_aiChatController']=this['context']['plugins']['get'](ht);const _0x14216c=this['context']['plugins']['get'](_t);try{const _0x2c3f88=this['_aiChatController']['getGroupId']();this['history']=new Tt({'connector':this['_aiConnector'],'group':_0x2c3f88}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x45e7d5,_0x33e423)=>{this['_setItemLoading'](_0x33e423['id'],'remove'),this['_handleRemove'](_0x33e423['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x4eddb1,_0x218b64)=>{this['_setItemLoading'](_0x218b64['id'],'rename'),this['_handleEditTitle'](_0x218b64['id'],_0x218b64['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x22e9fb,_0x3d91f4)=>{void 0x0!==_0x3d91f4['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x3d91f4['itemId'],_0x3d91f4['updates']['title']),void 0x0!==_0x3d91f4['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x3d91f4['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x302bdf,_0x1c3f80)=>{this['_aiChatController']['handleRemovedConversation'](_0x1c3f80['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x1c3f80['itemId']),this['_clearItemLoading'](_0x1c3f80['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x38e265,_0x3111df)=>{this['_handleHistoryErrorUI'](_0x3111df['error'],_0x3111df['operation'],_0x3111df['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x63c496,_0x873d2c)=>{this['_handleSelectConversation'](_0x873d2c['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x13b1cf,_0x27ac0e)=>{const _0x51365e=_0x27ac0e['pinned']?'pin':'unpin';this['_setItemLoading'](_0x27ac0e['id'],_0x51365e),this['_handleTogglePin'](_0x27ac0e['id'],_0x27ac0e['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x14216c['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x14216c['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x14216c,'resizedTabs',(_0x53d4a2,_0x5ba8f2)=>{this['_setIsMaximized'](_0x5ba8f2);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x14216c['resize']();});}catch(_0x4d9ec4){this['_handleHistoryErrorUI'](_0x4d9ec4,'init');}}async['_handleEditTitle'](_0x59a53b,_0x261d2b){await this['history']['updateItemTitle'](_0x59a53b,_0x261d2b);}async['_handleTogglePin'](_0x196541,_0x9a0723){await this['history']['updateItemPinned'](_0x196541,_0x9a0723);}async['_handleRemove'](_0xb79128){await this['history']['removeItem'](_0xb79128);}async['_handleSelectConversation'](_0x435cd0){await this['_aiChatController']['loadConversation'](_0x435cd0);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x1f29e5=this['_aiChatController']['activeConversation']?.['id'],_0x11db90=this['_getCategorizedItems']()['map'](_0x4be435=>({'title':_0x4be435['title'],'items':_0x4be435['items']['map'](_0x2bd0c5=>({'id':_0x2bd0c5['id'],'title':_0x2bd0c5['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x2bd0c5['createdAt'])['toLocaleDateString'](),'active':_0x2bd0c5['id']===_0x1f29e5,'pinned':_0x2bd0c5['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x11db90);}['_setItemLoading'](_0x3733d7,_0x2f20ee){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x3733d7,_0x2f20ee,!0x0);}['_clearItemLoading'](_0x473232){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x473232,null,!0x1);}['_handleHistoryErrorUI'](_0x31d605,_0x1e043d,_0x1c832b){const _0x28cbb3=this['_generateErrorMessage'](_0x1e043d,_0x1c832b);this['_aiChatHistoryUi']['showError'](_0x28cbb3),_0x1c832b&&this['_clearItemLoading'](_0x1c832b),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x31cbc4,_0x4c6d52){const _0xeee350=_0x4c6d52?this['history']['getItem'](_0x4c6d52):null,_0x106f94=_0xeee350?.['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x31cbc4){case'updateItemTitle':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x106f94);case'updateItemPinned':{const _0x2662c3=i(this['context']['locale'],_0xeee350?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x2662c3,_0x106f94]);}case'removeItem':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x106f94);case'init':case'loadItems':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x2ffa8f=new Date(),_0x5e66ed=new Date(_0x2ffa8f['getFullYear'](),_0x2ffa8f['getMonth'](),_0x2ffa8f['getDate']()),_0x5039e1=new Date(_0x5e66ed);_0x5039e1['setDate'](_0x5039e1['getDate']()-0x1);const _0x50399e=new Date(_0x5e66ed);_0x50399e['setDate'](_0x50399e['getDate']()-0xe);const _0x59ed68=this['history']['getItems']({'pinned':!0x0}),_0x1e8454=this['history']['getItems']({'from':_0x5e66ed,'to':_0x5e66ed}),_0xb07b55=this['history']['getItems']({'from':_0x5039e1,'to':_0x5039e1}),_0x490e89=this['history']['getItems']({'from':_0x50399e,'to':_0x5039e1}),_0x590742=this['history']['getItems']({'to':_0x50399e}),_0x6ef444=[];return _0x59ed68['length']>0x0&&_0x6ef444['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x59ed68}),_0x1e8454['length']>0x0&&_0x6ef444['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x1e8454}),_0xb07b55['length']>0x0&&_0x6ef444['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0xb07b55}),_0x490e89['length']>0x0&&_0x6ef444['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x490e89}),_0x590742['length']>0x0&&_0x6ef444['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x590742}),_0x6ef444;}['_setIsMaximized'](_0x4bedec){this['_aiChatHistoryUi']['setIsMaximized'](_0x4bedec);}}class gt extends _0x118815{static get['requires'](){return[rt,ct];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ua extends _0x118815{static get['requires'](){return[ht,D,ut,gt];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4ce502){super(_0x4ce502),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),this['context']['config']['define']('ai.chat.initialConversation','new');}async['addSelectionToChatContext'](){await this['context']['plugins']['get'](ht)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](ht)['startConversation']();}async['sendMessage']({message:_0x38613e,attributes:_0x73face}){await this['context']['plugins']['get'](ht)['sendMessage']({'message':_0x38613e,'attributes':_0x73face});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](ht)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](ht)['focusPromptInput']();}['registerToolDataCallback'](_0x393701){this['context']['plugins']['get'](ht)['_registerToolDataCallback'](_0x393701);}}class cs extends _0x5bfd84{['id'];constructor(_0x3ced4f,_0x5e22d1){super(_0x3ced4f);const {id:_0x4a300d,type:_0x963232,icon:_0x124048}=_0x5e22d1;this['id']=_0x4a300d,this['set']({'label':_0x5e22d1['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x5e22d1['id']}}),_0x124048?this['icon']=_0x124048:'chat'===_0x963232?this['icon']=_0x294a94:'review'===_0x963232?this['icon']=_0x283d0c:'translate'===_0x963232&&(this['icon']=Vt);}}class lt extends _0x15a8cb{['listView'];constructor(_0x3400eb,_0x162af6){super(_0x3400eb);const _0x134dc0=_0x162af6['map'](_0x481696=>{const _0x4252e9=new _0x5e9d54(this['locale']),_0x4a989a=new cs(this['locale'],_0x481696);return _0x4252e9['children']['add'](_0x4a989a),_0x4a989a['delegate']('execute')['to'](this),_0x4252e9;});this['listView']=new _0x236991(this['locale']),this['listView']['items']['addMany'](_0x134dc0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const wt='chat-shortcuts';var Va=function(_0x47bec3){return _0x47bec3['CHAT']='chat',_0x47bec3['REVIEW']='review',_0x47bec3['TRANSLATE']='translate',_0x47bec3;}({});class Ba extends _0x118815{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[ut];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](ut),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x8a39ac=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x8a39ac['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x8a39ac,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x98aa41=Object['values'](Va);this['_shortcuts']['forEach'](_0x192d5d=>{let _0x5b5b22=!0x0;if(_0x192d5d['id']&&_0x192d5d['label']&&_0x98aa41['includes'](_0x192d5d['type'])?'chat'===_0x192d5d['type']&&(_0x5b5b22='string'==typeof _0x192d5d['prompt']):_0x5b5b22=!0x1,!_0x5b5b22)throw new _0x542443('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x192d5d});});}['_injectShortcuts'](){const _0x1180a8=this['context']['plugins']['get'](ut);this['_shortcutsView']=new lt(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x1180a8['addFeedItemCustomElement'](this['_shortcutsView']['element'],wt),this['_shortcutsView']['on']('execute',_0x4d6b0a=>{const _0x54eb39=_0x4d6b0a['source']['id'];this['_executeShortcut'](_0x54eb39);});}['_removeShortcuts'](){const _0x35d98b=this['context']['plugins']['get'](ut);_0x35d98b['hasFeedItem'](wt)&&_0x35d98b['removeFeedItem'](wt),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x3567d3){const _0x5703ab=this['_shortcuts']['find'](_0x1cede0=>_0x1cede0['id']===_0x3567d3),_0x1ce228=_0x5703ab['type'];'chat'===_0x1ce228?this['_runChatShortcut'](_0x5703ab):'review'===_0x1ce228?_0x5703ab['check']?this['_runReviewShortcut'](_0x5703ab):this['_switchTab']('reviewMode'):'translate'===_0x1ce228&&(_0x5703ab['language']?this['_runTranslateShortcut'](_0x5703ab):this['_switchTab']('translate'));}['_switchTab'](_0x226b11){if(!this['context']['plugins']['has']('AITabs'))throw new _0x542443('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x226b11});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x226b11);}async['_runChatShortcut']({prompt:_0x19d8bb,draftMode:_0x2af67a,useWebSearch:_0x5d692f=!0x1,useReasoning:_0xca0829=!0x1,model:_0x166d5c}){const _0x364d4f=this['context']['plugins']['get']('AIChat'),_0x3e84b0=this['context']['plugins']['get']('AIChatController'),_0x3a2336=_0x3e84b0['activeConversation'];let _0x3a2cba;_0x3a2cba=_0x166d5c?await _0x3a2336['chatModels']['getModel'](_0x166d5c):await _0x3a2336['chatModels']['getDefault'](),_0x3a2cba&&await _0x3a2336['setModel'](_0x3a2cba),_0x3a2336['setWebSearch'](_0x5d692f),_0x3a2336['setReasoning'](_0xca0829),_0x3e84b0['addCurrentDocumentToChatContext'](),_0x2af67a?(this['_aiChatUI']['setPromptInputValue'](_0x19d8bb),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x364d4f['sendMessage']({'message':_0x19d8bb});}['_runReviewShortcut']({check:_0x2ebb2c,model:_0x295c16,prompt:_0x113fdb,params:_0x54eaaa}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new _0x542443('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x4e7bfd={'id':_0x2ebb2c,'isCustom':'custom'===_0x2ebb2c};_0x295c16&&_0x113fdb&&(_0x4e7bfd['args']={'model':_0x295c16,'prompt':_0x113fdb}),_0x54eaaa&&(_0x4e7bfd['params']=_0x54eaaa),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x4e7bfd);}['_runTranslateShortcut']({language:_0x4a0b01}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new _0x542443('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x4a0b01,'args':{'language':_0x4a0b01}});}}class Oi extends Ut{constructor(_0x4d7bd9){super(_0x4d7bd9);const _0x295a0e=_0x4d7bd9['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x295a0e,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x4f6340=this['editor']['plugins']['get']('AITabs')['view'];_0x4f6340['isVisible']=!_0x4f6340['isVisible'];}}class jt extends _0x241f5a{static get['requires'](){return[_t];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x30d2a8=this['editor'];_0x30d2a8['commands']['add']('toggleAi',new Oi(_0x30d2a8)),_0x30d2a8['ui']['componentFactory']['add']('toggleAi',()=>{const _0x179f03=this['_createAIUIButton'](_0x5bfd84);return _0x179f03['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x179f03;}),_0x30d2a8['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x4545dc=this['_createAIUIButton'](_0x302890);return _0x4545dc['set']({'role':'menuitemcheckbox'}),_0x4545dc;});}['_createAIUIButton'](_0x468170){const _0x32f80a=this['editor'],_0x17e21c=_0x32f80a['commands']['get']('toggleAi'),_0x1d7b70=new _0x468170(_0x32f80a['locale']);return _0x1d7b70['set']({'label':i(_0x32f80a['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x57100f,'isToggleable':!0x0}),_0x1d7b70['bind']('isEnabled')['to'](_0x17e21c),_0x1d7b70['bind']('isOn')['to'](_0x17e21c,'value',_0x4bb19d=>!!_0x4bb19d),this['listenTo'](_0x1d7b70,'execute',()=>{_0x17e21c['execute']();}),_0x1d7b70;}}const nt=['applySuggestion','insertSuggestion','showNext','showPrevious'];class gs extends _0x15a8cb{['_errorView'];constructor(_0x2c370a){super(_0x2c370a),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x45c5dd){this['showError'](_0x45c5dd);}['showError'](_0x35bce4){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x35bce4,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x33298b=new _0x15a8cb(this['locale']),_0x3b139d=new _0x15a8cb(this['locale']);return _0x3b139d['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x33298b['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x528bfd=>!_0x528bfd)]},'children':[_0x3b139d]}),_0x33298b;}}const at=0xa;class P extends _0x118815{static get['requires'](){return[D];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_isUpdatingMarkers']=!0x1;['open'](_0x5000d2){const {id:_0x275389}=this['_currentConfig']??{};this['_currentConfig']=_0x5000d2;const {id:_0x554ef3}=this['_currentConfig'];this['isOpen']&&_0x275389===_0x554ef3?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x586abb=et(this['context'])['plugins']['get']('Dialog');_0x586abb['isOpen']&&this['_currentConfig']&&_0x586abb['id']===this['_currentConfig']['id']&&_0x586abb['hide']();}['_updateDialog'](){const _0x300edf=et(this['context'])['plugins']['get']('Dialog'),{icon:_0x474148,title:_0x499059}=this['_currentConfig'];_0x300edf['view']?.['headerView']&&(_0x300edf['view']['headerView']['label']=_0x499059,_0x300edf['view']['headerView']['iconView']&&_0x474148&&(_0x300edf['view']['headerView']['iconView']['content']=_0x474148)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x300edf['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](D)['showFakeVisualSelection'](this['_currentConfig']['ranges'],'ai-balloon-'+this['_currentConfig']['index'],!0x0,!0x0);}['_hideFakeVisualSelection'](_0x463077){this['context']['plugins']['get'](D)['hideFakeVisualSelection']('ai-balloon-'+_0x463077);}['_showDialog'](){const _0x33e43c=et(this['context'])['plugins']['get']('Dialog'),{id:_0x2db0e3,title:_0x196ae2,icon:_0x536808,class:_0x1635a4,mainView:_0x40f63a}=this['_currentConfig'];_0x40f63a['delegate'](...nt)['to'](this),_0x33e43c['show']({'title':_0x196ae2,'icon':_0x536808,'hasCloseButton':!0x0,'id':_0x2db0e3,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x1635a4||''),'content':_0x40f63a,'onShow':_0x53fc87=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x16b417=this['_getSelectionElements']();_0x16b417&&_0x16b417[0x0]&&st({'target':_0x16b417[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x53fc87['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x2db0e3});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](this['_currentConfig']['index']),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x2db0e3}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0xe701c2,_0x2030f0){if(!_0x2030f0)return null;const _0x52caf1=this['_getSelectionElements']();if(!_0x52caf1||0x0===_0x52caf1['length'])return{'left':Math['round'](_0x2030f0['left']+_0x2030f0['width']/0x2-_0xe701c2['width']/0x2),'top':Math['round'](_0x2030f0['top']+_0x2030f0['height']/0x2-_0xe701c2['height']/0x2)};const _0x1a4e2b=Math['round'](_0x2030f0['left']+_0x2030f0['width']/0x2-_0xe701c2['width']/0x2),_0x4e3b67=_0x52caf1['map'](_0x2f0c22=>new ot(_0x2f0c22)),_0x16e3ba=_0xe701c2['height'];return{'left':_0x1a4e2b,'top':this['_calculateOptimalTopPosition'](_0x4e3b67,_0x16e3ba,_0x2030f0)};}['_calculateOptimalTopPosition'](_0x574b16,_0x26ca02,_0x1f5fee){const _0x366826=new ot(it['window']),_0x253e73=_0x574b16['map'](_0x4873fb=>_0x4873fb['getVisible']())['filter'](_0x2936f8=>_0x2936f8),_0x448ea5=ot['getBoundingRect'](_0x253e73);if(!_0x448ea5)return Math['round'](_0x1f5fee['top']+_0x1f5fee['height']/0x2);const _0x5b6e5b=_0x366826['getIntersection'](_0x448ea5);if(!_0x5b6e5b)return Math['round'](_0x1f5fee['top']+_0x1f5fee['height']/0x2);const _0x3ebf3a=_0x1f5fee['getVisible'](),_0xea870f=_0x3ebf3a&&_0x448ea5['height']>_0x3ebf3a['height'],_0x15c6f3=_0x5b6e5b['top'],_0x455f7b=_0x5b6e5b['bottom'];if(_0xea870f){const _0x599617=(_0x3ebf3a||_0x366826)['height']/0x2-_0x26ca02/0x2,_0x5a5736=_0x15c6f3-at-_0x1f5fee['top'],_0x5c4eea=_0x1f5fee['bottom']-_0x455f7b-at;return _0x5a5736>=_0x26ca02?Math['max'](at,_0x15c6f3-_0x26ca02-at):_0x5c4eea>=_0x26ca02?_0x455f7b+at:Math['max'](at,_0x599617);}const _0x450f1c=_0x15c6f3-_0x26ca02,_0x1c50d8=_0x1f5fee['bottom']-_0x455f7b-at,_0x288de5=_0x15c6f3-at-_0x1f5fee['top'];let _0x388453;if(_0x1c50d8>=_0x26ca02)_0x388453=_0x455f7b+at;else{if(_0x288de5>=_0x26ca02)_0x388453=_0x450f1c-at;else _0x388453=_0x15c6f3+_0x448ea5['height']/0x2-_0x26ca02/0x2;}return _0x388453;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x4122a9=et(this['context']);this['listenTo'](_0x4122a9['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x5610af,data:{newRange:_0xd52d3b}}of _0x4122a9['model']['document']['differ']['getChangedMarkers']())if(_0x5610af['startsWith'](F+':')&&(_0xd52d3b&&(_0xd52d3b['start']['isEqual'](_0xd52d3b['end'])||'$graveyard'==_0xd52d3b['root']['rootName'])||null==_0xd52d3b)){const _0x5e9f94=i(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x5e9f94),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x243f35=et(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x243f35['model']['document']);}['_getSelectionElements'](){const _0x449bad=et(this['context']);return tt(_0x449bad['editing'],[..._0x449bad['model']['markers']['getMarkersGroup']('ai-selection'),..._0x449bad['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class ls extends _0x3da665{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x6a3945,_0x3931ea={}){super(_0x6a3945),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x3931ea};const _0x38f536=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x38f536?'ck-ai-mini-toolbar\x20ck-hidden':'ck-ai-mini-toolbar',this['_config']['showCopy']&&(this['_setupCopyButton'](),this['items']['add'](this['copyButton'])),this['_config']['showChanges']&&(this['_setupShowChangesButton'](),this['items']['add'](this['showChangesButton'])),this['_setupRatingButtons'](),this['_config']['showLike']&&this['items']['add'](this['likeButton']),this['_config']['showDislike']&&this['items']['add'](this['dislikeButton']),this['_config']['customView']&&this['items']['addMany'](this['_config']['customView']);}['toggleShowChangesEnabled'](_0x548dc4){this['showChangesButton']['isEnabled']=_0x548dc4;}['_setupRatingButtons'](){this['likeButton']=new _0x5bfd84(this['locale']),this['likeButton']['set']({'icon':_0x502ea4,'label':i(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x5bfd84(this['locale']),this['dislikeButton']['set']({'icon':_0x4cfb74,'label':i(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x5bfd84(this['locale']),this['copyButton']['set']({'icon':_0x2f6fb4,'label':i(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x582c9b=new _0x2ae97e();_0x582c9b['set']({'content':_0x15208f}),_0x582c9b['extendTemplate']({'attributes':{'class':['ck-ai-mini-toolbar-copy-button__check-mark']}}),this['copyButton']['on']('execute',()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20ck-ai-mini-toolbar-copy-button_copied',setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button';},0x7d0);}),this['copyButton']['children']['add'](_0x582c9b);}['_setupShowChangesButton'](){this['showChangesButton']=new _0x5bfd84(this['locale']),this['showChangesButton']['set']({'icon':_0x43cdc5,'label':i(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':'ck-ai-button-tertiary'}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x2c9868=>_0x2c9868?_0x5e9a92:_0x43cdc5),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class ft extends gs{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x4ee821,_0x395db5){super(_0x4ee821);const _0x42d18a=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new _0x510dfd(),this['_keystrokes']=new _0x394cf5(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x5a99d2({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x395db5,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new as(_0x4ee821),this['_partToolbarView']=new us(_0x4ee821,_0x395db5['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x395db5),this['_stateView']=new ps(_0x4ee821),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new ls(_0x4ee821,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new fs(_0x4ee821,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x41ebfb,_0x206930,_0x25ca7a,_0xc56624)=>{let _0xd582bc,_0x5c156e;'pending'===_0xc56624?(_0xd582bc=this['_partToolbarView'],_0x5c156e=this['_stateView']):(_0xd582bc=this['_stateView'],_0x5c156e=this['_partToolbarView']),this['_stateView']['setState'](_0x25ca7a),_0xd582bc['isVisible']=!0x1,_0x5c156e['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x42d18a['to']('_state',_0x1c24da=>'ck-ai-chat-balloon-main_state_'+_0x1c24da)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x395db5);});}['render'](){super['render'](),this['nextButtonView']['render'](),this['previousButtonView']['render'](),this['_focusTracker']['add'](this['element']),this['_focusTracker']['add'](this['nextButtonView']),this['_focusTracker']['add'](this['previousButtonView']),this['_focusTracker']['add'](this['_miniToolbarView']),this['_focusTracker']['add'](this['_partToolbarView']),this['_keystrokes']['listenTo'](this['element']),this['_keystrokes']['listenTo'](this['nextButtonView']['element']),this['_keystrokes']['listenTo'](this['previousButtonView']['element']),this['_focusables']['addMany']([this['nextButtonView'],this['previousButtonView'],this['_partToolbarView'],this['_miniToolbarView']]);}['destroy'](){super['destroy'](),this['previousButtonView']['destroy'](),this['nextButtonView']['destroy']();}['focus'](){this['focusCycler']['focusFirst']();}['focusLast'](){this['focusCycler']['focusLast']();}async['updateContent'](_0xa24499){_0xa24499?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0xa24499);}['setState'](_0x503883){this['_state']=_0x503883;}['showError'](_0x20eeab){super['showError'](_0x20eeab),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x56b023){super['showBlockingError'](_0x56b023),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x475cec){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x475cec;}['togglePartToolbarEnabled'](_0xd5f4a8){this['_partToolbarView']['isEnabled']=_0xd5f4a8;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x14aa11,showSuggestButton:_0x38fe25}){_0x14aa11=_0x14aa11&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x38fe25=_0x38fe25&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x14aa11,'showSuggestButton':_0x38fe25});}['_createNextButtonView'](){const _0x99c3d5=new _0x5bfd84(this['locale']);return _0x99c3d5['set']({'icon':_0x1ee736,'label':i(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x99c3d5['on']('execute',()=>{this['fire']('showNext');}),_0x99c3d5;}['_createPreviousButtonView'](){const _0x57911f=new _0x5bfd84(this['locale']);return _0x57911f['set']({'icon':_0x5c42c1,'label':i(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x57911f['on']('execute',()=>{this['fire']('showPrevious');}),_0x57911f;}}class fs extends _0x15a8cb{constructor(_0x79055c,_0x5a2a23){super(_0x79055c),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x5a2a23});}}class kt extends _0x241f5a{static get['requires'](){return[_0x1017f8,P];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x5c67b1){super(_0x5c67b1),this['set']('showDiff',!0x1);}['open'](_0xba9ca7){const _0x28c33d=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x28c33d['plugins']['get']('AIBalloon')['open']({..._0xba9ca7,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0xba9ca7['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0xba9ca7['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x100f72){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x100f72);}['setState'](_0x518613){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x518613);}['_createChatBalloonView'](){const _0x1ca56c=this['editor'],_0x40c45d=_0x1ca56c['plugins']['get']('AIBalloon'),_0x1865b5=_0x1ca56c['commands']['get']('trackChanges');let _0x51b781=_0x1ca56c['config']['get']('ai.availableReplyActions')||[...X];_0x1ca56c['plugins']['has']('TrackChanges')||(_0x51b781=_0x51b781['filter'](_0x4be9ea=>'insertSuggestion'!=_0x4be9ea));const _0x4fb5ba=new ft(_0x1ca56c['locale'],{'availableActions':_0x51b781,'showApplyButton':!0x0,'showSuggestButton':!!_0x1865b5});return _0x4fb5ba['bind']('showDiff')['to'](this),_0x4fb5ba['delegate'](...pt)['to'](this),_0x4fb5ba['delegate']('showPrevious','showNext')['to'](this),_0x40c45d['delegate']('dialogClosed')['to'](this),_0x4fb5ba['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x4fb5ba['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x4fb5ba['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x1865b5&&_0x4fb5ba['bind']('isTrackChangesOn')['to'](_0x1865b5,'value'),_0x4fb5ba['render'](),_0x4fb5ba;}['_toggleRotatorButtonsInDialogHeader'](_0x555e4d){const _0x250d13=this['editor'],_0x4c0071=_0x250d13['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x555e4d),_0x4c0071['has'](this['_chatBalloonView']['previousButtonView'])||(_0x4c0071['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x250d13['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x4c0071['remove'](this['_chatBalloonView']['previousButtonView']),_0x4c0071['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class Ga extends _0x241f5a{static get['requires'](){return[jt,kt,qt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Zt(_0xe83400){const {editor:_0xf259b8,action:_0x298662,withText:_0x223583=!0x1,withIcon:_0x419b88=!0x0,isInDropdown:_0x596a51=!0x0,shouldPreventFocus:_0x1bad04=!0x1}=_0xe83400;return()=>{const _0x1423cf=_0xf259b8['locale'],_0x289cc6=new _0x5bfd84(_0x1423cf),_0x4c99f7=_0x289cc6['bindTemplate'];_0x596a51&&_0x289cc6['extendTemplate']({'on':{'mouseenter':_0x4c99f7['to'](()=>{_0x1bad04&&_0x1bad04()||_0x289cc6['focus']();})}});const _0x3ae7ae=_0x298662['icon']??_0x298662['parent']?.['icon'];return _0x289cc6['set']({'label':_0x298662['displayedPrompt'],'withText':_0x223583,'role':'menuitem','icon':_0x419b88?_0x3ae7ae??_0x9e3e58:void 0x0,'tooltip':!_0x223583,'class':'ck-ai-quick-actions-button','isEnabled':_0x298662['isEnabled']}),_0x289cc6['on']('execute',()=>{_0xf259b8['editing']['view']['focus'](),_0xf259b8['commands']['execute']('aiQuickAction',_0x298662);}),_0x289cc6;};}class Gs extends _0x1426e0{['arrowView'];constructor(_0x2a0eb2,_0x2abb50){super(_0x2a0eb2,_0x2abb50);const _0x1bf1dc=this['bindTemplate'];this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':['ck-dropdown-menu-list__nested-menu__button'],'aria-haspopup':!0x0,'aria-expanded':this['bindTemplate']['to']('isOn',_0xbf5b21=>String(_0xbf5b21)),'data-cke-tooltip-disabled':_0x1bf1dc['to']('isOn')},'on':{'mouseenter':_0x1bf1dc['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x562d61=new _0x2ae97e();return _0x562d61['content']=_0x4e1794,_0x562d61['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x562d61;}}class Ks extends _0x236991{['_allListItems'];['_allSearchableItems'];constructor(_0x506d75,_0x32d632,_0x3b15c5){super(_0x506d75),this['_allListItems']=_0x32d632,this['_allSearchableItems']=_0x3b15c5;}['filter'](_0x40c247){if(!_0x40c247)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x21927e=_0x40c247['source']['toLowerCase']()['trim'](),_0x52d822=this['_allSearchableItems']['filter'](_0x7e9e09=>(_0x7e9e09['groupLabel']?_0x7e9e09['label']+'\x20('+_0x7e9e09['groupLabel']+')':_0x7e9e09['label'])['toLowerCase']()['includes'](_0x21927e));return this['items']['clear'](),this['items']['addMany'](_0x52d822['sort']((_0x30e92f,_0x1da65f)=>{const _0x1c2e23=_0x30e92f['groupLabel'],_0x26df3f=_0x1da65f['groupLabel'];return _0x1c2e23||_0x26df3f?_0x1c2e23?0x1:-0x1:0x0;})['map'](_0x512e3e=>_0x512e3e['item'])),this['_highlightQuery'](_0x21927e,_0x52d822),{'resultsCount':_0x52d822['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x440c49,_0x1b88c5){if(!_0x440c49)return;const _0x483cd7=new RegExp(_0x249f4a(_0x440c49),'gi');_0x1b88c5['forEach'](_0x14ce78=>{_0x14ce78['highlightViews']&&_0x14ce78['highlightViews']['forEach'](_0x561bb4=>{'function'==typeof _0x561bb4['highlightText']&&_0x561bb4['highlightText'](_0x483cd7);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x185d11=>{_0x185d11['highlightViews']&&_0x185d11['highlightViews']['forEach'](_0x467d46=>{'function'==typeof _0x467d46['highlightText']&&_0x467d46['highlightText'](null);});});}}const Os='menu',Hs='menuitem';class io extends _0x15a8cb{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x60c6d2,_0x4423ae,_0x2b747e,_0x2bfe35,_0x5c2de7=!0x1){const _0x5c4c5a=_0x60c6d2['locale'];super(_0x5c4c5a),this['_bodyCollection']=_0x2bfe35,this['_hasSearch']=_0x5c2de7;const _0x57c661=this['_createListItems'](_0x60c6d2,_0x4423ae,_0x2b747e);this['optionsListView']=new Ks(_0x5c4c5a,_0x57c661,this['_allSearchableItems']),this['optionsListView']['role']=Os,this['optionsListView']['items']['addMany'](_0x57c661),this['focusTracker']=new _0x510dfd(),this['keystrokes']=new _0x394cf5(),_0x5c2de7&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x57c661,this['focusCycler']=new _0x5a99d2({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x5c2de7&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x1d6d7f=_0x5c2de7&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x152ab6(_0x1d6d7f),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x5c4c5a['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x230635(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':i(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':i(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x363a5a=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x363a5a);}['_createListItems'](_0x59b8f4,_0x1b5859,_0x4d232d){const _0x5c43f1=new _0x152ab6();return _0x1b5859['forEach'](_0x5cbd70=>{if('actions'in _0x5cbd70){const {listItem:_0x40c46f}=this['_createActionGroupButton'](_0x59b8f4,_0x5cbd70,_0x4d232d);_0x5c43f1['add'](_0x40c46f),_0x5cbd70['actions']['forEach'](_0x54a4e8=>{this['_createActionButton'](_0x59b8f4,_0x54a4e8,_0x5cbd70['label'],_0x5cbd70['icon']);const {listItem:_0x5e8125,highlightViews:_0x56ffa5}=this['_createSearchResultActionButton'](_0x59b8f4,_0x54a4e8,_0x5cbd70['label'],_0x5cbd70['icon']);this['_allSearchableItems']['push']({'item':_0x5e8125,'label':_0x54a4e8['displayedPrompt'],'groupLabel':_0x5cbd70['label'],'highlightViews':_0x56ffa5});});}else{const {listItem:_0x315d8e}=this['_createActionButton'](_0x59b8f4,_0x5cbd70);_0x5c43f1['add'](_0x315d8e);const _0x3a2532=_0x315d8e['children']['first'];if(_0x3a2532){const {listItem:_0x2f5a39,highlightViews:_0x337cab}=this['_createSearchResultActionButton'](_0x59b8f4,_0x5cbd70);this['_allSearchableItems']['push']({'item':_0x2f5a39,'label':_0x3a2532['label']||'','highlightViews':_0x337cab});}}}),_0x5c43f1;}['_createActionButton'](_0x27293c,_0x348a07,_0x5f068b,_0x25731a){const _0x50a97a=new _0x5e9d54(this['locale']);if(_0x5f068b&&_0x25731a){const _0x5e0189=new _0x5bfd84(this['locale']),_0x39c745=_0x5e0189['bindTemplate'],_0x34cfda=new _0x258b31();_0x34cfda['text']=_0x348a07['displayedPrompt'];const _0x50bf57=new _0x258b31();_0x50bf57['text']=_0x5f068b;const _0xd00484=new _0x2ae97e();_0xd00484['content']=_0x25731a,_0xd00484['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x3f9284=new _0x15a8cb(this['locale']);_0x3f9284['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x147363=new _0x15a8cb(this['locale']);return _0x147363['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x5e0189['set']({'label':_0x348a07['displayedPrompt']+'\x20('+_0x5f068b+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x5e0189['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-button_with-group'],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x34cfda,_0x3f9284,_0xd00484,_0x50bf57,_0x147363],'on':{'mouseenter':_0x39c745['to'](()=>{this['_isSearchFocused']()||_0x5e0189['focus']();}),'click':_0x39c745['to'](()=>{_0x5e0189['fire']('execute');})}}),_0x5e0189['on']('execute',()=>{_0x27293c['editing']['view']['focus'](),_0x27293c['commands']['execute']('aiQuickAction',_0x348a07);}),_0x50a97a['children']['add'](_0x5e0189),{'listItem':_0x50a97a,'highlightViews':[_0x34cfda,_0x50bf57]};}{const _0x36764a=new _0x5d3d48(),_0x1b6825=new _0x5bfd84(this['locale'],_0x36764a),_0x142e5d=_0x1b6825['bindTemplate'],_0x27820a=_0x348a07['icon']??_0x348a07['parent']?.['icon'],_0x5bc248=void 0x0!==_0x348a07['icon'];return _0x1b6825['set']({'label':_0x348a07['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':_0x5bc248?_0x27820a??_0x9e3e58:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x1b6825['extendTemplate']({'on':{'mouseenter':_0x142e5d['to'](()=>{this['_isSearchFocused']()||_0x1b6825['focus']();})}}),_0x1b6825['on']('execute',()=>{_0x27293c['editing']['view']['focus'](),_0x27293c['commands']['execute']('aiQuickAction',_0x348a07);}),_0x50a97a['children']['add'](_0x1b6825),{'listItem':_0x50a97a,'highlightViews':[_0x36764a]};}}['_createSearchResultActionButton'](_0x5f2c95,_0x2c63a1,_0x5850b2,_0x1de86b){return _0x5850b2&&_0x1de86b?this['_createSearchResultGroupedActionButton'](_0x5f2c95,_0x2c63a1,_0x5850b2,_0x1de86b):this['_createSearchResultIndividualActionButton'](_0x5f2c95,_0x2c63a1);}['_createSearchResultGroupedActionButton'](_0x5619b5,_0x250eef,_0x2d20c3,_0x1111f3){const _0x305619=new _0x5e9d54(this['locale']),_0xa39168=new _0x5bfd84(this['locale']),_0x1c6eef=_0xa39168['bindTemplate'],{view:_0x557be6,highlightView:_0x41793c}=this['_createSearchResultGroupRow'](_0x2d20c3,_0x1111f3),{view:_0xfe6e30,highlightView:_0x23fde5}=this['_createSearchResultActionRow'](_0x250eef['displayedPrompt']),_0x24807b=this['_createSearchResultContentView'](_0x557be6,_0xfe6e30);return _0xa39168['set']({'label':_0x250eef['displayedPrompt'],'withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button\x20ck-ai-quick-actions-search-result-button_with-group','tooltip':!0x1}),_0xa39168['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-search-result-button','ck-ai-quick-actions-search-result-button_with-group'],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x24807b],'on':{'mouseenter':_0x1c6eef['to'](()=>{this['_isSearchFocused']()||_0xa39168['focus']();}),'click':_0x1c6eef['to'](()=>{this['_handleSearchResultButtonClick'](_0xa39168);})}}),this['_setupActionButtonExecution'](_0xa39168,_0x5619b5,_0x250eef),_0x305619['children']['add'](_0xa39168),{'listItem':_0x305619,'highlightViews':[_0x41793c,_0x23fde5]};}['_createSearchResultIndividualActionButton'](_0xc7ad29,_0x363bd3){const _0x1f6cb5=new _0x5e9d54(this['locale']),_0x397dfe=new _0x5d3d48(),_0x5a6ca0=new _0x5bfd84(this['locale'],_0x397dfe),_0x3dfe4e=_0x5a6ca0['bindTemplate'];return _0x5a6ca0['set']({'label':_0x363bd3['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x5a6ca0['extendTemplate']({'on':{'mouseenter':_0x3dfe4e['to'](()=>{this['_isSearchFocused']()||_0x5a6ca0['focus']();})}}),this['_setupActionButtonExecution'](_0x5a6ca0,_0xc7ad29,_0x363bd3),_0x1f6cb5['children']['add'](_0x5a6ca0),{'listItem':_0x1f6cb5,'highlightViews':[_0x397dfe]};}['_createSearchResultGroupRow'](_0x474118,_0x262b65){const _0xf8155b=new _0x15a8cb(this['locale']),_0x4b71b8=new _0x2ae97e();_0x4b71b8['content']=_0x262b65,_0x4b71b8['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x54fd9f=new _0x258b31();return _0x54fd9f['text']=_0x474118,_0xf8155b['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x4b71b8,_0x54fd9f]}),{'view':_0xf8155b,'highlightView':_0x54fd9f};}['_createSearchResultActionRow'](_0x5fe5df){const _0x397acd=new _0x15a8cb(this['locale']),_0x3cf971=new _0x258b31();return _0x3cf971['text']=_0x5fe5df,_0x397acd['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x3cf971]}),{'view':_0x397acd,'highlightView':_0x3cf971};}['_createSearchResultContentView'](_0x3e8f08,_0x2516f9){const _0x46ce63=new _0x15a8cb(this['locale']);return _0x46ce63['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x3e8f08,_0x2516f9]}),_0x46ce63;}['_setupActionButtonExecution'](_0x171f09,_0x464923,_0x5e8c60){_0x171f09['on']('execute',()=>{_0x464923['editing']['view']['focus'](),_0x464923['commands']['execute']('aiQuickAction',_0x5e8c60);});}['_createActionGroupButton'](_0x18279a,_0x246ccd,_0x1ba767){const _0x30357a=new _0x5e9d54(this['locale']),_0xff95ef=new _0x5d3d48(),_0x4841c2=new Gs(this['locale'],_0xff95ef),_0x5f47ef=_0x4841c2['bindTemplate'],_0x4c84e7=this['_getPanelKeystroke'](_0x1ba767),_0xe20302=this['_createGroupActionsList'](_0x18279a,_0x246ccd['actions'],_0x1ba767);_0x4841c2['set']({'label':_0x246ccd['label'],'withText':!0x0,'role':Hs,'icon':_0x246ccd['icon']??_0x9e3e58,'isEnabled':_0x246ccd['actions']['some'](_0x2beb50=>_0x2beb50['isEnabled'])}),_0x4841c2['extendTemplate']({'on':{'mouseenter':_0x5f47ef['to'](()=>{this['_isSearchFocused']()||_0x4841c2['focus']();})}});const _0x15a61d=new _0x1ddc71(this['locale']);return _0x15a61d['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x5f47ef['to'](_0x565a34=>{this['_handlePanelKeydown'](_0x565a34,_0x4c84e7,_0x4841c2,_0x15a61d);})}}),_0x4841c2['bind']('isOn')['to'](_0x15a61d,'isVisible'),this['_bodyCollection']['add'](_0x15a61d),_0x15a61d['content']['add'](_0xe20302),this['_setupGroupMenuBehavior'](_0x4841c2,_0x15a61d),_0x30357a['children']['add'](_0x4841c2),{'listItem':_0x30357a,'highlightView':_0xff95ef};}['_createGroupActionsList'](_0x5e591d,_0x2b39bc,_0x5e3948){const _0x22e2e1=new _0x236991(this['locale']);return _0x22e2e1['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x2b39bc['forEach'](_0x2d361b=>{const _0x408758=new _0x5e9d54(this['locale']),_0x50ab90=Zt({'editor':_0x5e591d,'action':_0x2d361b,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x408758['children']['add'](_0x50ab90),_0x5e3948['focusTracker']['add'](_0x50ab90),_0x22e2e1['items']['add'](_0x408758);}),_0x22e2e1;}['_setupGroupMenuBehavior'](_0x239d5a,_0x36a664){const _0x1b5dae=_0x239d5a['bindTemplate'],_0x431f82=this['_getButtonKeystroke'](_0x239d5a);_0x239d5a['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x1b5dae['to'](()=>{this['_showNestedPanel'](_0x36a664,_0x239d5a);}),'mouseleave':_0x1b5dae['to'](_0x4be345=>{const _0x2dab31=_0x4be345['relatedTarget'];this['_isMovingToNestedMenu'](_0x2dab31,_0x36a664)||this['_hideNestedPanel'](_0x36a664);}),'keydown':_0x1b5dae['to'](_0x2c3855=>{_0x2c3855['key']==_0x431f82&&(this['_showNestedPanel'](_0x36a664,_0x239d5a),_0x36a664['content']['get'](0x0)['focus']());})}}),_0x36a664['on']('render',()=>{_0x36a664['element']?.['addEventListener']('mouseleave',_0x5f3fd9=>{const _0x653cdd=_0x5f3fd9['relatedTarget'];_0x239d5a['element']?.['contains'](_0x653cdd)||this['_isMovingToNestedMenu'](_0x653cdd,_0x36a664)||this['_hideNestedPanel'](_0x36a664);});});}['_showNestedPanel'](_0x3fb2d2,_0x3f9d3a){this['_openNestedPanels']['forEach'](_0x41a87d=>{_0x41a87d!==_0x3fb2d2&&_0x41a87d['isVisible']&&_0x41a87d['hide']();}),_0x3fb2d2['show'](),_0x3fb2d2['pin']({'positions':[_0x50490e['eastSouth']],'target':_0x3f9d3a['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x3fb2d2);}['_hideNestedPanel'](_0x1ad042){_0x1ad042['hide'](),this['_openNestedPanels']['delete'](_0x1ad042);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x5b5f9f=>_0x5b5f9f['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x5f08ba,_0x4cd646){if(!_0x5f08ba)return!0x1;if(_0x4cd646['element']?.['contains'](_0x5f08ba))return!0x0;const _0x3b524b=_0x5f08ba;return _0x3b524b['closest']&&(null!==_0x3b524b['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x3b524b['closest']('.ck-ai-quick-actions-group-list')||null!==_0x3b524b['closest']('.ck-ai-quick-actions-group-button'));}['resetSearch'](){this['_searchTextView']&&this['_searchTextView']['reset']();}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['_searchTextView']?this['_searchTextView']['focus']():this['optionsListView']['focus']();}['_getPanelKeystroke'](_0x26c628){return'rtl'===_0x26c628['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x521971){return'rtl'===_0x521971['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x4e69cf,_0x80b345,_0x10f542,_0x309d57){_0x4e69cf['key']==_0x80b345&&(_0x10f542['focus'](),this['_hideNestedPanel'](_0x309d57));}['_handleSearchResultButtonClick'](_0x26c4f1){_0x26c4f1['fire']('execute');}}function Xt(_0x10244f){const {editor:_0x3da1aa,content:_0x1259d8,buttonDefinition:_0x41deed,bodyCollection:_0xf3e83,hasSearch:_0x4e4863=!0x1}=_0x10244f;return()=>{const _0x5a62f9=_0x3da1aa['locale'],_0x4d4a28=_0x29ed58(_0x5a62f9);_0x4d4a28['buttonView']['set']({'icon':_0x41deed['icon']??_0x9e3e58,'label':_0x41deed['label'],'tooltip':!0x0}),_0x4d4a28['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x4f204b=new io(_0x3da1aa,_0x1259d8,_0x4d4a28,_0xf3e83,_0x4e4863);if(_0x4d4a28['panelView']['children']['add'](_0x4f204b),_0x4e4863){const _0x5e9240='ai-quick-actions-dropdown-selection';_0x4d4a28['on']('change:isOpen',(_0x5447f7,_0x231443,_0xffaf6c)=>{if(_0xffaf6c){if(_0x3da1aa['plugins']['has']('AIEditing')){const _0x2469c5=_0x3da1aa['plugins']['get'](D),_0x4c4a60=_0x3da1aa['model']['document']['selection'],_0x2e725c=Array['from'](_0x4c4a60['getRanges']());_0x2e725c['length']>0x0&&_0x2469c5['showFakeVisualSelection'](_0x2e725c,_0x5e9240,!0x1,!0x0);}}else _0x3da1aa['plugins']['has']('AIEditing')&&_0x3da1aa['plugins']['get'](D)['hideFakeVisualSelection'](_0x5e9240),_0x4f204b['resetSearch']();});}return _0x4d4a28;};}const ee='<task>For\x20given\x20selected\x20part\x20of\x20HTML\x20document\x20you\x20must\x20explain\x20the\x20meaning\x20of\x20it\x27s\x20content\x20clearly\x20and\x20in\x20plain\x20language.</task><rules>1.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is:-\x20If\x20it\x20looks\x20like\x20a\x20definition\x20explain\x20the\x20concept\x20in\x20simple\x20terms.-\x20If\x20it\x20looks\x20like\x20a\x20description\x20clarify\x20what\x20it\x20is\x20describing\x20and\x20why\x20it\x20matters.-\x20If\x20it\x20contains\x20technical\x20terms\x20or\x20jargon\x20break\x20them\x20down\x20into\x20everyday\x20language.-\x20If\x20it\x20looks\x20instructional\x20restate\x20as\x20clear\x20steps\x20someone\x20can\x20follow.-\x20If\x20it\x20provides\x20examples\x20explain\x20what\x20the\x20example\x20shows\x20and\x20why\x20it\x27s\x20relevant.-\x20If\x20it\x20presents\x20an\x20argument\x20or\x20claim\x20restate\x20the\x20claim\x20neutrally\x20and\x20explain\x20its\x20purpose.-\x20If\x20it\x20is\x20narrative/story-like\x20explain\x20what\x20event\x20or\x20situation\x20is\x20being\x20described.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20explain\x20what\x20the\x20data\x20indicates.-\x20If\x20it\x20is\x20a\x20quotation\x20explain\x20the\x20meaning\x20of\x20the\x20quote\x20in\x20context.-\x20If\x20it\x20compares/contrasts\x20things\x20explain\x20the\x20key\x20differences\x20or\x20similarities\x20simply.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20give\x20a\x20clear,\x20plain-language\x20explanation\x20of\x20its\x20meaning,\x20focusing\x20on\x20usefulness.2.\x20Provide\x20context\x20if\x20the\x20meaning\x20could\x20be\x20unclear\x20without\x20it.\x20(e.g.,\x20explain\x20where\x20such\x20a\x20term\x20might\x20be\x20used,\x20or\x20why\x20it\x20is\x20important).3.\x20Keep\x20the\x20explanation\x20short\x20but\x20complete\x20(2–5\x20sentences).Avoid\x20overly\x20technical\x20detail\x20unless\x20it\x20is\x20necessary\x20for\x20understanding.4.\x20Do\x20not\x20simply\x20repeat\x20the\x20original\x20text\x20—\x20restate\x20and\x20expand\x20it\x20in\x20plain\x20words.5.\x20If\x20possible,\x20add\x20a\x20short\x20example\x20or\x20analogy\x20to\x20make\x20it\x20easier\x20to\x20understand.6.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20explanation.7.\x20Your\x20explanation\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20explanation.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',ie='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20summarize\x20its\x20content\x20in\x20a\x20few\x20sentences,\x20keeping\x20only\x20the\x20essential\x20meaning.</task><rules>1.\x20Your\x20summary\x20should\x20be\x20short\x20and\x20clear:-\x20Aim\x20for\x202–4\x20sentences\x20unless\x20the\x20text\x20is\x20extremely\x20short.-\x20Focus\x20on\x20capturing\x20the\x20main\x20idea(s)\x20without\x20unnecessary\x20detail.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20summary\x20style:-\x20If\x20it\x20is\x20descriptive\x20condense\x20the\x20description\x20into\x20its\x20core\x20idea.-\x20If\x20it\x20is\x20argumentative\x20or\x20opinion-based\x20summarize\x20the\x20main\x20claim\x20and\x20reasoning\x20neutrally.-\x20If\x20it\x20is\x20narrative/story-like\x20capture\x20the\x20main\x20event\x20or\x20outcome\x20without\x20side\x20details.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20summarize\x20what\x20the\x20data\x20shows\x20in\x20plain\x20language.-\x20If\x20it\x20is\x20instructional\x20restate\x20the\x20overall\x20purpose\x20of\x20the\x20steps\x20without\x20listing\x20every\x20step.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20provide\x20a\x20general\x20concise\x20summary.3.\x20Provide\x20context\x20if\x20necessary\x20for\x20clarity:-\x20Mention\x20the\x20subject\x20or\x20topic\x20explicitly\x20so\x20the\x20summary\x20can\x20stand\x20alone.4.\x20Do\x20not\x20simply\x20copy\x20sentences\x20from\x20the\x20original\x20text\x20—\x20rephrase\x20in\x20plain\x20language.5.\x20Avoid\x20adding\x20new\x20information\x20or\x20interpretation\x20not\x20present\x20in\x20the\x20text.6.\x20Summarize\x20in\x20a\x20way\x20that\x20would\x20make\x20sense\x20to\x20someone\x20who\x20has\x20not\x20read\x20the\x20original\x20text.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20summary.8.\x20Your\x20summary\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20summary.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',ne='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20extract\x20and\x20present\x20the\x20key\x20points\x20from\x20its\x20content.</task><rules>1.\x20Present\x20the\x20output\x20as\x20a\x20clear,\x20structured\x20list\x20(bullets\x20or\x20numbered).-\x20Each\x20point\x20should\x20be\x20concise\x20(one\x20sentence\x20or\x20less).-\x20Do\x20not\x20merge\x20distinct\x20ideas\x20into\x20one\x20bullet.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20extraction\x20style:-\x20If\x20it\x20is\x20descriptive\x20capture\x20the\x20main\x20attributes\x20or\x20features.-\x20If\x20it\x20is\x20argumentative\x20extract\x20the\x20main\x20claim\x20and\x20supporting\x20reasons\x20separately.-\x20If\x20it\x20is\x20narrative/story-like\x20extract\x20the\x20main\x20events\x20in\x20chronological\x20order.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20highlight\x20the\x20most\x20important\x20facts\x20or\x20numbers.-\x20If\x20it\x20is\x20instructional\x20list\x20the\x20steps\x20or\x20main\x20actions\x20in\x20simplified\x20form.-\x20If\x20it\x20provides\x20comparisons\x20extract\x20the\x20contrasted\x20items\x20and\x20their\x20differences/similarities.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20category\x20above\x20extract\x20the\x20main\x20ideas\x20in\x20plain,\x20short\x20statements.3.\x20Keep\x20the\x20list\x20between\x203–7\x20items\x20where\x20possible.-\x20If\x20the\x20text\x20is\x20very\x20short,\x20fewer\x20items\x20are\x20fine.-\x20If\x20it\x20is\x20very\x20long,\x20focus\x20on\x20the\x20most\x20important\x20ideas\x20only.4.\x20Do\x20not\x20copy\x20long\x20text\x20fragments\x20—\x20restate\x20in\x20simple\x20words.5.\x20Do\x20not\x20add\x20interpretation,\x20evaluation,\x20or\x20commentary\x20beyond\x20the\x20text.6.\x20Ensure\x20the\x20list\x20can\x20stand\x20alone\x20without\x20requiring\x20the\x20reader\x20to\x20see\x20the\x20original\x20document.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20key\x20points.8.\x20Your\x20key\x20points\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20extracted\x20key\x20points.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>';var Qt=function(_0xe2d05b){return _0xe2d05b['CHAT']='CHAT',_0xe2d05b['ACTION']='ACTION',_0xe2d05b['REVIEW']='REVIEW',_0xe2d05b;}({}),Fa=function(_0xa458a1){return _0xa458a1['CHAT']='AIChat',_0xa458a1['ACTION']='AIActions',_0xa458a1['REVIEW']='AIReviewMode',_0xa458a1;}({});class ii extends _0x241f5a{static get['requires'](){return[te,S];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x156fe0=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x156fe0),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x4f6ea3){return function(_0x45e295){const _0x4cbda8=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x45e295['uiLanguage']),_0x285977=_0x4cbda8||'English',_0x173076=[{'id':'ask-ai','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Gt},{'id':'chat-commands','label':i(_0x45e295,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Gt,'actions':[{'id':'explain','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':ee['replace']('%0',_0x285977),'type':'CHAT'},{'id':'summarize','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':ie['replace']('%0',_0x285977),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':ne['replace']('%0',_0x285977),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Bt},{'id':'continue','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':zt},{'id':'fix-grammar','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Wt},{'id':'adjust-length','label':i(_0x45e295,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Kt,'actions':[{'id':'make-shorter','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':i(_0x45e295,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Yt,'actions':[{'id':'make-tone-casual','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':i(_0x45e295,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Vt,'actions':[{'id':'translate-to-english','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':i(_0x45e295,'AI_QUICK_ACTIONS_OTHER'),'icon':Jt,'actions':[]}];return _0x173076;}(_0x4f6ea3);}async['_getDefaultAndCustomActions'](){const _0x458bcb=ii['getDefaultQuickActions'](this['editor']['locale']),_0x2cee48=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x5ed8f6=[];try{_0x5ed8f6=await new At({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0xfadfc7){const _0xfce7af=new _0x542443('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0xfadfc7});Ct(_0xfce7af['message']);}finally{const _0x5b330b=_0x2cee48['map'](_0x23e8ed=>({..._0x23e8ed,'icon':void 0x0}));_0x458bcb['find'](_0x49a643=>'other'===_0x49a643['id'])['actions']['push'](..._0x5b330b),_0x458bcb['forEach'](_0x583f34=>{if('actions'in _0x583f34)_0x583f34['actions']['forEach'](_0x2f9ffa=>{if(_0x2f9ffa['isEnabled']=!!_0x5ed8f6['find'](_0xda7a3b=>_0xda7a3b['id']===_0x2f9ffa['model'])||void 0x0===_0x2f9ffa['model'],!_0x2f9ffa['isEnabled']){const _0xf97189=new _0x542443('ai-quick-actions-unavailable-model',this,{'actionId':_0x2f9ffa['id'],'modelId':_0x2f9ffa['model']});Ct(_0xf97189['message']);}});else{if(_0x583f34['isEnabled']=!!_0x5ed8f6['find'](_0xa13d21=>_0xa13d21['id']===_0x583f34['model'])||void 0x0===_0x583f34['model'],!_0x583f34['isEnabled']){const _0x378c3c=new _0x542443('ai-quick-actions-unavailable-model',this,{'actionId':_0x583f34['id'],'modelId':_0x583f34['model']});Ct(_0x378c3c['message']);}}});}return _0x458bcb;}['_initializeQuickActionsComponentsAndCommands'](){const _0x577107=new _0x49fddd(this['editor']['locale']);_0x577107['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x577107),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x577107);}['_initializeQuickActionsDropdown'](_0x9111fb){const _0x5351fc=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Xt({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x9e3e58,'label':i(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x9111fb,'hasSearch':_0x5351fc}));}['_prepareQuickActionsDefinition'](_0x57745f){this['_quickActionsDefinition']=_0x57745f['map'](_0xc489d1=>{if('actions'in _0xc489d1){const _0xad905e=_0xc489d1;return{..._0xad905e,'actions':_0xad905e['actions']['map'](_0x32e0fb=>{const {actions:_0x1acec6,..._0x4cb01a}=_0xad905e;return{..._0x32e0fb,'parent':_0x4cb01a};})['filter'](_0x24745a=>this['_shouldIncludeAction'](_0x24745a))};}return _0xc489d1;})['filter'](_0x20a8cb=>'actions'in _0x20a8cb?_0x20a8cb['actions']['length']>0x0:this['_shouldIncludeAction'](_0x20a8cb));}['_shouldIncludeAction'](_0x24ad18){const _0x508438=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Fa[_0x24ad18['type']])&&!_0x508438['includes'](_0x24ad18['id'])&&!('CHAT'===_0x24ad18['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x45e768){this['_quickActionsDefinition']['forEach'](_0x32b7f8=>{if('actions'in _0x32b7f8){const _0x465f96=Xt({'editor':this['editor'],'content':_0x32b7f8['actions'],'buttonDefinition':_0x32b7f8,'bodyCollection':_0x45e768});this['editor']['ui']['componentFactory']['add'](_0x32b7f8['id'],_0x465f96),_0x32b7f8['actions']['forEach'](_0x472d21=>{const _0x1cee99=Zt({'editor':this['editor'],'action':_0x472d21});this['editor']['ui']['componentFactory']['add'](_0x472d21['id'],_0x1cee99);});}else{const _0x376ff2=Zt({'editor':this['editor'],'action':_0x32b7f8,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x32b7f8['id'],_0x376ff2);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x382dae=>{const _0x3eec1e=new _0x538ac7(_0x382dae),_0x506302=i(_0x382dae,'AI_QUICK_ACTIONS_HEADING');_0x3eec1e['buttonView']['set']({'label':_0x506302,'icon':_0x9e3e58});const _0x123bb2=new _0x255377(_0x382dae);_0x123bb2['set']({'ariaLabel':_0x506302,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x16e5ef=>{if('actions'in _0x16e5ef){const _0x3951db=_0x16e5ef,_0x251fb4=new _0x199d14(_0x382dae,_0x3eec1e),_0x2fd67c=new _0x538ac7(_0x382dae),_0x4c5cdc=new _0x255377(_0x382dae);_0x2fd67c['buttonView']['set']({'label':_0x3951db['label'],'icon':_0x3951db['icon']}),_0x3951db['actions']['forEach'](_0x4b36d1=>{const _0x56d783=new _0x199d14(_0x382dae,_0x2fd67c),_0x55aa5b=new _0x302890(_0x382dae);_0x55aa5b['set']({'label':_0x4b36d1['displayedPrompt'],'icon':_0x4b36d1['icon'],'role':'menuitem','isEnabled':_0x4b36d1['isEnabled']}),_0x55aa5b['on']('execute',()=>{this['_executeQuickAction'](_0x4b36d1);}),_0x55aa5b['delegate']('execute')['to'](_0x2fd67c),_0x56d783['children']['add'](_0x55aa5b),_0x4c5cdc['items']['add'](_0x56d783);}),_0x2fd67c['panelView']['children']['add'](_0x4c5cdc),_0x251fb4['children']['add'](_0x2fd67c),_0x123bb2['items']['add'](_0x251fb4);}else{const _0x25575d=_0x16e5ef,_0x1ecdac=new _0x199d14(_0x382dae,_0x3eec1e),_0x9c3922=new _0x302890(_0x382dae);_0x9c3922['set']({'label':_0x25575d['displayedPrompt'],'icon':_0x25575d['icon'],'role':'menuitem','isEnabled':_0x25575d['isEnabled']}),_0x9c3922['on']('execute',()=>{this['_executeQuickAction'](_0x25575d);}),_0x9c3922['delegate']('execute')['to'](_0x3eec1e),_0x1ecdac['children']['add'](_0x9c3922),_0x123bb2['items']['add'](_0x1ecdac);}});const _0x42d2b1=Object['values'](Fa)['some'](_0x183897=>this['editor']['plugins']['has'](_0x183897));return _0x3eec1e['set']({'isEnabled':_0x42d2b1}),_0x3eec1e['panelView']['children']['add'](_0x123bb2),_0x3eec1e;});}['_executeQuickAction'](_0x3087aa){const _0x2c1cd9=this['editor'];_0x2c1cd9['editing']['view']['focus'](),_0x2c1cd9['commands']['execute']('aiQuickAction',_0x3087aa);const _0x1511f6=_0x2c1cd9['ui']['view']['menuBarView'];_0x1511f6&&_0x1511f6['close']&&_0x1511f6['close']();}}class ci extends Ut{['execute'](_0x25ad06){switch(this['_expandSelectionIfCollapsed'](),_0x25ad06['type']){case Qt['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x441303=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x542443('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x441303});}this['_handleAIChatAction'](_0x25ad06);break;case Qt['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x1d10ba=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x542443('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x1d10ba});}this['_handleAIActionsAction'](_0x25ad06);break;case Qt['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x9218e5=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x542443('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x9218e5});}this['_handleAIReviewAction'](_0x25ad06);}}async['_handleAIChatAction'](_0x5985b6){const _0x2efa56=this['editor']['plugins']['get']('AIChat'),_0x28363f=this['editor']['plugins']['get']('AIChatController'),_0xb748f4=this['editor']['plugins']['get']('AITabs')['view'];if(_0xb748f4['isVisible']||(_0xb748f4['isVisible']=!0x0),'chat'!==_0xb748f4['activeTab']&&_0xb748f4['activateTab']('chat'),'ask-ai'===_0x5985b6['id'])_0x28363f['removeSelectionFromChatContext'](),await _0x2efa56['addSelectionToChatContext'](),_0x2efa56['focusPromptInput']();else await _0x2efa56['startConversation'](),_0x28363f['removeSelectionFromChatContext'](),await _0x2efa56['addSelectionToChatContext'](),_0x2efa56['focusPromptInput'](),await _0x2efa56['sendMessage']({'message':_0x5985b6['prompt']||_0x5985b6['displayedPrompt'],'attributes':{'quickActionData':{'id':_0x5985b6['id']},'displayedPrompt':_0x5985b6['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x546c58=this['editor'],_0x2e2d0f=_0x546c58['model']['document']['selection'];if(!_0x2e2d0f['isCollapsed'])return;const _0xbee00c=_0xd78d7(_0x2e2d0f['getSelectedBlocks']())||_0x546c58['model']['schema']['getLimitElement'](_0x2e2d0f);_0x546c58['model']['change'](_0x59a072=>{_0x59a072['setSelection'](_0xbee00c,'in');});}['_handleAIActionsActionLabel'](_0x2f7252){return _0x2f7252['parent']?.['label']&&'other'!==_0x2f7252['parent']?.['id']?_0x2f7252['parent']['label']+':\x20'+_0x2f7252['displayedPrompt']:_0x2f7252['displayedPrompt'];}async['_handleAIActionsAction'](_0x1829ae){const _0x64dd19=this['editor']['plugins']['get']('AIActions'),_0x3efd0a=_0x1829ae['prompt']?{'userMessage':_0x1829ae['prompt'],'model':_0x1829ae['model']}:{'actionName':_0x1829ae['actionName']||_0x1829ae['id'],'args':_0x1829ae['args']},_0x55a142=this['_handleAIActionsActionLabel'](_0x1829ae);await _0x64dd19['executeAction'](_0x3efd0a,_0x55a142,_0x1829ae['icon']);}async['_handleAIReviewAction'](_0x5b7cf9){console['log']('handleAIReviewAction',_0x5b7cf9);}}class ti extends _0x241f5a{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x16994f=this['editor'],_0x5c9a2c=new ci(this['editor']);if(_0x16994f['commands']['add']('aiQuickAction',_0x5c9a2c),_0x16994f['plugins']['has']('AIChat')){const _0x50a820=this['editor']['plugins']['get']('AIChat');_0x16994f['model']['document']['selection']['on']('change:range',(_0x9b873c,_0xcde5b1)=>{_0xcde5b1['directChange']&&_0x50a820['removeSelectionFromChatContext']();});}}}class De extends Ge{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x52624a=this['documentContextContent']['children']['map'](_0x114d37=>({'node':_0x114d37,'id':Ot(_0x114d37,'data-id')})),_0x4b6e3f=this['parsedMergedContent']['children']['map'](_0x439138=>({'node':_0x439138,'id':Ot(_0x439138,'data-id')||_0x2e2dc8()})),_0x33a4c0=_0x57cf13(_0x52624a,_0x4b6e3f,{'comparator':(_0x240e6f,_0x5099ad)=>_0x240e6f['id']==_0x5099ad['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x33a4c0['length']&&_0x33a4c0[_0x33a4c0['length']-0x1]['removed'];)_0x33a4c0['pop']();}const _0x59b358=_0x33a4c0['map'](_0x500299=>{const _0x2fd7a4=_0x500299['added']?'new':_0x500299['removed']?'removed':'modified';return{'node':_0x500299['value'][0x0]['node'],'type':_0x2fd7a4,'id':_0x500299['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x59b358,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x3db51b,_0x4a4817){return _0x4a4817;}}class O extends xe{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x53dc2c){super(_0x53dc2c),this['content']=_0x53dc2c['content'],this['version']=_0x53dc2c['version'],this['actionName']=_0x53dc2c['actionName'],this['args']=_0x53dc2c['args'],this['userMessage']=_0x53dc2c['userMessage'],this['model']=_0x53dc2c['model'];}async['sendRequest'](){return this['actionName']?this['connector']['executeAction']({'content':this['content'],'actionName':this['actionName'],'args':this['args']}):this['connector']['executeCustomAction']({'content':this['content'],'message':this['userMessage'],'model':this['model'],'outputFormat':'html'});}['getDocumentContext'](){return{'type':qe['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x43d206){const _0x2b8260=new De({'editor':this['editor'],'documentContextContent':this['content'],..._0x43d206});return this['replies']['push'](_0x2b8260),_0x2b8260['delegate'](...ye)['to'](this),this['fire']('replyCreated',_0x2b8260),_0x2b8260;}}class Bn extends _0x3da665{constructor(_0x43025c,_0x30f256=!0x0,_0x169668=!0x0){super(_0x43025c),this['set']('isEnabled',!0x1),_0x30f256&&(this['applyButton']=this['_createButton'](i(_0x43025c,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x169668&&(this['suggestButton']=this['_createButton'](i(_0x43025c,'AI_BALLOON_SUGGEST_BUTTON'),_0x30f256?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x30f256,'showSuggestButton':_0x169668}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x4b6368,showSuggestButton:_0x33691f}){this['applyButton']&&(this['applyButton']['isVisible']=_0x4b6368),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x33691f);}['_createButton'](_0x1b2cf1,_0x128474){const _0x32adaa=new _0x5bfd84(this['locale']);return _0x32adaa['set']({'label':_0x1b2cf1,'class':_0x128474,'isVisible':!0x0,'withText':!0x0}),_0x32adaa;}}class yn extends _0x15a8cb{constructor(_0x59cbf4){super(_0x59cbf4),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':i(_0x59cbf4,'AI_DISCLAIMER_TEXT')}]}]});}}class Nn extends _0x15a8cb{constructor(_0x52411e){super(_0x52411e),this['set']('isVisible',!0x0);const _0x4d11ff=new Ci('small');_0x4d11ff['isVisible']=!0x0;const _0x504cb1=new _0x15a8cb(this['locale']);_0x504cb1['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[i(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x118750=>!_0x118750)]},'children':[_0x4d11ff,_0x504cb1]});}}class Y extends gs{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x4e9418,_0x4014df){super(_0x4e9418),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x4014df,this['_focusTracker']=new _0x510dfd(),this['_keystrokes']=new _0x394cf5(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x5a99d2({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x152ab6(),this['_addContentWrapper'](_0x4014df),this['_addDisclaimerView'](),this['_addToolbar'](_0x4014df),this['_focusables']['clear'](),this['_focusables']['addMany']([this['_toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-main']},'children':this['_dialogContent']}),this['on']('change:isTrackChangesOn',()=>{this['_toggleToolbarButtonsVisibility'](_0x4014df);});}['render'](){super['render']();for(const _0x5d7fc4 of this['_focusables'])this['_focusTracker']['add'](_0x5d7fc4['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x26f494){-0x1===_0x26f494?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x1cc3dc){this['_isLoading']=_0x1cc3dc;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x1bc689){super['showError'](_0x1bc689),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x524d15){super['showBlockingError'](_0x524d15),this['setErrorState']();}['addMiniToolbarItem'](_0x540ee2){this['_miniToolbarView']['items']['has'](_0x540ee2)||this['_miniToolbarView']['items']['add'](_0x540ee2);}['removeMiniToolbarItem'](_0x3dd82e){this['_miniToolbarView']['items']['has'](_0x3dd82e)&&this['_miniToolbarView']['items']['remove'](_0x3dd82e);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0xf3e4d6,showSuggestButton:_0x43dbbc}){_0xf3e4d6=_0xf3e4d6&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x43dbbc=_0x43dbbc&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0xf3e4d6,'showSuggestButton':_0x43dbbc});}async['updateContent'](_0x3f7411){await this['_streamableContentView']['update'](_0x3f7411);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x89153f){this['_contentWrapper']=new _0x15a8cb(this['locale']),this['_contentWrapper']['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content-wrapper']},'children':[this['_createLoaderView'](),this['_createStreamableContentView']()]},this['_createMiniToolbar'](_0x89153f['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new yn(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x384657,showSuggestButton:_0x5edf84}){this['_toolbarView']=new Bn(this['locale'],_0x384657,_0x5edf84),this['_toolbarView']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['_toolbarView']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_toolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',this,'_hasError',(_0x1b62cb,_0x11d849,_0xb595d4)=>!(_0x1b62cb||_0x11d849||_0xb595d4)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x384657,'showSuggestButton':_0x5edf84}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x15c9c0){return this['_miniToolbarView']=new ls(this['locale'],_0x15c9c0),this['_miniToolbarView']['delegate'](...pt)['to'](this),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['_miniToolbarView']['isShowChangesOn']=!this['_miniToolbarView']['isShowChangesOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':this['_miniToolbarView']['isShowChangesOn']});}),this['_miniToolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',(_0x1acdcf,_0x4b259f)=>!(_0x1acdcf||_0x4b259f)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new Nn(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new as(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x1ad18f=new _0x5bfd84(this['locale']),_0x5b01e6=new _0x5bfd84(this['locale']),_0x8e91e5=new Ln(this['locale']),_0x52889e=new _0x5bfd84(this['locale']);_0x1ad18f['set']({'icon':_0x5c8076,'label':i(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x5b01e6['set']({'icon':_0x3c7600,'tooltip':i(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x52889e['set']({'icon':_0x40af26,'tooltip':i(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x1ad18f['bind']('isEnabled')['to'](this,'isBusy',_0x5172c7=>!_0x5172c7),_0x1ad18f['on']('execute',()=>{this['fire']('tryAgain');}),_0x5b01e6['bind']('isEnabled')['to'](this,'isBusy',_0x27d36c=>!_0x27d36c),_0x5b01e6['on']('execute',()=>{this['fire']('showPrevious');}),_0x52889e['bind']('isEnabled')['to'](this,'isBusy',_0x4edfe7=>!_0x4edfe7),_0x52889e['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x5b01e6,this['_navigationCounter']=_0x8e91e5,this['_navigationNextButton']=_0x52889e,this['_navigationTryAgainButton']=_0x1ad18f;}['updateMiniToolbarButtons'](_0x5c7f5f,_0x152e34){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x512c38=_0x5c7f5f>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x512c38){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x1f7993=_0x5c7f5f-_0x152e34;this['_navigationCounter']['setInteractionCount'](_0x1f7993+'/'+_0x5c7f5f),this['_navigationPreviousButton']['isEnabled']=_0x152e34<_0x5c7f5f-0x1,this['_navigationNextButton']['isEnabled']=_0x152e34>0x0;}else this['removeMiniToolbarItem'](this['_navigationPreviousButton']),this['removeMiniToolbarItem'](this['_navigationCounter']),this['removeMiniToolbarItem'](this['_navigationNextButton']);}['disableMiniToolbarButtons'](){this['_navigationTryAgainButton']['isEnabled']=!0x1,this['_navigationPreviousButton']['isEnabled']=!0x1,this['_navigationNextButton']['isEnabled']=!0x1;}['startAutoScroll'](){this['_initializeScrollManager'](),this['_scrollManager']&&this['_scrollManager']['start']();}['stopAutoScroll'](){this['_scrollManager']&&this['_scrollManager']['stop']();}['toggleIsLoading'](_0x5156d3){this['_isLoading']=_0x5156d3;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x371b64=this['_getScrollableElement']();_0x371b64&&!this['_scrollManager']&&(this['_scrollManager']=new $e(_0x371b64));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class Ln extends _0x15a8cb{constructor(_0x5ac5d2){super(_0x5ac5d2);const _0x524e94=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x524e94['to']('interactionCount')}]});}['setInteractionCount'](_0x1600df){this['set']('interactionCount',_0x1600df);}}class ri extends _0x241f5a{static get['requires'](){return[S,_0x1017f8,D,P,_0x143aa3];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_promiseQueue'];['_bodyCollection'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}['_actionsBalloonView'];constructor(_0x2bd0c2){super(_0x2bd0c2),this['_bodyCollection']=new _0x49fddd(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new N();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x34fb15,_0x168f3c,_0x1765c3){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x3d8ee6,anchorData:_0x3e00e3}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x34fb15,_0x3d8ee6,_0x3e00e3,_0x168f3c,_0x1765c3);}}const {modelFragment:_0x1736fc,anchorData:_0x490407}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x34fb15,_0x1736fc,_0x490407,_0x168f3c,_0x1765c3);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x2edb71=this['editor']['plugins']['has']('TrackChanges');let _0x1eed19=this['editor']['config']['get']('ai.availableReplyActions')||[...X];_0x2edb71||(_0x1eed19=_0x1eed19['filter'](_0x90ed83=>'insertSuggestion'!=_0x90ed83));const _0x22230f=this['editor']['commands']['get']('trackChanges'),_0xb4def4=new Y(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x2edb71,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x1eed19});return _0xb4def4['bind']('isBusy')['to'](this),_0x22230f&&_0xb4def4['bind']('isTrackChangesOn')['to'](_0x22230f,'value'),_0xb4def4['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0xb4def4['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0xb4def4['on']('showNext',()=>{this['_navigateToNext']();}),_0xb4def4;}['_getExecuteDataRegular'](){const _0x33c927=this['editor']['model']['document']['selection'];if(_0x33c927['isCollapsed']){const _0x2856dd=_0xd78d7(_0x33c927['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x33c927);this['editor']['model']['change'](_0x595bbe=>{_0x595bbe['setSelection'](_0x2856dd,'in');});}const _0x56b8ca=_0x33c927['getFirstRange'](),_0x243d68=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x33c927),_0x56b8ca['start'],_0x56b8ca['end']);this['_copyMarkersToFragment'](_0x243d68,_0x33c927,{'isTableSelection':!0x1});const _0x35152c=_0x33c927['getFirstRange']()['start'],_0x17eda2=new Map();let _0x106d21=_0x243d68;for(let _0x76b51=0x0;_0x76b51<_0x35152c['path']['length'];_0x76b51++)_0x17eda2['set'](_0x106d21,_0x35152c['path'][_0x76b51]),_0x106d21=_0x106d21['getChild'](0x0);return{'modelFragment':_0x243d68,'anchorData':_0x17eda2};}['_getExecuteDataInTable'](){const _0x375365=this['editor']['model']['document']['selection'],_0x384639=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x2e090c=_0x375365['getFirstRange']()['start']['parent']['parent'],_0x41c10d=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x2e090c),this['editor']['model']['createPositionAfter'](_0x2e090c)),_0x592aa9=this['_wrapWithCommonAncestors'](_0x384639,_0x41c10d['start'],_0x41c10d['end']);this['_copyMarkersToFragment'](_0x592aa9,_0x375365,{'isTableSelection':!0x0});const _0x1f8def=_0x375365['getFirstRange']()['start'],_0x415ea6=new Map();let _0x25142c=_0x592aa9;for(let _0x4f1e56=0x0;_0x4f1e56<_0x1f8def['path']['length'];_0x4f1e56++)if(_0x415ea6['set'](_0x25142c,_0x1f8def['path'][_0x4f1e56]),_0x4f1e56<_0x1f8def['path']['length']-0x1)_0x25142c=_0x25142c['getChild'](0x0);else{let _0x104dac=_0x25142c['nextSibling'];for(;_0x104dac;)_0x415ea6['set'](_0x104dac,_0x1f8def['path'][_0x4f1e56]),_0x104dac=_0x104dac['nextSibling'];}return{'modelFragment':_0x592aa9,'anchorData':_0x415ea6};}async['_executeAction'](_0x10b13d,_0x1e9a10,_0x524f35,_0x21e879,_0x50646c){const _0x599ccf=this['editor']['plugins']['get'](D),_0xdd69f6=this['editor']['plugins']['get'](P),_0x25f694=this['editor']['model']['document']['selection'],_0x452940=await _0x599ccf['modelToDataWithIds'](_0x1e9a10),_0x143900=this['editor']['model']['document']['version'],_0x536ea8=[..._0x25f694['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),_0xdd69f6['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x21e879,'icon':_0x50646c||_0x9e3e58,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x536ea8,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0xdd69f6),this['_interactionParams']={'action':_0x10b13d,'content':_0x452940,'version':_0x143900,'aiBalloon':_0xdd69f6,'modelFragment':_0x1e9a10,'anchorData':_0x524f35},this['_setupApplyListeners'](),this['listenTo'](_0xdd69f6,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0xdd69f6,'dialogClosed',(_0x508780,{id:_0xe95c31})=>{if('aiActionsBalloon'===_0xe95c31){if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x4bf8b1=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x24b318=_0x4bf8b1['changeGroups'][0x0];_0x24b318&&'pending'===_0x24b318['state']&&_0x4bf8b1['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0xdd69f6);}}),this['_createInteraction'](_0x452940,_0x143900,_0xdd69f6,_0x10b13d);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0xd4966b,anchorData:_0x4c0636}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0xd4966b,_0x4c0636,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0xd4966b,_0x4c0636,!0x0);});}['_wrapWithCommonAncestors'](_0x4232ed,_0x5a03e0,_0x156026){const _0x5c78a6=this['editor']['model']['createRange'](_0x5a03e0,_0x156026)['getCommonAncestor'](),_0x4a49b7=_0x5c78a6['is']('documentFragment')?[]:_0x5c78a6['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x4a49b7['length']){const _0x1f17b4=_0x4a49b7['map'](_0x23b81b=>_0x23b81b['_clone'](!0x1));for(let _0x7deb36=0x1;_0x7deb36<_0x1f17b4['length'];_0x7deb36++)_0x1f17b4[_0x7deb36-0x1]['_appendChild'](_0x1f17b4[_0x7deb36]);return _0x1f17b4[_0x1f17b4['length']-0x1]['_appendChild'](_0x4232ed),new _0x53b4ba(_0x1f17b4[0x0]);}return _0x4232ed;}['_copyMarkersToFragment'](_0x3a2118,_0x3d1074,_0x13cc87={'isTableSelection':!0x1}){const _0x3c9dea=this['editor']['model'],_0x14fe50=Array['from'](_0x3d1074['getRanges']()),_0x28eb77=_0x3d1074['getFirstRange']()['start'];for(const _0x2dcf23 of _0x3c9dea['markers']){if(_0x2dcf23['name']['startsWith'](F)||!_0x2dcf23['affectsData'])continue;const _0x464b8d=_0x2dcf23['getRange']();if(!_0x14fe50['some'](_0x14f34d=>_0x14f34d['containsRange'](_0x464b8d,!0x0)))continue;const _0x34ca49=this['_regularCalculateMarkerPath'](_0x464b8d['start'],_0x28eb77,_0x13cc87['isTableSelection']),_0x2d56f5=this['_regularCalculateMarkerPath'](_0x464b8d['end'],_0x28eb77,_0x13cc87['isTableSelection']),_0xe694c=_0x3c9dea['createPositionFromPath'](_0x3a2118,_0x34ca49),_0x4d0ebe=_0x3c9dea['createPositionFromPath'](_0x3a2118,_0x2d56f5);if(!_0xe694c['isEqual'](_0x4d0ebe)){const _0x1cd719=_0x3c9dea['createRange'](_0xe694c,_0x4d0ebe);_0x3a2118['markers']['set'](_0x2dcf23['name'],_0x1cd719);}}}['_regularCalculateMarkerPath'](_0x2642c0,_0x5e6f8c,_0x1ef1b2=!0x1){const _0x30d9ac=[..._0x2642c0['path']['slice']()];for(let _0x50c082=0x0;_0x50c082<Math['max'](_0x5e6f8c['path']['length'],_0x2642c0['path']['length']);_0x50c082++){const _0x199646=_0x5e6f8c['path'][_0x50c082]||0x0,_0xa908dd=(_0x2642c0['path'][_0x50c082]||0x0)-_0x199646;if(_0x30d9ac[_0x50c082]=_0xa908dd,0x0!==_0xa908dd&&!_0x1ef1b2)break;}return _0x30d9ac;}async['_createInteraction'](_0x5d2703,_0x46633a,_0x21e1af,_0x689ae7){const _0x28ea18=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x689ae7,'content':_0x5d2703,'version':_0x46633a,'aiBalloon':_0x21e1af,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x213acb=new O({'connector':this['_aiConnector'],'editor':_0x28ea18,'content':_0x5d2703,'version':_0x46633a,..._0x689ae7});this['_interactions']['push'](_0x213acb);const _0xd208ce=(_0x7753b2,_0x459e9f=!0x1,_0x13fc7d='streaming')=>this['_promiseQueue']['enqueue'](async _0xb8ede0=>{try{const _0x5205b4=q({'editor':_0x28ea18,'changeGroups':_0x7753b2['changeGroups'],'documentContextContent':_0x7753b2['documentContextContent'],'showDiff':_0x459e9f,'trimUnchanged':!0x1});_0x5205b4['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x5205b4[0x0],'renderingStrategy':_0x13fc7d,'abortSignal':_0xb8ede0});}catch(_0x322db3){if(this['_isAbortError'](_0x322db3))return;throw _0x322db3;}});this['_interaction']['on']('replyCreated',(_0x191016,_0xb69bdb)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0xd208ce(_0xb69bdb)['catch'](_0x185bfd=>{this['_isAbortError'](_0x185bfd)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x185bfd),this['_setErrorState'](_0x213acb));});}),this['_interaction']['on']('replyContentUpdated',(_0xfb8a3d,_0x36c728)=>{_0xd208ce(_0x36c728)['catch'](_0x3e2dfb=>{this['_isAbortError'](_0x3e2dfb)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x3e2dfb),this['_setErrorState'](_0x213acb));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x89ea30){this['_isAbortError'](_0x89ea30)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x89ea30),this['_setErrorState'](_0x213acb));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x5a6049,{showDiff:_0x162fc5})=>{try{this['_balloonShowDiff']=_0x162fc5;const _0x1f5db5=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x1f5db5&&await _0xd208ce(_0x1f5db5,_0x162fc5,'static');}catch(_0xab8263){this['_isAbortError'](_0xab8263)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0xab8263),this['_setErrorState'](_0x213acb));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x2380a1,{reply:_0x3462af})=>{const _0x5c839e={'positiveCount':_0x3462af['changeGroups']['filter'](_0xe1a40f=>'accepted'===_0xe1a40f['state'])['length'],'totalCount':_0x3462af['changeGroups']['length']},_0x3b2083=this['_interaction']['actionCallId'],_0x5a7dfb=this['_interaction']['actionName'];_0x5a7dfb?this['_aiConnector']['upsertAIActionRating'](_0x5a7dfb,_0x3b2083,_0x5c839e):this['_aiConnector']['upsertCustomAIActionRating'](_0x3b2083,_0x5c839e);}),this['_setLoadingState']();try{const _0x513612=await this['_interaction']['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x513612;}catch(_0x59fb4b){if(this['_isAbortError'](_0x59fb4b))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x213acb);}}['_applyChanges'](_0x2117ed,_0x5d9e93,_0x30e5fd){const _0x14f38=this['editor'];if(_0x30e5fd&&!_0x14f38['plugins']['has']('TrackChanges'))throw new _0x542443('ai-no-track-changes',null);const _0x134999=this['editor']['plugins']['get'](_0x143aa3),_0x5f4edf=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x5f4edf||!_0x5f4edf['replies']['length'])return;const _0x40aebd=_0x5f4edf['replies'][_0x5f4edf['replies']['length']-0x1],_0x27eb9c=_0x40aebd['changeGroups'];_0x40aebd['setChangeGroupState'](0x0,'accepted');let _0x4dee70=W({'editor':_0x14f38,'reply':_0x40aebd,'interaction':_0x5f4edf,'groups':_0x27eb9c,'transform':!0x1,'documentCompare':_0x134999,'documentCompareOptions':{'anchor':_0x14f38['model']['createPositionAt'](_0x2117ed,0x0),'markDeletions':_0x30e5fd}});_0x4dee70=this['_filterOperationsOutsideRange'](_0x4dee70,_0x5d9e93);for(const _0x3ce5be of _0x4dee70)this['_anchorOperation'](_0x5d9e93,_0x3ce5be,_0x14f38['model']['document']['getRoot']());const _0x3047f4=_0x5f4edf['getDocumentContext']()['version'],_0x2411d9=_0x14f38['model']['document']['history']['getOperations'](_0x3047f4),_0x37f811={'document':_0x14f38['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x4ff422=_0x359a53(_0x4dee70,_0x2411d9,_0x37f811)['operationsA'];_0x14f38['model']['change'](_0x37bc18=>{if(_0x37bc18['setSelection'](_0x14f38['model']['document']['selection']['focus']),_0x30e5fd)_0x14f38['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x4ff422);else{for(const _0x148ee5 of _0x4ff422)_0x148ee5['baseVersion']=_0x14f38['model']['document']['version'],V(_0x14f38,_0x148ee5),_0x37bc18['batch']['addOperation'](_0x148ee5),_0x14f38['model']['applyOperation'](_0x148ee5);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x41cb67,_0x13a322){return _0x41cb67['filter'](_0x38758f=>{if('rename'==_0x38758f['type']){const _0x3346df=_0x38758f['position']['nodeAfter'];return!_0x13a322['has'](_0x3346df);}if(_0x38758f['type']['indexOf']('Attribute')>-0x1){const _0x45268d=_0x38758f['range']['start']['nodeAfter'];return!_0x13a322['has'](_0x45268d);}return!0x0;});}['_anchorOperation'](_0x28bd41,_0x5aaab3,_0x3022f5){const _0x296425=_0x5aaab3['clone']();for(const _0x114f14 in _0x5aaab3){const _0x5b0e50=_0x5aaab3[_0x114f14];_0x5b0e50 instanceof _0x561be6?_0x5aaab3[_0x114f14]=new _0x561be6(_0xc2cc67(_0x5b0e50['start']),_0xc2cc67(_0x5b0e50['end'])):_0x5b0e50 instanceof _0x18c733&&(_0x5aaab3[_0x114f14]=_0xc2cc67(_0x5b0e50));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x296425['type'])){if(_0x296425['isDocumentOperation']=!0x1,_0x296425['baseVersion']=null,'remove'==_0x296425['type']){const _0x4f7ffb=_0x296425['sourcePosition'],_0x2c7286=_0x296425['howMany'];new _0x5de5b5(_0x4f7ffb,_0x2c7286)['_execute']();}else _0x296425['_execute']();}function _0xc2cc67(_0x391049){if('$graveyard'==_0x391049['root']['rootName'])return _0x391049;const _0x1b374b=[];let _0x3872d5=_0x391049['root'];for(let _0xfa79d7=0x0;_0xfa79d7<_0x391049['path']['length'];_0xfa79d7++){const _0x28a24e=_0x28bd41['get'](_0x3872d5)||0x0;_0x1b374b[_0xfa79d7]=_0x391049['path'][_0xfa79d7]+_0x28a24e,_0x3872d5=_0x3872d5['getChildAtOffset'](_0x391049['path'][_0xfa79d7]);}return new _0x18c733(_0x3022f5,_0x1b374b,_0x391049['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x5e5daf,content:_0xc019a7,version:_0x4feb60,aiBalloon:_0x531728}=this['_interactionParams'];this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),this['_actionsBalloonView']['showLoader'](),this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),this['stopListening'](this['_actionsBalloonView']),this['_setupApplyListeners'](),this['_createInteraction'](_0xc019a7,_0x4feb60,_0x531728,_0x5e5daf)['catch'](_0x3bb612=>{this['_isAbortError'](_0x3bb612)||console['error']('Error\x20refreshing\x20interaction:',_0x3bb612);});}['_isAbortError'](_0x48cad0){return!!_0x48cad0['message']&&_0x48cad0['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['_interactionParams']&&this['_actionsBalloonView']['stopAutoScroll']();}['_navigateToPrevious'](){const _0x4a8817=this['_interactions']['length'];this['_currentInteractionIndex']<_0x4a8817-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x3c9f81){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x3c9f81;const _0xa57e0=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0xa57e0)return;if(_0xa57e0['hasError'])return this['_setErrorState'](_0xa57e0),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0xa57e0['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x4c0830=_0xa57e0['replies'][_0xa57e0['replies']['length']-0x1];if(_0x4c0830){const _0x581ced=this['editor'];try{const _0x2296b7=q({'editor':_0x581ced,'changeGroups':_0x4c0830['changeGroups'],'documentContextContent':_0x4c0830['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x3abd96=>setTimeout(_0x3abd96,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x2296b7[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x5bfa13){this['_isAbortError'](_0x5bfa13)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x5bfa13);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x1e1a1e){const _0x36b5a1=i(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x36b5a1),_0x1e1a1e['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],this['_actionsBalloonView']['setErrorState'](),this['_actionsBalloonView']['toggleIsLoading'](!0x0);}['_clearErrorState'](){this['_actionsBalloonView']['hideError'](),this['_actionsBalloonView']['toggleIsLoading'](!0x1);}async['_clearLoadingState'](){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,this['_actionsBalloonView']['setIsLoading'](!0x1);}}class Ka extends _0x241f5a{static get['requires'](){return[ii,ti,ri];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x18051b){super(_0x18051b),_0x18051b['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class gr extends _0x15a8cb{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x10856c,_0x33cbb4){super(_0x10856c),this['id']=_0x33cbb4,this['set']('status','pending'),this['set']('changeId',_0x33cbb4),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['outdatedButtonView']=this['_createOutdatedButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['set']('showDiff',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-result',this['bindTemplate']['if']('isActive','ck-ai_review__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click'),'mouseover':this['bindTemplate']['to']('mouseover'),'mouseout':this['bindTemplate']['to']('mouseout')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView'],this['outdatedButtonView']]},this['infoButtonView']]}]}),this['on']('click',(_0x558f1f,_0x34d87d)=>{_0x34d87d&&_0x34d87d['target']&&'A'===_0x34d87d['target']['tagName']&&_0x34d87d['preventDefault'](),this['fire']('activateChange',{'id':_0x33cbb4,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x33cbb4,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x33cbb4,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x2a68ae=new _0x15a8cb(this['locale']);return _0x2a68ae['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai_review__check-run-result-response',this['bindTemplate']['if']('showDiff','ck-hidden',_0x475972=>!_0x475972)]}}),_0x2a68ae;}['_createAcceptButtonView'](){const _0x5c3ac1=new _0x5bfd84(this['locale']);return _0x5c3ac1['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x5c3ac1['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x54e2dc=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x54e2dc['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x4ee816=>'pending'!==_0x4ee816&&'accepted'!==_0x4ee816),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-accept-button',_0x5c2be5=>'pending'===_0x5c2be5),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x20ccbc=>'accepted'===_0x20ccbc)]}}),this['on']('change:status',(_0x469da3,_0x1cc754,_0x193beb)=>{_0x5c3ac1['isEnabled']='pending'===_0x193beb,'accepted'===_0x193beb&&(_0x5c3ac1['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x5c3ac1['icon']=_0x1cd2e2);}),_0x5c3ac1;}['_createDismissButtonView'](){const _0x24448e=new _0x5bfd84(this['locale']);return _0x24448e['set']({'label':i(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x24448e['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x52704e=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x52704e['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary',this['bindTemplate']['if']('status','ck-hidden',_0x2478fd=>'pending'!==_0x2478fd&&'rejected'!==_0x2478fd),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x112729=>'pending'===_0x112729),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0xddc756=>'rejected'===_0xddc756)]}}),this['on']('change:status',(_0xb4aef4,_0x3aba95,_0x5a2aa6)=>{_0x24448e['isEnabled']='pending'===_0x5a2aa6,'rejected'===_0x5a2aa6&&(_0x24448e['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x24448e['icon']=_0x187b85);}),_0x24448e;}['_createInfoButtonView'](){const _0x3fa57a=new _0x5bfd84(this['locale']);return _0x3fa57a['set']({'label':i(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':tc,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x3fa57a['bind']('isOn')['to'](this,'isInfoToggleOn',_0x2a9567=>_0x2a9567),_0x3fa57a['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x3fa57a;}['_createOutdatedButtonView'](){const _0x51b495=new _0x5bfd84(this['locale']);return _0x51b495['set']({'label':i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':_0x257152,'withText':!0x0,'isEnabled':!0x1}),_0x51b495['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x5776d9=>'outdated'!==_0x5776d9)],'disabled':'disabled'}}),_0x51b495;}}class me extends _0x1ddc71{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x22e4c5,_0x40a10b){super(_0x22e4c5),this['set']({'isVisible':!0x1,'position':'arrow_se','class':null,'top':0x0,'left':0x0}),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-reset'],'tabindex':'-1'}}),this['set']('isDiffActive',!0x1),this['content']['add'](this['_createContentView']()),_0x40a10b['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0xf8bee6){this['resultItemView']['changeId']=_0xf8bee6['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0xf8bee6['contentDiffed'];}['showBalloon'](_0x218130,_0x2bb107,_0x38f6b3,_0x5569d5,_0x529b95,_0x1a20ac){const _0x29db15=_0x2bb107();if(!_0x29db15)return;this['updateContent'](_0x218130),this['show']();const _0x2c743e=Array['from'](_0x29db15['getClientRects']())['reverse'](),_0x317304=this['_getPointedRectIndexFromEvent'](_0x38f6b3,_0x2c743e),_0x357b39=_0x2c743e[_0x317304??0x0];'click'===_0x5569d5?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x2bb107(),_0x317304,_0x218130['id'],_0x529b95,_0x1a20ac)||_0x357b39})):'hover'===_0x5569d5&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x2bb107(),_0x317304,_0x218130['id'])||_0x357b39}));}['hideBalloon'](){this['hide'](),this['unpin'](),this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetElement']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange',{'origin':'balloon'});}['_setupClickOutsideHandler'](){_0x4daaf2({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x125963=[this['element']];return this['_pinnedTargetElement']&&_0x125963['push'](this['_pinnedTargetElement']),_0x125963;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x25251e=new _0x15a8cb();return this['resultItemView']=new gr(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x25251e['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai_review-balloon-panel-suggestion',this['bindTemplate']['if']('isDiffActive','ck-ai_review-balloon-panel-suggestion_diff-active')]},'children':[{'tag':'p','attributes':{'class':['ck-ai_review__suggestion-text']},'children':[this['resultItemView']]}]}),_0x25251e;}['_getBestRectPositionOnClick'](_0x458338,_0x4ebca6,_0xcc4526,_0x90d5d9,_0x121e9d){if(!_0x458338)return null;const _0x5ae572=this['position']['replace']('arrow_',''),_0x8e21e9=Array['from'](_0x458338['getClientRects']());let _0x839b12,_0x345980=_0x8e21e9['reverse']();return void 0x0!==_0x4ebca6&&this['_isPinnedRectVisible'](_0x345980[_0x4ebca6],_0x90d5d9,_0x121e9d)?(_0x839b12=_0x345980[_0x4ebca6],this['_pinnedRectIndex']=_0x4ebca6):this['_isPinnedRectVisible'](_0x345980[0x0],_0x90d5d9,_0x121e9d)&&void 0x0===_0x4ebca6?_0x839b12=_0x345980[0x0]:(_0x345980='s'==_0x5ae572[0x0]?[..._0x8e21e9]['reverse']():_0x8e21e9,_0x345980['forEach'](_0x2ee714=>{this['_isPinnedRectVisible'](_0x2ee714,_0x90d5d9,_0x121e9d)&&(_0x839b12=_0x2ee714);})),this['_pinnedTargetChangeId']=_0xcc4526,this['_pinnedTargetElement']=_0x458338,_0x839b12||_0x458338['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x5a7816,_0x1424fc,_0x30a7bf){if(!_0x5a7816)return null;const _0x1eba29=Array['from'](_0x5a7816['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x1424fc&&this['_pinnedTargetChangeId']!==_0x30a7bf)return this['_pinnedRectIndex']=_0x1424fc,this['_pinnedTargetElement']=_0x5a7816,this['_pinnedTargetChangeId']=_0x30a7bf,_0x1eba29[_0x1424fc];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x30a7bf){if(_0x5a7816!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x1eba29[this['_pinnedRectIndex']];}return void 0x0!==_0x1424fc&&this['_pinnedTargetChangeId']!==_0x30a7bf?(this['_pinnedRectIndex']=_0x1424fc,this['_pinnedTargetElement']=_0x5a7816,this['_pinnedTargetChangeId']=_0x30a7bf,_0x1eba29[_0x1424fc]):_0x5a7816['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x74873f,_0x2f24d2){if(_0x74873f)for(let _0x5d09e8=0x0;_0x5d09e8<_0x2f24d2['length'];_0x5d09e8++){const _0x5e1906=_0x2f24d2[_0x5d09e8];if(_0x74873f['clientX']>=_0x5e1906['left']-0x3&&_0x74873f['clientX']<=_0x5e1906['right']+0x3&&_0x74873f['clientY']>=_0x5e1906['top']-0x3&&_0x74873f['clientY']<=_0x5e1906['bottom']+0x3)return _0x5d09e8;}}['_isPinnedRectVisible'](_0x5bbf1a,_0x39817e,_0x2252c0){const _0x250fee=new ot(_0x5bbf1a),_0x13952f=_0x39817e||document['documentElement'],_0x4078c4=_0x250fee['getIntersection'](_0x2279c2(_0x2252c0)),_0x244a60=new ot(_0x13952f)['getIntersection'](_0x250fee);return!!(_0x4078c4&&_0x244a60&&_0x250fee['width']>0x0);}}const ih=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class Me extends _0x118815{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[_t];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5f5ba7){super(_0x5f5ba7),this['_bodyCollection']=new _0x49fddd(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...ih)['to'](this),this['_balloonSuggestionView']=new me(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x283aad=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x283aad);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0xf373d6){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x57f3d5=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0xf373d6,_0x57f3d5);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x2b2b2c){_0x2b2b2c&&('error-general'!==_0x2b2b2c['status']?'error-chunk'!==_0x2b2b2c['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x37321e){this['_mainView']['addCheckRunResult'](_0x37321e);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x5c89e0){this['_mainView']['showGeneralReviewCoreErrorView'](_0x5c89e0??i(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x1c5ee2,_0x38b5c0){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x1c5ee2,_0x38b5c0);}['setActiveStateInResults'](_0x259866){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x3f2eb7=>{_0x3f2eb7['id']===_0x259866&&_0x3f2eb7['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x1774cd=>_0x1774cd['setItemAsInactive']());}['updateChangeState'](_0x3e079a,_0x23010d){'accepted'===_0x23010d||'rejected'===_0x23010d||'outdated'===_0x23010d?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x3e079a,_0x23010d):this['_mainView']['reviewCheckResultsView']['showResult'](_0x3e079a,_0x23010d);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x5d1a6e,_0x2bd384,_0x1f602f,_0x5caf09,_0xb96e48,_0x39fe15){this['_balloonSuggestionView']['showBalloon'](_0x5d1a6e,_0x2bd384,_0x1f602f,_0x5caf09,_0xb96e48,_0x39fe15);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x421f49){const _0x44e524=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x2a4eed=>_0x2a4eed['id']===_0x421f49);return _0x44e524?_0x44e524['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class sh extends _0x15a8cb{constructor(_0x442654){super(_0x442654),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x5ce5e4=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x5ce5e4['if']('isVisible','ck-hidden',_0x5b73ff=>!_0x5b73ff)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x5ce5e4['to']('errorMessage')}]}]});}}class Ae extends _0x15a8cb{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x440a08,_0x547b12){super(_0x440a08),this['reviewCoreHeader']=_0x547b12['header'],this['generalErrorView']=new sh(_0x440a08),this['reviewCheckListView']=_0x547b12['list'],this['reviewCheckListView']['delegate'](...ih)['to'](this),this['reviewCheckResultsView']=_0x547b12['results'],this['reviewCheckResultsView']['delegate'](...ih)['to'](this),this['reviewCompletedView']=_0x547b12['completed'],this['reviewCompletedView']['delegate']('finishReview')['to'](this),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isLoading',!0x1),this['reviewCheckResultsView']['set']('isResultReady',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewCoreHeader'],this['generalErrorView'],this['reviewCheckListView'],this['reviewCheckResultsView'],this['reviewCompletedView']]});}['showReviewCheckListView'](){this['reviewCheckListView']['resetAllParameterizedChecks'](),this['reviewCheckListView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1);}['showReviewCheckResultsView'](){this['hideActionsWhenResultIsReady'](),this['reviewCheckResultsView']['resetErrorState'](),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['clearResults'](),this['reviewCheckResultsView']['set']('isLoading',!0x0),this['reviewCheckResultsView']['set']('isCompleted',!0x1);}['addCheckRunResult'](_0x5f3a18){this['reviewCheckResultsView']['addResult'](_0x5f3a18),this['reviewCheckResultsView']['set']('isLoading',!0x1);}['showReviewCompletedView'](){this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isCompleted',!0x0),this['reviewCheckListView']['set']('isVisible',!0x1);}['showActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']?(this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1)):this['reviewCheckResultsView']['isResultReady']=!0x0;}['showNoChangesView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x0);}['hideActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x1;}['showGeneralReviewCoreErrorView'](_0x53a2ed){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x53a2ed;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class _r extends _0x5bfd84{constructor(_0x44f6b4,_0x4383ca){super(_0x4383ca),this['set']({'label':_0x44f6b4,'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class Ve extends _0x5e9d54{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x3efa97,_0x120fe3){super(_0x3efa97),this['_contents']=_0x120fe3,this['_resultViews']=new _0x152ab6(),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_acceptAllButtonView']=this['_createAcceptAllButtonView'](),this['_exitReviewButtonView']=this['_createExitReviewButtonView'](),this['_toggleDiffButtonView']=this['_createToggleDiffButtonView'](),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['_resultsHeader']=this['_createResultHeaderView'](),this['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new Fi(_0x3efa97),this['set']('isLoading',!0x1),this['set']('isToggleDiffOn',!0x1),this['set']('isResultReady',!0x1),this['set']('headerTitle',''),this['set']('headerSubtitle',''),this['set']('isError',!0x1),this['set']('showErrorMessage',!0x1),this['set']('errorType','general'),this['set']('isCompleted',!0x1);const _0x4ff5c9=this['_createCombinedSkeletonLoader'](),_0x3f1b59=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x3f1b59['if']('isLoading','ck-ai_review__check-run_loading',_0x232df0=>_0x232df0),_0x3f1b59['if']('isResultReady','ck-ai_review__check-run_ready',_0x2cf305=>_0x2cf305),_0x3f1b59['if']('isVisible','ck-hidden',_0x11ff8a=>!_0x11ff8a)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x11bdb3=>_0x11bdb3)]},'children':this['_resultViews']},_0x4ff5c9]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x301158){const _0x52731b=new gr(this['locale'],_0x301158['id']);_0x52731b['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x52731b),_0x52731b['resultResponseView']['element']['innerHTML']=_0x301158['contentDiffed'];}['hideResult'](_0x5bb6da,_0x47218e){if('pending'===_0x47218e)return;const _0x5d903b=this['_resultViews']['find'](_0x3f70c4=>_0x3f70c4['id']===_0x5bb6da);_0x5d903b&&(_0x5d903b['status']=_0x47218e,_0x5d903b['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x39ca0a,_0x5755c7){if('pending'!==_0x5755c7)return;const _0x50a32c=this['_resultViews']['find'](_0x2d649f=>_0x2d649f['id']===_0x39ca0a);_0x50a32c&&(_0x50a32c['status']=_0x5755c7,_0x50a32c['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x3a20d0,_0x5e1f72){this['headerTitle']=_0x3a20d0,this['headerSubtitle']=_0x5e1f72||'';}['showChunkErrorMessage'](){this['errorType']='chunk',this['showErrorMessage']=!0x0;}['showGeneralErrorMessage'](){this['isError']=!0x0,this['errorType']='general',this['showErrorMessage']=!0x0;}['resetErrorState'](){this['isError']=!0x1,this['errorType']='general',this['showErrorMessage']=!0x1;}['_createSkeletonLoader'](){return new Ei(this['locale'],Si['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x7ccccc=new _0x15a8cb(this['locale']),_0x3e8583=[];for(let _0x421abe=0x0;_0x421abe<0x10;_0x421abe++){const _0x177852=this['_createSkeletonLoader']();_0x177852['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x3e8583['push'](_0x177852);}return _0x7ccccc['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x70df5e=>!_0x70df5e)]},'children':_0x3e8583}),_0x7ccccc;}['_createErrorView'](){const _0x239397=new _0x15a8cb(this['locale']),_0x15d0d7=new _0x5bfd84(this['locale']),t=this['locale']['t'];return _0x239397['delegate']('retryReview')['to'](this),_0x15d0d7['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai_review__check-run-error-retry-button'}),_0x15d0d7['on']('execute',()=>{this['fire']('retryReview');}),_0x239397['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x49319c=>!_0x49319c),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x38155b=>'chunk'===_0x38155b)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error','ck-ai-notification__full-width','ck-ai_review__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-notification_warning',_0x57879c=>'chunk'===_0x57879c)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x5101e2=>'general'!==_0x5101e2)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x2f4a37=>'chunk'!==_0x2f4a37)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x15d0d7]}),_0x239397;}['_createCancelButtonView'](){const _0x18c3d8=new _0x5bfd84(this['locale']);return _0x18c3d8['set']({'label':i(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x49c145}),_0x18c3d8['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x3afa66=>_0x3afa66),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x10d08e=>_0x10d08e)]}}),_0x18c3d8['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x18c3d8;}['_createToggleDiffButtonView'](){const _0x15f1a0=new _0x5bfd84(this['locale']);_0x15f1a0['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x15f1a0['bind']('isEnabled')['to'](this,'isError',_0x226409=>!_0x226409),_0x15f1a0['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0xed5269=>!_0xed5269),this['bindTemplate']['if']('isCompleted','ck-hidden',_0xc6125a=>_0xc6125a)]}});const _0x9c84d3=i(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0xa2e72=i(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x15f1a0['bind']('isOn')['to'](this,'isToggleDiffOn',_0x300e57=>_0x300e57),_0x15f1a0['bind']('icon')['to'](this,'isToggleDiffOn',_0xd6b76f=>_0xd6b76f?_0x3a16b6:_0x2b26c),_0x15f1a0['bind']('label')['to'](this,'isToggleDiffOn',_0x24d597=>_0x24d597?_0x9c84d3:_0xa2e72),_0x15f1a0['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x15f1a0;}['_createAcceptAllButtonView'](){const _0x1a6001=new _0x5bfd84(this['locale']);return _0x1a6001['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x1a6001['bind']('isEnabled')['to'](this,'isError',_0x1e5b74=>!_0x1e5b74),_0x1a6001['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x4d0557=>!_0x4d0557),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x513727=>_0x513727)]}}),_0x1a6001['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x1a6001;}['_createExitReviewButtonView'](){const _0x54c039=new _0x5bfd84(this['locale']);return _0x54c039['set']({'label':i(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x54c039['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary','ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x277f69=>!_0x277f69),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3c16bd=>_0x3c16bd)]}}),_0x54c039['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x54c039;}['_createResultHeaderView'](){const _0x39d17a=new _0x15a8cb(this['locale']),_0x126f2b=this['_createTitleView']();return _0x39d17a['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x298685=>_0x298685)]},'children':[_0x126f2b,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x39d17a;}['_createTitleView'](){const _0x43d079=new _0x15a8cb(this['locale']),_0xec69a9=new Ci();return _0xec69a9['bind']('isVisible')['to'](this,'isResultReady',_0x4b8cd2=>!_0x4b8cd2),_0x43d079['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0xec69a9,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x562d31=>_0x562d31)]},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]},{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3918a0=>!_0x3918a0)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x43d079;}['_createFinishReviewButtonView'](){const _0x39681e=new _r(i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x39681e['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x282e7e=>!_0x282e7e)]}}),_0x39681e['delegate']('finishReview')['to'](this),_0x39681e;}}class be extends _0x5e9d54{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x3fc96d,_0x2db180){super(_0x3fc96d),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x2db180['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x2db180['headerText']);const _0x192120=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x192120['if']('isVisible','ck-hidden',_0x118028=>!_0x118028)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai_review__review-completed-content-text']},'children':[{'text':_0x2db180['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x4a07df){const _0x39b591=new _r(_0x4a07df,this['locale']);return _0x39b591['delegate']('finishReview')['to'](this),_0x39b591;}['_createResultHeaderView'](_0x3ed9a0){const _0x315249=new _0x15a8cb(this['locale']);return _0x315249['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title']},'children':[{'text':_0x3ed9a0}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x315249;}}class Dr extends _0x15a8cb{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x320ea7,_0x206da3){super(_0x320ea7),this['_defaultValue']=_0x206da3['default']||(_0x206da3['data']['length']>0x0?_0x206da3['data'][0x0]['id']:''),this['_defaultLabel']=_0x206da3['data']['find'](_0x8800bf=>_0x8800bf['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x29ed58(this['locale']);const _0x6f2085=this['_prepareListOptions'](_0x206da3['data']);_0x48b098(this['_dropdownView'],_0x6f2085,{'role':'menu','ariaLabel':_0x206da3['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2cf2f5=>{_0x2cf2f5['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x197c4f=>{this['formValue']=_0x197c4f['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x197c4f['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai_review__check-list-item-parameterized-form-element','ck-ai_review__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x479718=[]){const _0x27adbb=new _0x4b06b7();this['resetToDefault']();for(const _0x780c8e of _0x479718){const _0x3b8a38=new _0x129df2({'label':_0x780c8e['label'],'withText':!0x0,'role':'menuitemradio','id':_0x780c8e['id'],'model':_0x780c8e});_0x3b8a38['bind']('isOn')['to'](this,'formValue',_0x1ae91d=>_0x1ae91d===_0x3b8a38['id']);const _0x43223a={'type':'button','model':_0x3b8a38};_0x27adbb['add'](_0x43223a);}return _0x27adbb;}}class cc extends _0x5e9d54{['_formItem']=null;constructor(_0x980df2,_0x3ed1b1,_0x44a0ff){super(_0x980df2),this['argsKey']=_0x3ed1b1?.['argsKey'];if('dropdown'===_0x3ed1b1['formType'])this['_formItem']=new Dr(this['locale'],_0x3ed1b1);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x315a3c=new _0x294a7c(this['locale'],{'children':[this['_formItem']],'class':[_0x44a0ff?'ck-form__row_with-submit':'']});_0x44a0ff&&_0x315a3c['children']['add'](_0x44a0ff),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x315a3c]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class mo extends _0x59ba6f{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x217399){super(_0x217399),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x394cf5(),this['minRows']=mo['MIN_ROWS'],this['maxRows']=mo['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-prompt-input','class':['ck','ck-review__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class rc extends _0x15a8cb{['focusTracker']=new _0x510dfd();['keystrokes']=new _0x394cf5();['focusCycler'];['_focusables']=new _0x152ab6();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x25f0f8,_0x221af0,_0xf57a29=!0x1){super(_0x25f0f8),this['_check']=_0x221af0,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x221af0['defaultModel']?_0x221af0['defaultModel']['id']:'',this['_defaultLabel']=_0x221af0['defaultModel']?_0x221af0['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x1a087b(this['locale'],()=>new mo(_0x25f0f8)),this['promptInputView']['fieldView']['bind']('value')['to'](this,'prompt'),this['promptInputView']['fieldView']['on']('input',()=>{this['prompt']=this['promptInputView']['fieldView']['element']['value'];}),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelSelectionDropdownItems']=new _0x4b06b7(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0xf57a29),_0x48b098(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x294a7c(this['locale'],{'children':[this['promptInputView']]}),new _0x294a7c(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x4b8d1f,_0x247b89)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x247b89()):_0x247b89();}),this['focusCycler']=new _0x5a99d2({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}));}['render'](){super['render'](),([this['promptInputView'],this['_modelSelectionDropdown'],this['cancelButtonView'],this['submitButtonView']]['forEach'](_0x19ba30=>{this['_focusables']['add'](_0x19ba30),this['focusTracker']['add'](_0x19ba30['element']);}),this['keystrokes']['listenTo'](this['element']));}get['modelDefaultValue'](){return this['_defaultValue'];}get['modelDefaultLabel'](){return this['_defaultLabel'];}['resetToDefault'](){this['prompt']='',this['modelId']=this['modelDefaultValue'],this['_modelSelectionDropdown']['buttonView']['label']=this['modelDefaultLabel'],this['resetFormValidationStatus']();}['resetFormValidationStatus'](){this['promptInputView']['errorText']='';}['_isValid'](){this['resetFormValidationStatus']();for(const _0x3aca7b of this['_getFormValidators']()){const _0x1e4fd5=_0x3aca7b();if(_0x1e4fd5)return this['promptInputView']['errorText']=_0x1e4fd5,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return i(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x3a848b=new _0x5bfd84(this['locale']),t=this['locale']['t'];return _0x3a848b['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x3a848b['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x3a848b;}['_createCancelButtonView'](){const _0x1f9798=new _0x5bfd84(this['locale']),t=this['locale']['t'];return _0x1f9798['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary'}),_0x1f9798['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x32d4b9=>{_0x32d4b9['stopPropagation']();})}}),_0x1f9798['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x1f9798;}['_setModelList'](_0x5537e8){this['_modelSelectionDropdownItems']['clear']();const _0x192e6c=this['_check']['models'];if(_0x5537e8)this['set']('modelDisplayMode','hidden');else{const _0x400a08=0x1===_0x192e6c['length'];this['set']('modelDisplayMode',_0x400a08?'name':'selector');}if(this['resetToDefault'](),_0x192e6c?.['length']){0x1===_0x192e6c['length']&&this['set']('activeModelName',_0x192e6c[0x0]['name']||_0x192e6c[0x0]['id']);for(const _0x1fca4e of _0x192e6c){const _0x1ffb5a=new _0x129df2({'label':_0x1fca4e['name'],'withText':!0x0,'role':'menuitemradio','id':_0x1fca4e['id'],'model':_0x1fca4e});_0x1ffb5a['bind']('isOn')['to'](this,'modelId',_0x2a6a6e=>_0x2a6a6e===_0x1fca4e['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x1ffb5a,'labelView':new po(this['locale'],_0x1fca4e)});}}}['_createModelSelectionDropdown'](){const _0x5f5aa1=_0x29ed58(this['locale']);return _0x5f5aa1['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x5f5aa1['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),_0x5f5aa1['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x53d591=>'selector'===_0x53d591),this['listenTo'](_0x5f5aa1,'execute',_0x1f1c5b=>{this['modelId']=_0x1f1c5b['source']['model']['id'],_0x5f5aa1['buttonView']['label']=_0x1f1c5b['source']['label'];}),_0x5f5aa1;}['_createModelNameView'](){const _0x60812c=new wo(this['locale']);return _0x60812c['bind']('text')['to'](this,'activeModelName',_0x70864b=>_0x70864b??''),_0x60812c['bind']('isVisible')['to'](this,'modelDisplayMode',_0x268641=>'name'===_0x268641),_0x60812c;}['_createActionsFooterView'](){const _0x59c2ea=new _0x15a8cb(this['locale']);return _0x59c2ea['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0x59c2ea;}}class wo extends _0x15a8cb{constructor(_0x5c7584){super(_0x5c7584),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x58a4f6=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x58a4f6['if']('isVisible','ck-hidden',_0x1b2358=>!_0x1b2358)]},'children':[{'text':_0x58a4f6['to']('text')}]});}}class po extends _0x59760a{constructor(_0x11495f,_0x21a4d5){super();const _0x5130e9=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x5130e9['to']('style'),'id':_0x5130e9['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x5130e9['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x21a4d5['description']||'']}]}]});}}class ic extends _0x5e9d54{['_formItemsCollection']=new _0x152ab6();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x158cf5,_0x2f6857,_0x346fb5,_0x13d1c4=!0x1){super(_0x158cf5),this['_hideModels']=_0x13d1c4,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x2f6857['isParameterized']);const _0x19ee75=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai_review__check-list-item_selected',_0x5c26f7=>_0x5c26f7),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x2cba74=>_0x2cba74)],'style':{'--ck-ai-review-check-list-item-index':_0x346fb5}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-list-item-title-text']},'children':[{'text':_0x2f6857['title']}]},_0x19ee75]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x2f6857['description']?[{'text':_0x2f6857['description']}]:[]}]}]},..._0x2f6857['isParameterized']?[this['_createParameterizedView'](_0x2f6857)]:[],...'custom'===_0x2f6857['id']?[this['_createCustomView'](_0x2f6857,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x2f6857['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x2f6857['id'],'args':_0x2f6857['useArgs']?_0x2f6857['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x4daaf2({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x3a130b=>{_0x3a130b['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x161b8d=new _0x2ae97e();return _0x161b8d['content']=_0x2ef869,_0x161b8d['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x161b8d;}['_createParameterizedView'](_0x409694){const _0x5bdd82=new _0x15a8cb(),_0x2557ac=this['_createFormView'](_0x409694);return _0x5bdd82['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x472a5d=>!_0x472a5d)]},'children':[_0x2557ac]}),_0x5bdd82;}['_createFormView'](_0xee0296){const _0x425f3b=new _0x15a8cb(),_0x3a9643=Array['isArray'](_0xee0296['options'])?_0xee0296['options']:[],_0x1a3b49=new _0x5bfd84(this['locale']),t=this['locale']['t'];_0x1a3b49['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x1a3b49['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x52bbc9=>{_0x52bbc9['stopPropagation']();})}}),_0x1a3b49['on']('execute',()=>{const _0x1c4f1a=[],_0x2c481c={};this['_formItemsCollection']['forEach'](_0x277ff3=>{_0x1c4f1a['push'](_0x277ff3['value']),_0xee0296['useArgs']&&_0xee0296['options']&&(_0x2c481c[_0x277ff3['argsKey']]=_0x277ff3['value']);}),this['fire']('runReviewCheck',{'id':_0xee0296['id'],'params':_0x1c4f1a['length']?_0x1c4f1a:void 0x0,'args':Object['keys'](_0x2c481c)['length']?_0x2c481c:void 0x0});});const _0x3df306=_0x3a9643['length'];return _0x3a9643['forEach']((_0x113ea9,_0x3fcc36)=>{const _0x474e6d=_0x3fcc36===_0x3df306-0x1;this['_formItemsCollection']['add'](new cc(this['locale'],_0x113ea9,_0x474e6d?_0x1a3b49:null));}),_0x425f3b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x425f3b;}['_createCustomView'](_0x5d7430,_0x329c63=!0x1){return this['_customCheckView']=new rc(this['locale'],_0x5d7430,_0x329c63),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-parameterized','ck-ai_review__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x55e9a4=>!_0x55e9a4)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x2ad20e,_0x1414b9,_0x5c65f3)=>{_0x5c65f3||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class je extends _0x5e9d54{['_checkViews'];constructor(_0x29350b){super(_0x29350b),this['_checkViews']=new _0x152ab6(),this['_setupTemplate']();}['setChecks'](_0xbdb016,_0x7a574e=!0x1){this['_checkViews']['clear']();for(const [_0x24c605,_0x1be260]of _0xbdb016['entries']()){const _0x2344b2=new ic(this['locale'],_0x1be260,_0x24c605,_0x7a574e);_0x2344b2['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x2344b2);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x42a796 of this['_checkViews'])_0x42a796 instanceof ic&&_0x42a796['resetToDefault']();}['_setupTemplate'](){const _0x2caa4d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x2caa4d['if']('isVisible','ck-hidden',_0x1ebd6f=>!_0x1ebd6f)]},'children':this['_checkViews']});}}class ge extends Me{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x381d93=this['context']['locale'],_0x294573=new _0x2e3f47(_0x381d93,{'label':i(_0x381d93,'AI_REVIEW_MODE'),'icon':_0x143feb,'class':'ck-ai-header\x20ck-ai-header_review'});return new Ae(this['context']['locale'],{'header':_0x294573,'list':new je(_0x381d93),'results':new Ve(_0x381d93,{'generalErrorText':i(_0x381d93,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new be(_0x381d93,{'headerText':i(_0x381d93,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':i(_0x381d93,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0x381d93,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x16da58=this['context']['plugins']['get']('AITabs');_0x16da58['view']['on']('activateTab',(_0x47407d,_0x445714)=>{'reviewMode'===_0x445714?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x16da58['view']['addTab']({'id':'reviewMode','buttonLabel':i(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x143feb,'order':0x0,'content':this['_mainView']});}}const fe='review-';class de extends _0x118815{static get['requires'](){return[_0x143aa3,D];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];constructor(_0x27947c){super(_0x27947c),this['_domEmitter']=new(_0x400351())(),this['_eventEmitter']=new(_0x204e9f())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x4d89a8=et(this['context']);_0x4d89a8['conversion']['for']('editingDowncast')['markerToElement']({'model':fe+'insert','view':(_0x2db2e3,{writer:_0x1df47b})=>{const _0x5b63fa=this['_markers']['get'](_0x2db2e3['markerName']),_0x2cbcdc={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x5b63fa?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x2db2e3['markerName']};return _0x1df47b['createUIElement']('span',_0x2cbcdc,function(_0x2305a8){const _0x13b5bc=this['toDomElement'](_0x2305a8);return _0x13b5bc['innerHTML']=_0x5b63fa?.['content']?.['asString']||'',_0x13b5bc;});}}),_0x4d89a8['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-only','view':_0x1214a7=>{const _0x38acea=this['_markers']['get'](_0x1214a7['markerName']),_0x3a50f8=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x38acea?.['id']||'')&&_0x3a50f8['push']('ck-ai_review__change_active'),{'classes':_0x3a50f8,'attributes':{'data-marker-id':_0x1214a7['markerName']}};}}),_0x4d89a8['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-context','view':_0x60f9cc=>{const _0x2f5435=this['_markers']['get'](_0x60f9cc['markerName']),_0x3ac850=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x2f5435?.['id']||'')&&_0x3ac850['push']('ck-ai_review__change_active'),{'classes':_0x3ac850,'attributes':{'data-marker-id':_0x60f9cc['markerName']}};}}),_0x4d89a8['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-text','view':_0x360701=>{const _0x14257d=this['_markers']['get'](_0x360701['markerName']),_0x22e8ee=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x14257d?.['id']||'')&&_0x22e8ee['push']('ck-ai_review__change_active'),{'classes':_0x22e8ee,'attributes':{'data-marker-id':_0x360701['markerName']}};}}),_0x4d89a8['conversion']['for']('dataDowncast')['markerToElement']({'model':fe+'suggestion-context','view':(_0x269104,{writer:_0x4630a4})=>_0x4630a4['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x269104['isOpening']?'start':'end')})}),_0x4d89a8['conversion']['for']('downcast')['attributeToAttribute']({'model':Et,'view':_0x53de42});const _0x28ef0b=_0x4d89a8['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x28ef0b,'mouseup',(_0x184103,_0x386df0)=>{const _0x24edcc=_0x386df0['target'],_0x2a9393=this['_findMarkerElement'](_0x24edcc);if(!_0x2a9393)return;const _0x3a9c6d=_0x2a9393['getAttribute']('data-marker-id'),_0x323844=_0x3a9c6d['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x3a9c6d,'changeId':_0x323844,'markerElement':()=>this['_findMarkerElementById'](_0x3a9c6d),'domEvent':_0x386df0});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x28ef0b,'mouseover',(_0x360e69,_0x7ae6f7)=>{const _0x5bb88a=_0x7ae6f7['target'],_0x280392=_0x7ae6f7['relatedTarget'];let _0x14d66f=this['_findMarkerElement'](_0x5bb88a);if(!_0x14d66f&&_0x280392&&(_0x14d66f=this['_findMarkerElement'](_0x280392)),!_0x14d66f)return;const _0x3fa1bb=_0x14d66f['getAttribute']('data-marker-id'),_0xc113eb=_0x3fa1bb['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0xc113eb,'markerElement':()=>this['_findMarkerElementById'](_0x3fa1bb),'domEvent':_0x7ae6f7});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x5a61ef((_0x341480,_0x12013b)=>{const _0x52bdbc=_0x12013b['target'];if(this['_findMarkerElement'](_0x52bdbc))return;_0x52bdbc['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x4d89a8['model']['document']['registerPostFixer'](_0x355a36=>this['_validateMarkers'](_0x4d89a8,_0x355a36)),_0x4d89a8['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x4d89a8));}['getDocumentData'](){const _0x357e52=this['context']['plugins']['get']('AIEditing'),_0x5abb38=et(this['context']),_0xc418c7=_0x5abb38['model'],_0x5507dc=new _0x53b4ba();for(const _0x29673c of _0xc418c7['document']['getRoot']()['getChildren']()){const _0x1fec37=_0x29673c['_clone'](!0x0);_0x5507dc['_appendChild'](_0x1fec37);}for(const _0x275847 of _0xc418c7['markers'])_0x5507dc['markers']['set'](_0x275847['name'],this['_changeRangeOwnerDocument'](_0x275847['getRange']()['clone'](),_0x5507dc));const _0x14f533=new _0x266ef3({'ignoreElementEnd':!0x0,'startPosition':_0xc418c7['createPositionAt'](_0x5507dc,0x0)}),_0x4ca3d3=new Set(),_0x5e1d7c=new Map();for(const {item:_0x143603}of _0x14f533){if(!_0x143603['is']('$textProxy'))continue;const _0x31b008=_0x143603['parent'];if(_0x31b008&&_0x31b008['is']('element')){const _0x3e33bb=this['_upsertDataId'](_0x31b008,()=>_0x357e52['_nextDataId'](_0x4ca3d3));_0x4ca3d3['add'](_0x3e33bb);for(const _0x326cbf of _0x31b008['getChildren']())_0x326cbf['is']('element')&&_0x4ca3d3['add'](this['_upsertDataId'](_0x326cbf,()=>_0x357e52['_nextDataId'](_0x4ca3d3)));let _0xf1cfd7=_0x31b008;for(;_0xf1cfd7['parent']&&!_0xf1cfd7['parent']['is']('documentFragment');)_0xf1cfd7=_0xf1cfd7['parent'],_0xf1cfd7['hasAttribute'](Et)&&_0xf1cfd7['_removeAttribute'](Et);_0x5e1d7c['set'](_0x3e33bb,{'path':_0x31b008['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0xf1cfd7['_clone'](!0x0),_0x3e33bb,_0x5abb38['data'])}),_0x14f533['jumpTo'](_0xc418c7['createPositionAfter'](_0x31b008));}}return{'content':_0x5abb38['data']['processor']['toData'](_0x5abb38['data']['toView'](_0x5507dc)),'version':_0x5abb38['model']['document']['version'],'elements':_0x5e1d7c};}['diffContent'](_0x58315a,_0x3ff74b,_0x263316=!0x1){const _0x224c51=[],_0x459981=et(this['context']),_0x3c7930=_0x459981['data']['parse'](_0x3ff74b,'$documentFragment'),_0x17a8da=_0x459981['data']['parse'](_0x58315a,'$documentFragment'),_0x34ab69=_0x459981['model']['createPositionAt'](_0x17a8da,0x0);if(this['_haveSingleTopLevelElement'](_0x3c7930)){if(!this['_hasSameTopLevelElement'](_0x17a8da,_0x3c7930))return _0x224c51;}else{const _0x211fec=_0x459981['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x17a8da,_0x211fec)||!this['_haveOnlyInlineContent'](_0x3c7930,_0x211fec))return _0x224c51;}const _0x2065e7=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x58315a,_0x3ff74b,{'anchor':_0x34ab69,'markDeletions':!0x0})['getOperations']()['filter'](_0x3cbfed=>'insert'===_0x3cbfed['type']||'marker'===_0x3cbfed['type']&&_0x3cbfed['name']['startsWith']('$markedRemove')),_0x47a3d0=this['_groupAdjacentOperations'](_0x2065e7),_0x33c8e5=[];if(_0x263316){if(_0x47a3d0['length']){const _0x26f747=_0x47a3d0[0x0]['operations'][0x0],_0x3fe46c='insert'===_0x26f747['type']?_0x26f747['position']:_0x26f747['newRange']['start'],_0xf6e629=this['_getPositionLimitingRange'](_0x3fe46c,_0x459981,'inside'),_0x2c5121=_0xf6e629?_0x3c7930['getChild'](0x0)['getChildren']():_0x3c7930['getChildren'](),_0x54aea4=_0xf6e629||_0x459981['model']['createRangeIn'](_0x17a8da),_0x2e6314=[new _0x2b53fb('$markedRemove:synthetic'+_0x2e2dc8(),null,_0x54aea4,_0x459981['model']['document']['model']['markers'],!0x0,_0x459981['model']['document']['version']+0x1),new _0x147757(_0x54aea4['end'],_0x2c5121,_0x459981['model']['document']['version']+0x2)];_0x33c8e5['push']({'operations':_0x2e6314,'operationsIsolated':_0x2e6314,'groupOffset':0x0});}}else _0x33c8e5['push'](..._0x47a3d0);let _0x1a6d2e=0x0;return _0x459981['model']['change'](_0x3f4715=>{for(let _0x471bb6=0x0;_0x471bb6<_0x33c8e5['length'];_0x471bb6++){const _0x279991=_0x33c8e5[_0x471bb6],_0x106953=_0x3f4715['createDocumentFragment']();for(const _0x179f2e of _0x17a8da['getChildren']())_0x3f4715['append'](_0x179f2e['_clone'](!0x0),_0x106953);for(const _0x3c8926 of _0x279991['operationsIsolated'])if('insert'===_0x3c8926['type']){const _0x22fc8b=_0x3c8926;_0x22fc8b['baseVersion']=null,_0x22fc8b['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x22fc8b,_0x106953),_0x3f4715['batch']['addOperation'](_0x3c8926),_0x459981['model']['applyOperation'](_0x3c8926);const _0x3a81a8='suggestion:insertion:id:authorId:'+_0x1a6d2e++,_0xb8b7c=_0x459981['model']['createRange'](_0x22fc8b['position'],_0x22fc8b['position']['getShiftedBy'](_0x22fc8b['howMany']));_0x106953['markers']['set'](_0x3a81a8,_0xb8b7c);}else{if('marker'===_0x3c8926['type']&&_0x3c8926['name']['startsWith']('$markedRemove')){const _0x1f8645=_0x3c8926,_0x271cd2='suggestion:deletion:id:authorId:'+_0x1a6d2e++;this['_changeOperationOwnerDocument'](_0x1f8645,_0x106953),_0x106953['markers']['set'](_0x271cd2,_0x1f8645['newRange']);}}if(_0x263316)_0x224c51['push']({..._0x279991,'context':this['_createGetContentFn'](_0x17a8da,_0x459981['data']),'content':this['_createGetContentFn'](_0x17a8da,_0x459981['data'])});else{const _0x17a803=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x279991['operationsIsolated'][0x0]),_0x106953),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x279991['operationsIsolated'][_0x279991['operationsIsolated']['length']-0x1]),_0x106953));_0x106953['markers']['set'](fe+'suggestion-context',new _0x561be6(_0x17a803['start'],_0x17a803['end'])),_0x224c51['push']({..._0x279991,'context':this['_createGetContextFn'](_0x106953,_0x459981['data'],{'ellipsisBefore':_0x17a803['hasContentBefore'],'ellipsisAfter':_0x17a803['hasContentAfter']}),'content':this['_createGetContentFn'](_0x106953,_0x459981['data'])});}}}),_0x224c51;}['markChangePositionInEditorContent'](_0x25b0a8,_0x1b7c8b){if(!_0x25b0a8['length'])return;const _0x265838=_0x25b0a8[0x0]['parent']['id'],_0x39331f=_0x1b7c8b['elements']['get'](_0x265838);if(!_0x39331f)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x265838);const _0x21a685=_0x39331f['path'],_0x2b98bb=et(this['context']),_0x2726c6=_0x2b98bb['model']['document']['history']['getOperations'](_0x1b7c8b['version']),_0x45d981=[];for(const _0x556940 of _0x25b0a8){const _0x126b3d=_0x556940['operationsIsolated']['map'](_0x16eba3=>this['_translateOperationToEditorContent'](_0x16eba3,_0x21a685,_0x2b98bb['model']['document']['getRoots']()[0x0]));if(!_0x126b3d||!_0x126b3d['length'])continue;const _0x24b8ca=_0x126b3d['every'](_0x3e0bc9=>'marker'===_0x3e0bc9['type']&&_0x3e0bc9['name']['startsWith']('$markedRemove')),_0x100fca={'document':_0x2b98bb['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x2f2d1b=_0x359a53(_0x126b3d,_0x2726c6,_0x100fca)['operationsA'];for(const _0x600347 of _0x2f2d1b)if('insert'===_0x600347['type']){const _0x13f64a=_0x600347,_0x3097c9=_0x13f64a['nodes'];_0x2b98bb['model']['change'](_0x13ec08=>{const _0x530d66=_0x13ec08['createDocumentFragment']();for(const _0x113b89 of _0x3097c9)_0x13ec08['append'](_0x113b89['_clone'](!0x0),_0x530d66);_0x45d981['push']({'start':_0x13f64a['position'],'end':_0x13f64a['position'],'type':'insert','groupId':_0x556940['id'],'content':{'asString':this['_createGetContentFn'](_0x530d66,_0x2b98bb['data'])(),'asFragment':_0x530d66}});});}else{if('marker'===_0x600347['type']&&_0x600347['name']['startsWith']('$markedRemove')){const _0x3186ed=_0x600347;let _0x4933bf='remove-text';if(_0x24b8ca){const _0x3a0b79=this['_findAdjacentContextDistance'](_0x3186ed['newRange']['start'],'backward',_0x2b98bb['model']['schema']),_0x24c85b=this['_findAdjacentContextDistance'](_0x3186ed['newRange']['end'],'forward',_0x2b98bb['model']['schema']);if(_0x3a0b79||_0x24c85b){const _0x3ff2db=_0x3186ed['newRange']['start']['getShiftedBy'](-_0x3a0b79),_0x264d6e=_0x3186ed['newRange']['end']['getShiftedBy'](_0x24c85b);_0x45d981['push']({'start':_0x3ff2db,'end':_0x264d6e,'groupId':_0x556940['id'],'type':'remove-context'});}else _0x4933bf='remove-only';}_0x45d981['push']({'start':_0x3186ed['newRange']['start'],'end':_0x3186ed['newRange']['end'],'groupId':_0x556940['id'],'type':_0x4933bf});}}}this['_insertMarkers'](_0x45d981);}['clearAllMarkers'](){const _0x56294f=et(this['context']);_0x56294f['model']['change'](_0x2f5153=>{for(const _0x29f68d of this['_markers']['keys']())_0x56294f['model']['markers']['get'](_0x29f68d)&&_0x2f5153['removeMarker'](_0x29f68d);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){et(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){et(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x3e80ac){const _0x2fc07d=et(this['context']),_0x5c28f1=_0x2fc07d['model'],_0x310a5f=_0x3e80ac['map'](_0x3c0535=>this['_getMarkersDataForGroup'](_0x3c0535))['flat']();_0x5c28f1['change'](_0x79a2c9=>{for(const _0x19bb9d of _0x310a5f){const _0x215b6d=_0x2fc07d['model']['markers']['get'](_0x19bb9d['id']);if(_0x215b6d){if('insert'===_0x19bb9d['type']){if(!_0x19bb9d['content'])continue;_0x5c28f1['insertContent'](_0x19bb9d['content']['asFragment']||null,_0x215b6d['getRange']()['start']);}else'remove-text'!==_0x19bb9d['type']&&'remove-only'!==_0x19bb9d['type']||_0x5c28f1['deleteContent'](_0x5c28f1['createSelection'](_0x215b6d['getRange']()));_0x79a2c9['removeMarker'](_0x19bb9d['id']),this['_markers']['delete'](_0x19bb9d['id']);}}});}['rejectChange'](_0x330ade){const _0x26ee25=et(this['context']),_0x18ad25=this['_getMarkersDataForGroup'](_0x330ade);_0x26ee25['model']['change'](_0x1a7674=>{for(const _0x296031 of _0x18ad25)_0x1a7674['removeMarker'](_0x296031['id']),this['_markers']['delete'](_0x296031['id']);});}['getEditor'](){return et(this['context']);}['getMarkerElementForChange'](_0x2cd7f7){const _0x3cf1b5=Array['from'](this['_markers']['values']())['filter'](_0x3a2cae=>_0x3a2cae['groupId']===_0x2cd7f7);if(!_0x3cf1b5['length'])return null;const _0x17c21a=0x1===_0x3cf1b5['length']?_0x3cf1b5[0x0]:this['_sortMarkers'](_0x3cf1b5)[0x0],_0x3e4c8c=et(this['context'])['model']['markers']['get'](_0x17c21a['id']);if(!_0x3e4c8c)return null;return{'modelRange':_0x3e4c8c['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x17c21a['id'])};}['getContentElementForChange'](_0x38934d){const _0x159373=Array['from'](this['_markers']['values']())['filter'](_0xa11bcc=>_0xa11bcc['groupId']===_0x38934d);if(!_0x159373['length'])return null;const _0x450c4c=0x1===_0x159373['length']?_0x159373[0x0]:this['_sortMarkers'](_0x159373)[0x0],_0x40e976=et(this['context']),_0x5e7d83=_0x40e976['model']['markers']['get'](_0x450c4c['id']);if(!_0x5e7d83)return null;const _0x404411=_0x5e7d83['getRange'](),_0x355896=_0x40e976['editing']['view']['getDomRoot']();if(!_0x355896||!_0x404411)return null;let _0x5cc039=_0x404411['start']['parent'];for(;_0x5cc039['parent']&&'$root'!==_0x5cc039['parent']['name'];)_0x5cc039=_0x5cc039['parent'];if(!_0x5cc039||!_0x5cc039['name'])return null;const _0x2a72e6=_0x355896['querySelector']('[data-marker-id=\x22'+_0x450c4c['id']+'\x22]');if(!_0x2a72e6)return null;let _0x4da2d9=null;_0x40e976['model']['change'](_0x1e8cc5=>{_0x4da2d9=_0x1e8cc5['createDocumentFragment'](),_0x1e8cc5['append'](_0x5cc039['_clone'](!0x0),_0x4da2d9);});const _0x556d4c=_0x40e976['data']['toView'](_0x4da2d9)['getChild'](0x0);return _0x2a72e6['closest'](_0x556d4c['name']);}['reactivateMarkers'](_0x932952){const _0x5c0fee=this['_getMarkersDataForGroup'](_0x932952);if(!_0x5c0fee['length'])return;const _0xd6e9c0=Array['from'](this['_activeMarkers'])['sort'](),_0x3803db=Array['from'](new Set(_0x5c0fee['map'](_0x34cbf8=>_0x34cbf8['id'])))['sort']();_0xd6e9c0['join']('|')!==_0x3803db['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x932952));}['setMarkersInElementAsActive'](_0x268dfa){const _0x488441=this['_getMarkersDataForGroup'](_0x268dfa);if(!_0x488441['length'])return;const _0x501532=et(this['context']),_0x451cd1=new Set(_0x488441['map'](_0x3a1b3f=>_0x3a1b3f['id'])),_0x2c4165=Array['from'](_0x451cd1['values']())['map'](_0x3cfcb5=>_0x501532['model']['markers']['get'](_0x3cfcb5))['filter'](_0x212c00=>!!_0x212c00);_0x451cd1['forEach'](_0x4b132e=>{this['_activeMarkers']['add'](_0x4b132e);}),_0x501532['model']['change'](()=>{_0x2c4165['forEach'](_0x2da372=>{_0x501532['editing']['reconvertMarker'](_0x2da372);});});}['setAllMarkersAsInactive'](){const _0x38a0d2=Array['from'](this['_activeMarkers']);if(!_0x38a0d2['length'])return;this['_activeMarkers']['clear']();const _0x208c87=et(this['context']),_0xe7a003=_0x38a0d2['map'](_0x23d26f=>_0x208c87['model']['markers']['get'](_0x23d26f))['filter'](_0x26e53b=>!!_0x26e53b);_0x208c87['model']['change'](()=>{_0xe7a003['forEach'](_0x2509fe=>{_0x208c87['editing']['reconvertMarker'](_0x2509fe);});});}['_getPositionLimitingRange'](_0x2f07fe,_0x2bad22,_0x17489d='outside'){if(!_0x2f07fe)return null;let _0x4c7b8c=_0x2f07fe['parent'];for(;_0x4c7b8c&&_0x4c7b8c['parent']&&'$root'!==_0x4c7b8c['parent']['name']&&!_0x2bad22['model']['schema']['isLimit'](_0x4c7b8c)&&!_0x2bad22['model']['schema']['isBlock'](_0x4c7b8c);)_0x4c7b8c=_0x4c7b8c['parent'];if(!_0x4c7b8c||!_0x4c7b8c['name']||'$root'===_0x4c7b8c['name'])return null;let _0x5cfb04=null;return _0x2bad22['model']['change'](_0x18107e=>{_0x5cfb04='inside'===_0x17489d?_0x18107e['createRangeIn'](_0x4c7b8c):_0x18107e['createRangeOn'](_0x4c7b8c);}),_0x5cfb04;}['_validateMarkers'](_0x3bfa4c,_0x56bccc){const _0x1419e5=Array['from'](this['_markers']['keys']()),_0x56a6b4=new Map();for(const _0x172575 of _0x1419e5){const _0x11f317=_0x3bfa4c['model']['markers']['get'](_0x172575);if(!_0x11f317)continue;const _0x1cff56=_0x11f317['getStart']()['path'][0x0];_0x56a6b4['has'](_0x1cff56)||_0x56a6b4['set'](_0x1cff56,[]),_0x56a6b4['get'](_0x1cff56)['push'](_0x11f317);}const _0x514176=new Set();for(const _0x5d1a92 of _0x3bfa4c['model']['document']['differ']['getChanges']()){let _0x3b4c4a=-0x1,_0xc7d444=null;if('insert'===_0x5d1a92['type'])_0xc7d444=new _0x561be6(_0x5d1a92['position'],_0x5d1a92['position']['getShiftedBy'](_0x5d1a92['length'])),_0x3b4c4a=_0x5d1a92['position']['path'][0x0];else{if('remove'!==_0x5d1a92['type'])continue;_0xc7d444=new _0x561be6(_0x5d1a92['position']),_0x3b4c4a=_0x5d1a92['position']['path'][0x0];}const _0x4c15b8=_0x56a6b4['get'](_0x3b4c4a)||[];if(_0x4c15b8['length']){for(const _0x42d45f of _0x4c15b8)if(_0xc7d444['root']['rootName']===_0x42d45f['getRange']()['root']['rootName']&&('insert'!==_0x5d1a92['type']||!_0xc7d444['containsRange'](_0x42d45f['getRange']()))&&(_0xc7d444['isIntersecting'](_0x42d45f['getRange']())||_0xc7d444['start']['isTouching'](_0x42d45f['getRange']()['end'])||_0xc7d444['end']['isTouching'](_0x42d45f['getRange']()['start']))){const _0x30b477=this['_parseMarkerName'](_0x42d45f['name']);Array['from'](this['_markers']['values']())['filter'](_0x4fa1d2=>_0x4fa1d2['groupId']===_0x30b477['groupId'])['forEach'](_0x1ec88b=>_0x514176['add'](_0x1ec88b['id']));}}}if(_0x514176['size']){for(const _0x1b5f7e of _0x514176)_0x56bccc['removeMarker'](_0x1b5f7e);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x6c2cbe){for(const {name:_0x30a16b,data:_0x1d518c}of _0x6c2cbe['model']['document']['differ']['getChangedMarkers']()){if(!_0x30a16b['startsWith'](fe))continue;const _0x26c419=_0x1d518c['oldRange'],_0x49cce6=_0x1d518c['newRange'],_0x2aadaa=_0x26c419&&'$graveyard'===_0x26c419['root']['rootName'],_0x475a90=_0x49cce6&&'$graveyard'===_0x49cce6['root']['rootName'];if(_0x2aadaa&&_0x475a90)continue;const _0x334bd6=this['_parseMarkerName'](_0x30a16b);this['_markers']['get'](_0x30a16b)&&(_0x475a90||!_0x49cce6?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x30a16b,'changeId':_0x334bd6['groupId']}):_0x2aadaa&&_0x49cce6&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x30a16b,'changeId':_0x334bd6['groupId']}));}}['_parseMarkerName'](_0x3d1ea1){const _0x3d7ace=_0x3d1ea1['split'](':'),_0x2d1cc3=(_0x3d7ace[0x1]||'')['split']('_');return{'prefix':_0x3d7ace[0x0],'groupId':_0x2d1cc3[0x0],'suffix':_0x2d1cc3[0x1]};}['_translateOperationToEditorContent'](_0x4e432e,_0x58031e,_0x436c46){if('insert'===_0x4e432e['type']){const _0x5914c1=_0x4e432e;return new _0x147757(this['_changePosition'](_0x58031e['concat'](_0x5914c1['position']['offset']),_0x436c46),_0x5914c1['nodes'],_0x5914c1['baseVersion']);}if('marker'===_0x4e432e['type']&&_0x4e432e['name']['startsWith']('$markedRemove')){const _0x402572=_0x4e432e;return new _0x2b53fb(_0x402572['name'],_0x402572['oldRange'],this['_changeRange'](_0x402572['newRange'],_0x58031e['concat'](_0x402572['newRange']['start']['offset']),_0x58031e['concat'](_0x402572['newRange']['end']['offset']),_0x436c46),_0x402572['_markers'],_0x402572['affectsData'],_0x402572['baseVersion']);}return _0x4e432e;}['_groupAdjacentOperations'](_0x29c23c){if(!_0x29c23c['length'])return[];const _0x3b5ee5=[];let _0xc40779=0x0,_0xd3a3d3=0x0,_0x529901=[];for(let _0x1119a8=0x0;_0x1119a8<=_0x29c23c['length'];_0x1119a8++){const _0x487bb2=_0x29c23c[_0x1119a8],_0x43ffd0=_0x29c23c[_0x1119a8-0x1];!_0x487bb2||_0x43ffd0&&!this['_getOperationEnd'](_0x43ffd0)['isTouching'](this['_getOperationStart'](_0x487bb2))?(_0x3b5ee5['push']({'operations':_0x529901,'operationsIsolated':_0x529901['map'](_0x13d8f1=>this['_shiftOperation'](_0x13d8f1['clone'](),-_0xd3a3d3)),'groupOffset':_0xc40779}),_0x529901=_0x487bb2?[_0x487bb2]:[],_0xd3a3d3+=_0xc40779,_0xc40779=0x0):_0x529901['push'](_0x487bb2),_0x487bb2&&'insert'===_0x487bb2['type']&&(_0xc40779+=_0x487bb2['howMany']);}return _0x3b5ee5;}['_findAdjacentContextDistance'](_0x537861,_0x347970,_0x17b201,_0x36b6fc=0x1){const _0x395ed0=new _0x266ef3({'startPosition':_0x537861,'direction':_0x347970});let _0xed3372=0x0;for(let _0x53f4c5=0x0;_0x53f4c5<_0x36b6fc;_0x53f4c5++){let _0x543dc2=0x0,_0x5de01b=!0x1,_0x46a281='forward'===_0x347970?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x45a382}of _0x395ed0)if(_0x45a382['is']('$textProxy')){const _0x37a0d8=_0x46a281['exec'](_0x45a382['data']);if(_0x37a0d8&&_0x37a0d8['length']){if(_0x543dc2+='forward'===_0x347970?_0x37a0d8['index']+_0x37a0d8[0x0]['length']:_0x45a382['data']['length']-_0x37a0d8['index'],_0x37a0d8[0x0]['length']!==_0x45a382['data']['length'])break;_0x5de01b=!0x0,_0x46a281='forward'===_0x347970?/^\w+/:/\w+$/;}else{if(_0x5de01b)break;_0x543dc2+=_0x45a382['offsetSize'];}}else{if(_0x45a382['is']('element')){_0x17b201['isInline'](_0x45a382)&&!_0x5de01b&&(_0x543dc2+=0x1);break;}}_0xed3372+=_0x543dc2,_0x395ed0['jumpTo'](_0x537861['getShiftedBy']('forward'===_0x347970?_0xed3372:-_0xed3372));}return _0xed3372;}['_getChangeContext'](_0xc5bab5,_0x8f3f3f){const _0xdc3eac=et(this['context'])['model']['schema'],_0x5be1d7=this['_findAdjacentContextDistance'](_0xc5bab5,'backward',_0xdc3eac,0x6),_0x4971a1=this['_findAdjacentContextDistance'](_0x8f3f3f,'forward',_0xdc3eac,0x6),_0x3f68f1=_0xc5bab5['getShiftedBy'](-_0x5be1d7),_0x152f79=_0x8f3f3f['getShiftedBy'](_0x4971a1);return{'start':_0x3f68f1,'end':_0x152f79,'hasContentBefore':!_0x3f68f1['isAtStart'],'hasContentAfter':!_0x152f79['isAtEnd']};}['_insertMarkers'](_0xf015d1){const _0x5e3fb3=this['context']['plugins']['get']('AIEditing'),_0x2c5950=new Set();et(this['context'])['model']['change'](_0xd78fe4=>{for(const _0x5b6377 of _0xf015d1){const _0x5c5eee=''+fe+_0x5b6377['type']+':'+_0x5b6377['groupId']+'_'+_0x5e3fb3['_nextDataId'](_0x2c5950);this['_markers']['set'](_0x5c5eee,{'id':_0x5c5eee,'groupId':_0x5b6377['groupId'],'type':_0x5b6377['type'],'content':_0x5b6377['content']}),_0xd78fe4['addMarker'](_0x5c5eee,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xd78fe4['createRange'](_0x5b6377['start'],_0x5b6377['end'])});}});}['_createGetContextFn'](_0x206ddc,_0x56b23e,_0x1c8f4f){let _0x7b9de='';return()=>{if(!_0x7b9de){const _0x22bbb1=_0x56b23e['toView'](_0x206ddc,{'showSuggestionHighlights':!0x0});let _0x87f4c=_0x22bbb1['getChild'](0x0);if(_0x87f4c['is']('containerElement')||(_0x87f4c=_0x22bbb1),!_0x87f4c)return'';let _0x378deb=!0x1;const _0x5c2c9b=[];for(const _0x1ea4d4 of _0x87f4c['getChildren']())_0x1ea4d4['is']('element','span')&&_0x1ea4d4['hasClass']('ck-ai_review-marker_context-end')&&(_0x378deb=!0x1),_0x378deb&&_0x5c2c9b['push'](_0x1ea4d4),_0x1ea4d4['is']('element','span')&&_0x1ea4d4['hasClass']('ck-ai_review-marker_context-start')&&(_0x378deb=!0x0);_0x87f4c['_removeChildren'](0x0,_0x87f4c['childCount']),_0x1c8f4f?.['ellipsisBefore']&&_0x87f4c['_appendChild']('…'),_0x87f4c['_appendChild'](_0x5c2c9b),_0x1c8f4f?.['ellipsisAfter']&&_0x87f4c['_appendChild']('…');const _0x27922a=_0x56b23e['htmlProcessor']['domConverter']['viewToDom'](_0x22bbb1),_0x34765a=_0x56b23e['htmlProcessor']['htmlWriter']['getHtml'](_0x27922a);_0x7b9de=_0x34765a;}return _0x7b9de;};}['_createGetContentFn'](_0x564ac3,_0x31d211){let _0x5b6a78='';return()=>(_0x5b6a78||(_0x5b6a78=_0x31d211['stringify'](_0x564ac3,{'showSuggestionHighlights':!0x0})),_0x5b6a78);}['_createGetContentUsingDataIdFn'](_0x2685cf,_0x2e85a8,_0x262c85){let _0x5afafb='';return()=>{if(!_0x5afafb){const _0x3b74f9=_0x262c85['toView'](new _0x53b4ba(_0x2685cf)),_0x29dbdd=_0x262c85['htmlProcessor']['domConverter']['viewToDom'](_0x3b74f9)['querySelector']('[data-id=\x22'+_0x2e85a8+'\x22]');_0x5afafb=_0x29dbdd?.['outerHTML']||'';}return _0x5afafb;};}['_findMarkerElement'](_0x51858f,_0x5bdfea=0x5){let _0x9ecccf=_0x51858f,_0x5f5117=null;for(let _0x1a4aa4=0x0;_0x1a4aa4<_0x5bdfea&&_0x9ecccf;_0x1a4aa4++){if(!_0x9ecccf['className']){_0x9ecccf=_0x9ecccf['parentElement'];continue;}if(!(''+_0x9ecccf['className'])['includes']('ck-ai_review-marker_')){_0x9ecccf=_0x9ecccf['parentElement'];continue;}if(!_0x9ecccf['getAttribute']('data-marker-id'))break;_0x5f5117=_0x9ecccf;break;}return _0x5f5117;}['_findMarkerElementById'](_0x5c0208){const _0x26ece9=et(this['context']),_0x45fb2d=_0x26ece9['model']['markers']['get'](_0x5c0208);return _0x45fb2d?_0x25a0d4(_0x26ece9['editing'],_0x45fb2d):null;}['_getMarkersDataForGroup'](_0x2e508b){return Array['from'](this['_markers']['values']())['filter'](_0x24a791=>_0x24a791['groupId']===_0x2e508b);}['_getOperationStart'](_0x581a08){return'insert'===_0x581a08['type']?_0x581a08['position']:_0x581a08['newRange']['start'];}['_getOperationEnd'](_0x3d1ae5,_0x347aca=!0x1){return'insert'===_0x3d1ae5['type']?_0x347aca?_0x3d1ae5['position']:_0x3d1ae5['position']['getShiftedBy'](_0x3d1ae5['howMany']):_0x3d1ae5['newRange']['end'];}['_shiftOperation'](_0x475c9e,_0x2ef24e){return'insert'===_0x475c9e['type']?_0x475c9e['position']=_0x475c9e['position']['getShiftedBy'](_0x2ef24e):'marker'===_0x475c9e['type']&&_0x475c9e['newRange']&&(_0x475c9e['newRange']=new _0x561be6(_0x475c9e['newRange']['start']['getShiftedBy'](_0x2ef24e),_0x475c9e['newRange']['end']['getShiftedBy'](_0x2ef24e))),_0x475c9e;}['_changeOperationOwnerDocument'](_0x24edb7,_0x4c3791){'insert'===_0x24edb7['type']?_0x24edb7['position']=this['_changePositionOwnerDocument'](_0x24edb7['position'],_0x4c3791):'marker'===_0x24edb7['type']&&_0x24edb7['newRange']&&(_0x24edb7['newRange']=this['_changeRangeOwnerDocument'](_0x24edb7['newRange'],_0x4c3791));}['_changePositionOwnerDocument'](_0x5dd961,_0xef2ef){return new _0x18c733(_0xef2ef,_0x5dd961['path']);}['_changeRangeOwnerDocument'](_0x9e7580,_0x4beb52){return new _0x561be6(this['_changePositionOwnerDocument'](_0x9e7580['start'],_0x4beb52),this['_changePositionOwnerDocument'](_0x9e7580['end'],_0x4beb52));}['_changePosition'](_0x376d33,_0x52d4c){return new _0x18c733(_0x52d4c,[..._0x376d33]);}['_changeRange'](_0x281a70,_0x186696,_0x2920dc,_0x22f386){return new _0x561be6(this['_changePosition'](_0x186696,_0x22f386),this['_changePosition'](_0x2920dc,_0x22f386));}['_sortMarkers'](_0x22d6e3){const _0x1426ed=_0xb041ab=>{switch(_0xb041ab){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x22d6e3['sort']((_0x38849c,_0x25f447)=>_0x1426ed(_0x38849c['type'])-_0x1426ed(_0x25f447['type']));}['_hasSameTopLevelElement'](_0x4ff00e,_0x509c98){const _0x181451=_0x4ff00e['getChild'](0x0),_0x3e64c4=_0x509c98['getChild'](0x0);return!(!_0x181451||!_0x3e64c4)&&((!_0x181451['is']('element')||!_0x3e64c4['is']('element')||_0x181451['name']===_0x3e64c4['name'])&&!(_0x181451['is']('element')&&!_0x3e64c4['is']('element')||!_0x181451['is']('element')&&_0x3e64c4['is']('element')));}['_haveSingleTopLevelElement'](_0x5671c2){return 0x1===_0x5671c2['childCount'];}['_haveOnlyInlineContent'](_0x1131f6,_0x1781e5){for(const _0x335e9d of _0x1131f6['getChildren']())if(_0x335e9d['is']('element')&&!_0x1781e5['isInline'](_0x335e9d))return!0x1;return!0x0;}['_upsertDataId'](_0x210e5a,_0xf4fc90){let _0x44d100=_0x210e5a['getAttribute'](Et);return _0x44d100||(_0x44d100=_0xf4fc90(),_0x210e5a['_setAttribute'](Et,_0x44d100)),_0x44d100;}}class Xs extends _0x204e9f(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x3d8739,contentNew:_0x58cedb,contentInitial:_0x2a85d7,documentVersion:_0x466d15}){super(),this['id']=_0x3d8739,this['contentNew']=_0x58cedb,this['contentInitial']=_0x2a85d7,this['documentVersion']=_0x466d15;}}class Ys extends ts(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x55c50d,_0x1535e7,_0x2a6976){super(),this['id']=_0x55c50d,this['parent']=_0x2a6976,this['_data']=_0x1535e7,this['set']('isActivated',!0x1),this['set']('isRated',!0x1),this['set']('status','pending'),this['on']('change:status',()=>{'pending'!==this['status']&&this['isActivated']&&(this['isActivated']=!0x1);});}get['contentDiffed'](){return this['_data']['context']();}get['operations'](){return this['_data']['operations'];}get['operationsIsolated'](){return this['_data']['operationsIsolated'];}}class Zs extends ts(){['id']=_0x2e2dc8();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x14e3aa,_0x5a9770,_0x63b79d,_0x787fef,_0x3b0c92){super(),this['_sourceCheck']=_0x5a9770,this['_documentData']=_0x14e3aa,this['_aiConnector']=_0x63b79d,this['_reviewParams']=_0x787fef,this['_reviewArgs']=_0x3b0c92,this['on']('change:status',(_0x229af4,_0x341de3,_0x1e14cf)=>{'aborted'==_0x1e14cf&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x1e14cf,'run':this,'error':this['_currentError']});}),this['set']('status','initialized');}get['documentData'](){return this['_documentData'];}get['processedResultsCount'](){return this['_results']['size'];}get['title'](){return this['_sourceCheck']['title'];}get['subTitle'](){return'';}get['reviewName'](){return this['_sourceCheck']['id'];}get['hasModifications'](){return!this['_changes']['every'](_0x16005e=>'pending'===_0x16005e['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x544c35){this['_documentData']=_0x544c35;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x3ec28b=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x5e83d5 of _0x3ec28b)'unmodified'!==_0x5e83d5['data']['operation']&&('error'!==_0x5e83d5['data']['operation']?'review-metadata'!==_0x5e83d5['event']?this['_addReviewCheckResult'](_0x5e83d5['data']['dataId'],_0x5e83d5['data']['textDelta']):this['callId']=_0x5e83d5['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']||0x0===this['_changes']['length']?this['status']='unmodified':this['status']='ready');}catch(_0x50a737){this['_currentError']=_0x50a737,_0x50a737 instanceof Error&&_0x50a737['message']['includes']('ai-request-aborted')?this['status']='aborted':this['status']='error-general';}finally{this['_activeRequest']=null;}}async['restart'](){this['_results']['clear'](),this['_changes']['length']=0x0,this['_currentError']=void 0x0,await this['start']();}['addResultChanges'](_0x434731,_0x22412a){const _0x1b2fde=this['_results']['get'](_0x434731);if(!_0x1b2fde)return;if(0x0===_0x22412a['length'])return;const _0x12b78b=[];_0x22412a['forEach']((_0x4d1e9d,_0x52dc49)=>{const _0x484c26=new Ys(_0x1b2fde['id']+'-'+_0x52dc49,_0x4d1e9d,_0x1b2fde);_0x484c26['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x484c26,'status':_0x484c26['status']});}),_0x484c26['on']('change:isActivated',()=>{_0x484c26['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x484c26}):this['fire']('reviewCheckResultDeactivated',{'change':_0x484c26});}),this['_changes']['push'](_0x484c26),_0x12b78b['push'](_0x484c26);}),this['fire']('reviewCheckResultReady',{'changes':_0x12b78b,'result':_0x1b2fde,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x187b22){const _0x535aa1=this['_changes']['find'](_0x3d0529=>_0x3d0529['id']===_0x187b22);return!(!_0x535aa1||'pending'!==_0x535aa1['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x1b83d9=>!0x0===_0x1b83d9['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x34d72d=>'pending'===_0x34d72d['status']);}['getChangeById'](_0x1d60bd){return this['_changes']['find'](_0x170a50=>_0x170a50['id']===_0x1d60bd);}['markAllChangesAsAccepted'](){for(const _0x901a00 of this['_changes'])'pending'===_0x901a00['status']&&(_0x901a00['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0xfecaf){const _0x1a9944=this['_changes']['find'](_0x291a6c=>_0x291a6c['id']===_0xfecaf);_0x1a9944&&'pending'===_0x1a9944['status']&&(_0x1a9944['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0xe15333){const _0x3bef6c=this['_changes']['find'](_0x2a028c=>_0x2a028c['id']===_0xe15333);_0x3bef6c&&'pending'===_0x3bef6c['status']&&(_0x3bef6c['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x578026){const _0xd4a25d=this['_changes']['find'](_0x4c0a10=>_0x4c0a10['id']===_0x578026);_0xd4a25d&&'pending'===_0xd4a25d['status']&&(_0xd4a25d['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x51abae){const _0x4c5b4f=this['_changes']['find'](_0x231ec9=>_0x231ec9['id']===_0x51abae);_0x4c5b4f&&'outdated'===_0x4c5b4f['status']&&(_0x4c5b4f['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x147963){this['_changes']['filter'](_0x2c5404=>_0x2c5404['isActivated']&&_0x2c5404['id']!==_0x147963)['forEach'](_0x5f2f04=>{_0x5f2f04['isActivated']=!0x1;});const _0x188c24=this['_changes']['find'](_0x43adfe=>_0x43adfe['id']===_0x147963);_0x188c24&&'pending'===_0x188c24['status']&&(_0x188c24['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x61543d=>_0x61543d['isActivated'])['forEach'](_0x1a4b89=>{_0x1a4b89['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x473de4){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x32095e;if(_0x473de4){const _0x2c4adc=this['_changes']['find'](_0x26c955=>_0x26c955['id']===_0x473de4);if(_0x2c4adc&&_0x2c4adc['isRated'])return;_0x2c4adc&&(_0x32095e=_0x2c4adc['parent']['id'],_0x2c4adc['isRated']=!0x0);}const _0x18b962={'positiveCount':this['_changes']['filter'](_0x54d1dc=>'accepted'===_0x54d1dc['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x18b962,this['callId'],_0x32095e);}['_addReviewCheckResult'](_0x30edef,_0x13abe0){const _0xf5758f=this['_documentData']['elements']['get'](_0x30edef);if(!_0xf5758f)return;const _0x1aad8f=_0xf5758f['getContent']();if(_0x1aad8f===_0x13abe0)return;const _0x3f31a7=new Xs({'id':_0x30edef,'contentInitial':_0x1aad8f,'contentNew':_0x13abe0,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x3f31a7['id'],_0x3f31a7),this['fire']('reviewCheckResultAdded',{'result':_0x3f31a7,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x41e505=>'pending'===_0x41e505['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x53f148=>'pending'===_0x53f148['status'])['length']&&(this['status']='finished'));}}class si extends Zs{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x1e31db=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x56206b=0x0;_0x56206b<this['_reviewParams']['length'];_0x56206b++){if(!this['_reviewParams'][_0x56206b]||!this['_sourceCheck']['options'][_0x56206b])continue;const _0x489e21=this['_sourceCheck']['options'][_0x56206b],_0x25715c=_0x489e21['data']?.['find'](_0x361430=>_0x361430['id']===this['_reviewParams'][_0x56206b]);_0x25715c&&_0x1e31db['push'](_0x25715c['label']);}return _0x1e31db['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x471556,_0x52734d,_0x51e58c){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x52734d,_0x471556,_0x51e58c);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class ve extends _0x118815{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[S];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_initRequiredPlugins'](),this['_aiReviewCheckList']=await this['_getChecksList'](),this['listenTo'](this['_aiReviewCoreUi'],'getReviewCheckList',()=>{this['_aiReviewCoreUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewCoreUi'],'runReviewCheck',async(_0x3f0835,_0x1ae433)=>{const _0x1f8242=this['_aiReviewCheckList']['getCheckById'](_0x1ae433['id']);if(_0x1f8242){this['_onReviewCheckRun'](_0x1ae433),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x1ae433,_0x1f8242),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x3cf637,_0x4c00e8)=>{switch(_0x4c00e8['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x4c00e8);break;case'finished':this['_onCheckRunFinished']();break;case'ready':this['_aiReviewCoreUi']['showActionsWhenResultIsReady']();break;case'unmodified':this['_aiReviewCoreUi']['showNoChangesView']();break;case'error-general':this['_aiReviewCoreUi']['showGeneralResultsErrorView'](),this['_logError'](new _0x542443('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new _0x542443('ai-review-mode-check-run-chunk-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'aborted':this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewRunLeave'](!0x0);}'ready'!==_0x4c00e8['status']&&'error-chunk'!==_0x4c00e8['status']&&'error-general'!==_0x4c00e8['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x531911,_0x5b0f66)=>{if(!this['_currentReviewCheckRun'])throw new _0x542443('ai-review-mode-no-current-check-run',this);const _0x1c4ec0=this['_diffContent'](_0x5b0f66['result']['contentInitial'],_0x5b0f66['result']['contentNew']);_0x5b0f66['source']['addResultChanges'](_0x5b0f66['result']['id'],_0x1c4ec0);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x313aec,_0x8fb602)=>{for(const _0x471217 of _0x8fb602['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x471217);this['_markChangePositionInEditorContent'](_0x8fb602['changes'],_0x8fb602['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x188de6,_0x4071f3)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x4071f3['change']['id'],_0x4071f3['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x2f3f76,_0x5acc73)=>{this['_onReviewCheckResultActivated'](_0x5acc73);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x59a187){_0x59a187 instanceof Error&&_0x59a187['message']['includes']('ai-request-aborted')||(_0x59a187 instanceof _0x542443?this['_logError'](_0x59a187):this['_logError'](new _0x542443('ai-review-mode-check-run-failed',this,void 0x0,_0x59a187)));}}else this['_logError'](new _0x542443('ai-review-mode-source-check-not-found',this,{'checkId':_0x1ae433['id']}));}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReview',()=>{this['_onReviewRunLeave']();}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReviewCoreResultList',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewCoreUi'],'finishReview',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x5c4e14=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x5c4e14['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x5c4e14['map'](_0x5cec99=>_0x5cec99['id']));const _0x328bd9=this['_currentReviewCheckRun'];_0x328bd9['markAllChangesAsAccepted'](),_0x328bd9['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x59adfc,_0x21f298)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x21f298['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x21f298['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x21f298['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x21f298['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x19fcdf,_0x589aed)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x589aed['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x589aed['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x589aed['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x589aed['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&(this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_currentReviewCheckRun']['updateDocumentData'](this['_aiReviewCoreEditing']['getDocumentData']()),await this['_currentReviewCheckRun']['restart']());}),this['listenTo'](this['_aiReviewCoreUi'],'activateChange',(_0x3761f2,_0x233673)=>{this['_onActivateChange'](_0x233673);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x2389b9,_0x1732f1)=>{this['_onDeactivateChange'](_0x1732f1);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x184fec,_0x14cf94)=>{this['_onChangeMarkerClicked'](_0x184fec,_0x14cf94);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x265b91,_0x2ff552)=>{this['_onChangeMarkerHovered'](_0x265b91,_0x2ff552);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x40f4ba,_0x58a426)=>{this['_onChangeMarkerRemoved'](_0x40f4ba,_0x58a426);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x5d7f28,_0x462350)=>{this['_onChangeMarkerRestored'](_0x5d7f28,_0x462350);});}['_createReviewCheckRun'](_0x4c2189,_0x570d32){return new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0x570d32,this['_aiConnector'],_0x4c2189['params'],_0x4c2189['args']);}['_onChangeMarkerRemoved'](_0x4a2c9a,_0x5e39df){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x5e39df['changeId']);}['_onChangeMarkerRestored'](_0x1ce50f,_0x5eea4a){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x5eea4a['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x47fcd1=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x47fcd1&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x56a796=this['_aiReviewCoreEditing']['getEditor']();_0x56a796&&_0x56a796['editing']['view']['change'](_0x2b1113=>{const _0x5e0dfa=_0x56a796['editing']['view']['document']['getRoot']();_0x2b1113['removeClass']('ck-ai_review-diff',_0x5e0dfa),_0x2b1113['removeClass']('ck-ai_review-highlights',_0x5e0dfa),_0x2b1113['removeClass']('ck-ai-translate-mode-content',_0x5e0dfa);});}['_getTranslationWithDefault'](_0x54fc2f,_0x304554){const _0x40bb5c=i(this['context']['locale'],_0x54fc2f);return _0x40bb5c===_0x54fc2f?_0x304554:_0x40bb5c;}['_logError'](_0x6a647a,_0x3e74dd=!0x1){Ct(_0x6a647a['message']),_0x3e74dd||(_0x6a647a['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x570504){if('content'===this['_changeActivationSource']){const _0x2fbafe=this['_aiReviewCoreUi']['getChangeElement'](_0x570504);_0x2fbafe&&_0x88b018(_0x2fbafe['closest']('.ck-ai_review__check-run-result')||_0x2fbafe);}else{if('panel'===this['_changeActivationSource']){const _0x56f8e5=this['_getChangeContentElement'](_0x570504);if(!_0x56f8e5)return;st({'target':_0x56f8e5,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}const we=[{'id':'custom','commandId':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','commandId':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','commandId':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','commandId':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'length','commandId':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'tone','commandId':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]}];class Ws{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x4ffd60){this['id']=_0x4ffd60['id'],this['commandId']=_0x4ffd60['commandId'],this['title']=_0x4ffd60['title'],this['description']=_0x4ffd60['description'],this['isParameterized']=_0x4ffd60['isParameterized'],this['useArgs']=_0x4ffd60['useArgs'],this['options']=_0x4ffd60['options'],this['args']=_0x4ffd60['args'];}}class vo extends ts(){['_checks']=[];['setupChecks'](_0x46f522){this['_checks']=_0x46f522['map'](_0x2a69f4=>new Ws(_0x2a69f4));}get['checks'](){return this['_checks'];}['getCheckById'](_0x517773){return this['checks']['find'](_0x18154a=>_0x18154a['id']===_0x517773);}['removeCheckById'](_0x3e2684){this['_checks']=this['_checks']['filter'](_0x1ff23b=>_0x1ff23b['id']!==_0x3e2684);}}class ke extends Ws{['_models']=[];['_defaultModel']=null;constructor(_0x3ac5c6,_0x148471,_0xc372e8){super(_0x3ac5c6),this['_models']=_0x148471,this['_defaultModel']=_0xc372e8;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class Ie extends Ws{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x459677,_0x13b025,_0x3b246e){super(_0x459677),this['prompt']=_0x459677['prompt'],this['model']=_0x459677['model'],this['model']?this['_defaultModel']=_0x13b025['find'](_0x345530=>_0x345530['id']===this['model'])||null:this['_defaultModel']=_0x3b246e;}get['defaultModel'](){return this['_defaultModel'];}}class _e extends vo{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x34750e,_0x138646,_0x22c2a6){super(),this['_allModels']=_0x34750e,this['_recommendedModels']=_0x138646,this['_defaultModel']=_0x22c2a6;}['setupChecks'](_0x405d4b){this['_checks']=_0x405d4b['map'](_0x375703=>!0x0===_0x375703['isExtra']?new Ie(_0x375703,this['_allModels'],this['_defaultModel']):'custom'===_0x375703['id']?new ke(_0x375703,this['_recommendedModels'],this['_defaultModel']):new Ws(_0x375703));}}class Ce extends Zs{['_prompt'];['_model'];constructor(_0x82895b,_0x1addf4,_0x3ab76d,_0x2fb004,_0x4068cf){super(_0x3ab76d,_0x2fb004,_0x4068cf),this['_prompt']=_0x82895b,this['_model']=_0x1addf4;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x1f116c,_0x4cb7b4,_0x51c964){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x4cb7b4,_0x1f116c,_0x51c964);}}class Re extends Ce{get['subTitle'](){return'';}set['prompt'](_0x17da1d){this['_prompt']=_0x17da1d;}set['model'](_0x495629){this['_model']=_0x495629;}}class pe extends ve{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x14537a){super(_0x14537a),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',we['map'](_0x59179e=>_0x59179e['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x53ace2,_0x3d7732)=>{this['_isDiffOn']=_0x3d7732['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x3ed687,_0x4246df){return _0x3ed687['isCustom']?new Ce(_0x3ed687['args']['prompt'],_0x3ed687['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x4246df,this['_aiConnector']):_0x4246df['isExtra']?new Re(_0x4246df['prompt'],_0x4246df['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x4246df,this['_aiConnector']):new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0x4246df,this['_aiConnector'],_0x3ed687['params'],_0x3ed687['args']);}['_onReviewCheckResultActivated'](_0x2a682a){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x2a682a['change']['id']),this['_scrollToChange'](_0x2a682a['change']['id']);const _0x4c9dc9=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x2a682a['change']['id']);if(!_0x4c9dc9)return;const _0x4febbd=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x2a682a['change'],()=>_0x4c9dc9['getElement'](),void 0x0,'click',_0x4febbd?.['editing']?.['view']?.['getDomRoot'](),_0x4febbd?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x2a682a['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x17c958){this['_currentReviewCheckRun']&&'click'===_0x17c958['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x17c958['id']));}['_onDeactivateChange'](_0xe185a0){this['_currentReviewCheckRun']&&'balloon'===_0xe185a0['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x5dee00,_0x4d5360){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x4d5360['changeId']);const _0x25bbca=this['_currentReviewCheckRun']['getChangeById'](_0x4d5360['changeId']);if(!_0x25bbca)return;const _0xe2f031=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x25bbca,_0x4d5360['markerElement'],_0x4d5360['domEvent'],'click',_0xe2f031?.['editing']?.['view']?.['getDomRoot'](),_0xe2f031?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x12378a,_0x4fe888){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x1c662e=this['_currentReviewCheckRun']['getChangeById'](_0x4fe888['changeId']);if(!_0x1c662e)return;const _0x4c269f=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x1c662e,_0x4fe888['markerElement'],_0x4fe888['domEvent'],'hover',_0x4c269f?.['editing']?.['view']?.['getDomRoot'](),_0x4c269f?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x503b55){const _0x2500b4=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x503b55);return _0x2500b4?_0x2500b4['getElement']():null;}['_markChangePositionInEditorContent'](_0x1fff22,_0x4947b2){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x1fff22,_0x4947b2);}['_diffContent'](_0xce9b17,_0x254c3f){return this['_aiReviewCoreEditing']['diffContent'](_0xce9b17,_0x254c3f);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x292d2a){const _0x23dffd=this['_aiReviewCoreEditing']['getEditor']();_0x292d2a?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x23dffd&&_0x23dffd['editing']['view']['change'](_0x3d1a66=>{const _0x3bb844=_0x23dffd['editing']['view']['document']['getRoot']();for(const _0x389aa9 of _0x3bb844['getClassNames']())_0x389aa9['startsWith']('ck-ai_review-')&&_0x3d1a66['removeClass'](_0x389aa9,_0x3bb844);_0x3d1a66['addClass'](_0x292d2a?'ck-ai_review-diff':'ck-ai_review-highlights',_0x3bb844);});}async['_getChecksList'](){const _0xf53245=[...we,...this['_getExtraChecks']()],_0x3e9584=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x3e9584,_0xf53245);let _0x115393=_0xf53245;this['_hasDefaultAvailableCommands']||(_0x115393=_0x3e9584['map'](_0x5aa92b=>_0xf53245['find'](_0x123460=>_0x123460['id']===_0x5aa92b))['filter'](_0x4cb654=>!!_0x4cb654)),_0x115393=_0x115393['map'](_0x13d841=>_0x13d841['isExtra']?_0x13d841:this['_translateReviewCheck'](_0x13d841));const _0x123ed7=_0x115393['some'](_0x4f4ba6=>_0x4f4ba6['isExtra']||'custom'===_0x4f4ba6['id']);let _0x238d95=[],_0x3e416c=[],_0x5b0990=null;if(_0x123ed7){const _0x20bae3=await this['_getModels']();_0x238d95=_0x20bae3['all'],_0x3e416c=_0x20bae3['recommended'],_0x5b0990=_0x20bae3['default'];}const _0x1abaf7=new _e(_0x238d95,_0x3e416c,_0x5b0990);return _0x1abaf7['setupChecks'](_0x115393),_0x123ed7&&this['_filterChecksWithMissingModel'](_0x1abaf7),_0x1abaf7;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x43e355=>({'id':_0x43e355['id'],'commandId':_0x43e355['id'],'title':_0x43e355['label'],'description':_0x43e355['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x43e355['prompt'],'model':_0x43e355['model']}));}['_logErrorForNonExistentChecks'](_0x5fda74,_0x2d8686){const _0x6b7567=_0x5fda74['filter'](_0x54977=>!_0x2d8686['some'](_0x5ce858=>_0x5ce858['id']===_0x54977));_0x6b7567['length']&&this['_logError'](new _0x542443('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x6b7567['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x5bfc43=new At({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x5bfc43['getAll'](),'recommended':await _0x5bfc43['getAvailableModels'](),'default':await _0x5bfc43['getDefault']()};}catch(_0x36bb8e){return this['_logError'](new _0x542443('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x36bb8e)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x2c9ed3){const _0x2796df='AI_REVIEW_CHECK_'+_0x2c9ed3['id']['toUpperCase']()['replaceAll']('-','_'),_0x1dea25={..._0x2c9ed3,'title':this['_getTranslationWithDefault'](_0x2796df+'_TITLE',_0x2c9ed3['title']),'description':this['_getTranslationWithDefault'](_0x2796df+'_DESCRIPTION',_0x2c9ed3['description'])};return _0x2c9ed3['options']&&(_0x1dea25['options']=_0x2c9ed3['options']['map'](_0x4b2c7f=>({..._0x4b2c7f,'label':this['_getTranslationWithDefault'](_0x2796df+'_OPTIONS_LABEL',_0x4b2c7f['label']||''),'data':_0x4b2c7f['data']?_0x4b2c7f['data']['map'](_0x1ae030=>({..._0x1ae030,'label':this['_getTranslationWithDefault'](_0x2796df+'_OPTIONS_DATA_'+_0x1ae030['id']['toUpperCase'](),_0x1ae030['label'])})):void 0x0}))),_0x1dea25;}['_filterChecksWithMissingModel'](_0x476ef9){const _0x56ebb7=[];_0x476ef9['checks']['forEach'](_0x21a8d3=>{(_0x21a8d3 instanceof Ie&&!_0x21a8d3['defaultModel']||_0x21a8d3 instanceof ke&&!_0x21a8d3['models']['length'])&&_0x56ebb7['push'](_0x21a8d3['id']);}),_0x56ebb7['length']&&_0x56ebb7['forEach'](_0x1f7e50=>{_0x476ef9['removeCheckById'](_0x1f7e50),this['_logError'](new _0x542443('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x1f7e50}),!0x0);});}}class Wa extends _0x118815{static get['requires'](){return[pe,ge,de];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class jr extends Ws{get['apiId'](){return'translate';}}class Pe extends vo{['setupChecks'](_0x5b5e5d){this['_checks']=_0x5b5e5d['map'](_0x332bf6=>new jr(_0x332bf6));}}class Se extends si{['_title'];constructor(_0x30131e,_0x504426,_0x1c33c6,_0x4a831f,_0x44ca0c,_0x36f4d9){super(_0x30131e,_0x504426,_0x1c33c6,_0x44ca0c,_0x36f4d9),this['_title']=_0x4a831f;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class rr extends ve{static get['pluginName'](){return'AITranslateController';}constructor(_0x3f95ea){super(_0x3f95ea),this['context']['config']['define']('ai.translate.languages',[{'label':'English','id':'english'},{'label':'Spanish','id':'spanish'},{'label':'French','id':'french'},{'label':'German','id':'german'},{'label':'Chinese\x20(Simplified)','id':'chinese'},{'label':'Japanese','id':'japanese'},{'label':'Russian','id':'russian'},{'label':'Portuguese','id':'portuguese'},{'label':'Korean','id':'korean'},{'label':'Italian','id':'italian'}]);}['_onCheckRunFinished'](){this['_onReviewRunLeave'](!0x0);}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AITranslateUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x55e61b,_0x36a8c3){return new Se(this['_aiReviewCoreEditing']['getDocumentData'](),_0x36a8c3,this['_aiConnector'],i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x55e61b['params'],_0x55e61b['args']);}['_onReviewCheckResultActivated'](_0x298345){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x298345['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x298345['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x405407){this['_currentReviewCheckRun']&&('hover'===_0x405407['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x405407['id'])),'click'===_0x405407['uiInteraction']&&this['_scrollToChange'](_0x405407['id']));}['_onDeactivateChange'](_0x4c81a0){this['_currentReviewCheckRun']&&'panel'===_0x4c81a0['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x515a8a,_0x2a3543){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x2a3543['changeId']),this['_scrollToChange'](_0x2a3543['changeId']));}['_onChangeMarkerHovered'](_0x1739e1,_0x224ef7){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x224ef7['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x224ef7['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0xf193fd){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0xf193fd);}['_markChangePositionInEditorContent'](_0xefb323,_0x5b866a){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0xefb323,_0x5b866a);}['_diffContent'](_0x3d9e7c,_0x32b61c){return this['_aiReviewCoreEditing']['diffContent'](_0x3d9e7c,_0x32b61c,!0x0);}['_onReviewCheckRun'](){const _0x1fd66c=this['_aiReviewCoreEditing']['getEditor']();_0x1fd66c&&_0x1fd66c['editing']['view']['change'](_0x16a815=>{const _0x1c9b43=_0x1fd66c['editing']['view']['document']['getRoot']();for(const _0x26f24d of _0x1c9b43['getClassNames']())(_0x26f24d['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0x26f24d)&&_0x16a815['removeClass'](_0x26f24d,_0x1c9b43);_0x16a815['addClass']('ck-ai-translate-mode-content',_0x1c9b43);});}async['_getChecksList'](){const _0x335ed9=[],_0x5d0a66=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x5db886 of _0x5d0a66)_0x335ed9['push']({'title':_0x5db886['label'],'id':_0x5db886['id'],'commandId':_0x5db886['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x5db886['id']}});const _0x3ead28=new Pe();return _0x3ead28['setupChecks'](this['_translateChecks'](_0x335ed9)),_0x3ead28;}['_translateChecks'](_0x5144cb){return _0x5144cb['map'](_0x208fb8=>{const _0x20fd2a='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x208fb8['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x208fb8,'title':this['_getTranslationWithDefault'](_0x20fd2a,_0x208fb8['title'])};});}}class Le extends Ve{constructor(_0x4dd27e,_0x2b8817){super(_0x4dd27e,_0x2b8817),this['on']('set:isLoading',(_0x3e6f3f,_0x34ec52,_0x2d52aa)=>{_0x2d52aa&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x789080,_0x588706,_0x1ac3c0)=>{_0x1ac3c0&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x35ba3e=super['_createAcceptAllButtonView']();return _0x35ba3e['set']('label',i(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x35ba3e;}['_createExitReviewButtonView'](){const _0x477286=super['_createExitReviewButtonView']();return _0x477286['set']('label',i(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x477286;}}class Ne extends je{['_setupTemplate'](){const _0x1abac9=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x1abac9['if']('isVisible','ck-hidden',_0x469846=>!_0x469846)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':i(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':i(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x1abac9['if']('isVisible','ck-hidden',_0x11bc61=>!_0x11bc61)]},'children':this['_checkViews']}]});}}class tr extends Me{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x266a9a=this['context']['locale'],_0x350a32=new _0x2e3f47(_0x266a9a,{'label':i(_0x266a9a,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x3515b8,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x5c085e=new Ae(_0x266a9a,{'header':_0x350a32,'list':new Ne(_0x266a9a),'results':new Le(_0x266a9a,{'generalErrorText':i(_0x266a9a,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new be(_0x266a9a,{'headerText':i(_0x266a9a,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':i(_0x266a9a,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0x266a9a,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x5c085e['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x5c085e;}['registerTab'](){const _0xba5859=this['context']['plugins']['get']('AITabs');_0xba5859['view']['on']('activateTab',(_0xe8a2bc,_0xa2b046)=>{'translate'===_0xa2b046?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0xba5859['view']['addTab']({'id':'translate','buttonLabel':i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x3515b8,'order':0x0,'content':this['_mainView']});}}class Ya extends _0x118815{static get['requires'](){return[rr,tr,de];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{ri as AIActions,K as AIAdapter,$n as AIAssistant,n as AIAssistantUI,P as AIBalloon,Ua as AIChat,ht as AIChatController,gt as AIChatHistory,rt as AIChatHistoryController,ct as AIChatHistoryUI,Ba as AIChatShortcuts,ut as AIChatUI,S as AIConnector,D as AIEditing,Ga as AIEditorIntegration,Qt as AIQuickActionType,Ka as AIQuickActions,ii as AIQuickActionsUI,er as AIRequestError,Ws as AIReviewCheck,Xs as AIReviewCheckResult,Zs as AIReviewCheckRun,Wa as AIReviewMode,ve as AIReviewModeController,de as AIReviewModeEditing,ge as AIReviewModeUI,_t as AITabs,ar as AITextAdapter,jt as AIToggleButtonUI,Ya as AITranslate,rr as AITranslateController,tr as AITranslateUI,Xn as AWSTextAdapter,Qn as OpenAITextAdapter,E as ShowAIAssistantCommand,Oi as ToggleAICommand,Ri as createResizeButton,qn as getDefaultAICommands};