@ckeditor/ckeditor5-ai 47.7.1 → 47.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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 _0x511be8,Command as Lt,ContextPlugin as _0x575928,Editor as dt}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x225b63,IconCheck as _0x34e643,IconError as _0x3e02e6,IconSubmit as _0x4fc1d8,IconAIHistory as Nt,IconMagicWand as _0x2ff5c5,IconRobotPencil as _0x98228,IconMaximize as _0x327f4b,IconMinimize as _0x932832,IconShowChangesOn as _0x45a410,IconShowChangesOff as _0x4ecb10,IconDocument as _0x822d49,IconBoxWithCross as _0x815ee6,IconBoxWithCheck as _0x546f60,IconBoxWithMarker as _0x50a3ec,IconInfo as _0x42893a,IconLoupe as _0x3c98bc,IconCancel as _0x557804,IconStop as _0x2ff977,IconAIChat as vt,IconPlus as _0x40fce4,IconPin as _0x9d14c3,IconThreeHorizontalDots as _0xe97e9,IconChevronDown as _0x460c5d,IconChevronUp as _0x567c89,IconOutdated as tc,IconEye as _0x1597a1,IconEyeCrossedOut as _0x11989d,IconChevronRight as _0x3d890b,IconAIReview as _0x375882,IconAITranslate as _0x6cdaad}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x926b30,CKEditorError as _0x36ca17,ObservableMixin as ts,global as _0x28fe94,isVisible as _0x255643,Rect as _0x5b8f6e,Collection as _0x4b57cf,FocusTracker as _0x22c832,KeystrokeHandler as _0x2b0c94,first as _0x17af57,logWarning as _0x3bfc82,logError as gt,toArray as _0x2d74dd,EmitterMixin as _0x290e58,scrollViewportToShowTarget as _0x538b49,scrollAncestorsToShowTarget as _0x3c5789,ResizeObserver as _0xb25201,_isMotionReduced as Rt,getConstrainedViewportRect as _0x3e7313,DomEmitterMixin as _0x48ef7b}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x178dcf,ButtonView as _0x1e9460,View as _0x184e76,SpinnerView as _0x4435de,IconView as _0xc034b,AutocompleteView as _0x4043f2,ListView as _0x35cdc6,ListItemGroupView as _0x3633a2,ListItemView as _0x4ffa3a,ButtonLabelView as _0x55674c,FocusCycler as _0x56c0d3,createLabeledTextarea as _0x5db2e8,Dialog as _0x6460a2,createDropdown as _0x546896,addMenuToDropdown as _0xf23687,MenuBarMenuView as _0x53e868,MenuBarMenuListItemButtonView as _0x12221a,DialogViewPosition as _0x48fc7b,MenuBarMenuListView as _0x685ce2,MenuBarMenuListItemView as _0x217236,BodyCollection as _0x591ff4,BalloonPanelView as _0x2fff3d,clickOutsideHandler as _0x1ff4d5,addListToDropdown as _0x321091,UIModel as _0xf9ff1d,submitHandler as _0xa2cd14,LabeledFieldView as _0xfba0d2,createLabeledInputText as th,FormHeaderView as _0x41e0a3,HighlightedTextView as _0x56f45c,ViewCollection as _0x4e90c7,FileDialogButtonView as _0x254afa,InputTextView as _0x9c7843,SearchTextView as _0x46980e,ListItemButtonView as _0x8cf39b,ButtonLabelWithHighlightView as _0x32742a,DropdownMenuPanelPositioningFunctions as _0x291da6,BalloonToolbar as te,FormRowView as _0x20574d,TextareaView as _0x2dac43}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x4669c5,ClipboardMarkersUtils as _0x4d7ada}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x4f929f,ViewDataTransfer as _0xab6e54,ViewUpcastWriter as _0x5bedf2,Matcher as _0xe7dd0a,_DetachOperation as et,_insertIntoModelNodeList as _0x1fa6b7,_removeFromModelNodeList as to,ModelRange as it,transformOperationSets as nt,ViewDowncastWriter as Dt,ModelDocumentFragment as tt,ModelPosition as st,ModelTreeWalker as _0x3f0c2e,MarkerOperation as _0x57d058,InsertOperation as _0x1e2b01}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x5682c5,escape as _0xac888d,escapeRegExp as _0x3383a1,debounce as _0xd2e461}from'es-toolkit/compat';import{createParser as $t}from'eventsource-parser';import{parseDocument as _0x413294}from'htmlparser2';import{isTag as _0x5d51b2,findOne as yt,getParent as _0x2456ab,findAll as _0x3e90f0,removeElement as _0x4c1d4c,replaceElement as _0x482733,prepend as _0x2b8438,prependChild as _0x12356b,appendChild as _0x59ec57,append as _0x2bdf7a,find as _0x1a1c14,isComment as _0x3bac06,getChildren as _0x3d953b,textContent as _0x1aed79}from'domutils';import _0x3807c6 from'dom-serializer';import{Document as Et,Element as _0x10ebb7,Text as _0x280441,cloneNode as _0x54590c,isDocument as _0x22ff9c,isText as _0x30a61f,NodeWithChildren as _0x5f1e12}from'domhandler';import{MarkdownGfmMdToHtml as _0x26b84e}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x893b7e,DocumentCompare as _0x29a341,DATA_ID_MODEL_ATTRIBUTE as Ct,ConfirmMixin as _0x3bd6ad,LateFocusDropdownButtonView as _0x4e06b6,getAllMarkersDomElementsSorted as _0x450a79,SuggestionsConversion as zt,DATA_ID_VIEW_ATTRIBUTE as _0x169cf0,getMarkerDomElement as _0x5b13cd}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x1e538d}from'es-toolkit';import _0x13f10f from'morphdom';import{IconWeb as _0xd367bf,IconClose as _0xf5ecf7,IconDocument as _0x35a5eb,IconSelection as _0x5a0e45,IconFileUpload as _0x55fdc0,IconLink as _0xb249a6,IconBulb as _0x433ff5,IconAI as _0x1d5463,IconPreviousArrow as _0x29f3c3,IconCheck as _0xa54ca6,IconDocumentOutline as _0x56717c,IconPaperClip as _0xb4fa02,IconBrowseFiles as _0x3baee4,IconDropdownArrow as _0xd17942,IconAIChat as _0x2be426,IconAIReview as _0x560fa1,IconAITranslate as Vt,IconAIAskAI as _0x6818cf,IconThumbUp as _0x16e3fe,IconThumbDown as _0x46fa26,IconCopy as _0xb692f9,IconShowChangesOff as _0x196b91,IconShowChangesOn as _0x3d498c,IconAIQuickActions as _0x363d5b,IconAIChatCommands as Gt,IconAIImproveWriting as Bt,IconAIContinueWriting as Ft,IconAIGrammarCheck as Wt,IconAIAdjustLength as Kt,IconAIChangeTone as Yt,IconAIOther as Jt,IconRefresh as _0x3b6fc0,IconNextArrow as _0x3a3110}from'@ckeditor/ckeditor5-icons/dist/index.js';import{diffArrays as _0x148630}from'diff';const x='_ungrouppedCommands';function o(_0x40709d,_0x53e7f1){const _0x5be2a9=(0x0,_0x53e7f1['t'])('Other');return _0x40709d['length']?'groupId'in _0x40709d[0x0]?_0x40709d:[{'groupId':x,'groupLabel':_0x5be2a9,'order':0x1/0x0,'commands':_0x40709d}]:[{'groupId':x,'groupLabel':_0x5be2a9,'order':0x1/0x0,'commands':[]}];}const Kn=globalThis['DataTransfer'],f='ai-ui';class a extends _0x511be8{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x1b4acd}=this,_0x40d5dd=['ck-fake-ai-selection'];_0x1b4acd['config']['get']('ai.assistant.useTheme')&&_0x40d5dd['push']('ck-ai-assistant-ui_theme'),_0x1b4acd['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x40d5dd,'priority':0xc}}),_0x1b4acd['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x58fb41,{writer:_0x459fa2})=>{if(!_0x58fb41['markerRange']['isCollapsed'])return null;const _0x2e4ee6=_0x459fa2['createUIElement']('span');return _0x459fa2['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x2e4ee6),_0x2e4ee6;}});}['afterInit'](){!async function(_0x2a56cd){const _0x149f60=_0xed93ba([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]),_0x19a658=0x3dffc4e1,_0x366a24=0x3df84cf1^_0x19a658,_0x4aca38=window[_0xed93ba([0x44,0x61,0x74,0x65])][_0xed93ba([0x6e,0x6f,0x77])](),_0x124832=_0x2a56cd[_0xed93ba([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x2401e6=new window[(_0xed93ba([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5c3585=>{_0x124832[_0xed93ba([0x6f,0x6e,0x63,0x65])](_0xed93ba([0x72,0x65,0x61,0x64,0x79]),_0x5c3585);}),_0xd6f700={[_0xed93ba([0x6b,0x74,0x79])]:_0xed93ba([0x45,0x43]),[_0xed93ba([0x75,0x73,0x65])]:_0xed93ba([0x73,0x69,0x67]),[_0xed93ba([0x63,0x72,0x76])]:_0xed93ba([0x50,0x2d,0x32,0x35,0x36]),[_0xed93ba([0x78])]:_0xed93ba([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]),[_0xed93ba([0x79])]:_0xed93ba([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]),[_0xed93ba([0x61,0x6c,0x67])]:_0xed93ba([0x45,0x53,0x32,0x35,0x36])},_0x1628b2=_0x124832[_0xed93ba([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0xed93ba([0x67,0x65,0x74])](_0xed93ba([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x130826(){let _0x5ebbc5,_0x2fd6f6=null,_0x3b7f18=null;try{if(_0x1628b2==_0xed93ba([0x47,0x50,0x4c]))return _0xed93ba([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x5ebbc5=_0x5d3c63(),!_0x5ebbc5)return _0xed93ba([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x5ebbc5[_0xed93ba([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x3b7f18=_0x2b968e(_0x5ebbc5[_0xed93ba([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x5ebbc5[_0xed93ba([0x6a,0x74,0x69])])),await _0x532a9e()?_0x1ace83()?_0x1d2757()?_0xed93ba([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x300e30()?(_0x5ebbc5[_0xed93ba([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0xed93ba([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x2fd6f6=_0x39731f(_0xed93ba([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x4d33bd()):_0xed93ba([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0xed93ba([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0xed93ba([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0xed93ba([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x1d2757(){const _0x129868=[_0xed93ba([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0xed93ba([0x74,0x72,0x69,0x61,0x6c])][_0xed93ba([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5ebbc5[_0xed93ba([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x4aca38/0x3e8:0xe10*_0x366a24;return _0x5ebbc5[_0xed93ba([0x65,0x78,0x70])]<_0x129868;}function _0x1ace83(){const _0x1c43e9=_0x5ebbc5[_0xed93ba([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x1c43e9&&(!!_0x1c43e9[_0xed93ba([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xed93ba([0x2a]))||!!_0x1c43e9[_0xed93ba([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xed93ba([0x41,0x49])));}function _0x300e30(){const _0x5a6b3e=_0x5ebbc5[_0xed93ba([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x5a6b3e||0x0==_0x5a6b3e[_0xed93ba([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x28ca31}=new URL(window[_0xed93ba([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x5a6b3e[_0xed93ba([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x28ca31))return!0x0;const _0x1f61c6=_0x28ca31[_0xed93ba([0x73,0x70,0x6c,0x69,0x74])](_0xed93ba([0x2e]));return _0x5a6b3e[_0xed93ba([0x66,0x69,0x6c,0x74,0x65,0x72])](_0xf648e5=>_0xf648e5[_0xed93ba([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xed93ba([0x2a])))[_0xed93ba([0x6d,0x61,0x70])](_0xa5c1b9=>_0xa5c1b9[_0xed93ba([0x73,0x70,0x6c,0x69,0x74])](_0xed93ba([0x2e])))[_0xed93ba([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x1f88c0=>_0x1f88c0[_0xed93ba([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x1f61c6[_0xed93ba([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0xed93ba([0x6d,0x61,0x70])](_0x10c6cb=>Array(_0x1f61c6[_0xed93ba([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x10c6cb[_0xed93ba([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0xed93ba([0x66,0x69,0x6c,0x6c])](_0x10c6cb[0x0]===_0xed93ba([0x2a])?_0xed93ba([0x2a]):'')[_0xed93ba([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x10c6cb))[_0xed93ba([0x73,0x6f,0x6d,0x65])](_0x33f497=>_0x1f61c6[_0xed93ba([0x65,0x76,0x65,0x72,0x79])]((_0x561d0f,_0x5d42da)=>_0x33f497[_0x5d42da]===_0x561d0f||_0x33f497[_0x5d42da]===_0xed93ba([0x2a])));}function _0x4d33bd(){return _0x2fd6f6&&_0x3b7f18?new window[(_0xed93ba([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x5e5a8d,_0x76d8e4)=>{_0x2fd6f6[_0xed93ba([0x74,0x68,0x65,0x6e])](_0x5e5a8d,_0x76d8e4),_0x3b7f18[_0xed93ba([0x74,0x68,0x65,0x6e])](_0x34a846=>{_0x34a846!=_0xed93ba([0x56,0x61,0x6c,0x69,0x64])&&_0x5e5a8d(_0x34a846);},_0x76d8e4);}):_0x2fd6f6||_0x3b7f18||_0xed93ba([0x56,0x61,0x6c,0x69,0x64]);}}function _0x2b968e(_0x2a0d3e,_0x3d40b5){return new window[(_0xed93ba([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x48ae6c=>{if(_0x591d73())return _0x48ae6c(_0xed93ba([0x56,0x61,0x6c,0x69,0x64]));_0x4eaa63(),_0x124832[_0xed93ba([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0xed93ba([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0xe5d514=!0x1;const _0x9eb9a4=_0x926b30();function _0x110a5e(_0x36d1be){return!!_0x36d1be&&(typeof _0x36d1be===_0xed93ba([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x36d1be===_0xed93ba([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x36d1be[_0xed93ba([0x74,0x68,0x65,0x6e])]===_0xed93ba([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x36d1be[_0xed93ba([0x63,0x61,0x74,0x63,0x68])]===_0xed93ba([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x25730d(_0x259201){_0x3230b1(_0x259201)[_0xed93ba([0x74,0x68,0x65,0x6e])](_0x4922f5=>{if(!_0x4922f5||_0x4922f5[_0xed93ba([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0xed93ba([0x6f,0x6b]))return _0xed93ba([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x5dc9dc(_0x5e948b(_0x9eb9a4+_0x3d40b5))!=_0x4922f5[_0xed93ba([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0xed93ba([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0xed93ba([0x56,0x61,0x6c,0x69,0x64]);})[_0xed93ba([0x74,0x68,0x65,0x6e])](_0x20000e=>(_0x4a5499(),_0x20000e),()=>{const _0x17537e=_0x1a5a16();return null==_0x17537e?(_0x4a5499(),_0xed93ba([0x56,0x61,0x6c,0x69,0x64])):_0xed93ba(_0x4aca38-_0x17537e>(0x19f340e1^_0x19a658)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0xed93ba([0x74,0x68,0x65,0x6e])](_0x48ae6c)[_0xed93ba([0x63,0x61,0x74,0x63,0x68])](()=>{_0x48ae6c(_0xed93ba([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x3ece40=0x3dc92a61^_0x19a658;function _0x4a5499(){const _0x5b14e2=_0xed93ba([0x6c,0x6c,0x63,0x74,0x2d])+_0x5dc9dc(_0x5e948b(_0x2a0d3e)),_0x1a15e2=_0x234714(_0x5dc9dc(window[_0xed93ba([0x4d,0x61,0x74,0x68])][_0xed93ba([0x63,0x65,0x69,0x6c])](_0x4aca38/_0x3ece40)));window[_0xed93ba([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0xed93ba([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x5b14e2,_0x1a15e2);}function _0x1a5a16(){const _0xdb365a=_0xed93ba([0x6c,0x6c,0x63,0x74,0x2d])+_0x5dc9dc(_0x5e948b(_0x2a0d3e)),_0x4a1441=window[_0xed93ba([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0xed93ba([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0xdb365a);return _0x4a1441?window[_0xed93ba([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x234714(_0x4a1441),0x10)*_0x3ece40:null;}function _0x3230b1(_0x380a71){return new window[(_0xed93ba([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x53db87,_0x311915)=>{_0x380a71[_0xed93ba([0x74,0x68,0x65,0x6e])](_0x53db87,_0x311915),window[_0xed93ba([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x311915,0x3dfe1021^_0x19a658);});}}_0x124832[_0xed93ba([0x6f,0x6e])](_0xed93ba([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x343cfb,_0x29710a)=>{if(_0x29710a[0x0]!=_0x2a0d3e)return _0x48ae6c(_0xed93ba([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x29710a[0x1]={..._0x29710a[0x1],[_0xed93ba([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x9eb9a4};},{[_0xed93ba([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0xed93ba([0x68,0x69,0x67,0x68])}),_0x124832[_0xed93ba([0x6f,0x6e])](_0xed93ba([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x2c9852=>{_0x110a5e(_0x2c9852[_0xed93ba([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0xe5d514=!0x0,_0x25730d(_0x2c9852[_0xed93ba([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0xed93ba([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0xed93ba([0x6c,0x6f,0x77])}),_0x2401e6[_0xed93ba([0x74,0x68,0x65,0x6e])](()=>{_0xe5d514||_0x48ae6c(_0xed93ba([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x591d73(){return _0x124832[_0xed93ba([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0xed93ba([0x76,0x69,0x65,0x77])][_0xed93ba([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0xed93ba([0x61,0x75,0x74,0x6f]);}function _0x4eaa63(){_0x124832[_0xed93ba([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0xed93ba([0x76,0x69,0x65,0x77])][_0xed93ba([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0xed93ba([0x61,0x75,0x74,0x6f]);}}function _0x39731f(_0x56ddc0){const _0x67df6e=[new window[(_0xed93ba([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x37bcb4=>setTimeout(_0x37bcb4,0x3df6fa2d^_0x19a658)),_0x2401e6[_0xed93ba([0x74,0x68,0x65,0x6e])](()=>new window[(_0xed93ba([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4c9587=>{let _0x239f6b=0x0;_0x124832[_0xed93ba([0x6d,0x6f,0x64,0x65,0x6c])][_0xed93ba([0x6f,0x6e])](_0xed93ba([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x37ade9,_0xcd450)=>{_0xcd450[0x0][_0xed93ba([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x239f6b++,_0x239f6b==(0x3dffc109^_0x19a658)&&(_0x4c9587(),_0x37ade9[_0xed93ba([0x6f,0x66,0x66])]());});}))];return window[_0xed93ba([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0xed93ba([0x72,0x61,0x63,0x65])](_0x67df6e)[_0xed93ba([0x74,0x68,0x65,0x6e])](()=>_0x56ddc0);}async function _0x400715(){await _0x2401e6,_0x124832[_0xed93ba([0x6d,0x6f,0x64,0x65,0x6c])][_0xed93ba([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x516507,_0x124832[_0xed93ba([0x6d,0x6f,0x64,0x65,0x6c])][_0xed93ba([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x516507,_0x124832[_0xed93ba([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0xed93ba([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x2f1177(_0x2de4b4){const _0x279346=_0x1d1b13();_0x124832[_0x279346]=_0xed93ba([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x2de4b4,_0x2de4b4!=_0xed93ba([0x56,0x61,0x6c,0x69,0x64])&&_0x400715();}function _0x1d1b13(){const _0xf15689=window[_0xed93ba([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0xed93ba([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0xed93ba([0x6e,0x6f,0x77])]())[_0xed93ba([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0xed93ba([0x2e]),'');let _0x24a771=_0xed93ba([0x6e]);for(let _0x400ceb=0x0;_0x400ceb<_0xf15689[_0xed93ba([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x400ceb+=0x2){let _0xe724c2=window[_0xed93ba([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xf15689[_0xed93ba([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x400ceb,_0x400ceb+0x2));_0xe724c2>=_0x149f60[_0xed93ba([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0xe724c2-=_0x149f60[_0xed93ba([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x24a771+=_0x149f60[_0xe724c2];}return _0x24a771;}function _0x5d3c63(){const _0xd8f9a=_0x1628b2[_0xed93ba([0x73,0x70,0x6c,0x69,0x74])](_0xed93ba([0x2e]));if(0x3!=_0xd8f9a[_0xed93ba([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x3792d9(_0xd8f9a[0x1]);function _0x3792d9(_0x18bd63){const _0x93f3f1=_0x19d528(_0x18bd63);return _0x93f3f1&&_0x63f661()?_0x93f3f1:null;function _0x63f661(){const _0x35cb27=_0x93f3f1[_0xed93ba([0x6a,0x74,0x69])],_0x8f3451=window[_0xed93ba([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x35cb27[_0xed93ba([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x35cb27[_0xed93ba([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x3fcfd4={..._0x93f3f1,[_0xed93ba([0x6a,0x74,0x69])]:_0x35cb27[_0xed93ba([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x35cb27[_0xed93ba([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x3fcfd4[_0xed93ba([0x76,0x63])],_0x5e948b(_0x3fcfd4)==_0x8f3451;}}}async function _0x532a9e(){let _0x2fc7bf=!0x0;try{const _0x490e5c=_0x1628b2[_0xed93ba([0x73,0x70,0x6c,0x69,0x74])](_0xed93ba([0x2e])),[_0x384d29,_0x32a7e8,_0x203e0c]=_0x490e5c;return _0x10b7dc(_0x384d29),await _0x415d1b(_0x384d29,_0x32a7e8,_0x203e0c),_0x2fc7bf;}catch{return!0x1;}function _0x10b7dc(_0x17934a){const _0x483aae=_0x19d528(_0x17934a);_0x483aae&&_0x483aae[_0xed93ba([0x61,0x6c,0x67])]==_0xed93ba([0x45,0x53,0x32,0x35,0x36])||(_0x2fc7bf=!0x1);}async function _0x415d1b(_0x514894,_0x1a7cf3,_0x268b04){const _0x27a56f=window[_0xed93ba([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0xed93ba([0x66,0x72,0x6f,0x6d])](_0x17c8f9(_0x268b04),_0x109dcb=>_0x109dcb[_0xed93ba([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x117cc5=new window[(_0xed93ba([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0xed93ba([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x514894+_0xed93ba([0x2e])+_0x1a7cf3),_0x5e22fa=window[_0xed93ba([0x63,0x72,0x79,0x70,0x74,0x6f])][_0xed93ba([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x5e22fa)return;const _0x519f6f=await _0x5e22fa[_0xed93ba([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0xed93ba([0x6a,0x77,0x6b]),_0xd6f700,{[_0xed93ba([0x6e,0x61,0x6d,0x65])]:_0xed93ba([0x45,0x43,0x44,0x53,0x41]),[_0xed93ba([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0xed93ba([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0xed93ba([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x5e22fa[_0xed93ba([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0xed93ba([0x6e,0x61,0x6d,0x65])]:_0xed93ba([0x45,0x43,0x44,0x53,0x41]),[_0xed93ba([0x68,0x61,0x73,0x68])]:{[_0xed93ba([0x6e,0x61,0x6d,0x65])]:_0xed93ba([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x519f6f,_0x27a56f,_0x117cc5)||(_0x2fc7bf=!0x1);}}function _0x19d528(_0x515c10){return _0x515c10[_0xed93ba([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0xed93ba([0x65,0x79]))?JSON[_0xed93ba([0x70,0x61,0x72,0x73,0x65])](_0x17c8f9(_0x515c10)):null;}function _0x17c8f9(_0x41dd3e){return window[_0xed93ba([0x61,0x74,0x6f,0x62])](_0x41dd3e[_0xed93ba([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0xed93ba([0x2b]))[_0xed93ba([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0xed93ba([0x2f])));}function _0x5e948b(_0xd8a795){let _0x21c246=0x1505;function _0x752815(_0x47c5b4){for(let _0x48800d=0x0;_0x48800d<_0x47c5b4[_0xed93ba([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x48800d++){const _0x5c6c84=_0x47c5b4[_0xed93ba([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x48800d);_0x21c246=(_0x21c246<<0x5)+_0x21c246+_0x5c6c84,_0x21c246&=_0x21c246;}}function _0x939d6f(_0x726641){Array[_0xed93ba([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x726641)?_0x726641[_0xed93ba([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x939d6f):_0x726641&&typeof _0x726641==_0xed93ba([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0xed93ba([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x726641)[_0xed93ba([0x73,0x6f,0x72,0x74])]()[_0xed93ba([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x2d45b1,_0x11f25f])=>{_0x752815(_0x2d45b1),_0x939d6f(_0x11f25f);}):_0x752815(window[_0xed93ba([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x726641));}return _0x939d6f(_0xd8a795),_0x21c246>>>0x0;}function _0x5dc9dc(_0x2043f3){return _0x2043f3[_0xed93ba([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0xed93ba([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0xed93ba([0x30]));}function _0x234714(_0x3dc43d){return _0x3dc43d[_0xed93ba([0x73,0x70,0x6c,0x69,0x74])]('')[_0xed93ba([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0xed93ba([0x6a,0x6f,0x69,0x6e])]('');}function _0x516507(){}function _0xed93ba(_0x3ca062){return _0x3ca062['map'](_0x544f07=>String['fromCharCode'](_0x544f07))['join']('');}_0x2f1177(await _0x130826());}(this);}['showFakeVisualSelection'](){const _0x5ca5fe=this['editor']['model'];_0x5ca5fe['change'](_0x255ae6=>{const _0x45e04b=_0x5ca5fe['document']['selection']['getRanges']();let _0x2bc3e4=0x0;for(const _0x1c0304 of _0x45e04b){const _0x47c9e6=f+':'+_0x2bc3e4;if(_0x5ca5fe['markers']['has'](_0x47c9e6))_0x255ae6['updateMarker'](_0x47c9e6,{'range':_0x1c0304});else{if(_0x1c0304['start']['isAtEnd']){const _0x2fbc29=_0x1c0304['start']['getLastMatchingPosition'](({item:_0x344bd2})=>!_0x5ca5fe['schema']['isContent'](_0x344bd2),{'boundaries':_0x1c0304});_0x255ae6['addMarker'](_0x47c9e6,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x255ae6['createRange'](_0x2fbc29,_0x1c0304['end'])});}else _0x255ae6['addMarker'](_0x47c9e6,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1c0304});}_0x2bc3e4++;}});}['hideFakeVisualSelection'](){const _0x3c3013=this['editor']['model'],_0x5e0426=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x5e0426['length']&&_0x3c3013['change'](_0x468668=>{_0x5e0426['forEach'](_0x3a6152=>{_0x468668['removeMarker'](_0x3a6152);});});}['insertContent'](_0x4881f3,_0x5561c9){const _0x52efad=this['_getAISelection'](),_0x400956=_0x5561c9||_0x52efad['getFirstRange']();this['editor']['model']['canEditAt'](_0x400956)&&this['editor']['model']['change'](_0x1b6883=>{this['hideFakeVisualSelection'](),_0x5561c9||this['_resetContentOfSelectedTableCells'](_0x1b6883,_0x52efad),this['_pasteHTMLUsingClipboard']({'insertAt':_0x400956,'writer':_0x1b6883,'html':_0x4881f3});});}['insertContentBelow'](_0x1d72ce){const {model:_0x390b73}=this['editor'],_0xf7cceb=this['_getAISelection']();_0x390b73['change'](()=>{const _0x5cbdc6=this['_prepareTableInsertBelowPosition'](_0x1d72ce,_0xf7cceb)||this['_getDefaultInsertBelowPosition'](_0xf7cceb);this['insertContent'](_0x1d72ce,_0x5cbdc6);});}['_getAISelection'](){const _0x5adf36=this['editor']['model'],_0x37b6e6=Array['from'](_0x5adf36['markers']['getMarkersGroup'](f))['map'](_0x40f69f=>_0x40f69f['getRange']());return _0x5adf36['createSelection'](_0x37b6e6);}['_pasteHTMLUsingClipboard']({writer:_0x56794c,html:_0x2ab6b4,insertAt:_0x188965}){const {view:_0x520eaa}=this['editor']['editing'],_0x18c144=this['editor']['plugins']['get'](_0x4669c5),_0x69a5af=new Kn();_0x69a5af['setData']('text/html',_0x2ab6b4);const _0xbb1cfc=new ClipboardEvent('paste',{'clipboardData':_0x69a5af}),_0x483390=new _0x4f929f(_0x520eaa,_0xbb1cfc,{'dataTransfer':new _0xab6e54(_0x69a5af)});_0x56794c['setSelection'](_0x188965);const _0x2a9a23=(_0x5039b3,_0x596bc3)=>{_0x596bc3['resultRange']&&_0x56794c['setSelection'](_0x596bc3['resultRange']);};_0x18c144['once']('contentInsertion',_0x2a9a23,{'priority':'lowest'}),_0x520eaa['document']['fire']('paste',_0x483390),_0x18c144['off']('contentInsertion',_0x2a9a23);}['_getDefaultInsertBelowPosition'](_0x328505){const {model:_0x3395c5}=this['editor'],_0x53cbd2=Array['from'](_0x328505['getSelectedBlocks']());return _0x53cbd2['length']?_0x3395c5['createPositionAfter'](_0x53cbd2['pop']()):_0x328505['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x4f429d,_0x15fe68){const {model:_0x6affd5,plugins:_0x11323a}=this['editor'];if(_0x11323a['has']('TableUtils')){const _0xc69a88=_0x11323a['get']('TableUtils')['getSelectedTableCells'](_0x15fe68);if(_0xc69a88['length']){const _0x99bbce=this['_getTableRowCountFromContent'](_0x4f429d),_0x129412=this['_createEmptyTableRows'](_0xc69a88,_0x99bbce);return _0x6affd5['createPositionAt'](_0x129412,0x0);}}return null;}['_getTableRowCountFromContent'](_0x4f0235){const _0x3053df=this['editor']['plugins']['get']('TableUtils'),_0xa62ab7=this['editor']['data']['parse'](_0x4f0235),_0x5b4fdd=Array['from'](_0xa62ab7['getChildren']())['filter'](_0x20c50d=>_0x20c50d['is']('element','table'));let _0x876b41=0x0;return _0x5b4fdd['forEach'](_0x8b4838=>{_0x876b41+=_0x3053df['getRows'](_0x8b4838);}),_0x876b41;}['_createEmptyTableRows'](_0x221962,_0x32c90c){const _0x340173=this['editor']['plugins']['get']('TableUtils'),_0xe083a3=_0x340173['getRowIndexes'](_0x221962),_0x2729e3=_0x340173['getColumnIndexes'](_0x221962),_0x151925=_0xe083a3['last']+0x1,_0x57898d=_0x2729e3['first'],_0x155d52=_0x221962[0x0]['findAncestor']('table');for(let _0x4b09e4=0x0;_0x4b09e4<_0x32c90c;_0x4b09e4++)_0x340173['insertRows'](_0x155d52,{'at':_0x151925});return _0x155d52['getChild'](_0x151925)['getChild'](_0x57898d);}['_resetContentOfSelectedTableCells'](_0x2d316f,_0x6684ad){const {plugins:_0x2a20ba}=this['editor'],{model:_0x358c90}=_0x2d316f;if(!_0x2a20ba['has']('TableUtils'))return;_0x2a20ba['get']('TableUtils')['getSelectedTableCells'](_0x6684ad)['length']&&_0x358c90['deleteContent'](_0x6684ad);}}class K extends _0x511be8{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x36ca17('aiadapter-text-adapter-not-set',null);}}class er extends Error{constructor(_0x4be1f6){super(_0x4be1f6),this['name']='AIRequestError';}}function Wn(_0x3f834e,_0x5d416f,_0x37aa24){const t=_0x3f834e['t'];switch(_0x5d416f){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',_0x37aa24);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x37aa24);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'},_0x37aa24);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 _0x5d416f;}}class E extends Lt{['_commandDefinitions'];constructor(_0x5ab397,_0x21827e){super(_0x5ab397),this['_commandDefinitions']=_0x21827e,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x115a1a,_0x22dfd8,_0x326768)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0x326768));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x2e0866,_0xab09bd,_0x1f8a89)=>{this['enabledCommandsIds']=_0x1f8a89?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x28e9a4=this['editor']['model'];this['_hasContext']=function(_0x11287d){const _0x316781=_0x11287d['document']['selection'];return _0x316781['isCollapsed']?0x0!==[..._0x316781['getSelectedBlocks']()]['length']&&![..._0x316781['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x11287d['hasContent'](_0x316781['getFirstRange']());}(_0x28e9a4);const _0x1ada69=_0x28e9a4['document']['selection'],_0x2fb6a4=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x4f0473 of _0x1ada69['getRanges']())for(const _0x2fcd01 of _0x4f0473['getItems']())if(_0x2fcd01['is']('element')&&_0x2fb6a4['includes'](_0x2fcd01['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x398e9f='',_0x356a32='',_0x579d23='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x398e9f,_0x356a32,_0x579d23);}}function ns(_0x2c800b,_0x3c849e){const _0x1a71e2=new Set();for(const _0x481e43 of _0x2c800b['values']())(_0x3c849e||!0x1===_0x481e43['requiresContent'])&&_0x1a71e2['add'](_0x481e43['id']);return Array['from'](_0x1a71e2);}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(_0xea131c,_0x331f79,_0x5f497e){super(),this['editor']=_0xea131c,this['textAdapter']=_0x331f79,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x5f497e,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x4c22f0,_0x5aceb3,_0x66d275)=>{this['view']['value']=this['_sanitizeHTML'](_0x66d275);}),this['listenTo'](this['view'],'submitPrompt',(_0x2c3815,_0x3c3794)=>{const _0x582bee=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x3c3794,_0x582bee,'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:_0x59f8b8,query:_0x16ceb1,htmlContent:_0x35fa96,label:_0x10de47,mainActionLabel:_0x457ebf}){this['view']['prompt']=_0x10de47,this['view']['mainAction']=_0x457ebf,this['initialContext']=_0x35fa96,_0x16ceb1&&(this['view']['isRendered']?this['_handleQuery'](_0x16ceb1,_0x35fa96,_0x59f8b8,_0x10de47):this['view']['once']('render',()=>{this['_handleQuery'](_0x16ceb1,_0x35fa96,_0x59f8b8,_0x10de47);}));}['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'](_0x3aeac,_0x136c9c,_0x34ee71,_0x3cad7a){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x136c9c,this['previousQuery']=_0x3aeac,this['previousLabel']=_0x3cad7a||_0x3aeac,this['previousActionId']=_0x34ee71,new Promise(_0x3933aa=>{this['textAdapter']['makeRequest']({'query':_0x3aeac,'context':_0x136c9c,'onData':_0xe31bd3=>{this['currentResponse']=_0xe31bd3,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x34ee71})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x33ee2d=>{_0x33ee2d instanceof er?this['view']['handleError'](_0x33ee2d['message']):this['view']['handleError'](),_0x3933aa();})['finally'](()=>{this['stopProcessing'](),_0x3933aa();});});}['_parseAndNormalizeContent'](_0x5add46,_0x217702=!0x1){const _0xd03811=hs['exec'](_0x5add46);_0x5add46=_0xd03811?_0x5add46['substring'](_0xd03811[0x1]['length']):_0x5add46['length']<0x64&&!_0x217702?'':this['_stripMarkdownSyntax'](_0x5add46);const _0x49990e=this['_domParser']['parseFromString'](_0x5add46,'text/html');if(_0xd03811){const _0x305b1f=Array['from'](_0x49990e['body']['childNodes']);_0x305b1f['reverse']();for(const _0xfff122 of _0x305b1f){if(_0xfff122['nodeType']==Node['ELEMENT_NODE'])break;_0xfff122['remove']();}}const _0x485791=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x49990e['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x485791);const _0x23dc61=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x4f5515=this['editor']['data']['toModel'](_0x485791);return _0x23dc61||_0x4f5515['markers']['clear'](),this['editor']['data']['stringify'](_0x4f5515);}['_normalizeResponseHeadings'](_0x16e9e0){const _0x1bfd6e=new _0x5bedf2(this['editor']['editing']['view']['document']),_0x1ee280=new _0xe7dd0a({'name':/^h[1-5]$/}),_0x1190fb=[];let _0x42a0de=!0x1;for(const _0x21fc78 of _0x16e9e0)_0x21fc78['is']('element')&&_0x1ee280['match'](_0x21fc78)&&(_0x1190fb['push'](_0x21fc78),'h1'==_0x21fc78['name']&&(_0x42a0de=!0x0));if(_0x42a0de){for(const _0x38d234 of _0x1190fb)_0x1bfd6e['rename']('h'+(parseInt(_0x38d234['name'][0x1])+0x1),_0x38d234);}}['_isH1TagSupportEnabled'](){const {data:_0xd6d7db,editing:_0x4a15fd}=this['editor'],_0x19af30=_0xd6d7db['htmlProcessor']['toView']('<h1></h1>'),_0x1b30e5=_0xd6d7db['toView'](_0xd6d7db['toModel'](_0x19af30));return!!_0x4a15fd['view']['domConverter']['viewToDom'](_0x1b30e5)['querySelector']('h1');}['_sanitizeHTML'](_0x1fe30a){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x1fe30a),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x68a5de){const _0xdc3616=_0x68a5de['trim']();return _0xdc3616['startsWith']('```html')?_0xdc3616['endsWith']('```')?_0xdc3616['substring'](0x7,_0xdc3616['length']-0x3):_0xdc3616['substring'](0x7):_0x68a5de;}}const _={'REPLACE':'replace','INSERT':'insert'};class Ar extends _0x178dcf{constructor(_0xf354fb){super(_0xf354fb),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x4c5ee7=>Wn(_0xf354fb,'AI_'+_0x4c5ee7['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Wn(_0xf354fb,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Wn(_0xf354fb,'Try\x20again')),this['stopButton']=this['_createButton'](Wn(_0xf354fb,'Stop'));const _0x15012a=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x15012a['if']('isVisible','ck-hidden',_0x37af08=>!_0x37af08)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x5496c4,_0x20a9d2){const _0x36ec82=new _0x1e9460(this['locale']);return _0x36ec82['set']({'label':_0x5496c4,'class':_0x20a9d2||'','isVisible':!0x0,'withText':!0x0}),_0x36ec82;}}class Pr extends _0x184e76{['contentFieldView'];['copyButtonView'];constructor(_0xd4a943,_0x10b624=''){super(_0xd4a943),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x22b232=this['bindTemplate'];this['contentFieldView']=new Yn(_0xd4a943,_0x10b624),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x22b232['if']('isVisible','ck-hidden',_0x5bdcd5=>!_0x5bdcd5)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x22b232['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 _0x1b308f=!0x1;this['on']('change:value',(_0x4ba238,_0x46f825,_0x161ecc)=>{const _0x647a81=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x161ecc),this['isProcessing']&&_0x647a81&&!_0x1b308f&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x3950c6,_0x2096b8,_0x6ebdb2)=>{_0x1b308f=!0x1,_0x6ebdb2?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x1b308f=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x1b308f=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x3e2c59=this['locale'],_0x97030b=new _0x1e9460(this['locale']),_0x4f12fc='ck-ai-form__copy-button';return _0x97030b['set']({'label':Wn(_0x3e2c59,'Copy'),'icon':_0x225b63,'class':_0x4f12fc,'tooltip':!0x0}),_0x97030b['bind']('isVisible')['to'](this,'value',_0x3b0a14=>!!_0x3b0a14),_0x97030b['bind']('isEnabled')['to'](this,'isProcessing',_0x6dbca8=>!_0x6dbca8),_0x97030b['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x97030b['icon']=_0x34e643,_0x97030b['class']=_0x4f12fc+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x97030b['icon']=_0x225b63,_0x97030b['class']=_0x4f12fc;},0x3e8);}),_0x97030b;}['_copyHTMLToClipboard'](_0x5c1032){const {window:_0x4bae24,document:_0x256796}=_0x28fe94;if(_0x4bae24['ClipboardItem']){const {Blob:_0x600c00,ClipboardItem:_0x2d5f1c}=_0x4bae24,_0x1e3d8f=[new _0x2d5f1c({'text/html':new _0x600c00([_0x5c1032['innerHTML']],{'type':'text/html'}),'text/plain':new _0x600c00([_0x5c1032['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x1e3d8f);}else{const _0x55dd78=_0x256796['createElement']('div');_0x55dd78['style']['position']='absolute',_0x55dd78['style']['left']='-9999px',_0x55dd78['innerHTML']='<span>[</span>'+_0x5c1032['innerHTML']+'<span>]</span>',_0x256796['body']['appendChild'](_0x55dd78);const _0x12f588=_0x256796['createRange']();_0x12f588['setStartAfter'](_0x55dd78['firstElementChild']),_0x12f588['setEndBefore'](_0x55dd78['lastElementChild']);const _0x4563d3=_0x4bae24['getSelection']();_0x4563d3['removeAllRanges'](),_0x4563d3['addRange'](_0x12f588),_0x256796['execCommand']('copy'),_0x55dd78['remove']();}}}class Yn extends _0x184e76{constructor(_0x5c4aaa,_0xa4e0ab=''){super(_0x5c4aaa),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0xa4e0ab,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x3b74b4){this['element']['innerHTML']=_0x3b74b4;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x36becd=new _0x184e76(),_0x1b2184=this['locale'],_0x48438a=new _0x4435de();return _0x48438a['isVisible']=!0x0,_0x36becd['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x48438a,{'text':Wn(_0x1b2184,'AI\x20is\x20writing...')}]}),_0x36becd['render'](),_0x36becd;}}class Vr extends _0x184e76{constructor(_0x53f222,_0x428a5f=''){super(_0x53f222);const _0x388963=new _0xc034b(),_0x1a452b=this['bindTemplate'];this['set']('text',_0x428a5f),_0x388963['content']=_0x3e02e6,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x388963,{'text':_0x1a452b['to']('text')}]});}}class Cr extends _0x4043f2{['submitButtonView'];['showHistoryButtonView'];constructor(_0x3fac22,_0x3ffaeb){super(_0x3fac22,_0x3ffaeb),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',(_0x2a1bdd,_0x2d154d)=>{_0x2a1bdd['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x2d154d());});}['_createSubmitButton'](){const _0x1757d1=new _0x1e9460(this['locale']),_0x210615=this['locale'];return _0x1757d1['set']({'icon':_0x4fc1d8,'label':Wn(_0x210615,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x1757d1['on']('execute',()=>{this['submit']();}),_0x1757d1['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x2d403d,_0x151956)=>!_0x2d403d&&_0x151956),_0x1757d1;}['_createShowHistoryButton'](){const _0x1d194a=new _0x1e9460(this['locale']),_0x1864f3=this['resultsView'],_0x14ead7=this['locale'];_0x1d194a['set']({'label':Wn(_0x14ead7,'History'),'withText':!0x1,'icon':Nt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x1d194a['bind']('isOn')['to'](_0x1864f3,'isVisible'),_0x1d194a['bind']('isEnabled')['to'](this,'isEnabled'),_0x1d194a['on']('execute',()=>{_0x1864f3['isVisible']=!_0x1864f3['isVisible'],_0x1864f3['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x285bbc=()=>{_0x28fe94['window']['requestAnimationFrame'](()=>{if(_0x255643(this['element'])){const _0x43ec8a=new _0x5b8f6e(this['queryView']['fieldView']['element']),_0x45f865=_0x43ec8a['width'],_0x45531a='rtl'===_0x14ead7['uiLanguageDirection']?'left':'right';_0x43ec8a['excludeScrollbarsAndBorders'](),_0x1d194a['element']['style'][_0x45531a]=_0x45f865-_0x43ec8a['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x285bbc),this['on']('render',_0x285bbc),_0x1d194a;}['submit'](){const _0x51bfea=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x51bfea);}['focus'](_0x66ecda){-0x1===_0x66ecda?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Hr extends _0x35cdc6{['historyGroupView'];['clearHistoryButton'];constructor(_0x4799ea){super(_0x4799ea),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x3633a2(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Wn(_0x4799ea,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x51ad9c=0x0;for(const _0x45d883 of this['items'])_0x51ad9c+=_0x45d883['items']['length'];return{'resultsCount':_0x51ad9c,'totalItemsCount':_0x51ad9c};}['_createClearHistoryButton'](){const _0x51604d=this['locale'],_0x3e42c6=new _0x1e9460(this['locale']);return _0x3e42c6['set']({'label':'('+Wn(_0x51604d,'Clear')+')','withText':!0x0}),_0x3e42c6['on']('execute',()=>this['fire']('clearHistory')),_0x3e42c6;}}class Rr extends _0x4ffa3a{constructor(_0x57755b){super();const _0x4f8757=new _0x55674c(),_0x458d30=new _0x1e9460(this['locale'],_0x4f8757);this['children']['add'](_0x458d30),_0x458d30['set']({'label':_0x57755b['prompt'],'withText':!0x0}),_0x458d30['on']('execute',()=>{this['fire']('execute',{'value':_0x5682c5(_0x57755b['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class Br extends _0x4b57cf{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x1c6b0f,_0x3dd552)=>{const _0xb9d91b=go(_0x3dd552['prompt']);for(const _0x5d3bf4 of this)if(_0x5d3bf4!=_0x3dd552&&go(_0x5d3bf4['prompt'])===_0xb9d91b){this['remove'](_0x5d3bf4);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x5ad519=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0x5ad519));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0xf59bba=>_0xf59bba)));}}function go(_0x175e79){return _0x175e79['toLowerCase']()['trim']();}class k extends _0x184e76{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x4d4af2,_0xaefba4,_0x137280=''){super(_0x4d4af2),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(_0x4d4af2),this['contentArea']=new Pr(_0x4d4af2,_0x137280),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 _0x22c832(),this['keystrokes']=new _0x2b0c94(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x56c0d3({'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 _0x4492ad=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0xaefba4],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x4492ad['if']('isError','ck-hidden',_0x55abed=>!_0x55abed)]},'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'](_0x26bcfe=0x1){-0x1===_0x26bcfe?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 _0xf55388=this['locale'],_0x6aabf1=new Cr(_0xf55388,{'queryView':{'label':Wn(_0xf55388,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x5db2e8,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Wn(_0xf55388,'Empty\x20history'),'secondary':Wn(_0xf55388,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x6aabf1['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x4c9b42,_0x222ab3)=>_0x4c9b42&&!_0x222ab3),this['listenTo'](_0x6aabf1,'submit',(_0xc4f92b,_0x75f7c9)=>{this['prompt']=_0x75f7c9;const _0x21d2e3=_0xac888d(_0x75f7c9);this['fire']('submitPrompt',_0x21d2e3),_0x75f7c9['trim']()&&this['_promptHistory']['add']({'prompt':_0x21d2e3},0x0);},{'priority':'high'}),_0x6aabf1;}['_createHistoryView'](){const _0x2cf876=new Hr(this['locale']);return _0x2cf876['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Rr),_0x2cf876['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x2cf876;}['_createToolbar'](){const _0x284592=new Ar(this['locale']);return _0x284592['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x4f4174,_0x301489,_0x258420)=>_0x4f4174&&!_0x301489&&!!_0x258420),_0x284592['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x284592['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x5a5386,_0x47df93,_0x2d93f1)=>_0x5a5386&&!_0x47df93&&!!_0x2d93f1),_0x284592['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x284592['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2dcd59,_0x46e8d0)=>_0x2dcd59&&!_0x46e8d0),_0x284592['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x284592['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x284592['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x284592;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x3b5570=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Wn(_0x3b5570,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x2e745b){const _0x1d79a4=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x2e745b||Wn(_0x1d79a4,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x511be8{['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[_0x4d7ada,a,K,_0x6460a2];}constructor(_0x53b281){super(_0x53b281),_0x53b281['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x53b281['config']['define']('ai.assistant.contentAreaCssClass',''),_0x53b281['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x53b281['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x687472}=this;this['_aiAdapter']=_0x687472['plugins']['get'](K),this['_dialog']=_0x687472['plugins']['get'](_0x6460a2),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x30f06b=new E(_0x687472,Array['from'](this['_commandDefinitions']['values']()));_0x687472['commands']['add']('showAIAssistant',_0x30f06b),_0x687472['ui']['componentFactory']['add']('aiCommands',_0x4ac41b=>{const _0x4c0518=_0x546896(_0x4ac41b);return _0x4c0518['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x4c0518['buttonView']['set']({'label':Wn(_0x4ac41b,'AI\x20Commands'),'icon':_0x2ff5c5,'tooltip':!0x0}),_0x4c0518['on']('execute',_0x3ff2ce=>this['_onExecute'](_0x3ff2ce['source']['id'])),_0xf23687(_0x4c0518,_0x687472['ui']['view']['body'],function(_0x5591fb){const _0x428786=o(_0x5591fb['config']['get']('ai.assistant.commands'),_0x5591fb['locale']),_0x50a718=B(_0x5591fb,_0x428786)['filter'](_0x185f87=>_0x185f87['commands']['length']);if(0x1===_0x50a718['length'])return B(_0x5591fb,_0x50a718[0x0]['commands'])['map'](_0x285c2f=>({'id':_0x285c2f['id'],'label':_0x285c2f['label']}));return _0x50a718['map'](_0x56b44c=>{const {groupId:_0x2c9d5a,groupLabel:_0x27a845,commands:_0x3ee87a}=_0x56b44c,_0x24eb87=B(_0x5591fb,_0x3ee87a)['map'](_0x541239=>({'id':_0x541239['id'],'label':_0x541239['label']}));return{'id':_0x2c9d5a,'menu':_0x27a845||_0x2c9d5a,'children':_0x24eb87};});}(_0x687472),{'ariaLabel':Wn(_0x4ac41b,'AI\x20Commands')}),_0x4c0518['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x30f06b['on']('change:enabledCommandsIds',_0x21cc9e),_0x4c0518['menuView']['once']('render',_0x21cc9e),_0x4c0518;function _0x21cc9e(){_0x4c0518['isEnabled']=_0x30f06b['enabledCommandsIds']['length']>0x0;for(const _0x5e0bc5 of _0x4c0518['menuView']['buttons'])_0x5e0bc5['isEnabled']=_0x30f06b['enabledCommandsIds']['includes'](_0x5e0bc5['id']);}}),_0x687472['ui']['componentFactory']['add']('menuBar:aiCommands',_0x1f50ba=>{const _0x3fc49d=new _0x53e868(_0x1f50ba);_0x3fc49d['buttonView']['set']({'label':Wn(_0x1f50ba,'AI\x20Commands'),'icon':_0x2ff5c5}),_0x3fc49d['bind']('isEnabled')['to'](_0x30f06b,'enabledCommandsIds',_0x538551=>_0x538551['length']>0x0);const _0x16d617=o(_0x687472['config']['get']('ai.assistant.commands'),_0x1f50ba);return this['_populateMenuBarMenu'](_0x30f06b,_0x3fc49d,_0x16d617,_0x3c4066=>this['_onExecute'](_0x3c4066)),_0x3fc49d;}),_0x687472['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x1b9e05=this['_createAIAssistantUIButton'](_0x1e9460);return _0x1b9e05['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x1b9e05;}),_0x687472['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x4f35e1=this['_createAIAssistantUIButton'](_0x12221a);return _0x4f35e1['set']({'role':'menuitemcheckbox'}),_0x4f35e1;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x39240c=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x428ff1;for(const _0x107ab8 in _0x39240c){const _0x53f0d1=_0x107ab8,_0x2b6699=_0x39240c[_0x53f0d1];if('aiLicenseKeyValid'==_0x2b6699||'aiLicenseKeyInvalid'==_0x2b6699||'aiLicenseKeyExpired'==_0x2b6699||'aiLicenseKeyDomainLimit'==_0x2b6699||'aiLicenseKeyNotAllowed'==_0x2b6699||'aiLicenseKeyEvaluationLimit'==_0x2b6699||'aiLicenseKeyUsageLimit'==_0x2b6699){delete _0x39240c[_0x53f0d1],_0x428ff1=_0x2b6699,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x428ff1&&_0x39240c['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x428ff1&&_0x39240c['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x428ff1&&_0x39240c['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x428ff1&&_0x39240c['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x428ff1&&_0x39240c['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x428ff1&&_0x39240c['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x591c5b='',_0x2d8c6a='',_0x299463='custom'){const _0x54215b=this['editor'],_0x192a06=_0x54215b['editing']['view'],_0x1cceaf=_0x54215b['plugins']['get'](a),_0x4c040a=_0x54215b['plugins']['get'](_0x4d7ada);_0x1cceaf['showFakeVisualSelection']();const _0x47d675=new w(),_0x57387c=new ClipboardEvent('copy',{'clipboardData':_0x47d675}),_0x421107=new _0xab6e54(_0x47d675),_0x4581d4=new _0x4f929f(_0x192a06,_0x57387c,{'dataTransfer':_0x421107});_0x4c040a['_forceMarkersCopy']('comment',()=>{_0x192a06['document']['fire']('copy',_0x4581d4);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x54215b,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x3c702b=_0x421107['getData']('text/html');const _0x1a49c9=_0x54215b['model']['document']['selection'],_0x4d47d6=Array['from'](_0x1a49c9['getRanges']());0x1===_0x4d47d6['length']&&_0x4d47d6[0x0]['isFlat']&&!_0x1a49c9['getSelectedElement']()&&''!==_0x3c702b['replace'](/&nbsp;/g,'')['trim']()&&(_0x3c702b='<p>'+_0x3c702b+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x299463,'query':_0x591c5b,'htmlContent':_0x3c702b,'label':_0x2d8c6a,'mainActionLabel':_[_0x54215b['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x98228,'title':Wn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x48fc7b['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x1cceaf['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x44fb04=new Map(),_0x29d782=o(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x34cacc of _0x29d782)for(const _0x3bf099 of _0x34cacc['commands'])_0x44fb04['set'](_0x3bf099['id'],{..._0x3bf099,'groupId':_0x34cacc['groupId'],'groupLabel':_0x34cacc['groupLabel']||_0x34cacc['groupId']});return _0x44fb04;}['_createAIAssistantUIButton'](_0x1af570){const _0x4629cb=this['editor'],_0x3209d3=_0x4629cb['commands']['get']('showAIAssistant'),_0x2de4c7=new _0x1af570(_0x4629cb['locale']);return _0x2de4c7['set']({'label':Wn(_0x4629cb['locale'],'AI\x20Assistant'),'icon':_0x98228,'isToggleable':!0x0}),_0x2de4c7['bind']('isEnabled')['to'](_0x3209d3),_0x2de4c7['bind']('isOn')['to'](this['_dialog'],'id',_0x1bed54=>'aiAssistant'===_0x1bed54),this['listenTo'](_0x2de4c7,'execute',()=>{_0x2de4c7['isOn']?this['hideUI']():_0x3209d3['execute']();}),_0x2de4c7;}['_initView'](){const _0x5d33de=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',()=>{_0x5d33de['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x5d33de['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x2bfa3e,ui:{ariaLiveAnnouncer:_0x42cb98}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0xb51175,_0x1df781,_0x16a31d)=>{const _0x36980a=this['_aiAssistantController']['currentContext'];_0x16a31d?_0x42cb98['announce'](Wn(_0x2bfa3e,'AI\x20is\x20writing')):_0x36980a&&_0x42cb98['announce'](Wn(_0x2bfa3e,'Generated\x20content:\x20%0',_0x36980a),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x5bf590,_0x25bdc1,_0x46b709)=>{if(_0x46b709){const _0x31c589=this['_formView']['errorView']['text'];_0x42cb98['announce'](Wn(_0x2bfa3e,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x31c589));}});}['_onExecute'](_0xbcf99f){const _0x4a7c47=this['_commandDefinitions']['get'](_0xbcf99f),_0x1e2338=this['editor'],_0x3710e8=_0x1e2338['model']['document']['selection'],_0x1244b6=_0x1e2338['commands']['get']('showAIAssistant'),_0x258e7a=_0x1e2338['plugins']['get'](a),_0x262050=''+(_0x4a7c47['groupId']!==x?_0x4a7c47['groupLabel']+':\x20':'')+_0x4a7c47['label'];if(!0x1!==_0x4a7c47['requiresContent']&&_0x3710e8['isCollapsed']){const _0x4124e4=_0x17af57(_0x3710e8['getSelectedBlocks']())||_0x1e2338['model']['schema']['getLimitElement'](_0x3710e8);_0x1e2338['model']['change'](_0x10819f=>{_0x10819f['setSelection'](_0x4124e4,'in');});}_0x258e7a['showFakeVisualSelection'](),_0x1244b6['execute'](_0x4a7c47['prompt'],_0x262050,'command:'+_0xbcf99f);}['_populateMenuBarMenu'](_0x56c613,_0x1924dc,_0x4fc84f,_0x450039){const _0x1e19e9=this['editor'],_0x8bdba1=_0x1e19e9['locale'],_0x35fb08=new _0x685ce2(_0x8bdba1),_0x3a3488=B(_0x1e19e9,_0x4fc84f)['filter'](_0x432de7=>_0x432de7['commands']['length']);0x1===_0x3a3488['length']?this['_getMenuBarGroupButtons']({'command':_0x56c613,'commands':_0x3a3488[0x0]['commands'],'parentMenuView':_0x1924dc,'onExecute':_0x450039})['forEach'](_0x440438=>_0x35fb08['items']['add'](_0x440438)):_0x3a3488['forEach'](({groupId:_0x5d292d,groupLabel:_0xbe915b,commands:_0x24ade9})=>{const _0x4351bd=new _0x217236(_0x8bdba1,_0x1924dc),_0x44a6c1=new _0x53e868(_0x8bdba1),_0x1f2108=new _0x685ce2(_0x8bdba1),_0x30ad1d=this['_getMenuBarGroupButtons']({'command':_0x56c613,'commands':_0x24ade9,'parentMenuView':_0x44a6c1,'onExecute':_0x450039});_0x44a6c1['buttonView']['set']({'label':_0xbe915b||_0x5d292d}),_0x44a6c1['delegate']('execute')['to'](_0x1924dc),_0x1f2108['items']['addMany'](_0x30ad1d),_0x44a6c1['panelView']['children']['add'](_0x1f2108),_0x4351bd['children']['add'](_0x44a6c1),_0x35fb08['items']['add'](_0x4351bd);}),_0x1924dc['panelView']['children']['add'](_0x35fb08);}['_getMenuBarGroupButtons']({command:_0x587aef,commands:_0x4bdbab,parentMenuView:_0x2f632d,onExecute:_0x5eb665}){const _0x4053fe=this['editor'],_0x39b24b=_0x4053fe['locale'];return B(_0x4053fe,_0x4bdbab)['map'](_0x1f8a49=>{const _0x59e36a=new _0x217236(_0x39b24b,_0x2f632d),_0x6ae85c=new _0x12221a(_0x39b24b);return _0x6ae85c['set']({'label':_0x1f8a49['label']}),_0x6ae85c['delegate']('execute')['to'](_0x2f632d),_0x6ae85c['on']('execute',()=>_0x5eb665(_0x1f8a49['id'])),_0x6ae85c['bind']('isEnabled')['to'](_0x587aef,'enabledCommandsIds',_0x1d2f64=>_0x1d2f64['includes'](_0x1f8a49['id'])),_0x59e36a['children']['add'](_0x6ae85c),_0x59e36a;});}}function U(_0x531977,_0x551714){return void 0x0!==_0x531977['order']&&void 0x0===_0x551714['order']?0x1:void 0x0===_0x531977['order']&&void 0x0!==_0x551714['order']?-0x1:void 0x0!==_0x531977['order']&&void 0x0!==_0x551714['order']?_0x531977['order']-_0x551714['order']:0x0;}function B(_0x4258cb,_0x20780b){_0x20780b['sort'](U);const _0x442229={},_0x21b155=[];for(const _0x2a47ae of _0x20780b)if(void 0x0!==_0x2a47ae['order']){if(_0x2a47ae['order']in _0x442229)throw new _0x36ca17('ai-commands-config-order-collision',_0x4258cb,{'conflictingDefinitions':[_0x2a47ae,_0x442229[_0x2a47ae['order']]]});_0x442229[_0x2a47ae['order']]=_0x2a47ae,_0x21b155['splice'](_0x2a47ae['order'],0x0,_0x2a47ae);}else _0x21b155['push'](_0x2a47ae);return _0x21b155;}class $n extends _0x511be8{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x49befc){super(_0x49befc);const _0x899778=_0x49befc['config'],_0xadefd4=_0x49befc['locale'];_0x899778['define']('ai.assistant.preserveComments',!0x0),_0x899778['define']('ai.assistant.commands',qn(_0xadefd4)),_0x899778['define']('ai.assistant.extraCommandGroups',[]),_0x899778['define']('ai.assistant.removeCommands',[]);let _0x45aafe=o(_0x899778['get']('ai.assistant.commands'),_0xadefd4);const _0xf30427=_0x899778['get']('ai.assistant.extraCommandGroups'),_0x5c6e4c=_0x899778['get']('ai.assistant.removeCommands');_0xf30427['forEach'](_0x3b650e=>{const _0x1dfd4d=_0x45aafe['find'](_0x3ed13f=>_0x3ed13f['groupId']===_0x3b650e['groupId']);_0x1dfd4d?_0x1dfd4d['commands']=_0x1dfd4d['commands']['concat'](_0x3b650e['commands']):_0x45aafe['push'](_0x3b650e);}),_0x45aafe=_0x45aafe['filter'](_0x4f0b5f=>!_0x5c6e4c['includes'](_0x4f0b5f['groupId'])),_0x45aafe['forEach'](_0x389003=>{_0x389003['commands']=_0x389003['commands']['filter'](_0x26859c=>!_0x5c6e4c['includes'](_0x26859c['id']));}),_0x899778['set']('ai.assistant.commands',_0x45aafe);}}function qn(_0x19a605){return[{'groupId':'editOrReview','groupLabel':Wn(_0x19a605,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Wn(_0x19a605,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Wn(_0x19a605,'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(_0x19a605,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Wn(_0x19a605,'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(_0x19a605,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Wn(_0x19a605,'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(_0x19a605,'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(_0x19a605,'Change\x20tone'),'commands':[{'id':'professional','label':Wn(_0x19a605,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Wn(_0x19a605,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Wn(_0x19a605,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Wn(_0x19a605,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Wn(_0x19a605,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Wn(_0x19a605,'Change\x20style'),'commands':[{'id':'business','label':Wn(_0x19a605,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Wn(_0x19a605,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Wn(_0x19a605,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Wn(_0x19a605,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Wn(_0x19a605,'Translate'),'commands':[{'id':'translateEnglish','label':Wn(_0x19a605,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Wn(_0x19a605,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Wn(_0x19a605,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Wn(_0x19a605,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Wn(_0x19a605,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Wn(_0x19a605,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Wn(_0x19a605,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Wn(_0x19a605,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ar extends _0x511be8{['abortController'];static get['requires'](){return[K];}constructor(_0xd19eab){super(_0xd19eab),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'](_0x355fb6){return this['sendRequest'](_0x355fb6)['catch'](_0x500724=>{if(_0x500724 instanceof er)return Promise['reject'](_0x500724);if('AbortError'==_0x500724['name'])return Promise['resolve']();throw console['error'](_0x500724),new _0x36ca17('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x584db7,_0x5adde8){const _0x28e32d=this['editor']['locale'],_0x4e6019={'Content-Type':'application/json'};if('object'==typeof _0x584db7)Object['assign'](_0x4e6019,_0x584db7);else{if(_0x584db7)try{const _0x41e4aa=await _0x584db7(_0x5adde8);Object['assign'](_0x4e6019,_0x41e4aa);}catch{return Promise['reject'](new er(Wn(_0x28e32d,'AI_ERROR_GET_HEADERS')));}}return _0x4e6019;}async['_prepareRequestParameters'](_0x2b64aa,_0x278a7a){const _0x56fcf0=this['editor']['locale'];if('object'==typeof _0x2b64aa)return _0x2b64aa;try{return await _0x2b64aa(_0x278a7a);}catch{return Promise['reject'](new er(Wn(_0x56fcf0,'AI_ERROR_GET_PARAMETERS')));}}}class Qn extends ar{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x5c1e6b){super(_0x5c1e6b),_0x5c1e6b['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x5c1e6b['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x5c1e6b['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x5c1e6b['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x5c1e6b['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x5c1e6b['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x5463f5,context:_0x181db5,onData:_0x2b6099,actionId:_0x20cd0d}){const _0x87b9a3=this['editor']['locale'],_0x3c2220=await this['prepareMessages'](_0x5463f5,_0x181db5,_0x20cd0d),_0x277082=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x20cd0d),_0x156af8=await this['_prepareRequestParameters'](this['_requestParameters'],_0x20cd0d),_0x418e19={'messages':_0x3c2220,..._0x156af8},_0x54c684={'method':'POST','headers':_0x277082,'body':JSON['stringify'](_0x418e19),'signal':this['abortController']['signal']},_0x5edd97=await fetch(this['_apiUrl'],_0x54c684);if(_0x5edd97['ok'])return _0x156af8['stream']?await this['_readStreamableResponse'](_0x5edd97,_0x2b6099):await this['_readStaticResponse'](_0x5edd97,_0x2b6099),Promise['resolve']();{const _0x50e145=await _0x5edd97['text']();return _0x50e145['includes']('context_length_exceeded')?Promise['reject'](new er(Wn(_0x87b9a3,'AI_ERROR_CONTEXT_LENGTH'))):_0x50e145['includes']('Moderation')?Promise['reject'](new er(Wn(_0x87b9a3,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x50e145));}}async['prepareMessages'](_0x38d777,_0x2876b8,_0x4dee6c){let _0x1ae003,_0xb48ffb;return _0x2876b8?(_0x1ae003='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.',_0xb48ffb='Instruction:\x0a'+_0x38d777+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x2876b8):(_0x1ae003='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.',_0xb48ffb=_0x38d777),[{'role':'system','content':_0x1ae003},{'role':'user','content':_0xb48ffb}];}async['_readStreamableResponse'](_0x184296,_0x4d86d0){const _0x3bfe8f=_0x184296['body']['getReader'](),_0xa191ed=new TextDecoder();let _0x2179f0='',_0x42e334='',_0x405c51='',_0x27085c=!0x1;for(;!_0x27085c;){const {done:_0x3ac17e,value:_0x229114}=await _0x3bfe8f['read'](),_0x7ee901=_0x2179f0+_0xa191ed['decode'](_0x229114);let _0xd9d460='';_0x27085c=_0x3ac17e;try{_0xd9d460=this['_cleanUpData'](_0x7ee901),_0x2179f0='';}catch{_0x2179f0=_0x7ee901;continue;}_0x42e334+=_0xd9d460,!_0x27085c&&this['_isBufferIncomplete'](_0x42e334)||_0x42e334&&(_0x405c51+=_0x42e334,_0x42e334='',_0x4d86d0(_0x405c51));}return Promise['resolve']();}async['_readStaticResponse'](_0x3dea7b,_0x313b4e){return _0x313b4e((await _0x3dea7b['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x552e0b){const _0x323591=_0x552e0b['split']('<')['length']!==_0x552e0b['split']('>')['length'],_0x35c523=_0x552e0b['length']<0x1e;return _0x323591&&_0x35c523;}['_cleanUpData'](_0x300043){return _0x300043['split'](/\n(?![^{]*\})/g)['map'](_0x46748e=>_0x46748e['replace']('data:\x20',''))['filter'](_0x92f0ff=>_0x92f0ff&&_0x92f0ff['length']>0x0&&'[DONE]'!==_0x92f0ff)['map'](_0x405f24=>{const {choices:_0x2c8324}=JSON['parse'](_0x405f24);if(_0x2c8324[0x0]?.['delta']?.['content'])return _0x2c8324[0x0]['delta']['content'];})['filter'](_0x33fbf0=>_0x33fbf0)['join']('');}}class Xn extends ar{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),_0x3bfc82('ai-aws-adapter-not-supported');}async['sendRequest'](_0x3a08b1){throw gt('ai-aws-adapter-not-supported'),new er(Wn(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class ia extends _0x1e9460{constructor(_0x1c0793,_0x18a0ab={}){super(_0x1c0793),this['isToggleable']=!0x0,this['set']('side',_0x18a0ab['side']||'top');const _0x48ac15=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x2d74dd(_0x18a0ab['class']||[]),_0x48ac15['to']('side',_0xccb7c1=>'ck-tab-button_'+_0xccb7c1),_0x48ac15['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x184e76{['children'];constructor(_0x5f4140,_0x53dc24={}){super(_0x5f4140);const _0xcef25=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x2d74dd(_0x53dc24['class']||[]),_0xcef25['to']('class'),_0xcef25['if']('isVisible','ck-hidden',_0x401736=>!_0x401736)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x184e76{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x388d60,_0x38695e={}){super(_0x388d60),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x38695e['side']||'top'),this['set']('isMaximized',!0x1);const _0x3a637e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x2d74dd(_0x38695e['class']||[]),_0x3a637e['to']('side',_0x2b5553=>'ck-tabs_'+_0x2b5553),_0x3a637e['to']('class'),_0x3a637e['to']('isMaximized',_0x2bedd9=>_0x2bedd9?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x3a637e['to']('side',_0x29aab9=>'ck-tabs__buttons-container_'+_0x29aab9)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x3a637e['to']('side',_0x2a2174=>'ck-tabs__panels-container_'+_0x2a2174)]},'children':this['panelViews']},..._0x2d74dd(_0x38695e['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x1b07a6){const _0x292e4e=this['_tabs']['get'](_0x1b07a6);return _0x292e4e||null;}['addTab'](_0x52daa6){const _0x247c62=this['_setupButton']({'id':_0x52daa6['id'],'label':_0x52daa6['buttonLabel'],'icon':_0x52daa6['buttonIcon'],'order':_0x52daa6['order']}),_0x4885eb=new ea(this['locale']);return _0x4885eb['render'](),_0x52daa6['content']&&_0x4885eb['children']['add'](_0x52daa6['content']),this['panelViews']['add'](_0x4885eb),this['_tabs']['set'](_0x52daa6['id'],{'button':_0x247c62,'panel':_0x4885eb,'order':void 0x0!==_0x52daa6['order']?_0x52daa6['order']:null}),this['fire']('addTab:'+_0x52daa6['id'],{'id':_0x52daa6['id'],'button':_0x247c62,'panel':_0x4885eb}),null===this['activeTab']?this['activateTab'](_0x52daa6['id']):this['_hidePanel'](_0x52daa6['id']),{'button':_0x247c62,'panel':_0x4885eb};}['activateTab'](_0x4a7677){if(null!==_0x4a7677&&!this['getTab'](_0x4a7677))throw new _0x36ca17('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x4a7677});this['activeTab']!==_0x4a7677&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x4a7677,_0x4a7677&&this['_showPanel'](_0x4a7677),this['fire']('activateTab:'+_0x4a7677,_0x4a7677));}['showTab'](_0x3f16b6){if(!this['getTab'](_0x3f16b6))throw new _0x36ca17('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x3f16b6});this['_showPanel'](_0x3f16b6),this['_showButton'](_0x3f16b6),this['fire']('show:'+_0x3f16b6,_0x3f16b6);}['hideTab'](_0x11026e){if(!this['getTab'](_0x11026e))throw new _0x36ca17('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x11026e});const _0x4e5606=this['activeTab'];this['_hidePanel'](_0x11026e),this['_hideButton'](_0x11026e);const _0x37517b=this['getTabIds']();_0x4e5606===_0x11026e&&_0x37517b['length']>0x1&&this['activateTab'](_0x37517b['find'](_0x304937=>_0x304937!==_0x11026e)),this['fire']('hide:'+_0x11026e,_0x11026e);}['_getPanel'](_0x59baf3){const _0x3e4a22=this['_tabs']['get'](_0x59baf3);return _0x3e4a22?_0x3e4a22['panel']:null;}['_showPanel'](_0x4bf576){null!==this['activeTab']&&this['activeTab']!==_0x4bf576||this['_getPanel'](_0x4bf576)['show']();}['_hidePanel'](_0xb36aee){const _0x3de5c0=this['_getPanel'](_0xb36aee);_0x3de5c0['isVisible']&&(this['activeTab']===_0xb36aee&&(this['activeTab']=null),_0x3de5c0['hide']());}['_getButton'](_0x580dea){const _0x2e3bdd=this['_tabs']['get'](_0x580dea);return _0x2e3bdd?_0x2e3bdd['button']:null;}['_showButton'](_0x36c462){this['_getButton'](_0x36c462)['show']();}['_hideButton'](_0x347f18){this['_getButton'](_0x347f18)['hide']();}['_setupButton'](_0x24e041){const _0x917302=new ia(this['locale'],{'side':this['side']}),_0xd44c83=this['buttonViews'];if(_0x917302['set']({'label':_0x24e041['label'],'icon':_0x24e041['icon'],'tooltip':!0x0,'withText':!0x0}),_0x917302['bind']('isOn')['to'](this,'activeTab',_0x5f2715=>_0x5f2715===_0x24e041['id']),_0x917302['bind']('side')['to'](this,'side'),_0x24e041['order']){const _0x542613=[...this['_tabs']]['reduce']((_0x2f91b0,_0x4ec658)=>{const _0x3bceeb=_0x4ec658[0x0],{order:_0xfc61b1}=_0x4ec658[0x1];return!_0xfc61b1||_0xfc61b1>_0x24e041['order']?_0x2f91b0:_0xfc61b1>=_0x2f91b0['order']?{'id':_0x3bceeb,'order':_0xfc61b1}:_0x2f91b0;},{'id':'','order':0x0}),_0x28bac9=_0xd44c83['getIndex'](this['_getButton'](_0x542613['id']));_0xd44c83['add'](_0x917302,_0x28bac9+0x1);}else _0xd44c83['add'](_0x917302);return _0x917302['on']('execute',()=>{this['activateTab'](_0x24e041['id']);}),_0x917302;}}const ni=['overlay','sidebar','custom'],oi=['left','right'];class hi extends ss{constructor(_0x39f0d3,_0x5b84bd={}){super(_0x39f0d3,_0x5b84bd),this['set']('type',_0x5b84bd['type']||'sidebar'),this['set']('side',_0x5b84bd['side']||'right'),this['set']('isVisible',_0x5b84bd['visibleByDefault']??!0x0);const _0xcae935=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0xcae935['if']('type','ck-ai-tabs__overlay',_0x42c42e=>'overlay'===_0x42c42e),_0xcae935['if']('type','ck-ai-tabs__sidebar',_0x4b6b8c=>'sidebar'===_0x4b6b8c),_0xcae935['if']('isVisible','ck-hidden',_0x13501b=>!_0x13501b)]}}),this['buttonViews']['on']('add',(_0x5c1527,_0x45dfe7)=>{_0x45dfe7['set']('withText',!0x1);});}}class pt extends _0x575928{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x52100b){super(_0x52100b);const _0x38f5dd=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x38f5dd)throw new _0x36ca17('ai-tabs-configuration-not-found');if(void 0x0!==_0x38f5dd['showResizeButton']&&(this['showResizeButton']=_0x38f5dd['showResizeButton']),'sidebar'!==_0x38f5dd['type']&&'overlay'!==_0x38f5dd['type']||_0x38f5dd['side']&&(this['side']=_0x38f5dd['side']),'sidebar'===_0x38f5dd['type']){if(this['container']=_0x38f5dd['element'],this['set']('type','sidebar'),!this['container'])throw new _0x36ca17('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x38f5dd['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===_0x38f5dd['visibleByDefault']||_0x38f5dd['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'](_0x2bb3ad){if(_0x2bb3ad&&this['type']!==_0x2bb3ad){if(!ni['includes'](_0x2bb3ad))throw new _0x36ca17('ai-tabs-unsupported-ui-type');this['type']=_0x2bb3ad;}}['switchSide'](_0x144d9d){if(_0x144d9d&&this['side']!==_0x144d9d){if(!oi['includes'](_0x144d9d))throw new _0x36ca17('ai-tabs-unsupported-ui-side');this['side']=_0x144d9d;}}['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 _0x575928{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4c648e){super(_0x4c648e),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 _0xaa092b=this['context']['plugins']['get']('CloudServices');if(!_0xaa092b['token'])throw new _0x36ca17('ai-missing-token',this);this['_token']=_0xaa092b['token'];}['startConversation'](_0x13727,_0x183be4){const _0x5b506d=this['_sendApiRequest']('/conversations','POST',{'id':_0x13727,'group':_0x183be4});return{'getConversation':async()=>(await _0x5b506d['request'])['json'](),'abortController':_0x5b506d['abortController']};}['queryAssistant']({message:_0x4ef975,conversationId:_0x51d836,parts:_0x36e6dc,capabilities:_0xb1ca7b,model:_0x229b12,attributes:_0x1c84a1}){const _0x4dfaa4={'prompt':_0x4ef975,'content':_0x36e6dc,'model':_0x229b12,..._0xb1ca7b&&{'capabilities':_0xb1ca7b},..._0x1c84a1&&{'attributes':_0x1c84a1}},_0x2bf02f=this['_sendApiRequest']('/conversations/'+_0x51d836+'/messages','POST',_0x4dfaa4);return{'getStream':async()=>{const _0x48bf7c=(await _0x2bf02f['request'])['body'];return this['_getStreamReader'](_0x48bf7c);},'abortController':_0x2bf02f['abortController']};}['executeCustomAction']({content:_0x56605f,message:_0x5c6862,model:_0x5e089c,outputFormat:_0xcf6b33}){const _0x1328b2={'content':[{'type':'text','content':_0x56605f}],'prompt':_0x5c6862,'model':_0x5e089c,'outputFormat':_0xcf6b33},_0x32138f=this['_sendApiRequest']('/actions/custom/calls','POST',_0x1328b2);return{'getStream':async()=>{const _0x1b81f1=(await _0x32138f['request'])['body'];return this['_getStreamReader'](_0x1b81f1);},'abortController':_0x32138f['abortController']};}['executeAction']({actionName:_0x1ea320,content:_0x1f0d30,args:_0x751e59}){const _0x163ac2={'content':[{'type':'text','content':_0x1f0d30}],'args':_0x751e59},_0x1efedc=this['_sendApiRequest']('/actions/system/'+_0x1ea320+'/calls','POST',_0x163ac2);return{'getStream':async()=>{const _0x4bd5a1=(await _0x1efedc['request'])['body'];return this['_getStreamReader'](_0x4bd5a1);},'abortController':_0x1efedc['abortController']};}['uploadFile'](_0x5ef699,_0x1bc88e,_0x1c38cf){const _0x472286=new FormData();_0x472286['append']('file',_0x1bc88e,_0x1bc88e['name']),_0x1c38cf&&_0x472286['append']('attributes',JSON['stringify'](_0x1c38cf));const _0x24a78c=this['_sendApiRequest']('/conversations/'+_0x5ef699+'/files','POST',_0x472286);return{'getId':async()=>(await _0x24a78c['request'])['json'](),'abortController':_0x24a78c['abortController']};}['fetchDocument'](_0x42b6ec,_0x32f4cb){const _0x5c0e56=this['_sendApiRequest']('/conversations/'+_0x42b6ec+'/documents/'+_0x32f4cb,'GET');return{'getDocument':async()=>(await _0x5c0e56['request'])['json'](),'abortController':_0x5c0e56['abortController']};}['uploadDocument'](_0x5d2cd9,_0x26440c,_0x4c890b){const _0x342104={'content':_0x26440c};_0x4c890b&&(_0x342104['attributes']=_0x4c890b);const _0x453bbf=this['_sendApiRequest']('/conversations/'+_0x5d2cd9+'/documents','POST',_0x342104);return{'getId':async()=>(await _0x453bbf['request'])['json'](),'abortController':_0x453bbf['abortController']};}['fetchConversations'](_0x5f55c6,_0x3a5621={}){const _0x5d1a87=new URLSearchParams();_0x5d1a87['append']('group',_0x5f55c6),_0x5d1a87['append']('excludeEmpty',!0x1!==_0x3a5621['excludeEmpty']?'true':'false'),_0x5d1a87['append']('limit',_0x3a5621['limit']?_0x3a5621['limit']['toString']():'100'),_0x5d1a87['append']('sortBy',_0x3a5621['sortBy']?_0x3a5621['sortBy']:'createdAt'),_0x5d1a87['append']('order',_0x3a5621['order']?_0x3a5621['order']:'desc');const _0x29db73=this['_sendApiRequest']('/conversations?'+_0x5d1a87['toString'](),'GET');return{'getConversations':async()=>{const _0x3d3e97=await _0x29db73['request'];return(await _0x3d3e97['json']())['items'];},'abortController':_0x29db73['abortController']};}['deleteConversation'](_0x1dde3e){const _0x59e8dc=this['_sendApiRequest']('/conversations/'+_0x1dde3e,'DELETE');return{'execute':async()=>{await _0x59e8dc['request'];},'abortController':_0x59e8dc['abortController']};}['updateConversation'](_0x3467bc,_0x447fa2){const _0x2cccbc=this['_sendApiRequest']('/conversations/'+_0x3467bc,'PATCH',_0x447fa2);return{'getResult':async()=>(await _0x2cccbc['request'],_0x447fa2),'abortController':_0x2cccbc['abortController']};}['fetchConversation'](_0x2fd75c){const _0x1de129=this['_sendApiRequest']('/conversations/'+_0x2fd75c,'GET');return{'getConversation':async()=>(await _0x1de129['request'])['json'](),'abortController':_0x1de129['abortController']};}['fetchConversationMessages'](_0x22f30f){const _0x1b9adf=this['_sendApiRequest']('/conversations/'+_0x22f30f+'/messages','GET');return{'getMessages':async()=>{const _0x172ca5=await _0x1b9adf['request'];return(await _0x172ca5['json']())['items'];},'abortController':_0x1b9adf['abortController']};}['uploadUrl'](_0x386aa2,_0x1c773d,_0x4884c9){const _0x135b58=this['_sendApiRequest']('/conversations/'+_0x386aa2+'/web-resources','POST',{'url':_0x1c773d,'attributes':_0x4884c9});return{'getId':async()=>(await _0x135b58['request'])['json'](),'abortController':_0x135b58['abortController']};}['getModels'](_0x40834f='en'){const _0x3c51a2=new URLSearchParams();_0x3c51a2['append']('language',_0x40834f);const _0x58db5b='/models/1?'+_0x3c51a2['toString'](),_0xa12437=this['_sendApiRequest'](_0x58db5b,'GET');return{'list':async()=>await(await _0xa12437['request'])['json'](),'abortController':_0xa12437['abortController']};}['deleteFile'](_0x432bd5,_0x46004b){const _0x20c490=this['_sendApiRequest']('/conversations/'+_0x432bd5+'/files/'+_0x46004b,'DELETE');return{'execute':async()=>{await _0x20c490['request'];},'abortController':_0x20c490['abortController']};}['deleteDocument'](_0x32abc8,_0x550b80){const _0x3f0be4=this['_sendApiRequest']('/conversations/'+_0x32abc8+'/documents/'+_0x550b80,'DELETE');return{'execute':async()=>{await _0x3f0be4['request'];},'abortController':_0x3f0be4['abortController']};}['deleteWebResource'](_0x22b9c0,_0x41f036){const _0x18513d=this['_sendApiRequest']('/conversations/'+_0x22b9c0+'/web-resources/'+_0x41f036,'DELETE');return{'execute':async()=>{await _0x18513d['request'];},'abortController':_0x18513d['abortController']};}['callSystemReview']({reviewName:_0x1b6c01,content:_0xecf623,args:_0x188ec6}){const _0x584607=this['_sendApiRequest']('/reviews/system/'+_0x1b6c01+'/calls','POST',{'content':[{'type':'text','content':_0xecf623}],'args':_0x188ec6});return{'getStream':async()=>{const _0x300098=(await _0x584607['request'])['body'];return this['_getStreamReader'](_0x300098);},'abortController':_0x584607['abortController']};}['callCustomReview']({content:_0x3a0679,prompt:_0x411c3e,model:_0x39afb4}){const _0x49d2a7=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x3a0679}],'prompt':_0x411c3e,'model':_0x39afb4});return{'getStream':async()=>{const _0xd8f782=(await _0x49d2a7['request'])['body'];return this['_getStreamReader'](_0xd8f782);},'abortController':_0x49d2a7['abortController']};}['upsertAIChatRating'](_0x58f65b,_0x54163a,_0x21992a){const _0x3d8122=this['_sendApiRequest']('/conversations/'+_0x58f65b+'/messages/'+_0x54163a+'/ratings','PUT',{'positiveCount':_0x21992a['positiveCount'],'totalCount':_0x21992a['totalCount'],'modificationId':_0x21992a['modificationId']});return{'execute':async()=>{await _0x3d8122['request'];},'abortController':_0x3d8122['abortController']};}['upsertAIActionRating'](_0x46a7f1,_0x3feb63,_0x5749a0){const _0x1c78be=this['_sendApiRequest']('/actions/system/'+_0x46a7f1+'/calls/'+_0x3feb63+'/ratings','PUT',{'positiveCount':_0x5749a0['positiveCount'],'totalCount':_0x5749a0['totalCount']});return{'execute':async()=>{await _0x1c78be['request'];},'abortController':_0x1c78be['abortController']};}['upsertCustomAIActionRating'](_0x26619d,_0x15ad9d){const _0x27ee96=this['_sendApiRequest']('/actions/custom/calls/'+_0x26619d+'/ratings','PUT',{'positiveCount':_0x15ad9d['positiveCount'],'totalCount':_0x15ad9d['totalCount']});return{'execute':async()=>{await _0x27ee96['request'];},'abortController':_0x27ee96['abortController']};}['upsertAIReviewRating'](_0x3c49c0,_0x356bba,_0x33831d,_0x91c817){const _0x3ef49a=this['_sendApiRequest']('/reviews/system/'+_0x3c49c0+'/calls/'+_0x356bba+'/ratings','PUT',{'positiveCount':_0x33831d['positiveCount'],'totalCount':_0x33831d['totalCount'],'dataId':_0x91c817});return{'execute':async()=>{await _0x3ef49a['request'];},'abortController':_0x3ef49a['abortController']};}['upsertCustomAIReviewRating'](_0x1fd9ee,_0x4b371f,_0x3692ec){const _0x5c8a92=this['_sendApiRequest']('/reviews/custom/calls/'+_0x1fd9ee+'/ratings','PUT',{'positiveCount':_0x4b371f['positiveCount'],'totalCount':_0x4b371f['totalCount'],'dataId':_0x3692ec});return{'execute':async()=>{await _0x5c8a92['request'];},'abortController':_0x5c8a92['abortController']};}['_sendApiRequest'](_0x9ee634,_0x3bde51,_0x1bdc18){const _0x1a65ff=new AbortController(),_0x10ee4b=_0x1bdc18 instanceof FormData,_0x3baf39={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x1bdc18&&!_0x10ee4b&&(_0x3baf39['Content-Type']='application/json');const _0x3cce8f={'method':_0x3bde51,'headers':_0x3baf39,'signal':_0x1a65ff['signal']};return _0x1bdc18&&(_0x3cce8f['body']=_0x10ee4b?_0x1bdc18:JSON['stringify'](_0x1bdc18)),{'request':fetch(''+this['_apiUrl']+_0x9ee634,_0x3cce8f)['catch'](_0x182876=>{this['_handleError'](_0x182876);})['then'](_0x36e362=>_0x36e362['ok']?_0x36e362:_0x36e362['json']()['then'](_0x10a322=>{throw{'url':this['_apiUrl'],'path':_0x9ee634,'method':_0x3bde51,'body':_0x1bdc18,'status':(_0x36e362||{})['status'],'statusText':(_0x36e362||{})['statusText'],'code':_0x10a322['code'],'message':_0x10a322['message'],'traceId':_0x10a322['traceId']};})),'abortController':_0x1a65ff};}async*['_getStreamReader'](_0x18c3b0){const _0x524879=[],_0xa8ff4c=_0x18c3b0['getReader'](),_0x461a36=$t({'onError':_0x4e5cf2=>{this['_handleError'](_0x4e5cf2);},'onEvent':_0x2a3459=>{_0x2a3459['data']=JSON['parse'](_0x2a3459['data']),_0x524879['push'](_0x2a3459);}});try{let _0x543dd3=!0x1;for(;!_0x543dd3;){const {done:_0x198565,value:_0xdb849e}=await _0xa8ff4c['read']();_0x198565&&(_0x543dd3=!0x0),_0x461a36['feed'](this['_decoder']['decode'](_0xdb849e,{'stream':!0x0})),yield*_0x524879,_0x524879['length']=0x0;}}catch(_0x157352){this['_handleError'](_0x157352);}finally{_0xa8ff4c['releaseLock'](),_0x461a36['reset']();}}['_handleError'](_0x33055f){if(_0x33055f instanceof _0x36ca17)throw _0x33055f;if(_0x33055f instanceof Error&&'AbortError'===_0x33055f['name'])throw new _0x36ca17('ai-request-aborted',this,{'originalError':_0x33055f});throw new _0x36ca17('ai-request-failed',this,{'originalError':_0x33055f});}}function i(_0x4614bf,_0x4dd963,_0x74214e){const t=_0x4614bf['t'];switch(_0x4dd963){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'},_0x74214e);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.'},_0x74214e);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.'},_0x74214e);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.'},_0x74214e);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'},_0x74214e);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x74214e);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'},_0x74214e);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.'},_0x74214e);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.'},_0x74214e);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.'},_0x74214e);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.'},_0x74214e);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'},_0x74214e);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.'},_0x74214e);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 _0x4dd963;}}function Hs(_0x5614a4,_0x51bf4c){const _0xed045c=new _0x1e9460(_0x5614a4),_0x29cf69=i(_0x5614a4,'AI_TABS_LABEL_MINIMIZE'),_0x276d41=i(_0x5614a4,'AI_TABS_LABEL_MAXIMIZE');return _0xed045c['set']({'withText':!0x1,'icon':_0x327f4b,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary'}),_0xed045c['bind']('label')['to'](_0x51bf4c,'isMaximized',_0x3a0132=>_0x3a0132?_0x29cf69:_0x276d41),_0xed045c['bind']('icon')['to'](_0x51bf4c,'isMaximized',_0x3449e0=>_0x3449e0?_0x932832:_0x327f4b),_0xed045c['bind']('isOn')['to'](_0x51bf4c,'isMaximized'),_0xed045c['on']('execute',()=>{_0x51bf4c['fire']('resizeTabs');}),_0xed045c;}function ji(_0x53f9b7){return _0x413294(_0x53f9b7);}function Tt(_0x2caa56){return _0x3807c6(_0x2caa56);}function St(_0x1a76ce,_0x4633ee,_0x53bc75){const _0x84a134=null!==_0x4633ee?_0x24cf62=>_0x24cf62['attribs'][_0x1a76ce]===_0x4633ee:_0xa2c10e=>Boolean(_0xa2c10e['attribs'][_0x1a76ce]);return yt(_0x1a5114=>_0x5d51b2(_0x1a5114)&&_0x84a134(_0x1a5114),_0x53bc75);}function Bi(_0x567161,_0x21befe,_0x3f3d76){const _0xc51332=null!==_0x21befe?_0xd183df=>_0xd183df['attribs'][_0x567161]===_0x21befe:_0x4c138e=>Boolean(_0x4c138e['attribs'][_0x567161]);return _0x3e90f0(_0x545e5d=>_0x5d51b2(_0x545e5d)&&_0xc51332(_0x545e5d),_0x3f3d76);}function At(_0x463cb4,_0x7e7322){return _0x463cb4&&_0x5d51b2(_0x463cb4)?_0x463cb4['attribs'][_0x7e7322]:null;}function Qi(_0x47d618,_0x52799a,_0x5520af){_0x5d51b2(_0x47d618)&&(null===_0x5520af?delete _0x47d618['attribs'][_0x52799a]:_0x47d618['attribs'][_0x52799a]=_0x5520af);}function qi(_0x1e9293,_0x531a19,_0x769739){const _0x368523=_0x531a19['cloneNode'](!0x0);'beforebegin'===_0x769739?_0x2b8438(_0x1e9293,_0x368523):'afterbegin'===_0x769739?_0x12356b(_0x1e9293,_0x368523):'beforeend'===_0x769739?_0x59ec57(_0x1e9293,_0x368523):'afterend'===_0x769739&&_0x2bdf7a(_0x1e9293,_0x368523);}function Gi(_0x18cdc5){const _0x3ce169=[];let _0x4785fb=_0x18cdc5;for(;_0x4785fb;)_0x4785fb=_0x2456ab(_0x4785fb),_0x4785fb&&_0x3ce169['push'](_0x4785fb);return _0x3ce169;}function zn(_0x1efe8e){return _0x1efe8e['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Zi(_0x4ca4a0){let _0x3de5f6=0x0;for(;_0x4ca4a0['parentNode'];)_0x4ca4a0=_0x4ca4a0['parentNode'],_0x3de5f6++;return _0x3de5f6;}function Ns(_0x15e237){const _0x52d912=[];let _0x2ddb67=_0x15e237['nextSibling'];for(;_0x2ddb67;)_0x52d912['push'](_0x2ddb67),_0x2ddb67=_0x2ddb67['nextSibling'];_0x52d912['forEach'](_0x332514=>{_0x4c1d4c(_0x332514);});}class Ui extends/* #__PURE__ -- @preserve */
25
- ts(){['_m2html'];constructor(){super(),this['_m2html']=new _0x26b84e();}['convertMarkdownToHTML'](_0x26bf26){const _0x223e92=this['_m2html']['parse'](_0x26bf26);return this['parseAndNormalizeHTML'](_0x223e92);}['parseAndNormalizeHTML'](_0x2b47a7){return this['_parseHTML'](_0x2b47a7);}['_parseHTML'](_0x59bb95){const _0x682b7=ji('<dummy>'+_0x59bb95['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x682b7['children']=_0x682b7['children'][0x0]['children'],_0x682b7;}}class Ni extends/* #__PURE__ -- @preserve */
26
- ts(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x988c46){super(),this['_generateUid']=_0x988c46||_0x926b30;}['merge'](_0x20506c,_0x5742af,_0x2eadc8){const _0x231535=_0x20506c['cloneNode'](!0x0);if(0x0===_0x5742af['childNodes']['length']){const _0x1bf36b=[];return Bi('data-id','new-element',_0x231535)['forEach'](_0x93028f=>{const _0x3a4bc1=this['_generateUid']();Qi(_0x93028f,'data-id',_0x3a4bc1),_0x1bf36b['push'](_0x3a4bc1);}),this['_removeSpecialComments'](_0x231535),{'parsedContent':_0x231535,'newNodeIds':_0x1bf36b,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x2eadc8&&_0x2eadc8['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x231535),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Bi('data-id',null,_0x5742af)['map'](_0x4c1e0c=>At(_0x4c1e0c,'data-id'))['filter'](_0x1a2457=>!!_0x1a2457));let _0x17c9c8=-0x1,_0x376016=!0x1;const _0x11f42a=_0x231535['childNodes'],_0x2ca0ba=Array['from'](_0x11f42a)['filter'](_0x4df31b=>!(0x3===_0x4df31b['nodeType']&&''===Tt(_0x4df31b)['trim']())),_0x20e946=_0x2ca0ba['length'];for(let _0x5abea4=0x0;_0x5abea4<_0x20e946;_0x5abea4++){const _0x1c641d=_0x2ca0ba[_0x5abea4],_0x2aab75=_0x2ca0ba[_0x5abea4+0x1];if(this['_isNewNode'](_0x1c641d)){if(-0x1===_0x17c9c8&&(_0x17c9c8=_0x5abea4),this['_markWrappedElements'](_0x1c641d),!this['_isNewNode'](_0x2aab75)){const [_0x4e8ae3,_0x43e2a2]=this['_findReferenceNode'](_0x1c641d,_0x376016,_0x5742af);if(_0x4e8ae3){const _0x251a98=Array['from'](_0x2ca0ba)['slice'](_0x17c9c8,_0x5abea4+0x1);this['_insertNodes'](_0x4e8ae3,_0x251a98,_0x43e2a2),_0x17c9c8=-0x1;}}}else{if(this['_isExistingContentComment'](_0x1c641d))_0x376016=!0x0;else{if(this['_isExistingNode'](_0x1c641d)){const _0x26d282=At(_0x1c641d,'data-id');if(_0x26d282&&this['_existingDataIds']['has'](_0x26d282)){const _0x467a0=St('data-id',_0x26d282,_0x5742af);this['_replaceNode'](_0x467a0,_0x1c641d);}if(this['_touchedNodesState']['removedIds']['includes'](_0x26d282)){const _0x36a363=this['_touchedNodesState']['removedIds']['indexOf'](_0x26d282);this['_touchedNodesState']['removedIds']['splice'](_0x36a363,0x1);}}else{if(this['_isDelNode'](_0x1c641d)){const _0x45aa59=At(_0x1c641d,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x45aa59)||this['_storeDeletedElementIds'](_0x1c641d);}}}}}for(const _0x2054b8 of this['_touchedNodesState']['removedIds']){const _0x57826c=St('data-id',_0x2054b8,_0x5742af);if(_0x57826c){if(_0x2eadc8&&_0x2eadc8['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x2054b8;const _0x1314b2=_0x2eadc8['replaceRemovedWith']['cloneNode'](!0x0);Qi(_0x1314b2,'data-id',_0x2054b8),Qi(_0x1314b2,'data-removed','true'),_0x482733(_0x57826c,_0x1314b2);}else _0x4c1d4c(_0x57826c);}}if(Bi('data-wrapped-id',null,_0x5742af)['forEach'](_0x3eb5ce=>{const _0x40aaa4=St('data-id',At(_0x3eb5ce,'data-wrapped-id'),_0x5742af);var _0x207a03,_0x38bffe;_0x40aaa4&&(_0x38bffe=_0x3eb5ce,_0x4c1d4c(_0x207a03=_0x40aaa4),_0x482733(_0x38bffe,_0x207a03));}),Bi('data-id','new-element',_0x5742af)['forEach'](_0x5905ee=>{const _0x5ad740=this['_getUid'](_0x5905ee);Qi(_0x5905ee,'data-id',_0x5ad740),this['_touchedNodesState']['newIds']['push'](_0x5ad740);}),this['_removeSpecialComments'](_0x5742af),_0x2eadc8&&_0x2eadc8['markUnstableElements']&&this['_markUnstableElements'](_0x5742af,_0x2eadc8['markUnstableElementsDepth']||0x0),_0x2eadc8&&_0x2eadc8['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x150ab9=St('data-id',this['_touchedNodesState']['lastTouchedId'],_0x5742af);for(;_0x150ab9;)Ns(_0x150ab9),_0x150ab9=_0x150ab9['parentNode'];}return{'parsedContent':_0x5742af,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x19c871,_0x50fb81,_0xf36e71){for(const _0x3ff4f5 of _0x50fb81){const _0x5f030c=this['_getUid'](_0x3ff4f5);Qi(_0x3ff4f5,'data-id',_0x5f030c),this['_touchedNodesState']['newIds']['push'](_0x5f030c),this['_touchedNodesState']['lastTouchedId']=_0x5f030c;}const _0x3a3090='afterbegin'===_0xf36e71||'afterend'===_0xf36e71?_0x50fb81['reverse']():_0x50fb81;for(const _0x5d763c of _0x3a3090)qi(_0x19c871,_0x5d763c,_0xf36e71);}['_replaceNode'](_0x14337e,_0x328c32){if(!_0x14337e)return;if(_0xf0f532=_0x328c32,zn(Tt(_0x14337e))===zn(Tt(_0xf0f532)))return;var _0xf0f532;const _0x45f19e=this['_getUid'](_0x14337e);Qi(_0x328c32,'data-id',_0x45f19e),this['_touchedNodesState']['modifiedIds']['push'](_0x45f19e),this['_touchedNodesState']['lastTouchedId']=_0x45f19e,_0x482733(_0x14337e,_0x328c32['cloneNode'](!0x0));}['_findReferenceNode'](_0x56f8d5,_0xe22d9f,_0x46bd41){const _0x51359e=this['_findPrevElementWithDataId'](_0x56f8d5,!0x1);if(_0x51359e){const _0x5c78f4=this['_getNodeDataId'](_0x51359e),_0x30be5c=St('data-id',_0x5c78f4,_0x46bd41);if(_0x30be5c)return[_0x30be5c,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x5c78f4);}const _0x149a9a=this['_findNextElementWithDataId'](_0x56f8d5,!0x1);if(_0x149a9a){const _0x36d02b=this['_getNodeDataId'](_0x149a9a),_0x4e6bd3=St('data-id',_0x36d02b,_0x46bd41);if(_0x4e6bd3)return[_0x4e6bd3,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x36d02b);}return _0xe22d9f?_0x56f8d5['nextSibling']?this['_findFallbackReferenceNode'](_0x56f8d5,_0x46bd41):[_0x46bd41['childNodes'][_0x46bd41['childNodes']['length']-0x1],'afterend']:[_0x46bd41['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x30eb69,_0x24f31d){const _0x2fe0f2=[],_0x1115bd=this['_findPrevElementWithDataId'](_0x30eb69,!0x0);if(_0x1115bd){const _0x5306e4=St('data-id',this['_getNodeDataId'](_0x1115bd),_0x24f31d);_0x5306e4&&_0x2fe0f2['push']([_0x5306e4,'afterend']);}const _0x2bc91c=this['_findNextElementWithDataId'](_0x30eb69,!0x0);if(_0x2bc91c){const _0xb010e9=St('data-id',this['_getNodeDataId'](_0x2bc91c),_0x24f31d);_0xb010e9&&_0x2fe0f2['push']([_0xb010e9,'beforebegin']);}if(_0x2fe0f2['length']>0x1)return Zi(_0x2fe0f2[0x0][0x0])<=Zi(_0x2fe0f2[0x1][0x0])?_0x2fe0f2[0x0]:_0x2fe0f2[0x1];return 0x1===_0x2fe0f2['length']?_0x2fe0f2[0x0]:[_0x24f31d['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x415ef9,_0x411955){let _0xbfd8b=_0x415ef9['nextSibling'],_0x49d825=null,_0x21f49c=!0x1;for(;_0xbfd8b;){if(_0x3bac06(_0xbfd8b)){if(this['_isDelNode'](_0xbfd8b)&&(_0x49d825=_0xbfd8b),this['_isExistingContentComment'](_0xbfd8b)&&_0x411955&&!_0x21f49c){_0x21f49c=!0x0,_0xbfd8b=_0xbfd8b['nextSibling'];continue;}break;}const _0x36712b=At(_0xbfd8b,'data-id');if(_0x36712b&&'new-element'!==_0x36712b&&this['_existingDataIds']['has'](_0x36712b)){_0x49d825=_0xbfd8b;break;}_0xbfd8b=_0xbfd8b['nextSibling'];}return _0x49d825;}['_findPrevElementWithDataId'](_0x7c6c76,_0x3b7620){let _0x313fd0=_0x7c6c76['previousSibling'],_0x4b83e0=null,_0x50755a=!0x1;for(;_0x313fd0;){if(_0x3bac06(_0x313fd0)){if(this['_isDelNode'](_0x313fd0)&&(_0x4b83e0=_0x313fd0),this['_isExistingContentComment'](_0x313fd0)&&_0x3b7620&&!_0x50755a){_0x50755a=!0x0,_0x313fd0=_0x313fd0['previousSibling'];continue;}break;}const _0x1f7d91=At(_0x313fd0,'data-id');if(_0x1f7d91&&'new-element'!==_0x1f7d91&&this['_existingDataIds']['has'](_0x1f7d91)){_0x4b83e0=_0x313fd0;break;}_0x313fd0=_0x313fd0['previousSibling'];}return _0x4b83e0;}['_markWrappedElements'](_0x1fdb76){_0x5d51b2(_0x1fdb76)&&Bi('data-id',null,_0x1fdb76)['forEach'](_0x9cf674=>{this['_isExistingNode'](_0x9cf674)&&!this['_hasWrappedParent'](_0x9cf674)&&(Qi(_0x9cf674,'data-wrapped-id',At(_0x9cf674,'data-id')),Qi(_0x9cf674,'data-id',null));});}['_getNodeDataId'](_0x345865){if(!_0x345865)return null;if(_0x5d51b2(_0x345865))return At(_0x345865,'data-id');if(_0x3bac06(_0x345865)){const _0x5d485d=Tt(_0x345865)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x5d485d&&_0x5d485d[0x1])return _0x5d485d[0x1];}return null;}['_storeDeletedElementIds'](_0x5847c0){if(_0x3bac06(_0x5847c0)){const _0x5d70cc=Tt(_0x5847c0)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x5d70cc&&_0x5d70cc[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x5d70cc[0x1]);}}['_getUid'](_0x10fe2c){return this['_isExistingNode'](_0x10fe2c)?At(_0x10fe2c,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x20b599){(function(_0x53f208){return _0x1a1c14(_0x10036d=>_0x3bac06(_0x10036d),_0x53f208,!0x0,0x1/0x0);}(_0x20b599)['filter'](_0x4ae2d1=>this['_isDelNode'](_0x4ae2d1)||this['_isExistingContentComment'](_0x4ae2d1))['forEach'](_0x360587=>{_0x4c1d4c(_0x360587);}));}['_markLastTagElementUnstable'](_0x21ec5b){const _0x153724=_0x21ec5b['childNodes'],_0xea037d=_0x153724[_0x153724['length']-0x1];_0xea037d&&_0x5d51b2(_0xea037d)&&Qi(_0xea037d,'data-unstable','true');}['_markUnstableElements'](_0x45bb5f,_0x82f7a5){const _0x2f0497=St('data-unstable','true',_0x45bb5f);if(!_0x2f0497)return;const _0x50b1e3=Gi(_0x2f0497)['slice'](0x0,-0x1),_0x21f5a8=_0x50b1e3['length'];let _0x80547d=_0x2f0497;if(_0x21f5a8>_0x82f7a5){let _0x3c4909=_0x21f5a8,_0x29ebb9=null;for(;_0x3c4909>_0x82f7a5&&_0x3c4909>=0x0;)_0x3c4909--,_0x29ebb9=_0x50b1e3[_0x3c4909];_0x29ebb9&&(_0x80547d=_0x29ebb9,Qi(_0x2f0497,'data-unstable',null),Qi(_0x29ebb9,'data-unstable','true'));}else{if(_0x21f5a8<_0x82f7a5){let _0x554a4e=_0x21f5a8,_0x39fc9f=_0x2f0497;for(;_0x554a4e<_0x82f7a5;){const _0x4ad305=_0x39fc9f['childNodes']['filter'](_0x2d702b=>_0x5d51b2(_0x2d702b));if(0x0===_0x4ad305['length'])break;_0x554a4e++,_0x39fc9f=_0x4ad305[_0x4ad305['length']-0x1];}_0x39fc9f&&(_0x80547d=_0x39fc9f,Qi(_0x2f0497,'data-unstable',null),Qi(_0x39fc9f,'data-unstable','true'));}}let _0x464ca4=_0x80547d;for(;_0x464ca4;){for(;_0x464ca4['nextSibling'];)_0x464ca4=_0x464ca4['nextSibling'],_0x5d51b2(_0x464ca4)&&Qi(_0x464ca4,'data-unstable','true');_0x464ca4=_0x464ca4['parentNode'];}}['_isNewNode'](_0x17516d){return Boolean('new-element'===At(_0x17516d,'data-id'));}['_isExistingNode'](_0x1c3066){return Boolean((At(_0x1c3066,'data-id')||'')['length']>0x0&&'new-element'!==At(_0x1c3066,'data-id'));}['_isDelNode'](_0x31455e){return!!_0x31455e&&Boolean(_0x3bac06(_0x31455e)&&Tt(_0x31455e)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x5b7694){let _0x430c27=_0x5b7694['parentNode'];for(;_0x430c27;){if(At(_0x430c27,'data-wrapped-id'))return!0x0;_0x430c27=_0x430c27['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x39eb06){return Boolean(_0x3bac06(_0x39eb06)&&Tt(_0x39eb06)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function J({editor:_0x92c037,changeGroups:_0x52e582,documentContextContent:_0xe7689a,showDiff:_0x1cfd78,trimUnchanged:_0x308ddb=!0x0}){return _0x52e582['map'](_0x375979=>{const _0x6a3ed2=new Et([]),_0xa13f1e=new Et([]);for(const _0x4c1d0a of _0x375979['changes'])if(_0x1cfd78&&'removed'==_0x4c1d0a['type']||_0xa13f1e['children']['push'](_0x4c1d0a['node']['cloneNode'](!0x0)),'new'!=_0x4c1d0a['type']&&(_0x1cfd78||'removed'!=_0x4c1d0a['type'])){const _0x33372d=yt(_0x1c5fac=>At(_0x1c5fac,'data-id')==_0x4c1d0a['id'],_0xe7689a,!0x0);_0x33372d&&_0x6a3ed2['children']['push'](_0x33372d['cloneNode'](!0x0));}const {content:_0x28e838,hasChanges:_0xe75689}=function(_0x573466,_0x1b7d25,_0x59cd5c,_0x495d8c,_0x3cd8ee=!0x0){const _0x2469c5=_0x573466['plugins']['get']('DocumentCompare'),_0x331ad1=Tt(_0x1b7d25),_0x48ba98=Tt(_0x59cd5c),_0x453196=_0x573466['data']['parse'](_0x331ad1,'$root'),_0xf5ab1e=_0x573466['model']['createPositionAt'](_0x453196,0x0),_0x1326a2=_0x2469c5['getDiff'](_0x331ad1,_0x48ba98,{'anchor':_0xf5ab1e,'markDeletions':_0x495d8c}),_0x3b44f3=_0x1326a2['getOperations']();if(0x0==_0x3b44f3['length'])return{'content':_0x1b7d25['cloneNode'](!0x0),'hasChanges':!0x1};_0x495d8c?function(_0x117a66,_0x5ccee1,_0x2cc74c){if(0x0==_0x117a66['length'])return;const _0x3d533e=_0x2cc74c['plugins']['get']('DocumentCompare'),_0x63b978=_0x2cc74c['plugins']['get']('SuggestionsConversion');_0x2cc74c['model']['change'](_0x577ddd=>{const _0x4241f9=new Set();for(let _0x10d3d1=0x0;_0x10d3d1<_0x117a66['length'];_0x10d3d1++){const _0x3e88d3=_0x117a66[_0x10d3d1];if(_0x3e88d3['baseVersion']=null,_0x3e88d3['isDocumentOperation']=!0x1,_0x3d533e['isMarkedRemoveOperation'](_0x3e88d3)){const _0x3f97b3=_0x893b7e(_0x3e88d3['newRange'],_0x2cc74c['model']),_0x253353='suggestion:deletion:'+_0x926b30()+':$aiSuggestion';_0x5ccee1['markers']['set'](_0x253353,_0x3f97b3);}else switch(_0x3e88d3['type']){case'rename':{if(_0x3e88d3['oldName']==_0x3e88d3['newName'])break;_0x577ddd['batch']['addOperation'](_0x3e88d3),_0x2cc74c['model']['applyOperation'](_0x3e88d3);const _0x2ecee9='$elementName',_0xddfa95=_0x3e88d3['position'],_0x52f03c=_0x2cc74c['model']['createRange'](_0xddfa95,_0x2cc74c['model']['createPositionAt'](_0xddfa95['nodeAfter'],'end')),_0x286cdb='suggestion:attribute:'+_0x2ecee9+':'+_0x926b30()+':$aiSuggestion';_0x5ccee1['markers']['set'](_0x286cdb,_0x52f03c);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x3e88d3['oldValue']==_0x3e88d3['newValue'])break;_0x577ddd['batch']['addOperation'](_0x3e88d3),_0x2cc74c['model']['applyOperation'](_0x3e88d3);const _0x245dac=_0x3e88d3['key'];if(!_0x63b978['isRegisteredAttribute'](_0x245dac))break;const _0x27323c=_0x893b7e(_0x3e88d3['range'],_0x2cc74c['model']),_0x31a20f='suggestion:attribute:'+_0x245dac+':'+_0x926b30()+':$aiSuggestion';_0x5ccee1['markers']['set'](_0x31a20f,_0x27323c);break;}case'insert':{_0x577ddd['batch']['addOperation'](_0x3e88d3),_0x2cc74c['model']['applyOperation'](_0x3e88d3);if(_0x117a66[_0x10d3d1+0x1]&&'move'==_0x117a66[_0x10d3d1+0x1]['type']){no(_0x5ccee1,_0x3e88d3);break;}const _0x3dc178=_0x3e88d3['position'],_0x272ac4=_0x3e88d3['howMany'],_0x1ee799=_0x893b7e(_0x2cc74c['model']['createRange'](_0x3dc178,_0x3dc178['getShiftedBy'](_0x272ac4)),_0x2cc74c['model']),_0xe628fe='suggestion:insertion:'+_0x926b30()+':$aiSuggestion';_0x5ccee1['markers']['set'](_0xe628fe,_0x1ee799);break;}case'split':{_0x577ddd['batch']['addOperation'](_0x3e88d3),_0x2cc74c['model']['applyOperation'](_0x3e88d3);const _0x303150=_0x3e88d3['splitPosition'],_0x1ece03=_0x3e88d3['moveTargetPosition'],_0x1af477=_0x2cc74c['model']['createRange'](_0x303150,_0x1ece03),_0x27e37e='suggestion:insertion:'+_0x926b30()+':$aiSuggestion';_0x5ccee1['markers']['set'](_0x27e37e,_0x1af477);break;}case'move':{_0x577ddd['batch']['addOperation'](_0x3e88d3),_0x2cc74c['model']['applyOperation'](_0x3e88d3),_0x117a66[_0x10d3d1-0x1]&&'insert'==_0x117a66[_0x10d3d1-0x1]['type']&&no(_0x5ccee1,_0x3e88d3);const _0x4b9fc4=_0x3e88d3['getMovedRangeStart'](),_0x3a2595=_0x3e88d3['howMany'];for(let _0x446379=0x0;_0x446379<_0x3a2595;_0x446379++){const _0xca5bb3=_0x4b9fc4['getShiftedBy'](_0x446379)['nodeAfter'];_0x4241f9['add'](_0xca5bb3);}break;}case'remove':{const _0x4ff19e=_0x3e88d3['sourcePosition'],_0x23c5d1=_0x3e88d3['howMany'],_0x5afa3c=new et(_0x4ff19e,_0x23c5d1);_0x577ddd['batch']['addOperation'](_0x5afa3c),_0x2cc74c['model']['applyOperation'](_0x5afa3c);break;}}}for(const _0x273585 of _0x4241f9){const _0x332f0a=_0x2cc74c['model']['createRangeOn'](_0x273585),_0x1ed024='suggestion:formatBlock:$fakeWrap:'+_0x926b30()+':$aiSuggestion';_0x5ccee1['markers']['set'](_0x1ed024,_0x893b7e(_0x332f0a,_0x2cc74c['model']));}});}(_0x3b44f3,_0x453196,_0x573466):_0x573466['model']['change'](_0x40b671=>{for(const _0xdd3cda of _0x3b44f3)if('remove'==_0xdd3cda['type']){const _0x2c6eca=_0xdd3cda['sourcePosition'],_0x4336c6=_0xdd3cda['howMany'],_0x4abf32=new et(_0x2c6eca,_0x4336c6);_0x40b671['batch']['addOperation'](_0x4abf32),_0x573466['model']['applyOperation'](_0x4abf32);}else{if('marker'==_0xdd3cda['type']){const _0x230d5a=_0xdd3cda['name'],_0x3aa38e=_0xdd3cda['newRange'];null!==_0x3aa38e?_0x453196['markers']['set'](_0x230d5a,_0x3aa38e):_0x453196['markers']['delete'](_0x230d5a);}else _0xdd3cda['baseVersion']=null,_0xdd3cda['isDocumentOperation']=!0x1,_0x40b671['batch']['addOperation'](_0xdd3cda),_0x573466['model']['applyOperation'](_0xdd3cda);}});if(_0x3cd8ee){const _0x41f320=mt(_0x573466,_0x3b44f3,_0x453196);ft(_0x573466['model'],_0x41f320),function(_0x8e097e,_0x17bd68){const _0x3120e6=_0x17bd68['getFirstRange']()['start'];let _0x32c524=_0x17bd68['getFirstRange']()['end'];const _0x159028=_0x3120e6['root'];(_0x32c524['textNode']||_0x32c524['nodeAfter']&&_0x32c524['nodeAfter']['is']('$text'))&&(_0x1fa6b7(_0x32c524,'...'),_0x32c524=_0x32c524['getShiftedBy'](0x3)),(_0x3120e6['textNode']||_0x3120e6['nodeBefore']&&_0x3120e6['nodeBefore']['is']('$text'))&&(_0x1fa6b7(_0x3120e6,'...'),function(_0x54823b,_0x54a317,_0x9735dc){for(let [_0x3a4501,_0x31eca4]of _0x54823b['markers']){const _0x500ac1=_0x31eca4['_getTransformedByInsertion'](_0x54a317,_0x9735dc,!0x1);_0x31eca4=_0x500ac1[0x0],_0x54823b['markers']['set'](_0x3a4501,_0x31eca4);}}(_0x159028,_0x3120e6,0x3),_0x3120e6['parent']==_0x32c524['parent']&&(_0x32c524=_0x32c524['getShiftedBy'](0x3)));const _0x4f41fd=_0x8e097e['createRange'](_0x8e097e['createPositionAt'](_0x159028,0x0),_0x3120e6),_0x1b0568=_0x8e097e['createRange'](_0x32c524,_0x8e097e['createPositionAt'](_0x159028,'end')),_0xe6d0e0=[..._0x4f41fd['getMinimalFlatRanges'](),..._0x1b0568['getMinimalFlatRanges']()];_0xe6d0e0['reverse']();for(const _0x4d7655 of _0xe6d0e0)to(_0x4d7655),Jn(_0x159028,_0x4d7655);}(_0x573466['model'],_0x41f320);}const _0x143918=_0x573466['data']['stringify'](_0x453196,{'showSuggestionHighlights':!0x0});return{'content':ji(_0x143918),'hasChanges':!0x0};}(_0x92c037,_0x6a3ed2,_0xa13f1e,_0x1cfd78,_0x308ddb);return{'type':_0x375979['changes'][0x0]['type'],'index':_0x375979['index'],'content':_0x28e838,'hasChanges':_0xe75689};});}function no(_0x301f4d,_0x36a765){for(const [_0x464f90,_0x3fe9b8]of _0x301f4d['markers']){const _0x1d5b96=it['_createFromRanges'](_0x3fe9b8['getTransformedByOperation'](_0x36a765));_0x301f4d['markers']['set'](_0x464f90,_0x1d5b96);}}function mt(_0x4f1902,_0x2d406c,_0x804ba1){const _0x224e98=_0x4f1902['plugins']['get']('DocumentCompare');let _0x487981=_0x4f1902['model']['createPositionAt'](_0x804ba1,Number['POSITIVE_INFINITY']),_0x2d9803=_0x4f1902['model']['createPositionAt'](_0x804ba1,0x0);for(const _0x5c7be0 of _0x2d406c){let _0x4681eb,_0x1d1f37;if(_0x224e98['isMarkedRemoveOperation'](_0x5c7be0))_0x4681eb=_0x5c7be0['newRange']['start'],_0x1d1f37=_0x5c7be0['newRange']['end'];else switch(_0x487981=_0x487981['getTransformedByOperation'](_0x5c7be0),_0x2d9803=_0x2d9803['getTransformedByOperation'](_0x5c7be0),_0x5c7be0['type']){case'rename':_0x4681eb=_0x5c7be0['position'],_0x1d1f37=_0x4681eb['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x4681eb=_0x5c7be0['range']['start'],_0x1d1f37=_0x5c7be0['range']['end'];break;case'insert':_0x4681eb=_0x5c7be0['position'],_0x1d1f37=_0x4681eb['getShiftedBy'](_0x5c7be0['howMany']);break;case'split':_0x4681eb=_0x5c7be0['splitPosition'],_0x1d1f37=_0x5c7be0['moveTargetPosition'];break;case'merge':{const _0x3f9bef=_0x5c7be0['targetPosition']['path']['slice'](0x0,-0x1);_0x4681eb=_0x4f1902['model']['createPositionFromPath'](_0x804ba1,_0x3f9bef),_0x1d1f37=_0x4681eb['getShiftedBy'](0x1);break;}case'remove':{const _0x3ff5aa=_0x5c7be0['howMany'],_0x7d8f96=_0x5c7be0['sourcePosition']['_getTransformedByInsertion'](_0x5c7be0['targetPosition'],_0x3ff5aa),_0x2bae20=_0x5c7be0['getMovedRangeStart']();'remove'==_0x5c7be0['type']?(_0x4681eb=_0x7d8f96,_0x1d1f37=_0x7d8f96):(_0x4681eb=_0x2bae20,_0x1d1f37=_0x2bae20['getShiftedBy'](_0x3ff5aa));break;}}_0x4681eb&&_0x4681eb['isBefore'](_0x487981)&&(_0x487981=_0x4681eb['clone'](),_0x487981['stickiness']='toNone'),_0x1d1f37&&_0x1d1f37['isAfter'](_0x2d9803)&&(_0x2d9803=_0x1d1f37['clone'](),_0x2d9803['stickiness']='toNone');}return _0x4f1902['model']['createSelection'](_0x4f1902['model']['createRange'](_0x487981,_0x2d9803));}function ft(_0x3f1778,_0x577777){ro(_0x3f1778,_0x577777,'forward');const _0x2cfdf9=_0x577777['getFirstRange']();_0x577777['setTo']([]),_0x577777['setTo'](_0x2cfdf9,{'backward':!0x0}),ro(_0x3f1778,_0x577777,'backward');}function ro(_0x127023,_0xae8e14,_0x115b04){let _0x58ccf5=0x14;for(;_0x58ccf5;){_0x127023['modifySelection'](_0xae8e14,{'unit':'word','direction':_0x115b04}),_0x58ccf5--;const _0x1d2584=_0xae8e14['focus']['forward'==_0x115b04?'nodeBefore':'nodeAfter'];if(_0x1d2584&&_0x1d2584['is']('element')&&_0x127023['schema']['isBlock'](_0x1d2584)&&_0x127023['schema']['isObject'](_0x1d2584))break;}}function Jn(_0x3aa8b1,_0x1e2cf5){for(const [_0x1d346f,_0x566a6d]of _0x3aa8b1['markers']){const _0x2e2c1b=_0x566a6d['_getTransformedByDeletion'](_0x1e2cf5['start'],_0x1e2cf5['end']['offset']-_0x1e2cf5['start']['offset']);null!=_0x2e2c1b?_0x3aa8b1['markers']['set'](_0x1d346f,_0x2e2c1b):_0x3aa8b1['markers']['delete'](_0x1d346f);}}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:_0xadc989,content:_0x1bdd0a='',isDone:_0x46c078=!0x1,interactionId:_0x3a0359,areActionsDisabled:_0xdec52,documentContextContent:_0x273ded,editor:_0x40dff5,id:_0x5eee9a}){super(),this['id']=_0x5eee9a||_0x926b30(),this['interactionId']=_0x3a0359,this['type']=_0xadc989,this['areActionsDisabled']=!!_0xdec52,this['editor']=_0x40dff5,this['aiResponseParser']=new Ui(),this['aiResponseApplier']=new Ni(),this['documentContextContent']=ji(_0x273ded||''),this['set']('isDone',_0x46c078),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x1bdd0a);}['appendContent'](_0x443a2d){this['set']('content',this['content']+_0x443a2d);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x5b56b7,_0x3cb72a){this['changeGroups'][_0x5b56b7]['state']=_0x3cb72a,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x5b56b7,'state':_0x3cb72a});}['getContentParts']({showDiff:_0xd3e3ab,groupIndex:_0x56b8d3}){if(!this['editor'])throw new _0x36ca17('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x4d80cf=this['_getCachedContentParts'](_0xd3e3ab,_0x56b8d3);if(_0x4d80cf)return _0x4d80cf;let _0x4535a4=[];if(void 0x0===_0x56b8d3)_0x4535a4=this['changeGroups'];else{const _0x5d6d76=this['changeGroups']['find'](({index:_0x3c752d})=>_0x3c752d===_0x56b8d3);if(!_0x5d6d76)throw new _0x36ca17('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x56b8d3});_0x4535a4=[_0x5d6d76];}const _0x30ff6a=J({'editor':this['editor'],'showDiff':_0xd3e3ab,'changeGroups':_0x4535a4,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0xd3e3ab,_0x30ff6a),_0x30ff6a;}['_getCachedContentParts'](_0x1f4b4a,_0x31ba30){const _0x39c438=_0x1f4b4a?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x39c438]['length'])return null;const _0x13665a=this['cachedSuggestionContentParts'][_0x39c438];if(void 0x0===_0x31ba30)return _0x13665a['length']>0x0&&_0x13665a['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x1f4b4a,null),null):_0x1e538d(_0x13665a);{const _0x2a2b6c=_0x13665a['find'](({index:_0x129056})=>_0x129056===_0x31ba30);if(_0x2a2b6c)return[_0x1e538d(_0x2a2b6c)];}return null;}['_setCachedContentParts'](_0x5d6b93,_0x106e99){const _0x288e9e=_0x5d6b93?'withDiff':'withoutDiff';_0x106e99?_0x106e99['forEach'](_0x1181a3=>{const _0x2b4490=this['cachedSuggestionContentParts'][_0x288e9e],_0x4d2739=_0x2b4490['find'](({index:_0x4490fe})=>_0x4490fe===_0x1181a3['index']);if(_0x4d2739){const _0x1a0daa=_0x2b4490['indexOf'](_0x4d2739);_0x2b4490['splice'](_0x1a0daa,0x1,_0x1181a3);}else _0x2b4490['push'](_0x1181a3);}):this['cachedSuggestionContentParts'][_0x288e9e]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x3a63fd=this['changeGroups'];this['updateChangeGroups']();const _0x148508=this['_getDifferentChangeGroups'](_0x3a63fd,this['changeGroups']);(_0x148508['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x148508),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x32f56b,_0x157427){const _0x1b33a0=[];for(const _0xab1be9 of _0x157427){const _0x2c5239=_0x32f56b[_0xab1be9['index']];_0x2c5239?_0x2c5239['changes']['length']!==_0xab1be9['changes']['length']?_0x1b33a0['push'](_0xab1be9):_0x2c5239['changes']['forEach']((_0x2a6bf7,_0x308615)=>{const _0x102cb8=_0xab1be9['changes'][_0x308615];_0x2a6bf7['id']!==_0x102cb8['id']&&_0x1b33a0['push'](_0xab1be9);}):_0x1b33a0['push'](_0xab1be9);}return _0x1b33a0;}['updateChangeGroups'](){const _0x511230=new _0x10ebb7('p',{},[new _0x10ebb7('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x280441(i(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x598b7b=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x511230,'cutAfterLastChange':!this['isDone']});if(!_0x598b7b['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x598b7b['parsedContent'];let _0x19e668=[];if(_0x3e90f0(_0xb666f4=>{const _0x403b36=At(_0xb666f4,'data-id');if(!_0x403b36||!_0x152b95(_0x403b36))return!0x1;const _0x537876=[_0xb666f4,...Gi(_0xb666f4)]['at'](-0x2);if(_0xb666f4!=_0x537876){const _0x41a31e=At(_0x537876,'data-id');_0x152b95(_0x41a31e)||(_0x19e668['push']({'node':_0x537876,'id':_0x41a31e,'type':'modified'}),_0x598b7b['modifiedNodeIds']['push'](_0x41a31e));}else _0x598b7b['modifiedNodeIds']['includes'](_0x403b36)?_0x19e668['push']({'node':_0xb666f4,'type':'modified','id':_0x403b36}):_0x598b7b['newNodeIds']['includes'](_0x403b36)?_0x19e668['push']({'node':_0xb666f4,'type':'new','id':_0x403b36,'anchorId':At(_0xb666f4['previousSibling'],'data-id')}):_0x19e668['push']({'node':_0xb666f4,'type':'removed','id':_0x403b36});return!0x0;},this['parsedMergedContent']),_0x19e668=_0x19e668['filter'](({node:_0x6a2959})=>[...Gi(_0x6a2959),_0x6a2959]['every'](_0x1a2734=>!At(_0x1a2734,'data-unstable'))),0x0==_0x19e668['length'])return;const _0x2633cd=[[_0x19e668[0x0]]];for(let _0x4490ed=0x1;_0x4490ed<_0x19e668['length'];_0x4490ed++){const _0x15fee4=_0x2633cd[_0x2633cd['length']-0x1],_0x566a6f=_0x15fee4[_0x15fee4['length']-0x1];_0x19e668[_0x4490ed]['node']['previousSibling']==_0x566a6f['node']&&'modified'!=_0x19e668[_0x4490ed]['type']&&'modified'!=_0x566a6f['type']?_0x15fee4['push'](_0x19e668[_0x4490ed]):_0x2633cd['push']([_0x19e668[_0x4490ed]]);}for(const _0xf823ed of _0x2633cd){const _0x5b3a16=_0xf823ed[0x0],_0x5d8e9e=_0xf823ed[_0xf823ed['length']-0x1],_0x4ac99d=_0x8ae9c6(_0x5b3a16['node']['previousSibling']);_0x4ac99d&&_0xf823ed['unshift'](_0x4ac99d);const _0x23a6d6=_0x8ae9c6(_0x5d8e9e['node']['nextSibling']);_0x23a6d6&&_0xf823ed['push'](_0x23a6d6);}function _0x152b95(_0x529429){return _0x598b7b['modifiedNodeIds']['includes'](_0x529429)||_0x598b7b['newNodeIds']['includes'](_0x529429)||_0x598b7b['removedNodeIds']['includes'](_0x529429);}function _0x8ae9c6(_0x26e7d1){if(_0x26e7d1&&At(_0x26e7d1,'data-id')&&!At(_0x26e7d1,'data-unstable')){const _0x26548a=At(_0x26e7d1,'data-id');if(!_0x152b95(_0x26548a))return{'node':_0x26e7d1,'type':'context','id':_0x26548a};}return null;}this['changeGroups']=_0x2633cd['map']((_0x3f5e82,_0x2dd7a8)=>({'changes':_0x3f5e82,'state':'pending','index':_0x2dd7a8}));}}const ye=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class xe extends _0x290e58(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x25853d,editor:_0x3cd1ac}){super(),this['id']=_0x926b30(),this['connector']=_0x25853d,this['isStopped']=!0x0,this['editor']=_0x3cd1ac;}async['start'](){const _0x28e52a=[];let _0x31ae13,_0x159393,_0x1b8a62;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x49c604=await this['currentRequest']['getStream']();for await(const _0x452fbf of _0x49c604){if(this['isStopped'])return;if('error'==_0x452fbf['event'])return void this['fire']('error',{'error':new _0x36ca17('ai-chat-interaction-error',this)});switch(_0x452fbf['event']){case'message-metadata':this['messageId']=_0x452fbf['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x452fbf['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x452fbf['data']['conversationTitle'],!0x0);break;case'source':_0x28e52a['push'](_0x452fbf['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'](),_0x31ae13='modification-delta'==_0x452fbf['event']?'modification':'text',_0x159393='modification-delta'==_0x452fbf['event']?_0x452fbf['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x31ae13&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x31ae13,'interactionId':this['id'],'id':_0x159393}),'modification'==_0x31ae13&&(this['currentReply']['sources']=_0x28e52a['splice'](0x0))),this['currentReply']['appendContent'](_0x452fbf['data']['textDelta']);break;case'mcp-tool-result':_0x1b8a62=JSON['parse'](_0x452fbf['data']['result']),this['_handleToolResultData']({'toolName':_0x452fbf['data']['toolName'],'data':_0x1b8a62['data'],'attributes':_0x1b8a62['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x452fbf['data']['toolName'],'data':_0x452fbf['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0x28e52a['length']>0x0&&(this['currentReply']['sources']=_0x28e52a['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x459aed){return this['replies']['find'](_0xaee016=>_0xaee016['id']===_0x459aed);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x48ee76=>_0x48ee76['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0xbf88c2){const _0x4c6d80=new Ge({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0xbf88c2});return this['replies']['push'](_0x4c6d80),_0x4c6d80['delegate'](...ye)['to'](this),this['fire']('replyCreated',_0x4c6d80),_0x4c6d80;}['setConversationTitle'](_0xe4feee,_0x133ff0=!0x1){this['fire']('setConversationTitle',_0xe4feee,_0x133ff0);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0xeec383){this['fire']('toolDataReceived',{'type':'result','toolName':_0xeec383['toolName'],'data':structuredClone(_0xeec383['data']||{}),'attributes':structuredClone(_0xeec383['attributes']||{})},this);}['_handleToolNotificationData'](_0x156c37){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x156c37['toolName'],'data':structuredClone(_0x156c37['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(_0x20acab){return _0x20acab['TOOL']='mcp-tool-context',_0x20acab['FILE']='file',_0x20acab['DOCUMENT']='document',_0x20acab['URL']='web-resource',_0x20acab['TEXT']='text',_0x20acab['SELECTION']='selection',_0x20acab;}({}),Fe=function(_0x19fc79){return _0x19fc79['TEXT']='text',_0x19fc79['MARKDOWN']='markdown',_0x19fc79['HTML']='html',_0x19fc79;}({});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:_0x3a4309,config:_0x4a5fd4,ownerId:_0x266b42}){super(),this['_connector']=_0x3a4309,this['_config']=_0x4a5fd4,this['_ownerId']=_0x266b42;}['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'](_0x81167e){const _0x34ff53=await this['_createContextItemFromContent'](_0x81167e);return this['_addToConversationContextItem'](_0x34ff53),'current-document'===_0x34ff53['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x34ff53;}async['_createContextItemFromContent'](_0x205fd7){if(_0x205fd7['type']===qe['DOCUMENT']){const _0x362e31=await this['_connector']['fetchDocument'](this['_ownerId'],_0x205fd7['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x205fd7['type'],'content':_0x362e31['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x362e31['attributes']?.['version'],'sessionId':_0x362e31['attributes']?.['sessionId']};}if(_0x205fd7['type']===qe['TOOL'])return{'id':_0x205fd7['id'],'uiId':_0x205fd7['id'],'label':_0x205fd7['data']?.['label']||_0x205fd7['id'],'type':qe['TOOL'],'mcpServerName':_0x205fd7['mcpServerName'],'toolName':_0x205fd7['toolName'],'data':_0x205fd7['data']||{}};return{'id':_0x205fd7['id'],'uiId':_0x205fd7['id'],'label':_0x205fd7['attributes']?.['label']||_0x205fd7['name']||_0x205fd7['url']||_0x205fd7['id'],'type':_0x205fd7['type'],..._0x205fd7?.['attributes']?.['resourceId']?{'resourceId':_0x205fd7['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x973e4){const _0x188d39=this['_pendingContextItems']['get'](_0x973e4);_0x188d39?.['isReadOnly']||this['_removeContextItem'](_0x973e4);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x96bf9a of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x96bf9a['uiId']);const _0x425ed3=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x425ed3&&this['_addContextItem']({..._0x425ed3,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x3e183f){for(const _0x4393cc of _0x3e183f['values']())this['_addToConversationContextItem'](_0x4393cc);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'](_0x3f671c){return Array['from'](_0x3f671c['values']())['map'](_0x483ddd=>this['_mapContextItemToRequestData'](_0x483ddd))['filter'](_0x1d8299=>null!==_0x1d8299);}async['addFilesToContext'](_0x81818e,_0x1565d1,_0x4d10ca=qe['FILE']){const _0x4fff72='files-'+_0x926b30();this['_startUploadOperation'](_0x4fff72);try{await Promise['all'](_0x81818e['map'](async _0x51889a=>{const _0x4c3dd9='file-'+_0x926b30(),_0x25f800=_0xac888d(_0x51889a['name']);try{this['_addContextItem']({'type':_0x4d10ca,'label':_0x1565d1?.['label']||_0x25f800,'uiId':_0x4c3dd9,'resourceId':_0x1565d1?.['resourceId']},!0x0);const _0xe9b0ce=this['_connector']['uploadFile'](this['_ownerId'],_0x51889a,_0x1565d1);this['_ongoingUploads']['set'](_0x4c3dd9,_0xe9b0ce['abortController']);const {id:_0x5a626}=await _0xe9b0ce['getId']();this['_ongoingUploads']['delete'](_0x4c3dd9),this['_finishContextItemLoading']({'type':_0x4d10ca,'id':_0x5a626,'label':_0x1565d1?.['label']||_0x25f800,'uiId':_0x4c3dd9,'resourceId':_0x1565d1?.['resourceId']},!0x1);}catch(_0x4c0507){this['_ongoingUploads']['delete'](_0x4c3dd9);if(!(_0x4c0507 instanceof _0x36ca17&&_0x4c0507['message']['startsWith']('ai-request-aborted'))){const _0x3c7510=Ue['get'](_0x4c0507['code'])||'ai-chat-file-upload-failed',_0x4373d8=new _0x36ca17(_0x3c7510,null,{'fileName':_0x25f800,..._0x4c0507});_0x4373d8['stack']=_0x4c0507['stack'],this['fire']('error',{'error':_0x4373d8});}this['_removeContextItem'](_0x4c3dd9);}}));}finally{this['_finishUploadOperation'](_0x4fff72);}}['addCurrentDocumentToContext'](_0x30c46b){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x425235={'type':qe['DOCUMENT'],'uiId':'current-document','label':_0x30c46b,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x425235);}async['updateCurrentDocument'](_0x52141a,_0x88df50,_0x176237,_0x124831){const _0x38395e=this['_pendingContextItems']['get']('current-document');if(_0x38395e&&_0x52141a){_0x38395e['selection']=_0x124831?_0x124831['map'](_0x140c0f=>({'start':_0x140c0f['start'],'end':_0x140c0f['end']})):[];try{if(_0x38395e['version']===_0x88df50)return;const {id:_0x5b233d}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x52141a,{'version':_0x88df50,'sessionId':_0x176237})['getId']();_0x38395e['id']=_0x5b233d,_0x38395e['content']=_0x52141a,_0x38395e['version']=_0x88df50,_0x38395e['sessionId']=_0x176237;}catch(_0x12f811){const _0x40d187=new _0x36ca17('ai-chat-document-upload-failed',null);_0x40d187['stack']=_0x12f811['stack'],this['fire']('error',{'error':_0x40d187});}}}['addSelectionToContext'](_0x21e085){this['_addContextItem']({'type':qe['SELECTION'],'label':_0x21e085,'uiId':'selection','content':_0x21e085});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x5a4296,_0x265d35){const _0x4de937='url-'+_0x926b30();this['_startUploadOperation'](_0x4de937);const _0x33bad8='url-'+_0x926b30();try{this['_addContextItem']({'type':qe['URL'],'label':_0x265d35?.['label']||_0x5a4296,'uiId':_0x33bad8,'resourceId':_0x265d35?.['resourceId']},!0x0);const _0x3a2c52=this['_connector']['uploadUrl'](this['_ownerId'],_0x5a4296,_0x265d35);this['_ongoingUploads']['set'](_0x33bad8,_0x3a2c52['abortController']);const {id:_0x48e0cb}=await _0x3a2c52['getId']();this['_ongoingUploads']['delete'](_0x33bad8),this['_finishContextItemLoading']({'type':qe['URL'],'id':_0x48e0cb,'label':_0x265d35?.['label']||_0x5a4296,'uiId':_0x33bad8,'resourceId':_0x265d35?.['resourceId']},!0x1);}catch(_0x551a60){this['_ongoingUploads']['delete'](_0x33bad8),(_0x551a60['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x36ca17('ai-chat-url-upload-failed',this,{'url':_0x5a4296,'originalError':_0x551a60}),'url':_0x5a4296}),this['_removeContextItem'](_0x33bad8));}finally{this['_finishUploadOperation'](_0x4de937);}}['addToolItemToContext'](_0x606886){_0x606886['id']=_0x606886['id']??_0x926b30()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x606886['uiId'],_0x606886),this['fire']('contextItemAdded',{'contextItem':_0x606886,'isLoading':!0x1});}async['loadSourceResources'](_0x5bba26,_0x496f07,_0x3e9d60){const _0x3aab27=this['_addContextOptionsState']['sources']['find'](_0x36b830=>_0x36b830['id']===_0x5bba26);if(!_0x3aab27)return this['fire']('error',{'error':new _0x36ca17('ai-chat-source-not-found',this,{'sourceId':_0x5bba26}),'sourceId':_0x5bba26}),[];try{const _0x550f43=(await _0x3aab27['getResources'](_0x496f07))['map'](_0x54ce5b=>{const _0x46f9e5=this['_isResourceInContext'](_0x54ce5b['id']);return{..._0x54ce5b,'isInContext':_0x46f9e5};});return _0x3aab27['resources']=_0x550f43,this['fire']('sourceResourcesLoaded',{'sourceId':_0x5bba26,'source':_0x3aab27,'resources':_0x550f43,'uid':_0x3e9d60}),_0x550f43;}catch(_0x3ad595){return this['fire']('error',{'error':new _0x36ca17('ai-chat-source-resources-load-failed',this,{'sourceId':_0x5bba26,'originalError':_0x3ad595}),'sourceId':_0x5bba26,'sourceLabel':_0x3aab27['label']}),[];}}async['addResourceToContext'](_0x44cf27,_0x100993){if(this['_isResourceInContext'](_0x100993['id']))return;let _0x33a1b1=_0x100993['data'];if(!_0x33a1b1&&_0x44cf27['getData'])try{_0x33a1b1=await _0x44cf27['getData'](_0x100993['id']);}catch(_0x1d2d74){return void this['fire']('error',{'error':new _0x36ca17('ai-chat-resource-load-failed',this,{'resourceId':_0x100993['id'],'sourceId':_0x44cf27['id'],'originalError':_0x1d2d74}),'resourceId':_0x100993['id'],'sourceId':_0x44cf27['id']});}if(_0x33a1b1)switch(_0x100993['type']){case qe['URL']:if('string'!=typeof _0x33a1b1)return void this['fire']('error',{'error':new _0x36ca17('ai-chat-context-invalid-data',this,{'resourceId':_0x100993['id'],'sourceId':_0x44cf27['id'],'expectedType':'string','actualType':typeof _0x33a1b1}),'resourceId':_0x100993['id'],'sourceId':_0x44cf27['id']});await this['addUrlToContext'](_0x33a1b1,{'label':_0x100993['label'],'resourceId':_0x100993['id']});break;case qe['FILE']:if(!(_0x33a1b1 instanceof File))return void this['fire']('error',{'error':new _0x36ca17('ai-chat-context-invalid-data',this,{'resourceId':_0x100993['id'],'sourceId':_0x44cf27['id'],'expectedType':'File','actualType':typeof _0x33a1b1}),'resourceId':_0x100993['id'],'sourceId':_0x44cf27['id']});await this['addFilesToContext']([_0x33a1b1],{'label':_0x100993['label'],'resourceId':_0x100993['id']});break;case qe['TEXT']:if('object'!=typeof _0x33a1b1||!('content'in _0x33a1b1)||!('type'in _0x33a1b1))return void this['fire']('error',{'error':new _0x36ca17('ai-chat-context-invalid-data',this,{'resourceId':_0x100993['id'],'sourceId':_0x44cf27['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x33a1b1}),'resourceId':_0x100993['id'],'sourceId':_0x44cf27['id']});_0x33a1b1=We['_convertTextResourceToFile'](_0x33a1b1,_0x100993['label']),await this['addFilesToContext']([_0x33a1b1],{'label':_0x100993['label'],'resourceId':_0x100993['id']},qe['TEXT']);break;case qe['TOOL']:break;default:this['fire']('error',{'error':new _0x36ca17('ai-chat-context-unsupported-type',this,{'resourceId':_0x100993['id'],'sourceId':_0x44cf27['id'],'resourceType':_0x100993['type']}),'resourceId':_0x100993['id'],'sourceId':_0x44cf27['id']});}else this['fire']('error',{'error':new _0x36ca17('ai-chat-resource-no-data',this,{'resourceId':_0x100993['id'],'sourceId':_0x44cf27['id']}),'resourceId':_0x100993['id'],'sourceId':_0x44cf27['id']});}static['_convertTextResourceToFile'](_0x14631a,_0x51587e){switch(_0x14631a['type']){case Fe['MARKDOWN']:return new File([_0x14631a['content']],_0x51587e,{'type':'text/markdown'});case Fe['HTML']:return new File([_0x14631a['content']],_0x51587e,{'type':'text/html'});default:return new File([_0x14631a['content']],_0x51587e,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x43329f){switch(_0x43329f['type']){case qe['FILE']:return{'type':qe['FILE'],'id':_0x43329f['id']};case qe['URL']:return{'type':qe['URL'],'id':_0x43329f['id']};case qe['DOCUMENT']:return{'type':qe['DOCUMENT'],'id':_0x43329f['id'],..._0x43329f['selection']?.['length']&&{'selection':_0x43329f['selection']}};case qe['TEXT']:return{'type':qe['FILE'],'id':_0x43329f['id']};case qe['TOOL']:{const _0x5c1cac=_0x43329f;return{'type':qe['TOOL'],'mcpServerName':_0x5c1cac['mcpServerName'],'toolName':_0x5c1cac['toolName'],'data':_0x5c1cac['data'],'id':_0x5c1cac['id']};}default:return null;}}['_addContextItem'](_0x161d9f,_0x9b6107=!0x1){if(this['_pendingContextItems']['set'](_0x161d9f['uiId'],_0x161d9f),_0x161d9f['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x161d9f,'isLoading':_0x9b6107}),'current-document'===_0x161d9f['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x161d9f['resourceId']){const _0x50f9e8=this['_findSourceIdsByResourceId'](_0x161d9f['resourceId']);_0x50f9e8&&_0x50f9e8['forEach'](_0x4a1254=>{this['_updateResourceInContextState'](_0x4a1254,_0x161d9f['resourceId'],!0x0);});}}['_removeContextItem'](_0x2eb16c){const _0x3bdf51=this['_pendingContextItems']['get'](_0x2eb16c),_0x2586e7=this['_ongoingUploads']['get'](_0x2eb16c);if(_0x2586e7&&(_0x2586e7['abort'](),this['_ongoingUploads']['delete'](_0x2eb16c)),_0x3bdf51?.['resourceId']){const _0xffb063=this['_findSourceIdsByResourceId'](_0x3bdf51['resourceId']);_0xffb063&&_0xffb063['forEach'](_0x3d060b=>{this['_updateResourceInContextState'](_0x3d060b,_0x3bdf51['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x2eb16c),this['fire']('contextItemRemoved',{'uiId':_0x2eb16c,'type':_0x3bdf51?.['type']}),'current-document'===_0x2eb16c&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x4c2724,_0x5057ff){if(this['_pendingContextItems']['has'](_0x4c2724['uiId'])&&(this['_pendingContextItems']['set'](_0x4c2724['uiId'],_0x4c2724),this['fire']('contextItemLoadingEnded',{'contextItem':_0x4c2724,'isLoading':_0x5057ff}),_0x4c2724['resourceId'])){const _0x4f0f2e=this['_findSourceIdsByResourceId'](_0x4c2724['resourceId']);_0x4f0f2e&&_0x4f0f2e['forEach'](_0x3b6b55=>{this['_updateResourceInContextState'](_0x3b6b55,_0x4c2724['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x595dbc){this['_conversationContextItems']['set'](_0x595dbc['uiId'],_0x595dbc);}['_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'](_0xf078c5=>({..._0xf078c5,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x251ebd=>({..._0x251ebd,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x544ed4=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x544ed4,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x5c9ef4){for(const _0x4dd42a of this['_pendingContextItems']['values']())if(_0x4dd42a['resourceId']===_0x5c9ef4)return!0x0;for(const _0x2c0016 of this['_conversationContextItems']['values']())if(_0x2c0016['resourceId']===_0x5c9ef4)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0xd5c82f){const _0x159abb=[];for(const _0x3171a9 of this['_addContextOptionsState']['sources']){_0x3171a9['resources']['find'](_0x1f1cd7=>_0x1f1cd7['id']===_0xd5c82f)&&_0x159abb['push'](_0x3171a9['id']);}return 0x0===_0x159abb['length']?null:_0x159abb;}['_updateResourceInContextState'](_0x39b7d6,_0x55171f,_0x18fcac){const _0x54e15f=this['_addContextOptionsState']['sources']['find'](_0xe094d2=>_0xe094d2['id']===_0x39b7d6);if(!_0x54e15f)return;const _0x1938fa=_0x54e15f['resources']['find'](_0x11e656=>_0x11e656['id']===_0x55171f);_0x1938fa&&(_0x1938fa['isInContext']=_0x18fcac,this['fire']('resourceStateChanged',{'sourceId':_0x39b7d6,'resourceId':_0x55171f,'isInContext':_0x18fcac}));}['_startUploadOperation'](_0x35f75a){this['_ongoingUploadOperations']['set'](_0x35f75a,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x4da689){this['_ongoingUploadOperations']['delete'](_0x4da689),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Be=['capabilitiesUpdated'];class Je extends _0x290e58(){['_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'](_0xbc4065){const _0x39cafc={};return _0xbc4065&&_0xbc4065['isWebSearchEnabled']&&(_0x39cafc['webSearch']={}),_0xbc4065&&_0xbc4065['isReasoningEnabled']&&(_0x39cafc['reasoning']={}),_0x39cafc;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x4442ff){_0x4442ff!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x4442ff,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x375000){_0x375000!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x375000,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Ke extends xe{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['attributes'];constructor(_0x13dede){super(_0x13dede),this['conversationId']=_0x13dede['conversationId'],this['contextItems']=_0x13dede['contextItems'],this['capabilities']=_0x13dede['capabilities'],this['userMessage']=_0x13dede['userMessage'],this['model']=_0x13dede['model'],this['attributes']=_0x13dede['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 _0x290e58(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x311d93){super(),this['options']=_0x311d93,this['connector']=_0x311d93['connector'],this['chatModels']=_0x311d93['chatModels'],this['id']=_0x311d93['conversationId'],this['isFromHistory']=_0x311d93['isFromHistory'];}async['init'](_0xb82acc){try{this['chatContext']=new We({'connector':this['connector'],'config':_0xb82acc,'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 _0x1c70fb=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x1c70fb});const _0x2ae82b=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x2ae82b&&await this['setModel'](_0x2ae82b);}catch(_0x563400){const _0xce44d5=new _0x36ca17('ai-chat-conversation-init-failed',null,{'message':_0x563400['message']||_0x563400});_0xce44d5['stack']=_0x563400['stack'],this['fire']('error',{'error':_0xce44d5});}}async['start'](){if(this['isStarted'])throw new _0x36ca17('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x36ca17('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x18288e}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x18288e,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x28846d){const _0x53e969=new _0x36ca17('ai-chat-conversation-start-failed',null,{'message':_0x28846d['message'],'conversationId':this['id']});throw _0x53e969['stack']=_0x28846d['stack'],this['fire']('error',{'error':_0x53e969}),_0x53e969;}}async['load'](_0x1964a2,_0x237522){try{const _0x25ef62=await this['connector']['fetchConversation'](_0x1964a2)['getConversation'](),_0x32047b=await this['connector']['fetchConversationMessages'](_0x1964a2)['getMessages'](),_0x19cdad=_0x32047b[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x25ef62['id'],'title'in _0x25ef62?this['fire']('setConversationTitle',_0x25ef62['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x1eafe0=(await this['chatModels']['getAll']())['find'](_0x34d757=>_0x34d757['id']['toLowerCase']()===_0x19cdad['toLowerCase']());return this['selectedModel']=_0x1eafe0,this['fire']('modelSelected',{'selectedModel':_0x1eafe0,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x32047b,_0x237522,_0x19cdad),this['currentInteraction']=void 0x0,this;}catch(_0x13efcc){const _0x4237fa=new _0x36ca17('ai-chat-conversation-init-from-id-failed',null,{'message':_0x13efcc['message'],'conversationId':_0x1964a2});throw _0x4237fa['stack']=_0x13efcc['stack'],this['fire']('error',{'error':_0x4237fa}),_0x4237fa;}}async['_processMessagesToInteractions'](_0x230f65,_0x271b19,_0x3f2c50){let _0x1e5ce4;for(const _0x4e132e of _0x230f65)if('user'===_0x4e132e['role']){const _0x505b5f=await this['_extractContextItems'](_0x4e132e),_0x4b56c9={'isReasoningEnabled':Object['hasOwn'](_0x4e132e['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x4e132e['capabilities'],'webSearch')};_0x1e5ce4=this['createInteraction']({'userMessage':_0x4e132e['prompt'],'contextItems':_0x505b5f,'capabilities':_0x4b56c9,'modelId':_0x3f2c50,'attributes':_0x4e132e['attributes']}),this['currentInteraction']=_0x1e5ce4,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x4e132e['role']&&_0x1e5ce4){const _0x541bfd=[];for(const _0x3a1660 of _0x4e132e['content'])switch(_0x3a1660['type']){case'text':case'modification':{const _0x2ae937=_0x1e5ce4['getDocumentContext']()?.['sessionId']!==_0x271b19;_0x1e5ce4['currentReply']=_0x1e5ce4['createReply']({'type':_0x3a1660['type'],'isDone':!0x0,'interactionId':_0x1e5ce4['id'],'areActionsDisabled':_0x2ae937}),_0x1e5ce4['currentReply']['appendContent'](_0x3a1660['content']),_0x541bfd['length']>0x0&&(_0x1e5ce4['currentReply']['sources']=_0x541bfd['splice'](0x0));break;}case'url':_0x541bfd['push'](_0x3a1660);break;case'mcp-tool-result':{const {data:_0x2bf354,attributes:_0x5e419f}=JSON['parse'](_0x3a1660['content']);_0x1e5ce4['_handleToolResultData']({'toolName':_0x3a1660['toolName'],'data':_0x2bf354,'attributes':_0x5e419f});break;}}}}}async['_extractContextItems'](_0x5cf453){const _0x3efbed=new Map();if(!_0x5cf453['content'])return _0x3efbed;for(const _0x30f3ce of _0x5cf453['content']){const _0x1ce352=await this['chatContext']['populateFromMessage'](_0x30f3ce);_0x1ce352&&_0x3efbed['set'](_0x1ce352['id'],_0x1ce352);}return _0x3efbed;}async['handleUserInteraction']({userMessage:_0x20c9ef,attributes:_0x20d512}){if(!this['isStarted'])throw new _0x36ca17('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x36ca17('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x25d05c=this['chatContext']['getPendingContextItems'](),_0x49fe9d=this['chatCapabilities']['getCapabilitiesConfig'](),_0x1144e9=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x20c9ef,'contextItems':_0x25d05c,'capabilities':_0x49fe9d,'modelId':_0x1144e9,'attributes':_0x20d512}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x5cfb78){if(_0x5cfb78 instanceof _0x36ca17)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x5cfb78});else{const _0x43aadf=Ue['get'](_0x5cfb78['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new _0x36ca17(_0x43aadf,null,{'error':_0x5cfb78})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x3ec23f,contextItems:_0x112683,capabilities:_0x285bf0,modelId:_0x10211f,attributes:_0x5ee5be}){const _0x1f9ea2=new Ke({'userMessage':_0x3ec23f,'contextItems':_0x112683,'capabilities':_0x285bf0,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x10211f,'attributes':_0x5ee5be});return _0x1f9ea2['delegate'](...ye)['to'](this),this['interactions']['push'](_0x1f9ea2),this['fire']('interactionCreated',_0x1f9ea2),_0x1f9ea2;}['getInteraction'](_0x5864be){return this['interactions']['find'](_0x244395=>_0x244395['id']===_0x5864be);}['removeInteraction'](_0x5ed5f6){const _0x4cec46=this['getInteraction'](_0x5ed5f6);_0x4cec46&&(_0x4cec46['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x4cec46),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x54b31f){this['chatContext']['addCurrentDocumentToContext'](_0x54b31f);}async['updateCurrentDocumentInContext']({content:_0x2577d1,version:_0x2d946f,sessionId:_0x4859ec,selections:_0xca16f0}){await this['chatContext']['updateCurrentDocument'](_0x2577d1,_0x2d946f,_0x4859ec,_0xca16f0);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x3df48a){this['chatContext']['addSelectionToContext'](_0x3df48a);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x11638f){this['chatContext']['addFilesToContext'](_0x11638f);}['addUrlToContext'](_0x46ad81){this['chatContext']['addUrlToContext'](_0x46ad81);}['addToolItemToContext'](_0x4c44d7){this['chatContext']['addToolItemToContext'](_0x4c44d7);}['addResourceToContext'](_0x11ffe9,_0x377c9b){this['chatContext']['addResourceToContext'](_0x11ffe9,_0x377c9b);}['loadSourceResources'](_0x47bfdc,_0x1c14f8,_0x47a5c1){return this['chatContext']['loadSourceResources'](_0x47bfdc,_0x1c14f8,_0x47a5c1);}['removeFromContext'](_0x4c5b03){this['chatContext']['removeFromContext'](_0x4c5b03);}['setWebSearch'](_0x1ea804){this['chatCapabilities']['setWebSearch'](_0x1ea804);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x275eb7){this['chatCapabilities']['setReasoning'](_0x275eb7);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x1c14f6){_0x1c14f6?!0x1===await this['chatModels']['isAvailable'](_0x1c14f6)&&(_0x3bfc82('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x1c14f6}),_0x1c14f6=(await this['chatModels']['getAvailableModels']())[0x0]):(_0x3bfc82('ai-chat-conversation-set-model-null',{'conversation':this}),_0x1c14f6=(await this['chatModels']['getAvailableModels']())[0x0]),_0x1c14f6['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x1c14f6,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x1c14f6}));}}class It extends _0x290e58(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x3e4072,config:_0x13c6c3,locale:_0x13bd3f}){super(),this['_connector']=_0x3e4072,this['_config']=_0x13c6c3,this['_locale']=_0x13bd3f;}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 _0x3ae98b=await this['getAll']();let _0x398678;return _0x398678=this['_availableModels']?this['_filterModels'](_0x3ae98b,this['_availableModels']):_0x3ae98b['filter'](_0x1d7ed5=>_0x1d7ed5['recommended']),_0x398678;}async['getModel'](_0x5f4bad){const _0x4cf883=await this['getAll']();if(!_0x4cf883['length'])return null;if(_0x5f4bad){const _0x4d23a3=this['_getModelById'](_0x4cf883,_0x5f4bad);if(_0x4d23a3)return _0x4d23a3;_0x3bfc82('ai-chat-model-id-unrecognized',{'modelId':_0x5f4bad,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x29f591=await this['getAvailableModels']();if(!_0x29f591['length'])return null;if(this['_defaultModelId']){const _0x26d597=this['_getModelById'](_0x29f591,this['_defaultModelId']);if(_0x26d597)return _0x26d597;_0x3bfc82('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x29f591[0x0]['id']});}return _0x29f591[0x0];}async['isAvailable'](_0x25261c){return(await this['getAvailableModels']())['some'](_0x5eb341=>_0x5eb341['name']===_0x25261c['name']&&_0x5eb341['provider']===_0x25261c['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x8db321=this['_locale']['uiLanguage']||'en',_0x3183b8=this['_connector']['getModels'](_0x8db321),_0x3e47c7=await _0x3183b8['list']();this['_modelList']=_0x3e47c7['items']['map'](_0x205c8c=>vi(_0x205c8c)?{..._0x205c8c,'name':i(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x205c8c);}catch(_0x3c8635){throw gt('ai-models-unable-to-retrieve',{'error':_0x3c8635}),_0x3c8635;}return[...this['_modelList']];}['_filterModels'](_0x5344fe,_0x3289e0){let _0x1ded37;if(_0x3289e0){_0x1ded37=[];const _0x4a284f=new Set(),_0x7e3bc5='string'==typeof _0x3289e0?[_0x3289e0['toLocaleLowerCase']()]:_0x3289e0['map'](_0x309616=>_0x309616['toLocaleLowerCase']());for(const _0x34b9b0 of _0x7e3bc5)for(const _0x4f1db3 of _0x5344fe)!_0x4a284f['has'](_0x4f1db3['id'])&&this['_isMatchingFilter'](_0x4f1db3,_0x34b9b0)&&(_0x1ded37['push'](_0x4f1db3),_0x4a284f['add'](_0x4f1db3['id']));}else _0x1ded37=_0x5344fe;return _0x1ded37;}['_isMatchingFilter'](_0x168ded,_0x2baef3){const _0x1fdacd=_0x168ded['id']['toLocaleLowerCase'](),_0x1ed1d8=_0x168ded['name']['toLocaleLowerCase'](),_0x265463=_0x168ded['provider']['toLocaleLowerCase']();return _0x1fdacd===_0x2baef3||_0x1ed1d8===_0x2baef3||vi(_0x168ded)&&'auto'===_0x2baef3||_0x265463===_0x2baef3||_0x1fdacd['startsWith'](_0x2baef3);}['_getModelById'](_0x4c2758,_0x5d35a8){return _0x4c2758['find'](_0x297487=>vi(_0x297487)&&'auto'===_0x5d35a8?_0x297487:_0x297487['id']===_0x5d35a8)||null;}}function vi(_0x2f99e5){return _0x2f99e5['id']['startsWith']('agent');}function T(_0x19da04){if(_0x19da04 instanceof dt)return _0x19da04;if(_0x19da04?.['editors']&&_0x19da04['editors']['get'](0x0))return _0x19da04['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.'),_0x19da04['editors']['get'](0x0);throw new _0x36ca17('ai-get-editor-from-context-no-editor');}function Z({editor:_0x21d971,interaction:_0xefa739,reply:_0x2443a7,groups:_0x3982a8,transform:_0x2472f9,documentCompare:_0x170428,documentCompareOptions:_0x510d7a}){const _0xfdb813=_0xefa739['getDocumentContext']();if(!_0xfdb813)return[];const _0x2fdd3d=_0xfdb813['content'],_0x64cc12=_0xfdb813['version'],_0x3ba04f=_0x2443a7['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x1f4ebf}of _0x3982a8){const _0x163f83=_0x1f4ebf['filter'](_0xe97b47=>'new'!=_0xe97b47['type'])['map'](_0x4ca803=>St('data-id',_0x4ca803['id'],_0x3ba04f)),_0x4e9f2e=_0x1f4ebf['filter'](_0x755d94=>'removed'!=_0x755d94['type'])['map'](_0x1684d5=>_0x1684d5['node']['cloneNode'](!0x0));let _0x1132a3=null;if(_0x163f83['length']){_0x1132a3=_0x163f83[0x0]['previousSibling'];for(let _0x4ee6f3=0x0;_0x4ee6f3<_0x163f83['length'];_0x4ee6f3++)_0x4c1d4c(_0x163f83[_0x4ee6f3]);}if(_0x4e9f2e['length']){_0x1132a3||(_0x1f4ebf[0x0]['anchorId']?_0x1132a3=St('data-id',_0x1f4ebf[0x0]['anchorId'],_0x3ba04f):(_0x1132a3=_0x4e9f2e['shift'](),_0x12356b(_0x3ba04f,_0x1132a3)));for(let _0x2b5ee2=0x0;_0x2b5ee2<_0x4e9f2e['length'];_0x2b5ee2++)_0x2bdf7a(_0x1132a3,_0x4e9f2e[_0x2b5ee2]),_0x1132a3=_0x4e9f2e[_0x2b5ee2];}}const _0x215010=Tt(_0x3ba04f),_0xe4462a=_0x170428['getDiff'](_0x2fdd3d,_0x215010,_0x510d7a)['getOperations']();if(_0x2472f9){const _0x129619=_0x21d971['model']['document']['history']['getOperations'](_0x64cc12),_0x4820df={'document':_0x21d971['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return nt(_0xe4462a,_0x129619,_0x4820df)['operationsA'];}return _0xe4462a;}function Y(_0x2ffbd7,_0x25c00d){if('marker'!=_0x25c00d['type'])return;const _0x1b75c4=_0x2ffbd7['model']['markers']['get'](_0x25c00d['name']);_0x1b75c4&&(_0x25c00d['oldRange']=_0x1b75c4['getRange']());}class at extends _0x575928{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[q,_0x29a341];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new _0x591ff4(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 _0x10bcec=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x1f83d5,_0x3748ce)=>{this['_handleUIUserMessage']({'userMessage':_0x3748ce});}),this['listenTo'](_0x10bcec,'resizedTabs',(_0x5bf748,_0x1be5d3)=>{this['_setIsMaximized'](_0x1be5d3);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x10bcec['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',(_0x3bd3ff,_0x3f0e1a)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x3f0e1a));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x5d3226,_0x1f96ff)=>{this['activeConversation']?.['addUrlToContext'](_0x1f96ff);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x9e06c1,_0x12e2f2)=>{_0x12e2f2['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x4ea420,_0x4e1b23)=>{this['activeConversation']?.['addResourceToContext'](_0x4e1b23['source'],_0x4e1b23['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x55fb1e,_0x4056e8)=>{this['_removeFromContext'](_0x4056e8);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x3b64ba,_0x3f4d2a)=>{this['activeConversation']?.['loadSourceResources'](_0x3f4d2a['sourceId'],_0x3f4d2a['query'],_0x3f4d2a['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x3724bd,_0x5877b7)=>{this['activeConversation']?.['setModel'](_0x5877b7);}),this['listenTo'](this['_aiChatUi'],'like',(_0xcda76a,{replyId:_0x7a0184})=>{console['log']('Liked\x20response',_0x7a0184);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x2d8d06,{replyId:_0x1dc2e0})=>{console['log']('Disliked\x20response',_0x1dc2e0);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x545eeb,_0x537ddc)=>{this['_insertSuggestion'](_0x537ddc);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0xfce5f4,{replyId:_0x3dfa43,partIndex:_0x166892})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x3dfa43,_0x166892);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x17e6f6,{replyId:_0x35f99f,partIndex:_0x5c9844})=>{const _0x52bef6=this['_getDocumentRangeForReplyChanges'](_0x35f99f,_0x5c9844);_0x52bef6&&'$graveyard'!=_0x52bef6['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x52bef6['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x1b47c1,_0x52affb)=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over'),this['_applySuggestion'](_0x52affb);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0xe844ea,{replyId:_0x1fcbf8,showDiff:_0x10fa44})=>{const {reply:_0x53c1c0}=this['getInteractionAndReplyById'](_0x1fcbf8),_0x244e15=_0x53c1c0['getContentParts']({'showDiff':_0x10fa44});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x53c1c0['id'],'parts':_0x244e15,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x17a095,{replyId:_0xa0571e,partIndex:_0x8a0e95})=>{this['_rejectSuggestion']({'replyId':_0xa0571e,'partIndex':_0x8a0e95}),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:_0x47ac7d,partIndex:_0x2d300f}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x3ebd3e}=this['getInteractionAndReplyById'](_0x47ac7d),_0x4ec921=_0x3ebd3e['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x2d300f});this['_aiChatBalloon']['updateContent']({'part':_0x4ec921[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0x2a4512,partIndex:_0x1b5ec9}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x2a4512,'partIndex':_0x1b5ec9}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x499ae0,partIndex:_0x14937e}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x499ae0,'partIndex':_0x14937e}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x9537d4,partIndex:_0x25d7ee}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x9537d4,'partIndex':_0x25d7ee}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0xa80956,partIndex:_0x164de5}=this['_currentPreviewedChangeGroup'],_0x1c1f7f=this['_getPresentableSiblingContentPartIndex'](_0xa80956,_0x164de5,'next');null!==_0x1c1f7f&&this['_openBalloonFor'](_0xa80956,_0x1c1f7f);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0x39ac46,partIndex:_0x5b1974}=this['_currentPreviewedChangeGroup'],_0x11e50c=this['_getPresentableSiblingContentPartIndex'](_0x39ac46,_0x5b1974,'previous');null!==_0x11e50c&&this['_openBalloonFor'](_0x39ac46,_0x11e50c);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x450fe1,{id:_0x5e8e8d})=>{if('aiChatBalloon'!==_0x5e8e8d)return;const {replyId:_0x31f420,partIndex:_0x3561da}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x31f420,'index':_0x3561da,'isActive':!0x1});}));}async['afterInit'](){this['context']instanceof dt?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x533b44,_0x17b38f)=>{_0x17b38f['on']('ready',()=>{this['_integrateEditor'](_0x17b38f);});});const _0x3e5736=this['context']['config']['get']('ai.chat.initialConversation');let _0x5c333a=_0x3e5736;if('lastCreated'!=_0x3e5736||(_0x5c333a=await this['_getLastCreatedConversationId'](),_0x5c333a))return'new'==_0x5c333a?this['_startConversationSafely']():this['loadConversation'](_0x5c333a);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_insertSuggestion'](_0xf2b36c){const _0x1199ba=T(this['context']);if(!_0x1199ba['plugins']['has']('TrackChanges'))throw new _0x36ca17('ai-no-track-changes',null);const _0x3218c9=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x35109f,interaction:_0x5d8217}=this['getInteractionAndReplyById'](_0xf2b36c['replyId']),_0x403f79=this['_getDocumentRangeForReplyChanges'](_0xf2b36c['replyId'],_0xf2b36c['partIndex']),_0xb8243e=void 0x0!==_0xf2b36c['partIndex']?[_0x35109f['changeGroups'][_0xf2b36c['partIndex']]]:_0x35109f['changeGroups']['filter'](_0x31e6e1=>'pending'==_0x31e6e1['state']),_0x191c10=_0xb8243e['map'](_0x50d89e=>_0x35109f['changeGroups']['indexOf'](_0x50d89e));if(!_0x403f79||'$graveyard'==_0x403f79['range']['root']['rootName'])return void _0x191c10['forEach'](_0x57c818=>_0x35109f['setChangeGroupState'](_0x57c818,'outdated'));_0x191c10['forEach'](_0x4b932a=>_0x35109f['setChangeGroupState'](_0x4b932a,'accepted'));const _0x643d02=Z({'editor':_0x1199ba,'reply':_0x35109f,'interaction':_0x5d8217,'groups':_0xb8243e,'transform':!0x0,'documentCompare':_0x3218c9,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x13c311;_0x403f79&&this['_scrollToSuggestionRange'](_0x403f79['range']),_0x1199ba['model']['change'](_0x56ab84=>{_0x13c311=_0x56ab84['batch'],_0x1199ba['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x643d02),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x13c311,{'interactionId':_0x5d8217['id'],'replyId':_0x35109f['id'],'indexes':_0x191c10['slice']()}),this['_updateRatings'](_0x35109f);}['_applySuggestion'](_0x8e079c){const _0x2b8f3f=T(this['context']),_0x2770d9=this['context']['plugins']['get'](_0x29a341),{reply:_0x294e37,interaction:_0x3aac17}=this['getInteractionAndReplyById'](_0x8e079c['replyId']),_0x1dc286=this['_getDocumentRangeForReplyChanges'](_0x8e079c['replyId'],_0x8e079c['partIndex']),_0x219c4f=void 0x0!==_0x8e079c['partIndex']?[_0x294e37['changeGroups'][_0x8e079c['partIndex']]]:_0x294e37['changeGroups']['filter'](_0x6d5ac=>'pending'==_0x6d5ac['state']),_0x2c5d1d=_0x219c4f['map'](_0x190f1e=>_0x294e37['changeGroups']['indexOf'](_0x190f1e));if(!_0x1dc286||'$graveyard'==_0x1dc286['range']['root']['rootName'])return void _0x2c5d1d['forEach'](_0x247baf=>_0x294e37['setChangeGroupState'](_0x247baf,'outdated'));_0x2c5d1d['forEach'](_0x40a4e6=>_0x294e37['setChangeGroupState'](_0x40a4e6,'accepted'));const _0x282b96=Z({'editor':_0x2b8f3f,'reply':_0x294e37,'interaction':_0x3aac17,'groups':_0x219c4f,'transform':!0x0,'documentCompare':_0x2770d9,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x281514;_0x1dc286&&this['_scrollToSuggestionRange'](_0x1dc286['range']),_0x2b8f3f['model']['change'](_0x3c8a06=>{_0x281514=_0x3c8a06['batch'];for(const _0x824aad of _0x282b96)_0x824aad['baseVersion']=_0x2b8f3f['model']['document']['version'],Y(_0x2b8f3f,_0x824aad),_0x3c8a06['batch']['addOperation'](_0x824aad),_0x2b8f3f['model']['applyOperation'](_0x824aad);}),this['_batchToChanges']['set'](_0x281514,{'interactionId':_0x3aac17['id'],'replyId':_0x294e37['id'],'indexes':_0x2c5d1d['slice']()}),this['_updateRatings'](_0x294e37);}['_rejectSuggestion'](_0x4da023){const {reply:_0x4e680e}=this['getInteractionAndReplyById'](_0x4da023['replyId']);_0x4e680e['setChangeGroupState'](_0x4da023['partIndex'],'rejected');}['_openBalloonFor'](_0x11a917,_0x4bf772){if(!this['_aiChatBalloon'])return;const {reply:_0x2c47c9}=this['getInteractionAndReplyById'](_0x11a917),_0x543bce=_0x2c47c9['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x2480e3,_0x5d849f;if(void 0x0!==_0x4bf772?(_0x5d849f=_0x543bce['find'](_0x29a76f=>_0x29a76f['index']==_0x4bf772),_0x2480e3=_0x5d849f?.['index']):(_0x5d849f=_0x543bce[0x0],_0x2480e3=_0x5d849f['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x11a917&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x2480e3)return;const _0x55fd31=this['_getUserPresentableContentPartDocumentRange'](_0x11a917,_0x2c47c9,_0x5d849f);if(!_0x55fd31)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x11a917,'partIndex':_0x2480e3},this['_scrollToSuggestionRange'](_0x55fd31,!0x0);const _0xce3b48=this['_getPresentableSiblingContentPartIndex'](_0x11a917,_0x2480e3,'next');this['_aiChatBalloon']['updateContent']({'part':_0x5d849f,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x2480e3,'title':i(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x2480e3+0x1)['toString']()),'showRotator':null!==_0xce3b48,'ranges':[_0x55fd31],'areActionsDisabled':_0x2c47c9['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x11a917,_0x2480e3),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x11a917,'index':_0x2480e3,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0xc3ab01,_0x3ec500,_0x5b1707){const {reply:_0x3bb355}=this['getInteractionAndReplyById'](_0xc3ab01),_0x38ca53=_0x3bb355['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x38ca53['length'])return null;const _0x104706=_0x38ca53['findIndex'](_0x495347=>_0x495347['index']==_0x3ec500),_0x27dc3d='next'==_0x5b1707?0x1:-0x1;let _0x6c9ea4=_0x38ca53['at']((_0x104706+_0x27dc3d)%_0x38ca53['length'])['index'],_0x3375d4=_0x38ca53[_0x6c9ea4];for(;!this['_getUserPresentableContentPartDocumentRange'](_0xc3ab01,_0x3bb355,_0x3375d4);){if(_0x6c9ea4=_0x38ca53['at']((_0x6c9ea4+_0x27dc3d)%_0x38ca53['length'])['index'],_0x6c9ea4===_0x104706)return null;_0x3375d4=_0x38ca53[_0x6c9ea4];}return _0x6c9ea4;}['_getUserPresentableContentPartDocumentRange'](_0x3696c3,_0x521132,_0x16e96c){const _0x1cc197=_0x521132['changeGroups'];if(!_0x16e96c['hasChanges'])return null;const _0xb8acb1=_0x1cc197['find'](_0x253263=>_0x253263['index']==_0x16e96c['index']);if('pending'!==_0xb8acb1?.['state'])return null;const _0x3c0f79=this['_getDocumentRangeForReplyChanges'](_0x3696c3,_0x16e96c['index']);if(!_0x3c0f79)return null;const {range:_0x4c2cbd,currentIndex:_0x463040}=_0x3c0f79;return'$graveyard'==_0x4c2cbd['root']['rootName']?(_0x521132['setChangeGroupState'](_0x463040,'outdated'),null):_0x3c0f79['range'];}['_getDocumentRangeForReplyChanges'](_0x46656e,_0x166ed4){const _0x58b7d3=T(this['context']),{reply:_0x272f2c,interaction:_0x496b21}=this['getInteractionAndReplyById'](_0x46656e),_0x1a8c0e=_0x272f2c['changeGroups']['filter'](_0x113c48=>'pending'==_0x113c48['state']),_0x2b2e81=_0x1a8c0e['map'](_0x27822b=>_0x272f2c['changeGroups']['indexOf'](_0x27822b));void 0x0===_0x166ed4&&(_0x166ed4=_0x2b2e81[0x0]);const _0x1e2b38=_0x2b2e81['indexOf'](_0x166ed4);if(-0x1==_0x1e2b38)return null;const _0x21911d=_0x1a8c0e[_0x1e2b38],_0x237ed8=new Et([]),_0x51d804=new Et([]);for(const _0x2ea569 of _0x21911d['changes'])if('removed'!=_0x2ea569['type']&&_0x51d804['children']['push'](_0x2ea569['node']['cloneNode'](!0x0)),'new'!=_0x2ea569['type']){const _0x3a99a1=yt(_0x327f8c=>At(_0x327f8c,'data-id')==_0x2ea569['id'],_0x272f2c['documentContextContent'],!0x0);_0x237ed8['children']['push'](_0x3a99a1['cloneNode'](!0x0));}if(0x0==_0x237ed8['children']['length']){if(_0x21911d['changes'][0x0]['anchorId']){const _0x2376ae=St('data-id',_0x21911d['changes'][0x0]['anchorId'],_0x272f2c['documentContextContent']);_0x237ed8['children']['unshift'](_0x2376ae['cloneNode'](!0x0)),_0x51d804['children']['unshift'](_0x2376ae['cloneNode'](!0x0)),_0x2376ae['nextSibling']&&(_0x237ed8['children']['push'](_0x2376ae['nextSibling']['cloneNode'](!0x0)),_0x51d804['children']['push'](_0x2376ae['nextSibling']['cloneNode'](!0x0)));}else{const _0x20aff4=_0x272f2c['documentContextContent']['children'][0x0];if(!_0x20aff4)return null;_0x237ed8['children']['push'](_0x20aff4['cloneNode'](!0x0)),_0x51d804['children']['push'](_0x20aff4['cloneNode'](!0x0));}}const _0x19a48e=_0x496b21['getDocumentContext'](),_0x884293=_0x58b7d3['data']['parse'](_0x19a48e['content']),_0x31eead=Tt(_0x237ed8),_0x583c0=_0x58b7d3['data']['parse'](_0x31eead),_0xb0efec=_0x58b7d3['data']['parse'](_0x31eead),_0x4747da=_0x58b7d3['model']['createPositionAt'](_0x583c0,0x0),_0x594714=Tt(_0x51d804),_0x5d4822={'anchor':_0x4747da,'markDeletions':!0x1},_0x346012=_0x58b7d3['plugins']['get'](_0x29a341)['getDiff'](_0x31eead,_0x594714,_0x5d4822)['getOperations']();if(!_0x346012['length'])return null;_0x58b7d3['model']['change'](_0x9bf80d=>{for(const _0x733346 of _0x346012)if('remove'==_0x733346['type']){const _0x47ff1d=_0x733346['sourcePosition'],_0x5930d1=_0x733346['howMany'],_0x155331=new et(_0x47ff1d,_0x5930d1);_0x9bf80d['batch']['addOperation'](_0x155331),_0x58b7d3['model']['applyOperation'](_0x155331);}else'marker'!==_0x733346['type']&&(_0x733346['baseVersion']=null,_0x733346['isDocumentOperation']=!0x1,_0x9bf80d['batch']['addOperation'](_0x733346),_0x58b7d3['model']['applyOperation'](_0x733346));});const _0x3d22a3=mt(_0x58b7d3,_0x346012,_0x583c0);ft(_0x58b7d3['model'],_0x3d22a3);const _0x1f4bd4=_0x3d22a3['getFirstRange']()['start']['path']['slice'](),_0x12b331=_0x3d22a3['getFirstRange']()['end']['path']['slice'](),_0x1f7ef0=[];let _0x4bdd8c=_0x583c0,_0x510620=_0xb0efec;for(let _0x2815e3=0x0;_0x2815e3<_0x12b331['length'];_0x2815e3++){const _0x322809=_0x4bdd8c['maxOffset']-_0x12b331[_0x2815e3];_0x1f7ef0[_0x2815e3]=_0x510620['maxOffset']-_0x322809,_0x4bdd8c=_0x4bdd8c['getChildAtOffset'](_0x12b331[_0x2815e3]),_0x510620=_0x510620['getChildAtOffset'](_0x1f7ef0[_0x2815e3]);}const _0x3666d6=_0x58b7d3['model']['createRange'](_0x58b7d3['model']['createPositionFromPath'](_0xb0efec,_0x1f4bd4),_0x58b7d3['model']['createPositionFromPath'](_0xb0efec,_0x1f7ef0)),_0x44d0e1=_0xb0efec['getChild'](0x0)['getAttribute'](Ct),_0x4eda1c=Array['from'](_0x884293['getChildren']())['find'](_0x2c703a=>_0x2c703a['getAttribute'](Ct)==_0x44d0e1)['getPath'](),_0x49ad61=_0x3666d6['start']['path']['slice'](),_0x509da3=_0x3666d6['end']['path']['slice']();_0x49ad61[0x0]=_0x4eda1c[0x0]+_0x49ad61[0x0],_0x509da3[0x0]=_0x4eda1c[0x0]+_0x509da3[0x0];let _0x51dd9f=_0x58b7d3['model']['createRange'](_0x58b7d3['model']['createPositionFromPath'](_0x58b7d3['model']['document']['getRoot'](),_0x49ad61),_0x58b7d3['model']['createPositionFromPath'](_0x58b7d3['model']['document']['getRoot'](),_0x509da3));const _0xec044=_0x58b7d3['model']['document']['history']['getOperations'](_0x19a48e['version']);for(const _0x1aa1d9 of _0xec044)_0x51dd9f=it['_createFromRanges'](_0x51dd9f['getTransformedByOperation'](_0x1aa1d9));return{'range':_0x51dd9f,'currentIndex':_0x166ed4};}['_integrateEditor'](_0x928059){if(!_0x928059['plugins']['has']('Undo'))return;const _0x1a3afc=_0x928059['commands']['get']('undo'),_0x1953bb=_0x928059['commands']['get']('redo');this['listenTo'](_0x1a3afc,'revert',(_0x242ceb,_0x557d1c,_0x242340)=>{const _0x5764dc=this['_batchToChanges']['get'](_0x557d1c);if(!_0x5764dc)return;const _0x12db40=this['activeConversation']['getInteraction'](_0x5764dc['interactionId'])['getReply'](_0x5764dc['replyId']);_0x5764dc['indexes']['forEach'](_0x16d585=>_0x12db40['setChangeGroupState'](_0x16d585,'pending')),this['_batchToChanges']['delete'](_0x557d1c),this['_batchToChanges']['set'](_0x242340,_0x5764dc);}),this['listenTo'](_0x1953bb,'revert',(_0x1a8d0a,_0x40f7c8,_0x149a4c)=>{const _0x5738d9=this['_batchToChanges']['get'](_0x40f7c8);if(!_0x5738d9)return;const _0x408a14=this['activeConversation']['getInteraction'](_0x5738d9['interactionId'])['getReply'](_0x5738d9['replyId']);_0x5738d9['indexes']['forEach'](_0x2220a7=>_0x408a14['setChangeGroupState'](_0x2220a7,'accepted')),this['_batchToChanges']['delete'](_0x40f7c8),this['_batchToChanges']['set'](_0x149a4c,_0x5738d9);});}async['loadConversation'](_0x38016f){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'](_0x38016f)['getConversation'](),await this['_startConversationSafely'](_0x38016f),this['updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x38016f,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x2a908b){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x38016f}),this['_logError'](new _0x36ca17('ai-chat-conversation-not-found',this,{'error':_0x2a908b}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}async['_getLastCreatedConversationId'](){const _0x440275=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x1cf416=await _0x440275['getConversations']();return _0x1cf416['length']?_0x1cf416[0x0]['id']:'new';}catch(_0x2aae14){return this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x926b30()}),this['_logError'](new _0x36ca17('ai-chat-conversation-init-failed',this,{'error':_0x2aae14})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}['handleRemovedConversation'](_0x252c4e){this['activeConversation']['id']===_0x252c4e&&this['_startConversationSafely']();}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x3a35ce=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x3a35ce),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x33b22d,attributes:_0x1fed0a}){await this['_handleUIUserMessage']({'userMessage':_0x33b22d,'attributes':_0x1fed0a});}['getGroupId'](){const _0x108844=this['context']['config']['get']('collaboration.channelId');if(!_0x108844)throw new _0x36ca17('ai-chat-missing-channel-id',this);return _0x108844;}async['_startConversationSafely'](_0x191e51){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x191e51);}catch(_0x4d6f31){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x191e51||_0x926b30()}),console['error'](_0x4d6f31),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x16165e){let _0x5ad1cc;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0x16165e||!this['activeConversation']?_0x5ad1cc=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x5ad1cc=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x25bda0=this['getGroupId'](),_0x338a82=_0x16165e||_0x926b30();this['activeConversation']=new _t({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x5ad1cc,'conversationId':_0x338a82,'group':_0x25bda0,'getEditor':()=>T(this['context']),'isFromHistory':!!_0x16165e}),this['activeConversation']['delegate']('toolDataReceived','interactionStarted')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x40a6e4,_0x11c44f)=>{this['_aiChatUi']['createConversation'](_0x11c44f),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x16165e||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x2e252e,_0x22f063)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x22f063['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x3e57be,_0x257526)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x257526);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x20bbc7=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x20bbc7);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x433e3c=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x433e3c);}),this['activeConversation']['on']('webSearchFinished',(_0x51948a,_0x185be3)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x185be3,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x362410,_0x28d308)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x28d308,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x5d8c30,_0x14762f)=>{this['_aiChatUi']['removeFeedInteraction'](_0x14762f['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x4b3deb,_0xe99e89,_0x1a8f80)=>{this['updateConversationTitle'](_0xe99e89,_0x1a8f80);}),this['activeConversation']['on']('replyCreated',(_0x5b9ef6,_0x2b9287)=>{'text'===_0x2b9287['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x2b9287):this['_aiChatUi']['addFeedItemAISuggestion'](_0x2b9287);}),this['activeConversation']['on']('replyContentUpdated',async(_0x6810b9,_0x52652d)=>{await this['_updateReplyContent']({'reply':_0x52652d});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x5864b5,{reply:_0x4194c0,index:_0xb0a8e9,state:_0xf4bb0b})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x4194c0['id'],'index':_0xb0a8e9,'state':_0xf4bb0b}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x4194c0['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0xb0a8e9&&this['_aiChatBalloon']?.['setState'](_0xf4bb0b);}),this['activeConversation']['on']('contextItemAdded',(_0x22d0a4,_0x5ab37e)=>{if(this['_aiChatUi']['addContextItem'](_0x5ab37e['contextItem'],_0x5ab37e['isLoading']),'selection'===_0x5ab37e['contextItem']['type']){const _0x1665f8=[...T(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x1665f8,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x502f78,_0x26dfa4)=>{this['_aiChatUi']['removeContextItem'](_0x26dfa4['uiId']),'current-document'==_0x26dfa4['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x26dfa4['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x14c9b6,_0x175bc3)=>{this['_aiChatUi']['setContextItemLoading'](_0x175bc3['contextItem']['uiId'],_0x175bc3['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x3b5b00,_0x10e159)=>{this['_aiChatUi']['setConversationContext'](_0x10e159['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0xc5ff38,_0x811115)=>{this['_aiChatUi']['setAddContextOptions'](_0x811115['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x52ea3a,_0x237365)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x237365['sourceId'],_0x237365['source'],_0x237365['resources'],_0x237365['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x5059ee,_0x314735)=>{this['_aiChatUi']['updateResourceState'](_0x314735['sourceId'],_0x314735['resourceId'],_0x314735['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x5d471d,_0x8aa166)=>{this['_aiChatUi']['updateCapabilities'](_0x8aa166);}),this['activeConversation']['on']('modelSelected',async(_0x41d200,_0x59e4e2)=>{const _0x3657e9=(await this['_aiChatModels']['getAll']())['find'](_0xc13fc9=>_0xc13fc9['id']===_0x59e4e2['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x3657e9,_0x59e4e2['isDisabled']);}),this['activeConversation']['on']('error',(_0x34fa0a,{error:_0x1c3861,interactionId:_0x34e650,fileName:_0x51b399,url:_0x50c3db,sourceId:_0x922e6a,sourceLabel:_0x5f5b79})=>{const _0x483adb=_0x34e650?_0x34e650+':'+_0x926b30():_0x926b30();_0x1c3861['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':i(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x483adb}):_0x1c3861['message']['startsWith']('ai-chat-conversation-init-failed')||_0x1c3861['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x483adb}),this['_logError'](_0x1c3861)):_0x1c3861['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x51b399),'id':_0x483adb}):_0x1c3861['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x50c3db),'id':_0x483adb}):_0x1c3861['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x483adb}):_0x1c3861['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x483adb}):_0x1c3861['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x922e6a&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x922e6a),this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x5f5b79||'source'),'id':_0x483adb}),this['_logError'](_0x1c3861)):_0x1c3861['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x483adb}),this['_logError'](_0x1c3861)):_0x1c3861['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x483adb}),this['_logError'](_0x1c3861)):_0x1c3861['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x483adb}),this['_logError'](_0x1c3861)):_0x1c3861['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x483adb}),this['_logError'](_0x1c3861)):_0x1c3861['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':_0x483adb}),this['_logError'](_0x1c3861)):_0x1c3861['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':_0x483adb}),this['_logError'](_0x1c3861)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x483adb}),this['_logError'](_0x1c3861));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x16165e||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x4a2a0a,attributes:_0x5858d7}){if(!this['activeConversation'])throw new _0x36ca17('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x5b78ac=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x5b78ac);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x4a2a0a,'attributes':_0x5858d7});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x11e63f){this['_aiChatUi']['setIsMaximized'](_0x11e63f);}['_logError'](_0x1aa080){gt(_0x1aa080['message']);}['_removeFromContext'](_0x3ce25d){this['activeConversation']?.['removeFromContext'](_0x3ce25d);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x1268fb){const [_0x510002,_0x5898ac]=_0x1268fb['split'](':'),_0x334585=this['activeConversation']['getInteraction'](_0x510002),_0x10e3a4=_0x334585['getReply'](_0x5898ac);return{'interaction':_0x334585,'reply':_0x10e3a4};}['_scrollToSuggestionRange'](_0x5ad878,_0x3c3902=!0x1){const _0x45cbe4=T(this['context']),_0x24af91={'target':_0x45cbe4['editing']['view']['domConverter']['viewRangeToDom'](_0x45cbe4['editing']['mapper']['toViewRange'](_0x5ad878)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x3c3902};_0x3c3902&&(_0x24af91['alignToTop']=!0x0),_0x538b49(_0x24af91);}['updateConversationTitle'](_0x32823a,_0x15d780=!0x1){this['_aiChatUi']['setConversationTitle'](_0x32823a||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x15d780);}async['_updateReplyContent']({reply:_0x4a147f,renderingStrategy:_0x338a32}){const {id:_0x107070,interactionId:_0x37f31e,isDone:_0x72bdf1,type:_0x50f9ae,parsedContent:_0x36bf23}=_0x4a147f,_0x242785=_0x37f31e+':'+_0x107070;if('modification'===_0x50f9ae){const _0x290595=_0x4a147f['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x242785,'parts':_0x290595,'renderingStrategy':_0x338a32,'isDone':_0x72bdf1});}else'text'===_0x50f9ae&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x242785,'parsedContent':_0x36bf23,'renderingStrategy':_0x338a32,'isDone':_0x72bdf1});_0x72bdf1&&_0x4a147f['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x242785,_0x4a147f['sources']);}async['_stopLastInteraction'](){const _0x474d46=this['activeConversation']?.['lastInteraction'];_0x474d46&&(_0x474d46['stop'](),this['_aiChatUi']['stopInteraction'](_0x474d46));}async['_flushLastInteractionUI'](){const _0x1e72dd=this['activeConversation']?.['lastInteraction'];if(_0x1e72dd){for await(const _0x1d546e of _0x1e72dd['replies'])await this['_updateReplyContent']({'reply':_0x1d546e,'renderingStrategy':'static'});}}['_updateRatings'](_0x557980){const _0x5888ad={'positiveCount':_0x557980['changeGroups']['filter'](_0x55ba72=>'accepted'===_0x55ba72['state'])['length'],'totalCount':_0x557980['changeGroups']['length'],'modificationId':_0x557980['id']},_0x130968=this['activeConversation']['getInteraction'](_0x557980['interactionId'])['messageId'];_0x130968&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x130968,_0x5888ad);}['_registerToolDataCallback'](_0x1b0e50){let _0x351cbd=null,_0x12b8ef=null;this['on']('toolDataReceived',(_0x103644,_0x5b6564,_0x2e99c0)=>{_0x2e99c0['id']!==_0x351cbd&&(_0x351cbd=_0x2e99c0['id'],_0x12b8ef=this['_getAIChatInteractionAPI'](_0x2e99c0)),_0x1b0e50(_0x5b6564,_0x12b8ef);});}['_getAIChatInteractionAPI'](_0x19e236){const _0x390721=this['_aiChatUi'],_0x33c600=()=>{_0x19e236['resetWebSearchState'](),_0x19e236['resetReasoningState'](),_0x390721['clearLoadingMessage']();},_0x44bb77=()=>{_0x19e236['currentReply']&&(_0x19e236['currentReply']['done'](),_0x19e236['currentReply']=void 0x0);};return{'insertTextReply':(_0x23e817,_0x430029)=>{_0x44bb77(),_0x33c600();const _0x227220=_0x19e236['currentReply']=_0x19e236['createReply']({'type':'text','interactionId':_0x19e236['id'],'content':_0x23e817,'id':_0x430029||_0x926b30()});return _0x44bb77(),_0x227220;},'insertCustomElement':async(_0x588042,_0x2cb3a1)=>(_0x44bb77(),_0x33c600(),_0x390721['addFeedItemCustomElement'](_0x588042,_0x2cb3a1||_0x926b30())),'setLoadingMessage':_0x1990cc=>{_0x390721['setLoadingMessage'](_0x1990cc);},'clearLoadingMessage':()=>{_0x390721['clearLoadingMessage']();}};}}const R='ai-selection';class D extends _0x575928{constructor(_0x4deb01){super(_0x4deb01),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 _0x2d85ed=T(this['context']),_0x4e1afe=_0x2d85ed['plugins']['has']('RealTimeCollaborationClient')&&_0x2d85ed['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x4e1afe||_0x926b30();}return this['_sessionId'];}async['getDocumentData'](){const _0x25e67b=T(this['context']),_0x205432=_0x25e67b['model'],_0x1d01b2=_0x25e67b['data']['toView'](_0x205432['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x2e38ef=new Dt(_0x25e67b['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x1d01b2,_0x2e38ef);let _0x319d59=await this['_getDocumentDataStringFromView'](_0x1d01b2);const _0x2a292f=this['_getMarkersInDocumentOrder'](),_0x5ac379=[];for(const _0x10ae70 of _0x2a292f){const _0x54dfbc='<'+_0x10ae70['name']+':start></'+_0x10ae70['name']+':start>',_0x571f18=_0x319d59['indexOf'](_0x54dfbc);_0x319d59=_0x319d59['substring'](0x0,_0x571f18)+_0x319d59['substring'](_0x571f18+_0x54dfbc['length']);const _0x12c556='<'+_0x10ae70['name']+':end></'+_0x10ae70['name']+':end>',_0x532cb0=_0x319d59['indexOf'](_0x12c556);_0x319d59=_0x319d59['substring'](0x0,_0x532cb0)+_0x319d59['substring'](_0x532cb0+_0x12c556['length']),_0x5ac379['push']({'markerName':_0x10ae70['name'],'start':_0x571f18,'end':_0x532cb0,'htmlFragment':_0x319d59['substring'](_0x571f18,_0x532cb0)});}return{'content':_0x319d59,'version':_0x25e67b['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x5ac379};}async['afterInit'](){this['context']instanceof dt?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x4b529a,_0x34a63e)=>{_0x34a63e['on']('ready',()=>{this['_integrateEditor'](_0x34a63e);});});}['_setOutputDataProcessor'](_0x4fdf9d){this['_outputDataProcessor']=_0x4fdf9d;}async['_getDocumentDataStringFromView'](_0x48dee2){let _0x5cbf42;const _0x2ebcc1=T(this['context']);if(this['_outputDataProcessor']){const _0x30da49=_0x2ebcc1['data']['processor']['domConverter']['viewToDom'](_0x48dee2),_0x124d17=await this['_outputDataProcessor'](_0x30da49);_0x5cbf42=_0x2ebcc1['data']['processor']['htmlWriter']['getHtml'](_0x124d17);}else _0x5cbf42=_0x2ebcc1['data']['processor']['toData'](_0x48dee2);return _0x5cbf42;}['_integrateEditor'](_0x45ded9){_0x45ded9['conversion']['for']('editingDowncast')['markerToHighlight']({'model':R,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x45ded9['conversion']['for']('dataDowncast')['markerToElement']({'model':R,'view':(_0x106ce1,{writer:_0x357fbb,options:_0x36860c})=>_0x36860c['convertAiChatSelectionMarker']?_0x357fbb['createUIElement'](_0x106ce1['markerName']+':'+(_0x106ce1['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x3688ff,_0xc9b788,_0x88cc57=!0x1,_0xb864bb=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0xb864bb)return!0x1;const _0xb0e1f8=T(this['context'])['model'];return _0xb0e1f8['change'](_0x20745d=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0xc9b788,this['_displayedFakeSelectionLocked']=_0x88cc57;let _0x50ed7d=0x0;for(let _0x504520 of _0x3688ff){const _0x33e6f9=R+':'+_0x50ed7d;if(_0x504520['start']['isAtEnd']){const _0x376ffb=_0x504520['start']['getLastMatchingPosition'](({item:_0x3ed9d7})=>!_0xb0e1f8['schema']['isContent'](_0x3ed9d7),{'boundaries':_0x504520});_0x504520=_0x20745d['createRange'](_0x376ffb,_0x504520['end']);}_0x20745d['addMarker'](_0x33e6f9,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x504520}),_0x50ed7d++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x43e6ac){if(this['_displayedFakeSelectionId']!=_0x43e6ac)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x49a100=T(this['context']),_0x476c48=_0x49a100['model']['markers']['getMarkersGroup'](R);return _0x49a100['model']['change'](_0x143024=>{for(const _0x440cd3 of _0x476c48)_0x143024['removeMarker'](_0x440cd3);}),!0x0;}async['modelToDataWithIds'](_0x8b04de){const _0x5e2717=T(this['context']),_0x488a70=_0x5e2717['data']['toView'](_0x8b04de),_0xb4c573=new Dt(_0x5e2717['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x488a70,_0xb4c573),this['_getDocumentDataStringFromView'](_0x488a70);}['_setDataIdsOnChildren'](_0x557ddb,_0x2d88cf){let _0x376431=!0x1;const _0x2e02f6=new Set();for(const _0x1fa40f of _0x557ddb['getChildren']()){const _0x2e5dc5=_0x1fa40f['is']('emptyElement')||_0x1fa40f['is']('containerElement');if(!_0x1fa40f['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x1fa40f,_0x2d88cf)||_0x2e5dc5)&&(_0x2d88cf['setAttribute']('data-id',this['_nextDataId'](_0x2e02f6),_0x1fa40f),_0x376431=!0x0);}return _0x376431;}['_nextDataId'](_0x49f994){let _0x223e54;do{_0x223e54='';for(let _0x472bfd=0x0;_0x472bfd<0x4;_0x472bfd++)_0x223e54+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x49f994['has'](_0x223e54));return _0x49f994['add'](_0x223e54),_0x223e54;}['getSelectionText'](){const {model:_0x328653}=T(this['context']),_0x531e33=_0x328653['document']['selection'],_0x3f5b7b=[];for(const _0x509095 of _0x531e33['getRanges']())for(const _0x5105e0 of _0x509095['getItems']())_0x5105e0['is']('$textProxy')?_0x3f5b7b['push'](_0x5105e0['data']):_0x5105e0['is']('element')&&_0x3f5b7b['length']>0x0&&'\x20'!==_0x3f5b7b[_0x3f5b7b['length']-0x1]&&_0x3f5b7b['push']('\x20');return _0x3f5b7b['length']?'\x22'+_0x3f5b7b['join']('')['trim']()+'\x22':i(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_getMarkersInDocumentOrder'](){const _0x3e14b0=T(this['context'])['model'];return Array['from'](_0x3e14b0['markers']['getMarkersGroup'](R))['sort']((_0x37faae,_0x1635f8)=>_0x37faae['getStart']()['isBefore'](_0x1635f8['getStart']())?-0x1:_0x37faae['getStart']()['isAfter'](_0x1635f8['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(_0x55cbc3){this['options']={'delay':_0x55cbc3['delay']??0x14,'textNodeStyle':_0x55cbc3['textNodeStyle'],'onStreamUpdate':_0x55cbc3['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x3031cf,targetElement:_0x573e56,abortSignal:_0x56f2d6}){this['isStreaming']&&this['stop'](),_0x56f2d6?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x54590c(_0x3031cf,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x53ed64=0x0;_0x53ed64<this['currentIndex'];_0x53ed64++)this['nodesList'][_0x53ed64]['shouldBeStreamed']=!0x0;do{const _0x1e4cbd=Date['now'](),_0x5530cd=this['nodesList'][this['currentIndex']],_0x44a923=_0x1e4cbd-this['lastUpdateTime'];if(_0x5530cd){_0x5530cd['shouldBeStreamed']=!0x0;let _0x3e33f6=_0x5530cd['parent'];for(;_0x3e33f6;)_0x3e33f6['shouldBeStreamed']=!0x0,_0x3e33f6=_0x3e33f6['parent'];}if(_0x44a923<this['options']['delay'])try{const {promise:_0x54c13d,abortController:_0x158370}=Ds(this['options']['delay']-_0x44a923);this['timeoutAbortController']=_0x158370,await _0x54c13d;}catch(_0x4dcaf9){return;}_0x13f10f(_0x573e56,'<'+_0x573e56['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x573e56['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:_0x1a7bc4}){Array['from'](_0x1a7bc4['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x3ae795=>{_0x3ae795['replaceWith'](_0x3ae795['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x273665){let _0x1e1354='';if(function(_0x56ec44){return _0x22ff9c(_0x56ec44);}(_0x273665)){for(const _0x5d304f of _0x273665['children'])_0x1e1354+=this['renderNode'](_0x5d304f);}else{if(Ts(_0x273665)){if(!_0x273665['shouldBeStreamed'])return'';const _0x55ddcc=_0x273665,_0x563657=Object['entries'](_0x55ddcc['attribs'])['map'](([_0x34f3a8,_0x54805e])=>_0x34f3a8+'=\x22'+_0x54805e+'\x22')['join']('\x20');_0x1e1354+='<'+_0x55ddcc['tagName']+(_0x563657?'\x20'+_0x563657:'')+'>';for(const _0x2f0c20 of _0x3d953b(_0x55ddcc))_0x1e1354+=this['renderNode'](_0x2f0c20);_0x1e1354+='</'+_0x55ddcc['tagName']+'>';}else{if(!Ss(_0x273665))return'';if(!_0x273665['shouldBeStreamed'])return'';!function(_0xb985a3){if(!_0xb985a3['parent']||!Ts(_0xb985a3['parent']))return!0x1;if(!ys['includes'](_0xb985a3['parent']['tagName']))return!0x1;return!_0x1aed79(_0xb985a3)['match'](/^\s*[<>]\s*$/);}(_0x273665)?_0x1e1354+=_0x3807c6(_0x273665):_0x1e1354+=_0x3807c6(new _0x10ebb7('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x273665]));}}return _0x1e1354;}['getParsedDocumentNodeList'](){const _0x140176=[];return function(_0x5b2a5f,_0x5c719e){const _0x2d4931=_0x28f411=>{if(_0x5c719e(_0x28f411),_0x28f411 instanceof _0x5f1e12)for(let _0x8d28b0=0x0;_0x8d28b0<_0x28f411['children']['length'];_0x8d28b0++){const _0x63460c=_0x28f411['children'][_0x8d28b0];_0x2d4931(_0x63460c);}};for(let _0x415431=0x0;_0x415431<_0x5b2a5f['children']['length'];_0x415431++)_0x2d4931(_0x5b2a5f['children'][_0x415431]);}(this['document'],_0x407a2d=>{if(Ss(_0x407a2d)){const _0x23389f=this['splitTextNodeIntoWordNodes'](_0x407a2d);_0x23389f['length']&&_0x140176['push'](..._0x23389f);}_0x407a2d['isWordSplitSource']||_0x407a2d['isWordSplitResult']||_0x140176['push'](_0x407a2d);}),_0x140176;}['splitTextNodeIntoWordNodes'](_0x25465c){if(_0x25465c['isWordSplitSource']||_0x25465c['isWordSplitResult'])return[];const _0x14683a=_0x1aed79(_0x25465c)['match'](/(?:\s*\S+\s*)/g),_0x3a2b28=[];if(_0x14683a&&_0x14683a['length']>0x1){for(const _0x569e2f of _0x14683a){const _0x3de673=new _0x280441(_0x569e2f);_0x3de673['isWordSplitResult']=!0x0,_0x2b8438(_0x25465c,_0x3de673),_0x3a2b28['push'](_0x3de673);}_0x25465c['isWordSplitSource']=!0x0,_0x4c1d4c(_0x25465c);}return _0x3a2b28;}}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(_0x723dc6){return _0x30a61f(_0x723dc6);}function Ts(_0x19aacf){return _0x5d51b2(_0x19aacf);}function Ds(_0x1f5d51){const _0x357fb3=new AbortController();return{'promise':new Promise((_0x2e3787,_0x133cd3)=>{const _0x4e9d84=setTimeout(_0x2e3787,_0x1f5d51);_0x357fb3['signal']['addEventListener']('abort',()=>{clearTimeout(_0x4e9d84),_0x133cd3();});}),'abortController':_0x357fb3};}class Fr extends _0x184e76{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x311fd7){super();const _0x2f377c=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']=_0x311fd7,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x2f377c['if']('isDone','ck-ai-chat__feed__item_done'),_0x2f377c['if']('isVisible','ck-hidden',_0x5e48ec=>!_0x5e48ec),'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'](_0x40efe7=>{_0x40efe7['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x223708,_0x40bf9f,_0x3a3a1f){await this['htmlStreamer']['stream']({'document':_0x223708,'targetElement':_0x40bf9f,'abortSignal':_0x3a3a1f});}}class oa extends _0x184e76{['showChangesToggleView'];constructor(_0x39ba7f,_0x2f88a7){super(_0x39ba7f),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Zn(_0x39ba7f),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':i(_0x39ba7f,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x2f88a7['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x27198f=>_0x27198f?_0x45a410:_0x4ecb10),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x3a295b=new _0xc034b();_0x3a295b['content']=_0x822d49,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x2f88a7['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x3a295b,{'tag':'span','children':[i(_0x39ba7f,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Zn extends _0x1e9460{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const Or={'accepted':_0x546f60,'rejected':_0x815ee6,'outdated':_0x815ee6};class ws extends _0x184e76{['stateIconView'];constructor(_0xa65a5b){super(_0xa65a5b);const _0x24878a=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',_0x24878a['to']('state',_0x25b9ee=>'ck-ai-suggestion__content-part-state_'+_0x25b9ee),_0x24878a['if']('isVisible','ck-hidden',_0x58c6f1=>!_0x58c6f1)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x24878a['to']('state',_0x447d7a=>{switch(_0x447d7a){case'accepted':return i(_0xa65a5b,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return i(_0xa65a5b,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return i(_0xa65a5b,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x5d0d86){this['state']=_0x5d0d86;}}class Nr extends _0xc034b{constructor(){super(),this['set']('state','accepted'),this['content']=Or[this['state']],this['on']('change:state',()=>{this['content']=Or[this['state']];});}}class cs extends _0x178dcf{['_applyButton'];['_suggestButton'];constructor(_0x5a2004,_0x4fef44,_0x43ab93){super(_0x5a2004);const _0x2be3f3=Boolean(_0x43ab93);this['set']('isEnabled',!_0x2be3f3),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x438c13=[];if(_0x2be3f3){const _0x8aed06=new _0x1e9460(_0x5a2004);_0x8aed06['set']({'label':i(_0x5a2004,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x42893a}),_0x438c13['push'](_0x8aed06);}else{_0x4fef44['includes']('applySuggestion')&&(this['_applyButton']=new _0x1e9460(_0x5a2004),this['_applyButton']['set']({'label':i(_0x5a2004,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x546f60}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x438c13['push'](this['_applyButton'])),_0x4fef44['includes']('insertSuggestion')&&(this['_suggestButton']=new _0x1e9460(_0x5a2004),this['_suggestButton']['set']({'label':i(_0x5a2004,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x50a3ec}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x438c13['push'](this['_suggestButton']));const _0x3e352c=new _0x1e9460(_0x5a2004);_0x3e352c['set']({'label':i(_0x5a2004,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x815ee6}),_0x3e352c['bind']('isEnabled')['to'](this),_0x3e352c['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x438c13['push'](_0x3e352c);}this['items']['addMany'](_0x438c13);const _0x1a5769=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x1a5769['if']('isVisible','ck-hidden',_0x23f78a=>!_0x23f78a)]}});}['setButtonsVisibility']({showApplyButton:_0xcd9ea2,showSuggestButton:_0x503eae}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0xcd9ea2),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x503eae);}}class vn extends _0x184e76{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x1a3ebd,{part:_0x3142b4,uiIndex:_0x3b3c00,availableActions:_0x16bf38,areActionsDisabled:_0x3d9cc4}){super(_0x1a3ebd),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new cs(_0x1a3ebd,_0x16bf38,_0x3d9cc4),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x3142b4['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x3142b4['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x3142b4['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new ws(_0x1a3ebd),this['titleLabelView']=new Sn(_0x1a3ebd,_0x3b3c00),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',(_0x24c334,_0x1db502,_0x2560a6,_0x4ee90d)=>{'pending'===_0x4ee90d?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x2560a6?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x2560a6),this['children']['add'](this['stateView']));});}}class Sn extends _0x184e76{constructor(_0x41512d,_0x20901a){super(_0x41512d),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[i(_0x41512d,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x20901a['toString']())]});}}class as extends _0x184e76{['htmlStreamer'];constructor(_0xd84f2e){super(_0xd84f2e),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:_0x5ea00a,renderingStrategy:_0x5f0115,abortSignal:_0x34e40f}){'streaming'===_0x5f0115?await this['htmlStreamer']['stream']({'document':_0x5ea00a['content'],'targetElement':this['element'],'abortSignal':_0x34e40f}):this['element']['innerHTML']=Tt(_0x5ea00a['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class na extends _0x184e76{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x4c0364,{part:_0x4da2d4,uiIndex:_0x319937,areActionsDisabled:_0x53373c,availableActions:_0x1073ee}){super(_0x4c0364);const _0x3b37b3=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x32bc83=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x53373c;};this['on']('change:state',_0x32bc83),this['on']('change:isDone',_0x32bc83),_0x32bc83(),this['_children']=this['createCollection'](),this['_headerView']=new vn(_0x4c0364,{'part':_0x4da2d4,'uiIndex':_0x319937,'availableActions':_0x1073ee,'areActionsDisabled':_0x53373c}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...ut)['to'](this),this['_streamableContentView']=new as(_0x4c0364),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x3b37b3['to']('state',_0x9fd660=>'ck-ai-suggestion__body__content-part_'+_0x9fd660),_0x3b37b3['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x3b37b3['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x3b37b3['if']('isVisible','ck-hidden',_0x2d7014=>!_0x2d7014)]},'children':this['_children'],'on':{'mouseenter':_0x3b37b3['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x4da2d4['index']});}),'mouseleave':_0x3b37b3['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x4da2d4['index']});}),'click':_0x3b37b3['to'](_0xed7401=>{const _0x3f4500=_0xed7401['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x3f4500)&&this['fire']('showChangeInText',{'index':_0x4da2d4['index']});})}});}async['updateContent']({part:_0x3fbbc4,renderingStrategy:_0x515198,showUnchangedParts:_0x4b6586=!0x1,abortSignal:_0x433ae9}){this['partDefinition']=_0x3fbbc4,this['isVisible']=this['partDefinition']['hasChanges']||_0x4b6586,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x3fbbc4,'renderingStrategy':_0x515198,'abortSignal':_0x433ae9});}['markAsDone'](){this['isDone']=!0x0;}}class z extends _0x290e58(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x20f069){const _0x20fcf7=this['createTask'](_0x20f069);return this['queue']['push'](_0x20fcf7),this['_processQueue'](),_0x20fcf7['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(_0x5bf7ee=>{this['once']('_queueEmpty',()=>{_0x5bf7ee();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x20915f=this['queue']['shift']();try{await _0x20915f['callback'](this['_abortController']['signal']),_0x20915f['resolve']();}catch(_0x4d2c5f){_0x20915f['reject'](_0x4d2c5f);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x4aedc6){let _0x3281eb,_0x43cc7b;const _0x249339=new Promise((_0x36036f,_0x5619f7)=>{_0x3281eb=_0x36036f,_0x43cc7b=_0x5619f7;});return{'callback':_0x4aedc6,'resolve':_0x3281eb,'reject':_0x43cc7b,'completePromise':_0x249339};}}class Ze extends Fr{constructor(_0x1f57ae){super(_0x1f57ae),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x1f57ae['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x47f76a){this['element']['innerHTML']=_0x47f76a;}}const ot=['applySuggestion','insertSuggestion'];class ra extends _0x184e76{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x3dcc61,_0x3488c2=[...ot],_0xa06c32){super(_0x3dcc61);const _0x2ad697=this['bindTemplate'],_0x223a80=Boolean(_0xa06c32);if(this['set']('isEnabled',!_0x223a80),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x223a80){const _0x52c404=new _0x1e9460(_0x3dcc61);_0x52c404['set']({'label':i(_0x3dcc61,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x42893a});const _0x4924b0=new _0x184e76(_0x3dcc61);_0x4924b0['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[i(_0x3dcc61,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x52c404]}]}),this['children']['add'](_0x4924b0);}else this['_applyChangesButton']=new _0x1e9460(_0x3dcc61),this['_applyChangesButton']['set']({'label':i(_0x3dcc61,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x3488c2['includes']('applySuggestion'),'class':'ck-ai-button-primary'}),this['_insertSuggestionsButton']=new _0x1e9460(_0x3dcc61),this['_insertSuggestionsButton']['set']({'label':i(_0x3dcc61,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x3488c2['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'](_0x1b0634=>{_0x1b0634['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',_0x2ad697['if']('isVisible','ck-hidden',_0x39cc7c=>!_0x39cc7c)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x403508){this['isVisible']=_0x403508;}['_switchButtonLabelsPlurality'](_0x4e22e9){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x4e22e9?(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 _0x184e76{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x447b60,_0x3fc32c){super(_0x447b60),this['bodyCollection']=_0x3fc32c,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',_0x4993a1=>!_0x4993a1)]},'children':this['children']});const _0x6452ea=new _0x184e76(this['locale']),_0x440fb7=new _0xc034b();_0x440fb7['content']=_0xd367bf,_0x6452ea['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x440fb7,{'tag':'span','children':[{'text':i(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x6452ea),this['_setupBalloonPanel'](_0x447b60);}['addSource'](_0xfcba3e){this['children']['add'](new qr(this['locale'],_0xfcba3e,this['balloonPanelView']));}['_setupBalloonPanel'](_0x5eecc1){this['balloonPanelView']=new _0x2fff3d(_0x5eecc1),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class qr extends _0x1e9460{['balloonPanelView'];['source'];constructor(_0x491d25,_0x1e64a3,_0x1a4a24){super(_0x491d25),this['source']=_0x1e64a3,this['balloonPanelView']=_0x1a4a24,this['set']({'label':_0x1e64a3['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x327cf2=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x327cf2['to'](()=>{window['open'](_0x1e64a3['url'],'_blank');}),'mouseenter':_0x327cf2['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x327cf2['to'](()=>{this['_hideTooltip']();})}}),_0x1e64a3['favicon']){const _0x1a7be1=new _0x184e76(_0x491d25);_0x1a7be1['setTemplate']({'tag':'img','attributes':{'src':_0x1e64a3['favicon']||_0xd367bf,'alt':_0x1e64a3['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x1a7be1);}else this['set']('icon',_0xd367bf);}['_createTooltipContentView'](_0x2cb118,_0x1b4994){const _0x34a97c=new _0x184e76(_0x2cb118),_0xf3c57=[];let _0x113eb0;_0x1b4994?.['favicon']?(_0x113eb0=new _0x184e76(_0x2cb118),_0x113eb0['setTemplate']({'tag':'img','attributes':{'src':_0x1b4994['favicon'],'alt':_0x1b4994['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x113eb0=new _0xc034b(),_0x113eb0['content']=_0xd367bf,_0x113eb0['extendTemplate']({'attributes':{'alt':_0x1b4994['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0xf3c57['push'](_0x113eb0);const _0x1458b8=new _0x184e76(_0x2cb118);_0x1458b8['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x1b4994['url']},'children':[{'text':new URL(_0x1b4994['url'])?.['hostname']}]}),_0xf3c57['push'](_0x1458b8);const _0x5e9cb1=new _0x184e76(_0x2cb118);_0x5e9cb1['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0xf3c57});const _0x771448=new _0x184e76(_0x2cb118);return _0x771448['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x1b4994['title']['length']>0x190?_0x1b4994['title']['substring'](0x0,0x190)+'...':_0x1b4994['title']}]}),_0x34a97c['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x5e9cb1,_0x771448]}),_0x34a97c;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[_0x2fff3d['defaultPositions']['northArrowSouth'],_0x2fff3d['defaultPositions']['northArrowSouthWest'],_0x2fff3d['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 _0xb0e10=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0xb0e10);}}class ca extends _0x184e76{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x31ab99,_0x39452c){super(_0x31ab99);const {areActionsDisabled:_0x3b3c7e,showUnchangedParts:_0x43fdff,availableActions:_0x4e8711}=_0x39452c;this['_areActionsDisabled']=_0x3b3c7e,this['_showUnchangedParts']=_0x43fdff,this['_availableActions']=_0x4e8711,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(_0x31ab99,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new ra(_0x31ab99,_0x39452c['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sr(this['locale'],_0x39452c['bodyCollection']),_0x39452c['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:_0xfe9f61,renderingStrategy:_0x266f3e,abortSignal:_0x13c52d}){this['_children']['length']?_0xfe9f61['forEach'](_0x2a52c7=>{const _0x5e54dc=this['_cachedContentParts']['findIndex'](_0x3d8fea=>_0x3d8fea['index']==_0x2a52c7['index']);-0x1===_0x5e54dc?this['_cachedContentParts']['push'](_0x2a52c7):this['_cachedContentParts'][_0x5e54dc]=_0x2a52c7;}):this['_cachedContentParts']=_0xfe9f61;const _0x55d05e=this['_showUnchangedParts']?_0xfe9f61:_0xfe9f61['filter'](_0x40f4fa=>_0x40f4fa['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x55d05e['length']>0x1);for(const _0x42e4ae of _0x55d05e)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x5d0f88=>{let _0x39570c=this['getPartView'](_0x42e4ae['index']);_0x39570c||(_0x39570c=new na(this['locale'],{'part':_0x42e4ae,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x39570c['delegate'](...ut)['to'](this),this['_children']['add'](_0x39570c),this['hasPendingParts']=!0x0),await _0x39570c['updateContent']({'part':_0x42e4ae,'renderingStrategy':_0x266f3e,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x5d0f88}),_0x39570c['markAsDone']();});return _0x13c52d?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x5c9919,_0x1f4c95){const _0x30a61e=this['getPartView'](_0x5c9919);_0x30a61e&&(_0x30a61e['state']=_0x1f4c95),this['hasPendingParts']='pending'==_0x1f4c95||Array['from'](this['_children'])['some'](_0x4eb817=>'pending'==_0x4eb817['state']);}['setPartActive'](_0x316715,_0x5e8100){if(!0x1===_0x316715){for(const _0x4a06fe of this['_children'])_0x4a06fe['isActive']=!0x1;}else{const _0x51c6b5=this['getPartView'](_0x316715);_0x51c6b5&&(_0x51c6b5['isActive']=_0x5e8100);}}['updateSources'](_0x189b82){_0x189b82['forEach'](_0x50db9b=>this['_sourcesView']['addSource'](_0x50db9b)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x5918d7){return this['_children']['find'](_0x264c9b=>_0x264c9b['partDefinition']['index']==_0x5918d7)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x4f9c42=!this['_cachedContentParts']['find'](({hasChanges:_0x11bd2f})=>_0x11bd2f),_0x5c00a3=!!this['_cachedContentParts']['find'](({hasChanges:_0x123fd1})=>!_0x123fd1);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x5c00a3,_0x4f9c42?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'](_0x323ca7=>_0x323ca7['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0xc158e7=>_0xc158e7['partDefinition']['hasChanges'])['length']>0x0;}}class gn extends _0x184e76{['bodyView'];['children'];['headerView'];constructor(_0x460674,_0x48a8cd,_0x3b3141){super(_0x460674);const {showDiff:_0x55b0c5,areActionsDisabled:_0x4d1b3,showUnchangedParts:_0xabb939,availableActions:_0x1c140a}=_0x48a8cd;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new oa(_0x460674,{'showDiff':_0x55b0c5}),this['headerView']['on']('toggleShowChanges',(_0x22e0f8,_0x5d2aa1)=>{this['areChangesVisible']=_0x5d2aa1['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x5d2aa1['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new ca(_0x460674,{'areActionsDisabled':_0x4d1b3,'showUnchangedParts':!!_0xabb939,'availableActions':_0x1c140a,'bodyCollection':_0x3b3141}),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'](_0x4e6012){await this['bodyView']['updateContentParts'](_0x4e6012);}['updateSources'](_0x3194b9){this['bodyView']['updateSources'](_0x3194b9);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Qe extends Fr{['containerView'];constructor(_0x3d98eb,_0x5c8142,_0x50e164){super(_0x5c8142),this['set']('isTrackChangesOn',!0x1),this['containerView']=new gn(_0x3d98eb,{'showDiff':_0x5c8142['showDiff'],'areActionsDisabled':_0x5c8142['areActionsDisabled'],'availableActions':_0x5c8142['availableActions']},_0x50e164),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x57cc70,_0x3cdfe8)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x3cdfe8['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',(_0xd1dac,{index:_0x540c7a})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x540c7a});}),this['containerView']['on']('applySuggestion',(_0x49f851,{index:_0x29ebd9}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x29ebd9});}),this['containerView']['on']('insertSuggestion',(_0x3435a6,{index:_0x27ce3a}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x27ce3a});}),this['containerView']['on']('rejectSuggestion',(_0x3c3647,{index:_0x23882a})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x23882a});}),this['containerView']['on']('mouseOverSuggestion',(_0x2e470e,{index:_0x5163e9})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x5163e9});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x2d30dd,{index:_0x40ed8b})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x40ed8b});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x34d9d5){await this['containerView']['updateContent'](_0x34d9d5);}['updatePartState'](_0x476048,_0x221ee6){this['containerView']['bodyView']['updatePartState'](_0x476048,_0x221ee6);}['setPartActive'](_0x3c339c,_0x45c2a9){!0x1===_0x3c339c?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x3c339c,_0x45c2a9);}['updateSources'](_0x209231){this['containerView']['updateSources'](_0x209231);}['getPartView'](_0x35cb82){return this['containerView']['bodyView']['getPartView'](_0x35cb82);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class Xe extends Fr{['replyContainer'];['_bodyCollection'];constructor(_0x5d1a20,_0x28474e,_0x587ef0){super(_0x28474e),this['_bodyCollection']=_0x587ef0,this['locale']=_0x5d1a20,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x184e76(),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:_0x29bc68,renderingStrategy:_0x3d9213,abortSignal:_0x30ba78}){'streaming'===_0x3d9213?await this['streamIntoElement'](_0x29bc68,this['replyContainer']['element'],_0x30ba78):this['replyContainer']['element']['innerHTML']=_0x3807c6(_0x29bc68);}['updateSources'](_0x44a67c){const _0x435c08=new Sr(this['locale'],this['_bodyCollection']);_0x435c08['children']['addMany'](_0x44a67c['map'](_0x538af2=>new qr(this['locale'],_0x538af2,_0x435c08['balloonPanelView']))),_0x435c08['isVisible']=!0x0,this['children']['add'](_0x435c08);}}class li extends _0x4435de{constructor(_0x1361bd=void 0x0){super();const _0x196a59=_0x1361bd?'ck-ai-spinner_'+_0x1361bd:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x196a59]}});}}const xn={'file':_0x55fdc0,'document':_0x35a5eb,'web-resource':_0xb249a6,'text':_0x55fdc0,'selection':_0x5a0e45,'mcp-tool-context':_0x35a5eb},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 _0x1e9460{constructor(_0x30f2b8,_0x50c05f,_0x2bd04f,_0x4b86cd,_0x48f74d=!0x1){super(_0x30f2b8),this['_isAnimationOnEnterEnabled']=_0x4b86cd,this['_initializeProperties'](_0x50c05f,_0x2bd04f,_0x48f74d),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'](_0x17653e,_0x3ee1a3,_0x1088b0){this['set']('label',_0x17653e['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x17653e['type']),this['set']('id',_0x17653e['uiId']),this['set']('readonly',_0x3ee1a3),this['set']('isLoading',_0x1088b0);}['_setupTemplate'](){const _0x348f2a=this['_createIconView'](),_0x5005a5=this['_createRemoveButton'](),_0x1f7e51=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x1f7e51),'children':this['_createTemplateChildren'](_0x348f2a,_0x5005a5,_0x1f7e51)});}['_createTemplateAttributes'](_0x2cc05c){return{'class':[Ur,_0x2cc05c['if']('itemType',Yr,_0x1bab42=>'document'==_0x1bab42),_0x2cc05c['if']('itemType',Wr,_0x5670e9=>'selection'==_0x5670e9)],'data-cke-tooltip-text':_0x2cc05c['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':Xr};}['_createTemplateChildren'](_0x2c1e44,_0x16fbf7,_0x5be575){const _0x13f6a8=this['_createLabelElement'](_0x5be575),_0x119569=this['_createLoaderIcon']();return this['readonly']?[_0x2c1e44,_0x13f6a8]:[_0x2c1e44,_0x119569,_0x13f6a8,_0x16fbf7];}['_createLabelElement'](_0x523860){return{'tag':'span','attributes':{'class':$r},'children':[{'text':_0x523860['to']('label')}]};}['_createRemoveButton'](){const _0x502f9b=new _0x1e9460(this['locale']);return _0x502f9b['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0xf5ecf7}),this['_setupRemoveButtonEvent'](_0x502f9b),_0x502f9b;}['_setupRemoveButtonEvent'](_0x23771f){_0x23771f['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x297cbc=this['bindTemplate'],_0x4b48fd=new _0xc034b();return _0x4b48fd['content']=xn[this['itemType']],_0x4b48fd['extendTemplate']({'attributes':{'class':[Qr,_0x297cbc['if']('isLoading','ck-hidden',_0x5a96d2=>_0x5a96d2)]}}),_0x4b48fd;}['_handleAnimationEndOnce'](_0x1d1958,_0x6ea8b3){if(!_0x1d1958)return;const _0x1dc84d=()=>{_0x6ea8b3(),_0x1d1958['removeEventListener']('animationend',_0x1dc84d),_0x1d1958['removeEventListener']('webkitAnimationEnd',_0x1dc84d);};_0x1d1958['addEventListener']('animationend',_0x1dc84d),_0x1d1958['addEventListener']('webkitAnimationEnd',_0x1dc84d);}['_createLoaderIcon'](){const _0x9a436a=new li('small');return _0x9a436a['bind']('isVisible')['to'](this,'isLoading',_0x5f06f8=>_0x5f06f8),_0x9a436a;}}function In(_0x21dd92){if(!_0x21dd92)return _0x21dd92;if(_0x21dd92['length']<=0x78)return _0x21dd92;const _0x2ca4d6=_0x21dd92['slice'](0x0,0x78),_0x1f2ecd=_0x2ca4d6['lastIndexOf']('\x20');return(_0x1f2ecd>0x0?_0x2ca4d6['slice'](0x0,_0x1f2ecd):_0x2ca4d6)+'…';}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(_0x44a244,_0x1d46e1,_0x105357,_0x580d42,_0x5e2834){this['_locale']=_0x44a244,this['_visibleChips']=_0x1d46e1,this['_config']={...hn,..._0x105357,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x105357['cssClasses']}},this['_overflowChips']=new _0x4b57cf(),this['_bodyCollection']=_0x580d42,this['_parentView']=_0x5e2834||null;}['setContainerElement'](_0x3edea8){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x3edea8,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 _0x53a408=[...this['_visibleChips'],...this['_overflowChips']],_0x189f92=this['_createCalculationContainer'](),_0x53fd2f=this['_calculateOverflowInContainer'](_0x189f92,_0x53a408),_0x328467=_0x189f92['_ancestorsToRestore'];_0x328467&&this['_restoreAncestorVisibility'](_0x328467),_0x189f92['remove'](),this['_applyOverflowResults'](_0x53a408,_0x53fd2f);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x1ff4d5({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x185823=new _0x1e9460(this['_locale']);_0x185823['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x530c37=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x530c37['push'](this['_config']['cssClasses']['controlsButton']),_0x185823['extendTemplate']({'attributes':{'class':_0x530c37}}),_0x185823;}['_createShowMoreBalloonPanelView'](){const _0x14bf1e=new _0x2fff3d(this['_locale']);return _0x14bf1e['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x14bf1e),_0x14bf1e;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x226ece=>{_0x226ece['disableAnimationOnEnter']();});const _0x587211=new _0x184e76(this['_locale']);_0x587211['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x587211);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x4a8cfc=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x4a8cfc?'':'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'](_0x166e4e){const _0x25fb4f=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x2a3f5a=this['_containerElement']?.['classList'];if(_0x2a3f5a){const _0x405222=_0x2a3f5a[0x0]||'',_0x1c0b3c=_0x166e4e['querySelector']('.'+_0x405222),_0x498e6d=_0x166e4e['querySelector'](_0x25fb4f);return _0x1c0b3c||_0x498e6d||_0x166e4e;}return _0x166e4e['querySelector'](_0x25fb4f)||_0x166e4e;}['_calculateContainerWidth'](){const _0x2f9322=this['_parentView']?.['element']||this['_containerElement'];if(!_0x2f9322)return an;const _0x159e2e=window['getComputedStyle'](_0x2f9322)['width'];if('auto'===_0x159e2e||'0px'===_0x159e2e||!_0x159e2e){const _0x123506=_0x2f9322['parentElement'];if(_0x123506){const _0x36f050=window['getComputedStyle'](_0x123506);return'auto'!==_0x36f050['width']?_0x36f050['width']:an;}return an;}return _0x159e2e;}['_applyCalculationStyles'](_0x52a64d,_0x3788ab){this['_config']['cssClasses']['calculationContainer']&&_0x52a64d['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x52a64d['style']['width']=_0x3788ab,_0x52a64d['style']['position']='absolute',_0x52a64d['style']['top']='-9999px',_0x52a64d['style']['left']='-9999px',_0x52a64d['style']['opacity']='0',_0x52a64d['style']['pointerEvents']='none',_0x52a64d['style']['zIndex']='-1',_0x52a64d['style']['visibility']='visible\x20!important',_0x52a64d['style']['display']='block\x20!important',_0x52a64d['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x4b2155){_0x4b2155['forEach'](({element:_0x209233,originalDisplay:_0x21fab0,originalVisibility:_0x3b054c})=>{_0x209233['style']['display']=_0x21fab0,_0x209233['style']['visibility']=_0x3b054c;});}['_makeAncestorsVisible'](_0x27aa12){const _0x455361=[];let _0xa23cae=_0x27aa12;for(;_0xa23cae&&_0xa23cae!==document['body'];){const _0x260d38=window['getComputedStyle'](_0xa23cae);'none'!==_0x260d38['display']&&'hidden'!==_0x260d38['visibility']||(_0x455361['push']({'element':_0xa23cae,'originalDisplay':_0xa23cae['style']['display'],'originalVisibility':_0xa23cae['style']['visibility']}),_0xa23cae['style']['display']='block',_0xa23cae['style']['visibility']='visible'),_0xa23cae=_0xa23cae['parentElement'];}return _0x455361;}['_createContainerElements'](){let _0x3c360d,_0x2c7182;return this['_parentView']?.['element']?(_0x3c360d=this['_parentView']['element']['cloneNode'](!0x0),_0x2c7182=this['_findTargetContainer'](_0x3c360d)):(_0x3c360d=document['createElement']('div'),_0x2c7182=_0x3c360d),{'calculationContainer':_0x3c360d,'targetContainer':_0x2c7182};}['_createCalculationContainer'](){const {calculationContainer:_0x5eaca5,targetContainer:_0x58b7b9}=this['_createContainerElements'](),_0x32e6a0=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x5eaca5,_0x32e6a0);const _0x5a88df=this['_parentView']?.['element']||this['_containerElement'],_0x1c3b2f=_0x5a88df?.['parentElement'];_0x1c3b2f?_0x1c3b2f['appendChild'](_0x5eaca5):document['body']['appendChild'](_0x5eaca5),_0x5eaca5['_targetContainer']=_0x58b7b9;const _0x37da02=this['_makeAncestorsVisible'](_0x1c3b2f||null);return _0x5eaca5['offsetWidth'],_0x5eaca5['_ancestorsToRestore']=_0x37da02,_0x5eaca5;}['_calculateOverflowInContainer'](_0x489dbe,_0x540189){const _0x36482c=_0x489dbe['_targetContainer']||_0x489dbe,_0x5aa3e6=[],{rowCount:_0x38e2e3}=this['_renderChipsAndCountRows'](_0x36482c,_0x540189);if(_0x38e2e3<=this['_config']['maxVisibleRows'])return _0x5aa3e6;const _0x18fb18=_0x540189['slice']();for(;_0x18fb18['length']>0x0;){if(this['_testButtonFit'](_0x489dbe,_0x36482c,_0x18fb18)){const _0x2cce0f=_0x540189['filter'](_0x5e648e=>!_0x18fb18['includes'](_0x5e648e));_0x5aa3e6['push'](..._0x2cce0f);break;}if(!_0x18fb18['pop']())break;}return _0x5aa3e6;}['_renderChipsAndCountRows'](_0xb507d5,_0x285447){_0xb507d5['innerHTML']='',_0x285447['forEach'](_0x4539ae=>{if(_0x4539ae['element']){const _0x16fec4=_0x4539ae['element']['cloneNode'](!0x0);_0xb507d5['appendChild'](_0x16fec4);}}),_0xb507d5['offsetWidth'];const _0x45a1dc=_0xb507d5['children'],_0x2e3b96=[];return Array['from'](_0x45a1dc)['forEach'](_0x236239=>{const _0xcd0275=_0x236239['getBoundingClientRect']()['top'];_0x2e3b96['some'](_0x5a9caa=>Math['abs'](_0x5a9caa-_0xcd0275)<this['_config']['rowDetectionTolerance'])||_0x2e3b96['push'](_0xcd0275);}),{'rowCount':_0x2e3b96['length']};}['_createMockButton'](){const _0x1aa16b=document['createElement']('button');return _0x1aa16b['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x1aa16b['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x1aa16b['textContent']='+\x201',_0x1aa16b;}['_testButtonFit'](_0x15078b,_0x1f1cfe,_0x5cf8ce){this['_renderChipsAndCountRows'](_0x1f1cfe,_0x5cf8ce);const _0x3e2d62=this['_createMockButton']();_0x15078b['appendChild'](_0x3e2d62),_0x15078b['offsetWidth'];const _0x5c9d3f=[..._0x1f1cfe['children'],_0x3e2d62],_0x24033a=[];_0x5c9d3f['forEach'](_0x58b81f=>{const _0x44448d=_0x58b81f['getBoundingClientRect']()['top'];_0x24033a['some'](_0x3c78bb=>Math['abs'](_0x3c78bb-_0x44448d)<this['_config']['rowDetectionTolerance'])||_0x24033a['push'](_0x44448d);});const _0x53dda1=_0x24033a['length'];return _0x3e2d62['remove'](),_0x53dda1<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x57d0c0,_0x1025a9){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x57d0c0['forEach'](_0x1d385a=>{_0x1025a9['includes'](_0x1d385a)?this['_overflowChips']['add'](_0x1d385a):this['_visibleChips']['add'](_0x1d385a);});}['_updateOverflowUI'](_0x1c4b92){if(_0x1c4b92>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x1c4b92>0x0&&this['_showMoreButtonView']){const _0x3c94ad=''+this['_config']['showMoreLabelPrefix']+(_0x1c4b92<0x63?_0x1c4b92:'99');this['_showMoreButtonView']['label']=_0x3c94ad;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0xa62684,_0x594385){this['_distributeChips'](_0xa62684,_0x594385),this['_updateOverflowUI'](_0x594385['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x220b0b=>{_0x220b0b[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 _0x10be70=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x10be70['width']||0x0===_0x10be70['height'])return!0x1;const _0x200598=window['innerHeight']||document['documentElement']['clientHeight'],_0x5abe02=window['innerWidth']||document['documentElement']['clientWidth'],_0xba2481=0xc8;return _0x10be70['bottom']>=-0xc8&&_0x10be70['top']<=_0x200598+_0xba2481&&_0x10be70['right']>=-0xc8&&_0x10be70['left']<=_0x5abe02+_0xba2481;}}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 _0x184e76{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x1ee76d,_0x25cdb2,_0x5d24f8){super(_0x1ee76d),this['_bodyCollection']=_0x5d24f8,this['_createContextChips'](_0x25cdb2);const _0x4fb1e4={'cssClasses':{'showMoreButton':_a,'showMoreBalloon':Aa,'overflowContainer':ua,'controlsButton':da}};this['_overflowManager']=new Ro(_0x1ee76d,this['_contextChips'],_0x4fb1e4,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 _0x1c2496=this['element']['querySelector']('.'+la);_0x1c2496&&(this['_overflowManager']['setContainerElement'](_0x1c2496),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x41b195){for(const _0x3d1966 of _0x41b195){const _0x2775af=new Vo(this['locale'],_0x3d1966,!0x0,!0x1);this['_contextChips']['add'](_0x2775af);}}}class Ye extends Fr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x484468,_0x421a4d,_0xc91d47){super(_0x421a4d),this['_locale']=_0x484468,this['_bodyCollection']=_0xc91d47,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'](_0x3f174c=>!_0x3f174c['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x184e76(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(_0x499555,_0x46e325){super(_0x46e325);const {isWebSearchEnabled:_0x150f2b,isReasoningEnabled:_0x4fde05}=_0x46e325['capabilities'],_0x4a3a3c=[];let _0x7b2ac='';_0x150f2b&&_0x4fde05?(_0x7b2ac=i(_0x499555,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x4a3a3c['push'](aa(_0xd367bf)),_0x4a3a3c['push'](aa(_0x433ff5))):_0x150f2b?(_0x7b2ac=i(_0x499555,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x4a3a3c['push'](aa(_0xd367bf))):_0x4fde05&&(_0x7b2ac=i(_0x499555,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x4a3a3c['push'](aa(_0x433ff5))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x7b2ac?'':'ck-hidden']}});const _0x4e76f0=new _0x184e76();_0x4e76f0['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x4a3a3c,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x7b2ac]}]}),this['children']['add'](_0x4e76f0),this['capabilities']=_0x46e325['capabilities'];}}function aa(_0x4f3bea){const _0x1e21cc=new _0xc034b();return _0x1e21cc['content']=_0x4f3bea,_0x1e21cc;}const Fs=['wheel','touchstart','pointerdown','keydown'],Us=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class $e{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x5801bf){this['element']=_0x5801bf,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x31336b of Fs){const _0x568406='keydown'!==_0x31336b;this['element']['addEventListener'](_0x31336b,this['_onUserEvent']['bind'](this),{'passive':_0x568406,'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'](_0x167992){if(this['isRunning']){if('keydown'===_0x167992['type']){const _0x2ff872=_0x167992['key'];if(!Us['includes'](_0x2ff872))return;}_0x167992 instanceof WheelEvent?_0x167992['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x4d82f7,scrollHeight:_0x51e4ca,clientHeight:_0x26c09c}=this['element'];return _0x51e4ca-_0x4d82f7-_0x26c09c<=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 _0x184e76{constructor(_0x475d3f,_0x11f452){super(_0x475d3f),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x11f452)});}['_createSkeletonItems'](_0x4c6ef8){const _0x3b79d0=['ck','ck-ai-skeleton__item'];return _0x4c6ef8['map'](_0x24f3b2=>{let _0x46e2c5='';switch(_0x24f3b2['attributes']['align']){case'right':_0x46e2c5='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x46e2c5='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x46e2c5='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x24f3b2['tag'],'attributes':{'class':[..._0x3b79d0,_0x24f3b2['attributes']['class']?_0x24f3b2['attributes']['class']:''],'style':'width:\x20'+_0x24f3b2['attributes']['width']+';\x20height:\x20'+_0x24f3b2['attributes']['height']+';'+_0x46e2c5}};});}}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(_0x5afde0,_0x18e998,_0x5ae611,_0x49b9b9){return new Array(_0x5afde0)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x18e998,'height':_0x5ae611,'align':_0x49b9b9}}));}class mi extends Fr{constructor(_0x42543d){super(_0x42543d),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 _0x184e76{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x440254,_0x4a470b){super(_0x440254),this['_bodyCollection']=_0x4a470b,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'](_0x2a4f1a,_0x43735a){let _0x313bd5;return'ai-reply'===_0x2a4f1a?_0x313bd5=new Xe(this['locale'],_0x43735a,this['_bodyCollection']):'ai-suggestion-reply'===_0x2a4f1a?(_0x313bd5=new Qe(this['locale'],_0x43735a,this['_bodyCollection']),_0x313bd5['bind']('isTrackChangesOn')['to'](this)):_0x313bd5='user-message'===_0x2a4f1a?new Ye(this['locale'],_0x43735a,this['_bodyCollection']):'interaction-header'===_0x2a4f1a?new Mt(this['locale'],_0x43735a):'custom-element'===_0x2a4f1a?new mi(_0x43735a):new Ze(_0x43735a),this['children']['add'](_0x313bd5),_0x313bd5;}async['updateReplyItem']({id:_0x1ae195,parsedContent:_0x35fad0,renderingStrategy:_0x235a80,abortSignal:_0x1d33be}){const _0x4c7679=this['getItemById'](_0x1ae195);if(!(_0x4c7679 instanceof Xe))throw new _0x36ca17('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x4c7679,'id':_0x1ae195,'parsedContent':_0x35fad0});await _0x4c7679['updateContent']({'parsedContent':_0x35fad0,'renderingStrategy':_0x235a80,'abortSignal':_0x1d33be});}async['updateWebSources'](_0x323741,_0x557580){const _0x23e232=this['getItemById'](_0x323741);if(_0x23e232 instanceof Qe)_0x23e232['updateSources'](_0x557580);else{if(!(_0x23e232 instanceof Xe))throw new _0x36ca17('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x23e232,'id':_0x323741,'sources':_0x557580});_0x23e232['updateSources'](_0x557580);}}async['updateSuggestionItem']({id:_0x25c72e,parts:_0x26733c,renderingStrategy:_0x1fcb4d,abortSignal:_0x394439}){const _0x4484d8=this['getItemById'](_0x25c72e);if(!(_0x4484d8 instanceof Qe))throw new _0x36ca17('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x4484d8,'id':_0x25c72e,'parts':_0x26733c});await _0x4484d8['updateContent']({'parts':_0x26733c,'renderingStrategy':_0x1fcb4d,'abortSignal':_0x394439});}['updateSuggestionPartState']({id:_0x3a7bb3,index:_0x4980ec,state:_0x275f95}){const _0x5e1ac5=this['getItemById'](_0x3a7bb3);if(!(_0x5e1ac5 instanceof Qe))throw new _0x36ca17('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x3a7bb3});_0x5e1ac5['updatePartState'](_0x4980ec,_0x275f95);}['setSuggestionPartActive']({id:_0x119fa0,index:_0x377f88,isActive:_0x2faf1b}){const _0x529dc5=this['getItemById'](_0x119fa0);if(!(_0x529dc5 instanceof Qe))throw new _0x36ca17('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x119fa0});this['children']['filter'](_0xb6af75=>_0xb6af75 instanceof Qe)['forEach'](_0x1445af=>{_0x1445af['setPartActive'](!0x1);}),_0x529dc5['setPartActive'](_0x377f88,_0x2faf1b);}['markItemAsDone'](_0x4ff38c){this['getItemById'](_0x4ff38c)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x2cf30e=>_0x2cf30e['options']['id']);}['removeItem'](_0x5d519a){this['children']['remove'](this['getItemById'](_0x5d519a));}['hasItem'](_0x544929){return!!this['children']['find'](_0x2bf632=>_0x2bf632['options']['id']['includes'](_0x544929));}['scrollToSuggestion'](_0x4e1cd5,_0x4508b0){const _0x31376b=this['getItemById'](_0x4e1cd5);if(!(_0x31376b instanceof Qe))return void _0x3bfc82('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x4e1cd5,'partIndex':_0x4508b0});const _0x17162a=_0x31376b['getPartView'](_0x4508b0);_0x17162a?_0x3c5789(_0x17162a['element'],0x14,this['element']['parentElement'],!0x0,!0x0):_0x3bfc82('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x4e1cd5,'partIndex':_0x4508b0});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x529516=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x529516,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x719c78=new ai(this['locale'],di['aiFeed']);return _0x719c78['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x56ee5c=>!_0x56ee5c)]}}),_0x719c78;}['_createFeedItems'](){const _0x1e5345=new _0x184e76(this['locale']);return _0x1e5345['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x1e5345;}['_createFeedLoader'](){const _0x21c5b6=new _0x184e76(this['locale']);return _0x21c5b6['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0xd7d440=>!_0xd7d440)]},'children':this['_createLoaderChildren']()}),_0x21c5b6;}['_createLoaderChildren'](){const _0x1de075=new li();return _0x1de075['isVisible']=!0x0,[_0x1de075,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x33222d){const _0x5746e8=this['children']['find'](_0x533787=>_0x533787['options']['id']['includes'](_0x33222d));if(!_0x5746e8)throw new _0x36ca17('ai-chat-feed-view-item-not-found',this,{'id':_0x33222d});return _0x5746e8;}['setLoadingMessage'](_0xb2970d){this['set']('loadingMessage',_0xb2970d);}['toggleLoadingSkeleton'](_0x18e41d){this['set']('isLoadingSkeletonVisible',_0x18e41d);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class nh extends _0x35cdc6{['filter'](){let _0x45eaa8=0x0;for(const _0x998e91 of this['items'])_0x45eaa8+=_0x998e91['items']['length'];return{'resultsCount':_0x45eaa8,'totalItemsCount':_0x45eaa8};}}const ah='ck-ai-chat__prompt-input_highlighted';class _s extends _0x4043f2{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x3e6aa5,_0x5818b9){super(_0x3e6aa5,{'queryView':{'label':'','creator':_0x5db2e8,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new nh(_0x3e6aa5),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x5818b9,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',(_0x505a59,_0x1c9570)=>!_0x505a59&&!_0x1c9570),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x5af1f8,_0x2976ab)=>{this['isUploadInProgress']||this['isEmpty']||_0x5af1f8['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x2976ab());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x53f795=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x53f795)return this['queryView']['errorText']=i(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x2a73e3=_0xac888d(_0x53f795);this['fire']('sendUserMessage',_0x2a73e3),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x2d7596){this['queryView']['fieldView']['set']('placeholder',_0x2d7596);}['focus'](_0x49fb6e=!0x1){super['focus'](),_0x49fb6e&&(this['element']['classList']['contains'](ah)||(this['element']['classList']['add'](ah),setTimeout(()=>{this['element']['classList']['remove'](ah);},0x320)));}['_createSubmitButton'](){const _0xb9d1a4=new _0x1e9460(this['locale']);return _0xb9d1a4['set']({'icon':_0x4fc1d8,'label':i(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0xb9d1a4['on']('execute',()=>{this['submit']();}),_0xb9d1a4;}['setIsUploadInProgress'](_0x4ac51d){this['isUploadInProgress']=_0x4ac51d;}['_setUpAddContextButtonPositioning'](){const _0x309f2e=this['locale'],_0xcf5489=()=>{_0x28fe94['window']['requestAnimationFrame'](()=>{if(_0x255643(this['element'])){const _0x53466c=new _0x5b8f6e(this['queryView']['fieldView']['element']),_0x45e71a=new _0x5b8f6e(this['_addContextButtonView']['element']),_0x3af1a2=_0x53466c['width'],_0x414690='rtl'===_0x309f2e['uiLanguageDirection']?'right':'left';_0x53466c['excludeScrollbarsAndBorders']();const _0x2f9459=_0x3af1a2-_0x53466c['width']+0x1;this['_addContextButtonView']['element']['style'][_0x414690]='calc('+(_0x3af1a2-_0x45e71a['width']-_0x2f9459)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0xcf5489),this['on']('render',()=>{_0xcf5489(),this['_queryViewResizeObserver']=new _0xb25201(this['queryView']['fieldView']['element'],()=>{_0xcf5489();});});}}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 _0x184e76{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x309948){super(_0x309948),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',_0x355ccd=>'selector'===_0x355ccd),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x362c22=>_0x362c22?this['_modelSelectionDropdown']['buttonView']['label']:i(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x28b266=>_0x28b266),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x512c5d=>_0x512c5d),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x22b9a8=>i(this['locale'],_0x22b9a8?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x4c5d9b=>_0x4c5d9b),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x207cc0=>i(this['locale'],_0x207cc0?'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 _0x4b57cf(),_0x321091(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x416a8f,_0xc9a95b){if(_0xc9a95b)this['set']('modelDisplayMode','hidden');else{const _0x220aba=0x1===_0x416a8f['length'];this['set']('modelDisplayMode',_0x220aba?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x416a8f?.['length'])for(const _0x1f47da of _0x416a8f){const _0x3c29c6=new _0xf9ff1d({'label':_0x1f47da['name'],'withText':!0x0,'role':'menuitemradio','id':_0x1f47da['id'],'model':_0x1f47da});_0x3c29c6['bind']('isOn')['to'](this,'activeModelId',_0x21b746=>_0x21b746===_0x1f47da['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x3c29c6,'labelView':new Sa(this['locale'],_0x1f47da)});}}['setWebSearch'](_0x176a5b){this['set']('webSearchActive',_0x176a5b);}['setReasoning'](_0x46a2e1){this['set']('reasoningActive',_0x46a2e1);}['setModel'](_0x43f4d3){if(!_0x43f4d3)return;this['activeModelId']=_0x43f4d3['id'],this['activeModelName']=_0x43f4d3['name']||_0x43f4d3['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x43f4d3['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x43f4d3['name']);const _0x4d022c=_0x43f4d3['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x4d022c),this['_webSearchButton']['set']('isVisible',_0x4d022c);const _0x3f0a8c=_0x43f4d3['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x3f0a8c),this['_reasoningButton']['set']('isVisible',_0x3f0a8c);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x5bd99c){this['set']('modelSelectorEnabled',!0x1),_0x5bd99c&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x45e289=new _0x1e9460();return _0x45e289['set']({'label':i(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0xd367bf,'class':Ia,'isToggleable':!0x0,'tooltipPosition':fa}),_0x45e289['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x45e289;}['_createReasoningButton'](){const _0x8eb284=new _0x1e9460();return _0x8eb284['set']({'label':i(this['locale'],'AI_CHAT_REASONING'),'icon':_0x433ff5,'class':Ia,'isToggleable':!0x0,'tooltipPosition':fa}),_0x8eb284['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x8eb284;}['_createCommandsButton'](){const _0x40be34=new _0x1e9460();return _0x40be34['set']({'label':i(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x1d5463,'withText':!0x0,'class':Ia,'isToggleable':!0x0,'tooltip':i(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':fa}),_0x40be34['extendTemplate']({'attributes':{'class':[Ea]}}),_0x40be34['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x40be34;}['_createModelSelectionDropdown'](){const _0x809162=_0x546896(this['locale']);return _0x809162['set']({'panelPosition':'ne','class':[pa]}),_0x809162['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':fa,'class':Ta}),this['listenTo'](_0x809162,'execute',_0x4bd476=>{this['fire']('selectModel',_0x4bd476['source']['model']);}),_0x809162;}['_createModelNameView'](){const _0x32a2f6=new ba(this['locale']);return _0x32a2f6['bind']('text')['to'](this,'activeModelName',_0x986e34=>_0x986e34??''),_0x32a2f6['bind']('isVisible')['to'](this,'modelDisplayMode',_0x10051a=>'name'===_0x10051a),_0x32a2f6;}}let Sa=class extends _0x55674c{constructor(_0x52bbc4,_0x1a5ccd){super();const _0x45d8b1=this['bindTemplate'],_0x2d4b41=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x45d8b1['to']('style'),'id':_0x45d8b1['to']('id')},'children':[{'tag':'div','attributes':{'class':[ma]},'children':[{'text':_0x45d8b1['to']('text')}]},{'tag':'div','attributes':{'class':[Ca]},'children':[{'tag':'span','children':[{'text':_0x1a5ccd['description']}]}]},{'tag':'div','attributes':{'class':[wa]},'children':_0x2d4b41}]}),_0x2d4b41['addMany'](this['_getCapabilityParts'](_0x52bbc4,_0xd367bf,'AI_CHAT_SEARCH_WEB',_0x1a5ccd['capabilities']['webSearch']?.['enabled']??!0x1)),_0x2d4b41['addMany'](this['_getCapabilityParts'](_0x52bbc4,_0x433ff5,'AI_CHAT_REASONING',_0x1a5ccd['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x2d38b6,_0x1c2b3b,_0x14cf99,_0x3ad897){const _0x2fbf64=new _0xc034b();_0x2fbf64['content']=_0x1c2b3b;const _0x4c1f20=new _0x184e76(_0x2d38b6);_0x4c1f20['setTemplate']({'tag':'span','children':[{'text':i(_0x2d38b6,_0x14cf99)+':\x20'}]});const _0xed4ad8=new _0x184e76(_0x2d38b6);return _0xed4ad8['setTemplate']({'tag':'span','children':[{'text':i(_0x2d38b6,_0x3ad897?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x2fbf64,_0x4c1f20,_0xed4ad8];}},ba=class extends _0x184e76{constructor(_0x1c45b3){super(_0x1c45b3),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x26c3dd=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x26c3dd['if']('isVisible','ck-hidden',_0x17a633=>!_0x17a633)]},'children':[{'text':_0x26c3dd['to']('text')}]});}};const Ra='ck-ai-chat-context-controls__url-form',Oa='ck-ai-chat-context-controls__url-input-section';class Po extends _0x184e76{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x44aa96){super(_0x44aa96),this['focusTracker']=new _0x22c832(),this['keystrokes']=new _0x2b0c94(),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 _0x56c0d3({'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'](_0x14ef4e=>{this['focusTracker']['add'](_0x14ef4e['element']),this['keystrokes']['listenTo'](_0x14ef4e['element']);}),_0xa2cd14({'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'](_0x4bb126){this['urlInputField']['errorText']=_0x4bb126,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x843186=new _0x1e9460(this['locale']);return _0x843186['set']({'icon':_0x29f3c3,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x1054a5,_0x2ebeb0,_0x250c86)=>{_0x843186['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x250c86?'':'\x20ck-hidden')]});}),_0x843186;}['_createUrlInputField'](){const _0x2394ff=new _0xfba0d2(this['locale'],th);return _0x2394ff['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x2394ff['fieldView']['set']({'placeholder':i(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x2394ff;}['_createConfirmButton'](){const _0x44727c=new _0x1e9460(this['locale']);return _0x44727c['set']({'icon':_0xa54ca6,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x44727c;}['_setupTemplate'](){const _0x39a3b2=new _0x41e0a3(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'});_0x39a3b2['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Ra,'tabindex':'-1'},'children':[_0x39a3b2,{'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',_0x4134c4=>{_0x4134c4['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x18845e,_0x4c3769)=>{this['clear'](),this['fire']('cancel'),_0x4c3769();});}['_handleSubmit'](){const _0x1d17be=this['getValue']()['trim']();_0x1d17be?this['_isValidUrl'](_0x1d17be)?(this['clearError'](),this['fire']('submitUrl',_0x1d17be)):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x2e88f9=this['getValue']()['trim'](),_0x2646a2=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x2e88f9['length']>0x0&&!_0x2646a2;}['_isValidUrl'](_0x26ea7a){try{return!!new URL(_0x26ea7a);}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 _0x4ffa3a{['resource'];['_titleView'];['_iconView'];constructor(_0x24c822,_0x23a389){super(_0x24c822),this['resource']=_0x23a389,this['set']('isInContext',!!_0x23a389['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x4c4f5d){if(_0x4c4f5d['isInContext'])return _0xa54ca6;switch(_0x4c4f5d['type']){case qe['DOCUMENT']:return _0x35a5eb;case qe['URL']:return _0xb249a6;case qe['FILE']:case qe['TEXT']:return _0x55fdc0;default:return _0x56717c;}}['highlightText'](_0x1cb295){if(!_0x1cb295||''===_0x1cb295['trim']())return void this['_titleView']['highlightText'](null);const _0x594117=new RegExp(_0x3383a1(_0x1cb295),'gi');this['_titleView']['highlightText'](_0x594117);}['updateResourceState'](_0x31320f){this['resource']['isInContext']=_0x31320f,this['isInContext']=_0x31320f,this['_updateIcon']();}['_createTitleView'](){const _0x4b8397=new _0x56f45c();return _0x4b8397['text']=this['resource']['label'],_0x4b8397['extendTemplate']({'tag':'span','attributes':{'class':[va]}}),_0x4b8397;}['_createIconView'](){const _0x109bdf=new _0xc034b();return _0x109bdf['content']=this['getResourceIcon'](this['resource']),_0x109bdf;}['_setupTemplate'](){const _0x5d59fd=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[ka,_0x5d59fd['if']('isVisible','ck-hidden',_0x20da17=>!_0x20da17),_0x5d59fd['if']('isInContext',Na)]},'children':[{'tag':'div','attributes':{'class':[ya]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x5d59fd['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const xa='ck-ai-chat-resources__list';class Lr extends _0x35cdc6{['_source'];constructor(_0x33efbe,_0xd7d6e){super(_0x33efbe),this['_source']=_0xd7d6e,this['extendTemplate']({'attributes':{'class':[xa]}});}['setResources'](_0xf06fa0,_0x201740){this['items']['clear']();let _0x4920f6=_0xf06fa0;if(this['_source']['useDefaultFiltering']&&_0x201740&&''!==_0x201740['trim']()){const _0xbd64aa=new RegExp(_0x201740['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x4920f6=_0xf06fa0['filter'](_0x27579c=>_0xbd64aa['test'](_0x27579c['label']));}for(const _0x475fdc of _0x4920f6){const _0x36277a=new hc(this['locale'],_0x475fdc);_0x36277a['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x475fdc);}),this['items']['add'](_0x36277a);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x201740);}['highlightText'](_0x658d69){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x142691=>{_0x142691['highlightText'](_0x658d69);});}['updateResourceState'](_0x13cf3c,_0x6c044){for(const _0x339deb of this['items']){const _0x817e81=_0x339deb;_0x817e81['resource']['id']===_0x13cf3c&&_0x817e81['updateResourceState'](_0x6c044);}}['_handleResourceSelection'](_0xc07181,_0x4b353e){this['fire']('addResourceToContext',{'source':_0xc07181,'resource':_0x4b353e});}}class Tr extends _0xfba0d2{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x5c18d9){const t=_0x5c18d9['t'],_0x312ecc={'showResetButton':!0x0,'showIcon':!0x0,'creator':th,'label':i(_0x5c18d9,'AI_CHAT_SEARCH_RESOURCES')};super(_0x5c18d9,_0x312ecc['creator']),this['label']=_0x312ecc['label'],this['_viewConfig']=_0x312ecc,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x5c18d9,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x1176fb){this['fire']('search',_0x1176fb);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0xc034b(),this['iconView']['content']=_0x3c98bc,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x4fc718,t){this['resetButtonView']=new _0x1e9460(_0x4fc718),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x557804,'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',_0x5f3e96=>!_0x5f3e96),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 _0x184e76{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x472bc9,_0x3e648f){super(_0x472bc9),this['_source']=_0x3e648f['source'],this['_searchInputVisibleFrom']=_0x3e648f['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 _0x4e90c7([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 _0x3be76d=new _0x184e76(this['locale']);return _0x3be76d['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x3f1164,_0x1028c5)=>{this['loadResources'](_0x1028c5),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x1028c5);}),_0x3be76d;}['_createResourcesListView'](){const _0x456d61=new Lr(this['locale'],this['_source']);return _0x456d61['delegate']('addResourceToContext')['to'](this),_0x456d61['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x456d61;}['_createSkeletonView'](){const _0x4e197f=new ai(this['locale'],di['aiChatResources']);return _0x4e197f['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x26d351=>!_0x26d351)]}}),_0x4e197f;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x34b1e3){const _0x3bb42a=_0x926b30();this['_latestLoadResourcesUid']=_0x3bb42a,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x34b1e3,'uid':_0x3bb42a}),this['isLoading']=!0x0;}['setResources'](_0x306eb6,_0x29ba56){if(_0x29ba56&&_0x29ba56!==this['_latestLoadResourcesUid'])return;const _0xd30681=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x306eb6,_0xd30681),_0x306eb6['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x50673f,_0x3ddf7a){this['_resourcesListView']['updateResourceState'](_0x50673f,_0x3ddf7a);}}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(_0x18fd10,_0x30f180,_0x475f67){this['_locale']=_0x18fd10,this['_bodyCollection']=_0x30f180,this['_config']=_0x475f67;}['showSourceResourcesBalloon']({source:_0x10ea40,withBackButton:_0x5e2a5c}){let _0x40a119=this['_sourceResourceBalloons']['get'](_0x10ea40['id']);_0x40a119||(_0x40a119=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x10ea40['id'],_0x40a119),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x40a119)),this['_addSourceResourceContent']({'balloonPanel':_0x40a119,'source':_0x10ea40,'withBackButton':_0x5e2a5c}),_0x40a119['show']();const _0x1ad19d=this['_config']['getTargetElement']();_0x1ad19d&&_0x40a119['pin']({'target':_0x1ad19d,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x29feb2,_0x543fd3,_0x25e4ee){const _0x2f30de=this['_sourceResourceBalloons']['get'](_0x29feb2);if(!_0x2f30de)return;const _0x25adbc=this['_getResourcesViewFromBalloon'](_0x2f30de);_0x25adbc&&(_0x25adbc['setResources'](_0x543fd3,_0x25e4ee),_0x25adbc['once']('change:isLoading',()=>{_0x2f30de['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x1e1af0){const _0xcf6335=this['_sourceResourceBalloons']['get'](_0x1e1af0);_0xcf6335&&requestAnimationFrame(()=>{_0xcf6335['hide'](),this['_sourceResourceBalloons']['delete'](_0x1e1af0),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x31b216 of this['_sourceResourceBalloons']['values']())if(_0x31b216['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x2935b5,_0xde6ea3,_0x8a79b7){const _0x267672=this['_sourceResourceBalloons']['get'](_0x2935b5);if(!_0x267672||!_0x267672['isVisible'])return;const _0x4e674a=this['_config']['getTargetElement']();if(!_0x4e674a)return;_0x267672['pin']({'target':_0x4e674a,'limiter':this['_config']['getLimiterElement']()});const _0x355420=this['_getResourcesViewFromBalloon'](_0x267672);_0x355420&&_0x355420['updateResourceState'](_0xde6ea3,_0x8a79b7);}['destroy'](){for(const _0x33a370 of this['_sourceResourceBalloons']['values']())_0x33a370['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x328782=new _0x2fff3d(this['_locale']);return _0x328782['extendTemplate']({'attributes':{'class':La}}),this['_bodyCollection']['add'](_0x328782),_0x328782;}['_addSourceResourceContent']({balloonPanel:_0x183c5a,source:_0x46f76c,withBackButton:_0x5ecd6a}){_0x183c5a['content']['clear']();const _0x4a0fcd=this['_createBalloonHeader']({'balloonPanel':_0x183c5a,'source':_0x46f76c,'withBackButton':_0x5ecd6a});_0x183c5a['content']['add'](_0x4a0fcd);const _0x530c39=this['_createBalloonResourcesView'](_0x46f76c);_0x183c5a['content']['add'](_0x530c39);}['_createBalloonHeader']({balloonPanel:_0x44efaf,source:_0x3ea449,withBackButton:_0x43ba7b}){const _0x3d3d5b=new _0x41e0a3(this['_locale'],{'label':_0x3ea449['label'],'class':Pa});return _0x43ba7b&&_0x3d3d5b['children']['add'](this['_createBackButton'](_0x44efaf),0x0),_0x3d3d5b;}['_createBackButton'](_0x1826ec){const _0x42713a=new _0x1e9460(this['_locale']);return _0x42713a['set']({'icon':_0x29f3c3,'tooltip':i(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Da}),_0x42713a['on']('execute',()=>{_0x1826ec['hide'](),this['_config']['onBackToContext']();}),_0x42713a;}['_createBalloonResourcesView'](_0x296d00){const _0x41fec9=new lc(this['_locale'],{'source':_0x296d00,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x41fec9['on']('loadSourceResources',(_0x2ad4ed,_0x271999)=>{this['_config']['onLoadSourceResources'](_0x271999);}),_0x41fec9['on']('addResourceToContext',(_0x3eb137,_0x22758f)=>{this['_config']['onResourceSelected'](_0x22758f['source'],_0x22758f['resource']),this['closeSourceResourceBalloon'](_0x296d00['id']);}),_0x41fec9;}['_getResourcesViewFromBalloon'](_0xcd9027){const _0x130bc5=_0xcd9027['content']['get'](0x1);return _0x130bc5 instanceof lc?_0x130bc5:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x4e43df){_0x1ff4d5({'emitter':_0x4e43df,'contextElements':[_0x4e43df['element']],'callback':()=>{_0x4e43df['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x4e43df['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=[_0x2fff3d['defaultPositions']['northArrowSouthWest'],_0x2fff3d['defaultPositions']['northArrowSouth'],_0x2fff3d['defaultPositions']['northArrowSouthEast'],_0x2fff3d['defaultPositions']['southArrowNorthWest'],_0x2fff3d['defaultPositions']['southArrowNorth'],_0x2fff3d['defaultPositions']['southArrowNorthEast']];class Is extends _0x184e76{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x5878fa,_0x240c1a){super(_0x5878fa),this['bodyCollection']=_0x240c1a['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x5878fa),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x5878fa),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x5878fa),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x5878fa,_0x240c1a);const _0x5c9587={'cssClasses':{'showMoreButton':$o,'showMoreBalloon':Wo,'overflowContainer':Do,'controlsButton':Xo}};this['_overflowManager']=new Ro(_0x5878fa,this['_currentContextsChips'],_0x5c9587,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'](_0x2969db,_0x17b9c6){const _0x54332d=this['_createContextButton'](_0x2969db,'current',!0x0,_0x17b9c6);this['_addContextToCollection'](_0x54332d,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x12623e){this['_removeContextFromCollection'](_0x12623e,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x12623e,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x3f57ad,_0x5566c2){let _0x18e2d3=this['_currentContextsChips']['find'](_0x186e97=>_0x186e97['id']===_0x3f57ad);_0x18e2d3||(_0x18e2d3=this['_overflowManager']['overflowChips']['find'](_0x5d644a=>_0x5d644a['id']===_0x3f57ad)),_0x18e2d3&&(_0x18e2d3['isLoading']=_0x5566c2);}['setConversationContext'](_0x41fc46){this['_conversationContextsChips']['clear']();for(const _0x32736b of _0x41fc46){const _0x472959=this['_createContextButton'](_0x32736b,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x472959,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x475e8a,_0xdcaf1b,_0x79db5){this['_resourcesBalloonView']['updateResourceState'](_0x475e8a,_0xdcaf1b,_0x79db5);}['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:_0x3be37c,withBackButton:_0x180df8}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x3be37c,'withBackButton':_0x180df8}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x34a9a2,_0x5867f7,_0x40b576,_0x1b4f71){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x34a9a2,_0x40b576,_0x1b4f71);}['closeSourceResourceBalloon'](_0x3bbf64){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x3bbf64),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x14a0bd){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x14a0bd),this['_setAddContextButtonEnabled'](_0x14a0bd);}['_setAddContextButtonEnabled'](_0x485e35){const _0x513d55=!_0x485e35['document']['isHidden']&&_0x485e35['document']['enabled'],_0x1cc0ec=_0x485e35['urls']['enabled'],_0x11121e=_0x485e35['files']['enabled'],_0x58f365=_0x485e35['sources']['length']>0x0,_0x5ad15a=_0x485e35['customItems']&&_0x485e35['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x513d55||_0x1cc0ec||_0x11121e||_0x58f365||_0x5ad15a;}['_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'](_0x2c62d0){const _0x1534cb=new _0x1e9460(_0x2c62d0);return _0x1534cb['set']({'label':i(_0x2c62d0,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Xo+'\x20'+Mo,'icon':_0xb4fa02,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x1534cb;}['_createAddContextBalloonPanelView'](_0x1dd7fe){return this['_createBaseBalloonPanel'](_0x1dd7fe,No);}['_createUrlBalloonPanelView'](_0x24fc07){const _0x1fc7f6=this['_createBaseBalloonPanel'](_0x24fc07,Ho);return this['_addUrlContent'](_0x1fc7f6,_0x24fc07),_0x1fc7f6;}['_createResourcesBalloonView'](_0x825e3a,_0x188560){const _0xbbdc83={'searchInputVisibleFrom':_0x188560['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo});},'onResourceSelected':(_0x34a0ea,_0x184ae7)=>{this['fire']('addResourceToContext',{'source':_0x34a0ea,'resource':_0x184ae7});},'onLoadSourceResources':_0x123954=>{this['fire']('loadSourceResources',_0x123954);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Oo(_0x825e3a,_0x188560['bodyCollection'],_0xbbdc83);}['_getLimiterElement'](){return this['element']?.['closest']('.'+qo)||document['body'];}['_createBaseBalloonPanel'](_0x42df8a,_0x25601e){const _0x397ea1=new _0x2fff3d(_0x42df8a);return _0x397ea1['extendTemplate']({'attributes':{'class':_0x25601e}}),this['bodyCollection']['add'](_0x397ea1),_0x397ea1;}['_setBalloonPanelContent'](_0x2a90a9,_0xa02067,_0x263b5c){if(_0x2a90a9['content']['clear'](),!_0x263b5c['document']['isHidden']&&_0x263b5c['document']['enabled']){const _0x3bd29b=this['_createBalloonButton'](_0xa02067,{'label':i(_0xa02067,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x35a5eb});_0x3bd29b['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x2a90a9['content']['add'](_0x3bd29b);}if(_0x263b5c['urls']['enabled']){const _0x5c7ec4=this['_createBalloonButton'](_0xa02067,{'label':i(_0xa02067,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0xb249a6});_0x5c7ec4['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo}),this['_urlInputView']['focus']();}),_0x2a90a9['content']['add'](_0x5c7ec4);}if(_0x263b5c['files']['enabled']){const _0x5d05ca=new _0x254afa(_0xa02067);_0x5d05ca['set']({'label':i(_0xa02067,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x3baee4,'withText':!0x0,'tooltip':!0x0,'class':jo,'allowMultipleFiles':!0x0}),_0x5d05ca['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x5d05ca['on']('done',(_0x292d6f,_0x364b32)=>{this['fire']('addFileToContext',_0x364b32);}),_0x5d05ca['tooltip']=!0x0,_0x2a90a9['content']['add'](_0x5d05ca);}for(const _0x51e53b of _0x263b5c['sources']){const _0xa6f6e8=this['_createBalloonButton'](_0xa02067,{'label':_0x51e53b['label'],'icon':_0x51e53b['icon']||_0x56717c,'type':'source'});_0x2a90a9['content']['add'](_0xa6f6e8),_0xa6f6e8['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x51e53b,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x82c901 of _0x263b5c['customItems']||[]){const _0x37c467=this['_createBalloonButton'](_0xa02067,{'label':_0x82c901['label'],'icon':_0x82c901['icon']||_0x56717c,'type':'customItem'});_0x2a90a9['content']['add'](_0x37c467),_0x37c467['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x82c901);});}this['_hasExactlyOneSource']=0x1===_0x2a90a9['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x3cd31e,_0x831961){this['_urlInputView']=new Po(_0x831961),this['_urlInputView']['on']('submitUrl',(_0x279b7f,_0x37c1cb)=>{this['_handleUrlSubmit'](_0x37c1cb);}),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});}),_0x3cd31e['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x1de6de,_0x55b3e9){const _0x3f4b9c='source'===_0x55b3e9['type']?new Ha(_0x1de6de):new _0x1e9460(_0x1de6de);return _0x3f4b9c['set']({'label':_0x55b3e9['label'],'icon':_0x55b3e9['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':jo}),_0x3f4b9c;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x1ff4d5({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0xcbb74a){const _0x5c73c8=this['_addContextBalloonConfig'];_0x5c73c8['buttonView']['isOn']=_0xcbb74a,_0xcbb74a?_0x5c73c8['balloonView']['show']():_0x5c73c8['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x1f8146,buttonView:_0x509f28,hideMethod:_0x4acff8}=this['_addContextBalloonConfig'];_0x1ff4d5({'emitter':_0x1f8146,'contextElements':[_0x1f8146['element'],_0x509f28['element']],'callback':()=>{_0x4acff8();},'activator':()=>_0x509f28['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x34f944,_0x16fc24,_0x55b8a8=!0x1,_0x42074d=!0x1){const _0x2cd350='conversation'===_0x16fc24||!0x0===_0x34f944['isReadOnly'],_0xd2682c=new Vo(this['locale'],_0x34f944,_0x2cd350,_0x55b8a8,_0x42074d);return _0x2cd350||_0xd2682c['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0xd2682c['id']);}),_0xd2682c;}['_addContextToCollection'](_0x6f915,_0x44c5c2){_0x44c5c2['add'](_0x6f915,0x0);}['_removeContextFromCollection'](_0x471bb3,_0x3761d9){const _0x559faf=_0x3761d9['find'](_0x1f550a=>_0x1f550a['id']===_0x471bb3);_0x559faf&&_0x3761d9['remove'](_0x559faf);}['_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'](_0x30b461){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x30b461);}}class Ha extends _0x1e9460{['arrowView'];constructor(_0xdb37f9){super(_0xdb37f9),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 _0x18014e=new _0xc034b();return _0x18014e['content']=_0xd17942,_0x18014e['extendTemplate']({'attributes':{'class':Fo+'__arrow'}}),_0x18014e;}}class Cs extends _0x184e76{['_cancelButtonView'];['_loaderView'];constructor(_0x439ccb){super(_0x439ccb),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 _0x37c8bb=new _0x1e9460(this['locale']);return _0x37c8bb['set']({'label':i(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x2ff977}),_0x37c8bb['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x37c8bb;}['_createLoaderView'](){const _0x340bf3=new _0x184e76(this['locale']);return _0x340bf3['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')}]}),_0x340bf3;}}class pi extends _0x184e76{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x788989,_0x1ebc81){super(_0x788989),this['_contextPanelView']=this['_createContextPanelView'](_0x788989,{'bodyCollection':_0x1ebc81['bodyCollection'],'searchInputVisibleFrom':_0x1ebc81['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x788989),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x788989),this['_loaderView']=this['_createLoaderView'](_0x788989),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x788989),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 _0x1c3a53=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x1c3a53['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x1c3a53['if']('isLoading','ck-hidden',_0x25631f=>_0x25631f||!this['isModelAvailable']),_0x1c3a53['if']('isModelAvailable','ck-hidden',_0x471026=>!_0x471026||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x1c3a53['if']('isLoading','ck-hidden',_0x5cc505=>!_0x5cc505)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x1c3a53['if']('isModelAvailable','ck-hidden',_0x5e8007=>_0x5e8007)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x1ff4d5({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x4884cf,_0x2f1da6){return new Is(_0x4884cf,_0x2f1da6);}['_createPromptInputView'](_0x12c71c){return new _s(_0x12c71c,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x6fe611){return new vs(_0x6fe611);}['_createLoaderView'](_0x2b3742){return new Cs(_0x2b3742);}['_createModelUnavailableMessageView'](_0x53a149){const _0x334675=new As(_0x53a149);return _0x334675['delegate']('startConversation')['to'](this),_0x334675;}['_handlePromptInputFocus'](_0x2b5a98,_0x4c9019,_0x4fb7b2){_0x4fb7b2?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x1a1629,_0x25a5fe){this['_contextPanelView']['addContextItem'](_0x1a1629,_0x25a5fe);}['removeContextItem'](_0x516e52){this['_contextPanelView']['removeContextItem'](_0x516e52);}['setContextItemLoading'](_0x106fca,_0x27e425){this['_contextPanelView']['setContextItemLoading'](_0x106fca,_0x27e425);}['setIsUploadInProgress'](_0x45bf9c){this['_promptInputView']['setIsUploadInProgress'](_0x45bf9c);}['setConversationContext'](_0x1b3558){this['_contextPanelView']['setConversationContext'](_0x1b3558);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x4ec957,_0x55204f,_0x3f46d1){this['_contextPanelView']['updateResourceState'](_0x4ec957,_0x55204f,_0x3f46d1);}['setWebSearch'](_0x174d51){this['_promptCapabilitiesView']['setWebSearch'](_0x174d51);}['setReasoning'](_0x3e249e){this['_promptCapabilitiesView']['setReasoning'](_0x3e249e);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x451592){this['_contextPanelView']['setAddContextOptions'](_0x451592);}['setInputPlaceholder'](_0x1ff12f){this['_promptInputView']['setPlaceholderText'](_0x1ff12f);}['setModelList'](_0x5bba4a,_0x34a3bf){this['_promptCapabilitiesView']['setModelList'](_0x5bba4a,_0x34a3bf);}['setModel'](_0x21089c){_0x21089c?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x21089c)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x3905fa){this['_promptCapabilitiesView']['disableModelSelector'](_0x3905fa);}['populateSourceResourceBalloon'](_0xf4a6a4,_0x172874,_0x31fef1,_0x300144){this['_contextPanelView']['populateSourceResourceBalloon'](_0xf4a6a4,_0x172874,_0x31fef1,_0x300144);}['closeSourceResourceBalloon'](_0x4c078f){this['_contextPanelView']['closeSourceResourceBalloon'](_0x4c078f);}['focusPromptInput'](_0x56db08=!0x1){this['_promptInputView']['focus'](_0x56db08);}['setPromptInputValue'](_0x435466){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x435466;}}class As extends _0x184e76{constructor(_0x3738d6){super(_0x3738d6);const _0xa27430=new _0x1e9460(_0x3738d6);_0xa27430['set']({'label':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0xa27430['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'},_0xa27430]}]});}}class wi extends _0x41e0a3{['conversationStartButton'];['resizeButton'];constructor(_0xe299ef,_0x491a97){super(_0xe299ef,{'label':i(_0xe299ef,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':vt}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0xe299ef),this['children']['add'](this['conversationStartButton']),_0x491a97&&(this['resizeButton']=Hs(_0xe299ef,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0xf7d6b5){const _0x3488a4=new _0x1e9460(_0xf7d6b5);return _0x3488a4['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x40fce4,'class':'ck-ai-chat__start-conversation'}),_0x3488a4['on']('execute',()=>{this['fire']('startConversation');}),_0x3488a4;}}class fi extends _0x184e76{constructor(_0x417a89){super(_0x417a89),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':i(_0x417a89,'AI_DISCLAIMER_TEXT')}]}]});}}class Pt extends _0x184e76{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0xa80c3e,_0xe1afe7){super(_0xa80c3e),this['_bodyCollection']=new _0x591ff4(_0xa80c3e),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new wi(_0xa80c3e,_0xe1afe7['showResizeButton']),this['chatHeader']['delegate'](...bt)['to'](this),this['chatFeed']=new ui(_0xa80c3e,this['_bodyCollection']),this['chatFeed']['delegate'](...bt)['to'](this),this['chatControls']=new pi(_0xa80c3e,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0xe1afe7['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...bt)['to'](this),this['chatDisclaimer']=new fi(_0xa80c3e),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0xa80c3e['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x3db714,_0x183f9f,_0x48cb24,_0x3cd3e9){this['chatControls']['populateSourceResourceBalloon'](_0x3db714,_0x183f9f,_0x48cb24,_0x3cd3e9);}['closeSourceResourceBalloon'](_0x4f50c7){this['chatControls']['closeSourceResourceBalloon'](_0x4f50c7);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class ct extends _0x575928{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(_0x19d943){super(_0x19d943);const _0x4a0042=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new z(),this['_view']=new Pt(this['context']['locale'],{'showResizeButton':_0x4a0042['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...bt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0xfe8430,{showDiff:_0x10c10c})=>{this['showDiff']=_0x10c10c;}),_0x4a0042['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',_0x5d0fce=>_0x5d0fce),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x4d6818=>_0x4d6818),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x39d755){const _0x217960=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'](_0x39d755['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x217960}),this['fire']('conversationCreated');}['addFeedItemStaticMessage']({id:_0x319bc4,staticMessage:_0x2c315e}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x319bc4,'initialContent':'<p>'+_0x2c315e+'</p>'});}['addFeedItemUserMessage'](_0x2f4121){const _0x4e6563=_0x2f4121['attributes']?.['displayedPrompt']||_0x2f4121['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x2f4121['contextItems']['values']()),'initialContent':'<p>'+_0x4e6563+'</p>','id':_0x2f4121['id']});}['addFeedItemError']({errorMessage:_0x123f97,id:_0x10b43e}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x123f97+'</p>','id':_0x10b43e});}['addFeedItemAIReply'](_0x58ced5){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x58ced5['interactionId']+':'+_0x58ced5['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x5c3141){const _0x144391=T(this['context']);let _0x492cfb=_0x144391['config']['get']('ai.availableReplyActions')||[...ot];if(_0x144391['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x1d217b=_0x144391['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x1d217b,'value');}}else _0x492cfb=_0x492cfb['filter'](_0x3256d0=>'insertSuggestion'!=_0x3256d0);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x5c3141['interactionId']+':'+_0x5c3141['id'],'areActionsDisabled':_0x5c3141['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x492cfb}),this['clearLoadingMessage']();});}['addFeedInteractionHeader'](_0x126b38,_0x5ae5e6){const _0x209d55=this['_view']['chatFeed']['children']['last'];if(_0x209d55 instanceof Mt)return this['_view']['chatFeed']['children']['remove'](_0x209d55),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x126b38['id'],'capabilities':{'isWebSearchEnabled':_0x209d55['capabilities']['isWebSearchEnabled']||_0x5ae5e6['isWebSearchEnabled'],'isReasoningEnabled':_0x209d55['capabilities']['isReasoningEnabled']||_0x5ae5e6['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x126b38['id'],'capabilities':_0x5ae5e6});}async['addFeedItemCustomElement'](_0x1446e7,_0x28900e){let _0x5a1052;return await this['_promiseQueue']['enqueue'](async()=>{_0x5a1052=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x1446e7,'id':_0x28900e});}),_0x5a1052;}['removeFeedItem'](_0x56a19d){this['_view']['chatFeed']['removeItem'](_0x56a19d);}['hasFeedItem'](_0x56b70a){return this['_view']['chatFeed']['hasItem'](_0x56b70a);}['updateFeedInteractionHeader'](_0x1c6d11){const _0xb83df9=this['_view']['chatFeed']['children']['find'](_0x1f925f=>_0x1f925f['options']['id']==_0x1c6d11['id']&&_0x1f925f instanceof Mt);_0xb83df9&&_0xb83df9['set']('isVisible',_0x1c6d11['isVisible']);}async['updateFeedItemAIReplyContent'](_0x4ec748){const _0x4b1642=_0x4ec748['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x18c824=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x4ec748,'abortSignal':_0x18c824,'renderingStrategy':_0x4b1642}),_0x4ec748['isDone']&&this['markFeedItemAsDone'](_0x4ec748['id']);});}['updateFeedItemAIReplySources'](_0x5e75c5,_0x386414){this['_view']['chatFeed']['updateWebSources'](_0x5e75c5,_0x386414);}async['updateFeedItemAIReplySuggestionContent'](_0xb74311){const _0x34d358=_0xb74311['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x5e71db=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0xb74311,'abortSignal':_0x5e71db,'renderingStrategy':_0x34d358}),_0xb74311['isDone']&&this['markFeedItemAsDone'](_0xb74311['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x13e558){this['_view']['chatFeed']['updateSuggestionPartState'](_0x13e558);}['setFeedItemAIReplySuggestionPartActive'](_0x1bb3cc){this['_view']['chatFeed']['setSuggestionPartActive'](_0x1bb3cc);}['markFeedItemAsDone'](_0x40f1e8){this['_view']['chatFeed']['markItemAsDone'](_0x40f1e8);}['removeFeedInteraction'](_0x2439c7){this['_view']['chatFeed']['getItemIds']()['filter'](_0x9c412c=>_0x9c412c['startsWith'](_0x2439c7))['forEach'](_0x53cfa4=>this['_view']['chatFeed']['removeItem'](_0x53cfa4));}['startInteraction'](){const _0x4d38db=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x4d38db),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x42a564){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x1392c9=>_0x1392c9['startsWith'](_0x42a564['id']))['forEach'](_0x1f831f=>this['markFeedItemAsDone'](_0x1f831f)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x2a20f1,_0x4d4492){this['_view']['chatControls']['addContextItem'](_0x2a20f1,_0x4d4492);}['removeContextItem'](_0xf32072){this['_view']['chatControls']['removeContextItem'](_0xf32072);}['setContextItemLoading'](_0x4d2ad7,_0x392d4d){this['_view']['chatControls']['setContextItemLoading'](_0x4d2ad7,_0x392d4d);}['setIsUploadInProgress'](_0x327a22){this['_view']['chatControls']['setIsUploadInProgress'](_0x327a22);}['setConversationContext'](_0x57c53e){this['_view']['chatControls']['setConversationContext'](_0x57c53e);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x35eac6,_0x13a58d,_0x57a9ac){this['_view']['chatControls']['updateResourceState'](_0x35eac6,_0x13a58d,_0x57a9ac);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x86e8ea){this['_view']['chatControls']['setAddContextOptions'](_0x86e8ea);}['updateCapabilities'](_0xf0894e){this['_view']['chatControls']['setWebSearch'](_0xf0894e['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0xf0894e['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0xf0894e));}['setSelectedModel'](_0x56981c,_0x3ca4f4){this['_view']['chatControls']['setModel'](_0x56981c),_0x3ca4f4&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x36f0f5){this['feedItemRenderingStrategy']=_0x36f0f5;}['toggleLoadingSkeleton'](_0x2a333a){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x2a333a);}['resetConversationTitle'](){this['setConversationTitle'](i(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x2004cd,_0x554302=!0x1){if(_0x554302&&!Rt()&&_0x2004cd['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x2004cd);this['_view']['chatHeader']['label']=_0x2004cd;}['setLoadingMessage'](_0x53ceec){this['_view']['chatFeed']['setLoadingMessage'](_0x53ceec);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x54c261){let _0x4bb24f=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x54c261[_0x4bb24f],_0x4bb24f++,_0x4bb24f===_0x54c261['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x5606a0){this['_view']['chatHeader']['isMaximized']=_0x5606a0;}['prepareLoadingMessage'](_0x9e9638){return _0x9e9638['isWebSearchEnabled']&&_0x9e9638['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x9e9638['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x9e9638['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x2faed8){return _0x2faed8?_0x2faed8['isWebSearchEnabled']&&_0x2faed8['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x2faed8['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x2faed8['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'](_0x261493,_0x24689f,_0x298fc8,_0x374417){this['_view']['populateSourceResourceBalloon'](_0x261493,_0x24689f,_0x298fc8,_0x374417);}['closeSourceResourceBalloon'](_0x30a3b7){this['_view']['closeSourceResourceBalloon'](_0x30a3b7);}['setPromptInputValue'](_0x306d0e){this['_view']['chatControls']['setPromptInputValue'](_0x306d0e);}['focusPromptInput'](_0x2399c7=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x2399c7);}['scrollFeedToSuggestion'](_0x324bfc,_0x543c02){this['_view']['chatFeed']['scrollToSuggestion'](_0x324bfc,_0x543c02);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class yi extends _0x35cdc6{['sections'];constructor(_0x360f04,_0x2972f3){super(_0x360f04),this['sections']=_0x2972f3,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x1a2d59){let _0x18088f=0x0,_0x9d5f9=0x0;for(const _0x1b0d1d of this['sections']){const {resultsCount:_0x2921cd,totalItemsCount:_0x30b911}=_0x1b0d1d['filter'](_0x1a2d59);_0x18088f+=_0x2921cd,_0x9d5f9+=_0x30b911;}return{'resultsCount':_0x18088f,'totalItemsCount':_0x9d5f9};}}class Ei extends _0x4ffa3a{['title'];['itemsViews'];['_itemsListView'];constructor(_0x1d5a30,{title:_0xbf70e0,items:_0x10e1db}){super(_0x1d5a30);const _0x17f644=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0xbf70e0,this['itemsViews']=_0x10e1db;const _0x352e63=new _0x184e76(_0x1d5a30);_0x352e63['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x35cdc6(_0x1d5a30),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x17f644['if']('isVisible','ck-hidden',_0x5d39bb=>!_0x5d39bb)]},'children':[_0x352e63,this['_itemsListView']]});}['filter'](_0x59e9ee){const _0x1c5e91=this['itemsViews']['length'];let _0x5e31e5=0x0;for(const _0x53b8e1 of this['itemsViews']){if(_0x59e9ee){const _0x53579d=_0x53b8e1['isMatching'](_0x59e9ee);_0x53b8e1['isVisible']=!!_0x53579d,_0x53b8e1['highlightText'](_0x59e9ee);}else _0x53b8e1['isVisible']=!0x0,_0x53b8e1['highlightText'](null);_0x53b8e1['isVisible']&&_0x5e31e5++;}return this['isVisible']=_0x5e31e5>0x0,{'resultsCount':_0x5e31e5,'totalItemsCount':_0x1c5e91};}['getItem'](_0x237741){return this['itemsViews']['find'](_0x1c398f=>_0x1c398f['id']===_0x237741);}['removeItem'](_0x1b26db){const _0x316975=this['itemsViews']['indexOf'](_0x1b26db);-0x1!==_0x316975&&(this['itemsViews']['splice'](_0x316975,0x1),this['_itemsListView']['items']['remove'](_0x1b26db));}}class Ri extends/* #__PURE__ -- @preserve */
27
- _0x3bd6ad(_0x4ffa3a){['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(_0x23ba56,_0x4923af){super(_0x23ba56);const _0x411653=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x4923af['pinned']),this['set']('loadingState',null),this['id']=_0x4923af['id'];const {title:_0x36194f,createdAt:_0x30df1e,active:_0x6ffd8a=!0x1}=_0x4923af;this['_titleView']=new _0x56f45c(),this['_titleView']['text']=_0x36194f,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x1baed8=this['_createCheckView'](),_0x584a21=this['_createPinButtonView'](_0x23ba56),_0x1b8a34=this['_createMenuDropdownView'](),_0x58b805=this['_createEditInputView'](_0x23ba56,_0x36194f),_0x3ff29d=this['_createAcceptEditButtonView'](_0x23ba56,_0x58b805),_0x3cee98=this['_createCancelEditButtonView'](_0x23ba56,_0x58b805);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x584a21),this['actions']['add'](_0x1b8a34),this['on']('change:isEdit',(_0xd65919,_0x4533b1,_0x50d9ee)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x50d9ee?(this['actions']['add'](_0x3ff29d),this['actions']['add'](_0x3cee98),this['mainContent']['add'](_0x58b805),_0x58b805['element']['focus']()):(this['actions']['add'](_0x584a21),this['actions']['add'](_0x1b8a34),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x6ffd8a?'ck-ai-chat-history__item--active':'',_0x411653['if']('isVisible','ck-hidden',_0x33feaa=>!_0x33feaa),_0x411653['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',_0x411653['if']('loadingState','ck-hidden',_0xee1ea=>!!_0xee1ea)]},'children':_0x6ffd8a?[_0x1baed8]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x411653['if']('loadingState','ck-hidden',_0x43af48=>!_0x43af48)]},'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',_0x411653['if']('loadingState','ck-hidden',_0x1b61d4=>!!_0x1b61d4)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x411653['if']('loadingState','ck-hidden',_0x1fd402=>!_0x1fd402)]},'children':[{'text':_0x411653['to']('loadingState',_0x360bf9=>_0x360bf9?i(this['locale'],Ri['LOADING_LABELS'][_0x360bf9]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x30df1e]}]},{'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'](_0x1d4801){this['_titleView']['text']=_0xac888d(_0x1d4801);}['updateLoadingState'](_0x1c87ed,_0x9de900){this['set']('loadingState',_0x9de900?_0x1c87ed:null);}['_createCheckView'](){const _0x6d040e=new _0xc034b();return _0x6d040e['set']({'content':_0x34e643}),_0x6d040e;}['_createPinButtonView'](_0x21dbda){const _0x21d118=new _0x1e9460(_0x21dbda);return _0x21d118['set']({'label':i(_0x21dbda,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x9d14c3,'withText':!0x1,'tooltip':!0x0}),_0x21d118['bind']('isOn')['to'](this,'pinned'),_0x21d118['on']('execute',()=>{const _0x4babec=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x4babec});}),_0x21d118;}['_createMenuDropdownView'](){const _0x15824f=_0x546896(this['locale'],_0x4e06b6),_0x24b7a6=_0x15824f['panelView']['children'];_0x15824f['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0xe97e9}),_0x15824f['panelPosition']='sw';const _0x3d0c1f=new _0x1e9460(this['locale']);_0x3d0c1f['label']=i(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x3d0c1f['withText']=!0x0,_0x3d0c1f['on']('execute',()=>{this['isEdit']=!0x0;});const _0x1eb68b=new _0x1e9460(this['locale']);_0x1eb68b['label']=i(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x1eb68b['withText']=!0x0,_0x1eb68b['on']('execute',()=>{this['showConfirm'](i(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x578919=new _0x35cdc6(this['locale']),_0x4f876a=new _0x4ffa3a(this['locale']);_0x4f876a['children']['add'](_0x3d0c1f);const _0x5594c2=new _0x4ffa3a(this['locale']);return _0x5594c2['children']['add'](_0x1eb68b),_0x578919['items']['addMany']([_0x4f876a,_0x5594c2]),_0x24b7a6['add'](_0x578919),_0x15824f;}['_createEditInputView'](_0x18b6d5,_0x1fd5d8){const _0x4d02e9=new _0x9c7843(_0x18b6d5),_0x5e4607=_0x4d02e9['bindTemplate'];return _0x4d02e9['value']=_0x1fd5d8,_0x4d02e9['extendTemplate']({'on':{'keydown':_0x5e4607['to'](_0x3f2310=>{'Enter'==_0x3f2310['key']&&this['_commitEditInputValue'](_0x4d02e9);})}}),_0x4d02e9;}['_createAcceptEditButtonView'](_0x417f4e,_0x50eae5){const _0x411452=new _0x1e9460(_0x417f4e);return _0x411452['set']({'icon':_0x34e643,'withText':!0x1,'tooltip':i(_0x417f4e,'AI_CHAT_HISTORY_ACCEPT')}),_0x411452['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x411452['on']('execute',()=>{this['_commitEditInputValue'](_0x50eae5);}),_0x411452;}['_commitEditInputValue'](_0x57fd58){const _0x26cb86=_0x57fd58['element']['value']||'';this['_titleView']['text']=_0x26cb86,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x26cb86});}['_createCancelEditButtonView'](_0x3aa2b8,_0xff1d77){const _0x3fe7b3=new _0x1e9460(_0x3aa2b8);return _0x3fe7b3['set']({'icon':_0x557804,'withText':!0x1,'tooltip':i(_0x3aa2b8,'AI_CHAT_HISTORY_CANCEL')}),_0x3fe7b3['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x3fe7b3['on']('execute',()=>{this['isEdit']=!0x1,_0xff1d77['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x3fe7b3;}['_createSpinnerView'](){const _0x29edd8=new li('tiny');return _0x29edd8['isVisible']=!0x0,_0x29edd8;}['isMatching'](_0x1002aa){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x1002aa)?{'title':!0x0}:null;}['highlightText'](_0x9e6767){this['_titleView']['highlightText'](_0x9e6767);}}class wt extends _0x184e76{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x13b522,_0x4ca0ff){super(_0x13b522),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 _0x195227=new _0x41e0a3(_0x13b522,{'label':i(_0x13b522,'AI_CHAT_HISTORY_HEADING'),'icon':Nt,'class':'ck-ai-header\x20ck-ai-header_history'});_0x4ca0ff&&(this['resizeButton']=Hs(_0x13b522,this),_0x195227['children']['add'](this['resizeButton'])),this['sectionsView']=new yi(_0x13b522,[]),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',_0x11ad43=>!_0x11ad43)]}}),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':[_0x195227,{'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 _0x3071a2=new _0x46980e(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x492b2f=>i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x492b2f),'secondary':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x143253=this['_createErrorView']();return _0x143253['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x3dcf8f=>!_0x3dcf8f)]}}),_0x3071a2['on']('render',()=>{_0x3071a2['children']['add'](_0x143253,0x1);}),_0x3071a2['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x9a6e3=>!_0x9a6e3)]}}),_0x3071a2;}['_createSkeletonView'](){const _0xeda145=new ai(this['locale'],di['aiHistory']);return _0xeda145['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0xcc1193=>!_0xcc1193)]}}),_0xeda145;}['_createErrorView'](){const _0x2724f4=new _0x184e76(this['locale']),_0x295d4d=new _0x1e9460(this['locale']);_0x295d4d['set']({'withText':!0x1,'icon':_0x557804,'class':'ck-ai-notification_error__dismiss-button'}),_0x295d4d['bind']('isVisible')['to'](this,'hasItems',_0x18a4b3=>!!_0x18a4b3),_0x295d4d['on']('execute',()=>{this['errorMessage']='';});const _0x966b52=this['bindTemplate'];return _0x2724f4['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x966b52['to']('errorMessage')}]},_0x295d4d]}),_0x2724f4;}['_createEmptyStateView'](){const _0x31c955=new _0x1e9460(this['locale']);_0x31c955['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x40fce4,'class':'ck-ai-chat__start-conversation'}),_0x31c955['on']('execute',()=>{this['fire']('openChat');});const _0x75af45=new _0x184e76(this['locale']);return _0x75af45['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x487426=>!_0x487426)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[i(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x31c955]}),_0x75af45;}['_createListItemViews'](_0x487672,_0x252606){const _0x4df950=[];for(const _0x2f717f of _0x487672){const _0x191a74=new Ri(_0x252606,_0x2f717f);_0x191a74['delegate'](...Mi)['to'](this),_0x4df950['push'](_0x191a74);}return _0x4df950;}['updateHistoryItemsWithCategories'](_0x30c0a9){const _0x3fd901=this['locale']||'en',_0x9e4c26=[];for(const _0x111aee of _0x30c0a9){const _0x595958=this['_createListItemViews'](_0x111aee['items'],_0x3fd901);_0x9e4c26['push'](new Ei(_0x3fd901,{'title':_0x111aee['title'],'items':_0x595958}));}this['sectionsView']['sections']=_0x9e4c26,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x9e4c26),this['hasItems']=_0x30c0a9['some'](_0x5f15c3=>_0x5f15c3['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x429735){for(const _0x5c399e of this['sectionsView']['sections']){const _0x5f55b1=_0x5c399e['getItem'](_0x429735);if(_0x5f55b1){if(_0x5c399e['removeItem'](_0x5f55b1),0x0===_0x5c399e['itemsViews']['length']){const _0x707a25=this['sectionsView']['sections']['indexOf'](_0x5c399e);-0x1!==_0x707a25&&(this['sectionsView']['sections']['splice'](_0x707a25,0x1),this['sectionsView']['items']['remove'](_0x5c399e));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0xfbbd0c,_0x58d57d){for(const _0x16d9db of this['sectionsView']['sections']){const _0x271b1e=_0x16d9db['getItem'](_0xfbbd0c);if(_0x271b1e){_0x271b1e['updateTitle'](_0x58d57d);break;}}}['updateItemLoadingState'](_0x361fc3,_0x3bc5c9,_0x569b2d){for(const _0x260074 of this['sectionsView']['sections']){const _0x100a9c=_0x260074['getItem'](_0x361fc3);if(_0x100a9c){_0x100a9c['updateLoadingState'](_0x3bc5c9,_0x569b2d);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x58d736=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x58d736);}}}const Mi=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class xt extends _0x575928{static get['requires'](){return[pt];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3094e1){super(_0x3094e1);const _0x4cb16d=this['context']['plugins']['get']('AITabs');this['_historyView']=new wt(this['context']['locale'],_0x4cb16d['showResizeButton']),this['_historyView']['delegate'](...Mi)['to'](this),_0x4cb16d['view']['addTab']({'id':'history','buttonLabel':i(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Nt,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x352d6b){this['_historyView']['removeHistoryItem'](_0x352d6b);}['updateItems'](_0x5b885b){this['_historyView']['updateHistoryItemsWithCategories'](_0x5b885b);}['updateItemTitle'](_0x240061,_0x1b826e){this['_historyView']['updateItemTitle'](_0x240061,_0x1b826e);}['updateItemLoadingState'](_0x52db59,_0x3ff57e,_0x398a90){this['_historyView']['updateItemLoadingState'](_0x52db59,_0x3ff57e,_0x398a90);}['setLoadingSkeleton'](_0x5b3324){this['_historyView']['isLoading']=_0x5b3324;}['showError'](_0x170b1b){this['_historyView']['errorMessage']=_0x170b1b;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x126a4d){this['_historyView']['isMaximized']=_0x126a4d;}}class nr extends ts(){['id'];['createdAt'];constructor({id:_0x3d4fc3,title:_0x34b4cc,createdAt:_0x164d62,updatedAt:_0x50ec13,pinned:_0x3aa65c}){super(),this['id']=_0x3d4fc3,this['createdAt']=new Date(_0x164d62),this['set']('title',_0x34b4cc),this['set']('updatedAt',_0x50ec13?new Date(_0x50ec13):null),this['set']('pinned',_0x3aa65c||!0x1);}['updateTitle'](_0x38cfef){this['set']('title',_0xac888d(_0x38cfef)),this['updatedAt']=new Date();}['updatePinned'](_0x836d3a){this['set']('pinned',_0x836d3a),this['updatedAt']=new Date();}}class Ht extends _0x290e58(){['items']=[];['connector'];['group'];constructor({connector:_0x116c47,group:_0x4c32a0}){super(),this['connector']=_0x116c47,this['group']=_0x4c32a0;}async['init'](){try{const _0xac5f7a=this['connector']['fetchConversations'](this['group']),_0x147d65=await _0xac5f7a['getConversations']();this['loadItems'](_0x147d65);}catch(_0x2071ea){this['fire']('error',{'error':_0x2071ea,'operation':'init'});}}['addItem'](_0x527c7d){this['items']['push'](_0x527c7d);}async['removeItem'](_0x22fb85){const _0x551150=this['items']['findIndex'](_0x3b5e52=>_0x3b5e52['id']===_0x22fb85);if(-0x1===_0x551150)return!0x1;try{return await this['connector']['deleteConversation'](_0x22fb85)['execute'](),this['items']['splice'](_0x551150,0x1),this['fire']('itemRemoved',{'itemId':_0x22fb85}),!0x0;}catch(_0x4ebb9b){return this['fire']('error',{'error':_0x4ebb9b,'operation':'removeItem','itemId':_0x22fb85}),!0x1;}}['getItem'](_0x4ec079){return this['items']['find'](_0x5846b4=>_0x5846b4['id']===_0x4ec079);}async['updateItemTitle'](_0x4ceb60,_0xb3ffa7){const _0x34ff79=this['getItem'](_0x4ceb60);if(!_0x34ff79)return!0x1;try{return await this['connector']['updateConversation'](_0x4ceb60,{'title':_0xb3ffa7})['getResult'](),_0x34ff79['updateTitle'](_0xb3ffa7),this['fire']('itemUpdated',{'itemId':_0x4ceb60,'updates':{'title':_0xb3ffa7}}),!0x0;}catch(_0x54d63b){return this['fire']('error',{'error':_0x54d63b,'operation':'updateItemTitle','itemId':_0x4ceb60}),!0x1;}}async['updateItemPinned'](_0x31154e,_0x802ed5){const _0x53fd73=this['getItem'](_0x31154e);if(!_0x53fd73)return!0x1;try{return await this['connector']['updateConversation'](_0x31154e,{'pinned':_0x802ed5})['getResult'](),_0x53fd73['updatePinned'](_0x802ed5),this['fire']('itemUpdated',{'itemId':_0x31154e,'updates':{'pinned':_0x802ed5}}),!0x0;}catch(_0x32a805){return this['fire']('error',{'error':_0x32a805,'operation':'updateItemPinned','itemId':_0x31154e}),!0x1;}}['loadItems'](_0x2f2943){try{this['items']=[],_0x2f2943['map'](_0x2efdae=>{this['addItem'](new nr(_0x2efdae));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x188216){this['fire']('error',{'error':_0x188216,'operation':'loadItems'});}}['getItems'](_0x1a9fe7={}){const _0x4a6d88=void 0x0!==_0x1a9fe7['pinned']&&_0x1a9fe7['pinned'],_0x245279=_0x1a9fe7['from']?new Date(_0x1a9fe7['from']['getFullYear'](),_0x1a9fe7['from']['getMonth'](),_0x1a9fe7['from']['getDate']()):null,_0x142369=_0x1a9fe7['to']?new Date(_0x1a9fe7['to']['getFullYear'](),_0x1a9fe7['to']['getMonth'](),_0x1a9fe7['to']['getDate']()):null;return this['items']['filter'](_0x534c9d=>{if(_0x534c9d['pinned']!==_0x4a6d88)return!0x1;if(_0x142369){const _0x4ab799=new Date(_0x534c9d['createdAt']['getFullYear'](),_0x534c9d['createdAt']['getMonth'](),_0x534c9d['createdAt']['getDate']());return _0x245279?_0x245279['getTime']()===_0x142369['getTime']()?_0x4ab799['getTime']()===_0x245279['getTime']():_0x4ab799<_0x142369&&_0x4ab799>=_0x245279:_0x4ab799<_0x142369;}return!0x0;});}}class jt extends _0x575928{['_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 _0x581d9c=this['context']['plugins']['get'](pt);try{const _0x29ddd6=this['_aiChatController']['getGroupId']();this['history']=new Ht({'connector':this['_aiConnector'],'group':_0x29ddd6}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x320116,_0x4dbc45)=>{this['_setItemLoading'](_0x4dbc45['id'],'remove'),this['_handleRemove'](_0x4dbc45['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x3122da,_0x885ddb)=>{this['_setItemLoading'](_0x885ddb['id'],'rename'),this['_handleEditTitle'](_0x885ddb['id'],_0x885ddb['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x24bf34,_0x20b146)=>{void 0x0!==_0x20b146['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x20b146['itemId'],_0x20b146['updates']['title']),void 0x0!==_0x20b146['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x20b146['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x452aec,_0x1e3956)=>{this['_aiChatController']['handleRemovedConversation'](_0x1e3956['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x1e3956['itemId']),this['_clearItemLoading'](_0x1e3956['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x785663,_0x81dafb)=>{this['_handleHistoryErrorUI'](_0x81dafb['error'],_0x81dafb['operation'],_0x81dafb['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x8513c6,_0x2db7ad)=>{this['_handleSelectConversation'](_0x2db7ad['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x5310b6,_0x2b776c)=>{const _0x3dad5e=_0x2b776c['pinned']?'pin':'unpin';this['_setItemLoading'](_0x2b776c['id'],_0x3dad5e),this['_handleTogglePin'](_0x2b776c['id'],_0x2b776c['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x581d9c['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x581d9c['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x581d9c,'resizedTabs',(_0x215db3,_0x3f095a)=>{this['_setIsMaximized'](_0x3f095a);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x581d9c['resize']();});}catch(_0x2cff8e){this['_handleHistoryErrorUI'](_0x2cff8e,'init');}}async['_handleEditTitle'](_0x814e43,_0x167a8b){await this['history']['updateItemTitle'](_0x814e43,_0x167a8b);}async['_handleTogglePin'](_0x25bb6f,_0x2398c4){await this['history']['updateItemPinned'](_0x25bb6f,_0x2398c4);}async['_handleRemove'](_0x5a3ecf){await this['history']['removeItem'](_0x5a3ecf);}async['_handleSelectConversation'](_0x14107f){await this['_aiChatController']['loadConversation'](_0x14107f);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x2041d6=this['_aiChatController']['activeConversation']?.['id'],_0x45d7bd=this['_getCategorizedItems']()['map'](_0x55c585=>({'title':_0x55c585['title'],'items':_0x55c585['items']['map'](_0x1191c7=>({'id':_0x1191c7['id'],'title':_0x1191c7['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x1191c7['createdAt'])['toLocaleDateString'](),'active':_0x1191c7['id']===_0x2041d6,'pinned':_0x1191c7['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x45d7bd);}['_setItemLoading'](_0x44da78,_0x16f1eb){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x44da78,_0x16f1eb,!0x0);}['_clearItemLoading'](_0x101003){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x101003,null,!0x1);}['_handleHistoryErrorUI'](_0x506d3b,_0x4dd622,_0x5edf5c){const _0x84d18e=this['_generateErrorMessage'](_0x4dd622,_0x5edf5c);this['_aiChatHistoryUi']['showError'](_0x84d18e),_0x5edf5c&&this['_clearItemLoading'](_0x5edf5c),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x46ae24,_0x29a85a){const _0xa7209c=_0x29a85a?this['history']['getItem'](_0x29a85a):null,_0x42bd29=_0xa7209c?.['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x46ae24){case'updateItemTitle':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x42bd29);case'updateItemPinned':{const _0x5bc125=i(this['context']['locale'],_0xa7209c?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x5bc125,_0x42bd29]);}case'removeItem':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x42bd29);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 _0x21fba2=new Date(),_0x3b664a=new Date(_0x21fba2['getFullYear'](),_0x21fba2['getMonth'](),_0x21fba2['getDate']()),_0x34cfc8=new Date(_0x3b664a);_0x34cfc8['setDate'](_0x34cfc8['getDate']()-0x1);const _0x5f3ebf=new Date(_0x3b664a);_0x5f3ebf['setDate'](_0x5f3ebf['getDate']()-0xe);const _0x2cae3a=this['history']['getItems']({'pinned':!0x0}),_0x554610=this['history']['getItems']({'from':_0x3b664a,'to':_0x3b664a}),_0xda5634=this['history']['getItems']({'from':_0x34cfc8,'to':_0x34cfc8}),_0xa4d173=this['history']['getItems']({'from':_0x5f3ebf,'to':_0x34cfc8}),_0x3d0fbe=this['history']['getItems']({'to':_0x5f3ebf}),_0x53b6d8=[];return _0x2cae3a['length']>0x0&&_0x53b6d8['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x2cae3a}),_0x554610['length']>0x0&&_0x53b6d8['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x554610}),_0xda5634['length']>0x0&&_0x53b6d8['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0xda5634}),_0xa4d173['length']>0x0&&_0x53b6d8['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0xa4d173}),_0x3d0fbe['length']>0x0&&_0x53b6d8['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x3d0fbe}),_0x53b6d8;}['_setIsMaximized'](_0x1e29b5){this['_aiChatHistoryUi']['setIsMaximized'](_0x1e29b5);}}class ht extends _0x575928{static get['requires'](){return[jt,xt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ma extends _0x575928{static get['requires'](){return[at,D,ct,ht];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2e572b){super(_0x2e572b),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:_0x3f9f62,attributes:_0x5a63bc}){await this['context']['plugins']['get'](at)['sendMessage']({'message':_0x3f9f62,'attributes':_0x5a63bc});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](at)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](at)['focusPromptInput']();}['registerToolDataCallback'](_0x113cbf){this['context']['plugins']['get'](at)['_registerToolDataCallback'](_0x113cbf);}}class fs extends _0x1e9460{['id'];constructor(_0xbc5e97,_0x354c3b){super(_0xbc5e97);const {id:_0x1bf158,type:_0x10801f,icon:_0x5aea5c}=_0x354c3b;this['id']=_0x1bf158,this['set']({'label':_0x354c3b['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x354c3b['id']}}),_0x5aea5c?this['icon']=_0x5aea5c:'chat'===_0x10801f?this['icon']=_0x2be426:'review'===_0x10801f?this['icon']=_0x560fa1:'translate'===_0x10801f&&(this['icon']=Vt);}}class kt extends _0x184e76{['listView'];constructor(_0x552970,_0x4883c4){super(_0x552970);const _0xf069ae=_0x4883c4['map'](_0x34a175=>{const _0x976cb8=new _0x4ffa3a(this['locale']),_0x4631f8=new fs(this['locale'],_0x34a175);return _0x976cb8['children']['add'](_0x4631f8),_0x4631f8['delegate']('execute')['to'](this),_0x976cb8;});this['listView']=new _0x35cdc6(this['locale']),this['listView']['items']['addMany'](_0xf069ae),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const Ut='chat-shortcuts';var Ua=function(_0x1c40e7){return _0x1c40e7['CHAT']='chat',_0x1c40e7['REVIEW']='review',_0x1c40e7['TRANSLATE']='translate',_0x1c40e7;}({});class Va extends _0x575928{['_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 _0x256f24=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x256f24['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x256f24,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x39ea56=Object['values'](Ua);this['_shortcuts']['forEach'](_0x4c3b89=>{let _0x7c63d8=!0x0;if(_0x4c3b89['id']&&_0x4c3b89['label']&&_0x39ea56['includes'](_0x4c3b89['type'])?'chat'===_0x4c3b89['type']&&(_0x7c63d8='string'==typeof _0x4c3b89['prompt']):_0x7c63d8=!0x1,!_0x7c63d8)throw new _0x36ca17('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x4c3b89});});}['_injectShortcuts'](){const _0x1ddce6=this['context']['plugins']['get'](ct);this['_shortcutsView']=new kt(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x1ddce6['addFeedItemCustomElement'](this['_shortcutsView']['element'],Ut),this['_shortcutsView']['on']('execute',_0x2a8e39=>{const _0x1963f2=_0x2a8e39['source']['id'];this['_executeShortcut'](_0x1963f2);});}['_removeShortcuts'](){const _0x513b32=this['context']['plugins']['get'](ct);_0x513b32['hasFeedItem'](Ut)&&_0x513b32['removeFeedItem'](Ut),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x410e05){const _0x32431b=this['_shortcuts']['find'](_0x33e8b0=>_0x33e8b0['id']===_0x410e05),_0xb9d8d9=_0x32431b['type'];'chat'===_0xb9d8d9?this['_runChatShortcut'](_0x32431b):'review'===_0xb9d8d9?_0x32431b['check']?this['_runReviewShortcut'](_0x32431b):this['_switchTab']('reviewMode'):'translate'===_0xb9d8d9&&(_0x32431b['language']?this['_runTranslateShortcut'](_0x32431b):this['_switchTab']('translate'));}['_switchTab'](_0xf0c81f){if(!this['context']['plugins']['has']('AITabs'))throw new _0x36ca17('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0xf0c81f});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0xf0c81f);}async['_runChatShortcut']({prompt:_0x28adc5,draftMode:_0x1ccf6a,useWebSearch:_0x1a2b37=!0x1,useReasoning:_0x1a6ff=!0x1,model:_0xe9aca7}){const _0x2e837b=this['context']['plugins']['get']('AIChat'),_0x25bdd9=this['context']['plugins']['get']('AIChatController'),_0x56164a=_0x25bdd9['activeConversation'];let _0x3c044c;_0x3c044c=_0xe9aca7?await _0x56164a['chatModels']['getModel'](_0xe9aca7):await _0x56164a['chatModels']['getDefault'](),_0x3c044c&&await _0x56164a['setModel'](_0x3c044c),_0x56164a['setWebSearch'](_0x1a2b37),_0x56164a['setReasoning'](_0x1a6ff),_0x25bdd9['addCurrentDocumentToChatContext'](),_0x1ccf6a?(this['_aiChatUI']['setPromptInputValue'](_0x28adc5),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x2e837b['sendMessage']({'message':_0x28adc5});}['_runReviewShortcut']({check:_0xa4b8,model:_0x5077c6,prompt:_0x476566,params:_0x7672ec}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new _0x36ca17('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x3387c8={'id':_0xa4b8,'isCustom':'custom'===_0xa4b8};_0x5077c6&&_0x476566&&(_0x3387c8['args']={'model':_0x5077c6,'prompt':_0x476566}),_0x7672ec&&(_0x3387c8['params']=_0x7672ec),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x3387c8);}['_runTranslateShortcut']({language:_0x2109ac}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new _0x36ca17('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x2109ac,'args':{'language':_0x2109ac}});}}class io extends Lt{constructor(_0x448667){super(_0x448667);const _0x2178d7=_0x448667['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x2178d7,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x50fa35=this['editor']['plugins']['get']('AITabs')['view'];_0x50fa35['isVisible']=!_0x50fa35['isVisible'];}}class qt extends _0x511be8{static get['requires'](){return[pt];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x11f9cb=this['editor'];_0x11f9cb['commands']['add']('toggleAi',new io(_0x11f9cb)),_0x11f9cb['ui']['componentFactory']['add']('toggleAi',()=>{const _0x18d6df=this['_createAIUIButton'](_0x1e9460);return _0x18d6df['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x18d6df;}),_0x11f9cb['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x348153=this['_createAIUIButton'](_0x12221a);return _0x348153['set']({'role':'menuitemcheckbox'}),_0x348153;});}['_createAIUIButton'](_0x261873){const _0x11dd26=this['editor'],_0x47bc44=_0x11dd26['commands']['get']('toggleAi'),_0x127418=new _0x261873(_0x11dd26['locale']);return _0x127418['set']({'label':i(_0x11dd26['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x6818cf,'isToggleable':!0x0}),_0x127418['bind']('isEnabled')['to'](_0x47bc44),_0x127418['bind']('isOn')['to'](_0x47bc44,'value',_0x2a5b66=>!!_0x2a5b66),this['listenTo'](_0x127418,'execute',()=>{_0x47bc44['execute']();}),_0x127418;}}const F=['applySuggestion','insertSuggestion','showNext','showPrevious'];class ls extends _0x184e76{['_errorView'];constructor(_0x3837d5){super(_0x3837d5),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x36344d){this['showError'](_0x36344d);}['showError'](_0x191967){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x191967,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x5c8fd7=new _0x184e76(this['locale']),_0x464588=new _0x184e76(this['locale']);return _0x464588['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x5c8fd7['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x2a3d53=>!_0x2a3d53)]},'children':[_0x464588]}),_0x5c8fd7;}}const $=0xa;class Q extends _0x575928{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'](_0x473b5f){const {id:_0x15052d}=this['_currentConfig']??{};this['_currentConfig']=_0x473b5f;const {id:_0x3c3e28}=this['_currentConfig'];this['isOpen']&&_0x15052d===_0x3c3e28?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x14fd8d=T(this['context'])['plugins']['get']('Dialog');_0x14fd8d['isOpen']&&this['_currentConfig']&&_0x14fd8d['id']===this['_currentConfig']['id']&&_0x14fd8d['hide']();}['_updateDialog'](){const _0x598ce7=T(this['context'])['plugins']['get']('Dialog'),{icon:_0x19ec45,title:_0x19a030}=this['_currentConfig'];_0x598ce7['view']?.['headerView']&&(_0x598ce7['view']['headerView']['label']=_0x19a030,_0x598ce7['view']['headerView']['iconView']&&_0x19ec45&&(_0x598ce7['view']['headerView']['iconView']['content']=_0x19ec45)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x598ce7['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](D)['showFakeVisualSelection'](this['_currentConfig']['ranges'],'ai-balloon-'+this['_currentConfig']['index'],!0x0,!0x0);}['_hideFakeVisualSelection'](_0x2e3109){this['context']['plugins']['get'](D)['hideFakeVisualSelection']('ai-balloon-'+_0x2e3109);}['_showDialog'](){const _0x2ed6ea=T(this['context'])['plugins']['get']('Dialog'),{id:_0x250a1c,title:_0x36e163,icon:_0x135165,class:_0x5c9f22,mainView:_0x45df9b}=this['_currentConfig'];_0x45df9b['delegate'](...F)['to'](this),_0x2ed6ea['show']({'title':_0x36e163,'icon':_0x135165,'hasCloseButton':!0x0,'id':_0x250a1c,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x5c9f22||''),'content':_0x45df9b,'onShow':_0x2a5c2c=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x1a540d=this['_getSelectionElements']();_0x1a540d&&_0x1a540d[0x0]&&_0x538b49({'target':_0x1a540d[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x2a5c2c['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x250a1c});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](this['_currentConfig']['index']),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x250a1c}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x274f6b,_0x5df5be){if(!_0x5df5be)return null;const _0x190573=this['_getSelectionElements']();if(!_0x190573||0x0===_0x190573['length'])return{'left':Math['round'](_0x5df5be['left']+_0x5df5be['width']/0x2-_0x274f6b['width']/0x2),'top':Math['round'](_0x5df5be['top']+_0x5df5be['height']/0x2-_0x274f6b['height']/0x2)};const _0x1f5785=Math['round'](_0x5df5be['left']+_0x5df5be['width']/0x2-_0x274f6b['width']/0x2),_0x4903b9=_0x190573['map'](_0x399acc=>new _0x5b8f6e(_0x399acc)),_0x2a2d16=_0x274f6b['height'];return{'left':_0x1f5785,'top':this['_calculateOptimalTopPosition'](_0x4903b9,_0x2a2d16,_0x5df5be)};}['_calculateOptimalTopPosition'](_0x15d9d7,_0x2345c5,_0x14d761){const _0x3c9af6=new _0x5b8f6e(_0x28fe94['window']),_0x2c5d57=_0x15d9d7['map'](_0x51375c=>_0x51375c['getVisible']())['filter'](_0x265de0=>_0x265de0),_0x105687=_0x5b8f6e['getBoundingRect'](_0x2c5d57);if(!_0x105687)return Math['round'](_0x14d761['top']+_0x14d761['height']/0x2);const _0x40149b=_0x3c9af6['getIntersection'](_0x105687);if(!_0x40149b)return Math['round'](_0x14d761['top']+_0x14d761['height']/0x2);const _0x4362ed=_0x14d761['getVisible'](),_0x2fe1bc=_0x4362ed&&_0x105687['height']>_0x4362ed['height'],_0x4c5555=_0x40149b['top'],_0x2e0aa5=_0x40149b['bottom'];if(_0x2fe1bc){const _0x1ab7ef=(_0x4362ed||_0x3c9af6)['height']/0x2-_0x2345c5/0x2,_0x58a6ba=_0x4c5555-$-_0x14d761['top'],_0x25563e=_0x14d761['bottom']-_0x2e0aa5-$;return _0x58a6ba>=_0x2345c5?Math['max']($,_0x4c5555-_0x2345c5-$):_0x25563e>=_0x2345c5?_0x2e0aa5+$:Math['max']($,_0x1ab7ef);}const _0x5d0426=_0x4c5555-_0x2345c5,_0x3e6225=_0x14d761['bottom']-_0x2e0aa5-$,_0x2fd84b=_0x4c5555-$-_0x14d761['top'];let _0x28c270;if(_0x3e6225>=_0x2345c5)_0x28c270=_0x2e0aa5+$;else{if(_0x2fd84b>=_0x2345c5)_0x28c270=_0x5d0426-$;else _0x28c270=_0x4c5555+_0x105687['height']/0x2-_0x2345c5/0x2;}return _0x28c270;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x41deca=T(this['context']);this['listenTo'](_0x41deca['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x3871e0,data:{newRange:_0x1d33c3}}of _0x41deca['model']['document']['differ']['getChangedMarkers']())if(_0x3871e0['startsWith'](R+':')&&(_0x1d33c3&&(_0x1d33c3['start']['isEqual'](_0x1d33c3['end'])||'$graveyard'==_0x1d33c3['root']['rootName'])||null==_0x1d33c3)){const _0x702616=i(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x702616),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x1905e9=T(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x1905e9['model']['document']);}['_getSelectionElements'](){const _0x37bf5f=T(this['context']);return _0x450a79(_0x37bf5f['editing'],[..._0x37bf5f['model']['markers']['getMarkersGroup']('ai-selection'),..._0x37bf5f['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class us extends _0x178dcf{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x302e67,_0x155b1e={}){super(_0x302e67),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x155b1e};const _0x265bdb=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x265bdb?'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'](_0x52d613){this['showChangesButton']['isEnabled']=_0x52d613;}['_setupRatingButtons'](){this['likeButton']=new _0x1e9460(this['locale']),this['likeButton']['set']({'icon':_0x16e3fe,'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 _0x1e9460(this['locale']),this['dislikeButton']['set']({'icon':_0x46fa26,'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 _0x1e9460(this['locale']),this['copyButton']['set']({'icon':_0xb692f9,'label':i(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x5375c2=new _0xc034b();_0x5375c2['set']({'content':_0xa54ca6}),_0x5375c2['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'](_0x5375c2);}['_setupShowChangesButton'](){this['showChangesButton']=new _0x1e9460(this['locale']),this['showChangesButton']['set']({'icon':_0x196b91,'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',_0x52b7e0=>_0x52b7e0?_0x3d498c:_0x196b91),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(_0x1c15bb,_0xa9420d){super(_0x1c15bb);const _0x2a5f2b=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new _0x22c832(),this['_keystrokes']=new _0x2b0c94(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x56c0d3({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0xa9420d,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new as(_0x1c15bb),this['_partToolbarView']=new cs(_0x1c15bb,_0xa9420d['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0xa9420d),this['_stateView']=new ws(_0x1c15bb),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new us(_0x1c15bb,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new ms(_0x1c15bb,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x5c5511,_0xc27bc9,_0x2ec842,_0xa3b86d)=>{let _0x36a203,_0x50391f;'pending'===_0xa3b86d?(_0x36a203=this['_partToolbarView'],_0x50391f=this['_stateView']):(_0x36a203=this['_stateView'],_0x50391f=this['_partToolbarView']),this['_stateView']['setState'](_0x2ec842),_0x36a203['isVisible']=!0x1,_0x50391f['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x2a5f2b['to']('_state',_0x949a2e=>'ck-ai-chat-balloon-main_state_'+_0x949a2e)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0xa9420d);});}['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'](_0x452858){_0x452858?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x452858);}['setState'](_0x4e6d74){this['_state']=_0x4e6d74;}['showError'](_0x36efb0){super['showError'](_0x36efb0),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x3dab58){super['showBlockingError'](_0x3dab58),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x5c599a){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x5c599a;}['togglePartToolbarEnabled'](_0x503ba3){this['_partToolbarView']['isEnabled']=_0x503ba3;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x1bafce,showSuggestButton:_0x390b1a}){_0x1bafce=_0x1bafce&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x390b1a=_0x390b1a&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x1bafce,'showSuggestButton':_0x390b1a});}['_createNextButtonView'](){const _0x1bf5c9=new _0x1e9460(this['locale']);return _0x1bf5c9['set']({'icon':_0x460c5d,'label':i(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x1bf5c9['on']('execute',()=>{this['fire']('showNext');}),_0x1bf5c9;}['_createPreviousButtonView'](){const _0x15683f=new _0x1e9460(this['locale']);return _0x15683f['set']({'icon':_0x567c89,'label':i(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x15683f['on']('execute',()=>{this['fire']('showPrevious');}),_0x15683f;}}class ms extends _0x184e76{constructor(_0x3e00cd,_0x3f40e0){super(_0x3e00cd),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x3f40e0});}}class Ot extends _0x511be8{static get['requires'](){return[_0x6460a2,Q];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x172119){super(_0x172119),this['set']('showDiff',!0x1);}['open'](_0x16ca4c){const _0x2f8d19=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x2f8d19['plugins']['get']('AIBalloon')['open']({..._0x16ca4c,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x16ca4c['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x16ca4c['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x5097cd){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x5097cd);}['setState'](_0x1aca5c){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x1aca5c);}['_createChatBalloonView'](){const _0x5e0e58=this['editor'],_0x1dd160=_0x5e0e58['plugins']['get']('AIBalloon'),_0x393b79=_0x5e0e58['commands']['get']('trackChanges');let _0x37aca5=_0x5e0e58['config']['get']('ai.availableReplyActions')||[...ot];_0x5e0e58['plugins']['has']('TrackChanges')||(_0x37aca5=_0x37aca5['filter'](_0x39c9d2=>'insertSuggestion'!=_0x39c9d2));const _0x157cc8=new lt(_0x5e0e58['locale'],{'availableActions':_0x37aca5,'showApplyButton':!0x0,'showSuggestButton':!!_0x393b79});return _0x157cc8['bind']('showDiff')['to'](this),_0x157cc8['delegate'](...ut)['to'](this),_0x157cc8['delegate']('showPrevious','showNext')['to'](this),_0x1dd160['delegate']('dialogClosed')['to'](this),_0x157cc8['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x157cc8['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x157cc8['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x393b79&&_0x157cc8['bind']('isTrackChangesOn')['to'](_0x393b79,'value'),_0x157cc8['render'](),_0x157cc8;}['_toggleRotatorButtonsInDialogHeader'](_0x1f395a){const _0x3c2540=this['editor'],_0xf89631=_0x3c2540['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x1f395a),_0xf89631['has'](this['_chatBalloonView']['previousButtonView'])||(_0xf89631['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x3c2540['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0xf89631['remove'](this['_chatBalloonView']['previousButtonView']),_0xf89631['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class Ba extends _0x511be8{static get['requires'](){return[qt,Ot,zt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Zt(_0x3f10cd){const {editor:_0x118b37,action:_0x17a994,withText:_0x2feeaa=!0x1,withIcon:_0x2140e4=!0x0,isInDropdown:_0x47cf87=!0x0,shouldPreventFocus:_0x4c6db9=!0x1}=_0x3f10cd;return()=>{const _0x1aba0d=_0x118b37['locale'],_0x342459=new _0x1e9460(_0x1aba0d),_0x373d08=_0x342459['bindTemplate'];_0x47cf87&&_0x342459['extendTemplate']({'on':{'mouseenter':_0x373d08['to'](()=>{_0x4c6db9&&_0x4c6db9()||_0x342459['focus']();})}});const _0x5d9382=_0x17a994['icon']??_0x17a994['parent']?.['icon'];return _0x342459['set']({'label':_0x17a994['displayedPrompt'],'withText':_0x2feeaa,'role':'menuitem','icon':_0x2140e4?_0x5d9382??_0x363d5b:void 0x0,'tooltip':!_0x2feeaa,'class':'ck-ai-quick-actions-button','isEnabled':_0x17a994['isEnabled']}),_0x342459['on']('execute',()=>{_0x118b37['editing']['view']['focus'](),_0x118b37['commands']['execute']('aiQuickAction',_0x17a994);}),_0x342459;};}class Ps extends _0x8cf39b{['arrowView'];constructor(_0x37517e,_0x11fd65){super(_0x37517e,_0x11fd65);const _0x470438=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',_0x5bd19b=>String(_0x5bd19b)),'data-cke-tooltip-disabled':_0x470438['to']('isOn')},'on':{'mouseenter':_0x470438['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x2fc929=new _0xc034b();return _0x2fc929['content']=_0xd17942,_0x2fc929['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x2fc929;}}class Ls extends _0x35cdc6{['_allListItems'];['_allSearchableItems'];constructor(_0x348ca9,_0x37bd65,_0x3e57b4){super(_0x348ca9),this['_allListItems']=_0x37bd65,this['_allSearchableItems']=_0x3e57b4;}['filter'](_0x35152d){if(!_0x35152d)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x510d16=_0x35152d['source']['toLowerCase']()['trim'](),_0x5e92ff=this['_allSearchableItems']['filter'](_0x3577d0=>(_0x3577d0['groupLabel']?_0x3577d0['label']+'\x20('+_0x3577d0['groupLabel']+')':_0x3577d0['label'])['toLowerCase']()['includes'](_0x510d16));return this['items']['clear'](),this['items']['addMany'](_0x5e92ff['sort']((_0x3d660c,_0x11b23d)=>{const _0x84055d=_0x3d660c['groupLabel'],_0x2dd1f2=_0x11b23d['groupLabel'];return _0x84055d||_0x2dd1f2?_0x84055d?0x1:-0x1:0x0;})['map'](_0x5e3b70=>_0x5e3b70['item'])),this['_highlightQuery'](_0x510d16,_0x5e92ff),{'resultsCount':_0x5e92ff['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x32088e,_0x4dfbc9){if(!_0x32088e)return;const _0x39ec9a=new RegExp(_0x3383a1(_0x32088e),'gi');_0x4dfbc9['forEach'](_0x48baba=>{_0x48baba['highlightViews']&&_0x48baba['highlightViews']['forEach'](_0x495100=>{'function'==typeof _0x495100['highlightText']&&_0x495100['highlightText'](_0x39ec9a);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x2ee50a=>{_0x2ee50a['highlightViews']&&_0x2ee50a['highlightViews']['forEach'](_0x163913=>{'function'==typeof _0x163913['highlightText']&&_0x163913['highlightText'](null);});});}}const Qs='menu',Gs='menuitem';class co extends _0x184e76{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x3fc7d8,_0x4f52d5,_0xb4724f,_0x3190a5,_0xb0fb69=!0x1){const _0x2b0872=_0x3fc7d8['locale'];super(_0x2b0872),this['_bodyCollection']=_0x3190a5,this['_hasSearch']=_0xb0fb69;const _0x5ebd10=this['_createListItems'](_0x3fc7d8,_0x4f52d5,_0xb4724f);this['optionsListView']=new Ls(_0x2b0872,_0x5ebd10,this['_allSearchableItems']),this['optionsListView']['role']=Qs,this['optionsListView']['items']['addMany'](_0x5ebd10),this['focusTracker']=new _0x22c832(),this['keystrokes']=new _0x2b0c94(),_0xb0fb69&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x5ebd10,this['focusCycler']=new _0x56c0d3({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0xb0fb69&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x16943e=_0xb0fb69&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x4e90c7(_0x16943e),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x2b0872['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x46980e(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 _0x530824=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x530824);}['_createListItems'](_0x2504f5,_0x331ff6,_0x51f31e){const _0x2090b5=new _0x4e90c7();return _0x331ff6['forEach'](_0x250eee=>{if('actions'in _0x250eee){const {listItem:_0x6feba3}=this['_createActionGroupButton'](_0x2504f5,_0x250eee,_0x51f31e);_0x2090b5['add'](_0x6feba3),_0x250eee['actions']['forEach'](_0x44ad3f=>{this['_createActionButton'](_0x2504f5,_0x44ad3f,_0x250eee['label'],_0x250eee['icon']);const {listItem:_0x5e5672,highlightViews:_0x5e2708}=this['_createSearchResultActionButton'](_0x2504f5,_0x44ad3f,_0x250eee['label'],_0x250eee['icon']);this['_allSearchableItems']['push']({'item':_0x5e5672,'label':_0x44ad3f['displayedPrompt'],'groupLabel':_0x250eee['label'],'highlightViews':_0x5e2708});});}else{const {listItem:_0x50ac4b}=this['_createActionButton'](_0x2504f5,_0x250eee);_0x2090b5['add'](_0x50ac4b);const _0x299d8e=_0x50ac4b['children']['first'];if(_0x299d8e){const {listItem:_0x7479f3,highlightViews:_0x5d608d}=this['_createSearchResultActionButton'](_0x2504f5,_0x250eee);this['_allSearchableItems']['push']({'item':_0x7479f3,'label':_0x299d8e['label']||'','highlightViews':_0x5d608d});}}}),_0x2090b5;}['_createActionButton'](_0x204c5b,_0x294a1c,_0x33c001,_0x33318b){const _0x21da47=new _0x4ffa3a(this['locale']);if(_0x33c001&&_0x33318b){const _0xb24403=new _0x1e9460(this['locale']),_0xb92e37=_0xb24403['bindTemplate'],_0xfdfe37=new _0x56f45c();_0xfdfe37['text']=_0x294a1c['displayedPrompt'];const _0x3e3d03=new _0x56f45c();_0x3e3d03['text']=_0x33c001;const _0x30e327=new _0xc034b();_0x30e327['content']=_0x33318b,_0x30e327['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x20c210=new _0x184e76(this['locale']);_0x20c210['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x266b07=new _0x184e76(this['locale']);return _0x266b07['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0xb24403['set']({'label':_0x294a1c['displayedPrompt']+'\x20('+_0x33c001+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0xb24403['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':[_0xfdfe37,_0x20c210,_0x30e327,_0x3e3d03,_0x266b07],'on':{'mouseenter':_0xb92e37['to'](()=>{this['_isSearchFocused']()||_0xb24403['focus']();}),'click':_0xb92e37['to'](()=>{_0xb24403['fire']('execute');})}}),_0xb24403['on']('execute',()=>{_0x204c5b['editing']['view']['focus'](),_0x204c5b['commands']['execute']('aiQuickAction',_0x294a1c);}),_0x21da47['children']['add'](_0xb24403),{'listItem':_0x21da47,'highlightViews':[_0xfdfe37,_0x3e3d03]};}{const _0x4e6dfb=new _0x32742a(),_0x14ea7d=new _0x1e9460(this['locale'],_0x4e6dfb),_0x498efe=_0x14ea7d['bindTemplate'],_0x306916=_0x294a1c['icon']??_0x294a1c['parent']?.['icon'],_0x297a2a=void 0x0!==_0x294a1c['icon'];return _0x14ea7d['set']({'label':_0x294a1c['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':_0x297a2a?_0x306916??_0x363d5b:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x14ea7d['extendTemplate']({'on':{'mouseenter':_0x498efe['to'](()=>{this['_isSearchFocused']()||_0x14ea7d['focus']();})}}),_0x14ea7d['on']('execute',()=>{_0x204c5b['editing']['view']['focus'](),_0x204c5b['commands']['execute']('aiQuickAction',_0x294a1c);}),_0x21da47['children']['add'](_0x14ea7d),{'listItem':_0x21da47,'highlightViews':[_0x4e6dfb]};}}['_createSearchResultActionButton'](_0x15ee6f,_0x2a1332,_0x30e81d,_0x234ed0){return _0x30e81d&&_0x234ed0?this['_createSearchResultGroupedActionButton'](_0x15ee6f,_0x2a1332,_0x30e81d,_0x234ed0):this['_createSearchResultIndividualActionButton'](_0x15ee6f,_0x2a1332);}['_createSearchResultGroupedActionButton'](_0x47aee3,_0x23fe30,_0x135ccf,_0x5bbf87){const _0x28f261=new _0x4ffa3a(this['locale']),_0x1a12f3=new _0x1e9460(this['locale']),_0x4b8ca3=_0x1a12f3['bindTemplate'],{view:_0x5854bd,highlightView:_0x4e266b}=this['_createSearchResultGroupRow'](_0x135ccf,_0x5bbf87),{view:_0x270dae,highlightView:_0x5a6862}=this['_createSearchResultActionRow'](_0x23fe30['displayedPrompt']),_0x30da90=this['_createSearchResultContentView'](_0x5854bd,_0x270dae);return _0x1a12f3['set']({'label':_0x23fe30['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}),_0x1a12f3['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':[_0x30da90],'on':{'mouseenter':_0x4b8ca3['to'](()=>{this['_isSearchFocused']()||_0x1a12f3['focus']();}),'click':_0x4b8ca3['to'](()=>{this['_handleSearchResultButtonClick'](_0x1a12f3);})}}),this['_setupActionButtonExecution'](_0x1a12f3,_0x47aee3,_0x23fe30),_0x28f261['children']['add'](_0x1a12f3),{'listItem':_0x28f261,'highlightViews':[_0x4e266b,_0x5a6862]};}['_createSearchResultIndividualActionButton'](_0x44d694,_0x6f99d9){const _0x58cac1=new _0x4ffa3a(this['locale']),_0x2e171c=new _0x32742a(),_0x5b391a=new _0x1e9460(this['locale'],_0x2e171c),_0x1c02f4=_0x5b391a['bindTemplate'];return _0x5b391a['set']({'label':_0x6f99d9['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x5b391a['extendTemplate']({'on':{'mouseenter':_0x1c02f4['to'](()=>{this['_isSearchFocused']()||_0x5b391a['focus']();})}}),this['_setupActionButtonExecution'](_0x5b391a,_0x44d694,_0x6f99d9),_0x58cac1['children']['add'](_0x5b391a),{'listItem':_0x58cac1,'highlightViews':[_0x2e171c]};}['_createSearchResultGroupRow'](_0x4bb6d5,_0x277aef){const _0x1d6f9d=new _0x184e76(this['locale']),_0x16e1a6=new _0xc034b();_0x16e1a6['content']=_0x277aef,_0x16e1a6['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x3dedf8=new _0x56f45c();return _0x3dedf8['text']=_0x4bb6d5,_0x1d6f9d['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x16e1a6,_0x3dedf8]}),{'view':_0x1d6f9d,'highlightView':_0x3dedf8};}['_createSearchResultActionRow'](_0x380f1d){const _0x1e2984=new _0x184e76(this['locale']),_0x1c06cf=new _0x56f45c();return _0x1c06cf['text']=_0x380f1d,_0x1e2984['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x1c06cf]}),{'view':_0x1e2984,'highlightView':_0x1c06cf};}['_createSearchResultContentView'](_0x1817eb,_0xf88fd2){const _0x44c919=new _0x184e76(this['locale']);return _0x44c919['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x1817eb,_0xf88fd2]}),_0x44c919;}['_setupActionButtonExecution'](_0x4230e3,_0x5b43d7,_0x349772){_0x4230e3['on']('execute',()=>{_0x5b43d7['editing']['view']['focus'](),_0x5b43d7['commands']['execute']('aiQuickAction',_0x349772);});}['_createActionGroupButton'](_0x112b20,_0x133b99,_0xb5adee){const _0x3c4024=new _0x4ffa3a(this['locale']),_0x50535f=new _0x32742a(),_0xb58c9=new Ps(this['locale'],_0x50535f),_0x27c2b3=_0xb58c9['bindTemplate'],_0x1e4052=this['_getPanelKeystroke'](_0xb5adee),_0x4db8a5=this['_createGroupActionsList'](_0x112b20,_0x133b99['actions'],_0xb5adee);_0xb58c9['set']({'label':_0x133b99['label'],'withText':!0x0,'role':Gs,'icon':_0x133b99['icon']??_0x363d5b,'isEnabled':_0x133b99['actions']['some'](_0x735013=>_0x735013['isEnabled'])}),_0xb58c9['extendTemplate']({'on':{'mouseenter':_0x27c2b3['to'](()=>{this['_isSearchFocused']()||_0xb58c9['focus']();})}});const _0x7b9e07=new _0x2fff3d(this['locale']);return _0x7b9e07['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x27c2b3['to'](_0x294b79=>{this['_handlePanelKeydown'](_0x294b79,_0x1e4052,_0xb58c9,_0x7b9e07);})}}),_0xb58c9['bind']('isOn')['to'](_0x7b9e07,'isVisible'),this['_bodyCollection']['add'](_0x7b9e07),_0x7b9e07['content']['add'](_0x4db8a5),this['_setupGroupMenuBehavior'](_0xb58c9,_0x7b9e07),_0x3c4024['children']['add'](_0xb58c9),{'listItem':_0x3c4024,'highlightView':_0x50535f};}['_createGroupActionsList'](_0x4166ec,_0x7ce62e,_0x12e859){const _0x4d392e=new _0x35cdc6(this['locale']);return _0x4d392e['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x7ce62e['forEach'](_0x548ad4=>{const _0x2a9efc=new _0x4ffa3a(this['locale']),_0x5ac6d5=Zt({'editor':_0x4166ec,'action':_0x548ad4,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x2a9efc['children']['add'](_0x5ac6d5),_0x12e859['focusTracker']['add'](_0x5ac6d5),_0x4d392e['items']['add'](_0x2a9efc);}),_0x4d392e;}['_setupGroupMenuBehavior'](_0x2b3e7a,_0x2fa78d){const _0x13f617=_0x2b3e7a['bindTemplate'],_0x470f63=this['_getButtonKeystroke'](_0x2b3e7a);_0x2b3e7a['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x13f617['to'](()=>{this['_showNestedPanel'](_0x2fa78d,_0x2b3e7a);}),'mouseleave':_0x13f617['to'](_0x226b85=>{const _0x5305ee=_0x226b85['relatedTarget'];this['_isMovingToNestedMenu'](_0x5305ee,_0x2fa78d)||this['_hideNestedPanel'](_0x2fa78d);}),'keydown':_0x13f617['to'](_0x23d674=>{_0x23d674['key']==_0x470f63&&(this['_showNestedPanel'](_0x2fa78d,_0x2b3e7a),_0x2fa78d['content']['get'](0x0)['focus']());})}}),_0x2fa78d['on']('render',()=>{_0x2fa78d['element']?.['addEventListener']('mouseleave',_0xf8c677=>{const _0x49c66f=_0xf8c677['relatedTarget'];_0x2b3e7a['element']?.['contains'](_0x49c66f)||this['_isMovingToNestedMenu'](_0x49c66f,_0x2fa78d)||this['_hideNestedPanel'](_0x2fa78d);});});}['_showNestedPanel'](_0x4657d4,_0x1a4779){this['_openNestedPanels']['forEach'](_0x68ea3e=>{_0x68ea3e!==_0x4657d4&&_0x68ea3e['isVisible']&&_0x68ea3e['hide']();}),_0x4657d4['show'](),_0x4657d4['pin']({'positions':[_0x291da6['eastSouth']],'target':_0x1a4779['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x4657d4);}['_hideNestedPanel'](_0x4d8c7e){_0x4d8c7e['hide'](),this['_openNestedPanels']['delete'](_0x4d8c7e);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x3461cd=>_0x3461cd['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x339734,_0x2a01a4){if(!_0x339734)return!0x1;if(_0x2a01a4['element']?.['contains'](_0x339734))return!0x0;const _0x2eaa00=_0x339734;return _0x2eaa00['closest']&&(null!==_0x2eaa00['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x2eaa00['closest']('.ck-ai-quick-actions-group-list')||null!==_0x2eaa00['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'](_0x2c6251){return'rtl'===_0x2c6251['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x1d857a){return'rtl'===_0x1d857a['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x26a11f,_0x2f8fc7,_0x10befd,_0x10e8e2){_0x26a11f['key']==_0x2f8fc7&&(_0x10befd['focus'](),this['_hideNestedPanel'](_0x10e8e2));}['_handleSearchResultButtonClick'](_0x127901){_0x127901['fire']('execute');}}function Xt(_0x53bdee){const {editor:_0x30ef0c,content:_0x1683d4,buttonDefinition:_0x1be94b,bodyCollection:_0x2d54b2,hasSearch:_0x159e80=!0x1}=_0x53bdee;return()=>{const _0x3490a0=_0x30ef0c['locale'],_0x46d5b8=_0x546896(_0x3490a0);_0x46d5b8['buttonView']['set']({'icon':_0x1be94b['icon']??_0x363d5b,'label':_0x1be94b['label'],'tooltip':!0x0}),_0x46d5b8['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x1393e8=new co(_0x30ef0c,_0x1683d4,_0x46d5b8,_0x2d54b2,_0x159e80);if(_0x46d5b8['panelView']['children']['add'](_0x1393e8),_0x159e80){const _0x4ba718='ai-quick-actions-dropdown-selection';_0x46d5b8['on']('change:isOpen',(_0x5cf86,_0x1da21a,_0x504c17)=>{if(_0x504c17){if(_0x30ef0c['plugins']['has']('AIEditing')){const _0x4c6c92=_0x30ef0c['plugins']['get'](D),_0x27fb34=_0x30ef0c['model']['document']['selection'],_0x427bde=Array['from'](_0x27fb34['getRanges']());_0x427bde['length']>0x0&&_0x4c6c92['showFakeVisualSelection'](_0x427bde,_0x4ba718,!0x1,!0x0);}}else _0x30ef0c['plugins']['has']('AIEditing')&&_0x30ef0c['plugins']['get'](D)['hideFakeVisualSelection'](_0x4ba718),_0x1393e8['resetSearch']();});}return _0x46d5b8;};}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(_0x34393e){return _0x34393e['CHAT']='CHAT',_0x34393e['ACTION']='ACTION',_0x34393e['REVIEW']='REVIEW',_0x34393e;}({}),Ga=function(_0x157f87){return _0x157f87['CHAT']='AIChat',_0x157f87['ACTION']='AIActions',_0x157f87['REVIEW']='AIReviewMode',_0x157f87;}({});class ii extends _0x511be8{static get['requires'](){return[te,q];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x297365=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x297365),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x1e4cd4){return function(_0x595e1f){const _0x33ef87=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x595e1f['uiLanguage']),_0x4da1de=_0x33ef87||'English',_0x559ae8=[{'id':'ask-ai','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Gt},{'id':'chat-commands','label':i(_0x595e1f,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Gt,'actions':[{'id':'explain','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':ee['replace']('%0',_0x4da1de),'type':'CHAT'},{'id':'summarize','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':ie['replace']('%0',_0x4da1de),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':ne['replace']('%0',_0x4da1de),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Bt},{'id':'continue','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Ft},{'id':'fix-grammar','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Wt},{'id':'adjust-length','label':i(_0x595e1f,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Kt,'actions':[{'id':'make-shorter','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':i(_0x595e1f,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Yt,'actions':[{'id':'make-tone-casual','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':i(_0x595e1f,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Vt,'actions':[{'id':'translate-to-english','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':i(_0x595e1f,'AI_QUICK_ACTIONS_OTHER'),'icon':Jt,'actions':[]}];return _0x559ae8;}(_0x1e4cd4);}async['_getDefaultAndCustomActions'](){const _0x3208b3=ii['getDefaultQuickActions'](this['editor']['locale']),_0x3d84ac=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x41e619=[];try{_0x41e619=await new It({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0x32a5a6){const _0x332462=new _0x36ca17('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x32a5a6});gt(_0x332462['message']);}finally{const _0x5e2dff=_0x3d84ac['map'](_0xec020=>({..._0xec020,'icon':void 0x0}));_0x3208b3['find'](_0x51da1f=>'other'===_0x51da1f['id'])['actions']['push'](..._0x5e2dff),_0x3208b3['forEach'](_0x533df7=>{if('actions'in _0x533df7)_0x533df7['actions']['forEach'](_0x1a9e81=>{if(_0x1a9e81['isEnabled']=!!_0x41e619['find'](_0x4f1b12=>_0x4f1b12['id']===_0x1a9e81['model'])||void 0x0===_0x1a9e81['model'],!_0x1a9e81['isEnabled']){const _0xf6051e=new _0x36ca17('ai-quick-actions-unavailable-model',this,{'actionId':_0x1a9e81['id'],'modelId':_0x1a9e81['model']});gt(_0xf6051e['message']);}});else{if(_0x533df7['isEnabled']=!!_0x41e619['find'](_0x31b52b=>_0x31b52b['id']===_0x533df7['model'])||void 0x0===_0x533df7['model'],!_0x533df7['isEnabled']){const _0x165b9b=new _0x36ca17('ai-quick-actions-unavailable-model',this,{'actionId':_0x533df7['id'],'modelId':_0x533df7['model']});gt(_0x165b9b['message']);}}});}return _0x3208b3;}['_initializeQuickActionsComponentsAndCommands'](){const _0x11df40=new _0x591ff4(this['editor']['locale']);_0x11df40['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x11df40),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x11df40);}['_initializeQuickActionsDropdown'](_0x564243){const _0x252c33=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Xt({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x363d5b,'label':i(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x564243,'hasSearch':_0x252c33}));}['_prepareQuickActionsDefinition'](_0x266d5d){this['_quickActionsDefinition']=_0x266d5d['map'](_0x387224=>{if('actions'in _0x387224){const _0x2ed3c9=_0x387224;return{..._0x2ed3c9,'actions':_0x2ed3c9['actions']['map'](_0x37a797=>{const {actions:_0x18e47d,..._0x30e767}=_0x2ed3c9;return{..._0x37a797,'parent':_0x30e767};})['filter'](_0x96b6ed=>this['_shouldIncludeAction'](_0x96b6ed))};}return _0x387224;})['filter'](_0x3e6efe=>'actions'in _0x3e6efe?_0x3e6efe['actions']['length']>0x0:this['_shouldIncludeAction'](_0x3e6efe));}['_shouldIncludeAction'](_0x5780ea){const _0x3fe9db=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ga[_0x5780ea['type']])&&!_0x3fe9db['includes'](_0x5780ea['id'])&&!('CHAT'===_0x5780ea['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x19425e){this['_quickActionsDefinition']['forEach'](_0x550865=>{if('actions'in _0x550865){const _0x5ee8b3=Xt({'editor':this['editor'],'content':_0x550865['actions'],'buttonDefinition':_0x550865,'bodyCollection':_0x19425e});this['editor']['ui']['componentFactory']['add'](_0x550865['id'],_0x5ee8b3),_0x550865['actions']['forEach'](_0x58582d=>{const _0x2c0c6a=Zt({'editor':this['editor'],'action':_0x58582d});this['editor']['ui']['componentFactory']['add'](_0x58582d['id'],_0x2c0c6a);});}else{const _0x33aa91=Zt({'editor':this['editor'],'action':_0x550865,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x550865['id'],_0x33aa91);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x3ee6fe=>{const _0x2b5c50=new _0x53e868(_0x3ee6fe),_0x5dbb2b=i(_0x3ee6fe,'AI_QUICK_ACTIONS_HEADING');_0x2b5c50['buttonView']['set']({'label':_0x5dbb2b,'icon':_0x363d5b});const _0x53f37b=new _0x685ce2(_0x3ee6fe);_0x53f37b['set']({'ariaLabel':_0x5dbb2b,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0xdac847=>{if('actions'in _0xdac847){const _0x4caf2f=_0xdac847,_0x18abfc=new _0x217236(_0x3ee6fe,_0x2b5c50),_0x5ad147=new _0x53e868(_0x3ee6fe),_0x391cc6=new _0x685ce2(_0x3ee6fe);_0x5ad147['buttonView']['set']({'label':_0x4caf2f['label'],'icon':_0x4caf2f['icon']}),_0x4caf2f['actions']['forEach'](_0x47c156=>{const _0x3f1c21=new _0x217236(_0x3ee6fe,_0x5ad147),_0x18a9b2=new _0x12221a(_0x3ee6fe);_0x18a9b2['set']({'label':_0x47c156['displayedPrompt'],'icon':_0x47c156['icon'],'role':'menuitem','isEnabled':_0x47c156['isEnabled']}),_0x18a9b2['on']('execute',()=>{this['_executeQuickAction'](_0x47c156);}),_0x18a9b2['delegate']('execute')['to'](_0x5ad147),_0x3f1c21['children']['add'](_0x18a9b2),_0x391cc6['items']['add'](_0x3f1c21);}),_0x5ad147['panelView']['children']['add'](_0x391cc6),_0x18abfc['children']['add'](_0x5ad147),_0x53f37b['items']['add'](_0x18abfc);}else{const _0x57cf01=_0xdac847,_0x245956=new _0x217236(_0x3ee6fe,_0x2b5c50),_0x2ae0b3=new _0x12221a(_0x3ee6fe);_0x2ae0b3['set']({'label':_0x57cf01['displayedPrompt'],'icon':_0x57cf01['icon'],'role':'menuitem','isEnabled':_0x57cf01['isEnabled']}),_0x2ae0b3['on']('execute',()=>{this['_executeQuickAction'](_0x57cf01);}),_0x2ae0b3['delegate']('execute')['to'](_0x2b5c50),_0x245956['children']['add'](_0x2ae0b3),_0x53f37b['items']['add'](_0x245956);}});const _0x484f6c=Object['values'](Ga)['some'](_0x637468=>this['editor']['plugins']['has'](_0x637468));return _0x2b5c50['set']({'isEnabled':_0x484f6c}),_0x2b5c50['panelView']['children']['add'](_0x53f37b),_0x2b5c50;});}['_executeQuickAction'](_0x3ab271){const _0x11c246=this['editor'];_0x11c246['editing']['view']['focus'](),_0x11c246['commands']['execute']('aiQuickAction',_0x3ab271);const _0x342cb6=_0x11c246['ui']['view']['menuBarView'];_0x342cb6&&_0x342cb6['close']&&_0x342cb6['close']();}}class ci extends Lt{['execute'](_0x557829){switch(this['_expandSelectionIfCollapsed'](),_0x557829['type']){case Qt['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x44a046=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x36ca17('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x44a046});}this['_handleAIChatAction'](_0x557829);break;case Qt['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x3bb417=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x36ca17('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x3bb417});}this['_handleAIActionsAction'](_0x557829);break;case Qt['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0xd4e9e0=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x36ca17('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0xd4e9e0});}this['_handleAIReviewAction'](_0x557829);}}async['_handleAIChatAction'](_0x237546){const _0x4e8524=this['editor']['plugins']['get']('AIChat'),_0x5c5ec8=this['editor']['plugins']['get']('AIChatController'),_0x167733=this['editor']['plugins']['get']('AITabs')['view'];if(_0x167733['isVisible']||(_0x167733['isVisible']=!0x0),'chat'!==_0x167733['activeTab']&&_0x167733['activateTab']('chat'),'ask-ai'===_0x237546['id'])_0x5c5ec8['removeSelectionFromChatContext'](),await _0x4e8524['addSelectionToChatContext'](),_0x4e8524['focusPromptInput']();else await _0x4e8524['startConversation'](),_0x5c5ec8['removeSelectionFromChatContext'](),await _0x4e8524['addSelectionToChatContext'](),_0x4e8524['focusPromptInput'](),await _0x4e8524['sendMessage']({'message':_0x237546['prompt']||_0x237546['displayedPrompt'],'attributes':{'quickActionData':{'id':_0x237546['id']},'displayedPrompt':_0x237546['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x34aaca=this['editor'],_0x354ff1=_0x34aaca['model']['document']['selection'];if(!_0x354ff1['isCollapsed'])return;const _0x1f752f=_0x17af57(_0x354ff1['getSelectedBlocks']())||_0x34aaca['model']['schema']['getLimitElement'](_0x354ff1);_0x34aaca['model']['change'](_0x42453a=>{_0x42453a['setSelection'](_0x1f752f,'in');});}['_handleAIActionsActionLabel'](_0x9b832e){return _0x9b832e['parent']?.['label']&&'other'!==_0x9b832e['parent']?.['id']?_0x9b832e['parent']['label']+':\x20'+_0x9b832e['displayedPrompt']:_0x9b832e['displayedPrompt'];}async['_handleAIActionsAction'](_0x15669c){const _0x6e2053=this['editor']['plugins']['get']('AIActions'),_0x6b228d=_0x15669c['prompt']?{'userMessage':_0x15669c['prompt'],'model':_0x15669c['model']}:{'actionName':_0x15669c['actionName']||_0x15669c['id'],'args':_0x15669c['args']},_0x55cfad=this['_handleAIActionsActionLabel'](_0x15669c);await _0x6e2053['executeAction'](_0x6b228d,_0x55cfad,_0x15669c['icon']);}async['_handleAIReviewAction'](_0x163525){console['log']('handleAIReviewAction',_0x163525);}}class ti extends _0x511be8{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x538334=this['editor'],_0x2ad310=new ci(this['editor']);if(_0x538334['commands']['add']('aiQuickAction',_0x2ad310),_0x538334['plugins']['has']('AIChat')){const _0x3ebef5=this['editor']['plugins']['get']('AIChat');_0x538334['model']['document']['selection']['on']('change:range',(_0x7fd2a9,_0x13d00e)=>{_0x13d00e['directChange']&&_0x3ebef5['removeSelectionFromChatContext']();});}}}class De extends Ge{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x5b8039=this['documentContextContent']['children']['map'](_0x371237=>({'node':_0x371237,'id':At(_0x371237,'data-id')})),_0x31f78b=this['parsedMergedContent']['children']['map'](_0x2e8a75=>({'node':_0x2e8a75,'id':At(_0x2e8a75,'data-id')||_0x926b30()})),_0x363a68=_0x148630(_0x5b8039,_0x31f78b,{'comparator':(_0x4a4253,_0x1fdd70)=>_0x4a4253['id']==_0x1fdd70['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x363a68['length']&&_0x363a68[_0x363a68['length']-0x1]['removed'];)_0x363a68['pop']();}const _0x260176=_0x363a68['map'](_0xa9d484=>{const _0xe24e4d=_0xa9d484['added']?'new':_0xa9d484['removed']?'removed':'modified';return{'node':_0xa9d484['value'][0x0]['node'],'type':_0xe24e4d,'id':_0xa9d484['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x260176,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x2d2e61,_0x3858e1){return _0x3858e1;}}class W extends xe{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x5351e2){super(_0x5351e2),this['content']=_0x5351e2['content'],this['version']=_0x5351e2['version'],this['actionName']=_0x5351e2['actionName'],this['args']=_0x5351e2['args'],this['userMessage']=_0x5351e2['userMessage'],this['model']=_0x5351e2['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'](_0x4c72fd){const _0x57acbe=new De({'editor':this['editor'],'documentContextContent':this['content'],..._0x4c72fd});return this['replies']['push'](_0x57acbe),_0x57acbe['delegate'](...ye)['to'](this),this['fire']('replyCreated',_0x57acbe),_0x57acbe;}}class Bn extends _0x178dcf{constructor(_0x35158b,_0xf870aa=!0x0,_0x9a6a4d=!0x0){super(_0x35158b),this['set']('isEnabled',!0x1),_0xf870aa&&(this['applyButton']=this['_createButton'](i(_0x35158b,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x9a6a4d&&(this['suggestButton']=this['_createButton'](i(_0x35158b,'AI_BALLOON_SUGGEST_BUTTON'),_0xf870aa?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0xf870aa,'showSuggestButton':_0x9a6a4d}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x4e9853,showSuggestButton:_0x49d8eb}){this['applyButton']&&(this['applyButton']['isVisible']=_0x4e9853),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x49d8eb);}['_createButton'](_0x3935b8,_0x105c94){const _0x5bd70c=new _0x1e9460(this['locale']);return _0x5bd70c['set']({'label':_0x3935b8,'class':_0x105c94,'isVisible':!0x0,'withText':!0x0}),_0x5bd70c;}}class yn extends _0x184e76{constructor(_0x3cfaf7){super(_0x3cfaf7),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(_0x3cfaf7,'AI_DISCLAIMER_TEXT')}]}]});}}class Nn extends _0x184e76{constructor(_0x11706b){super(_0x11706b),this['set']('isVisible',!0x0);const _0x3075a4=new li('small');_0x3075a4['isVisible']=!0x0;const _0x4c71e5=new _0x184e76(this['locale']);_0x4c71e5['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',_0x553e0b=>!_0x553e0b)]},'children':[_0x3075a4,_0x4c71e5]});}}class rt extends ls{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x402bca,_0x2fc149){super(_0x402bca),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x2fc149,this['_focusTracker']=new _0x22c832(),this['_keystrokes']=new _0x2b0c94(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x56c0d3({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x4e90c7(),this['_addContentWrapper'](_0x2fc149),this['_addDisclaimerView'](),this['_addToolbar'](_0x2fc149),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'](_0x2fc149);});}['render'](){super['render']();for(const _0x100e81 of this['_focusables'])this['_focusTracker']['add'](_0x100e81['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x4df820){-0x1===_0x4df820?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x37cce0){this['_isLoading']=_0x37cce0;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x3eed70){super['showError'](_0x3eed70),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x1be2b6){super['showBlockingError'](_0x1be2b6),this['setErrorState']();}['addMiniToolbarItem'](_0x57b673){this['_miniToolbarView']['items']['has'](_0x57b673)||this['_miniToolbarView']['items']['add'](_0x57b673);}['removeMiniToolbarItem'](_0x242eb9){this['_miniToolbarView']['items']['has'](_0x242eb9)&&this['_miniToolbarView']['items']['remove'](_0x242eb9);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x3c0f15,showSuggestButton:_0x4a0a07}){_0x3c0f15=_0x3c0f15&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x4a0a07=_0x4a0a07&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x3c0f15,'showSuggestButton':_0x4a0a07});}async['updateContent'](_0x2bede0){await this['_streamableContentView']['update'](_0x2bede0);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x14f9f9){this['_contentWrapper']=new _0x184e76(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'](_0x14f9f9['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new yn(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x29b26e,showSuggestButton:_0x500088}){this['_toolbarView']=new Bn(this['locale'],_0x29b26e,_0x500088),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',(_0x40e8ab,_0x1fae43,_0x59ab52)=>!(_0x40e8ab||_0x1fae43||_0x59ab52)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x29b26e,'showSuggestButton':_0x500088}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x6ae52f){return this['_miniToolbarView']=new us(this['locale'],_0x6ae52f),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',(_0x4cbe62,_0x375df2)=>!(_0x4cbe62||_0x375df2)),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 _0x23c1a5=new _0x1e9460(this['locale']),_0x18f651=new _0x1e9460(this['locale']),_0x4de70b=new Ln(this['locale']),_0x333eac=new _0x1e9460(this['locale']);_0x23c1a5['set']({'icon':_0x3b6fc0,'label':i(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x18f651['set']({'icon':_0x29f3c3,'tooltip':i(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x333eac['set']({'icon':_0x3a3110,'tooltip':i(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x23c1a5['bind']('isEnabled')['to'](this,'isBusy',_0x267387=>!_0x267387),_0x23c1a5['on']('execute',()=>{this['fire']('tryAgain');}),_0x18f651['bind']('isEnabled')['to'](this,'isBusy',_0x4fef14=>!_0x4fef14),_0x18f651['on']('execute',()=>{this['fire']('showPrevious');}),_0x333eac['bind']('isEnabled')['to'](this,'isBusy',_0x4f034c=>!_0x4f034c),_0x333eac['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x18f651,this['_navigationCounter']=_0x4de70b,this['_navigationNextButton']=_0x333eac,this['_navigationTryAgainButton']=_0x23c1a5;}['updateMiniToolbarButtons'](_0x11f35a,_0x47fa8d){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x222770=_0x11f35a>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x222770){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x39d1de=_0x11f35a-_0x47fa8d;this['_navigationCounter']['setInteractionCount'](_0x39d1de+'/'+_0x11f35a),this['_navigationPreviousButton']['isEnabled']=_0x47fa8d<_0x11f35a-0x1,this['_navigationNextButton']['isEnabled']=_0x47fa8d>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'](_0xed1174){this['_isLoading']=_0xed1174;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x17995c=this['_getScrollableElement']();_0x17995c&&!this['_scrollManager']&&(this['_scrollManager']=new $e(_0x17995c));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class Ln extends _0x184e76{constructor(_0x34f59f){super(_0x34f59f);const _0x5df99d=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x5df99d['to']('interactionCount')}]});}['setInteractionCount'](_0x95d802){this['set']('interactionCount',_0x95d802);}}class ri extends _0x511be8{static get['requires'](){return[q,_0x6460a2,D,Q,_0x29a341];}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(_0x9d3409){super(_0x9d3409),this['_bodyCollection']=new _0x591ff4(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'](_0x205ac3,_0x1b589b,_0x262b52){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x397c54,anchorData:_0x3f6908}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x205ac3,_0x397c54,_0x3f6908,_0x1b589b,_0x262b52);}}const {modelFragment:_0x346497,anchorData:_0x2c57af}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x205ac3,_0x346497,_0x2c57af,_0x1b589b,_0x262b52);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x3e0d37=this['editor']['plugins']['has']('TrackChanges');let _0x1323de=this['editor']['config']['get']('ai.availableReplyActions')||[...ot];_0x3e0d37||(_0x1323de=_0x1323de['filter'](_0x509fad=>'insertSuggestion'!=_0x509fad));const _0x1acd4d=this['editor']['commands']['get']('trackChanges'),_0xe3032c=new rt(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x3e0d37,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x1323de});return _0xe3032c['bind']('isBusy')['to'](this),_0x1acd4d&&_0xe3032c['bind']('isTrackChangesOn')['to'](_0x1acd4d,'value'),_0xe3032c['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0xe3032c['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0xe3032c['on']('showNext',()=>{this['_navigateToNext']();}),_0xe3032c;}['_getExecuteDataRegular'](){const _0x2c761b=this['editor']['model']['document']['selection'];if(_0x2c761b['isCollapsed']){const _0x4d4a26=_0x17af57(_0x2c761b['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x2c761b);this['editor']['model']['change'](_0x1aa7b8=>{_0x1aa7b8['setSelection'](_0x4d4a26,'in');});}const _0x52bf7d=_0x2c761b['getFirstRange'](),_0x36be2f=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x2c761b),_0x52bf7d['start'],_0x52bf7d['end']);this['_copyMarkersToFragment'](_0x36be2f,_0x2c761b,{'isTableSelection':!0x1});const _0x256a46=_0x2c761b['getFirstRange']()['start'],_0x6a292d=new Map();let _0x3a4a69=_0x36be2f;for(let _0x4a4fd9=0x0;_0x4a4fd9<_0x256a46['path']['length'];_0x4a4fd9++)_0x6a292d['set'](_0x3a4a69,_0x256a46['path'][_0x4a4fd9]),_0x3a4a69=_0x3a4a69['getChild'](0x0);return{'modelFragment':_0x36be2f,'anchorData':_0x6a292d};}['_getExecuteDataInTable'](){const _0x378ba9=this['editor']['model']['document']['selection'],_0x3867a3=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x4d6b38=_0x378ba9['getFirstRange']()['start']['parent']['parent'],_0x556758=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x4d6b38),this['editor']['model']['createPositionAfter'](_0x4d6b38)),_0x41277a=this['_wrapWithCommonAncestors'](_0x3867a3,_0x556758['start'],_0x556758['end']);this['_copyMarkersToFragment'](_0x41277a,_0x378ba9,{'isTableSelection':!0x0});const _0x39c960=_0x378ba9['getFirstRange']()['start'],_0x1ca5af=new Map();let _0x2ffe35=_0x41277a;for(let _0x515714=0x0;_0x515714<_0x39c960['path']['length'];_0x515714++)if(_0x1ca5af['set'](_0x2ffe35,_0x39c960['path'][_0x515714]),_0x515714<_0x39c960['path']['length']-0x1)_0x2ffe35=_0x2ffe35['getChild'](0x0);else{let _0x2d0d86=_0x2ffe35['nextSibling'];for(;_0x2d0d86;)_0x1ca5af['set'](_0x2d0d86,_0x39c960['path'][_0x515714]),_0x2d0d86=_0x2d0d86['nextSibling'];}return{'modelFragment':_0x41277a,'anchorData':_0x1ca5af};}async['_executeAction'](_0x135594,_0x175281,_0x1f3fc6,_0x4c4404,_0x10dc41){const _0x4109c0=this['editor']['plugins']['get'](D),_0x272bd5=this['editor']['plugins']['get'](Q),_0x4946e8=this['editor']['model']['document']['selection'],_0x268d48=await _0x4109c0['modelToDataWithIds'](_0x175281),_0x213ebc=this['editor']['model']['document']['version'],_0x59d0da=[..._0x4946e8['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),_0x272bd5['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x4c4404,'icon':_0x10dc41||_0x363d5b,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x59d0da,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x272bd5),this['_interactionParams']={'action':_0x135594,'content':_0x268d48,'version':_0x213ebc,'aiBalloon':_0x272bd5,'modelFragment':_0x175281,'anchorData':_0x1f3fc6},this['_setupApplyListeners'](),this['listenTo'](_0x272bd5,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x272bd5,'dialogClosed',(_0x3f6b07,{id:_0x21787f})=>{if('aiActionsBalloon'===_0x21787f){if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x20798f=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x14905c=_0x20798f['changeGroups'][0x0];_0x14905c&&'pending'===_0x14905c['state']&&_0x20798f['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x272bd5);}}),this['_createInteraction'](_0x268d48,_0x213ebc,_0x272bd5,_0x135594);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x1e6bb8,anchorData:_0x371468}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x1e6bb8,_0x371468,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x1e6bb8,_0x371468,!0x0);});}['_wrapWithCommonAncestors'](_0xa9b152,_0x1d4a98,_0x22dc78){const _0x5442f0=this['editor']['model']['createRange'](_0x1d4a98,_0x22dc78)['getCommonAncestor'](),_0x341fcf=_0x5442f0['is']('documentFragment')?[]:_0x5442f0['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x341fcf['length']){const _0x501d4c=_0x341fcf['map'](_0x406107=>_0x406107['_clone'](!0x1));for(let _0x4604b9=0x1;_0x4604b9<_0x501d4c['length'];_0x4604b9++)_0x501d4c[_0x4604b9-0x1]['_appendChild'](_0x501d4c[_0x4604b9]);return _0x501d4c[_0x501d4c['length']-0x1]['_appendChild'](_0xa9b152),new tt(_0x501d4c[0x0]);}return _0xa9b152;}['_copyMarkersToFragment'](_0x1bce84,_0x4250dc,_0x417fa6={'isTableSelection':!0x1}){const _0x384f1e=this['editor']['model'],_0x4aad96=Array['from'](_0x4250dc['getRanges']()),_0x350770=_0x4250dc['getFirstRange']()['start'];for(const _0x2add03 of _0x384f1e['markers']){if(_0x2add03['name']['startsWith'](R)||!_0x2add03['affectsData'])continue;const _0x561d5c=_0x2add03['getRange']();if(!_0x4aad96['some'](_0x4073d1=>_0x4073d1['containsRange'](_0x561d5c,!0x0)))continue;const _0x2a36b4=this['_regularCalculateMarkerPath'](_0x561d5c['start'],_0x350770,_0x417fa6['isTableSelection']),_0x69325f=this['_regularCalculateMarkerPath'](_0x561d5c['end'],_0x350770,_0x417fa6['isTableSelection']),_0x173e33=_0x384f1e['createPositionFromPath'](_0x1bce84,_0x2a36b4),_0xe8baff=_0x384f1e['createPositionFromPath'](_0x1bce84,_0x69325f);if(!_0x173e33['isEqual'](_0xe8baff)){const _0x309173=_0x384f1e['createRange'](_0x173e33,_0xe8baff);_0x1bce84['markers']['set'](_0x2add03['name'],_0x309173);}}}['_regularCalculateMarkerPath'](_0x2576ee,_0x531368,_0x244ff4=!0x1){const _0x46c2bc=[..._0x2576ee['path']['slice']()];for(let _0x42faef=0x0;_0x42faef<Math['max'](_0x531368['path']['length'],_0x2576ee['path']['length']);_0x42faef++){const _0x5d656e=_0x531368['path'][_0x42faef]||0x0,_0x54a633=(_0x2576ee['path'][_0x42faef]||0x0)-_0x5d656e;if(_0x46c2bc[_0x42faef]=_0x54a633,0x0!==_0x54a633&&!_0x244ff4)break;}return _0x46c2bc;}async['_createInteraction'](_0x4f79cc,_0x4170ea,_0x1a9f64,_0x14fa8f){const _0x488e28=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x14fa8f,'content':_0x4f79cc,'version':_0x4170ea,'aiBalloon':_0x1a9f64,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x58045b=new W({'connector':this['_aiConnector'],'editor':_0x488e28,'content':_0x4f79cc,'version':_0x4170ea,..._0x14fa8f});this['_interactions']['push'](_0x58045b);const _0x407934=(_0x57137f,_0x8a8c83=!0x1,_0x2ea34d='streaming')=>this['_promiseQueue']['enqueue'](async _0x5abae2=>{try{const _0x236dc6=J({'editor':_0x488e28,'changeGroups':_0x57137f['changeGroups'],'documentContextContent':_0x57137f['documentContextContent'],'showDiff':_0x8a8c83,'trimUnchanged':!0x1});_0x236dc6['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x236dc6[0x0],'renderingStrategy':_0x2ea34d,'abortSignal':_0x5abae2});}catch(_0x4f7565){if(this['_isAbortError'](_0x4f7565))return;throw _0x4f7565;}});this['_interaction']['on']('replyCreated',(_0x1e9f49,_0x36459e)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x407934(_0x36459e)['catch'](_0x3e9a41=>{this['_isAbortError'](_0x3e9a41)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x3e9a41),this['_setErrorState'](_0x58045b));});}),this['_interaction']['on']('replyContentUpdated',(_0xb0f6f,_0x4d02ff)=>{_0x407934(_0x4d02ff)['catch'](_0x223b52=>{this['_isAbortError'](_0x223b52)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x223b52),this['_setErrorState'](_0x58045b));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x4d3171){this['_isAbortError'](_0x4d3171)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x4d3171),this['_setErrorState'](_0x58045b));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0xa3f95c,{showDiff:_0x3d427f})=>{try{this['_balloonShowDiff']=_0x3d427f;const _0x350eb6=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x350eb6&&await _0x407934(_0x350eb6,_0x3d427f,'static');}catch(_0x2e9654){this['_isAbortError'](_0x2e9654)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x2e9654),this['_setErrorState'](_0x58045b));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x250717,{reply:_0x418896})=>{const _0x5ec6e5={'positiveCount':_0x418896['changeGroups']['filter'](_0xe118f1=>'accepted'===_0xe118f1['state'])['length'],'totalCount':_0x418896['changeGroups']['length']},_0x27d28c=this['_interaction']['actionCallId'],_0x1228a8=this['_interaction']['actionName'];_0x1228a8?this['_aiConnector']['upsertAIActionRating'](_0x1228a8,_0x27d28c,_0x5ec6e5):this['_aiConnector']['upsertCustomAIActionRating'](_0x27d28c,_0x5ec6e5);}),this['_setLoadingState']();try{const _0x3b0246=await this['_interaction']['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x3b0246;}catch(_0x5a5dd6){if(this['_isAbortError'](_0x5a5dd6))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x58045b);}}['_applyChanges'](_0x2e71e7,_0x339d7f,_0x5e6c8b){const _0x5a2099=this['editor'];if(_0x5e6c8b&&!_0x5a2099['plugins']['has']('TrackChanges'))throw new _0x36ca17('ai-no-track-changes',null);const _0x574793=this['editor']['plugins']['get'](_0x29a341),_0x517cff=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x517cff||!_0x517cff['replies']['length'])return;const _0x27c7a8=_0x517cff['replies'][_0x517cff['replies']['length']-0x1],_0x26c707=_0x27c7a8['changeGroups'];_0x27c7a8['setChangeGroupState'](0x0,'accepted');let _0x297694=Z({'editor':_0x5a2099,'reply':_0x27c7a8,'interaction':_0x517cff,'groups':_0x26c707,'transform':!0x1,'documentCompare':_0x574793,'documentCompareOptions':{'anchor':_0x5a2099['model']['createPositionAt'](_0x2e71e7,0x0),'markDeletions':_0x5e6c8b}});_0x297694=this['_filterOperationsOutsideRange'](_0x297694,_0x339d7f);for(const _0x34d106 of _0x297694)this['_anchorOperation'](_0x339d7f,_0x34d106,_0x5a2099['model']['document']['getRoot']());const _0x19dd0e=_0x517cff['getDocumentContext']()['version'],_0x58bf08=_0x5a2099['model']['document']['history']['getOperations'](_0x19dd0e),_0x3fcd52={'document':_0x5a2099['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0xe5a294=nt(_0x297694,_0x58bf08,_0x3fcd52)['operationsA'];_0x5a2099['model']['change'](_0x413dde=>{if(_0x413dde['setSelection'](_0x5a2099['model']['document']['selection']['focus']),_0x5e6c8b)_0x5a2099['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0xe5a294);else{for(const _0xcc442 of _0xe5a294)_0xcc442['baseVersion']=_0x5a2099['model']['document']['version'],Y(_0x5a2099,_0xcc442),_0x413dde['batch']['addOperation'](_0xcc442),_0x5a2099['model']['applyOperation'](_0xcc442);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x75b56a,_0x3065b7){return _0x75b56a['filter'](_0x5912b5=>{if('rename'==_0x5912b5['type']){const _0x11f36d=_0x5912b5['position']['nodeAfter'];return!_0x3065b7['has'](_0x11f36d);}if(_0x5912b5['type']['indexOf']('Attribute')>-0x1){const _0x532170=_0x5912b5['range']['start']['nodeAfter'];return!_0x3065b7['has'](_0x532170);}return!0x0;});}['_anchorOperation'](_0x378249,_0x4ada2f,_0x5421dc){const _0x1d41b1=_0x4ada2f['clone']();for(const _0x25d4ac in _0x4ada2f){const _0x4beec4=_0x4ada2f[_0x25d4ac];_0x4beec4 instanceof it?_0x4ada2f[_0x25d4ac]=new it(_0x3a728f(_0x4beec4['start']),_0x3a728f(_0x4beec4['end'])):_0x4beec4 instanceof st&&(_0x4ada2f[_0x25d4ac]=_0x3a728f(_0x4beec4));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x1d41b1['type'])){if(_0x1d41b1['isDocumentOperation']=!0x1,_0x1d41b1['baseVersion']=null,'remove'==_0x1d41b1['type']){const _0x31c033=_0x1d41b1['sourcePosition'],_0x245b3c=_0x1d41b1['howMany'];new et(_0x31c033,_0x245b3c)['_execute']();}else _0x1d41b1['_execute']();}function _0x3a728f(_0x56589c){if('$graveyard'==_0x56589c['root']['rootName'])return _0x56589c;const _0x6b6b82=[];let _0x2f2c2f=_0x56589c['root'];for(let _0x2f0738=0x0;_0x2f0738<_0x56589c['path']['length'];_0x2f0738++){const _0x1c8433=_0x378249['get'](_0x2f2c2f)||0x0;_0x6b6b82[_0x2f0738]=_0x56589c['path'][_0x2f0738]+_0x1c8433,_0x2f2c2f=_0x2f2c2f['getChildAtOffset'](_0x56589c['path'][_0x2f0738]);}return new st(_0x5421dc,_0x6b6b82,_0x56589c['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x2dc352,content:_0x4d0a87,version:_0xdd5f9a,aiBalloon:_0xe6c9db}=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'](_0x4d0a87,_0xdd5f9a,_0xe6c9db,_0x2dc352)['catch'](_0x32dbc9=>{this['_isAbortError'](_0x32dbc9)||console['error']('Error\x20refreshing\x20interaction:',_0x32dbc9);});}['_isAbortError'](_0x302e91){return!!_0x302e91['message']&&_0x302e91['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 _0x3d405a=this['_interactions']['length'];this['_currentInteractionIndex']<_0x3d405a-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x2fbbf9){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x2fbbf9;const _0x1d6544=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x1d6544)return;if(_0x1d6544['hasError'])return this['_setErrorState'](_0x1d6544),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x1d6544['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x218f05=_0x1d6544['replies'][_0x1d6544['replies']['length']-0x1];if(_0x218f05){const _0x2904ac=this['editor'];try{const _0x3fec6d=J({'editor':_0x2904ac,'changeGroups':_0x218f05['changeGroups'],'documentContextContent':_0x218f05['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x540c6e=>setTimeout(_0x540c6e,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x3fec6d[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x5d820a){this['_isAbortError'](_0x5d820a)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x5d820a);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x2a3f65){const _0x52281c=i(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x52281c),_0x2a3f65['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 _0x511be8{static get['requires'](){return[ii,ti,ri];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x51e265){super(_0x51e265),_0x51e265['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class Ys extends _0x184e76{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x31a872,_0x2dcb0){super(_0x31a872),this['id']=_0x2dcb0,this['set']('status','pending'),this['set']('changeId',_0x2dcb0),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',(_0x4ce771,_0x172959)=>{_0x172959&&_0x172959['target']&&'A'===_0x172959['target']['tagName']&&_0x172959['preventDefault'](),this['fire']('activateChange',{'id':_0x2dcb0,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x2dcb0,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x2dcb0,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x26b70b=new _0x184e76(this['locale']);return _0x26b70b['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',_0x3db49a=>!_0x3db49a)]}}),_0x26b70b;}['_createAcceptButtonView'](){const _0x104519=new _0x1e9460(this['locale']);return _0x104519['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x104519['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x112e94=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x112e94['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x592a1e=>'pending'!==_0x592a1e&&'accepted'!==_0x592a1e),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-accept-button',_0x53bd69=>'pending'===_0x53bd69),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x58cbcf=>'accepted'===_0x58cbcf)]}}),this['on']('change:status',(_0x125a93,_0x192178,_0x45052a)=>{_0x104519['isEnabled']='pending'===_0x45052a,'accepted'===_0x45052a&&(_0x104519['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x104519['icon']=_0x34e643);}),_0x104519;}['_createDismissButtonView'](){const _0x5ebf62=new _0x1e9460(this['locale']);return _0x5ebf62['set']({'label':i(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x5ebf62['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x105094=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x105094['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary',this['bindTemplate']['if']('status','ck-hidden',_0x4dd975=>'pending'!==_0x4dd975&&'rejected'!==_0x4dd975),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x114b00=>'pending'===_0x114b00),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x38377e=>'rejected'===_0x38377e)]}}),this['on']('change:status',(_0xe59619,_0x5410bc,_0xb655fb)=>{_0x5ebf62['isEnabled']='pending'===_0xb655fb,'rejected'===_0xb655fb&&(_0x5ebf62['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x5ebf62['icon']=_0x557804);}),_0x5ebf62;}['_createInfoButtonView'](){const _0x2e4015=new _0x1e9460(this['locale']);return _0x2e4015['set']({'label':i(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x42893a,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x2e4015['bind']('isOn')['to'](this,'isInfoToggleOn',_0x3bc9b5=>_0x3bc9b5),_0x2e4015['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x2e4015;}['_createOutdatedButtonView'](){const _0x25ca5c=new _0x1e9460(this['locale']);return _0x25ca5c['set']({'label':i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':tc,'withText':!0x0,'isEnabled':!0x1}),_0x25ca5c['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x74a24f=>'outdated'!==_0x74a24f)],'disabled':'disabled'}}),_0x25ca5c;}}class me extends _0x2fff3d{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x8c3910,_0x3624e5){super(_0x8c3910),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']()),_0x3624e5['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x4b7657){this['resultItemView']['changeId']=_0x4b7657['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x4b7657['contentDiffed'];}['showBalloon'](_0x1b66dd,_0xcb63c7,_0x2c62ef,_0x18ba81,_0x30c1c5,_0x510308){const _0x2e33d7=_0xcb63c7();if(!_0x2e33d7)return;this['updateContent'](_0x1b66dd),this['show']();const _0x2da1ba=Array['from'](_0x2e33d7['getClientRects']())['reverse'](),_0x3a685e=this['_getPointedRectIndexFromEvent'](_0x2c62ef,_0x2da1ba),_0x2247d2=_0x2da1ba[_0x3a685e??0x0];'click'===_0x18ba81?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0xcb63c7(),_0x3a685e,_0x1b66dd['id'],_0x30c1c5,_0x510308)||_0x2247d2})):'hover'===_0x18ba81&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0xcb63c7(),_0x3a685e,_0x1b66dd['id'])||_0x2247d2}));}['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'](){_0x1ff4d5({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x39310f=[this['element']];return this['_pinnedTargetElement']&&_0x39310f['push'](this['_pinnedTargetElement']),_0x39310f;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x3d0d32=new _0x184e76();return this['resultItemView']=new Ys(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x3d0d32['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']]}]}),_0x3d0d32;}['_getBestRectPositionOnClick'](_0x3424f6,_0x16fcc8,_0x3400f3,_0x3d9be0,_0x4e7f6a){if(!_0x3424f6)return null;const _0x1fe2de=this['position']['replace']('arrow_',''),_0x214fd9=Array['from'](_0x3424f6['getClientRects']());let _0x376c08,_0xdd9b3e=_0x214fd9['reverse']();return void 0x0!==_0x16fcc8&&this['_isPinnedRectVisible'](_0xdd9b3e[_0x16fcc8],_0x3d9be0,_0x4e7f6a)?(_0x376c08=_0xdd9b3e[_0x16fcc8],this['_pinnedRectIndex']=_0x16fcc8):this['_isPinnedRectVisible'](_0xdd9b3e[0x0],_0x3d9be0,_0x4e7f6a)&&void 0x0===_0x16fcc8?_0x376c08=_0xdd9b3e[0x0]:(_0xdd9b3e='s'==_0x1fe2de[0x0]?[..._0x214fd9]['reverse']():_0x214fd9,_0xdd9b3e['forEach'](_0x34de7e=>{this['_isPinnedRectVisible'](_0x34de7e,_0x3d9be0,_0x4e7f6a)&&(_0x376c08=_0x34de7e);})),this['_pinnedTargetChangeId']=_0x3400f3,this['_pinnedTargetElement']=_0x3424f6,_0x376c08||_0x3424f6['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x21c0a2,_0x160c8a,_0x5a858e){if(!_0x21c0a2)return null;const _0x97f1e1=Array['from'](_0x21c0a2['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x160c8a&&this['_pinnedTargetChangeId']!==_0x5a858e)return this['_pinnedRectIndex']=_0x160c8a,this['_pinnedTargetElement']=_0x21c0a2,this['_pinnedTargetChangeId']=_0x5a858e,_0x97f1e1[_0x160c8a];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x5a858e){if(_0x21c0a2!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x97f1e1[this['_pinnedRectIndex']];}return void 0x0!==_0x160c8a&&this['_pinnedTargetChangeId']!==_0x5a858e?(this['_pinnedRectIndex']=_0x160c8a,this['_pinnedTargetElement']=_0x21c0a2,this['_pinnedTargetChangeId']=_0x5a858e,_0x97f1e1[_0x160c8a]):_0x21c0a2['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x281fa8,_0x2de490){if(_0x281fa8)for(let _0x52587c=0x0;_0x52587c<_0x2de490['length'];_0x52587c++){const _0x4546d8=_0x2de490[_0x52587c];if(_0x281fa8['clientX']>=_0x4546d8['left']-0x3&&_0x281fa8['clientX']<=_0x4546d8['right']+0x3&&_0x281fa8['clientY']>=_0x4546d8['top']-0x3&&_0x281fa8['clientY']<=_0x4546d8['bottom']+0x3)return _0x52587c;}}['_isPinnedRectVisible'](_0xfe98e0,_0x47e48c,_0x102168){const _0x5e98b5=new _0x5b8f6e(_0xfe98e0),_0x331b6c=_0x47e48c||document['documentElement'],_0x3eecfc=_0x5e98b5['getIntersection'](_0x3e7313(_0x102168)),_0x52664d=new _0x5b8f6e(_0x331b6c)['getIntersection'](_0x5e98b5);return!!(_0x3eecfc&&_0x52664d&&_0x5e98b5['width']>0x0);}}const ih=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class Me extends _0x575928{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[pt];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x352314){super(_0x352314),this['_bodyCollection']=new _0x591ff4(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 _0x21d375=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x21d375);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x20a938){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x35bdaa=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x20a938,_0x35bdaa);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x530a8c){_0x530a8c&&('error-general'!==_0x530a8c['status']?'error-chunk'!==_0x530a8c['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x29eabc){this['_mainView']['addCheckRunResult'](_0x29eabc);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x46edfd){this['_mainView']['showGeneralReviewCoreErrorView'](_0x46edfd??i(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x556647,_0x5d5268){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x556647,_0x5d5268);}['setActiveStateInResults'](_0x33c99e){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x3da98e=>{_0x3da98e['id']===_0x33c99e&&_0x3da98e['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x37b890=>_0x37b890['setItemAsInactive']());}['updateChangeState'](_0x4c0fcd,_0x4793a8){'accepted'===_0x4793a8||'rejected'===_0x4793a8||'outdated'===_0x4793a8?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x4c0fcd,_0x4793a8):this['_mainView']['reviewCheckResultsView']['showResult'](_0x4c0fcd,_0x4793a8);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x1cd9cb,_0x27c4a1,_0x474f67,_0x2d646b,_0x18b005,_0x54ba9d){this['_balloonSuggestionView']['showBalloon'](_0x1cd9cb,_0x27c4a1,_0x474f67,_0x2d646b,_0x18b005,_0x54ba9d);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x3d5188){const _0x21a69a=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x52e8fc=>_0x52e8fc['id']===_0x3d5188);return _0x21a69a?_0x21a69a['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class sh extends _0x184e76{constructor(_0xd7889f){super(_0xd7889f),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x1ab342=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x1ab342['if']('isVisible','ck-hidden',_0x3a4a1a=>!_0x3a4a1a)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x1ab342['to']('errorMessage')}]}]});}}class Ae extends _0x184e76{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x26018c,_0x578d45){super(_0x26018c),this['reviewCoreHeader']=_0x578d45['header'],this['generalErrorView']=new sh(_0x26018c),this['reviewCheckListView']=_0x578d45['list'],this['reviewCheckListView']['delegate'](...ih)['to'](this),this['reviewCheckResultsView']=_0x578d45['results'],this['reviewCheckResultsView']['delegate'](...ih)['to'](this),this['reviewCompletedView']=_0x578d45['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'](_0x5838fe){this['reviewCheckResultsView']['addResult'](_0x5838fe),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'](_0x3aed4b){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x3aed4b;}['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 _0x1e9460{constructor(_0x19f380,_0x3b9d84){super(_0x3b9d84),this['set']({'label':_0x19f380,'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class Ve extends _0x4ffa3a{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x4ca5c7,_0x4092b9){super(_0x4ca5c7),this['_contents']=_0x4092b9,this['_resultViews']=new _0x4e90c7(),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(_0x4ca5c7),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 _0xe51b9f=this['_createCombinedSkeletonLoader'](),_0x1becce=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x1becce['if']('isLoading','ck-ai_review__check-run_loading',_0x47ad48=>_0x47ad48),_0x1becce['if']('isResultReady','ck-ai_review__check-run_ready',_0x3a0959=>_0x3a0959),_0x1becce['if']('isVisible','ck-hidden',_0xa578a1=>!_0xa578a1)]},'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',_0x364b6a=>_0x364b6a)]},'children':this['_resultViews']},_0xe51b9f]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x58f21e){const _0x1ef32f=new Ys(this['locale'],_0x58f21e['id']);_0x1ef32f['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x1ef32f),_0x1ef32f['resultResponseView']['element']['innerHTML']=_0x58f21e['contentDiffed'];}['hideResult'](_0x553e86,_0x476bd4){if('pending'===_0x476bd4)return;const _0x275b25=this['_resultViews']['find'](_0xec24c=>_0xec24c['id']===_0x553e86);_0x275b25&&(_0x275b25['status']=_0x476bd4,_0x275b25['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0xa66652,_0x38c275){if('pending'!==_0x38c275)return;const _0x42930e=this['_resultViews']['find'](_0xde2792=>_0xde2792['id']===_0xa66652);_0x42930e&&(_0x42930e['status']=_0x38c275,_0x42930e['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x5b91b4,_0xb67157){this['headerTitle']=_0x5b91b4,this['headerSubtitle']=_0xb67157||'';}['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 _0x3d54e2=new _0x184e76(this['locale']),_0x63070f=[];for(let _0x3b2f90=0x0;_0x3b2f90<0x10;_0x3b2f90++){const _0x462480=this['_createSkeletonLoader']();_0x462480['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x63070f['push'](_0x462480);}return _0x3d54e2['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x580e67=>!_0x580e67)]},'children':_0x63070f}),_0x3d54e2;}['_createErrorView'](){const _0x41586f=new _0x184e76(this['locale']),_0x1bab11=new _0x1e9460(this['locale']),t=this['locale']['t'];return _0x41586f['delegate']('retryReview')['to'](this),_0x1bab11['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai_review__check-run-error-retry-button'}),_0x1bab11['on']('execute',()=>{this['fire']('retryReview');}),_0x41586f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x110eb0=>!_0x110eb0),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x4d50f4=>'chunk'===_0x4d50f4)]},'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',_0xf242a7=>'chunk'===_0xf242a7)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x2fab51=>'general'!==_0x2fab51)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x4548b5=>'chunk'!==_0x4548b5)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x1bab11]}),_0x41586f;}['_createCancelButtonView'](){const _0x3db49c=new _0x1e9460(this['locale']);return _0x3db49c['set']({'label':i(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x2ff977}),_0x3db49c['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x363265=>_0x363265),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5c162a=>_0x5c162a)]}}),_0x3db49c['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x3db49c;}['_createToggleDiffButtonView'](){const _0x4e1c6a=new _0x1e9460(this['locale']);_0x4e1c6a['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x4e1c6a['bind']('isEnabled')['to'](this,'isError',_0x252d0d=>!_0x252d0d),_0x4e1c6a['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x3e5653=>!_0x3e5653),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x550378=>_0x550378)]}});const _0x3a9951=i(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x452a27=i(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x4e1c6a['bind']('isOn')['to'](this,'isToggleDiffOn',_0xe8f923=>_0xe8f923),_0x4e1c6a['bind']('icon')['to'](this,'isToggleDiffOn',_0x1cd138=>_0x1cd138?_0x1597a1:_0x11989d),_0x4e1c6a['bind']('label')['to'](this,'isToggleDiffOn',_0x50286c=>_0x50286c?_0x3a9951:_0x452a27),_0x4e1c6a['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x4e1c6a;}['_createAcceptAllButtonView'](){const _0x466aed=new _0x1e9460(this['locale']);return _0x466aed['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x466aed['bind']('isEnabled')['to'](this,'isError',_0x9e1a38=>!_0x9e1a38),_0x466aed['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x28e38e=>!_0x28e38e),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4c4c7c=>_0x4c4c7c)]}}),_0x466aed['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x466aed;}['_createExitReviewButtonView'](){const _0x1431a6=new _0x1e9460(this['locale']);return _0x1431a6['set']({'label':i(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x1431a6['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary','ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x2acad1=>!_0x2acad1),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1a3a07=>_0x1a3a07)]}}),_0x1431a6['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x1431a6;}['_createResultHeaderView'](){const _0x555882=new _0x184e76(this['locale']),_0x30ac58=this['_createTitleView']();return _0x555882['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x4c69f3=>_0x4c69f3)]},'children':[_0x30ac58,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x555882;}['_createTitleView'](){const _0x4c42e0=new _0x184e76(this['locale']),_0x5598c2=new li();return _0x5598c2['bind']('isVisible')['to'](this,'isResultReady',_0x386b2d=>!_0x386b2d),_0x4c42e0['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x5598c2,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x25f516=>_0x25f516)]},'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',_0x18473e=>!_0x18473e)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x4c42e0;}['_createFinishReviewButtonView'](){const _0x153abc=new vr(i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x153abc['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x47392a=>!_0x47392a)]}}),_0x153abc['delegate']('finishReview')['to'](this),_0x153abc;}}class be extends _0x4ffa3a{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x1d6488,_0x545afe){super(_0x1d6488),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x545afe['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x545afe['headerText']);const _0xc72373=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0xc72373['if']('isVisible','ck-hidden',_0x2a14e2=>!_0x2a14e2)]},'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':_0x545afe['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x1cc2c9){const _0x5493ae=new vr(_0x1cc2c9,this['locale']);return _0x5493ae['delegate']('finishReview')['to'](this),_0x5493ae;}['_createResultHeaderView'](_0x34c6fa){const _0x22b2d8=new _0x184e76(this['locale']);return _0x22b2d8['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':_0x34c6fa}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x22b2d8;}}class Dr extends _0x184e76{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0xdfd6fa,_0x3c40fc){super(_0xdfd6fa),this['_defaultValue']=_0x3c40fc['default']||(_0x3c40fc['data']['length']>0x0?_0x3c40fc['data'][0x0]['id']:''),this['_defaultLabel']=_0x3c40fc['data']['find'](_0x28ac00=>_0x28ac00['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x546896(this['locale']);const _0x621f2b=this['_prepareListOptions'](_0x3c40fc['data']);_0x321091(this['_dropdownView'],_0x621f2b,{'role':'menu','ariaLabel':_0x3c40fc['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x37d256=>{_0x37d256['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x46bf55=>{this['formValue']=_0x46bf55['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x46bf55['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'](_0x25f986=[]){const _0x57fcdb=new _0x4b57cf();this['resetToDefault']();for(const _0x43c512 of _0x25f986){const _0x5737f9=new _0xf9ff1d({'label':_0x43c512['label'],'withText':!0x0,'role':'menuitemradio','id':_0x43c512['id'],'model':_0x43c512});_0x5737f9['bind']('isOn')['to'](this,'formValue',_0xdfafe9=>_0xdfafe9===_0x5737f9['id']);const _0xa0cbe5={'type':'button','model':_0x5737f9};_0x57fcdb['add'](_0xa0cbe5);}return _0x57fcdb;}}class sc extends _0x4ffa3a{['_formItem']=null;constructor(_0x17472f,_0x540274,_0x2228d1){super(_0x17472f),this['argsKey']=_0x540274?.['argsKey'];if('dropdown'===_0x540274['formType'])this['_formItem']=new Dr(this['locale'],_0x540274);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x4937a0=new _0x20574d(this['locale'],{'children':[this['_formItem']],'class':[_0x2228d1?'ck-form__row_with-submit':'']});_0x2228d1&&_0x4937a0['children']['add'](_0x2228d1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x4937a0]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class po extends _0x2dac43{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x51189b){super(_0x51189b),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x2b0c94(),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 _0x184e76{['focusTracker']=new _0x22c832();['keystrokes']=new _0x2b0c94();['focusCycler'];['_focusables']=new _0x4e90c7();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x5a319d,_0xbe878f,_0x2f4a6d=!0x1){super(_0x5a319d),this['_check']=_0xbe878f,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0xbe878f['defaultModel']?_0xbe878f['defaultModel']['id']:'',this['_defaultLabel']=_0xbe878f['defaultModel']?_0xbe878f['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0xfba0d2(this['locale'],()=>new po(_0x5a319d)),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 _0x4b57cf(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x2f4a6d),_0x321091(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x20574d(this['locale'],{'children':[this['promptInputView']]}),new _0x20574d(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x1c023a,_0x3a85af)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x3a85af()):_0x3a85af();}),this['focusCycler']=new _0x56c0d3({'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'](_0x2b3755=>{this['_focusables']['add'](_0x2b3755),this['focusTracker']['add'](_0x2b3755['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 _0xe7278a of this['_getFormValidators']()){const _0xd1038a=_0xe7278a();if(_0xd1038a)return this['promptInputView']['errorText']=_0xd1038a,!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 _0xf8ce83=new _0x1e9460(this['locale']),t=this['locale']['t'];return _0xf8ce83['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0xf8ce83['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0xf8ce83;}['_createCancelButtonView'](){const _0x117440=new _0x1e9460(this['locale']),t=this['locale']['t'];return _0x117440['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary'}),_0x117440['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2dc79b=>{_0x2dc79b['stopPropagation']();})}}),_0x117440['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x117440;}['_setModelList'](_0x5d1f5d){this['_modelSelectionDropdownItems']['clear']();const _0x34a69b=this['_check']['models'];if(_0x5d1f5d)this['set']('modelDisplayMode','hidden');else{const _0x3bd3cf=0x1===_0x34a69b['length'];this['set']('modelDisplayMode',_0x3bd3cf?'name':'selector');}if(this['resetToDefault'](),_0x34a69b?.['length']){0x1===_0x34a69b['length']&&this['set']('activeModelName',_0x34a69b[0x0]['name']||_0x34a69b[0x0]['id']);for(const _0x4b3e21 of _0x34a69b){const _0x2c0962=new _0xf9ff1d({'label':_0x4b3e21['name'],'withText':!0x0,'role':'menuitemradio','id':_0x4b3e21['id'],'model':_0x4b3e21});_0x2c0962['bind']('isOn')['to'](this,'modelId',_0x171be4=>_0x171be4===_0x4b3e21['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x2c0962,'labelView':new ko(this['locale'],_0x4b3e21)});}}}['_createModelSelectionDropdown'](){const _0x4ab93a=_0x546896(this['locale']);return _0x4ab93a['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x4ab93a['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),_0x4ab93a['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x312c17=>'selector'===_0x312c17),this['listenTo'](_0x4ab93a,'execute',_0x3d5501=>{this['modelId']=_0x3d5501['source']['model']['id'],_0x4ab93a['buttonView']['label']=_0x3d5501['source']['label'];}),_0x4ab93a;}['_createModelNameView'](){const _0x394e04=new _o(this['locale']);return _0x394e04['bind']('text')['to'](this,'activeModelName',_0x42d7a1=>_0x42d7a1??''),_0x394e04['bind']('isVisible')['to'](this,'modelDisplayMode',_0x879ffb=>'name'===_0x879ffb),_0x394e04;}['_createActionsFooterView'](){const _0x398f9d=new _0x184e76(this['locale']);return _0x398f9d['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']]}]}),_0x398f9d;}}class _o extends _0x184e76{constructor(_0xf12add){super(_0xf12add),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0xc5824d=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0xc5824d['if']('isVisible','ck-hidden',_0x1e2ec0=>!_0x1e2ec0)]},'children':[{'text':_0xc5824d['to']('text')}]});}}class ko extends _0x55674c{constructor(_0x17c4be,_0x16b05c){super();const _0x435742=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x435742['to']('style'),'id':_0x435742['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x435742['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x16b05c['description']||'']}]}]});}}class ec extends _0x4ffa3a{['_formItemsCollection']=new _0x4e90c7();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x30fcbd,_0x4c1095,_0xe8996a,_0x443aac=!0x1){super(_0x30fcbd),this['_hideModels']=_0x443aac,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x4c1095['isParameterized']);const _0x4faa5e=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',_0x3ef53f=>_0x3ef53f),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x2cb978=>_0x2cb978)],'style':{'--ck-ai-review-check-list-item-index':_0xe8996a}},'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':_0x4c1095['title']}]},_0x4faa5e]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x4c1095['description']?[{'text':_0x4c1095['description']}]:[]}]}]},..._0x4c1095['isParameterized']?[this['_createParameterizedView'](_0x4c1095)]:[],...'custom'===_0x4c1095['id']?[this['_createCustomView'](_0x4c1095,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x4c1095['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x4c1095['id'],'args':_0x4c1095['useArgs']?_0x4c1095['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x1ff4d5({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x3176d9=>{_0x3176d9['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x13d069=new _0xc034b();return _0x13d069['content']=_0x3d890b,_0x13d069['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x13d069;}['_createParameterizedView'](_0x47a726){const _0x176735=new _0x184e76(),_0xbd53d1=this['_createFormView'](_0x47a726);return _0x176735['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x561ff5=>!_0x561ff5)]},'children':[_0xbd53d1]}),_0x176735;}['_createFormView'](_0x3bcee5){const _0x12643d=new _0x184e76(),_0x22bc0b=Array['isArray'](_0x3bcee5['options'])?_0x3bcee5['options']:[],_0x268ede=new _0x1e9460(this['locale']),t=this['locale']['t'];_0x268ede['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x268ede['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x14235a=>{_0x14235a['stopPropagation']();})}}),_0x268ede['on']('execute',()=>{const _0x57d808=[],_0x4aa6c0={};this['_formItemsCollection']['forEach'](_0x24deb0=>{_0x57d808['push'](_0x24deb0['value']),_0x3bcee5['useArgs']&&_0x3bcee5['options']&&(_0x4aa6c0[_0x24deb0['argsKey']]=_0x24deb0['value']);}),this['fire']('runReviewCheck',{'id':_0x3bcee5['id'],'params':_0x57d808['length']?_0x57d808:void 0x0,'args':Object['keys'](_0x4aa6c0)['length']?_0x4aa6c0:void 0x0});});const _0x214b5c=_0x22bc0b['length'];return _0x22bc0b['forEach']((_0x1cc148,_0x48f612)=>{const _0x4fa796=_0x48f612===_0x214b5c-0x1;this['_formItemsCollection']['add'](new sc(this['locale'],_0x1cc148,_0x4fa796?_0x268ede:null));}),_0x12643d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x12643d;}['_createCustomView'](_0xf9ff47,_0x355317=!0x1){return this['_customCheckView']=new cc(this['locale'],_0xf9ff47,_0x355317),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',_0x334740=>!_0x334740)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x1fd4e3,_0x2992eb,_0x1ab944)=>{_0x1ab944||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class je extends _0x4ffa3a{['_checkViews'];constructor(_0x332220){super(_0x332220),this['_checkViews']=new _0x4e90c7(),this['_setupTemplate']();}['setChecks'](_0x409ef4,_0x531693=!0x1){this['_checkViews']['clear']();for(const [_0x4228b7,_0x3a01ed]of _0x409ef4['entries']()){const _0x453f60=new ec(this['locale'],_0x3a01ed,_0x4228b7,_0x531693);_0x453f60['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x453f60);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x43924d of this['_checkViews'])_0x43924d instanceof ec&&_0x43924d['resetToDefault']();}['_setupTemplate'](){const _0x56189d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x56189d['if']('isVisible','ck-hidden',_0x33ddc0=>!_0x33ddc0)]},'children':this['_checkViews']});}}class ge extends Me{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x63fc5=this['context']['locale'],_0x158b9d=new _0x41e0a3(_0x63fc5,{'label':i(_0x63fc5,'AI_REVIEW_MODE'),'icon':_0x375882,'class':'ck-ai-header\x20ck-ai-header_review'});return new Ae(this['context']['locale'],{'header':_0x158b9d,'list':new je(_0x63fc5),'results':new Ve(_0x63fc5,{'generalErrorText':i(_0x63fc5,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new be(_0x63fc5,{'headerText':i(_0x63fc5,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':i(_0x63fc5,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0x63fc5,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x340132=this['context']['plugins']['get']('AITabs');_0x340132['view']['on']('activateTab',(_0x5e829d,_0x3f8c68)=>{'reviewMode'===_0x3f8c68?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x340132['view']['addTab']({'id':'reviewMode','buttonLabel':i(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x375882,'order':0x0,'content':this['_mainView']});}}const fe='review-';class de extends _0x575928{static get['requires'](){return[_0x29a341,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(_0x1d2fae){super(_0x1d2fae),this['_domEmitter']=new(_0x48ef7b())(),this['_eventEmitter']=new(_0x290e58())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x505ac1=T(this['context']);_0x505ac1['conversion']['for']('editingDowncast')['markerToElement']({'model':fe+'insert','view':(_0x8721f3,{writer:_0x2d6b91})=>{const _0x3c8f2b=this['_markers']['get'](_0x8721f3['markerName']),_0x33bdeb={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x3c8f2b?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x8721f3['markerName']};return _0x2d6b91['createUIElement']('span',_0x33bdeb,function(_0x148abf){const _0x409243=this['toDomElement'](_0x148abf);return _0x409243['innerHTML']=_0x3c8f2b?.['content']?.['asString']||'',_0x409243;});}}),_0x505ac1['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-only','view':_0x210c88=>{const _0xb38077=this['_markers']['get'](_0x210c88['markerName']),_0x4128be=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0xb38077?.['id']||'')&&_0x4128be['push']('ck-ai_review__change_active'),{'classes':_0x4128be,'attributes':{'data-marker-id':_0x210c88['markerName']}};}}),_0x505ac1['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-context','view':_0x5952b5=>{const _0x321d43=this['_markers']['get'](_0x5952b5['markerName']),_0x16ef5a=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x321d43?.['id']||'')&&_0x16ef5a['push']('ck-ai_review__change_active'),{'classes':_0x16ef5a,'attributes':{'data-marker-id':_0x5952b5['markerName']}};}}),_0x505ac1['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-text','view':_0x27ad83=>{const _0x5cc172=this['_markers']['get'](_0x27ad83['markerName']),_0x13e83e=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x5cc172?.['id']||'')&&_0x13e83e['push']('ck-ai_review__change_active'),{'classes':_0x13e83e,'attributes':{'data-marker-id':_0x27ad83['markerName']}};}}),_0x505ac1['conversion']['for']('dataDowncast')['markerToElement']({'model':fe+'suggestion-context','view':(_0x559b86,{writer:_0xa02c63})=>_0xa02c63['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x559b86['isOpening']?'start':'end')})}),_0x505ac1['conversion']['for']('downcast')['attributeToAttribute']({'model':Ct,'view':_0x169cf0});const _0x50152d=_0x505ac1['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x50152d,'mouseup',(_0x56d291,_0x576d74)=>{const _0x4f145c=_0x576d74['target'],_0x80c127=this['_findMarkerElement'](_0x4f145c);if(!_0x80c127)return;const _0x39080d=_0x80c127['getAttribute']('data-marker-id'),_0x57f3b8=_0x39080d['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x39080d,'changeId':_0x57f3b8,'markerElement':()=>this['_findMarkerElementById'](_0x39080d),'domEvent':_0x576d74});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x50152d,'mouseover',(_0x421c07,_0x58b45b)=>{const _0x18c613=_0x58b45b['target'],_0x1b7fdf=_0x58b45b['relatedTarget'];let _0x10842e=this['_findMarkerElement'](_0x18c613);if(!_0x10842e&&_0x1b7fdf&&(_0x10842e=this['_findMarkerElement'](_0x1b7fdf)),!_0x10842e)return;const _0x268523=_0x10842e['getAttribute']('data-marker-id'),_0x190130=_0x268523['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x190130,'markerElement':()=>this['_findMarkerElementById'](_0x268523),'domEvent':_0x58b45b});}),this['_domEmitter']['listenTo'](document,'mouseover',_0xd2e461((_0x1a249f,_0x3b1e0b)=>{const _0x34af3a=_0x3b1e0b['target'];if(this['_findMarkerElement'](_0x34af3a))return;_0x34af3a['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x505ac1['model']['document']['registerPostFixer'](_0x2c2d63=>this['_validateMarkers'](_0x505ac1,_0x2c2d63)),_0x505ac1['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x505ac1));}['getDocumentData'](){const _0x2a77d5=this['context']['plugins']['get']('AIEditing'),_0x140a53=T(this['context']),_0x5580b7=_0x140a53['model'],_0x4ef405=new tt();for(const _0xb600b0 of _0x5580b7['document']['getRoot']()['getChildren']()){const _0x3d0688=_0xb600b0['_clone'](!0x0);_0x4ef405['_appendChild'](_0x3d0688);}for(const _0x1696ec of _0x5580b7['markers'])_0x4ef405['markers']['set'](_0x1696ec['name'],this['_changeRangeOwnerDocument'](_0x1696ec['getRange']()['clone'](),_0x4ef405));const _0x3f7426=new _0x3f0c2e({'ignoreElementEnd':!0x0,'startPosition':_0x5580b7['createPositionAt'](_0x4ef405,0x0)}),_0x3c8fce=new Set(),_0x3cf7f4=new Map();for(const {item:_0x239d39}of _0x3f7426){if(!_0x239d39['is']('$textProxy'))continue;const _0x43604d=_0x239d39['parent'];if(_0x43604d&&_0x43604d['is']('element')){const _0xbe55b0=this['_upsertDataId'](_0x43604d,()=>_0x2a77d5['_nextDataId'](_0x3c8fce));_0x3c8fce['add'](_0xbe55b0);for(const _0x5ab743 of _0x43604d['getChildren']())_0x5ab743['is']('element')&&_0x3c8fce['add'](this['_upsertDataId'](_0x5ab743,()=>_0x2a77d5['_nextDataId'](_0x3c8fce)));let _0x1a3b17=_0x43604d;for(;_0x1a3b17['parent']&&!_0x1a3b17['parent']['is']('documentFragment');)_0x1a3b17=_0x1a3b17['parent'],_0x1a3b17['hasAttribute'](Ct)&&_0x1a3b17['_removeAttribute'](Ct);_0x3cf7f4['set'](_0xbe55b0,{'path':_0x43604d['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x1a3b17['_clone'](!0x0),_0xbe55b0,_0x140a53['data'])}),_0x3f7426['jumpTo'](_0x5580b7['createPositionAfter'](_0x43604d));}}return{'content':_0x140a53['data']['processor']['toData'](_0x140a53['data']['toView'](_0x4ef405)),'version':_0x140a53['model']['document']['version'],'elements':_0x3cf7f4};}['diffContent'](_0x14b8c9,_0x14ad1c,_0x8542fa=!0x1){const _0x249be3=[],_0xc7b55=T(this['context']),_0x408b3e=_0xc7b55['data']['parse'](_0x14ad1c,'$documentFragment'),_0x1db28c=_0xc7b55['data']['parse'](_0x14b8c9,'$documentFragment'),_0x25973b=_0xc7b55['model']['createPositionAt'](_0x1db28c,0x0);if(this['_haveSingleTopLevelElement'](_0x408b3e)){if(!this['_hasSameTopLevelElement'](_0x1db28c,_0x408b3e))return _0x249be3;}else{const _0x285765=_0xc7b55['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x1db28c,_0x285765)||!this['_haveOnlyInlineContent'](_0x408b3e,_0x285765))return _0x249be3;}const _0x104793=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x14b8c9,_0x14ad1c,{'anchor':_0x25973b,'markDeletions':!0x0})['getOperations']()['filter'](_0x571f82=>'insert'===_0x571f82['type']||'marker'===_0x571f82['type']&&_0x571f82['name']['startsWith']('$markedRemove')),_0x1b4d16=this['_groupAdjacentOperations'](_0x104793),_0x58bf19=[];if(_0x8542fa){if(_0x1b4d16['length']){const _0x3ba804=_0x1b4d16[0x0]['operations'][0x0],_0x85f2dd='insert'===_0x3ba804['type']?_0x3ba804['position']:_0x3ba804['newRange']['start'],_0x50b61e=this['_getPositionLimitingRange'](_0x85f2dd,_0xc7b55,'inside'),_0x2d1af3=_0x50b61e?_0x408b3e['getChild'](0x0)['getChildren']():_0x408b3e['getChildren'](),_0x84cb10=_0x50b61e||_0xc7b55['model']['createRangeIn'](_0x1db28c),_0x1e2b72=[new _0x57d058('$markedRemove:synthetic'+_0x926b30(),null,_0x84cb10,_0xc7b55['model']['document']['model']['markers'],!0x0,_0xc7b55['model']['document']['version']+0x1),new _0x1e2b01(_0x84cb10['end'],_0x2d1af3,_0xc7b55['model']['document']['version']+0x2)];_0x58bf19['push']({'operations':_0x1e2b72,'operationsIsolated':_0x1e2b72,'groupOffset':0x0});}}else _0x58bf19['push'](..._0x1b4d16);let _0xf0b350=0x0;return _0xc7b55['model']['change'](_0x56e607=>{for(let _0x55b497=0x0;_0x55b497<_0x58bf19['length'];_0x55b497++){const _0x5149a9=_0x58bf19[_0x55b497],_0x3ad5fe=_0x56e607['createDocumentFragment']();for(const _0x29371d of _0x1db28c['getChildren']())_0x56e607['append'](_0x29371d['_clone'](!0x0),_0x3ad5fe);for(const _0x2683a8 of _0x5149a9['operationsIsolated'])if('insert'===_0x2683a8['type']){const _0x14cd9d=_0x2683a8;_0x14cd9d['baseVersion']=null,_0x14cd9d['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x14cd9d,_0x3ad5fe),_0x56e607['batch']['addOperation'](_0x2683a8),_0xc7b55['model']['applyOperation'](_0x2683a8);const _0x3261f4='suggestion:insertion:id:authorId:'+_0xf0b350++,_0x17e552=_0xc7b55['model']['createRange'](_0x14cd9d['position'],_0x14cd9d['position']['getShiftedBy'](_0x14cd9d['howMany']));_0x3ad5fe['markers']['set'](_0x3261f4,_0x17e552);}else{if('marker'===_0x2683a8['type']&&_0x2683a8['name']['startsWith']('$markedRemove')){const _0x43d784=_0x2683a8,_0x3551b9='suggestion:deletion:id:authorId:'+_0xf0b350++;this['_changeOperationOwnerDocument'](_0x43d784,_0x3ad5fe),_0x3ad5fe['markers']['set'](_0x3551b9,_0x43d784['newRange']);}}if(_0x8542fa)_0x249be3['push']({..._0x5149a9,'context':this['_createGetContentFn'](_0x1db28c,_0xc7b55['data']),'content':this['_createGetContentFn'](_0x1db28c,_0xc7b55['data'])});else{const _0x2e5411=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x5149a9['operationsIsolated'][0x0]),_0x3ad5fe),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x5149a9['operationsIsolated'][_0x5149a9['operationsIsolated']['length']-0x1]),_0x3ad5fe));_0x3ad5fe['markers']['set'](fe+'suggestion-context',new it(_0x2e5411['start'],_0x2e5411['end'])),_0x249be3['push']({..._0x5149a9,'context':this['_createGetContextFn'](_0x3ad5fe,_0xc7b55['data'],{'ellipsisBefore':_0x2e5411['hasContentBefore'],'ellipsisAfter':_0x2e5411['hasContentAfter']}),'content':this['_createGetContentFn'](_0x3ad5fe,_0xc7b55['data'])});}}}),_0x249be3;}['markChangePositionInEditorContent'](_0x43b6d1,_0x5aef4f){if(!_0x43b6d1['length'])return;const _0x2fce8=_0x43b6d1[0x0]['parent']['id'],_0x1bc31a=_0x5aef4f['elements']['get'](_0x2fce8);if(!_0x1bc31a)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x2fce8);const _0x4d7236=_0x1bc31a['path'],_0x5a37cb=T(this['context']),_0x470f1d=_0x5a37cb['model']['document']['history']['getOperations'](_0x5aef4f['version']),_0x2d04f4=[];for(const _0x562d8d of _0x43b6d1){const _0x2cbacd=_0x562d8d['operationsIsolated']['map'](_0x53623c=>this['_translateOperationToEditorContent'](_0x53623c,_0x4d7236,_0x5a37cb['model']['document']['getRoots']()[0x0]));if(!_0x2cbacd||!_0x2cbacd['length'])continue;const _0x13b884=_0x2cbacd['every'](_0x2723d3=>'marker'===_0x2723d3['type']&&_0x2723d3['name']['startsWith']('$markedRemove')),_0x107524={'document':_0x5a37cb['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x50dfbb=nt(_0x2cbacd,_0x470f1d,_0x107524)['operationsA'];for(const _0x5e332d of _0x50dfbb)if('insert'===_0x5e332d['type']){const _0x1b442a=_0x5e332d,_0x5ae926=_0x1b442a['nodes'];_0x5a37cb['model']['change'](_0xd5b711=>{const _0x3435bf=_0xd5b711['createDocumentFragment']();for(const _0x53c3e9 of _0x5ae926)_0xd5b711['append'](_0x53c3e9['_clone'](!0x0),_0x3435bf);_0x2d04f4['push']({'start':_0x1b442a['position'],'end':_0x1b442a['position'],'type':'insert','groupId':_0x562d8d['id'],'content':{'asString':this['_createGetContentFn'](_0x3435bf,_0x5a37cb['data'])(),'asFragment':_0x3435bf}});});}else{if('marker'===_0x5e332d['type']&&_0x5e332d['name']['startsWith']('$markedRemove')){const _0x223878=_0x5e332d;let _0x37254d='remove-text';if(_0x13b884){const _0x32e614=this['_findAdjacentContextDistance'](_0x223878['newRange']['start'],'backward',_0x5a37cb['model']['schema']),_0x1597b4=this['_findAdjacentContextDistance'](_0x223878['newRange']['end'],'forward',_0x5a37cb['model']['schema']);if(_0x32e614||_0x1597b4){const _0x4b3127=_0x223878['newRange']['start']['getShiftedBy'](-_0x32e614),_0x1a0fbd=_0x223878['newRange']['end']['getShiftedBy'](_0x1597b4);_0x2d04f4['push']({'start':_0x4b3127,'end':_0x1a0fbd,'groupId':_0x562d8d['id'],'type':'remove-context'});}else _0x37254d='remove-only';}_0x2d04f4['push']({'start':_0x223878['newRange']['start'],'end':_0x223878['newRange']['end'],'groupId':_0x562d8d['id'],'type':_0x37254d});}}}this['_insertMarkers'](_0x2d04f4);}['clearAllMarkers'](){const _0x48260e=T(this['context']);_0x48260e['model']['change'](_0x48b13b=>{for(const _0x7c474c of this['_markers']['keys']())_0x48260e['model']['markers']['get'](_0x7c474c)&&_0x48b13b['removeMarker'](_0x7c474c);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){T(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){T(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x49258f){const _0x7aa1c7=T(this['context']),_0x35d959=_0x7aa1c7['model'],_0x3606e8=_0x49258f['map'](_0x3a87e0=>this['_getMarkersDataForGroup'](_0x3a87e0))['flat']();_0x35d959['change'](_0x17066e=>{for(const _0x58623c of _0x3606e8){const _0x192a68=_0x7aa1c7['model']['markers']['get'](_0x58623c['id']);if(_0x192a68){if('insert'===_0x58623c['type']){if(!_0x58623c['content'])continue;_0x35d959['insertContent'](_0x58623c['content']['asFragment']||null,_0x192a68['getRange']()['start']);}else'remove-text'!==_0x58623c['type']&&'remove-only'!==_0x58623c['type']||_0x35d959['deleteContent'](_0x35d959['createSelection'](_0x192a68['getRange']()));_0x17066e['removeMarker'](_0x58623c['id']),this['_markers']['delete'](_0x58623c['id']);}}});}['rejectChange'](_0x4fc195){const _0xc8cdcc=T(this['context']),_0x4810c6=this['_getMarkersDataForGroup'](_0x4fc195);_0xc8cdcc['model']['change'](_0x5caffe=>{for(const _0x5a1eea of _0x4810c6)_0x5caffe['removeMarker'](_0x5a1eea['id']),this['_markers']['delete'](_0x5a1eea['id']);});}['getEditor'](){return T(this['context']);}['getMarkerElementForChange'](_0x218de0){const _0x4347d9=Array['from'](this['_markers']['values']())['filter'](_0xe1bef1=>_0xe1bef1['groupId']===_0x218de0);if(!_0x4347d9['length'])return null;const _0x2b2d5c=0x1===_0x4347d9['length']?_0x4347d9[0x0]:this['_sortMarkers'](_0x4347d9)[0x0],_0xc8ae40=T(this['context'])['model']['markers']['get'](_0x2b2d5c['id']);if(!_0xc8ae40)return null;return{'modelRange':_0xc8ae40['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x2b2d5c['id'])};}['getContentElementForChange'](_0xce6829){const _0xbd62f2=Array['from'](this['_markers']['values']())['filter'](_0x4fcc99=>_0x4fcc99['groupId']===_0xce6829);if(!_0xbd62f2['length'])return null;const _0x2f03d1=0x1===_0xbd62f2['length']?_0xbd62f2[0x0]:this['_sortMarkers'](_0xbd62f2)[0x0],_0x2aa0a4=T(this['context']),_0x2622e9=_0x2aa0a4['model']['markers']['get'](_0x2f03d1['id']);if(!_0x2622e9)return null;const _0x1adbc0=_0x2622e9['getRange'](),_0x5180bc=_0x2aa0a4['editing']['view']['getDomRoot']();if(!_0x5180bc||!_0x1adbc0)return null;let _0x1a1545=_0x1adbc0['start']['parent'];for(;_0x1a1545['parent']&&'$root'!==_0x1a1545['parent']['name'];)_0x1a1545=_0x1a1545['parent'];if(!_0x1a1545||!_0x1a1545['name'])return null;const _0x111ca5=_0x5180bc['querySelector']('[data-marker-id=\x22'+_0x2f03d1['id']+'\x22]');if(!_0x111ca5)return null;let _0x3b7b58=null;_0x2aa0a4['model']['change'](_0x53be9b=>{_0x3b7b58=_0x53be9b['createDocumentFragment'](),_0x53be9b['append'](_0x1a1545['_clone'](!0x0),_0x3b7b58);});const _0x482665=_0x2aa0a4['data']['toView'](_0x3b7b58)['getChild'](0x0);return _0x111ca5['closest'](_0x482665['name']);}['reactivateMarkers'](_0x133c42){const _0x153bae=this['_getMarkersDataForGroup'](_0x133c42);if(!_0x153bae['length'])return;const _0x41a34e=Array['from'](this['_activeMarkers'])['sort'](),_0x433e54=Array['from'](new Set(_0x153bae['map'](_0x1677a4=>_0x1677a4['id'])))['sort']();_0x41a34e['join']('|')!==_0x433e54['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x133c42));}['setMarkersInElementAsActive'](_0x176178){const _0x284f00=this['_getMarkersDataForGroup'](_0x176178);if(!_0x284f00['length'])return;const _0x6b286c=T(this['context']),_0x5838d4=new Set(_0x284f00['map'](_0x58092b=>_0x58092b['id'])),_0x44f684=Array['from'](_0x5838d4['values']())['map'](_0x207816=>_0x6b286c['model']['markers']['get'](_0x207816))['filter'](_0x59c0e4=>!!_0x59c0e4);_0x5838d4['forEach'](_0x46e4b2=>{this['_activeMarkers']['add'](_0x46e4b2);}),_0x6b286c['model']['change'](()=>{_0x44f684['forEach'](_0x53a744=>{_0x6b286c['editing']['reconvertMarker'](_0x53a744);});});}['setAllMarkersAsInactive'](){const _0x12a77b=Array['from'](this['_activeMarkers']);if(!_0x12a77b['length'])return;this['_activeMarkers']['clear']();const _0x52bb63=T(this['context']),_0x27485d=_0x12a77b['map'](_0xfb85d9=>_0x52bb63['model']['markers']['get'](_0xfb85d9))['filter'](_0xc6d692=>!!_0xc6d692);_0x52bb63['model']['change'](()=>{_0x27485d['forEach'](_0x37f5b8=>{_0x52bb63['editing']['reconvertMarker'](_0x37f5b8);});});}['_getPositionLimitingRange'](_0x453077,_0x46d7c8,_0x38f41f='outside'){if(!_0x453077)return null;let _0x52e673=_0x453077['parent'];for(;_0x52e673&&_0x52e673['parent']&&'$root'!==_0x52e673['parent']['name']&&!_0x46d7c8['model']['schema']['isLimit'](_0x52e673)&&!_0x46d7c8['model']['schema']['isBlock'](_0x52e673);)_0x52e673=_0x52e673['parent'];if(!_0x52e673||!_0x52e673['name']||'$root'===_0x52e673['name'])return null;let _0x3a9e16=null;return _0x46d7c8['model']['change'](_0x3dc31e=>{_0x3a9e16='inside'===_0x38f41f?_0x3dc31e['createRangeIn'](_0x52e673):_0x3dc31e['createRangeOn'](_0x52e673);}),_0x3a9e16;}['_validateMarkers'](_0x175657,_0x3fbacb){const _0xc1f02d=Array['from'](this['_markers']['keys']()),_0xe91ef=new Map();for(const _0x23a02e of _0xc1f02d){const _0x58ab62=_0x175657['model']['markers']['get'](_0x23a02e);if(!_0x58ab62)continue;const _0x49cd35=_0x58ab62['getStart']()['path'][0x0];_0xe91ef['has'](_0x49cd35)||_0xe91ef['set'](_0x49cd35,[]),_0xe91ef['get'](_0x49cd35)['push'](_0x58ab62);}const _0x57a9de=new Set();for(const _0x1960e1 of _0x175657['model']['document']['differ']['getChanges']()){let _0x44129e=-0x1,_0x490e7f=null;if('insert'===_0x1960e1['type'])_0x490e7f=new it(_0x1960e1['position'],_0x1960e1['position']['getShiftedBy'](_0x1960e1['length'])),_0x44129e=_0x1960e1['position']['path'][0x0];else{if('remove'!==_0x1960e1['type'])continue;_0x490e7f=new it(_0x1960e1['position']),_0x44129e=_0x1960e1['position']['path'][0x0];}const _0x511db2=_0xe91ef['get'](_0x44129e)||[];if(_0x511db2['length']){for(const _0x532be5 of _0x511db2)if(_0x490e7f['root']['rootName']===_0x532be5['getRange']()['root']['rootName']&&('insert'!==_0x1960e1['type']||!_0x490e7f['containsRange'](_0x532be5['getRange']()))&&(_0x490e7f['isIntersecting'](_0x532be5['getRange']())||_0x490e7f['start']['isTouching'](_0x532be5['getRange']()['end'])||_0x490e7f['end']['isTouching'](_0x532be5['getRange']()['start']))){const _0x18d08b=this['_parseMarkerName'](_0x532be5['name']);Array['from'](this['_markers']['values']())['filter'](_0x556d05=>_0x556d05['groupId']===_0x18d08b['groupId'])['forEach'](_0x188704=>_0x57a9de['add'](_0x188704['id']));}}}if(_0x57a9de['size']){for(const _0x3a8ed2 of _0x57a9de)_0x3fbacb['removeMarker'](_0x3a8ed2);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x56a833){for(const {name:_0x17dfc6,data:_0x5c8cd4}of _0x56a833['model']['document']['differ']['getChangedMarkers']()){if(!_0x17dfc6['startsWith'](fe))continue;const _0x20954f=_0x5c8cd4['oldRange'],_0x43427b=_0x5c8cd4['newRange'],_0x310a13=_0x20954f&&'$graveyard'===_0x20954f['root']['rootName'],_0xef5a16=_0x43427b&&'$graveyard'===_0x43427b['root']['rootName'];if(_0x310a13&&_0xef5a16)continue;const _0x330db9=this['_parseMarkerName'](_0x17dfc6);this['_markers']['get'](_0x17dfc6)&&(_0xef5a16||!_0x43427b?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x17dfc6,'changeId':_0x330db9['groupId']}):_0x310a13&&_0x43427b&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x17dfc6,'changeId':_0x330db9['groupId']}));}}['_parseMarkerName'](_0x4e6c1c){const _0x18045f=_0x4e6c1c['split'](':'),_0x54c87c=(_0x18045f[0x1]||'')['split']('_');return{'prefix':_0x18045f[0x0],'groupId':_0x54c87c[0x0],'suffix':_0x54c87c[0x1]};}['_translateOperationToEditorContent'](_0x185a16,_0x2491b2,_0x2f610f){if('insert'===_0x185a16['type']){const _0x518bf1=_0x185a16;return new _0x1e2b01(this['_changePosition'](_0x2491b2['concat'](_0x518bf1['position']['offset']),_0x2f610f),_0x518bf1['nodes'],_0x518bf1['baseVersion']);}if('marker'===_0x185a16['type']&&_0x185a16['name']['startsWith']('$markedRemove')){const _0x425c9e=_0x185a16;return new _0x57d058(_0x425c9e['name'],_0x425c9e['oldRange'],this['_changeRange'](_0x425c9e['newRange'],_0x2491b2['concat'](_0x425c9e['newRange']['start']['offset']),_0x2491b2['concat'](_0x425c9e['newRange']['end']['offset']),_0x2f610f),_0x425c9e['_markers'],_0x425c9e['affectsData'],_0x425c9e['baseVersion']);}return _0x185a16;}['_groupAdjacentOperations'](_0x36b8ba){if(!_0x36b8ba['length'])return[];const _0x577c79=[];let _0x1d678b=0x0,_0x15e6fe=0x0,_0x509512=[];for(let _0x16e94c=0x0;_0x16e94c<=_0x36b8ba['length'];_0x16e94c++){const _0x44a7fb=_0x36b8ba[_0x16e94c],_0x137128=_0x36b8ba[_0x16e94c-0x1];!_0x44a7fb||_0x137128&&!this['_getOperationEnd'](_0x137128)['isTouching'](this['_getOperationStart'](_0x44a7fb))?(_0x577c79['push']({'operations':_0x509512,'operationsIsolated':_0x509512['map'](_0x1b7955=>this['_shiftOperation'](_0x1b7955['clone'](),-_0x15e6fe)),'groupOffset':_0x1d678b}),_0x509512=_0x44a7fb?[_0x44a7fb]:[],_0x15e6fe+=_0x1d678b,_0x1d678b=0x0):_0x509512['push'](_0x44a7fb),_0x44a7fb&&'insert'===_0x44a7fb['type']&&(_0x1d678b+=_0x44a7fb['howMany']);}return _0x577c79;}['_findAdjacentContextDistance'](_0x1acbea,_0xbda290,_0x161683,_0xd0f704=0x1){const _0x4784dd=new _0x3f0c2e({'startPosition':_0x1acbea,'direction':_0xbda290});let _0x21973e=0x0;for(let _0x2f68f7=0x0;_0x2f68f7<_0xd0f704;_0x2f68f7++){let _0x2c4a4b=0x0,_0x70412a=!0x1,_0x38c7f2='forward'===_0xbda290?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x543ad3}of _0x4784dd)if(_0x543ad3['is']('$textProxy')){const _0x32130a=_0x38c7f2['exec'](_0x543ad3['data']);if(_0x32130a&&_0x32130a['length']){if(_0x2c4a4b+='forward'===_0xbda290?_0x32130a['index']+_0x32130a[0x0]['length']:_0x543ad3['data']['length']-_0x32130a['index'],_0x32130a[0x0]['length']!==_0x543ad3['data']['length'])break;_0x70412a=!0x0,_0x38c7f2='forward'===_0xbda290?/^\w+/:/\w+$/;}else{if(_0x70412a)break;_0x2c4a4b+=_0x543ad3['offsetSize'];}}else{if(_0x543ad3['is']('element')){_0x161683['isInline'](_0x543ad3)&&!_0x70412a&&(_0x2c4a4b+=0x1);break;}}_0x21973e+=_0x2c4a4b,_0x4784dd['jumpTo'](_0x1acbea['getShiftedBy']('forward'===_0xbda290?_0x21973e:-_0x21973e));}return _0x21973e;}['_getChangeContext'](_0x30cd4e,_0x481cd0){const _0x21b55e=T(this['context'])['model']['schema'],_0x332d3e=this['_findAdjacentContextDistance'](_0x30cd4e,'backward',_0x21b55e,0x6),_0x5926fb=this['_findAdjacentContextDistance'](_0x481cd0,'forward',_0x21b55e,0x6),_0x3703d8=_0x30cd4e['getShiftedBy'](-_0x332d3e),_0x4eaaa0=_0x481cd0['getShiftedBy'](_0x5926fb);return{'start':_0x3703d8,'end':_0x4eaaa0,'hasContentBefore':!_0x3703d8['isAtStart'],'hasContentAfter':!_0x4eaaa0['isAtEnd']};}['_insertMarkers'](_0x683e33){const _0x4eb617=this['context']['plugins']['get']('AIEditing'),_0x5ced7d=new Set();T(this['context'])['model']['change'](_0x1a6271=>{for(const _0x337a9c of _0x683e33){const _0x87ceba=''+fe+_0x337a9c['type']+':'+_0x337a9c['groupId']+'_'+_0x4eb617['_nextDataId'](_0x5ced7d);this['_markers']['set'](_0x87ceba,{'id':_0x87ceba,'groupId':_0x337a9c['groupId'],'type':_0x337a9c['type'],'content':_0x337a9c['content']}),_0x1a6271['addMarker'](_0x87ceba,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1a6271['createRange'](_0x337a9c['start'],_0x337a9c['end'])});}});}['_createGetContextFn'](_0x1d0160,_0x4f2190,_0x3843f3){let _0x25141e='';return()=>{if(!_0x25141e){const _0x529cba=_0x4f2190['toView'](_0x1d0160,{'showSuggestionHighlights':!0x0});let _0x46c73d=_0x529cba['getChild'](0x0);if(_0x46c73d['is']('containerElement')||(_0x46c73d=_0x529cba),!_0x46c73d)return'';let _0x3d9024=!0x1;const _0x177769=[];for(const _0x3d6e00 of _0x46c73d['getChildren']())_0x3d6e00['is']('element','span')&&_0x3d6e00['hasClass']('ck-ai_review-marker_context-end')&&(_0x3d9024=!0x1),_0x3d9024&&_0x177769['push'](_0x3d6e00),_0x3d6e00['is']('element','span')&&_0x3d6e00['hasClass']('ck-ai_review-marker_context-start')&&(_0x3d9024=!0x0);_0x46c73d['_removeChildren'](0x0,_0x46c73d['childCount']),_0x3843f3?.['ellipsisBefore']&&_0x46c73d['_appendChild']('…'),_0x46c73d['_appendChild'](_0x177769),_0x3843f3?.['ellipsisAfter']&&_0x46c73d['_appendChild']('…');const _0x36fb67=_0x4f2190['htmlProcessor']['domConverter']['viewToDom'](_0x529cba),_0x401646=_0x4f2190['htmlProcessor']['htmlWriter']['getHtml'](_0x36fb67);_0x25141e=_0x401646;}return _0x25141e;};}['_createGetContentFn'](_0xba3b38,_0x590ef1){let _0xdd1f05='';return()=>(_0xdd1f05||(_0xdd1f05=_0x590ef1['stringify'](_0xba3b38,{'showSuggestionHighlights':!0x0})),_0xdd1f05);}['_createGetContentUsingDataIdFn'](_0x3ac08b,_0x4c9e74,_0x3bc521){let _0xdcbc08='';return()=>{if(!_0xdcbc08){const _0x53d7b3=_0x3bc521['toView'](new tt(_0x3ac08b)),_0x2e5a40=_0x3bc521['htmlProcessor']['domConverter']['viewToDom'](_0x53d7b3)['querySelector']('[data-id=\x22'+_0x4c9e74+'\x22]');_0xdcbc08=_0x2e5a40?.['outerHTML']||'';}return _0xdcbc08;};}['_findMarkerElement'](_0xa64b48,_0x2e8160=0x5){let _0xf30ac8=_0xa64b48,_0x41ec76=null;for(let _0x10e889=0x0;_0x10e889<_0x2e8160&&_0xf30ac8;_0x10e889++){if(!_0xf30ac8['className']){_0xf30ac8=_0xf30ac8['parentElement'];continue;}if(!(''+_0xf30ac8['className'])['includes']('ck-ai_review-marker_')){_0xf30ac8=_0xf30ac8['parentElement'];continue;}if(!_0xf30ac8['getAttribute']('data-marker-id'))break;_0x41ec76=_0xf30ac8;break;}return _0x41ec76;}['_findMarkerElementById'](_0x136dca){const _0x1566ef=T(this['context']),_0x353d76=_0x1566ef['model']['markers']['get'](_0x136dca);return _0x353d76?_0x5b13cd(_0x1566ef['editing'],_0x353d76):null;}['_getMarkersDataForGroup'](_0x514c19){return Array['from'](this['_markers']['values']())['filter'](_0x29e491=>_0x29e491['groupId']===_0x514c19);}['_getOperationStart'](_0x4ed1c7){return'insert'===_0x4ed1c7['type']?_0x4ed1c7['position']:_0x4ed1c7['newRange']['start'];}['_getOperationEnd'](_0x3c5b51,_0xea0c35=!0x1){return'insert'===_0x3c5b51['type']?_0xea0c35?_0x3c5b51['position']:_0x3c5b51['position']['getShiftedBy'](_0x3c5b51['howMany']):_0x3c5b51['newRange']['end'];}['_shiftOperation'](_0x16dbdc,_0x3f74fc){return'insert'===_0x16dbdc['type']?_0x16dbdc['position']=_0x16dbdc['position']['getShiftedBy'](_0x3f74fc):'marker'===_0x16dbdc['type']&&_0x16dbdc['newRange']&&(_0x16dbdc['newRange']=new it(_0x16dbdc['newRange']['start']['getShiftedBy'](_0x3f74fc),_0x16dbdc['newRange']['end']['getShiftedBy'](_0x3f74fc))),_0x16dbdc;}['_changeOperationOwnerDocument'](_0x8c3523,_0x8f7b40){'insert'===_0x8c3523['type']?_0x8c3523['position']=this['_changePositionOwnerDocument'](_0x8c3523['position'],_0x8f7b40):'marker'===_0x8c3523['type']&&_0x8c3523['newRange']&&(_0x8c3523['newRange']=this['_changeRangeOwnerDocument'](_0x8c3523['newRange'],_0x8f7b40));}['_changePositionOwnerDocument'](_0x4b11fb,_0x2d1c5c){return new st(_0x2d1c5c,_0x4b11fb['path']);}['_changeRangeOwnerDocument'](_0x4bd92b,_0x3a19e6){return new it(this['_changePositionOwnerDocument'](_0x4bd92b['start'],_0x3a19e6),this['_changePositionOwnerDocument'](_0x4bd92b['end'],_0x3a19e6));}['_changePosition'](_0x59e96a,_0x4bef95){return new st(_0x4bef95,[..._0x59e96a]);}['_changeRange'](_0x3e29c5,_0x1dd590,_0x476064,_0xd65474){return new it(this['_changePosition'](_0x1dd590,_0xd65474),this['_changePosition'](_0x476064,_0xd65474));}['_sortMarkers'](_0x1ee23b){const _0x53ef35=_0x46ef84=>{switch(_0x46ef84){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x1ee23b['sort']((_0x2b9e13,_0x1814dd)=>_0x53ef35(_0x2b9e13['type'])-_0x53ef35(_0x1814dd['type']));}['_hasSameTopLevelElement'](_0x4b7c03,_0x52db42){const _0x5a0a1c=_0x4b7c03['getChild'](0x0),_0x579e13=_0x52db42['getChild'](0x0);return!(!_0x5a0a1c||!_0x579e13)&&((!_0x5a0a1c['is']('element')||!_0x579e13['is']('element')||_0x5a0a1c['name']===_0x579e13['name'])&&!(_0x5a0a1c['is']('element')&&!_0x579e13['is']('element')||!_0x5a0a1c['is']('element')&&_0x579e13['is']('element')));}['_haveSingleTopLevelElement'](_0x26d691){return 0x1===_0x26d691['childCount'];}['_haveOnlyInlineContent'](_0x1cdf7a,_0x41a207){for(const _0x3ec00d of _0x1cdf7a['getChildren']())if(_0x3ec00d['is']('element')&&!_0x41a207['isInline'](_0x3ec00d))return!0x1;return!0x0;}['_upsertDataId'](_0x32410f,_0x49caf2){let _0x330594=_0x32410f['getAttribute'](Ct);return _0x330594||(_0x330594=_0x49caf2(),_0x32410f['_setAttribute'](Ct,_0x330594)),_0x330594;}}class Os extends _0x290e58(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x32f10f,contentNew:_0x277186,contentInitial:_0x2afaa6,documentVersion:_0x363188}){super(),this['id']=_0x32f10f,this['contentNew']=_0x277186,this['contentInitial']=_0x2afaa6,this['documentVersion']=_0x363188;}}class Ks extends ts(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x4850ba,_0x2e9ab4,_0x258cd0){super(),this['id']=_0x4850ba,this['parent']=_0x258cd0,this['_data']=_0x2e9ab4,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']=_0x926b30();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x2a86e2,_0x52aae3,_0x2c41f6,_0x4af768,_0x9d0d36){super(),this['_sourceCheck']=_0x52aae3,this['_documentData']=_0x2a86e2,this['_aiConnector']=_0x2c41f6,this['_reviewParams']=_0x4af768,this['_reviewArgs']=_0x9d0d36,this['on']('change:status',(_0x379af3,_0x4f20d6,_0x1c66a1)=>{'aborted'==_0x1c66a1&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x1c66a1,'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'](_0xb49000=>'pending'===_0xb49000['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x226d28){this['_documentData']=_0x226d28;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x184561=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x372435 of _0x184561)'unmodified'!==_0x372435['data']['operation']&&('error'!==_0x372435['data']['operation']?'review-metadata'!==_0x372435['event']?this['_addReviewCheckResult'](_0x372435['data']['dataId'],_0x372435['data']['textDelta']):this['callId']=_0x372435['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(_0x155643){this['_currentError']=_0x155643,_0x155643 instanceof Error&&_0x155643['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'](_0x247539,_0x4e4edc){const _0x32fcf7=this['_results']['get'](_0x247539);if(!_0x32fcf7)return;if(0x0===_0x4e4edc['length'])return;const _0x172abb=[];_0x4e4edc['forEach']((_0x240498,_0x4a3934)=>{const _0x117a6d=new Ks(_0x32fcf7['id']+'-'+_0x4a3934,_0x240498,_0x32fcf7);_0x117a6d['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x117a6d,'status':_0x117a6d['status']});}),_0x117a6d['on']('change:isActivated',()=>{_0x117a6d['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x117a6d}):this['fire']('reviewCheckResultDeactivated',{'change':_0x117a6d});}),this['_changes']['push'](_0x117a6d),_0x172abb['push'](_0x117a6d);}),this['fire']('reviewCheckResultReady',{'changes':_0x172abb,'result':_0x32fcf7,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x3cb07e){const _0x5b0c9b=this['_changes']['find'](_0x2746b6=>_0x2746b6['id']===_0x3cb07e);return!(!_0x5b0c9b||'pending'!==_0x5b0c9b['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x330537=>!0x0===_0x330537['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x307390=>'pending'===_0x307390['status']);}['getChangeById'](_0x13baa1){return this['_changes']['find'](_0x434429=>_0x434429['id']===_0x13baa1);}['markAllChangesAsAccepted'](){for(const _0x5d9b85 of this['_changes'])'pending'===_0x5d9b85['status']&&(_0x5d9b85['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x21b001){const _0x104989=this['_changes']['find'](_0x3299ce=>_0x3299ce['id']===_0x21b001);_0x104989&&'pending'===_0x104989['status']&&(_0x104989['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x10b18c){const _0x58d5b3=this['_changes']['find'](_0x29ad47=>_0x29ad47['id']===_0x10b18c);_0x58d5b3&&'pending'===_0x58d5b3['status']&&(_0x58d5b3['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x48bfdd){const _0x44e3dd=this['_changes']['find'](_0xd58d3c=>_0xd58d3c['id']===_0x48bfdd);_0x44e3dd&&'pending'===_0x44e3dd['status']&&(_0x44e3dd['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0xee8b78){const _0x326e02=this['_changes']['find'](_0x3d2f20=>_0x3d2f20['id']===_0xee8b78);_0x326e02&&'outdated'===_0x326e02['status']&&(_0x326e02['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x4dba79){this['_changes']['filter'](_0x5acaf9=>_0x5acaf9['isActivated']&&_0x5acaf9['id']!==_0x4dba79)['forEach'](_0x294f7b=>{_0x294f7b['isActivated']=!0x1;});const _0x457850=this['_changes']['find'](_0xa5035f=>_0xa5035f['id']===_0x4dba79);_0x457850&&'pending'===_0x457850['status']&&(_0x457850['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x535f00=>_0x535f00['isActivated'])['forEach'](_0x107ea1=>{_0x107ea1['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0xfb677f){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x483dd4;if(_0xfb677f){const _0x52a7b5=this['_changes']['find'](_0x1a4c38=>_0x1a4c38['id']===_0xfb677f);if(_0x52a7b5&&_0x52a7b5['isRated'])return;_0x52a7b5&&(_0x483dd4=_0x52a7b5['parent']['id'],_0x52a7b5['isRated']=!0x0);}const _0x6da0cc={'positiveCount':this['_changes']['filter'](_0x426a39=>'accepted'===_0x426a39['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x6da0cc,this['callId'],_0x483dd4);}['_addReviewCheckResult'](_0x3bbbb2,_0x4f4454){const _0x2d5511=this['_documentData']['elements']['get'](_0x3bbbb2);if(!_0x2d5511)return;const _0x16ffb5=_0x2d5511['getContent']();if(_0x16ffb5===_0x4f4454)return;const _0x2c6005=new Os({'id':_0x3bbbb2,'contentInitial':_0x16ffb5,'contentNew':_0x4f4454,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x2c6005['id'],_0x2c6005),this['fire']('reviewCheckResultAdded',{'result':_0x2c6005,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x2bc1ba=>'pending'===_0x2bc1ba['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x47468c=>'pending'===_0x47468c['status'])['length']&&(this['status']='finished'));}}class si extends Ws{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0xfd419d=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0xac976d=0x0;_0xac976d<this['_reviewParams']['length'];_0xac976d++){if(!this['_reviewParams'][_0xac976d]||!this['_sourceCheck']['options'][_0xac976d])continue;const _0x47267f=this['_sourceCheck']['options'][_0xac976d],_0x246ccf=_0x47267f['data']?.['find'](_0xf13dd6=>_0xf13dd6['id']===this['_reviewParams'][_0xac976d]);_0x246ccf&&_0xfd419d['push'](_0x246ccf['label']);}return _0xfd419d['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x375889,_0x5ee04e,_0x221abc){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x5ee04e,_0x375889,_0x221abc);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class ve extends _0x575928{['_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(_0x39bc92,_0x39215e)=>{const _0x49a77a=this['_aiReviewCheckList']['getCheckById'](_0x39215e['id']);if(_0x49a77a){this['_onReviewCheckRun'](_0x39215e),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x39215e,_0x49a77a),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x3e9fe5,_0x28c53e)=>{switch(_0x28c53e['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x28c53e);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 _0x36ca17('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new _0x36ca17('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'!==_0x28c53e['status']&&'error-chunk'!==_0x28c53e['status']&&'error-general'!==_0x28c53e['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x234696,_0x410504)=>{if(!this['_currentReviewCheckRun'])throw new _0x36ca17('ai-review-mode-no-current-check-run',this);const _0x2d3257=this['_diffContent'](_0x410504['result']['contentInitial'],_0x410504['result']['contentNew']);_0x410504['source']['addResultChanges'](_0x410504['result']['id'],_0x2d3257);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x277b30,_0x26cb16)=>{for(const _0x2f02e4 of _0x26cb16['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x2f02e4);this['_markChangePositionInEditorContent'](_0x26cb16['changes'],_0x26cb16['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x5eeb14,_0x42499f)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x42499f['change']['id'],_0x42499f['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x39db26,_0x30825e)=>{this['_onReviewCheckResultActivated'](_0x30825e);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x55916e){_0x55916e instanceof Error&&_0x55916e['message']['includes']('ai-request-aborted')||(_0x55916e instanceof _0x36ca17?this['_logError'](_0x55916e):this['_logError'](new _0x36ca17('ai-review-mode-check-run-failed',this,void 0x0,_0x55916e)));}}else this['_logError'](new _0x36ca17('ai-review-mode-source-check-not-found',this,{'checkId':_0x39215e['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 _0x58afdd=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x58afdd['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x58afdd['map'](_0x1354b7=>_0x1354b7['id']));const _0x556b01=this['_currentReviewCheckRun'];_0x556b01['markAllChangesAsAccepted'](),_0x556b01['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x29b4b2,_0x5e11da)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x5e11da['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x5e11da['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x5e11da['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x5e11da['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x469cd8,_0x1b1b50)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x1b1b50['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x1b1b50['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x1b1b50['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x1b1b50['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',(_0x2e5383,_0x582567)=>{this['_onActivateChange'](_0x582567);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x37e06e,_0x541ec5)=>{this['_onDeactivateChange'](_0x541ec5);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x3cf161,_0x22c139)=>{this['_onChangeMarkerClicked'](_0x3cf161,_0x22c139);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x7ec579,_0x333fcd)=>{this['_onChangeMarkerHovered'](_0x7ec579,_0x333fcd);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x132ec8,_0x1d5be1)=>{this['_onChangeMarkerRemoved'](_0x132ec8,_0x1d5be1);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x520bbf,_0x541f23)=>{this['_onChangeMarkerRestored'](_0x520bbf,_0x541f23);});}['_createReviewCheckRun'](_0x285729,_0x570f5a){return new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0x570f5a,this['_aiConnector'],_0x285729['params'],_0x285729['args']);}['_onChangeMarkerRemoved'](_0x1f49cf,_0x4c2886){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x4c2886['changeId']);}['_onChangeMarkerRestored'](_0x37be8b,_0x564421){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x564421['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x4dc6e7=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x4dc6e7&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x3ba790=this['_aiReviewCoreEditing']['getEditor']();_0x3ba790&&_0x3ba790['editing']['view']['change'](_0x4d555c=>{const _0x310cca=_0x3ba790['editing']['view']['document']['getRoot']();_0x4d555c['removeClass']('ck-ai_review-diff',_0x310cca),_0x4d555c['removeClass']('ck-ai_review-highlights',_0x310cca),_0x4d555c['removeClass']('ck-ai-translate-mode-content',_0x310cca);});}['_getTranslationWithDefault'](_0x5d664d,_0xae229d){const _0xb40630=i(this['context']['locale'],_0x5d664d);return _0xb40630===_0x5d664d?_0xae229d:_0xb40630;}['_logError'](_0x2548d3,_0x41bb93=!0x1){gt(_0x2548d3['message']),_0x41bb93||(_0x2548d3['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x217d23){if('content'===this['_changeActivationSource']){const _0x5f10d9=this['_aiReviewCoreUi']['getChangeElement'](_0x217d23);_0x5f10d9&&_0x3c5789(_0x5f10d9['closest']('.ck-ai_review__check-run-result')||_0x5f10d9);}else{if('panel'===this['_changeActivationSource']){const _0x4caf9b=this['_getChangeContentElement'](_0x217d23);if(!_0x4caf9b)return;_0x538b49({'target':_0x4caf9b,'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(_0x16be28){this['id']=_0x16be28['id'],this['commandId']=_0x16be28['commandId'],this['title']=_0x16be28['title'],this['description']=_0x16be28['description'],this['isParameterized']=_0x16be28['isParameterized'],this['useArgs']=_0x16be28['useArgs'],this['options']=_0x16be28['options'],this['args']=_0x16be28['args'];}}class vo extends ts(){['_checks']=[];['setupChecks'](_0x19c738){this['_checks']=_0x19c738['map'](_0x38fc76=>new Js(_0x38fc76));}get['checks'](){return this['_checks'];}['getCheckById'](_0x4322a3){return this['checks']['find'](_0x147139=>_0x147139['id']===_0x4322a3);}['removeCheckById'](_0x8b2d9b){this['_checks']=this['_checks']['filter'](_0xee0472=>_0xee0472['id']!==_0x8b2d9b);}}class ke extends Js{['_models']=[];['_defaultModel']=null;constructor(_0x3af0c0,_0x240b25,_0x2b0597){super(_0x3af0c0),this['_models']=_0x240b25,this['_defaultModel']=_0x2b0597;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class Ie extends Js{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x242bfb,_0x4b155a,_0x559c0d){super(_0x242bfb),this['prompt']=_0x242bfb['prompt'],this['model']=_0x242bfb['model'],this['model']?this['_defaultModel']=_0x4b155a['find'](_0x2b39b1=>_0x2b39b1['id']===this['model'])||null:this['_defaultModel']=_0x559c0d;}get['defaultModel'](){return this['_defaultModel'];}}class _e extends vo{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0xa51e5,_0x293400,_0x4be602){super(),this['_allModels']=_0xa51e5,this['_recommendedModels']=_0x293400,this['_defaultModel']=_0x4be602;}['setupChecks'](_0x15ea72){this['_checks']=_0x15ea72['map'](_0x2be578=>!0x0===_0x2be578['isExtra']?new Ie(_0x2be578,this['_allModels'],this['_defaultModel']):'custom'===_0x2be578['id']?new ke(_0x2be578,this['_recommendedModels'],this['_defaultModel']):new Js(_0x2be578));}}class Ce extends Ws{['_prompt'];['_model'];constructor(_0x530c40,_0x507651,_0x240519,_0x1c5656,_0x10fbc5){super(_0x240519,_0x1c5656,_0x10fbc5),this['_prompt']=_0x530c40,this['_model']=_0x507651;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x27f878,_0x53da28,_0x5a9f37){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x53da28,_0x27f878,_0x5a9f37);}}class Re extends Ce{get['subTitle'](){return'';}set['prompt'](_0x180672){this['_prompt']=_0x180672;}set['model'](_0x49ba5e){this['_model']=_0x49ba5e;}}class pe extends ve{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x141438){super(_0x141438),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',we['map'](_0x2d55c5=>_0x2d55c5['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x86e881,_0x4beee6)=>{this['_isDiffOn']=_0x4beee6['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x126998,_0x3c3a0b){return _0x126998['isCustom']?new Ce(_0x126998['args']['prompt'],_0x126998['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x3c3a0b,this['_aiConnector']):_0x3c3a0b['isExtra']?new Re(_0x3c3a0b['prompt'],_0x3c3a0b['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x3c3a0b,this['_aiConnector']):new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0x3c3a0b,this['_aiConnector'],_0x126998['params'],_0x126998['args']);}['_onReviewCheckResultActivated'](_0x4359d9){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x4359d9['change']['id']),this['_scrollToChange'](_0x4359d9['change']['id']);const _0x511a9d=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x4359d9['change']['id']);if(!_0x511a9d)return;const _0x400785=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x4359d9['change'],()=>_0x511a9d['getElement'](),void 0x0,'click',_0x400785?.['editing']?.['view']?.['getDomRoot'](),_0x400785?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x4359d9['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x118cf3){this['_currentReviewCheckRun']&&'click'===_0x118cf3['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x118cf3['id']));}['_onDeactivateChange'](_0x1e3d24){this['_currentReviewCheckRun']&&'balloon'===_0x1e3d24['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x2c5843,_0x223a5c){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x223a5c['changeId']);const _0x18ac58=this['_currentReviewCheckRun']['getChangeById'](_0x223a5c['changeId']);if(!_0x18ac58)return;const _0x2116ab=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x18ac58,_0x223a5c['markerElement'],_0x223a5c['domEvent'],'click',_0x2116ab?.['editing']?.['view']?.['getDomRoot'](),_0x2116ab?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x395a86,_0x2847e8){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x43672c=this['_currentReviewCheckRun']['getChangeById'](_0x2847e8['changeId']);if(!_0x43672c)return;const _0x2a5c5f=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x43672c,_0x2847e8['markerElement'],_0x2847e8['domEvent'],'hover',_0x2a5c5f?.['editing']?.['view']?.['getDomRoot'](),_0x2a5c5f?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x5f42dd){const _0x40ede9=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x5f42dd);return _0x40ede9?_0x40ede9['getElement']():null;}['_markChangePositionInEditorContent'](_0x1bf8fd,_0x5b81ed){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x1bf8fd,_0x5b81ed);}['_diffContent'](_0x1f6146,_0x48ccf1){return this['_aiReviewCoreEditing']['diffContent'](_0x1f6146,_0x48ccf1);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x30a1b8){const _0x526c56=this['_aiReviewCoreEditing']['getEditor']();_0x30a1b8?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x526c56&&_0x526c56['editing']['view']['change'](_0x16eb6b=>{const _0x41ad6e=_0x526c56['editing']['view']['document']['getRoot']();for(const _0x2f47f9 of _0x41ad6e['getClassNames']())_0x2f47f9['startsWith']('ck-ai_review-')&&_0x16eb6b['removeClass'](_0x2f47f9,_0x41ad6e);_0x16eb6b['addClass'](_0x30a1b8?'ck-ai_review-diff':'ck-ai_review-highlights',_0x41ad6e);});}async['_getChecksList'](){const _0x45c087=[...we,...this['_getExtraChecks']()],_0x3a20c5=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x3a20c5,_0x45c087);let _0x119752=_0x45c087;this['_hasDefaultAvailableCommands']||(_0x119752=_0x3a20c5['map'](_0x3fa8be=>_0x45c087['find'](_0x2a2cc5=>_0x2a2cc5['id']===_0x3fa8be))['filter'](_0x516d57=>!!_0x516d57)),_0x119752=_0x119752['map'](_0x1ba689=>_0x1ba689['isExtra']?_0x1ba689:this['_translateReviewCheck'](_0x1ba689));const _0xf0ca97=_0x119752['some'](_0x52403e=>_0x52403e['isExtra']||'custom'===_0x52403e['id']);let _0xf2598b=[],_0x58ce4c=[],_0x329404=null;if(_0xf0ca97){const _0x29ced6=await this['_getModels']();_0xf2598b=_0x29ced6['all'],_0x58ce4c=_0x29ced6['recommended'],_0x329404=_0x29ced6['default'];}const _0x270672=new _e(_0xf2598b,_0x58ce4c,_0x329404);return _0x270672['setupChecks'](_0x119752),_0xf0ca97&&this['_filterChecksWithMissingModel'](_0x270672),_0x270672;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x6cd4e9=>({'id':_0x6cd4e9['id'],'commandId':_0x6cd4e9['id'],'title':_0x6cd4e9['label'],'description':_0x6cd4e9['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x6cd4e9['prompt'],'model':_0x6cd4e9['model']}));}['_logErrorForNonExistentChecks'](_0x295413,_0x3cb722){const _0x333eb9=_0x295413['filter'](_0x233c1b=>!_0x3cb722['some'](_0x124915=>_0x124915['id']===_0x233c1b));_0x333eb9['length']&&this['_logError'](new _0x36ca17('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x333eb9['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x2de5e7=new It({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x2de5e7['getAll'](),'recommended':await _0x2de5e7['getAvailableModels'](),'default':await _0x2de5e7['getDefault']()};}catch(_0x1e5de0){return this['_logError'](new _0x36ca17('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x1e5de0)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x4850d7){const _0x14498='AI_REVIEW_CHECK_'+_0x4850d7['id']['toUpperCase']()['replaceAll']('-','_'),_0xe20bbb={..._0x4850d7,'title':this['_getTranslationWithDefault'](_0x14498+'_TITLE',_0x4850d7['title']),'description':this['_getTranslationWithDefault'](_0x14498+'_DESCRIPTION',_0x4850d7['description'])};return _0x4850d7['options']&&(_0xe20bbb['options']=_0x4850d7['options']['map'](_0x523ef9=>({..._0x523ef9,'label':this['_getTranslationWithDefault'](_0x14498+'_OPTIONS_LABEL',_0x523ef9['label']||''),'data':_0x523ef9['data']?_0x523ef9['data']['map'](_0x4c0d76=>({..._0x4c0d76,'label':this['_getTranslationWithDefault'](_0x14498+'_OPTIONS_DATA_'+_0x4c0d76['id']['toUpperCase'](),_0x4c0d76['label'])})):void 0x0}))),_0xe20bbb;}['_filterChecksWithMissingModel'](_0x489083){const _0x3499f1=[];_0x489083['checks']['forEach'](_0x332517=>{(_0x332517 instanceof Ie&&!_0x332517['defaultModel']||_0x332517 instanceof ke&&!_0x332517['models']['length'])&&_0x3499f1['push'](_0x332517['id']);}),_0x3499f1['length']&&_0x3499f1['forEach'](_0x2e9a13=>{_0x489083['removeCheckById'](_0x2e9a13),this['_logError'](new _0x36ca17('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x2e9a13}),!0x0);});}}class Ka extends _0x575928{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'](_0x17c955){this['_checks']=_0x17c955['map'](_0x52ccf5=>new jr(_0x52ccf5));}}class Se extends si{['_title'];constructor(_0x178127,_0x4e15bd,_0x29b03e,_0x41a694,_0x1e67ab,_0x51aa82){super(_0x178127,_0x4e15bd,_0x29b03e,_0x1e67ab,_0x51aa82),this['_title']=_0x41a694;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class rr extends ve{static get['pluginName'](){return'AITranslateController';}constructor(_0x2155c2){super(_0x2155c2),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'](_0x57572b,_0x3770e9){return new Se(this['_aiReviewCoreEditing']['getDocumentData'](),_0x3770e9,this['_aiConnector'],i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x57572b['params'],_0x57572b['args']);}['_onReviewCheckResultActivated'](_0x3eddfc){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x3eddfc['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x3eddfc['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x20319c){this['_currentReviewCheckRun']&&('hover'===_0x20319c['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x20319c['id'])),'click'===_0x20319c['uiInteraction']&&this['_scrollToChange'](_0x20319c['id']));}['_onDeactivateChange'](_0xc3396){this['_currentReviewCheckRun']&&'panel'===_0xc3396['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0xb33e6d,_0x843fa5){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x843fa5['changeId']),this['_scrollToChange'](_0x843fa5['changeId']));}['_onChangeMarkerHovered'](_0x2d977c,_0x423167){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x423167['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x423167['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x1909ac){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x1909ac);}['_markChangePositionInEditorContent'](_0x369754,_0x27603d){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x369754,_0x27603d);}['_diffContent'](_0x4ebce7,_0x29631a){return this['_aiReviewCoreEditing']['diffContent'](_0x4ebce7,_0x29631a,!0x0);}['_onReviewCheckRun'](){const _0x367226=this['_aiReviewCoreEditing']['getEditor']();_0x367226&&_0x367226['editing']['view']['change'](_0x3a02a7=>{const _0x4ac0cf=_0x367226['editing']['view']['document']['getRoot']();for(const _0x341a08 of _0x4ac0cf['getClassNames']())(_0x341a08['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0x341a08)&&_0x3a02a7['removeClass'](_0x341a08,_0x4ac0cf);_0x3a02a7['addClass']('ck-ai-translate-mode-content',_0x4ac0cf);});}async['_getChecksList'](){const _0x1f92e8=[],_0x50f386=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x1281d6 of _0x50f386)_0x1f92e8['push']({'title':_0x1281d6['label'],'id':_0x1281d6['id'],'commandId':_0x1281d6['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x1281d6['id']}});const _0x2e9435=new Pe();return _0x2e9435['setupChecks'](this['_translateChecks'](_0x1f92e8)),_0x2e9435;}['_translateChecks'](_0x4279fe){return _0x4279fe['map'](_0x42390e=>{const _0x3c3b1d='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x42390e['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x42390e,'title':this['_getTranslationWithDefault'](_0x3c3b1d,_0x42390e['title'])};});}}class Le extends Ve{constructor(_0x3eb8bb,_0x1b2249){super(_0x3eb8bb,_0x1b2249),this['on']('set:isLoading',(_0x2047f3,_0x54ace8,_0xd0cce6)=>{_0xd0cce6&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x4a73c7,_0x35427b,_0x3fc201)=>{_0x3fc201&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x448729=super['_createAcceptAllButtonView']();return _0x448729['set']('label',i(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x448729;}['_createExitReviewButtonView'](){const _0x5659d4=super['_createExitReviewButtonView']();return _0x5659d4['set']('label',i(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x5659d4;}}class Ne extends je{['_setupTemplate'](){const _0x20f4a2=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x20f4a2['if']('isVisible','ck-hidden',_0x1d6139=>!_0x1d6139)]},'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',_0x20f4a2['if']('isVisible','ck-hidden',_0x4a382e=>!_0x4a382e)]},'children':this['_checkViews']}]});}}class tr extends Me{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x2dc019=this['context']['locale'],_0x11d4ea=new _0x41e0a3(_0x2dc019,{'label':i(_0x2dc019,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x6cdaad,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x53e492=new Ae(_0x2dc019,{'header':_0x11d4ea,'list':new Ne(_0x2dc019),'results':new Le(_0x2dc019,{'generalErrorText':i(_0x2dc019,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new be(_0x2dc019,{'headerText':i(_0x2dc019,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':i(_0x2dc019,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0x2dc019,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x53e492['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x53e492;}['registerTab'](){const _0x3f2985=this['context']['plugins']['get']('AITabs');_0x3f2985['view']['on']('activateTab',(_0x2b3b22,_0x2018d3)=>{'translate'===_0x2018d3?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x3f2985['view']['addTab']({'id':'translate','buttonLabel':i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x6cdaad,'order':0x0,'content':this['_mainView']});}}class Wa extends _0x575928{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 _0x361c0d,Command as Lt,ContextPlugin as _0x3a5602,Editor as _0x2cda04}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x41a51c,IconCheck as _0x24d29c,IconError as _0xf1053e,IconSubmit as _0x40c783,IconAIHistory as Nt,IconMagicWand as _0x3699a1,IconRobotPencil as _0x152ed0,IconMaximize as _0x3ff106,IconMinimize as _0x2e4568,IconShowChangesOn as _0x2f2c13,IconShowChangesOff as _0x189462,IconDocument as _0x53a0ad,IconBoxWithCross as _0x1e26a1,IconBoxWithCheck as _0x327ee4,IconBoxWithMarker as _0x40fbce,IconInfo as _0x169d70,IconLoupe as _0x4c94fe,IconCancel as _0x4718d2,IconStop as _0x197784,IconAIChat as Et,IconPlus as _0x1fce8d,IconPin as _0x404f94,IconThreeHorizontalDots as _0x214ca4,IconChevronDown as _0x179898,IconChevronUp as _0x2ca36b,IconOutdated as _0x42666d,IconEye as _0x59f2c5,IconEyeCrossedOut as _0x359228,IconChevronRight as _0x215c94,IconAIReview as _0x4081d8,IconAITranslate as _0x20e0a0}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x48eb5e,CKEditorError as _0x563e6a,ObservableMixin as ts,global as _0x44426a,isVisible as _0x334b9e,Rect as _0x4b725e,Collection as _0x7916ba,FocusTracker as _0x5f2dfb,KeystrokeHandler as _0x15425,first as _0x42aa06,logWarning as _0xa8aac2,logError as _0x4e5dbd,toArray as _0x5f0c81,EmitterMixin as _0x5bd7c6,scrollViewportToShowTarget as _0x1fa956,scrollAncestorsToShowTarget as _0x54a145,ResizeObserver as _0x592694,_isMotionReduced as mt,getConstrainedViewportRect as _0x117236,DomEmitterMixin as _0x3423db}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x14c71e,ButtonView as _0x2cf640,View as _0xc3e5b1,SpinnerView as _0x559c75,IconView as _0x59b3d9,AutocompleteView as _0xf03a68,ListView as _0x163c9e,ListItemGroupView as _0x4cfb21,ListItemView as _0x663ac1,ButtonLabelView as _0x23a78e,FocusCycler as _0x1af4a5,createLabeledTextarea as _0xbfd767,Dialog as _0x3a1450,createDropdown as _0x3e48f8,addMenuToDropdown as _0x4923a2,MenuBarMenuView as _0x580086,MenuBarMenuListItemButtonView as _0x226c2e,DialogViewPosition as _0x1c5421,MenuBarMenuListView as _0x3dd394,MenuBarMenuListItemView as _0x30af6d,BodyCollection as _0x340c25,BalloonPanelView as _0x5442ef,clickOutsideHandler as _0x1d212b,addListToDropdown as _0x5aa31c,UIModel as _0x201273,submitHandler as _0x28e7fc,LabeledFieldView as _0x16298f,createLabeledInputText as th,FormHeaderView as _0x1e299f,HighlightedTextView as _0x19afdf,ViewCollection as _0xf5a45d,FileDialogButtonView as _0x538cbe,InputTextView as _0x4a24d0,SearchTextView as _0x56da7a,ListItemButtonView as _0x4e6947,ButtonLabelWithHighlightView as _0x49352c,DropdownMenuPanelPositioningFunctions as _0x3770f5,BalloonToolbar as te,FormRowView as _0x42755e,TextareaView as _0x2fe62a}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x40b091,ClipboardMarkersUtils as _0x5a0b98}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x2e4e75,ViewDataTransfer as _0x181e06,ViewUpcastWriter as _0x25de84,Matcher as _0x2901ef,_DetachOperation as lt,_insertIntoModelNodeList as _0x296e10,_removeFromModelNodeList as to,ModelRange as dt,transformOperationSets as kt,ViewDowncastWriter as Dt,ModelDocumentFragment as bt,ModelPosition as vt,ModelTreeWalker as _0x1f3d99,MarkerOperation as _0x2a897f,InsertOperation as _0x4675cd}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x4a8a27,escape as _0x528e40,escapeRegExp as _0x15b1ec,debounce as _0x49634e}from'es-toolkit/compat';import{createParser as $t}from'eventsource-parser';import{parseDocument as _0x4b17c9}from'htmlparser2';import{isTag as _0x40e032,findOne as gt,getParent as _0x4708b7,findAll as _0x4c7e33,removeElement as _0x12acc3,replaceElement as _0xd8634b,prepend as _0x4856b5,prependChild as _0x8342b6,appendChild as _0xadca60,append as _0x43ba66,find as _0x284730,isComment as _0x38b3c0,getChildren as _0x3a470b,textContent as _0x1099ea}from'domutils';import _0x17e525 from'dom-serializer';import{Document as _t,Element as _0x504ef3,Text as _0x201b94,cloneNode as _0x38bb01,isDocument as _0x82e93c,isText as _0x207546,NodeWithChildren as _0x409cd6}from'domhandler';import{MarkdownGfmMdToHtml as _0x499648}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x5df738,DocumentCompare as ot,DATA_ID_MODEL_ATTRIBUTE as nt,ConfirmMixin as _0x28ab1a,LateFocusDropdownButtonView as _0x3c46f6,getAllMarkersDomElementsSorted as _0x18a8b5,SuggestionsConversion as zt,DATA_ID_VIEW_ATTRIBUTE as _0x5b56f8,getMarkerDomElement as _0xce5e3b}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x4f0e8d}from'es-toolkit';import _0x352e48 from'morphdom';import{IconWeb as _0xd8346c,IconClose as _0x3daaaf,IconDocument as _0x2ff8c2,IconSelection as _0x413c92,IconFileUpload as _0x4d62fe,IconLink as _0xa0ac3e,IconBulb as _0xd8dd72,IconAI as _0x51d4bb,IconPreviousArrow as _0x5d4f8c,IconCheck as _0x2b7211,IconDocumentOutline as _0x5313d0,IconPaperClip as _0x3b2e9c,IconBrowseFiles as _0x3e59fd,IconDropdownArrow as _0x468b06,IconAIChat as _0x382801,IconAIReview as _0x17e3b2,IconAITranslate as Vt,IconAIAskAI as _0x2ab699,IconThumbUp as _0x2ea5c6,IconThumbDown as _0x427eb3,IconCopy as _0x571e92,IconShowChangesOff as _0x1c481d,IconShowChangesOn as _0x339447,IconAIQuickActions as yt,IconAIChatCommands as Gt,IconAIImproveWriting as Bt,IconAIContinueWriting as Ft,IconAIGrammarCheck as Wt,IconAIAdjustLength as Kt,IconAIChangeTone as Yt,IconAIOther as Jt,IconRefresh as _0x42e42d,IconNextArrow as _0x254ba8}from'@ckeditor/ckeditor5-icons/dist/index.js';import{diffArrays as _0x411a1f}from'diff';const x='_ungrouppedCommands';function o(_0x305070,_0x160d43){const _0x51eecc=(0x0,_0x160d43['t'])('Other');return _0x305070['length']?'groupId'in _0x305070[0x0]?_0x305070:[{'groupId':x,'groupLabel':_0x51eecc,'order':0x1/0x0,'commands':_0x305070}]:[{'groupId':x,'groupLabel':_0x51eecc,'order':0x1/0x0,'commands':[]}];}const Gn=globalThis['DataTransfer'],f='ai-ui';class a extends _0x361c0d{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x36bd6e}=this,_0x5f3143=['ck-fake-ai-selection'];_0x36bd6e['config']['get']('ai.assistant.useTheme')&&_0x5f3143['push']('ck-ai-assistant-ui_theme'),_0x36bd6e['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x5f3143,'priority':0xc}}),_0x36bd6e['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x31d114,{writer:_0x491e8d})=>{if(!_0x31d114['markerRange']['isCollapsed'])return null;const _0x29b214=_0x491e8d['createUIElement']('span');return _0x491e8d['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x29b214),_0x29b214;}});}['afterInit'](){!async function(_0x529653){const _0x3215ef=_0x38b0ea([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]),_0x1aaed3=0x3dffc4e1,_0x496827=0x3df84e89^_0x1aaed3,_0x226b71=window[_0x38b0ea([0x44,0x61,0x74,0x65])][_0x38b0ea([0x6e,0x6f,0x77])](),_0x2d2517=_0x529653[_0x38b0ea([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x58ce3b=new window[(_0x38b0ea([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3043a0=>{_0x2d2517[_0x38b0ea([0x6f,0x6e,0x63,0x65])](_0x38b0ea([0x72,0x65,0x61,0x64,0x79]),_0x3043a0);}),_0x55126f={[_0x38b0ea([0x6b,0x74,0x79])]:_0x38b0ea([0x45,0x43]),[_0x38b0ea([0x75,0x73,0x65])]:_0x38b0ea([0x73,0x69,0x67]),[_0x38b0ea([0x63,0x72,0x76])]:_0x38b0ea([0x50,0x2d,0x32,0x35,0x36]),[_0x38b0ea([0x78])]:_0x38b0ea([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]),[_0x38b0ea([0x79])]:_0x38b0ea([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]),[_0x38b0ea([0x61,0x6c,0x67])]:_0x38b0ea([0x45,0x53,0x32,0x35,0x36])},_0x2d55bc=_0x2d2517[_0x38b0ea([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x38b0ea([0x67,0x65,0x74])](_0x38b0ea([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0xc2b078(){let _0x395eaf,_0xb19453=null,_0x55399c=null;try{if(_0x2d55bc==_0x38b0ea([0x47,0x50,0x4c]))return _0x38b0ea([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x395eaf=_0x499965(),!_0x395eaf)return _0x38b0ea([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x395eaf[_0x38b0ea([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x55399c=_0x445858(_0x395eaf[_0x38b0ea([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x395eaf[_0x38b0ea([0x6a,0x74,0x69])])),await _0x3c17b9()?_0xb68e14()?_0x379427()?_0x38b0ea([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x5ee40e()?(_0x395eaf[_0x38b0ea([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x38b0ea([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0xb19453=_0x5ade40(_0x38b0ea([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0xd7f128()):_0x38b0ea([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x38b0ea([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x38b0ea([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x38b0ea([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x379427(){const _0x23f30d=[_0x38b0ea([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x38b0ea([0x74,0x72,0x69,0x61,0x6c])][_0x38b0ea([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x395eaf[_0x38b0ea([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x226b71/0x3e8:0xe10*_0x496827;return _0x395eaf[_0x38b0ea([0x65,0x78,0x70])]<_0x23f30d;}function _0xb68e14(){const _0x26734b=_0x395eaf[_0x38b0ea([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x26734b&&(!!_0x26734b[_0x38b0ea([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x38b0ea([0x2a]))||!!_0x26734b[_0x38b0ea([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x38b0ea([0x41,0x49])));}function _0x5ee40e(){const _0x3bf70f=_0x395eaf[_0x38b0ea([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x3bf70f||0x0==_0x3bf70f[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x3a5f35}=new URL(window[_0x38b0ea([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x3bf70f[_0x38b0ea([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3a5f35))return!0x0;const _0x5ad4b6=_0x3a5f35[_0x38b0ea([0x73,0x70,0x6c,0x69,0x74])](_0x38b0ea([0x2e]));return _0x3bf70f[_0x38b0ea([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x26540a=>_0x26540a[_0x38b0ea([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x38b0ea([0x2a])))[_0x38b0ea([0x6d,0x61,0x70])](_0x39ab84=>_0x39ab84[_0x38b0ea([0x73,0x70,0x6c,0x69,0x74])](_0x38b0ea([0x2e])))[_0x38b0ea([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x5b9324=>_0x5b9324[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x5ad4b6[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x38b0ea([0x6d,0x61,0x70])](_0x32d6fe=>Array(_0x5ad4b6[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x32d6fe[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x38b0ea([0x66,0x69,0x6c,0x6c])](_0x32d6fe[0x0]===_0x38b0ea([0x2a])?_0x38b0ea([0x2a]):'')[_0x38b0ea([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x32d6fe))[_0x38b0ea([0x73,0x6f,0x6d,0x65])](_0x1db9da=>_0x5ad4b6[_0x38b0ea([0x65,0x76,0x65,0x72,0x79])]((_0x3b61a7,_0x45ccde)=>_0x1db9da[_0x45ccde]===_0x3b61a7||_0x1db9da[_0x45ccde]===_0x38b0ea([0x2a])));}function _0xd7f128(){return _0xb19453&&_0x55399c?new window[(_0x38b0ea([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x27465f,_0xc12655)=>{_0xb19453[_0x38b0ea([0x74,0x68,0x65,0x6e])](_0x27465f,_0xc12655),_0x55399c[_0x38b0ea([0x74,0x68,0x65,0x6e])](_0x112ee4=>{_0x112ee4!=_0x38b0ea([0x56,0x61,0x6c,0x69,0x64])&&_0x27465f(_0x112ee4);},_0xc12655);}):_0xb19453||_0x55399c||_0x38b0ea([0x56,0x61,0x6c,0x69,0x64]);}}function _0x445858(_0x118b52,_0x368355){return new window[(_0x38b0ea([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5c5d0a=>{if(_0x4e7f3f())return _0x5c5d0a(_0x38b0ea([0x56,0x61,0x6c,0x69,0x64]));_0x2e9c1d(),_0x2d2517[_0x38b0ea([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x38b0ea([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x4d475c=!0x1;const _0x3b4f31=_0x48eb5e();function _0x20d468(_0x424ad1){return!!_0x424ad1&&(typeof _0x424ad1===_0x38b0ea([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x424ad1===_0x38b0ea([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x424ad1[_0x38b0ea([0x74,0x68,0x65,0x6e])]===_0x38b0ea([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x424ad1[_0x38b0ea([0x63,0x61,0x74,0x63,0x68])]===_0x38b0ea([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x57667e(_0x4d29af){_0x5af4d1(_0x4d29af)[_0x38b0ea([0x74,0x68,0x65,0x6e])](_0x2cae4b=>{if(!_0x2cae4b||_0x2cae4b[_0x38b0ea([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x38b0ea([0x6f,0x6b]))return _0x38b0ea([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x587310(_0x501f09(_0x3b4f31+_0x368355))!=_0x2cae4b[_0x38b0ea([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x38b0ea([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x38b0ea([0x56,0x61,0x6c,0x69,0x64]);})[_0x38b0ea([0x74,0x68,0x65,0x6e])](_0x2d137f=>(_0x313115(),_0x2d137f),()=>{const _0x19fc6=_0x26d082();return null==_0x19fc6?(_0x313115(),_0x38b0ea([0x56,0x61,0x6c,0x69,0x64])):_0x38b0ea(_0x226b71-_0x19fc6>(0x19f340e1^_0x1aaed3)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x38b0ea([0x74,0x68,0x65,0x6e])](_0x5c5d0a)[_0x38b0ea([0x63,0x61,0x74,0x63,0x68])](()=>{_0x5c5d0a(_0x38b0ea([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x32871a=0x3dc92a61^_0x1aaed3;function _0x313115(){const _0x361bc2=_0x38b0ea([0x6c,0x6c,0x63,0x74,0x2d])+_0x587310(_0x501f09(_0x118b52)),_0x18aa49=_0x42a561(_0x587310(window[_0x38b0ea([0x4d,0x61,0x74,0x68])][_0x38b0ea([0x63,0x65,0x69,0x6c])](_0x226b71/_0x32871a)));window[_0x38b0ea([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x38b0ea([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x361bc2,_0x18aa49);}function _0x26d082(){const _0x4612b2=_0x38b0ea([0x6c,0x6c,0x63,0x74,0x2d])+_0x587310(_0x501f09(_0x118b52)),_0x4a33fe=window[_0x38b0ea([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x38b0ea([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4612b2);return _0x4a33fe?window[_0x38b0ea([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x42a561(_0x4a33fe),0x10)*_0x32871a:null;}function _0x5af4d1(_0xa8beb8){return new window[(_0x38b0ea([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3cf106,_0x1f94ee)=>{_0xa8beb8[_0x38b0ea([0x74,0x68,0x65,0x6e])](_0x3cf106,_0x1f94ee),window[_0x38b0ea([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x1f94ee,0x3dfe1021^_0x1aaed3);});}}_0x2d2517[_0x38b0ea([0x6f,0x6e])](_0x38b0ea([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x47771f,_0x30901e)=>{if(_0x30901e[0x0]!=_0x118b52)return _0x5c5d0a(_0x38b0ea([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x30901e[0x1]={..._0x30901e[0x1],[_0x38b0ea([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x3b4f31};},{[_0x38b0ea([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x38b0ea([0x68,0x69,0x67,0x68])}),_0x2d2517[_0x38b0ea([0x6f,0x6e])](_0x38b0ea([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x83157c=>{_0x20d468(_0x83157c[_0x38b0ea([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x4d475c=!0x0,_0x57667e(_0x83157c[_0x38b0ea([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x38b0ea([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x38b0ea([0x6c,0x6f,0x77])}),_0x58ce3b[_0x38b0ea([0x74,0x68,0x65,0x6e])](()=>{_0x4d475c||_0x5c5d0a(_0x38b0ea([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x4e7f3f(){return _0x2d2517[_0x38b0ea([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x38b0ea([0x76,0x69,0x65,0x77])][_0x38b0ea([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x38b0ea([0x61,0x75,0x74,0x6f]);}function _0x2e9c1d(){_0x2d2517[_0x38b0ea([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x38b0ea([0x76,0x69,0x65,0x77])][_0x38b0ea([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x38b0ea([0x61,0x75,0x74,0x6f]);}}function _0x5ade40(_0x47206a){const _0x5801a7=[new window[(_0x38b0ea([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x30680e=>setTimeout(_0x30680e,0x3df6fa2d^_0x1aaed3)),_0x58ce3b[_0x38b0ea([0x74,0x68,0x65,0x6e])](()=>new window[(_0x38b0ea([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x74c70=>{let _0x36de49=0x0;_0x2d2517[_0x38b0ea([0x6d,0x6f,0x64,0x65,0x6c])][_0x38b0ea([0x6f,0x6e])](_0x38b0ea([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x1acab6,_0x4f7e0d)=>{_0x4f7e0d[0x0][_0x38b0ea([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x36de49++,_0x36de49==(0x3dffc109^_0x1aaed3)&&(_0x74c70(),_0x1acab6[_0x38b0ea([0x6f,0x66,0x66])]());});}))];return window[_0x38b0ea([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x38b0ea([0x72,0x61,0x63,0x65])](_0x5801a7)[_0x38b0ea([0x74,0x68,0x65,0x6e])](()=>_0x47206a);}async function _0x27ab30(){await _0x58ce3b,_0x2d2517[_0x38b0ea([0x6d,0x6f,0x64,0x65,0x6c])][_0x38b0ea([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x29a874,_0x2d2517[_0x38b0ea([0x6d,0x6f,0x64,0x65,0x6c])][_0x38b0ea([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x29a874,_0x2d2517[_0x38b0ea([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x38b0ea([0x6d,0x6f,0x64,0x65,0x6c]));}function _0xcdc8b5(_0x116b67){const _0x1239da=_0x287745();_0x2d2517[_0x1239da]=_0x38b0ea([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x116b67,_0x116b67!=_0x38b0ea([0x56,0x61,0x6c,0x69,0x64])&&_0x27ab30();}function _0x287745(){const _0x57520c=window[_0x38b0ea([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x38b0ea([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x38b0ea([0x6e,0x6f,0x77])]())[_0x38b0ea([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x38b0ea([0x2e]),'');let _0x460f4f=_0x38b0ea([0x6e]);for(let _0x3fcad5=0x0;_0x3fcad5<_0x57520c[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x3fcad5+=0x2){let _0x332f4c=window[_0x38b0ea([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x57520c[_0x38b0ea([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3fcad5,_0x3fcad5+0x2));_0x332f4c>=_0x3215ef[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x332f4c-=_0x3215ef[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x460f4f+=_0x3215ef[_0x332f4c];}return _0x460f4f;}function _0x499965(){const _0x3dc006=_0x2d55bc[_0x38b0ea([0x73,0x70,0x6c,0x69,0x74])](_0x38b0ea([0x2e]));if(0x3!=_0x3dc006[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x11f70a(_0x3dc006[0x1]);function _0x11f70a(_0xce1aa4){const _0x536ac1=_0x2d3cd0(_0xce1aa4);return _0x536ac1&&_0x287082()?_0x536ac1:null;function _0x287082(){const _0x190c0c=_0x536ac1[_0x38b0ea([0x6a,0x74,0x69])],_0xf65263=window[_0x38b0ea([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x190c0c[_0x38b0ea([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x190c0c[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x3e3fed={..._0x536ac1,[_0x38b0ea([0x6a,0x74,0x69])]:_0x190c0c[_0x38b0ea([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x190c0c[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x3e3fed[_0x38b0ea([0x76,0x63])],_0x501f09(_0x3e3fed)==_0xf65263;}}}async function _0x3c17b9(){let _0x510dc3=!0x0;try{const _0x23a8ba=_0x2d55bc[_0x38b0ea([0x73,0x70,0x6c,0x69,0x74])](_0x38b0ea([0x2e])),[_0xa6c6e7,_0x4750e4,_0x4118c6]=_0x23a8ba;return _0x53e400(_0xa6c6e7),await _0x456d8d(_0xa6c6e7,_0x4750e4,_0x4118c6),_0x510dc3;}catch{return!0x1;}function _0x53e400(_0x2f7309){const _0xf2bda2=_0x2d3cd0(_0x2f7309);_0xf2bda2&&_0xf2bda2[_0x38b0ea([0x61,0x6c,0x67])]==_0x38b0ea([0x45,0x53,0x32,0x35,0x36])||(_0x510dc3=!0x1);}async function _0x456d8d(_0x4b585d,_0x2b0850,_0x30243f){const _0x2ae8c8=window[_0x38b0ea([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x38b0ea([0x66,0x72,0x6f,0x6d])](_0x126c53(_0x30243f),_0x1c4e20=>_0x1c4e20[_0x38b0ea([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x51a052=new window[(_0x38b0ea([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x38b0ea([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x4b585d+_0x38b0ea([0x2e])+_0x2b0850),_0x31f17b=window[_0x38b0ea([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x38b0ea([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x31f17b)return;const _0x161550=await _0x31f17b[_0x38b0ea([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x38b0ea([0x6a,0x77,0x6b]),_0x55126f,{[_0x38b0ea([0x6e,0x61,0x6d,0x65])]:_0x38b0ea([0x45,0x43,0x44,0x53,0x41]),[_0x38b0ea([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x38b0ea([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x38b0ea([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x31f17b[_0x38b0ea([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x38b0ea([0x6e,0x61,0x6d,0x65])]:_0x38b0ea([0x45,0x43,0x44,0x53,0x41]),[_0x38b0ea([0x68,0x61,0x73,0x68])]:{[_0x38b0ea([0x6e,0x61,0x6d,0x65])]:_0x38b0ea([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x161550,_0x2ae8c8,_0x51a052)||(_0x510dc3=!0x1);}}function _0x2d3cd0(_0xe61d0b){return _0xe61d0b[_0x38b0ea([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x38b0ea([0x65,0x79]))?JSON[_0x38b0ea([0x70,0x61,0x72,0x73,0x65])](_0x126c53(_0xe61d0b)):null;}function _0x126c53(_0x4ab5c1){return window[_0x38b0ea([0x61,0x74,0x6f,0x62])](_0x4ab5c1[_0x38b0ea([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x38b0ea([0x2b]))[_0x38b0ea([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x38b0ea([0x2f])));}function _0x501f09(_0x4b1d72){let _0x299d1a=0x1505;function _0x4c2774(_0x5c5002){for(let _0x1275b0=0x0;_0x1275b0<_0x5c5002[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1275b0++){const _0x1485bf=_0x5c5002[_0x38b0ea([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x1275b0);_0x299d1a=(_0x299d1a<<0x5)+_0x299d1a+_0x1485bf,_0x299d1a&=_0x299d1a;}}function _0x2abe3e(_0x5b737f){Array[_0x38b0ea([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x5b737f)?_0x5b737f[_0x38b0ea([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x2abe3e):_0x5b737f&&typeof _0x5b737f==_0x38b0ea([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x38b0ea([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x5b737f)[_0x38b0ea([0x73,0x6f,0x72,0x74])]()[_0x38b0ea([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x1f8edf,_0x1e7737])=>{_0x4c2774(_0x1f8edf),_0x2abe3e(_0x1e7737);}):_0x4c2774(window[_0x38b0ea([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x5b737f));}return _0x2abe3e(_0x4b1d72),_0x299d1a>>>0x0;}function _0x587310(_0x31eec0){return _0x31eec0[_0x38b0ea([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x38b0ea([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x38b0ea([0x30]));}function _0x42a561(_0x5603ce){return _0x5603ce[_0x38b0ea([0x73,0x70,0x6c,0x69,0x74])]('')[_0x38b0ea([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x38b0ea([0x6a,0x6f,0x69,0x6e])]('');}function _0x29a874(){}function _0x38b0ea(_0x371de9){return _0x371de9['map'](_0x317e42=>String['fromCharCode'](_0x317e42))['join']('');}_0xcdc8b5(await _0xc2b078());}(this);}['showFakeVisualSelection'](){const _0x59dd14=this['editor']['model'];_0x59dd14['change'](_0x55f522=>{const _0x8fc15a=_0x59dd14['document']['selection']['getRanges']();let _0xd30ad3=0x0;for(const _0x467d12 of _0x8fc15a){const _0x5ea394=f+':'+_0xd30ad3;if(_0x59dd14['markers']['has'](_0x5ea394))_0x55f522['updateMarker'](_0x5ea394,{'range':_0x467d12});else{if(_0x467d12['start']['isAtEnd']){const _0x451cf4=_0x467d12['start']['getLastMatchingPosition'](({item:_0x28a3ba})=>!_0x59dd14['schema']['isContent'](_0x28a3ba),{'boundaries':_0x467d12});_0x55f522['addMarker'](_0x5ea394,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x55f522['createRange'](_0x451cf4,_0x467d12['end'])});}else _0x55f522['addMarker'](_0x5ea394,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x467d12});}_0xd30ad3++;}});}['hideFakeVisualSelection'](){const _0x5bc1fe=this['editor']['model'],_0x42c732=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x42c732['length']&&_0x5bc1fe['change'](_0x5a5737=>{_0x42c732['forEach'](_0xb5430c=>{_0x5a5737['removeMarker'](_0xb5430c);});});}['insertContent'](_0x2d2904,_0x1ab6e9){const _0x238a50=this['_getAISelection'](),_0x527005=_0x1ab6e9||_0x238a50['getFirstRange']();this['editor']['model']['canEditAt'](_0x527005)&&this['editor']['model']['change'](_0x2b8cef=>{this['hideFakeVisualSelection'](),_0x1ab6e9||this['_resetContentOfSelectedTableCells'](_0x2b8cef,_0x238a50),this['_pasteHTMLUsingClipboard']({'insertAt':_0x527005,'writer':_0x2b8cef,'html':_0x2d2904});});}['insertContentBelow'](_0x946e98){const {model:_0x1c0e8a}=this['editor'],_0x5a6bf1=this['_getAISelection']();_0x1c0e8a['change'](()=>{const _0x2606f9=this['_prepareTableInsertBelowPosition'](_0x946e98,_0x5a6bf1)||this['_getDefaultInsertBelowPosition'](_0x5a6bf1);this['insertContent'](_0x946e98,_0x2606f9);});}['_getAISelection'](){const _0xfb4bf2=this['editor']['model'],_0x2c8171=Array['from'](_0xfb4bf2['markers']['getMarkersGroup'](f))['map'](_0x18d3ba=>_0x18d3ba['getRange']());return _0xfb4bf2['createSelection'](_0x2c8171);}['_pasteHTMLUsingClipboard']({writer:_0x3b0323,html:_0x526c2a,insertAt:_0x1dc0f8}){const {view:_0x4a8fd3}=this['editor']['editing'],_0xd3b81c=this['editor']['plugins']['get'](_0x40b091),_0x4525ef=new Gn();_0x4525ef['setData']('text/html',_0x526c2a);const _0x4a626e=new ClipboardEvent('paste',{'clipboardData':_0x4525ef}),_0xbab946=new _0x2e4e75(_0x4a8fd3,_0x4a626e,{'dataTransfer':new _0x181e06(_0x4525ef)});_0x3b0323['setSelection'](_0x1dc0f8);const _0x247710=(_0x431969,_0x104227)=>{_0x104227['resultRange']&&_0x3b0323['setSelection'](_0x104227['resultRange']);};_0xd3b81c['once']('contentInsertion',_0x247710,{'priority':'lowest'}),_0x4a8fd3['document']['fire']('paste',_0xbab946),_0xd3b81c['off']('contentInsertion',_0x247710);}['_getDefaultInsertBelowPosition'](_0xcc6d77){const {model:_0x2dfcf3}=this['editor'],_0x4dcc9a=Array['from'](_0xcc6d77['getSelectedBlocks']());return _0x4dcc9a['length']?_0x2dfcf3['createPositionAfter'](_0x4dcc9a['pop']()):_0xcc6d77['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x1dea84,_0x58af1f){const {model:_0x97fa5f,plugins:_0x25530c}=this['editor'];if(_0x25530c['has']('TableUtils')){const _0x219ee2=_0x25530c['get']('TableUtils')['getSelectedTableCells'](_0x58af1f);if(_0x219ee2['length']){const _0x53cc8f=this['_getTableRowCountFromContent'](_0x1dea84),_0x3858ff=this['_createEmptyTableRows'](_0x219ee2,_0x53cc8f);return _0x97fa5f['createPositionAt'](_0x3858ff,0x0);}}return null;}['_getTableRowCountFromContent'](_0x382aa3){const _0x47029b=this['editor']['plugins']['get']('TableUtils'),_0x426525=this['editor']['data']['parse'](_0x382aa3),_0x59da4f=Array['from'](_0x426525['getChildren']())['filter'](_0x59ad9e=>_0x59ad9e['is']('element','table'));let _0x1399d8=0x0;return _0x59da4f['forEach'](_0x5389ce=>{_0x1399d8+=_0x47029b['getRows'](_0x5389ce);}),_0x1399d8;}['_createEmptyTableRows'](_0x2db382,_0xe963c){const _0x57cfa=this['editor']['plugins']['get']('TableUtils'),_0x185c26=_0x57cfa['getRowIndexes'](_0x2db382),_0x1ebe32=_0x57cfa['getColumnIndexes'](_0x2db382),_0x40a995=_0x185c26['last']+0x1,_0x4023ce=_0x1ebe32['first'],_0xcfa4f6=_0x2db382[0x0]['findAncestor']('table');for(let _0x213589=0x0;_0x213589<_0xe963c;_0x213589++)_0x57cfa['insertRows'](_0xcfa4f6,{'at':_0x40a995});return _0xcfa4f6['getChild'](_0x40a995)['getChild'](_0x4023ce);}['_resetContentOfSelectedTableCells'](_0x493dc2,_0xb135d6){const {plugins:_0x3c8598}=this['editor'],{model:_0x569b2a}=_0x493dc2;if(!_0x3c8598['has']('TableUtils'))return;_0x3c8598['get']('TableUtils')['getSelectedTableCells'](_0xb135d6)['length']&&_0x569b2a['deleteContent'](_0xb135d6);}}class K extends _0x361c0d{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x563e6a('aiadapter-text-adapter-not-set',null);}}class er extends Error{constructor(_0x435cc6){super(_0x435cc6),this['name']='AIRequestError';}}function Fn(_0x227cb0,_0x194ee2,_0x5042f3){const t=_0x227cb0['t'];switch(_0x194ee2){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',_0x5042f3);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5042f3);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'},_0x5042f3);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 _0x194ee2;}}class E extends Lt{['_commandDefinitions'];constructor(_0x419633,_0x15f28a){super(_0x419633),this['_commandDefinitions']=_0x15f28a,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x245aed,_0x3e849f,_0x1018fb)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0x1018fb));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0xed3c8a,_0x342b4e,_0x50342f)=>{this['enabledCommandsIds']=_0x50342f?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x521202=this['editor']['model'];this['_hasContext']=function(_0x9c5fa7){const _0x3cc57f=_0x9c5fa7['document']['selection'];return _0x3cc57f['isCollapsed']?0x0!==[..._0x3cc57f['getSelectedBlocks']()]['length']&&![..._0x3cc57f['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x9c5fa7['hasContent'](_0x3cc57f['getFirstRange']());}(_0x521202);const _0x2349d7=_0x521202['document']['selection'],_0x225f65=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x2ffb2c of _0x2349d7['getRanges']())for(const _0x537510 of _0x2ffb2c['getItems']())if(_0x537510['is']('element')&&_0x225f65['includes'](_0x537510['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0xb83b57='',_0x5c53bb='',_0x980654='custom'){this['editor']['plugins']['get'](n)['showUI'](_0xb83b57,_0x5c53bb,_0x980654);}}function ns(_0x3b9b5f,_0x7a638e){const _0x287b83=new Set();for(const _0x17a2a2 of _0x3b9b5f['values']())(_0x7a638e||!0x1===_0x17a2a2['requiresContent'])&&_0x287b83['add'](_0x17a2a2['id']);return Array['from'](_0x287b83);}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(_0x18b816,_0x10c51b,_0x1f13b4){super(),this['editor']=_0x18b816,this['textAdapter']=_0x10c51b,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x1f13b4,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x2a1ba1,_0x4e4385,_0x4e6c2f)=>{this['view']['value']=this['_sanitizeHTML'](_0x4e6c2f);}),this['listenTo'](this['view'],'submitPrompt',(_0xa9a1c0,_0x8971f7)=>{const _0x4ef6ea=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x8971f7,_0x4ef6ea,'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:_0x41f8a6,query:_0x389c58,htmlContent:_0x649f4,label:_0x1783e2,mainActionLabel:_0x2c5525}){this['view']['prompt']=_0x1783e2,this['view']['mainAction']=_0x2c5525,this['initialContext']=_0x649f4,_0x389c58&&(this['view']['isRendered']?this['_handleQuery'](_0x389c58,_0x649f4,_0x41f8a6,_0x1783e2):this['view']['once']('render',()=>{this['_handleQuery'](_0x389c58,_0x649f4,_0x41f8a6,_0x1783e2);}));}['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'](_0x293b41,_0x258a61,_0x5e3f99,_0x259aa5){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x258a61,this['previousQuery']=_0x293b41,this['previousLabel']=_0x259aa5||_0x293b41,this['previousActionId']=_0x5e3f99,new Promise(_0x1364d6=>{this['textAdapter']['makeRequest']({'query':_0x293b41,'context':_0x258a61,'onData':_0x56e30d=>{this['currentResponse']=_0x56e30d,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x5e3f99})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x586d27=>{_0x586d27 instanceof er?this['view']['handleError'](_0x586d27['message']):this['view']['handleError'](),_0x1364d6();})['finally'](()=>{this['stopProcessing'](),_0x1364d6();});});}['_parseAndNormalizeContent'](_0x1d8c55,_0x1a954c=!0x1){const _0x59ed3f=hs['exec'](_0x1d8c55);_0x1d8c55=_0x59ed3f?_0x1d8c55['substring'](_0x59ed3f[0x1]['length']):_0x1d8c55['length']<0x64&&!_0x1a954c?'':this['_stripMarkdownSyntax'](_0x1d8c55);const _0x222043=this['_domParser']['parseFromString'](_0x1d8c55,'text/html');if(_0x59ed3f){const _0x4e671d=Array['from'](_0x222043['body']['childNodes']);_0x4e671d['reverse']();for(const _0x125ccb of _0x4e671d){if(_0x125ccb['nodeType']==Node['ELEMENT_NODE'])break;_0x125ccb['remove']();}}const _0x27217b=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x222043['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x27217b);const _0x40f0e0=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x4abf04=this['editor']['data']['toModel'](_0x27217b);return _0x40f0e0||_0x4abf04['markers']['clear'](),this['editor']['data']['stringify'](_0x4abf04);}['_normalizeResponseHeadings'](_0x101ae8){const _0x3c101a=new _0x25de84(this['editor']['editing']['view']['document']),_0x441420=new _0x2901ef({'name':/^h[1-5]$/}),_0x25f839=[];let _0x57e912=!0x1;for(const _0x42e8ba of _0x101ae8)_0x42e8ba['is']('element')&&_0x441420['match'](_0x42e8ba)&&(_0x25f839['push'](_0x42e8ba),'h1'==_0x42e8ba['name']&&(_0x57e912=!0x0));if(_0x57e912){for(const _0x1a4c38 of _0x25f839)_0x3c101a['rename']('h'+(parseInt(_0x1a4c38['name'][0x1])+0x1),_0x1a4c38);}}['_isH1TagSupportEnabled'](){const {data:_0x2e52ec,editing:_0x2be412}=this['editor'],_0x19f1d2=_0x2e52ec['htmlProcessor']['toView']('<h1></h1>'),_0x1c012f=_0x2e52ec['toView'](_0x2e52ec['toModel'](_0x19f1d2));return!!_0x2be412['view']['domConverter']['viewToDom'](_0x1c012f)['querySelector']('h1');}['_sanitizeHTML'](_0x4e8393){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x4e8393),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x190c0a){const _0x36bbf5=_0x190c0a['trim']();return _0x36bbf5['startsWith']('```html')?_0x36bbf5['endsWith']('```')?_0x36bbf5['substring'](0x7,_0x36bbf5['length']-0x3):_0x36bbf5['substring'](0x7):_0x190c0a;}}const _={'REPLACE':'replace','INSERT':'insert'};class Ar extends _0x14c71e{constructor(_0x214d17){super(_0x214d17),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x1553b6=>Fn(_0x214d17,'AI_'+_0x1553b6['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Fn(_0x214d17,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Fn(_0x214d17,'Try\x20again')),this['stopButton']=this['_createButton'](Fn(_0x214d17,'Stop'));const _0xa144d8=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0xa144d8['if']('isVisible','ck-hidden',_0x4a5edb=>!_0x4a5edb)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x36da91,_0x1ba45b){const _0x260d6f=new _0x2cf640(this['locale']);return _0x260d6f['set']({'label':_0x36da91,'class':_0x1ba45b||'','isVisible':!0x0,'withText':!0x0}),_0x260d6f;}}class Pr extends _0xc3e5b1{['contentFieldView'];['copyButtonView'];constructor(_0xe8643e,_0x463c5b=''){super(_0xe8643e),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x508739=this['bindTemplate'];this['contentFieldView']=new ContentFieldView(_0xe8643e,_0x463c5b),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x508739['if']('isVisible','ck-hidden',_0x3767b7=>!_0x3767b7)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x508739['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 _0x47c83a=!0x1;this['on']('change:value',(_0x2574bf,_0x266038,_0x2946d6)=>{const _0x3e13c5=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x2946d6),this['isProcessing']&&_0x3e13c5&&!_0x47c83a&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x27ed00,_0x24e760,_0x3d9bf4)=>{_0x47c83a=!0x1,_0x3d9bf4?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x47c83a=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x47c83a=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x4075fa=this['locale'],_0x4d1074=new _0x2cf640(this['locale']),_0x3de8de='ck-ai-form__copy-button';return _0x4d1074['set']({'label':Fn(_0x4075fa,'Copy'),'icon':_0x41a51c,'class':_0x3de8de,'tooltip':!0x0}),_0x4d1074['bind']('isVisible')['to'](this,'value',_0x22b34c=>!!_0x22b34c),_0x4d1074['bind']('isEnabled')['to'](this,'isProcessing',_0x1f2fb0=>!_0x1f2fb0),_0x4d1074['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x4d1074['icon']=_0x24d29c,_0x4d1074['class']=_0x3de8de+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x4d1074['icon']=_0x41a51c,_0x4d1074['class']=_0x3de8de;},0x3e8);}),_0x4d1074;}['_copyHTMLToClipboard'](_0x18571b){const {window:_0x43c710,document:_0x499c0c}=_0x44426a;if(_0x43c710['ClipboardItem']){const {Blob:_0x25269d,ClipboardItem:_0x20cb8a}=_0x43c710,_0x5b5fda=[new _0x20cb8a({'text/html':new _0x25269d([_0x18571b['innerHTML']],{'type':'text/html'}),'text/plain':new _0x25269d([_0x18571b['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x5b5fda);}else{const _0x42cd8d=_0x499c0c['createElement']('div');_0x42cd8d['style']['position']='absolute',_0x42cd8d['style']['left']='-9999px',_0x42cd8d['innerHTML']='<span>[</span>'+_0x18571b['innerHTML']+'<span>]</span>',_0x499c0c['body']['appendChild'](_0x42cd8d);const _0x159a69=_0x499c0c['createRange']();_0x159a69['setStartAfter'](_0x42cd8d['firstElementChild']),_0x159a69['setEndBefore'](_0x42cd8d['lastElementChild']);const _0x2b2771=_0x43c710['getSelection']();_0x2b2771['removeAllRanges'](),_0x2b2771['addRange'](_0x159a69),_0x499c0c['execCommand']('copy'),_0x42cd8d['remove']();}}}class ContentFieldView extends _0xc3e5b1{constructor(_0x5d6993,_0x3ecba0=''){super(_0x5d6993),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x3ecba0,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x3657ae){this['element']['innerHTML']=_0x3657ae;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x5d20d6=new _0xc3e5b1(),_0xcfafb6=this['locale'],_0x3f7c63=new _0x559c75();return _0x3f7c63['isVisible']=!0x0,_0x5d20d6['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x3f7c63,{'text':Fn(_0xcfafb6,'AI\x20is\x20writing...')}]}),_0x5d20d6['render'](),_0x5d20d6;}}class Vr extends _0xc3e5b1{constructor(_0x4d36bf,_0x39833b=''){super(_0x4d36bf);const _0x20b1c0=new _0x59b3d9(),_0x31fc33=this['bindTemplate'];this['set']('text',_0x39833b),_0x20b1c0['content']=_0xf1053e,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x20b1c0,{'text':_0x31fc33['to']('text')}]});}}class Cr extends _0xf03a68{['submitButtonView'];['showHistoryButtonView'];constructor(_0x4d665c,_0x5f0ebc){super(_0x4d665c,_0x5f0ebc),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',(_0x1ff531,_0x1d9eed)=>{_0x1ff531['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x1d9eed());});}['_createSubmitButton'](){const _0xddb30c=new _0x2cf640(this['locale']),_0x399194=this['locale'];return _0xddb30c['set']({'icon':_0x40c783,'label':Fn(_0x399194,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0xddb30c['on']('execute',()=>{this['submit']();}),_0xddb30c['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0xc0e3ae,_0x476ace)=>!_0xc0e3ae&&_0x476ace),_0xddb30c;}['_createShowHistoryButton'](){const _0x44423e=new _0x2cf640(this['locale']),_0x4b706c=this['resultsView'],_0x4e9ae3=this['locale'];_0x44423e['set']({'label':Fn(_0x4e9ae3,'History'),'withText':!0x1,'icon':Nt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x44423e['bind']('isOn')['to'](_0x4b706c,'isVisible'),_0x44423e['bind']('isEnabled')['to'](this,'isEnabled'),_0x44423e['on']('execute',()=>{_0x4b706c['isVisible']=!_0x4b706c['isVisible'],_0x4b706c['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x36ed24=()=>{_0x44426a['window']['requestAnimationFrame'](()=>{if(_0x334b9e(this['element'])){const _0x45c64e=new _0x4b725e(this['queryView']['fieldView']['element']),_0x39b558=_0x45c64e['width'],_0x5c933a='rtl'===_0x4e9ae3['uiLanguageDirection']?'left':'right';_0x45c64e['excludeScrollbarsAndBorders'](),_0x44423e['element']['style'][_0x5c933a]=_0x39b558-_0x45c64e['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x36ed24),this['on']('render',_0x36ed24),_0x44423e;}['submit'](){const _0x50b964=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x50b964);}['focus'](_0x1c6545){-0x1===_0x1c6545?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Hr extends _0x163c9e{['historyGroupView'];['clearHistoryButton'];constructor(_0x26a78a){super(_0x26a78a),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x4cfb21(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Fn(_0x26a78a,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x4fc877=0x0;for(const _0x13dfb3 of this['items'])_0x4fc877+=_0x13dfb3['items']['length'];return{'resultsCount':_0x4fc877,'totalItemsCount':_0x4fc877};}['_createClearHistoryButton'](){const _0x59b16a=this['locale'],_0x56def7=new _0x2cf640(this['locale']);return _0x56def7['set']({'label':'('+Fn(_0x59b16a,'Clear')+')','withText':!0x0}),_0x56def7['on']('execute',()=>this['fire']('clearHistory')),_0x56def7;}}class Rr extends _0x663ac1{constructor(_0x378926){super();const _0x2ce27e=new _0x23a78e(),_0x48fa27=new _0x2cf640(this['locale'],_0x2ce27e);this['children']['add'](_0x48fa27),_0x48fa27['set']({'label':_0x378926['prompt'],'withText':!0x0}),_0x48fa27['on']('execute',()=>{this['fire']('execute',{'value':_0x4a8a27(_0x378926['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class Br extends _0x7916ba{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x2328c9,_0x5e8015)=>{const _0x30c9c5=go(_0x5e8015['prompt']);for(const _0x1a5094 of this)if(_0x1a5094!=_0x5e8015&&go(_0x1a5094['prompt'])===_0x30c9c5){this['remove'](_0x1a5094);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x4d48a5=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0x4d48a5));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0x417875=>_0x417875)));}}function go(_0x40be19){return _0x40be19['toLowerCase']()['trim']();}class k extends _0xc3e5b1{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x57df7f,_0x31900c,_0x5e216c=''){super(_0x57df7f),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(_0x57df7f),this['contentArea']=new Pr(_0x57df7f,_0x5e216c),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 _0x5f2dfb(),this['keystrokes']=new _0x15425(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x1af4a5({'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 _0x1dcf2e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x31900c],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x1dcf2e['if']('isError','ck-hidden',_0x44ab2d=>!_0x44ab2d)]},'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'](_0x517104=0x1){-0x1===_0x517104?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 _0x1f82b4=this['locale'],_0x3e3e4c=new Cr(_0x1f82b4,{'queryView':{'label':Fn(_0x1f82b4,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0xbfd767,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Fn(_0x1f82b4,'Empty\x20history'),'secondary':Fn(_0x1f82b4,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x3e3e4c['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0xc76c58,_0x5b39b6)=>_0xc76c58&&!_0x5b39b6),this['listenTo'](_0x3e3e4c,'submit',(_0x5bfe54,_0x1b6059)=>{this['prompt']=_0x1b6059;const _0x4aa03c=_0x528e40(_0x1b6059);this['fire']('submitPrompt',_0x4aa03c),_0x1b6059['trim']()&&this['_promptHistory']['add']({'prompt':_0x4aa03c},0x0);},{'priority':'high'}),_0x3e3e4c;}['_createHistoryView'](){const _0x11dbb1=new Hr(this['locale']);return _0x11dbb1['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Rr),_0x11dbb1['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x11dbb1;}['_createToolbar'](){const _0x4a197e=new Ar(this['locale']);return _0x4a197e['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x54ef0a,_0x2a3492,_0x56b6af)=>_0x54ef0a&&!_0x2a3492&&!!_0x56b6af),_0x4a197e['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x4a197e['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x560186,_0x2b291d,_0x24ff8b)=>_0x560186&&!_0x2b291d&&!!_0x24ff8b),_0x4a197e['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x4a197e['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x12902d,_0x22bdbd)=>_0x12902d&&!_0x22bdbd),_0x4a197e['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x4a197e['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x4a197e['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x4a197e;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x4612fe=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Fn(_0x4612fe,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x3ac213){const _0x1b6657=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x3ac213||Fn(_0x1b6657,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x361c0d{['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[_0x5a0b98,a,K,_0x3a1450];}constructor(_0xda933a){super(_0xda933a),_0xda933a['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0xda933a['config']['define']('ai.assistant.contentAreaCssClass',''),_0xda933a['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0xda933a['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x37da3c}=this;this['_aiAdapter']=_0x37da3c['plugins']['get'](K),this['_dialog']=_0x37da3c['plugins']['get'](_0x3a1450),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x3e658a=new E(_0x37da3c,Array['from'](this['_commandDefinitions']['values']()));_0x37da3c['commands']['add']('showAIAssistant',_0x3e658a),_0x37da3c['ui']['componentFactory']['add']('aiCommands',_0x2ae405=>{const _0x574602=_0x3e48f8(_0x2ae405);return _0x574602['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x574602['buttonView']['set']({'label':Fn(_0x2ae405,'AI\x20Commands'),'icon':_0x3699a1,'tooltip':!0x0}),_0x574602['on']('execute',_0x54c9d5=>this['_onExecute'](_0x54c9d5['source']['id'])),_0x4923a2(_0x574602,_0x37da3c['ui']['view']['body'],function(_0x577b93){const _0x5875d6=o(_0x577b93['config']['get']('ai.assistant.commands'),_0x577b93['locale']),_0xb39a18=B(_0x577b93,_0x5875d6)['filter'](_0x39e32d=>_0x39e32d['commands']['length']);if(0x1===_0xb39a18['length'])return B(_0x577b93,_0xb39a18[0x0]['commands'])['map'](_0x870a7d=>({'id':_0x870a7d['id'],'label':_0x870a7d['label']}));return _0xb39a18['map'](_0x39eada=>{const {groupId:_0x225bdd,groupLabel:_0x394cef,commands:_0x5d8ba0}=_0x39eada,_0x223bd9=B(_0x577b93,_0x5d8ba0)['map'](_0x53db7d=>({'id':_0x53db7d['id'],'label':_0x53db7d['label']}));return{'id':_0x225bdd,'menu':_0x394cef||_0x225bdd,'children':_0x223bd9};});}(_0x37da3c),{'ariaLabel':Fn(_0x2ae405,'AI\x20Commands')}),_0x574602['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x3e658a['on']('change:enabledCommandsIds',_0x1884cf),_0x574602['menuView']['once']('render',_0x1884cf),_0x574602;function _0x1884cf(){_0x574602['isEnabled']=_0x3e658a['enabledCommandsIds']['length']>0x0;for(const _0x13bcf2 of _0x574602['menuView']['buttons'])_0x13bcf2['isEnabled']=_0x3e658a['enabledCommandsIds']['includes'](_0x13bcf2['id']);}}),_0x37da3c['ui']['componentFactory']['add']('menuBar:aiCommands',_0x434239=>{const _0x44e1f5=new _0x580086(_0x434239);_0x44e1f5['buttonView']['set']({'label':Fn(_0x434239,'AI\x20Commands'),'icon':_0x3699a1}),_0x44e1f5['bind']('isEnabled')['to'](_0x3e658a,'enabledCommandsIds',_0x3c5307=>_0x3c5307['length']>0x0);const _0x44bdac=o(_0x37da3c['config']['get']('ai.assistant.commands'),_0x434239);return this['_populateMenuBarMenu'](_0x3e658a,_0x44e1f5,_0x44bdac,_0xd02b7c=>this['_onExecute'](_0xd02b7c)),_0x44e1f5;}),_0x37da3c['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x48cda4=this['_createAIAssistantUIButton'](_0x2cf640);return _0x48cda4['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x48cda4;}),_0x37da3c['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x55c129=this['_createAIAssistantUIButton'](_0x226c2e);return _0x55c129['set']({'role':'menuitemcheckbox'}),_0x55c129;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x35706d=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x2c3453;for(const _0x3786dd in _0x35706d){const _0x1a29cb=_0x3786dd,_0x114c34=_0x35706d[_0x1a29cb];if('aiLicenseKeyValid'==_0x114c34||'aiLicenseKeyInvalid'==_0x114c34||'aiLicenseKeyExpired'==_0x114c34||'aiLicenseKeyDomainLimit'==_0x114c34||'aiLicenseKeyNotAllowed'==_0x114c34||'aiLicenseKeyEvaluationLimit'==_0x114c34||'aiLicenseKeyUsageLimit'==_0x114c34){delete _0x35706d[_0x1a29cb],_0x2c3453=_0x114c34,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x2c3453&&_0x35706d['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x2c3453&&_0x35706d['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x2c3453&&_0x35706d['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x2c3453&&_0x35706d['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x2c3453&&_0x35706d['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x2c3453&&_0x35706d['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x34a6db='',_0xe94cf3='',_0x312bbb='custom'){const _0x1878b5=this['editor'],_0xa592c5=_0x1878b5['editing']['view'],_0x446375=_0x1878b5['plugins']['get'](a),_0x16899d=_0x1878b5['plugins']['get'](_0x5a0b98);_0x446375['showFakeVisualSelection']();const _0x5bc6c5=new w(),_0x161cfa=new ClipboardEvent('copy',{'clipboardData':_0x5bc6c5}),_0x1f0c82=new _0x181e06(_0x5bc6c5),_0x110f9d=new _0x2e4e75(_0xa592c5,_0x161cfa,{'dataTransfer':_0x1f0c82});_0x16899d['_forceMarkersCopy']('comment',()=>{_0xa592c5['document']['fire']('copy',_0x110f9d);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x1878b5,this['_aiAdapter']['textAdapter'],this['_formView']));let _0xee4945=_0x1f0c82['getData']('text/html');const _0x57e6c4=_0x1878b5['model']['document']['selection'],_0x1865a1=Array['from'](_0x57e6c4['getRanges']());0x1===_0x1865a1['length']&&_0x1865a1[0x0]['isFlat']&&!_0x57e6c4['getSelectedElement']()&&''!==_0xee4945['replace'](/&nbsp;/g,'')['trim']()&&(_0xee4945='<p>'+_0xee4945+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x312bbb,'query':_0x34a6db,'htmlContent':_0xee4945,'label':_0xe94cf3,'mainActionLabel':_[_0x1878b5['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x152ed0,'title':Fn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x1c5421['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x446375['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x114fd7=new Map(),_0x4d0653=o(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x38eb99 of _0x4d0653)for(const _0x11231c of _0x38eb99['commands'])_0x114fd7['set'](_0x11231c['id'],{..._0x11231c,'groupId':_0x38eb99['groupId'],'groupLabel':_0x38eb99['groupLabel']||_0x38eb99['groupId']});return _0x114fd7;}['_createAIAssistantUIButton'](_0x17cf79){const _0x3fae38=this['editor'],_0x573dff=_0x3fae38['commands']['get']('showAIAssistant'),_0x1f19e6=new _0x17cf79(_0x3fae38['locale']);return _0x1f19e6['set']({'label':Fn(_0x3fae38['locale'],'AI\x20Assistant'),'icon':_0x152ed0,'isToggleable':!0x0}),_0x1f19e6['bind']('isEnabled')['to'](_0x573dff),_0x1f19e6['bind']('isOn')['to'](this['_dialog'],'id',_0x1a8cac=>'aiAssistant'===_0x1a8cac),this['listenTo'](_0x1f19e6,'execute',()=>{_0x1f19e6['isOn']?this['hideUI']():_0x573dff['execute']();}),_0x1f19e6;}['_initView'](){const _0x174cab=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',()=>{_0x174cab['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x174cab['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x9e6934,ui:{ariaLiveAnnouncer:_0x15ae68}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x4f1ed7,_0x1dd1cc,_0x332478)=>{const _0x8b5e85=this['_aiAssistantController']['currentContext'];_0x332478?_0x15ae68['announce'](Fn(_0x9e6934,'AI\x20is\x20writing')):_0x8b5e85&&_0x15ae68['announce'](Fn(_0x9e6934,'Generated\x20content:\x20%0',_0x8b5e85),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x36b740,_0x1745b6,_0x5d975b)=>{if(_0x5d975b){const _0x5bb858=this['_formView']['errorView']['text'];_0x15ae68['announce'](Fn(_0x9e6934,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5bb858));}});}['_onExecute'](_0x1f1977){const _0x19ae8e=this['_commandDefinitions']['get'](_0x1f1977),_0x5b2f69=this['editor'],_0x30859a=_0x5b2f69['model']['document']['selection'],_0x57b70d=_0x5b2f69['commands']['get']('showAIAssistant'),_0x4c3107=_0x5b2f69['plugins']['get'](a),_0x2d056f=''+(_0x19ae8e['groupId']!==x?_0x19ae8e['groupLabel']+':\x20':'')+_0x19ae8e['label'];if(!0x1!==_0x19ae8e['requiresContent']&&_0x30859a['isCollapsed']){const _0x4cba17=_0x42aa06(_0x30859a['getSelectedBlocks']())||_0x5b2f69['model']['schema']['getLimitElement'](_0x30859a);_0x5b2f69['model']['change'](_0x387d48=>{_0x387d48['setSelection'](_0x4cba17,'in');});}_0x4c3107['showFakeVisualSelection'](),_0x57b70d['execute'](_0x19ae8e['prompt'],_0x2d056f,'command:'+_0x1f1977);}['_populateMenuBarMenu'](_0xf211e0,_0x2a85df,_0x36a4cc,_0x1179fa){const _0x536269=this['editor'],_0x102289=_0x536269['locale'],_0x2dbb75=new _0x3dd394(_0x102289),_0x1559e3=B(_0x536269,_0x36a4cc)['filter'](_0x789718=>_0x789718['commands']['length']);0x1===_0x1559e3['length']?this['_getMenuBarGroupButtons']({'command':_0xf211e0,'commands':_0x1559e3[0x0]['commands'],'parentMenuView':_0x2a85df,'onExecute':_0x1179fa})['forEach'](_0x51ed86=>_0x2dbb75['items']['add'](_0x51ed86)):_0x1559e3['forEach'](({groupId:_0x1463f5,groupLabel:_0x11ddb4,commands:_0x162daf})=>{const _0x333a0e=new _0x30af6d(_0x102289,_0x2a85df),_0x5e96ba=new _0x580086(_0x102289),_0x180f10=new _0x3dd394(_0x102289),_0x55e5f8=this['_getMenuBarGroupButtons']({'command':_0xf211e0,'commands':_0x162daf,'parentMenuView':_0x5e96ba,'onExecute':_0x1179fa});_0x5e96ba['buttonView']['set']({'label':_0x11ddb4||_0x1463f5}),_0x5e96ba['delegate']('execute')['to'](_0x2a85df),_0x180f10['items']['addMany'](_0x55e5f8),_0x5e96ba['panelView']['children']['add'](_0x180f10),_0x333a0e['children']['add'](_0x5e96ba),_0x2dbb75['items']['add'](_0x333a0e);}),_0x2a85df['panelView']['children']['add'](_0x2dbb75);}['_getMenuBarGroupButtons']({command:_0x1135cc,commands:_0x45e7be,parentMenuView:_0x42f20f,onExecute:_0x4d1a05}){const _0x3b0921=this['editor'],_0x58f845=_0x3b0921['locale'];return B(_0x3b0921,_0x45e7be)['map'](_0xf3b653=>{const _0x3a9f59=new _0x30af6d(_0x58f845,_0x42f20f),_0x22e03c=new _0x226c2e(_0x58f845);return _0x22e03c['set']({'label':_0xf3b653['label']}),_0x22e03c['delegate']('execute')['to'](_0x42f20f),_0x22e03c['on']('execute',()=>_0x4d1a05(_0xf3b653['id'])),_0x22e03c['bind']('isEnabled')['to'](_0x1135cc,'enabledCommandsIds',_0xeec3d4=>_0xeec3d4['includes'](_0xf3b653['id'])),_0x3a9f59['children']['add'](_0x22e03c),_0x3a9f59;});}}function U(_0x49432a,_0xd0b78){return void 0x0!==_0x49432a['order']&&void 0x0===_0xd0b78['order']?0x1:void 0x0===_0x49432a['order']&&void 0x0!==_0xd0b78['order']?-0x1:void 0x0!==_0x49432a['order']&&void 0x0!==_0xd0b78['order']?_0x49432a['order']-_0xd0b78['order']:0x0;}function B(_0x138416,_0x26f086){_0x26f086['sort'](U);const _0x3e5007={},_0x1f6eaa=[];for(const _0x11ec28 of _0x26f086)if(void 0x0!==_0x11ec28['order']){if(_0x11ec28['order']in _0x3e5007)throw new _0x563e6a('ai-commands-config-order-collision',_0x138416,{'conflictingDefinitions':[_0x11ec28,_0x3e5007[_0x11ec28['order']]]});_0x3e5007[_0x11ec28['order']]=_0x11ec28,_0x1f6eaa['splice'](_0x11ec28['order'],0x0,_0x11ec28);}else _0x1f6eaa['push'](_0x11ec28);return _0x1f6eaa;}class AIAssistant extends _0x361c0d{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x44d3f1){super(_0x44d3f1);const _0x30a33b=_0x44d3f1['config'],_0x4ba9a0=_0x44d3f1['locale'];_0x30a33b['define']('ai.assistant.preserveComments',!0x0),_0x30a33b['define']('ai.assistant.commands',Wn(_0x4ba9a0)),_0x30a33b['define']('ai.assistant.extraCommandGroups',[]),_0x30a33b['define']('ai.assistant.removeCommands',[]);let _0x385c6b=o(_0x30a33b['get']('ai.assistant.commands'),_0x4ba9a0);const _0x2fdd46=_0x30a33b['get']('ai.assistant.extraCommandGroups'),_0x2a2be8=_0x30a33b['get']('ai.assistant.removeCommands');_0x2fdd46['forEach'](_0x49c457=>{const _0x417214=_0x385c6b['find'](_0x5788f1=>_0x5788f1['groupId']===_0x49c457['groupId']);_0x417214?_0x417214['commands']=_0x417214['commands']['concat'](_0x49c457['commands']):_0x385c6b['push'](_0x49c457);}),_0x385c6b=_0x385c6b['filter'](_0xdb605e=>!_0x2a2be8['includes'](_0xdb605e['groupId'])),_0x385c6b['forEach'](_0x356158=>{_0x356158['commands']=_0x356158['commands']['filter'](_0x3eb198=>!_0x2a2be8['includes'](_0x3eb198['id']));}),_0x30a33b['set']('ai.assistant.commands',_0x385c6b);}}function Wn(_0x3cc3dd){return[{'groupId':'editOrReview','groupLabel':Fn(_0x3cc3dd,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Fn(_0x3cc3dd,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Fn(_0x3cc3dd,'Make\x20shorter'),'prompt':'Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.'},{'id':'makeLonger','label':Fn(_0x3cc3dd,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Fn(_0x3cc3dd,'Simplify\x20language'),'prompt':'Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.'}]},{'groupId':'generate','groupLabel':Fn(_0x3cc3dd,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Fn(_0x3cc3dd,'Summarize'),'prompt':'Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.'},{'id':'continue','label':Fn(_0x3cc3dd,'Continue'),'prompt':'Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.'}]},{'groupId':'changeTone','groupLabel':Fn(_0x3cc3dd,'Change\x20tone'),'commands':[{'id':'professional','label':Fn(_0x3cc3dd,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Fn(_0x3cc3dd,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Fn(_0x3cc3dd,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Fn(_0x3cc3dd,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Fn(_0x3cc3dd,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Fn(_0x3cc3dd,'Change\x20style'),'commands':[{'id':'business','label':Fn(_0x3cc3dd,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Fn(_0x3cc3dd,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Fn(_0x3cc3dd,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Fn(_0x3cc3dd,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Fn(_0x3cc3dd,'Translate'),'commands':[{'id':'translateEnglish','label':Fn(_0x3cc3dd,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Fn(_0x3cc3dd,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Fn(_0x3cc3dd,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Fn(_0x3cc3dd,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Fn(_0x3cc3dd,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Fn(_0x3cc3dd,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Fn(_0x3cc3dd,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Fn(_0x3cc3dd,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ar extends _0x361c0d{['abortController'];static get['requires'](){return[K];}constructor(_0x10cc25){super(_0x10cc25),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'](_0x4f34fb){return this['sendRequest'](_0x4f34fb)['catch'](_0x2d7006=>{if(_0x2d7006 instanceof er)return Promise['reject'](_0x2d7006);if('AbortError'==_0x2d7006['name'])return Promise['resolve']();throw console['error'](_0x2d7006),new _0x563e6a('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x480b8c,_0x388b1f){const _0x5e1f93=this['editor']['locale'],_0x25fc7b={'Content-Type':'application/json'};if('object'==typeof _0x480b8c)Object['assign'](_0x25fc7b,_0x480b8c);else{if(_0x480b8c)try{const _0x6268c8=await _0x480b8c(_0x388b1f);Object['assign'](_0x25fc7b,_0x6268c8);}catch{return Promise['reject'](new er(Fn(_0x5e1f93,'AI_ERROR_GET_HEADERS')));}}return _0x25fc7b;}async['_prepareRequestParameters'](_0x6f1179,_0x374cff){const _0x516502=this['editor']['locale'];if('object'==typeof _0x6f1179)return _0x6f1179;try{return await _0x6f1179(_0x374cff);}catch{return Promise['reject'](new er(Fn(_0x516502,'AI_ERROR_GET_PARAMETERS')));}}}class OpenAITextAdapter extends ar{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x4c74d2){super(_0x4c74d2),_0x4c74d2['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x4c74d2['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x4c74d2['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x4c74d2['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x4c74d2['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x4c74d2['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x2c6298,context:_0x59dc7c,onData:_0x39e4c8,actionId:_0x3a7f5e}){const _0x358a0b=this['editor']['locale'],_0x4fc3f3=await this['prepareMessages'](_0x2c6298,_0x59dc7c,_0x3a7f5e),_0x42b338=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3a7f5e),_0x14d50c=await this['_prepareRequestParameters'](this['_requestParameters'],_0x3a7f5e),_0x3f6b50={'messages':_0x4fc3f3,..._0x14d50c},_0x1aca66={'method':'POST','headers':_0x42b338,'body':JSON['stringify'](_0x3f6b50),'signal':this['abortController']['signal']},_0x20d1e4=await fetch(this['_apiUrl'],_0x1aca66);if(_0x20d1e4['ok'])return _0x14d50c['stream']?await this['_readStreamableResponse'](_0x20d1e4,_0x39e4c8):await this['_readStaticResponse'](_0x20d1e4,_0x39e4c8),Promise['resolve']();{const _0xae6c5d=await _0x20d1e4['text']();return _0xae6c5d['includes']('context_length_exceeded')?Promise['reject'](new er(Fn(_0x358a0b,'AI_ERROR_CONTEXT_LENGTH'))):_0xae6c5d['includes']('Moderation')?Promise['reject'](new er(Fn(_0x358a0b,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0xae6c5d));}}async['prepareMessages'](_0x229d5a,_0xf8aa47,_0xcb3b81){let _0x39abd5,_0x3b5cba;return _0xf8aa47?(_0x39abd5='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.',_0x3b5cba='Instruction:\x0a'+_0x229d5a+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0xf8aa47):(_0x39abd5='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.',_0x3b5cba=_0x229d5a),[{'role':'system','content':_0x39abd5},{'role':'user','content':_0x3b5cba}];}async['_readStreamableResponse'](_0x1cba37,_0x1d1c82){const _0x420906=_0x1cba37['body']['getReader'](),_0x5d0043=new TextDecoder();let _0xbd6d78='',_0x5921af='',_0x546872='',_0x3ea82b=!0x1;for(;!_0x3ea82b;){const {done:_0x1fe006,value:_0x570732}=await _0x420906['read'](),_0x1544b8=_0xbd6d78+_0x5d0043['decode'](_0x570732);let _0x282991='';_0x3ea82b=_0x1fe006;try{_0x282991=this['_cleanUpData'](_0x1544b8),_0xbd6d78='';}catch{_0xbd6d78=_0x1544b8;continue;}_0x5921af+=_0x282991,!_0x3ea82b&&this['_isBufferIncomplete'](_0x5921af)||_0x5921af&&(_0x546872+=_0x5921af,_0x5921af='',_0x1d1c82(_0x546872));}return Promise['resolve']();}async['_readStaticResponse'](_0x3e0f9c,_0x35ad8b){return _0x35ad8b((await _0x3e0f9c['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x2e83a8){const _0x597a48=_0x2e83a8['split']('<')['length']!==_0x2e83a8['split']('>')['length'],_0x615d74=_0x2e83a8['length']<0x1e;return _0x597a48&&_0x615d74;}['_cleanUpData'](_0x3fa6a5){return _0x3fa6a5['split'](/\n(?![^{]*\})/g)['map'](_0x13280f=>_0x13280f['replace']('data:\x20',''))['filter'](_0x2e8891=>_0x2e8891&&_0x2e8891['length']>0x0&&'[DONE]'!==_0x2e8891)['map'](_0x3a6182=>{const {choices:_0x275a95}=JSON['parse'](_0x3a6182);if(_0x275a95[0x0]?.['delta']?.['content'])return _0x275a95[0x0]['delta']['content'];})['filter'](_0x2e66e4=>_0x2e66e4)['join']('');}}class AWSTextAdapter extends ar{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),_0xa8aac2('ai-aws-adapter-not-supported');}async['sendRequest'](_0x52970f){throw _0x4e5dbd('ai-aws-adapter-not-supported'),new er(Fn(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class ia extends _0x2cf640{constructor(_0x5ae55c,_0x4a139d={}){super(_0x5ae55c),this['isToggleable']=!0x0,this['set']('side',_0x4a139d['side']||'top');const _0x444a12=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x5f0c81(_0x4a139d['class']||[]),_0x444a12['to']('side',_0x2c0945=>'ck-tab-button_'+_0x2c0945),_0x444a12['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0xc3e5b1{['children'];constructor(_0xb6ef17,_0x545a6a={}){super(_0xb6ef17);const _0x2d1c51=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x5f0c81(_0x545a6a['class']||[]),_0x2d1c51['to']('class'),_0x2d1c51['if']('isVisible','ck-hidden',_0x36774e=>!_0x36774e)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0xc3e5b1{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x3270d4,_0x47c2e1={}){super(_0x3270d4),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x47c2e1['side']||'top'),this['set']('isMaximized',!0x1);const _0x554973=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x5f0c81(_0x47c2e1['class']||[]),_0x554973['to']('side',_0x19481f=>'ck-tabs_'+_0x19481f),_0x554973['to']('class'),_0x554973['to']('isMaximized',_0x3c9cb=>_0x3c9cb?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x554973['to']('side',_0x4cc745=>'ck-tabs__buttons-container_'+_0x4cc745)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x554973['to']('side',_0x1849cf=>'ck-tabs__panels-container_'+_0x1849cf)]},'children':this['panelViews']},..._0x5f0c81(_0x47c2e1['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x23ecea){const _0x58a82d=this['_tabs']['get'](_0x23ecea);return _0x58a82d||null;}['addTab'](_0x11cdc5){const _0x194960=this['_setupButton']({'id':_0x11cdc5['id'],'label':_0x11cdc5['buttonLabel'],'icon':_0x11cdc5['buttonIcon'],'order':_0x11cdc5['order']}),_0x4e8c0a=new ea(this['locale']);return _0x4e8c0a['render'](),_0x11cdc5['content']&&_0x4e8c0a['children']['add'](_0x11cdc5['content']),this['panelViews']['add'](_0x4e8c0a),this['_tabs']['set'](_0x11cdc5['id'],{'button':_0x194960,'panel':_0x4e8c0a,'order':void 0x0!==_0x11cdc5['order']?_0x11cdc5['order']:null}),this['fire']('addTab:'+_0x11cdc5['id'],{'id':_0x11cdc5['id'],'button':_0x194960,'panel':_0x4e8c0a}),null===this['activeTab']?this['activateTab'](_0x11cdc5['id']):this['_hidePanel'](_0x11cdc5['id']),{'button':_0x194960,'panel':_0x4e8c0a};}['activateTab'](_0x3f9f72){if(null!==_0x3f9f72&&!this['getTab'](_0x3f9f72))throw new _0x563e6a('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x3f9f72});this['activeTab']!==_0x3f9f72&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x3f9f72,_0x3f9f72&&this['_showPanel'](_0x3f9f72),this['fire']('activateTab:'+_0x3f9f72,_0x3f9f72));}['showTab'](_0xd35a32){if(!this['getTab'](_0xd35a32))throw new _0x563e6a('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0xd35a32});this['_showPanel'](_0xd35a32),this['_showButton'](_0xd35a32),this['fire']('show:'+_0xd35a32,_0xd35a32);}['hideTab'](_0x198586){if(!this['getTab'](_0x198586))throw new _0x563e6a('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x198586});const _0xebcad7=this['activeTab'];this['_hidePanel'](_0x198586),this['_hideButton'](_0x198586);const _0x1f2f5a=this['getTabIds']();_0xebcad7===_0x198586&&_0x1f2f5a['length']>0x1&&this['activateTab'](_0x1f2f5a['find'](_0x44d9a6=>_0x44d9a6!==_0x198586)),this['fire']('hide:'+_0x198586,_0x198586);}['_getPanel'](_0x49cd23){const _0x3633b0=this['_tabs']['get'](_0x49cd23);return _0x3633b0?_0x3633b0['panel']:null;}['_showPanel'](_0x18c493){null!==this['activeTab']&&this['activeTab']!==_0x18c493||this['_getPanel'](_0x18c493)['show']();}['_hidePanel'](_0x120d13){const _0x4753db=this['_getPanel'](_0x120d13);_0x4753db['isVisible']&&(this['activeTab']===_0x120d13&&(this['activeTab']=null),_0x4753db['hide']());}['_getButton'](_0x29c593){const _0x270f92=this['_tabs']['get'](_0x29c593);return _0x270f92?_0x270f92['button']:null;}['_showButton'](_0x4768c7){this['_getButton'](_0x4768c7)['show']();}['_hideButton'](_0xb53933){this['_getButton'](_0xb53933)['hide']();}['_setupButton'](_0xacacd9){const _0x22189b=new ia(this['locale'],{'side':this['side']}),_0x26649b=this['buttonViews'];if(_0x22189b['set']({'label':_0xacacd9['label'],'icon':_0xacacd9['icon'],'tooltip':!0x0,'withText':!0x0}),_0x22189b['bind']('isOn')['to'](this,'activeTab',_0x4c0d60=>_0x4c0d60===_0xacacd9['id']),_0x22189b['bind']('side')['to'](this,'side'),_0xacacd9['order']){const _0x3f4ba1=[...this['_tabs']]['reduce']((_0x38543b,_0x1292ee)=>{const _0x137a32=_0x1292ee[0x0],{order:_0x1e9632}=_0x1292ee[0x1];return!_0x1e9632||_0x1e9632>_0xacacd9['order']?_0x38543b:_0x1e9632>=_0x38543b['order']?{'id':_0x137a32,'order':_0x1e9632}:_0x38543b;},{'id':'','order':0x0}),_0x5709bb=_0x26649b['getIndex'](this['_getButton'](_0x3f4ba1['id']));_0x26649b['add'](_0x22189b,_0x5709bb+0x1);}else _0x26649b['add'](_0x22189b);return _0x22189b['on']('execute',()=>{this['activateTab'](_0xacacd9['id']);}),_0x22189b;}}const ni=['overlay','sidebar','custom'],oi=['left','right'];class hi extends ss{constructor(_0x590e57,_0x23826f={}){super(_0x590e57,_0x23826f),this['set']('type',_0x23826f['type']||'sidebar'),this['set']('side',_0x23826f['side']||'right'),this['set']('isVisible',_0x23826f['visibleByDefault']??!0x0);const _0x489093=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x489093['if']('type','ck-ai-tabs__overlay',_0x9b606f=>'overlay'===_0x9b606f),_0x489093['if']('type','ck-ai-tabs__sidebar',_0x3f995d=>'sidebar'===_0x3f995d),_0x489093['if']('isVisible','ck-hidden',_0x134383=>!_0x134383)]}}),this['buttonViews']['on']('add',(_0x47b0eb,_0x53bc85)=>{_0x53bc85['set']('withText',!0x1);});}}class it extends _0x3a5602{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x573600){super(_0x573600);const _0xd7c5dc=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0xd7c5dc)throw new _0x563e6a('ai-tabs-configuration-not-found');if(void 0x0!==_0xd7c5dc['showResizeButton']&&(this['showResizeButton']=_0xd7c5dc['showResizeButton']),'sidebar'!==_0xd7c5dc['type']&&'overlay'!==_0xd7c5dc['type']||_0xd7c5dc['side']&&(this['side']=_0xd7c5dc['side']),'sidebar'===_0xd7c5dc['type']){if(this['container']=_0xd7c5dc['element'],this['set']('type','sidebar'),!this['container'])throw new _0x563e6a('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0xd7c5dc['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===_0xd7c5dc['visibleByDefault']||_0xd7c5dc['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 _0x2cda04&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x11dccf){if(_0x11dccf&&this['type']!==_0x11dccf){if(!ni['includes'](_0x11dccf))throw new _0x563e6a('ai-tabs-unsupported-ui-type');this['type']=_0x11dccf;}}['switchSide'](_0x1a9887){if(_0x1a9887&&this['side']!==_0x1a9887){if(!oi['includes'](_0x1a9887))throw new _0x563e6a('ai-tabs-unsupported-ui-side');this['side']=_0x1a9887;}}['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 tt extends _0x3a5602{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x49cfd7){super(_0x49cfd7),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 _0xc35e13=this['context']['plugins']['get']('CloudServices');if(!_0xc35e13['token'])throw new _0x563e6a('ai-missing-token',this);this['_token']=_0xc35e13['token'];}['startConversation'](_0x26bb6d,_0x203cef){const _0x3f70c7=this['_sendApiRequest']('/conversations','POST',{'id':_0x26bb6d,'group':_0x203cef});return{'getConversation':async()=>(await _0x3f70c7['request'])['json'](),'abortController':_0x3f70c7['abortController']};}['queryAssistant']({message:_0xc8c5bf,conversationId:_0xcca93a,parts:_0x444b62,capabilities:_0x1d439f,model:_0x294a0a,attributes:_0x518071}){const _0x45c84a={'prompt':_0xc8c5bf,'content':_0x444b62,'model':_0x294a0a,..._0x1d439f&&{'capabilities':_0x1d439f},..._0x518071&&{'attributes':_0x518071}},_0x28582b=this['_sendApiRequest']('/conversations/'+_0xcca93a+'/messages','POST',_0x45c84a);return{'getStream':async()=>{const _0x1bca08=(await _0x28582b['request'])['body'];return this['_getStreamReader'](_0x1bca08);},'abortController':_0x28582b['abortController']};}['executeCustomAction']({content:_0x32e4db,message:_0x3777ff,model:_0x4e442d,outputFormat:_0x4853f6}){const _0x175757={'content':[{'type':'text','content':_0x32e4db}],'prompt':_0x3777ff,'model':_0x4e442d,'outputFormat':_0x4853f6},_0x247aa7=this['_sendApiRequest']('/actions/custom/calls','POST',_0x175757);return{'getStream':async()=>{const _0x1c8e9e=(await _0x247aa7['request'])['body'];return this['_getStreamReader'](_0x1c8e9e);},'abortController':_0x247aa7['abortController']};}['executeAction']({actionName:_0x41631d,content:_0x59e4c8,args:_0x58dd13}){const _0x3573a8={'content':[{'type':'text','content':_0x59e4c8}],'args':_0x58dd13},_0xca5197=this['_sendApiRequest']('/actions/system/'+_0x41631d+'/calls','POST',_0x3573a8);return{'getStream':async()=>{const _0x5f323e=(await _0xca5197['request'])['body'];return this['_getStreamReader'](_0x5f323e);},'abortController':_0xca5197['abortController']};}['uploadFile'](_0x19788c,_0x27fcfb,_0x2732f4){const _0x592fa2=new FormData();_0x592fa2['append']('file',_0x27fcfb,_0x27fcfb['name']),_0x2732f4&&_0x592fa2['append']('attributes',JSON['stringify'](_0x2732f4));const _0x174d18=this['_sendApiRequest']('/conversations/'+_0x19788c+'/files','POST',_0x592fa2);return{'getId':async()=>(await _0x174d18['request'])['json'](),'abortController':_0x174d18['abortController']};}['fetchDocument'](_0x10d3d8,_0x5777b7){const _0x3a52cf=this['_sendApiRequest']('/conversations/'+_0x10d3d8+'/documents/'+_0x5777b7,'GET');return{'getDocument':async()=>(await _0x3a52cf['request'])['json'](),'abortController':_0x3a52cf['abortController']};}['uploadDocument'](_0x1f0c83,_0x4b5ef9,_0x33a82e){const _0x2e3d8f={'content':_0x4b5ef9};_0x33a82e&&(_0x2e3d8f['attributes']=_0x33a82e);const _0x30aae6=this['_sendApiRequest']('/conversations/'+_0x1f0c83+'/documents','POST',_0x2e3d8f);return{'getId':async()=>(await _0x30aae6['request'])['json'](),'abortController':_0x30aae6['abortController']};}['fetchConversations'](_0x3109a9,_0x32a693={}){const _0x4823c2=new URLSearchParams();_0x4823c2['append']('group',_0x3109a9),_0x4823c2['append']('excludeEmpty',!0x1!==_0x32a693['excludeEmpty']?'true':'false'),_0x4823c2['append']('limit',_0x32a693['limit']?_0x32a693['limit']['toString']():'100'),_0x4823c2['append']('sortBy',_0x32a693['sortBy']?_0x32a693['sortBy']:'createdAt'),_0x4823c2['append']('order',_0x32a693['order']?_0x32a693['order']:'desc');const _0x2c6d06=this['_sendApiRequest']('/conversations?'+_0x4823c2['toString'](),'GET');return{'getConversations':async()=>{const _0x34e080=await _0x2c6d06['request'];return(await _0x34e080['json']())['items'];},'abortController':_0x2c6d06['abortController']};}['deleteConversation'](_0x5b123e){const _0x26f3bb=this['_sendApiRequest']('/conversations/'+_0x5b123e,'DELETE');return{'execute':async()=>{await _0x26f3bb['request'];},'abortController':_0x26f3bb['abortController']};}['updateConversation'](_0x42be59,_0x182969){const _0x1ae802=this['_sendApiRequest']('/conversations/'+_0x42be59,'PATCH',_0x182969);return{'getResult':async()=>(await _0x1ae802['request'],_0x182969),'abortController':_0x1ae802['abortController']};}['fetchConversation'](_0x5194be){const _0x420e81=this['_sendApiRequest']('/conversations/'+_0x5194be,'GET');return{'getConversation':async()=>(await _0x420e81['request'])['json'](),'abortController':_0x420e81['abortController']};}['fetchConversationMessages'](_0x4b3d3b){const _0x3a75a5=this['_sendApiRequest']('/conversations/'+_0x4b3d3b+'/messages','GET');return{'getMessages':async()=>{const _0x49f619=await _0x3a75a5['request'];return(await _0x49f619['json']())['items'];},'abortController':_0x3a75a5['abortController']};}['uploadUrl'](_0x22a013,_0x5db73a,_0x4ea6f8){const _0x539d23=this['_sendApiRequest']('/conversations/'+_0x22a013+'/web-resources','POST',{'url':_0x5db73a,'attributes':_0x4ea6f8});return{'getId':async()=>(await _0x539d23['request'])['json'](),'abortController':_0x539d23['abortController']};}['getModels'](_0x2d149f='en'){const _0x451f3d=new URLSearchParams();_0x451f3d['append']('language',_0x2d149f);const _0x4252f7='/models/1?'+_0x451f3d['toString'](),_0x85cbe5=this['_sendApiRequest'](_0x4252f7,'GET');return{'list':async()=>await(await _0x85cbe5['request'])['json'](),'abortController':_0x85cbe5['abortController']};}['deleteFile'](_0xfceb9e,_0x4e9981){const _0x48fe67=this['_sendApiRequest']('/conversations/'+_0xfceb9e+'/files/'+_0x4e9981,'DELETE');return{'execute':async()=>{await _0x48fe67['request'];},'abortController':_0x48fe67['abortController']};}['deleteDocument'](_0x3137b5,_0x13f8a9){const _0x48c4f9=this['_sendApiRequest']('/conversations/'+_0x3137b5+'/documents/'+_0x13f8a9,'DELETE');return{'execute':async()=>{await _0x48c4f9['request'];},'abortController':_0x48c4f9['abortController']};}['deleteWebResource'](_0x4f6d3b,_0x5866f6){const _0x4c8da0=this['_sendApiRequest']('/conversations/'+_0x4f6d3b+'/web-resources/'+_0x5866f6,'DELETE');return{'execute':async()=>{await _0x4c8da0['request'];},'abortController':_0x4c8da0['abortController']};}['callSystemReview']({reviewName:_0x45d6be,content:_0x1ad0cf,args:_0x2d3588}){const _0x51a6d1=this['_sendApiRequest']('/reviews/system/'+_0x45d6be+'/calls','POST',{'content':[{'type':'text','content':_0x1ad0cf}],'args':_0x2d3588});return{'getStream':async()=>{const _0x32f0de=(await _0x51a6d1['request'])['body'];return this['_getStreamReader'](_0x32f0de);},'abortController':_0x51a6d1['abortController']};}['callCustomReview']({content:_0xe4f081,prompt:_0x24c8e6,model:_0x2bf851}){const _0xa21c0f=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0xe4f081}],'prompt':_0x24c8e6,'model':_0x2bf851});return{'getStream':async()=>{const _0xf24813=(await _0xa21c0f['request'])['body'];return this['_getStreamReader'](_0xf24813);},'abortController':_0xa21c0f['abortController']};}['upsertAIChatRating'](_0x3e5054,_0x416dba,_0x274757){const _0x10ca93=this['_sendApiRequest']('/conversations/'+_0x3e5054+'/messages/'+_0x416dba+'/ratings','PUT',{'positiveCount':_0x274757['positiveCount'],'totalCount':_0x274757['totalCount'],'modificationId':_0x274757['modificationId']});return{'execute':async()=>{await _0x10ca93['request'];},'abortController':_0x10ca93['abortController']};}['upsertAIActionRating'](_0x5334e0,_0x85f741,_0x3d8a70){const _0x56f32d=this['_sendApiRequest']('/actions/system/'+_0x5334e0+'/calls/'+_0x85f741+'/ratings','PUT',{'positiveCount':_0x3d8a70['positiveCount'],'totalCount':_0x3d8a70['totalCount']});return{'execute':async()=>{await _0x56f32d['request'];},'abortController':_0x56f32d['abortController']};}['upsertCustomAIActionRating'](_0x589ebb,_0x4e6f4c){const _0xb1d43d=this['_sendApiRequest']('/actions/custom/calls/'+_0x589ebb+'/ratings','PUT',{'positiveCount':_0x4e6f4c['positiveCount'],'totalCount':_0x4e6f4c['totalCount']});return{'execute':async()=>{await _0xb1d43d['request'];},'abortController':_0xb1d43d['abortController']};}['upsertAIReviewRating'](_0x2e4e28,_0x8b97f8,_0x151ba7,_0x5a6ae6){const _0x53c00b=this['_sendApiRequest']('/reviews/system/'+_0x2e4e28+'/calls/'+_0x8b97f8+'/ratings','PUT',{'positiveCount':_0x151ba7['positiveCount'],'totalCount':_0x151ba7['totalCount'],'dataId':_0x5a6ae6});return{'execute':async()=>{await _0x53c00b['request'];},'abortController':_0x53c00b['abortController']};}['upsertCustomAIReviewRating'](_0x311d6f,_0x1d982a,_0x34b21d){const _0x5c44d9=this['_sendApiRequest']('/reviews/custom/calls/'+_0x311d6f+'/ratings','PUT',{'positiveCount':_0x1d982a['positiveCount'],'totalCount':_0x1d982a['totalCount'],'dataId':_0x34b21d});return{'execute':async()=>{await _0x5c44d9['request'];},'abortController':_0x5c44d9['abortController']};}['_sendApiRequest'](_0x3df665,_0x2ff277,_0x4927d4){const _0x42b500=new AbortController(),_0x58f4f9=_0x4927d4 instanceof FormData,_0x93aeb1={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x4927d4&&!_0x58f4f9&&(_0x93aeb1['Content-Type']='application/json');const _0x11fbb8={'method':_0x2ff277,'headers':_0x93aeb1,'signal':_0x42b500['signal']};return _0x4927d4&&(_0x11fbb8['body']=_0x58f4f9?_0x4927d4:JSON['stringify'](_0x4927d4)),{'request':fetch(''+this['_apiUrl']+_0x3df665,_0x11fbb8)['catch'](_0x1f70e0=>{this['_handleError'](_0x1f70e0);})['then'](_0x5ea8fc=>_0x5ea8fc['ok']?_0x5ea8fc:_0x5ea8fc['json']()['then'](_0x369fec=>{throw{'url':this['_apiUrl'],'path':_0x3df665,'method':_0x2ff277,'body':_0x4927d4,'status':(_0x5ea8fc||{})['status'],'statusText':(_0x5ea8fc||{})['statusText'],'code':_0x369fec['code'],'message':_0x369fec['message'],'traceId':_0x369fec['traceId']};})),'abortController':_0x42b500};}async*['_getStreamReader'](_0x15ae6e){const _0x5df930=[],_0xe67a54=_0x15ae6e['getReader'](),_0x7c836c=$t({'onError':_0x59ce7d=>{this['_handleError'](_0x59ce7d);},'onEvent':_0xff1d32=>{_0xff1d32['data']=JSON['parse'](_0xff1d32['data']),_0x5df930['push'](_0xff1d32);}});try{let _0x11de79=!0x1;for(;!_0x11de79;){const {done:_0x2d1fa4,value:_0xdc1800}=await _0xe67a54['read']();_0x2d1fa4&&(_0x11de79=!0x0),_0x7c836c['feed'](this['_decoder']['decode'](_0xdc1800,{'stream':!0x0})),yield*_0x5df930,_0x5df930['length']=0x0;}}catch(_0xb0df63){this['_handleError'](_0xb0df63);}finally{_0xe67a54['releaseLock'](),_0x7c836c['reset']();}}['_handleError'](_0x551951){if(_0x551951 instanceof _0x563e6a)throw _0x551951;if(_0x551951 instanceof Error&&'AbortError'===_0x551951['name'])throw new _0x563e6a('ai-request-aborted',this,{'originalError':_0x551951});throw new _0x563e6a('ai-request-failed',this,{'originalError':_0x551951});}}function i(_0x11a33f,_0xe77c5b,_0x41c25d){const t=_0x11a33f['t'];switch(_0xe77c5b){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'},_0x41c25d);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.'},_0x41c25d);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.'},_0x41c25d);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.'},_0x41c25d);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'},_0x41c25d);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x41c25d);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'},_0x41c25d);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.'},_0x41c25d);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.'},_0x41c25d);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.'},_0x41c25d);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.'},_0x41c25d);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'},_0x41c25d);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.'},_0x41c25d);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 _0xe77c5b;}}function us(_0x2c2328,_0x54021a){const _0x59d36c=new _0x2cf640(_0x2c2328),_0x5d414e=i(_0x2c2328,'AI_TABS_LABEL_MINIMIZE'),_0x3c522a=i(_0x2c2328,'AI_TABS_LABEL_MAXIMIZE');return _0x59d36c['set']({'withText':!0x1,'icon':_0x3ff106,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary'}),_0x59d36c['bind']('label')['to'](_0x54021a,'isMaximized',_0x1441fd=>_0x1441fd?_0x5d414e:_0x3c522a),_0x59d36c['bind']('icon')['to'](_0x54021a,'isMaximized',_0x32be05=>_0x32be05?_0x2e4568:_0x3ff106),_0x59d36c['bind']('isOn')['to'](_0x54021a,'isMaximized'),_0x59d36c['on']('execute',()=>{_0x54021a['fire']('resizeTabs');}),_0x59d36c;}function Wi(_0x3eddf8){return _0x4b17c9(_0x3eddf8);}function pt(_0x3aec94){return _0x17e525(_0x3aec94);}function It(_0x56014a,_0x21164e,_0x2eca3c){const _0x222191=null!==_0x21164e?_0x5979a0=>_0x5979a0['attribs'][_0x56014a]===_0x21164e:_0xe8824a=>Boolean(_0xe8824a['attribs'][_0x56014a]);return gt(_0x29e9b4=>_0x40e032(_0x29e9b4)&&_0x222191(_0x29e9b4),_0x2eca3c);}function Qi(_0x332aec,_0x78b9f1,_0x54b192){const _0x4720ec=null!==_0x78b9f1?_0x40a9f7=>_0x40a9f7['attribs'][_0x332aec]===_0x78b9f1:_0x2a75df=>Boolean(_0x2a75df['attribs'][_0x332aec]);return _0x4c7e33(_0x814e4a=>_0x40e032(_0x814e4a)&&_0x4720ec(_0x814e4a),_0x54b192);}function ut(_0x2ca81e,_0x41661a){return _0x2ca81e&&_0x40e032(_0x2ca81e)?_0x2ca81e['attribs'][_0x41661a]:null;}function Is(_0x114e87,_0x40e0f7,_0x4e3174){_0x40e032(_0x114e87)&&(null===_0x4e3174?delete _0x114e87['attribs'][_0x40e0f7]:_0x114e87['attribs'][_0x40e0f7]=_0x4e3174);}function $i(_0x3eac8a,_0x201e9d,_0x553415){const _0x21af26=_0x201e9d['cloneNode'](!0x0);'beforebegin'===_0x553415?_0x4856b5(_0x3eac8a,_0x21af26):'afterbegin'===_0x553415?_0x8342b6(_0x3eac8a,_0x21af26):'beforeend'===_0x553415?_0xadca60(_0x3eac8a,_0x21af26):'afterend'===_0x553415&&_0x43ba66(_0x3eac8a,_0x21af26);}function Ui(_0x3449d6){const _0x3e2ad6=[];let _0x2d5087=_0x3449d6;for(;_0x2d5087;)_0x2d5087=_0x4708b7(_0x2d5087),_0x2d5087&&_0x3e2ad6['push'](_0x2d5087);return _0x3e2ad6;}function Kn(_0x2f0eb1){return _0x2f0eb1['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function vs(_0x1e58f3){let _0x5ee200=0x0;for(;_0x1e58f3['parentNode'];)_0x1e58f3=_0x1e58f3['parentNode'],_0x5ee200++;return _0x5ee200;}function xs(_0x252524){const _0x5a2fcd=[];let _0x54dba4=_0x252524['nextSibling'];for(;_0x54dba4;)_0x5a2fcd['push'](_0x54dba4),_0x54dba4=_0x54dba4['nextSibling'];_0x5a2fcd['forEach'](_0x46d1e6=>{_0x12acc3(_0x46d1e6);});}class Fi extends/* #__PURE__ -- @preserve */
25
+ ts(){['_m2html'];constructor(){super(),this['_m2html']=new _0x499648();}['convertMarkdownToHTML'](_0x28db4e){const _0x190723=this['_m2html']['parse'](_0x28db4e);return this['parseAndNormalizeHTML'](_0x190723);}['parseAndNormalizeHTML'](_0x4671e1){return this['_parseHTML'](_0x4671e1);}['_parseHTML'](_0xb3e774){const _0x43e238=Wi('<dummy>'+_0xb3e774['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x43e238['children']=_0x43e238['children'][0x0]['children'],_0x43e238;}}class Ji extends/* #__PURE__ -- @preserve */
26
+ ts(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x444254){super(),this['_generateUid']=_0x444254||_0x48eb5e;}['merge'](_0x51359e,_0x5b5a1f,_0x1b1b56){const _0x4316af=_0x51359e['cloneNode'](!0x0);if(0x0===_0x5b5a1f['childNodes']['length']){const _0x5a7284=[];return Qi('data-id','new-element',_0x4316af)['forEach'](_0x4f0229=>{const _0x3eaff5=this['_generateUid']();Is(_0x4f0229,'data-id',_0x3eaff5),_0x5a7284['push'](_0x3eaff5);}),this['_removeSpecialComments'](_0x4316af),{'parsedContent':_0x4316af,'newNodeIds':_0x5a7284,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x1b1b56&&_0x1b1b56['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x4316af),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Qi('data-id',null,_0x5b5a1f)['map'](_0x37b48b=>ut(_0x37b48b,'data-id'))['filter'](_0x3133f6=>!!_0x3133f6));let _0xbd8b1a=-0x1,_0x3240a4=!0x1;const _0x412d70=_0x4316af['childNodes'],_0x6f2399=Array['from'](_0x412d70)['filter'](_0x1b817e=>!(0x3===_0x1b817e['nodeType']&&''===pt(_0x1b817e)['trim']())),_0x506f59=_0x6f2399['length'];for(let _0x3818dc=0x0;_0x3818dc<_0x506f59;_0x3818dc++){const _0xf91065=_0x6f2399[_0x3818dc],_0x1fbd6e=_0x6f2399[_0x3818dc+0x1];if(this['_isNewNode'](_0xf91065)){if(-0x1===_0xbd8b1a&&(_0xbd8b1a=_0x3818dc),this['_markWrappedElements'](_0xf91065),!this['_isNewNode'](_0x1fbd6e)){const [_0x5baac6,_0x4465b0]=this['_findReferenceNode'](_0xf91065,_0x3240a4,_0x5b5a1f);if(_0x5baac6){const _0xd79d=Array['from'](_0x6f2399)['slice'](_0xbd8b1a,_0x3818dc+0x1);this['_insertNodes'](_0x5baac6,_0xd79d,_0x4465b0),_0xbd8b1a=-0x1;}}}else{if(this['_isExistingContentComment'](_0xf91065))_0x3240a4=!0x0;else{if(this['_isExistingNode'](_0xf91065)){const _0x4ec327=ut(_0xf91065,'data-id');if(_0x4ec327&&this['_existingDataIds']['has'](_0x4ec327)){const _0x45f949=It('data-id',_0x4ec327,_0x5b5a1f);this['_replaceNode'](_0x45f949,_0xf91065);}if(this['_touchedNodesState']['removedIds']['includes'](_0x4ec327)){const _0x27a872=this['_touchedNodesState']['removedIds']['indexOf'](_0x4ec327);this['_touchedNodesState']['removedIds']['splice'](_0x27a872,0x1);}}else{if(this['_isDelNode'](_0xf91065)){const _0xfdec83=ut(_0xf91065,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0xfdec83)||this['_storeDeletedElementIds'](_0xf91065);}}}}}for(const _0x1c74f2 of this['_touchedNodesState']['removedIds']){const _0x1f9827=It('data-id',_0x1c74f2,_0x5b5a1f);if(_0x1f9827){if(_0x1b1b56&&_0x1b1b56['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x1c74f2;const _0x1cc63d=_0x1b1b56['replaceRemovedWith']['cloneNode'](!0x0);Is(_0x1cc63d,'data-id',_0x1c74f2),Is(_0x1cc63d,'data-removed','true'),_0xd8634b(_0x1f9827,_0x1cc63d);}else _0x12acc3(_0x1f9827);}}if(Qi('data-wrapped-id',null,_0x5b5a1f)['forEach'](_0x104868=>{const _0x1b6324=It('data-id',ut(_0x104868,'data-wrapped-id'),_0x5b5a1f);var _0xbd90aa,_0x489877;_0x1b6324&&(_0x489877=_0x104868,_0x12acc3(_0xbd90aa=_0x1b6324),_0xd8634b(_0x489877,_0xbd90aa));}),Qi('data-id','new-element',_0x5b5a1f)['forEach'](_0x197f2b=>{const _0x3d2b82=this['_getUid'](_0x197f2b);Is(_0x197f2b,'data-id',_0x3d2b82),this['_touchedNodesState']['newIds']['push'](_0x3d2b82);}),this['_removeSpecialComments'](_0x5b5a1f),_0x1b1b56&&_0x1b1b56['markUnstableElements']&&this['_markUnstableElements'](_0x5b5a1f,_0x1b1b56['markUnstableElementsDepth']||0x0),_0x1b1b56&&_0x1b1b56['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x47161e=It('data-id',this['_touchedNodesState']['lastTouchedId'],_0x5b5a1f);for(;_0x47161e;)xs(_0x47161e),_0x47161e=_0x47161e['parentNode'];}return{'parsedContent':_0x5b5a1f,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x263e13,_0x49c2d0,_0x24c2ff){for(const _0xa83ace of _0x49c2d0){const _0xbbba25=this['_getUid'](_0xa83ace);Is(_0xa83ace,'data-id',_0xbbba25),this['_touchedNodesState']['newIds']['push'](_0xbbba25),this['_touchedNodesState']['lastTouchedId']=_0xbbba25;}const _0x2ec5fe='afterbegin'===_0x24c2ff||'afterend'===_0x24c2ff?_0x49c2d0['reverse']():_0x49c2d0;for(const _0x4f4cfc of _0x2ec5fe)$i(_0x263e13,_0x4f4cfc,_0x24c2ff);}['_replaceNode'](_0x421a87,_0x2c43d5){if(!_0x421a87)return;if(_0x32badd=_0x2c43d5,Kn(pt(_0x421a87))===Kn(pt(_0x32badd)))return;var _0x32badd;const _0x1995a6=this['_getUid'](_0x421a87);Is(_0x2c43d5,'data-id',_0x1995a6),this['_touchedNodesState']['modifiedIds']['push'](_0x1995a6),this['_touchedNodesState']['lastTouchedId']=_0x1995a6,_0xd8634b(_0x421a87,_0x2c43d5['cloneNode'](!0x0));}['_findReferenceNode'](_0x2f6777,_0x9845ed,_0x25f21d){const _0x29b60c=this['_findPrevElementWithDataId'](_0x2f6777,!0x1);if(_0x29b60c){const _0x3863c7=this['_getNodeDataId'](_0x29b60c),_0x30e34a=It('data-id',_0x3863c7,_0x25f21d);if(_0x30e34a)return[_0x30e34a,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x3863c7);}const _0x510d8b=this['_findNextElementWithDataId'](_0x2f6777,!0x1);if(_0x510d8b){const _0x52e680=this['_getNodeDataId'](_0x510d8b),_0x254a75=It('data-id',_0x52e680,_0x25f21d);if(_0x254a75)return[_0x254a75,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x52e680);}return _0x9845ed?_0x2f6777['nextSibling']?this['_findFallbackReferenceNode'](_0x2f6777,_0x25f21d):[_0x25f21d['childNodes'][_0x25f21d['childNodes']['length']-0x1],'afterend']:[_0x25f21d['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x3ca457,_0xb5f1f0){const _0x2f78b0=[],_0x3e00cf=this['_findPrevElementWithDataId'](_0x3ca457,!0x0);if(_0x3e00cf){const _0x48efa8=It('data-id',this['_getNodeDataId'](_0x3e00cf),_0xb5f1f0);_0x48efa8&&_0x2f78b0['push']([_0x48efa8,'afterend']);}const _0x568523=this['_findNextElementWithDataId'](_0x3ca457,!0x0);if(_0x568523){const _0x4d9162=It('data-id',this['_getNodeDataId'](_0x568523),_0xb5f1f0);_0x4d9162&&_0x2f78b0['push']([_0x4d9162,'beforebegin']);}if(_0x2f78b0['length']>0x1)return vs(_0x2f78b0[0x0][0x0])<=vs(_0x2f78b0[0x1][0x0])?_0x2f78b0[0x0]:_0x2f78b0[0x1];return 0x1===_0x2f78b0['length']?_0x2f78b0[0x0]:[_0xb5f1f0['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x5ebc99,_0x5142a4){let _0x575e35=_0x5ebc99['nextSibling'],_0x5d41fb=null,_0x3e9d44=!0x1;for(;_0x575e35;){if(_0x38b3c0(_0x575e35)){if(this['_isDelNode'](_0x575e35)&&(_0x5d41fb=_0x575e35),this['_isExistingContentComment'](_0x575e35)&&_0x5142a4&&!_0x3e9d44){_0x3e9d44=!0x0,_0x575e35=_0x575e35['nextSibling'];continue;}break;}const _0x184ba5=ut(_0x575e35,'data-id');if(_0x184ba5&&'new-element'!==_0x184ba5&&this['_existingDataIds']['has'](_0x184ba5)){_0x5d41fb=_0x575e35;break;}_0x575e35=_0x575e35['nextSibling'];}return _0x5d41fb;}['_findPrevElementWithDataId'](_0xdcc989,_0x5e4108){let _0x1b5dbf=_0xdcc989['previousSibling'],_0x2b844d=null,_0x3852f8=!0x1;for(;_0x1b5dbf;){if(_0x38b3c0(_0x1b5dbf)){if(this['_isDelNode'](_0x1b5dbf)&&(_0x2b844d=_0x1b5dbf),this['_isExistingContentComment'](_0x1b5dbf)&&_0x5e4108&&!_0x3852f8){_0x3852f8=!0x0,_0x1b5dbf=_0x1b5dbf['previousSibling'];continue;}break;}const _0x2e1c3b=ut(_0x1b5dbf,'data-id');if(_0x2e1c3b&&'new-element'!==_0x2e1c3b&&this['_existingDataIds']['has'](_0x2e1c3b)){_0x2b844d=_0x1b5dbf;break;}_0x1b5dbf=_0x1b5dbf['previousSibling'];}return _0x2b844d;}['_markWrappedElements'](_0x2d0bf0){_0x40e032(_0x2d0bf0)&&Qi('data-id',null,_0x2d0bf0)['forEach'](_0xd3fbc1=>{this['_isExistingNode'](_0xd3fbc1)&&!this['_hasWrappedParent'](_0xd3fbc1)&&(Is(_0xd3fbc1,'data-wrapped-id',ut(_0xd3fbc1,'data-id')),Is(_0xd3fbc1,'data-id',null));});}['_getNodeDataId'](_0x2c6d31){if(!_0x2c6d31)return null;if(_0x40e032(_0x2c6d31))return ut(_0x2c6d31,'data-id');if(_0x38b3c0(_0x2c6d31)){const _0x4ad792=pt(_0x2c6d31)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x4ad792&&_0x4ad792[0x1])return _0x4ad792[0x1];}return null;}['_storeDeletedElementIds'](_0x5b34d3){if(_0x38b3c0(_0x5b34d3)){const _0x220144=pt(_0x5b34d3)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x220144&&_0x220144[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x220144[0x1]);}}['_getUid'](_0x2d3d4f){return this['_isExistingNode'](_0x2d3d4f)?ut(_0x2d3d4f,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x3bf488){(function(_0x939eab){return _0x284730(_0x16c7f8=>_0x38b3c0(_0x16c7f8),_0x939eab,!0x0,0x1/0x0);}(_0x3bf488)['filter'](_0x357b05=>this['_isDelNode'](_0x357b05)||this['_isExistingContentComment'](_0x357b05))['forEach'](_0x2fae43=>{_0x12acc3(_0x2fae43);}));}['_markLastTagElementUnstable'](_0x268821){const _0x54f92e=_0x268821['childNodes'],_0x28137b=_0x54f92e[_0x54f92e['length']-0x1];_0x28137b&&_0x40e032(_0x28137b)&&Is(_0x28137b,'data-unstable','true');}['_markUnstableElements'](_0x300a11,_0x547398){const _0xbad882=It('data-unstable','true',_0x300a11);if(!_0xbad882)return;const _0x326c17=Ui(_0xbad882)['slice'](0x0,-0x1),_0x1c3043=_0x326c17['length'];let _0x46c3a8=_0xbad882;if(_0x1c3043>_0x547398){let _0x248bc7=_0x1c3043,_0x93bb74=null;for(;_0x248bc7>_0x547398&&_0x248bc7>=0x0;)_0x248bc7--,_0x93bb74=_0x326c17[_0x248bc7];_0x93bb74&&(_0x46c3a8=_0x93bb74,Is(_0xbad882,'data-unstable',null),Is(_0x93bb74,'data-unstable','true'));}else{if(_0x1c3043<_0x547398){let _0x20b96b=_0x1c3043,_0x3ff617=_0xbad882;for(;_0x20b96b<_0x547398;){const _0xa8a0a0=_0x3ff617['childNodes']['filter'](_0x18457b=>_0x40e032(_0x18457b));if(0x0===_0xa8a0a0['length'])break;_0x20b96b++,_0x3ff617=_0xa8a0a0[_0xa8a0a0['length']-0x1];}_0x3ff617&&(_0x46c3a8=_0x3ff617,Is(_0xbad882,'data-unstable',null),Is(_0x3ff617,'data-unstable','true'));}}let _0x463150=_0x46c3a8;for(;_0x463150;){for(;_0x463150['nextSibling'];)_0x463150=_0x463150['nextSibling'],_0x40e032(_0x463150)&&Is(_0x463150,'data-unstable','true');_0x463150=_0x463150['parentNode'];}}['_isNewNode'](_0x4dce4a){return Boolean('new-element'===ut(_0x4dce4a,'data-id'));}['_isExistingNode'](_0x15ffc8){return Boolean((ut(_0x15ffc8,'data-id')||'')['length']>0x0&&'new-element'!==ut(_0x15ffc8,'data-id'));}['_isDelNode'](_0x11706b){return!!_0x11706b&&Boolean(_0x38b3c0(_0x11706b)&&pt(_0x11706b)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x18b31a){let _0x498d06=_0x18b31a['parentNode'];for(;_0x498d06;){if(ut(_0x498d06,'data-wrapped-id'))return!0x0;_0x498d06=_0x498d06['parentNode'];}return!0x1;}['_isExistingContentComment'](_0xd12672){return Boolean(_0x38b3c0(_0xd12672)&&pt(_0xd12672)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function wt({editor:_0x3fb891,changeGroups:_0x4b6bcb,documentContextContent:_0x25dfd8,showDiff:_0x1a9666,trimUnchanged:_0x3b4e7f=!0x0}){return _0x4b6bcb['map'](_0x71fcc4=>{const _0x3c1937=new _t([]),_0x2807d9=new _t([]);for(const _0x7e67ca of _0x71fcc4['changes'])if(_0x1a9666&&'removed'==_0x7e67ca['type']||_0x2807d9['children']['push'](_0x7e67ca['node']['cloneNode'](!0x0)),'new'!=_0x7e67ca['type']&&(_0x1a9666||'removed'!=_0x7e67ca['type'])){const _0x55589e=gt(_0x1cf36a=>ut(_0x1cf36a,'data-id')==_0x7e67ca['id'],_0x25dfd8,!0x0);_0x55589e&&_0x3c1937['children']['push'](_0x55589e['cloneNode'](!0x0));}const {content:_0x334843,hasChanges:_0x1ad524}=function(_0x3c6595,_0x95681b,_0x330388,_0x30128a,_0x24fb93=!0x0){const _0x4c371c=_0x3c6595['plugins']['get']('DocumentCompare'),_0xf22bef=pt(_0x95681b),_0xdadee1=pt(_0x330388),_0x6544ae=_0x3c6595['data']['parse'](_0xf22bef,'$root'),_0x2af3e9=_0x3c6595['model']['createPositionAt'](_0x6544ae,0x0),_0x504f1b=_0x4c371c['getDiff'](_0xf22bef,_0xdadee1,{'anchor':_0x2af3e9,'markDeletions':_0x30128a}),_0x555e0a=_0x504f1b['getOperations']();if(0x0==_0x555e0a['length'])return{'content':_0x95681b['cloneNode'](!0x0),'hasChanges':!0x1};_0x30128a?function(_0x223b12,_0x565a93,_0x555cd3){if(0x0==_0x223b12['length'])return;const _0x5c262b=_0x555cd3['plugins']['get']('DocumentCompare'),_0x1ec3ee=_0x555cd3['plugins']['get']('SuggestionsConversion');_0x555cd3['model']['change'](_0xb3a9e6=>{const _0x497150=new Set();for(let _0x56f2e0=0x0;_0x56f2e0<_0x223b12['length'];_0x56f2e0++){const _0x19a031=_0x223b12[_0x56f2e0];if(_0x19a031['baseVersion']=null,_0x19a031['isDocumentOperation']=!0x1,_0x5c262b['isMarkedRemoveOperation'](_0x19a031)){const _0x4f9f97=_0x5df738(_0x19a031['newRange'],_0x555cd3['model']),_0x3b7c6c='suggestion:deletion:'+_0x48eb5e()+':$aiSuggestion';_0x565a93['markers']['set'](_0x3b7c6c,_0x4f9f97);}else switch(_0x19a031['type']){case'rename':{if(_0x19a031['oldName']==_0x19a031['newName'])break;_0xb3a9e6['batch']['addOperation'](_0x19a031),_0x555cd3['model']['applyOperation'](_0x19a031);const _0x535147='$elementName',_0x4e8d30=_0x19a031['position'],_0x23c40b=_0x555cd3['model']['createRange'](_0x4e8d30,_0x555cd3['model']['createPositionAt'](_0x4e8d30['nodeAfter'],'end')),_0xcf177a='suggestion:attribute:'+_0x535147+':'+_0x48eb5e()+':$aiSuggestion';_0x565a93['markers']['set'](_0xcf177a,_0x23c40b);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x19a031['oldValue']==_0x19a031['newValue'])break;_0xb3a9e6['batch']['addOperation'](_0x19a031),_0x555cd3['model']['applyOperation'](_0x19a031);const _0x55f8b8=_0x19a031['key'];if(!_0x1ec3ee['isRegisteredAttribute'](_0x55f8b8))break;const _0x22b201=_0x5df738(_0x19a031['range'],_0x555cd3['model']),_0x1eb97e='suggestion:attribute:'+_0x55f8b8+':'+_0x48eb5e()+':$aiSuggestion';_0x565a93['markers']['set'](_0x1eb97e,_0x22b201);break;}case'insert':{_0xb3a9e6['batch']['addOperation'](_0x19a031),_0x555cd3['model']['applyOperation'](_0x19a031);if(_0x223b12[_0x56f2e0+0x1]&&'move'==_0x223b12[_0x56f2e0+0x1]['type']){no(_0x565a93,_0x19a031);break;}const _0x10e704=_0x19a031['position'],_0x3bef1f=_0x19a031['howMany'],_0x59d9d0=_0x5df738(_0x555cd3['model']['createRange'](_0x10e704,_0x10e704['getShiftedBy'](_0x3bef1f)),_0x555cd3['model']),_0x37bf3f='suggestion:insertion:'+_0x48eb5e()+':$aiSuggestion';_0x565a93['markers']['set'](_0x37bf3f,_0x59d9d0);break;}case'split':{_0xb3a9e6['batch']['addOperation'](_0x19a031),_0x555cd3['model']['applyOperation'](_0x19a031);const _0x19046f=_0x19a031['splitPosition'],_0x192eb0=_0x19a031['moveTargetPosition'],_0x23381a=_0x555cd3['model']['createRange'](_0x19046f,_0x192eb0),_0x20d4cc='suggestion:insertion:'+_0x48eb5e()+':$aiSuggestion';_0x565a93['markers']['set'](_0x20d4cc,_0x23381a);break;}case'move':{_0xb3a9e6['batch']['addOperation'](_0x19a031),_0x555cd3['model']['applyOperation'](_0x19a031),_0x223b12[_0x56f2e0-0x1]&&'insert'==_0x223b12[_0x56f2e0-0x1]['type']&&no(_0x565a93,_0x19a031);const _0x52f4ce=_0x19a031['getMovedRangeStart'](),_0x3a0dca=_0x19a031['howMany'];for(let _0x3e897c=0x0;_0x3e897c<_0x3a0dca;_0x3e897c++){const _0x5f1a9c=_0x52f4ce['getShiftedBy'](_0x3e897c)['nodeAfter'];_0x497150['add'](_0x5f1a9c);}break;}case'remove':{const _0x70d7fa=_0x19a031['sourcePosition'],_0x5bf048=_0x19a031['howMany'],_0x15b9f7=new lt(_0x70d7fa,_0x5bf048);_0xb3a9e6['batch']['addOperation'](_0x15b9f7),_0x555cd3['model']['applyOperation'](_0x15b9f7);break;}}}for(const _0x9bca56 of _0x497150){const _0x4d28d6=_0x555cd3['model']['createRangeOn'](_0x9bca56),_0x28d5c9='suggestion:formatBlock:$fakeWrap:'+_0x48eb5e()+':$aiSuggestion';_0x565a93['markers']['set'](_0x28d5c9,_0x5df738(_0x4d28d6,_0x555cd3['model']));}});}(_0x555e0a,_0x6544ae,_0x3c6595):_0x3c6595['model']['change'](_0x26be09=>{for(const _0x151ea2 of _0x555e0a)if('remove'==_0x151ea2['type']){const _0x12564c=_0x151ea2['sourcePosition'],_0x46ed75=_0x151ea2['howMany'],_0x5b7987=new lt(_0x12564c,_0x46ed75);_0x26be09['batch']['addOperation'](_0x5b7987),_0x3c6595['model']['applyOperation'](_0x5b7987);}else{if('marker'==_0x151ea2['type']){const _0x3f2adb=_0x151ea2['name'],_0x10a1da=_0x151ea2['newRange'];null!==_0x10a1da?_0x6544ae['markers']['set'](_0x3f2adb,_0x10a1da):_0x6544ae['markers']['delete'](_0x3f2adb);}else _0x151ea2['baseVersion']=null,_0x151ea2['isDocumentOperation']=!0x1,_0x26be09['batch']['addOperation'](_0x151ea2),_0x3c6595['model']['applyOperation'](_0x151ea2);}});if(_0x24fb93){const _0x5b4c87=ct(_0x3c6595,_0x555e0a,_0x6544ae);ht(_0x3c6595['model'],_0x5b4c87),function(_0x4e32a4,_0x451619){const _0x12337f=_0x451619['getFirstRange']()['start'];let _0x74eea7=_0x451619['getFirstRange']()['end'];const _0x1bb5f7=_0x12337f['root'];(_0x74eea7['textNode']||_0x74eea7['nodeAfter']&&_0x74eea7['nodeAfter']['is']('$text'))&&(_0x296e10(_0x74eea7,'...'),_0x74eea7=_0x74eea7['getShiftedBy'](0x3)),(_0x12337f['textNode']||_0x12337f['nodeBefore']&&_0x12337f['nodeBefore']['is']('$text'))&&(_0x296e10(_0x12337f,'...'),function(_0xbb9cb,_0x6f8814,_0x58d446){for(let [_0x58eedd,_0x6de8b7]of _0xbb9cb['markers']){const _0x4311a9=_0x6de8b7['_getTransformedByInsertion'](_0x6f8814,_0x58d446,!0x1);_0x6de8b7=_0x4311a9[0x0],_0xbb9cb['markers']['set'](_0x58eedd,_0x6de8b7);}}(_0x1bb5f7,_0x12337f,0x3),_0x12337f['parent']==_0x74eea7['parent']&&(_0x74eea7=_0x74eea7['getShiftedBy'](0x3)));const _0x2bf604=_0x4e32a4['createRange'](_0x4e32a4['createPositionAt'](_0x1bb5f7,0x0),_0x12337f),_0x1b22a9=_0x4e32a4['createRange'](_0x74eea7,_0x4e32a4['createPositionAt'](_0x1bb5f7,'end')),_0x4f64df=[..._0x2bf604['getMinimalFlatRanges'](),..._0x1b22a9['getMinimalFlatRanges']()];_0x4f64df['reverse']();for(const _0x23226d of _0x4f64df)to(_0x23226d),Yn(_0x1bb5f7,_0x23226d);}(_0x3c6595['model'],_0x5b4c87);}const _0x1b72b7=_0x3c6595['data']['stringify'](_0x6544ae,{'showSuggestionHighlights':!0x0});return{'content':Wi(_0x1b72b7),'hasChanges':!0x0};}(_0x3fb891,_0x3c1937,_0x2807d9,_0x1a9666,_0x3b4e7f);return{'type':_0x71fcc4['changes'][0x0]['type'],'index':_0x71fcc4['index'],'content':_0x334843,'hasChanges':_0x1ad524};});}function no(_0x24257e,_0x1f2de5){for(const [_0x48ea29,_0x2a2d85]of _0x24257e['markers']){const _0x1f82a5=dt['_createFromRanges'](_0x2a2d85['getTransformedByOperation'](_0x1f2de5));_0x24257e['markers']['set'](_0x48ea29,_0x1f82a5);}}function ct(_0x229fba,_0x5219f9,_0x31406){const _0x1d9b3e=_0x229fba['plugins']['get']('DocumentCompare');let _0x13dcbb=_0x229fba['model']['createPositionAt'](_0x31406,Number['POSITIVE_INFINITY']),_0x3de301=_0x229fba['model']['createPositionAt'](_0x31406,0x0);for(const _0x1b4109 of _0x5219f9){let _0x467c4a,_0x499346;if(_0x1d9b3e['isMarkedRemoveOperation'](_0x1b4109))_0x467c4a=_0x1b4109['newRange']['start'],_0x499346=_0x1b4109['newRange']['end'];else switch(_0x13dcbb=_0x13dcbb['getTransformedByOperation'](_0x1b4109),_0x3de301=_0x3de301['getTransformedByOperation'](_0x1b4109),_0x1b4109['type']){case'rename':_0x467c4a=_0x1b4109['position'],_0x499346=_0x467c4a['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x467c4a=_0x1b4109['range']['start'],_0x499346=_0x1b4109['range']['end'];break;case'insert':_0x467c4a=_0x1b4109['position'],_0x499346=_0x467c4a['getShiftedBy'](_0x1b4109['howMany']);break;case'split':_0x467c4a=_0x1b4109['splitPosition'],_0x499346=_0x1b4109['moveTargetPosition'];break;case'merge':{const _0x4ed64e=_0x1b4109['targetPosition']['path']['slice'](0x0,-0x1);_0x467c4a=_0x229fba['model']['createPositionFromPath'](_0x31406,_0x4ed64e),_0x499346=_0x467c4a['getShiftedBy'](0x1);break;}case'remove':{const _0x164baa=_0x1b4109['howMany'],_0x3014fe=_0x1b4109['sourcePosition']['_getTransformedByInsertion'](_0x1b4109['targetPosition'],_0x164baa),_0xd7086d=_0x1b4109['getMovedRangeStart']();'remove'==_0x1b4109['type']?(_0x467c4a=_0x3014fe,_0x499346=_0x3014fe):(_0x467c4a=_0xd7086d,_0x499346=_0xd7086d['getShiftedBy'](_0x164baa));break;}}_0x467c4a&&_0x467c4a['isBefore'](_0x13dcbb)&&(_0x13dcbb=_0x467c4a['clone'](),_0x13dcbb['stickiness']='toNone'),_0x499346&&_0x499346['isAfter'](_0x3de301)&&(_0x3de301=_0x499346['clone'](),_0x3de301['stickiness']='toNone');}return _0x229fba['model']['createSelection'](_0x229fba['model']['createRange'](_0x13dcbb,_0x3de301));}function ht(_0x5bd301,_0x171f08){ro(_0x5bd301,_0x171f08,'forward');const _0xb512a3=_0x171f08['getFirstRange']();_0x171f08['setTo']([]),_0x171f08['setTo'](_0xb512a3,{'backward':!0x0}),ro(_0x5bd301,_0x171f08,'backward');}function ro(_0x3b75f3,_0x4a4f7a,_0x4716b4){let _0x37ee6a=0x14;for(;_0x37ee6a;){_0x3b75f3['modifySelection'](_0x4a4f7a,{'unit':'word','direction':_0x4716b4}),_0x37ee6a--;const _0x3d02ed=_0x4a4f7a['focus']['forward'==_0x4716b4?'nodeBefore':'nodeAfter'];if(_0x3d02ed&&_0x3d02ed['is']('element')&&_0x3b75f3['schema']['isBlock'](_0x3d02ed)&&_0x3b75f3['schema']['isObject'](_0x3d02ed))break;}}function Yn(_0x7d3e21,_0x9e7cfe){for(const [_0x2d2090,_0x4ccfc5]of _0x7d3e21['markers']){const _0x2f9030=_0x4ccfc5['_getTransformedByDeletion'](_0x9e7cfe['start'],_0x9e7cfe['end']['offset']-_0x9e7cfe['start']['offset']);null!=_0x2f9030?_0x7d3e21['markers']['set'](_0x2d2090,_0x2f9030):_0x7d3e21['markers']['delete'](_0x2d2090);}}class xi extends ts(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _t([]);['parsedMergedContent']=new _t([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x570abe,content:_0x2345be='',isDone:_0xab0a6f=!0x1,interactionId:_0xbe2081,areActionsDisabled:_0x2a2766,documentContextContent:_0x2cf07c,editor:_0x3f0487,id:_0x357ef5}){super(),this['id']=_0x357ef5||_0x48eb5e(),this['interactionId']=_0xbe2081,this['type']=_0x570abe,this['areActionsDisabled']=!!_0x2a2766,this['editor']=_0x3f0487,this['aiResponseParser']=new Fi(),this['aiResponseApplier']=new Ji(),this['documentContextContent']=Wi(_0x2cf07c||''),this['set']('isDone',_0xab0a6f),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x2345be);}['appendContent'](_0x5fed21){this['set']('content',this['content']+_0x5fed21);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x5b0a49,_0x268473){this['changeGroups'][_0x5b0a49]['state']=_0x268473,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x5b0a49,'state':_0x268473});}['getContentParts']({showDiff:_0xdccea2,groupIndex:_0x2dd445}){if(!this['editor'])throw new _0x563e6a('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x1ff6ea=this['_getCachedContentParts'](_0xdccea2,_0x2dd445);if(_0x1ff6ea)return _0x1ff6ea;let _0x53688f=[];if(void 0x0===_0x2dd445)_0x53688f=this['changeGroups'];else{const _0x14ef30=this['changeGroups']['find'](({index:_0x11bd95})=>_0x11bd95===_0x2dd445);if(!_0x14ef30)throw new _0x563e6a('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x2dd445});_0x53688f=[_0x14ef30];}const _0x71480b=wt({'editor':this['editor'],'showDiff':_0xdccea2,'changeGroups':_0x53688f,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0xdccea2,_0x71480b),_0x71480b;}['_getCachedContentParts'](_0x295aa1,_0x16b45e){const _0x3791a6=_0x295aa1?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x3791a6]['length'])return null;const _0x32bd09=this['cachedSuggestionContentParts'][_0x3791a6];if(void 0x0===_0x16b45e)return _0x32bd09['length']>0x0&&_0x32bd09['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x295aa1,null),null):_0x4f0e8d(_0x32bd09);{const _0x3f5e68=_0x32bd09['find'](({index:_0x2a25f4})=>_0x2a25f4===_0x16b45e);if(_0x3f5e68)return[_0x4f0e8d(_0x3f5e68)];}return null;}['_setCachedContentParts'](_0x114330,_0x423daa){const _0x3f1725=_0x114330?'withDiff':'withoutDiff';_0x423daa?_0x423daa['forEach'](_0x1c9ca8=>{const _0x37b22c=this['cachedSuggestionContentParts'][_0x3f1725],_0x34aa60=_0x37b22c['find'](({index:_0x47d7d1})=>_0x47d7d1===_0x1c9ca8['index']);if(_0x34aa60){const _0x2cae7e=_0x37b22c['indexOf'](_0x34aa60);_0x37b22c['splice'](_0x2cae7e,0x1,_0x1c9ca8);}else _0x37b22c['push'](_0x1c9ca8);}):this['cachedSuggestionContentParts'][_0x3f1725]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0xd25def=this['changeGroups'];this['updateChangeGroups']();const _0xeb7b09=this['_getDifferentChangeGroups'](_0xd25def,this['changeGroups']);(_0xeb7b09['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0xeb7b09),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x1ed6e7,_0x435b8e){const _0x36bd78=[];for(const _0x2fb80e of _0x435b8e){const _0x17457e=_0x1ed6e7[_0x2fb80e['index']];_0x17457e?_0x17457e['changes']['length']!==_0x2fb80e['changes']['length']?_0x36bd78['push'](_0x2fb80e):_0x17457e['changes']['forEach']((_0x48f82b,_0x1f48f9)=>{const _0x2e30bb=_0x2fb80e['changes'][_0x1f48f9];_0x48f82b['id']!==_0x2e30bb['id']&&_0x36bd78['push'](_0x2fb80e);}):_0x36bd78['push'](_0x2fb80e);}return _0x36bd78;}['updateChangeGroups'](){const _0x262e92=new _0x504ef3('p',{},[new _0x504ef3('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x201b94(i(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x30bc55=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x262e92,'cutAfterLastChange':!this['isDone']});if(!_0x30bc55['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x30bc55['parsedContent'];let _0x23ce76=[];if(_0x4c7e33(_0x180a51=>{const _0x36d414=ut(_0x180a51,'data-id');if(!_0x36d414||!_0x3960c1(_0x36d414))return!0x1;const _0x203e26=[_0x180a51,...Ui(_0x180a51)]['at'](-0x2);if(_0x180a51!=_0x203e26){const _0x1d2a7f=ut(_0x203e26,'data-id');_0x3960c1(_0x1d2a7f)||(_0x23ce76['push']({'node':_0x203e26,'id':_0x1d2a7f,'type':'modified'}),_0x30bc55['modifiedNodeIds']['push'](_0x1d2a7f));}else _0x30bc55['modifiedNodeIds']['includes'](_0x36d414)?_0x23ce76['push']({'node':_0x180a51,'type':'modified','id':_0x36d414}):_0x30bc55['newNodeIds']['includes'](_0x36d414)?_0x23ce76['push']({'node':_0x180a51,'type':'new','id':_0x36d414,'anchorId':ut(_0x180a51['previousSibling'],'data-id')}):_0x23ce76['push']({'node':_0x180a51,'type':'removed','id':_0x36d414});return!0x0;},this['parsedMergedContent']),_0x23ce76=_0x23ce76['filter'](({node:_0x3443ea})=>[...Ui(_0x3443ea),_0x3443ea]['every'](_0x21eaf3=>!ut(_0x21eaf3,'data-unstable'))),0x0==_0x23ce76['length'])return;const _0x9278af=[[_0x23ce76[0x0]]];for(let _0xa503ac=0x1;_0xa503ac<_0x23ce76['length'];_0xa503ac++){const _0x48c2e4=_0x9278af[_0x9278af['length']-0x1],_0x35f9fa=_0x48c2e4[_0x48c2e4['length']-0x1];_0x23ce76[_0xa503ac]['node']['previousSibling']==_0x35f9fa['node']&&'modified'!=_0x23ce76[_0xa503ac]['type']&&'modified'!=_0x35f9fa['type']?_0x48c2e4['push'](_0x23ce76[_0xa503ac]):_0x9278af['push']([_0x23ce76[_0xa503ac]]);}for(const _0x3b8d3c of _0x9278af){const _0x6031fc=_0x3b8d3c[0x0],_0x1accf5=_0x3b8d3c[_0x3b8d3c['length']-0x1],_0x196f32=_0x23d0ed(_0x6031fc['node']['previousSibling']);_0x196f32&&_0x3b8d3c['unshift'](_0x196f32);const _0x249409=_0x23d0ed(_0x1accf5['node']['nextSibling']);_0x249409&&_0x3b8d3c['push'](_0x249409);}function _0x3960c1(_0x306132){return _0x30bc55['modifiedNodeIds']['includes'](_0x306132)||_0x30bc55['newNodeIds']['includes'](_0x306132)||_0x30bc55['removedNodeIds']['includes'](_0x306132);}function _0x23d0ed(_0x141f08){if(_0x141f08&&ut(_0x141f08,'data-id')&&!ut(_0x141f08,'data-unstable')){const _0x3ff0a2=ut(_0x141f08,'data-id');if(!_0x3960c1(_0x3ff0a2))return{'node':_0x141f08,'type':'context','id':_0x3ff0a2};}return null;}this['changeGroups']=_0x9278af['map']((_0x472923,_0x67968b)=>({'changes':_0x472923,'state':'pending','index':_0x67968b}));}}const De=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class os extends _0x5bd7c6(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x650124,editor:_0x13f1cf}){super(),this['id']=_0x48eb5e(),this['connector']=_0x650124,this['isStopped']=!0x0,this['editor']=_0x13f1cf;}async['start'](){const _0x899b75=[];let _0x2497de,_0x48a565,_0x4f3d99;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x4b4f58=await this['currentRequest']['getStream']();for await(const _0x1ddaae of _0x4b4f58){if(this['isStopped'])return;if('error'==_0x1ddaae['event'])return void this['fire']('error',{'error':new _0x563e6a('ai-chat-interaction-error',this)});switch(_0x1ddaae['event']){case'message-metadata':this['messageId']=_0x1ddaae['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x1ddaae['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x1ddaae['data']['conversationTitle'],!0x0);break;case'source':_0x899b75['push'](_0x1ddaae['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'](),_0x2497de='modification-delta'==_0x1ddaae['event']?'modification':'text',_0x48a565='modification-delta'==_0x1ddaae['event']?_0x1ddaae['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x2497de&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x2497de,'interactionId':this['id'],'id':_0x48a565}),'modification'==_0x2497de&&(this['currentReply']['sources']=_0x899b75['splice'](0x0))),this['currentReply']['appendContent'](_0x1ddaae['data']['textDelta']);break;case'mcp-tool-result':_0x4f3d99=JSON['parse'](_0x1ddaae['data']['result']),this['_handleToolResultData']({'toolName':_0x1ddaae['data']['toolName'],'data':_0x4f3d99['data'],'attributes':_0x4f3d99['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x1ddaae['data']['toolName'],'data':_0x1ddaae['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0x899b75['length']>0x0&&(this['currentReply']['sources']=_0x899b75['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x4ba0ff){return this['replies']['find'](_0x48b9cd=>_0x48b9cd['id']===_0x4ba0ff);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x4642fd=>_0x4642fd['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x383a9a){const _0x369e98=new xi({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x383a9a});return this['replies']['push'](_0x369e98),_0x369e98['delegate'](...De)['to'](this),this['fire']('replyCreated',_0x369e98),_0x369e98;}['setConversationTitle'](_0x42a942,_0x13556d=!0x1){this['fire']('setConversationTitle',_0x42a942,_0x13556d);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x123ec2){this['fire']('toolDataReceived',{'type':'result','toolName':_0x123ec2['toolName'],'data':structuredClone(_0x123ec2['data']||{}),'attributes':structuredClone(_0x123ec2['attributes']||{})},this);}['_handleToolNotificationData'](_0xde6209){this['fire']('toolDataReceived',{'type':'notification','toolName':_0xde6209['toolName'],'data':structuredClone(_0xde6209['data'])},this);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var xe=function(_0x37e689){return _0x37e689['TOOL']='mcp-tool-context',_0x37e689['FILE']='file',_0x37e689['DOCUMENT']='document',_0x37e689['URL']='web-resource',_0x37e689['TEXT']='text',_0x37e689['SELECTION']='selection',_0x37e689;}({}),ye=function(_0x4dd990){return _0x4dd990['TEXT']='text',_0x4dd990['MARKDOWN']='markdown',_0x4dd990['HTML']='html',_0x4dd990;}({});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']]),ze=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class We extends ts(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x95dd63,config:_0x39e0f0,ownerId:_0x333a51}){super(),this['_connector']=_0x95dd63,this['_config']=_0x39e0f0,this['_ownerId']=_0x333a51;}['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'](_0x29bfcf){const _0x10d0a4=await this['_createContextItemFromContent'](_0x29bfcf);return this['_addToConversationContextItem'](_0x10d0a4),'current-document'===_0x10d0a4['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x10d0a4;}async['_createContextItemFromContent'](_0x4aa1c6){if(_0x4aa1c6['type']===xe['DOCUMENT']){const _0x229de2=await this['_connector']['fetchDocument'](this['_ownerId'],_0x4aa1c6['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x4aa1c6['type'],'content':_0x229de2['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x229de2['attributes']?.['version'],'sessionId':_0x229de2['attributes']?.['sessionId']};}if(_0x4aa1c6['type']===xe['TOOL'])return{'id':_0x4aa1c6['id'],'uiId':_0x4aa1c6['id'],'label':_0x4aa1c6['data']?.['label']||_0x4aa1c6['id'],'type':xe['TOOL'],'mcpServerName':_0x4aa1c6['mcpServerName'],'toolName':_0x4aa1c6['toolName'],'data':_0x4aa1c6['data']||{}};return{'id':_0x4aa1c6['id'],'uiId':_0x4aa1c6['id'],'label':_0x4aa1c6['attributes']?.['label']||_0x4aa1c6['name']||_0x4aa1c6['url']||_0x4aa1c6['id'],'type':_0x4aa1c6['type'],..._0x4aa1c6?.['attributes']?.['resourceId']?{'resourceId':_0x4aa1c6['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x180e3b){const _0x49f5fe=this['_pendingContextItems']['get'](_0x180e3b);_0x49f5fe?.['isReadOnly']||this['_removeContextItem'](_0x180e3b);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x3145e7 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x3145e7['uiId']);const _0x3442d8=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x3442d8&&this['_addContextItem']({..._0x3442d8,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x28b9f5){for(const _0x76356d of _0x28b9f5['values']())this['_addToConversationContextItem'](_0x76356d);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'](_0x4e69cf){return Array['from'](_0x4e69cf['values']())['map'](_0x3b6892=>this['_mapContextItemToRequestData'](_0x3b6892))['filter'](_0x11a0cb=>null!==_0x11a0cb);}async['addFilesToContext'](_0x38e973,_0x9da36b,_0x304241=xe['FILE']){const _0x3c9a35='files-'+_0x48eb5e();this['_startUploadOperation'](_0x3c9a35);try{await Promise['all'](_0x38e973['map'](async _0x2fe717=>{const _0x2d921d='file-'+_0x48eb5e(),_0x4fd561=_0x528e40(_0x2fe717['name']);try{this['_addContextItem']({'type':_0x304241,'label':_0x9da36b?.['label']||_0x4fd561,'uiId':_0x2d921d,'resourceId':_0x9da36b?.['resourceId']},!0x0);const _0x6f5c1f=this['_connector']['uploadFile'](this['_ownerId'],_0x2fe717,_0x9da36b);this['_ongoingUploads']['set'](_0x2d921d,_0x6f5c1f['abortController']);const {id:_0x25c653}=await _0x6f5c1f['getId']();this['_ongoingUploads']['delete'](_0x2d921d),this['_finishContextItemLoading']({'type':_0x304241,'id':_0x25c653,'label':_0x9da36b?.['label']||_0x4fd561,'uiId':_0x2d921d,'resourceId':_0x9da36b?.['resourceId']},!0x1);}catch(_0x283aa8){this['_ongoingUploads']['delete'](_0x2d921d);if(!(_0x283aa8 instanceof _0x563e6a&&_0x283aa8['message']['startsWith']('ai-request-aborted'))){const _0x3ebb3c=Oe['get'](_0x283aa8['code'])||'ai-chat-file-upload-failed',_0x39296c=new _0x563e6a(_0x3ebb3c,null,{'fileName':_0x4fd561,..._0x283aa8});_0x39296c['stack']=_0x283aa8['stack'],this['fire']('error',{'error':_0x39296c});}this['_removeContextItem'](_0x2d921d);}}));}finally{this['_finishUploadOperation'](_0x3c9a35);}}['addCurrentDocumentToContext'](_0x3e6019){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x2dcde4={'type':xe['DOCUMENT'],'uiId':'current-document','label':_0x3e6019,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x2dcde4);}async['updateCurrentDocument'](_0x4d8edd,_0x2600aa,_0x558413,_0x544502){const _0x54a067=this['_pendingContextItems']['get']('current-document');if(_0x54a067&&_0x4d8edd){_0x54a067['selection']=_0x544502?_0x544502['map'](_0x12b4d7=>({'start':_0x12b4d7['start'],'end':_0x12b4d7['end']})):[];try{if(_0x54a067['version']===_0x2600aa)return;const {id:_0x47d4c5}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x4d8edd,{'version':_0x2600aa,'sessionId':_0x558413})['getId']();_0x54a067['id']=_0x47d4c5,_0x54a067['content']=_0x4d8edd,_0x54a067['version']=_0x2600aa,_0x54a067['sessionId']=_0x558413;}catch(_0x292264){const _0x2bcf44=new _0x563e6a('ai-chat-document-upload-failed',null);_0x2bcf44['stack']=_0x292264['stack'],this['fire']('error',{'error':_0x2bcf44});}}}['addSelectionToContext'](_0x2df15e){this['_addContextItem']({'type':xe['SELECTION'],'label':_0x2df15e,'uiId':'selection','content':_0x2df15e});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x2096f2,_0x3c875d){const _0x115302='url-'+_0x48eb5e();this['_startUploadOperation'](_0x115302);const _0x4b0746='url-'+_0x48eb5e();try{this['_addContextItem']({'type':xe['URL'],'label':_0x3c875d?.['label']||_0x2096f2,'uiId':_0x4b0746,'resourceId':_0x3c875d?.['resourceId']},!0x0);const _0x2321d8=this['_connector']['uploadUrl'](this['_ownerId'],_0x2096f2,_0x3c875d);this['_ongoingUploads']['set'](_0x4b0746,_0x2321d8['abortController']);const {id:_0x541f05}=await _0x2321d8['getId']();this['_ongoingUploads']['delete'](_0x4b0746),this['_finishContextItemLoading']({'type':xe['URL'],'id':_0x541f05,'label':_0x3c875d?.['label']||_0x2096f2,'uiId':_0x4b0746,'resourceId':_0x3c875d?.['resourceId']},!0x1);}catch(_0x489c85){this['_ongoingUploads']['delete'](_0x4b0746),(_0x489c85['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x563e6a('ai-chat-url-upload-failed',this,{'url':_0x2096f2,'originalError':_0x489c85}),'url':_0x2096f2}),this['_removeContextItem'](_0x4b0746));}finally{this['_finishUploadOperation'](_0x115302);}}['addToolItemToContext'](_0x552a58){_0x552a58['id']=_0x552a58['id']??_0x48eb5e()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x552a58['uiId'],_0x552a58),this['fire']('contextItemAdded',{'contextItem':_0x552a58,'isLoading':!0x1});}async['loadSourceResources'](_0x53294b,_0x4b58be,_0x375a5e){const _0x1da920=this['_addContextOptionsState']['sources']['find'](_0x350bc2=>_0x350bc2['id']===_0x53294b);if(!_0x1da920)return this['fire']('error',{'error':new _0x563e6a('ai-chat-source-not-found',this,{'sourceId':_0x53294b}),'sourceId':_0x53294b}),[];try{const _0x38cde3=(await _0x1da920['getResources'](_0x4b58be))['map'](_0x5fa114=>{const _0x3639a3=this['_isResourceInContext'](_0x5fa114['id']);return{..._0x5fa114,'isInContext':_0x3639a3};});return _0x1da920['resources']=_0x38cde3,this['fire']('sourceResourcesLoaded',{'sourceId':_0x53294b,'source':_0x1da920,'resources':_0x38cde3,'uid':_0x375a5e}),_0x38cde3;}catch(_0x2b9f5e){return this['fire']('error',{'error':new _0x563e6a('ai-chat-source-resources-load-failed',this,{'sourceId':_0x53294b,'originalError':_0x2b9f5e}),'sourceId':_0x53294b,'sourceLabel':_0x1da920['label']}),[];}}async['addResourceToContext'](_0x378ca7,_0x3bec8b){if(this['_isResourceInContext'](_0x3bec8b['id']))return;let _0x1ac97f=_0x3bec8b['data'];if(!_0x1ac97f&&_0x378ca7['getData'])try{_0x1ac97f=await _0x378ca7['getData'](_0x3bec8b['id']);}catch(_0x5ae552){return void this['fire']('error',{'error':new _0x563e6a('ai-chat-resource-load-failed',this,{'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id'],'originalError':_0x5ae552}),'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id']});}if(_0x1ac97f)switch(_0x3bec8b['type']){case xe['URL']:if('string'!=typeof _0x1ac97f)return void this['fire']('error',{'error':new _0x563e6a('ai-chat-context-invalid-data',this,{'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id'],'expectedType':'string','actualType':typeof _0x1ac97f}),'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id']});await this['addUrlToContext'](_0x1ac97f,{'label':_0x3bec8b['label'],'resourceId':_0x3bec8b['id']});break;case xe['FILE']:if(!(_0x1ac97f instanceof File))return void this['fire']('error',{'error':new _0x563e6a('ai-chat-context-invalid-data',this,{'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id'],'expectedType':'File','actualType':typeof _0x1ac97f}),'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id']});await this['addFilesToContext']([_0x1ac97f],{'label':_0x3bec8b['label'],'resourceId':_0x3bec8b['id']});break;case xe['TEXT']:if('object'!=typeof _0x1ac97f||!('content'in _0x1ac97f)||!('type'in _0x1ac97f))return void this['fire']('error',{'error':new _0x563e6a('ai-chat-context-invalid-data',this,{'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x1ac97f}),'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id']});_0x1ac97f=We['_convertTextResourceToFile'](_0x1ac97f,_0x3bec8b['label']),await this['addFilesToContext']([_0x1ac97f],{'label':_0x3bec8b['label'],'resourceId':_0x3bec8b['id']},xe['TEXT']);break;case xe['TOOL']:break;default:this['fire']('error',{'error':new _0x563e6a('ai-chat-context-unsupported-type',this,{'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id'],'resourceType':_0x3bec8b['type']}),'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id']});}else this['fire']('error',{'error':new _0x563e6a('ai-chat-resource-no-data',this,{'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id']}),'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id']});}static['_convertTextResourceToFile'](_0xaddd44,_0xeb103c){switch(_0xaddd44['type']){case ye['MARKDOWN']:return new File([_0xaddd44['content']],_0xeb103c,{'type':'text/markdown'});case ye['HTML']:return new File([_0xaddd44['content']],_0xeb103c,{'type':'text/html'});default:return new File([_0xaddd44['content']],_0xeb103c,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x521cfc){switch(_0x521cfc['type']){case xe['FILE']:return{'type':xe['FILE'],'id':_0x521cfc['id']};case xe['URL']:return{'type':xe['URL'],'id':_0x521cfc['id']};case xe['DOCUMENT']:return{'type':xe['DOCUMENT'],'id':_0x521cfc['id'],..._0x521cfc['selection']?.['length']&&{'selection':_0x521cfc['selection']}};case xe['TEXT']:return{'type':xe['FILE'],'id':_0x521cfc['id']};case xe['TOOL']:{const _0x1a115c=_0x521cfc;return{'type':xe['TOOL'],'mcpServerName':_0x1a115c['mcpServerName'],'toolName':_0x1a115c['toolName'],'data':_0x1a115c['data'],'id':_0x1a115c['id']};}default:return null;}}['_addContextItem'](_0x5ef5b2,_0x3b6a68=!0x1){if(this['_pendingContextItems']['set'](_0x5ef5b2['uiId'],_0x5ef5b2),_0x5ef5b2['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x5ef5b2,'isLoading':_0x3b6a68}),'current-document'===_0x5ef5b2['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x5ef5b2['resourceId']){const _0x21f101=this['_findSourceIdsByResourceId'](_0x5ef5b2['resourceId']);_0x21f101&&_0x21f101['forEach'](_0x32a873=>{this['_updateResourceInContextState'](_0x32a873,_0x5ef5b2['resourceId'],!0x0);});}}['_removeContextItem'](_0x1b75be){const _0x2b8c91=this['_pendingContextItems']['get'](_0x1b75be),_0x515619=this['_ongoingUploads']['get'](_0x1b75be);if(_0x515619&&(_0x515619['abort'](),this['_ongoingUploads']['delete'](_0x1b75be)),_0x2b8c91?.['resourceId']){const _0x324c90=this['_findSourceIdsByResourceId'](_0x2b8c91['resourceId']);_0x324c90&&_0x324c90['forEach'](_0x243be=>{this['_updateResourceInContextState'](_0x243be,_0x2b8c91['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x1b75be),this['fire']('contextItemRemoved',{'uiId':_0x1b75be,'type':_0x2b8c91?.['type']}),'current-document'===_0x1b75be&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x5e4ab4,_0x4ef090){if(this['_pendingContextItems']['has'](_0x5e4ab4['uiId'])&&(this['_pendingContextItems']['set'](_0x5e4ab4['uiId'],_0x5e4ab4),this['fire']('contextItemLoadingEnded',{'contextItem':_0x5e4ab4,'isLoading':_0x4ef090}),_0x5e4ab4['resourceId'])){const _0x54e97d=this['_findSourceIdsByResourceId'](_0x5e4ab4['resourceId']);_0x54e97d&&_0x54e97d['forEach'](_0x15f9e0=>{this['_updateResourceInContextState'](_0x15f9e0,_0x5e4ab4['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x71906e){this['_conversationContextItems']['set'](_0x71906e['uiId'],_0x71906e);}['_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'](_0x3bdca1=>({..._0x3bdca1,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x20b168=>({..._0x20b168,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x217230=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x217230,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x1f8f59){for(const _0x1825af of this['_pendingContextItems']['values']())if(_0x1825af['resourceId']===_0x1f8f59)return!0x0;for(const _0x3c696d of this['_conversationContextItems']['values']())if(_0x3c696d['resourceId']===_0x1f8f59)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x43905e){const _0x433e58=[];for(const _0x5fbc76 of this['_addContextOptionsState']['sources']){_0x5fbc76['resources']['find'](_0x54e596=>_0x54e596['id']===_0x43905e)&&_0x433e58['push'](_0x5fbc76['id']);}return 0x0===_0x433e58['length']?null:_0x433e58;}['_updateResourceInContextState'](_0x6476dd,_0x33efe9,_0xddbf2f){const _0x512971=this['_addContextOptionsState']['sources']['find'](_0x8d3cae=>_0x8d3cae['id']===_0x6476dd);if(!_0x512971)return;const _0x272f9f=_0x512971['resources']['find'](_0xf8581e=>_0xf8581e['id']===_0x33efe9);_0x272f9f&&(_0x272f9f['isInContext']=_0xddbf2f,this['fire']('resourceStateChanged',{'sourceId':_0x6476dd,'resourceId':_0x33efe9,'isInContext':_0xddbf2f}));}['_startUploadOperation'](_0x5d775b){this['_ongoingUploadOperations']['set'](_0x5d775b,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x391cb6){this['_ongoingUploadOperations']['delete'](_0x391cb6),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const He=['capabilitiesUpdated'];class Ue extends _0x5bd7c6(){['_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'](_0x364fcd){const _0x5e9cb8={};return _0x364fcd&&_0x364fcd['isWebSearchEnabled']&&(_0x5e9cb8['webSearch']={}),_0x364fcd&&_0x364fcd['isReasoningEnabled']&&(_0x5e9cb8['reasoning']={}),_0x5e9cb8;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x5e48e3){_0x5e48e3!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x5e48e3,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x18a2e7){_0x18a2e7!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x18a2e7,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Je extends os{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['attributes'];constructor(_0x37248b){super(_0x37248b),this['conversationId']=_0x37248b['conversationId'],this['contextItems']=_0x37248b['contextItems'],this['capabilities']=_0x37248b['capabilities'],this['userMessage']=_0x37248b['userMessage'],this['model']=_0x37248b['model'],this['attributes']=_0x37248b['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':We['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Ue['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class st extends _0x5bd7c6(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x12e3bc){super(),this['options']=_0x12e3bc,this['connector']=_0x12e3bc['connector'],this['chatModels']=_0x12e3bc['chatModels'],this['id']=_0x12e3bc['conversationId'],this['isFromHistory']=_0x12e3bc['isFromHistory'];}async['init'](_0x46de16){try{this['chatContext']=new We({'connector':this['connector'],'config':_0x46de16,'ownerId':this['id']}),this['chatContext']['delegate'](...ze)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Ue(),this['chatCapabilities']['delegate'](...He)['to'](this),this['chatCapabilities']['init']();const _0x5a1f87=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x5a1f87});const _0x3cfeab=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x3cfeab&&await this['setModel'](_0x3cfeab);}catch(_0x383d9e){const _0x13444c=new _0x563e6a('ai-chat-conversation-init-failed',null,{'message':_0x383d9e['message']||_0x383d9e});_0x13444c['stack']=_0x383d9e['stack'],this['fire']('error',{'error':_0x13444c});}}async['start'](){if(this['isStarted'])throw new _0x563e6a('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x563e6a('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x33a346}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x33a346,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x51bf83){const _0x48e8ee=new _0x563e6a('ai-chat-conversation-start-failed',null,{'message':_0x51bf83['message'],'conversationId':this['id']});throw _0x48e8ee['stack']=_0x51bf83['stack'],this['fire']('error',{'error':_0x48e8ee}),_0x48e8ee;}}async['load'](_0x4a98e4,_0x58a866){try{const _0xc639fa=await this['connector']['fetchConversation'](_0x4a98e4)['getConversation'](),_0x63e9de=await this['connector']['fetchConversationMessages'](_0x4a98e4)['getMessages'](),_0x5cc555=_0x63e9de[0x0]['model'];this['isStarted']=!0x0,this['id']=_0xc639fa['id'],'title'in _0xc639fa?this['fire']('setConversationTitle',_0xc639fa['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x31c781=(await this['chatModels']['getAll']())['find'](_0x3d1de8=>_0x3d1de8['id']['toLowerCase']()===_0x5cc555['toLowerCase']());return this['selectedModel']=_0x31c781,this['fire']('modelSelected',{'selectedModel':_0x31c781,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x63e9de,_0x58a866,_0x5cc555),this['currentInteraction']=void 0x0,this;}catch(_0x4505a0){const _0xeecc65=new _0x563e6a('ai-chat-conversation-init-from-id-failed',null,{'message':_0x4505a0['message'],'conversationId':_0x4a98e4});throw _0xeecc65['stack']=_0x4505a0['stack'],this['fire']('error',{'error':_0xeecc65}),_0xeecc65;}}async['_processMessagesToInteractions'](_0x29ac98,_0x40f5e5,_0x13b0bb){let _0x4ba82e;for(const _0x58d56a of _0x29ac98)if('user'===_0x58d56a['role']){const _0x364ffd=await this['_extractContextItems'](_0x58d56a),_0x5b5437={'isReasoningEnabled':Object['hasOwn'](_0x58d56a['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x58d56a['capabilities'],'webSearch')};_0x4ba82e=this['createInteraction']({'userMessage':_0x58d56a['prompt'],'contextItems':_0x364ffd,'capabilities':_0x5b5437,'modelId':_0x13b0bb,'attributes':_0x58d56a['attributes']}),this['currentInteraction']=_0x4ba82e,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x58d56a['role']&&_0x4ba82e){const _0x1bcc4e=[];for(const _0x50278e of _0x58d56a['content'])switch(_0x50278e['type']){case'text':case'modification':{const _0x3b4678=_0x4ba82e['getDocumentContext']()?.['sessionId']!==_0x40f5e5;_0x4ba82e['currentReply']=_0x4ba82e['createReply']({'type':_0x50278e['type'],'isDone':!0x0,'interactionId':_0x4ba82e['id'],'areActionsDisabled':_0x3b4678}),_0x4ba82e['currentReply']['appendContent'](_0x50278e['content']),_0x1bcc4e['length']>0x0&&(_0x4ba82e['currentReply']['sources']=_0x1bcc4e['splice'](0x0));break;}case'url':_0x1bcc4e['push'](_0x50278e);break;case'mcp-tool-result':{const {data:_0x1b37f8,attributes:_0x4e2efd}=JSON['parse'](_0x50278e['content']);_0x4ba82e['_handleToolResultData']({'toolName':_0x50278e['toolName'],'data':_0x1b37f8,'attributes':_0x4e2efd});break;}}}}}async['_extractContextItems'](_0x509e5b){const _0x14d699=new Map();if(!_0x509e5b['content'])return _0x14d699;for(const _0x4ead55 of _0x509e5b['content']){const _0x39b76d=await this['chatContext']['populateFromMessage'](_0x4ead55);_0x39b76d&&_0x14d699['set'](_0x39b76d['id'],_0x39b76d);}return _0x14d699;}async['handleUserInteraction']({userMessage:_0x5ea830,attributes:_0xe1c7c7}){if(!this['isStarted'])throw new _0x563e6a('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x563e6a('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x1e7d86=this['chatContext']['getPendingContextItems'](),_0x1d0411=this['chatCapabilities']['getCapabilitiesConfig'](),_0x216b37=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x5ea830,'contextItems':_0x1e7d86,'capabilities':_0x1d0411,'modelId':_0x216b37,'attributes':_0xe1c7c7}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x5e7a47){if(_0x5e7a47 instanceof _0x563e6a)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x5e7a47});else{const _0x38c5c1=Oe['get'](_0x5e7a47['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new _0x563e6a(_0x38c5c1,null,{'error':_0x5e7a47})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x5a3825,contextItems:_0x5163ef,capabilities:_0x465eef,modelId:_0x2ce9f9,attributes:_0x562373}){const _0x2fc657=new Je({'userMessage':_0x5a3825,'contextItems':_0x5163ef,'capabilities':_0x465eef,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x2ce9f9,'attributes':_0x562373});return _0x2fc657['delegate'](...De)['to'](this),this['interactions']['push'](_0x2fc657),this['fire']('interactionCreated',_0x2fc657),_0x2fc657;}['getInteraction'](_0x1226ab){return this['interactions']['find'](_0x19ffdc=>_0x19ffdc['id']===_0x1226ab);}['removeInteraction'](_0x1a4e1c){const _0x49431a=this['getInteraction'](_0x1a4e1c);_0x49431a&&(_0x49431a['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x49431a),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x50f0cc){this['chatContext']['addCurrentDocumentToContext'](_0x50f0cc);}async['updateCurrentDocumentInContext']({content:_0x2d87b3,version:_0x184bcf,sessionId:_0x2a0ade,selections:_0x266d34}){await this['chatContext']['updateCurrentDocument'](_0x2d87b3,_0x184bcf,_0x2a0ade,_0x266d34);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0xc460fb){this['chatContext']['addSelectionToContext'](_0xc460fb);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x356bab){this['chatContext']['addFilesToContext'](_0x356bab);}['addUrlToContext'](_0x28ca42){this['chatContext']['addUrlToContext'](_0x28ca42);}['addToolItemToContext'](_0xd067f){this['chatContext']['addToolItemToContext'](_0xd067f);}['addResourceToContext'](_0x138ae8,_0x212262){this['chatContext']['addResourceToContext'](_0x138ae8,_0x212262);}['loadSourceResources'](_0xa5cac4,_0x18b348,_0x3ab3fb){return this['chatContext']['loadSourceResources'](_0xa5cac4,_0x18b348,_0x3ab3fb);}['removeFromContext'](_0x3012ec){this['chatContext']['removeFromContext'](_0x3012ec);}['setWebSearch'](_0x40869f){this['chatCapabilities']['setWebSearch'](_0x40869f);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x4a339c){this['chatCapabilities']['setReasoning'](_0x4a339c);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x9a66f5){_0x9a66f5?!0x1===await this['chatModels']['isAvailable'](_0x9a66f5)&&(_0xa8aac2('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x9a66f5}),_0x9a66f5=(await this['chatModels']['getAvailableModels']())[0x0]):(_0xa8aac2('ai-chat-conversation-set-model-null',{'conversation':this}),_0x9a66f5=(await this['chatModels']['getAvailableModels']())[0x0]),_0x9a66f5['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x9a66f5,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x9a66f5}));}}class et extends _0x5bd7c6(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x3b449e,config:_0x44e2d8,locale:_0x41b86e}){super(),this['_connector']=_0x3b449e,this['_config']=_0x44e2d8,this['_locale']=_0x41b86e;}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 _0x4824f4=await this['getAll']();let _0xbd822b;return _0xbd822b=this['_availableModels']?this['_filterModels'](_0x4824f4,this['_availableModels']):_0x4824f4['filter'](_0xea34a1=>_0xea34a1['recommended']),_0xbd822b;}async['getModel'](_0x4863dc){const _0x559d4a=await this['getAll']();if(!_0x559d4a['length'])return null;if(_0x4863dc){const _0x54d95f=this['_getModelById'](_0x559d4a,_0x4863dc);if(_0x54d95f)return _0x54d95f;_0xa8aac2('ai-chat-model-id-unrecognized',{'modelId':_0x4863dc,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0xc7d03d=await this['getAvailableModels']();if(!_0xc7d03d['length'])return null;if(this['_defaultModelId']){const _0x437eef=this['_getModelById'](_0xc7d03d,this['_defaultModelId']);if(_0x437eef)return _0x437eef;_0xa8aac2('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0xc7d03d[0x0]['id']});}return _0xc7d03d[0x0];}async['isAvailable'](_0x256319){return(await this['getAvailableModels']())['some'](_0x2e62b2=>_0x2e62b2['name']===_0x256319['name']&&_0x2e62b2['provider']===_0x256319['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x402e64=this['_locale']['uiLanguage']||'en',_0x2b168a=this['_connector']['getModels'](_0x402e64),_0x473551=await _0x2b168a['list']();this['_modelList']=_0x473551['items']['map'](_0x10b463=>Bi(_0x10b463)?{..._0x10b463,'name':i(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x10b463);}catch(_0x103285){throw _0x4e5dbd('ai-models-unable-to-retrieve',{'error':_0x103285}),_0x103285;}return[...this['_modelList']];}['_filterModels'](_0x583a46,_0x471cfa){let _0xeedd60;if(_0x471cfa){_0xeedd60=[];const _0xa135e4=new Set(),_0xe8c2d4='string'==typeof _0x471cfa?[_0x471cfa['toLocaleLowerCase']()]:_0x471cfa['map'](_0x5b4b24=>_0x5b4b24['toLocaleLowerCase']());for(const _0x560507 of _0xe8c2d4)for(const _0x5a1dc5 of _0x583a46)!_0xa135e4['has'](_0x5a1dc5['id'])&&this['_isMatchingFilter'](_0x5a1dc5,_0x560507)&&(_0xeedd60['push'](_0x5a1dc5),_0xa135e4['add'](_0x5a1dc5['id']));}else _0xeedd60=_0x583a46;return _0xeedd60;}['_isMatchingFilter'](_0x5d669a,_0x53ddf3){const _0x1ce6e8=_0x5d669a['id']['toLocaleLowerCase'](),_0x2a814a=_0x5d669a['name']['toLocaleLowerCase'](),_0x5f3eee=_0x5d669a['provider']['toLocaleLowerCase']();return _0x1ce6e8===_0x53ddf3||_0x2a814a===_0x53ddf3||Bi(_0x5d669a)&&'auto'===_0x53ddf3||_0x5f3eee===_0x53ddf3||_0x1ce6e8['startsWith'](_0x53ddf3);}['_getModelById'](_0x4ab46e,_0x488399){return _0x4ab46e['find'](_0x29bce8=>Bi(_0x29bce8)&&'auto'===_0x488399?_0x29bce8:_0x29bce8['id']===_0x488399)||null;}}function Bi(_0x34c9c2){return _0x34c9c2['id']['startsWith']('agent');}function T(_0x47efb2){if(_0x47efb2 instanceof _0x2cda04)return _0x47efb2;if(_0x47efb2?.['editors']&&_0x47efb2['editors']['get'](0x0))return _0x47efb2['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.'),_0x47efb2['editors']['get'](0x0);throw new _0x563e6a('ai-get-editor-from-context-no-editor');}function at({editor:_0x6d97bb,interaction:_0x43a49a,reply:_0x23f325,groups:_0x1e531d,transform:_0x2a2f87,documentCompare:_0x509572,documentCompareOptions:_0x14e857}){const _0x46ea19=_0x43a49a['getDocumentContext']();if(!_0x46ea19)return[];const _0x4dfd26=_0x46ea19['content'],_0x3d5824=_0x46ea19['version'],_0x46f130=_0x23f325['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x2eec37}of _0x1e531d){const _0x2686aa=_0x2eec37['filter'](_0x55a305=>'new'!=_0x55a305['type'])['map'](_0x18a343=>It('data-id',_0x18a343['id'],_0x46f130)),_0xec405b=_0x2eec37['filter'](_0x471cf1=>'removed'!=_0x471cf1['type'])['map'](_0x46974e=>_0x46974e['node']['cloneNode'](!0x0));let _0x1df039=null;if(_0x2686aa['length']){_0x1df039=_0x2686aa[0x0]['previousSibling'];for(let _0x3fd194=0x0;_0x3fd194<_0x2686aa['length'];_0x3fd194++)_0x12acc3(_0x2686aa[_0x3fd194]);}if(_0xec405b['length']){_0x1df039||(_0x2eec37[0x0]['anchorId']?_0x1df039=It('data-id',_0x2eec37[0x0]['anchorId'],_0x46f130):(_0x1df039=_0xec405b['shift'](),_0x8342b6(_0x46f130,_0x1df039)));for(let _0x11a35a=0x0;_0x11a35a<_0xec405b['length'];_0x11a35a++)_0x43ba66(_0x1df039,_0xec405b[_0x11a35a]),_0x1df039=_0xec405b[_0x11a35a];}}const _0x5d656c=pt(_0x46f130),_0x566fef=_0x509572['getDiff'](_0x4dfd26,_0x5d656c,_0x14e857)['getOperations']();if(_0x2a2f87){const _0x50a076=_0x6d97bb['model']['document']['history']['getOperations'](_0x3d5824),_0xc29ad2={'document':_0x6d97bb['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return kt(_0x566fef,_0x50a076,_0xc29ad2)['operationsA'];}return _0x566fef;}function rt(_0x2e18ec,_0x4a8074){if('marker'!=_0x4a8074['type'])return;const _0x3c66cb=_0x2e18ec['model']['markers']['get'](_0x4a8074['name']);_0x3c66cb&&(_0x4a8074['oldRange']=_0x3c66cb['getRange']());}class q extends _0x3a5602{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[tt,ot];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new _0x340c25(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 et({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x279fdd=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x39def7,_0x3f64c6)=>{this['_handleUIUserMessage']({'userMessage':_0x3f64c6});}),this['listenTo'](_0x279fdd,'resizedTabs',(_0x504357,_0x566a70)=>{this['_setIsMaximized'](_0x566a70);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x279fdd['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',(_0x2710bd,_0x12b161)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x12b161));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x4d39d3,_0x5e21dd)=>{this['activeConversation']?.['addUrlToContext'](_0x5e21dd);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x24288d,_0x1f275a)=>{_0x1f275a['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x436b49,_0x4db57d)=>{this['activeConversation']?.['addResourceToContext'](_0x4db57d['source'],_0x4db57d['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x5c702e,_0x3aa427)=>{this['_removeFromContext'](_0x3aa427);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x3387bd,_0x58bc67)=>{this['activeConversation']?.['loadSourceResources'](_0x58bc67['sourceId'],_0x58bc67['query'],_0x58bc67['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0xb4deb4,_0x2c68bc)=>{this['activeConversation']?.['setModel'](_0x2c68bc);}),this['listenTo'](this['_aiChatUi'],'like',(_0x4ecd66,{replyId:_0x5e71b1})=>{console['log']('Liked\x20response',_0x5e71b1);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x196a9e,{replyId:_0x4cacbe})=>{console['log']('Disliked\x20response',_0x4cacbe);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x366a84,_0x3da812)=>{this['_insertSuggestion'](_0x3da812);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x40408d,{replyId:_0x1a82c2,partIndex:_0x426bfe})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x1a82c2,_0x426bfe);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x50683c,{replyId:_0x102cc7,partIndex:_0x376a25})=>{const _0x25a3b4=this['_getDocumentRangeForReplyChanges'](_0x102cc7,_0x376a25);_0x25a3b4&&'$graveyard'!=_0x25a3b4['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x25a3b4['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x489309,_0x18cddc)=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over'),this['_applySuggestion'](_0x18cddc);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x333a55,{replyId:_0x628ef7,showDiff:_0x308c2d})=>{const {reply:_0x3c02c8}=this['getInteractionAndReplyById'](_0x628ef7),_0x437590=_0x3c02c8['getContentParts']({'showDiff':_0x308c2d});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x3c02c8['id'],'parts':_0x437590,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0xb9c478,{replyId:_0x420681,partIndex:_0x4cd19f})=>{this['_rejectSuggestion']({'replyId':_0x420681,'partIndex':_0x4cd19f}),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:_0x2bb07f,partIndex:_0x550245}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x9bc463}=this['getInteractionAndReplyById'](_0x2bb07f),_0x90c906=_0x9bc463['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x550245});this['_aiChatBalloon']['updateContent']({'part':_0x90c906[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0x252dc1,partIndex:_0x4b2682}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x252dc1,'partIndex':_0x4b2682}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x56481f,partIndex:_0x2f5adc}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x56481f,'partIndex':_0x2f5adc}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x4c3175,partIndex:_0x1d90cb}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x4c3175,'partIndex':_0x1d90cb}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0x1b69f0,partIndex:_0x4aca09}=this['_currentPreviewedChangeGroup'],_0x4d43bb=this['_getPresentableSiblingContentPartIndex'](_0x1b69f0,_0x4aca09,'next');null!==_0x4d43bb&&this['_openBalloonFor'](_0x1b69f0,_0x4d43bb);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0x588f67,partIndex:_0x23b40b}=this['_currentPreviewedChangeGroup'],_0x34cbff=this['_getPresentableSiblingContentPartIndex'](_0x588f67,_0x23b40b,'previous');null!==_0x34cbff&&this['_openBalloonFor'](_0x588f67,_0x34cbff);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x514c22,{id:_0x41ce9a})=>{if('aiChatBalloon'!==_0x41ce9a)return;const {replyId:_0x3246dc,partIndex:_0x241e65}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x3246dc,'index':_0x241e65,'isActive':!0x1});}));}async['afterInit'](){this['context']instanceof _0x2cda04?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x278f35,_0x15e469)=>{_0x15e469['on']('ready',()=>{this['_integrateEditor'](_0x15e469);});});const _0x5da10a=this['context']['config']['get']('ai.chat.initialConversation');let _0x3a1e9b=_0x5da10a;if('lastCreated'!=_0x5da10a||(_0x3a1e9b=await this['_getLastCreatedConversationId'](),_0x3a1e9b))return'new'==_0x3a1e9b?this['_startConversationSafely']():this['loadConversation'](_0x3a1e9b);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_insertSuggestion'](_0x5e639a){const _0x4f948a=T(this['context']);if(!_0x4f948a['plugins']['has']('TrackChanges'))throw new _0x563e6a('ai-no-track-changes',null);const _0x439fa2=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x181464,interaction:_0x5f23c1}=this['getInteractionAndReplyById'](_0x5e639a['replyId']),_0x483a33=this['_getDocumentRangeForReplyChanges'](_0x5e639a['replyId'],_0x5e639a['partIndex']),_0x52ba4c=void 0x0!==_0x5e639a['partIndex']?[_0x181464['changeGroups'][_0x5e639a['partIndex']]]:_0x181464['changeGroups']['filter'](_0x22df24=>'pending'==_0x22df24['state']),_0x3f3c71=_0x52ba4c['map'](_0x2ca1f8=>_0x181464['changeGroups']['indexOf'](_0x2ca1f8));if(!_0x483a33||'$graveyard'==_0x483a33['range']['root']['rootName'])return void _0x3f3c71['forEach'](_0x24782d=>_0x181464['setChangeGroupState'](_0x24782d,'outdated'));_0x3f3c71['forEach'](_0x2434e5=>_0x181464['setChangeGroupState'](_0x2434e5,'accepted'));const _0x3f2b3d=at({'editor':_0x4f948a,'reply':_0x181464,'interaction':_0x5f23c1,'groups':_0x52ba4c,'transform':!0x0,'documentCompare':_0x439fa2,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x438df4;_0x483a33&&this['_scrollToSuggestionRange'](_0x483a33['range']),_0x4f948a['model']['change'](_0x1fa269=>{_0x438df4=_0x1fa269['batch'],_0x4f948a['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x3f2b3d),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x438df4,{'interactionId':_0x5f23c1['id'],'replyId':_0x181464['id'],'indexes':_0x3f3c71['slice']()}),this['_updateRatings'](_0x181464);}['_applySuggestion'](_0x4f0063){const _0x475d96=T(this['context']),_0x5eb99e=this['context']['plugins']['get'](ot),{reply:_0x311600,interaction:_0x4fc0c8}=this['getInteractionAndReplyById'](_0x4f0063['replyId']),_0x4007de=this['_getDocumentRangeForReplyChanges'](_0x4f0063['replyId'],_0x4f0063['partIndex']),_0x487da8=void 0x0!==_0x4f0063['partIndex']?[_0x311600['changeGroups'][_0x4f0063['partIndex']]]:_0x311600['changeGroups']['filter'](_0x1253ee=>'pending'==_0x1253ee['state']),_0x33c4ba=_0x487da8['map'](_0x956c53=>_0x311600['changeGroups']['indexOf'](_0x956c53));if(!_0x4007de||'$graveyard'==_0x4007de['range']['root']['rootName'])return void _0x33c4ba['forEach'](_0x589c3a=>_0x311600['setChangeGroupState'](_0x589c3a,'outdated'));_0x33c4ba['forEach'](_0x2af0bf=>_0x311600['setChangeGroupState'](_0x2af0bf,'accepted'));const _0xbc28e2=at({'editor':_0x475d96,'reply':_0x311600,'interaction':_0x4fc0c8,'groups':_0x487da8,'transform':!0x0,'documentCompare':_0x5eb99e,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x5f1fe2;_0x4007de&&this['_scrollToSuggestionRange'](_0x4007de['range']),_0x475d96['model']['change'](_0x2d7ba3=>{_0x5f1fe2=_0x2d7ba3['batch'];for(const _0x4e7766 of _0xbc28e2)_0x4e7766['baseVersion']=_0x475d96['model']['document']['version'],rt(_0x475d96,_0x4e7766),_0x2d7ba3['batch']['addOperation'](_0x4e7766),_0x475d96['model']['applyOperation'](_0x4e7766);}),this['_batchToChanges']['set'](_0x5f1fe2,{'interactionId':_0x4fc0c8['id'],'replyId':_0x311600['id'],'indexes':_0x33c4ba['slice']()}),this['_updateRatings'](_0x311600);}['_rejectSuggestion'](_0x1f89be){const {reply:_0x32779a}=this['getInteractionAndReplyById'](_0x1f89be['replyId']);_0x32779a['setChangeGroupState'](_0x1f89be['partIndex'],'rejected');}['_openBalloonFor'](_0x5110a6,_0x16e789){if(!this['_aiChatBalloon'])return;const {reply:_0x2f1eda}=this['getInteractionAndReplyById'](_0x5110a6),_0x6b2e7f=_0x2f1eda['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x252347,_0x1d7ea7;if(void 0x0!==_0x16e789?(_0x1d7ea7=_0x6b2e7f['find'](_0x44b65e=>_0x44b65e['index']==_0x16e789),_0x252347=_0x1d7ea7?.['index']):(_0x1d7ea7=_0x6b2e7f[0x0],_0x252347=_0x1d7ea7['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x5110a6&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x252347)return;const _0x372673=this['_getUserPresentableContentPartDocumentRange'](_0x5110a6,_0x2f1eda,_0x1d7ea7);if(!_0x372673)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x5110a6,'partIndex':_0x252347},this['_scrollToSuggestionRange'](_0x372673,!0x0);const _0x28a40d=this['_getPresentableSiblingContentPartIndex'](_0x5110a6,_0x252347,'next');this['_aiChatBalloon']['updateContent']({'part':_0x1d7ea7,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x252347,'title':i(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x252347+0x1)['toString']()),'showRotator':null!==_0x28a40d,'ranges':[_0x372673],'areActionsDisabled':_0x2f1eda['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x5110a6,_0x252347),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x5110a6,'index':_0x252347,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x34935d,_0x59e971,_0x49f0ef){const {reply:_0x116af7}=this['getInteractionAndReplyById'](_0x34935d),_0x487941=_0x116af7['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x487941['length'])return null;const _0x28ad06=_0x487941['findIndex'](_0x1b2173=>_0x1b2173['index']==_0x59e971),_0x24bed0='next'==_0x49f0ef?0x1:-0x1;let _0xc17fef=_0x487941['at']((_0x28ad06+_0x24bed0)%_0x487941['length'])['index'],_0x5981aa=_0x487941[_0xc17fef];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x34935d,_0x116af7,_0x5981aa);){if(_0xc17fef=_0x487941['at']((_0xc17fef+_0x24bed0)%_0x487941['length'])['index'],_0xc17fef===_0x28ad06)return null;_0x5981aa=_0x487941[_0xc17fef];}return _0xc17fef;}['_getUserPresentableContentPartDocumentRange'](_0x5e28c4,_0x557d52,_0x453398){const _0x1f0775=_0x557d52['changeGroups'];if(!_0x453398['hasChanges'])return null;const _0x3bf5df=_0x1f0775['find'](_0x1eaad1=>_0x1eaad1['index']==_0x453398['index']);if('pending'!==_0x3bf5df?.['state'])return null;const _0x36e069=this['_getDocumentRangeForReplyChanges'](_0x5e28c4,_0x453398['index']);if(!_0x36e069)return null;const {range:_0x49e3ea,currentIndex:_0x2d97c0}=_0x36e069;return'$graveyard'==_0x49e3ea['root']['rootName']?(_0x557d52['setChangeGroupState'](_0x2d97c0,'outdated'),null):_0x36e069['range'];}['_getDocumentRangeForReplyChanges'](_0xa0a9f7,_0x5cebf7){const _0x27cb32=T(this['context']),{reply:_0x589cfc,interaction:_0x6340d4}=this['getInteractionAndReplyById'](_0xa0a9f7),_0xb6879=_0x589cfc['changeGroups']['filter'](_0x1ce31f=>'pending'==_0x1ce31f['state']),_0x5ee2d5=_0xb6879['map'](_0x2cf728=>_0x589cfc['changeGroups']['indexOf'](_0x2cf728));void 0x0===_0x5cebf7&&(_0x5cebf7=_0x5ee2d5[0x0]);const _0x155a9f=_0x5ee2d5['indexOf'](_0x5cebf7);if(-0x1==_0x155a9f)return null;const _0x1099cc=_0xb6879[_0x155a9f],_0x1a9406=new _t([]),_0x29bad3=new _t([]);for(const _0x49985b of _0x1099cc['changes'])if('removed'!=_0x49985b['type']&&_0x29bad3['children']['push'](_0x49985b['node']['cloneNode'](!0x0)),'new'!=_0x49985b['type']){const _0x4f5b1b=gt(_0x28c31c=>ut(_0x28c31c,'data-id')==_0x49985b['id'],_0x589cfc['documentContextContent'],!0x0);_0x1a9406['children']['push'](_0x4f5b1b['cloneNode'](!0x0));}if(0x0==_0x1a9406['children']['length']){if(_0x1099cc['changes'][0x0]['anchorId']){const _0x2eeeea=It('data-id',_0x1099cc['changes'][0x0]['anchorId'],_0x589cfc['documentContextContent']);_0x1a9406['children']['unshift'](_0x2eeeea['cloneNode'](!0x0)),_0x29bad3['children']['unshift'](_0x2eeeea['cloneNode'](!0x0)),_0x2eeeea['nextSibling']&&(_0x1a9406['children']['push'](_0x2eeeea['nextSibling']['cloneNode'](!0x0)),_0x29bad3['children']['push'](_0x2eeeea['nextSibling']['cloneNode'](!0x0)));}else{const _0x1975f1=_0x589cfc['documentContextContent']['children'][0x0];if(!_0x1975f1)return null;_0x1a9406['children']['push'](_0x1975f1['cloneNode'](!0x0)),_0x29bad3['children']['push'](_0x1975f1['cloneNode'](!0x0));}}const _0x1c25c2=_0x6340d4['getDocumentContext'](),_0x58bc47=_0x27cb32['data']['parse'](_0x1c25c2['content']),_0x4a1a6e=pt(_0x1a9406),_0x35cef7=_0x27cb32['data']['parse'](_0x4a1a6e),_0x509320=_0x27cb32['data']['parse'](_0x4a1a6e),_0x1811f1=_0x27cb32['model']['createPositionAt'](_0x35cef7,0x0),_0x3a549a=pt(_0x29bad3),_0x519fdc={'anchor':_0x1811f1,'markDeletions':!0x1},_0x5d3bcf=_0x27cb32['plugins']['get'](ot)['getDiff'](_0x4a1a6e,_0x3a549a,_0x519fdc)['getOperations']();if(!_0x5d3bcf['length'])return null;_0x27cb32['model']['change'](_0x4683e3=>{for(const _0x31967a of _0x5d3bcf)if('remove'==_0x31967a['type']){const _0x12eb0a=_0x31967a['sourcePosition'],_0x12d0df=_0x31967a['howMany'],_0x469b3a=new lt(_0x12eb0a,_0x12d0df);_0x4683e3['batch']['addOperation'](_0x469b3a),_0x27cb32['model']['applyOperation'](_0x469b3a);}else'marker'!==_0x31967a['type']&&(_0x31967a['baseVersion']=null,_0x31967a['isDocumentOperation']=!0x1,_0x4683e3['batch']['addOperation'](_0x31967a),_0x27cb32['model']['applyOperation'](_0x31967a));});const _0x40f03d=ct(_0x27cb32,_0x5d3bcf,_0x35cef7);ht(_0x27cb32['model'],_0x40f03d);const _0x38aaa9=_0x40f03d['getFirstRange']()['start']['path']['slice'](),_0x3fa282=_0x40f03d['getFirstRange']()['end']['path']['slice'](),_0x1db5ba=[];let _0x15a404=_0x35cef7,_0x4297b0=_0x509320;for(let _0x27e2f5=0x0;_0x27e2f5<_0x3fa282['length'];_0x27e2f5++){const _0x377f7f=_0x15a404['maxOffset']-_0x3fa282[_0x27e2f5];_0x1db5ba[_0x27e2f5]=_0x4297b0['maxOffset']-_0x377f7f,_0x15a404=_0x15a404['getChildAtOffset'](_0x3fa282[_0x27e2f5]),_0x4297b0=_0x4297b0['getChildAtOffset'](_0x1db5ba[_0x27e2f5]);}const _0x1ffe30=_0x27cb32['model']['createRange'](_0x27cb32['model']['createPositionFromPath'](_0x509320,_0x38aaa9),_0x27cb32['model']['createPositionFromPath'](_0x509320,_0x1db5ba)),_0xed6af2=_0x509320['getChild'](0x0)['getAttribute'](nt),_0x20f740=Array['from'](_0x58bc47['getChildren']())['find'](_0x472a0d=>_0x472a0d['getAttribute'](nt)==_0xed6af2)['getPath'](),_0x516db7=_0x1ffe30['start']['path']['slice'](),_0x543564=_0x1ffe30['end']['path']['slice']();_0x516db7[0x0]=_0x20f740[0x0]+_0x516db7[0x0],_0x543564[0x0]=_0x20f740[0x0]+_0x543564[0x0];let _0x1aaeb0=_0x27cb32['model']['createRange'](_0x27cb32['model']['createPositionFromPath'](_0x27cb32['model']['document']['getRoot'](),_0x516db7),_0x27cb32['model']['createPositionFromPath'](_0x27cb32['model']['document']['getRoot'](),_0x543564));const _0x49b4c8=_0x27cb32['model']['document']['history']['getOperations'](_0x1c25c2['version']);for(const _0x390556 of _0x49b4c8)_0x1aaeb0=dt['_createFromRanges'](_0x1aaeb0['getTransformedByOperation'](_0x390556));return{'range':_0x1aaeb0,'currentIndex':_0x5cebf7};}['_integrateEditor'](_0x484849){if(!_0x484849['plugins']['has']('Undo'))return;const _0x5ee927=_0x484849['commands']['get']('undo'),_0x1331a3=_0x484849['commands']['get']('redo');this['listenTo'](_0x5ee927,'revert',(_0x540ac4,_0x4ed3c2,_0x1810b9)=>{const _0x59b1e4=this['_batchToChanges']['get'](_0x4ed3c2);if(!_0x59b1e4)return;const _0xf25f5=this['activeConversation']['getInteraction'](_0x59b1e4['interactionId'])['getReply'](_0x59b1e4['replyId']);_0x59b1e4['indexes']['forEach'](_0x1e77ab=>_0xf25f5['setChangeGroupState'](_0x1e77ab,'pending')),this['_batchToChanges']['delete'](_0x4ed3c2),this['_batchToChanges']['set'](_0x1810b9,_0x59b1e4);}),this['listenTo'](_0x1331a3,'revert',(_0x31e433,_0x5836c8,_0x377981)=>{const _0x597315=this['_batchToChanges']['get'](_0x5836c8);if(!_0x597315)return;const _0x5ddaf1=this['activeConversation']['getInteraction'](_0x597315['interactionId'])['getReply'](_0x597315['replyId']);_0x597315['indexes']['forEach'](_0x46e305=>_0x5ddaf1['setChangeGroupState'](_0x46e305,'accepted')),this['_batchToChanges']['delete'](_0x5836c8),this['_batchToChanges']['set'](_0x377981,_0x597315);});}async['loadConversation'](_0x32727d){this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),(this['context']['plugins']['get'](it)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x32727d)['getConversation'](),await this['_startConversationSafely'](_0x32727d),this['updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x32727d,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x56fc17){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x32727d}),this['_logError'](new _0x563e6a('ai-chat-conversation-not-found',this,{'error':_0x56fc17}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}async['_getLastCreatedConversationId'](){const _0xfd29d0=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x5474c2=await _0xfd29d0['getConversations']();return _0x5474c2['length']?_0x5474c2[0x0]['id']:'new';}catch(_0x33aa4b){return this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x48eb5e()}),this['_logError'](new _0x563e6a('ai-chat-conversation-init-failed',this,{'error':_0x33aa4b})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}['handleRemovedConversation'](_0x4f167f){this['activeConversation']['id']===_0x4f167f&&this['_startConversationSafely']();}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x519943=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x519943),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x1ed3c8,attributes:_0x37e7e1}){await this['_handleUIUserMessage']({'userMessage':_0x1ed3c8,'attributes':_0x37e7e1});}['getGroupId'](){const _0x3823b9=this['context']['config']['get']('collaboration.channelId');if(!_0x3823b9)throw new _0x563e6a('ai-chat-missing-channel-id',this);return _0x3823b9;}async['_startConversationSafely'](_0x56a56d){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x56a56d);}catch(_0x2ce40e){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x56a56d||_0x48eb5e()}),console['error'](_0x2ce40e),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0xff69b7){let _0xd6993a;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0xff69b7||!this['activeConversation']?_0xd6993a=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0xd6993a=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x42711f=this['getGroupId'](),_0x17e846=_0xff69b7||_0x48eb5e();this['activeConversation']=new st({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0xd6993a,'conversationId':_0x17e846,'group':_0x42711f,'getEditor':()=>T(this['context']),'isFromHistory':!!_0xff69b7}),this['activeConversation']['delegate']('toolDataReceived','interactionStarted')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x13ce60,_0x5f1613)=>{this['_aiChatUi']['createConversation'](_0x5f1613),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0xff69b7||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x5c0a44,_0x173307)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x173307['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x580d09,_0x4c6063)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x4c6063);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x89d751=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x89d751);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x3392f3=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x3392f3);}),this['activeConversation']['on']('webSearchFinished',(_0x13aed5,_0x3028be)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x3028be,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x3d5cb6,_0x4aa2f5)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x4aa2f5,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x3b069c,_0x204ddf)=>{this['_aiChatUi']['removeFeedInteraction'](_0x204ddf['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x10ebd2,_0x46c734,_0x2164fd)=>{this['updateConversationTitle'](_0x46c734,_0x2164fd);}),this['activeConversation']['on']('replyCreated',(_0x352ab5,_0x5b4041)=>{'text'===_0x5b4041['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x5b4041):this['_aiChatUi']['addFeedItemAISuggestion'](_0x5b4041);}),this['activeConversation']['on']('replyContentUpdated',async(_0x352b6f,_0x48e6ed)=>{await this['_updateReplyContent']({'reply':_0x48e6ed});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x75ca05,{reply:_0x3c83bb,index:_0x35fb10,state:_0x4cb069})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x3c83bb['id'],'index':_0x35fb10,'state':_0x4cb069}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x3c83bb['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x35fb10&&this['_aiChatBalloon']?.['setState'](_0x4cb069);}),this['activeConversation']['on']('contextItemAdded',(_0x39933e,_0x5ee7e4)=>{if(this['_aiChatUi']['addContextItem'](_0x5ee7e4['contextItem'],_0x5ee7e4['isLoading']),'selection'===_0x5ee7e4['contextItem']['type']){const _0x55ac12=[...T(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x55ac12,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x128776,_0x413139)=>{this['_aiChatUi']['removeContextItem'](_0x413139['uiId']),'current-document'==_0x413139['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x413139['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x2dc53c,_0x1bd9ee)=>{this['_aiChatUi']['setContextItemLoading'](_0x1bd9ee['contextItem']['uiId'],_0x1bd9ee['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x374c97,_0x4dd0c8)=>{this['_aiChatUi']['setConversationContext'](_0x4dd0c8['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x3ab97d,_0x514211)=>{this['_aiChatUi']['setAddContextOptions'](_0x514211['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x4adac0,_0x1838cb)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x1838cb['sourceId'],_0x1838cb['source'],_0x1838cb['resources'],_0x1838cb['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x4cb160,_0x178fd3)=>{this['_aiChatUi']['updateResourceState'](_0x178fd3['sourceId'],_0x178fd3['resourceId'],_0x178fd3['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x344661,_0x4b9654)=>{this['_aiChatUi']['updateCapabilities'](_0x4b9654);}),this['activeConversation']['on']('modelSelected',async(_0x4524dc,_0x16e8ad)=>{const _0x2e68aa=(await this['_aiChatModels']['getAll']())['find'](_0x299d7c=>_0x299d7c['id']===_0x16e8ad['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x2e68aa,_0x16e8ad['isDisabled']);}),this['activeConversation']['on']('error',(_0x3794b2,{error:_0x361988,interactionId:_0x56e57c,fileName:_0x7eefd5,url:_0x463ead,sourceId:_0x44260d,sourceLabel:_0xe108ce})=>{const _0x32339d=_0x56e57c?_0x56e57c+':'+_0x48eb5e():_0x48eb5e();_0x361988['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':i(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x32339d}):_0x361988['message']['startsWith']('ai-chat-conversation-init-failed')||_0x361988['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x32339d}),this['_logError'](_0x361988)):_0x361988['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x7eefd5),'id':_0x32339d}):_0x361988['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x463ead),'id':_0x32339d}):_0x361988['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x32339d}):_0x361988['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x32339d}):_0x361988['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x44260d&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x44260d),this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0xe108ce||'source'),'id':_0x32339d}),this['_logError'](_0x361988)):_0x361988['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x32339d}),this['_logError'](_0x361988)):_0x361988['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x32339d}),this['_logError'](_0x361988)):_0x361988['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x32339d}),this['_logError'](_0x361988)):_0x361988['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x32339d}),this['_logError'](_0x361988)):_0x361988['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':_0x32339d}),this['_logError'](_0x361988)):_0x361988['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':_0x32339d}),this['_logError'](_0x361988)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x32339d}),this['_logError'](_0x361988));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0xff69b7||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x2fa790,attributes:_0x1ccb7b}){if(!this['activeConversation'])throw new _0x563e6a('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x314245=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x314245);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x2fa790,'attributes':_0x1ccb7b});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x270615){this['_aiChatUi']['setIsMaximized'](_0x270615);}['_logError'](_0x529f62){_0x4e5dbd(_0x529f62['message']);}['_removeFromContext'](_0x2df217){this['activeConversation']?.['removeFromContext'](_0x2df217);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x10cff1){const [_0x560eee,_0x2c96ee]=_0x10cff1['split'](':'),_0x4588d3=this['activeConversation']['getInteraction'](_0x560eee),_0x2ff4b6=_0x4588d3['getReply'](_0x2c96ee);return{'interaction':_0x4588d3,'reply':_0x2ff4b6};}['_scrollToSuggestionRange'](_0x20ded6,_0x19b501=!0x1){const _0x495768=T(this['context']),_0x17cea5={'target':_0x495768['editing']['view']['domConverter']['viewRangeToDom'](_0x495768['editing']['mapper']['toViewRange'](_0x20ded6)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x19b501};_0x19b501&&(_0x17cea5['alignToTop']=!0x0),_0x1fa956(_0x17cea5);}['updateConversationTitle'](_0x2d4e19,_0x41bcaa=!0x1){this['_aiChatUi']['setConversationTitle'](_0x2d4e19||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x41bcaa);}async['_updateReplyContent']({reply:_0x3c2ded,renderingStrategy:_0x3ecd08}){const {id:_0x1a7a73,interactionId:_0x300cc2,isDone:_0x2e39ab,type:_0x1bf26f,parsedContent:_0x512af7}=_0x3c2ded,_0x10e0ae=_0x300cc2+':'+_0x1a7a73;if('modification'===_0x1bf26f){const _0x586853=_0x3c2ded['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x10e0ae,'parts':_0x586853,'renderingStrategy':_0x3ecd08,'isDone':_0x2e39ab});}else'text'===_0x1bf26f&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x10e0ae,'parsedContent':_0x512af7,'renderingStrategy':_0x3ecd08,'isDone':_0x2e39ab});_0x2e39ab&&_0x3c2ded['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x10e0ae,_0x3c2ded['sources']);}async['_stopLastInteraction'](){const _0x245da9=this['activeConversation']?.['lastInteraction'];_0x245da9&&(_0x245da9['stop'](),this['_aiChatUi']['stopInteraction'](_0x245da9));}async['_flushLastInteractionUI'](){const _0x18eac0=this['activeConversation']?.['lastInteraction'];if(_0x18eac0){for await(const _0x13bfef of _0x18eac0['replies'])await this['_updateReplyContent']({'reply':_0x13bfef,'renderingStrategy':'static'});}}['_updateRatings'](_0x3466eb){const _0x238c62={'positiveCount':_0x3466eb['changeGroups']['filter'](_0x204cb7=>'accepted'===_0x204cb7['state'])['length'],'totalCount':_0x3466eb['changeGroups']['length'],'modificationId':_0x3466eb['id']},_0x1b6673=this['activeConversation']['getInteraction'](_0x3466eb['interactionId'])['messageId'];_0x1b6673&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x1b6673,_0x238c62);}['_registerToolDataCallback'](_0x2fce02){let _0x48dc28=null,_0x10de4d=null;this['on']('toolDataReceived',(_0x15e6c2,_0x473469,_0x3393b3)=>{_0x3393b3['id']!==_0x48dc28&&(_0x48dc28=_0x3393b3['id'],_0x10de4d=this['_getAIChatInteractionAPI'](_0x3393b3)),_0x2fce02(_0x473469,_0x10de4d);});}['_getAIChatInteractionAPI'](_0xb12623){const _0x19ab61=this['_aiChatUi'],_0x174f8d=()=>{_0xb12623['resetWebSearchState'](),_0xb12623['resetReasoningState'](),_0x19ab61['clearLoadingMessage']();},_0x1b0cec=()=>{_0xb12623['currentReply']&&(_0xb12623['currentReply']['done'](),_0xb12623['currentReply']=void 0x0);};return{'insertTextReply':(_0x120107,_0x1e30e7)=>{_0x1b0cec(),_0x174f8d();const _0x443bfc=_0xb12623['currentReply']=_0xb12623['createReply']({'type':'text','interactionId':_0xb12623['id'],'content':_0x120107,'id':_0x1e30e7||_0x48eb5e()});return _0x1b0cec(),_0x443bfc;},'insertCustomElement':async(_0x1bf2eb,_0x215d9e)=>(_0x1b0cec(),_0x174f8d(),_0x19ab61['addFeedItemCustomElement'](_0x1bf2eb,_0x215d9e||_0x48eb5e())),'setLoadingMessage':_0x407166=>{_0x19ab61['setLoadingMessage'](_0x407166);},'clearLoadingMessage':()=>{_0x19ab61['clearLoadingMessage']();}};}}const R='ai-selection';class D extends _0x3a5602{constructor(_0x5518bd){super(_0x5518bd),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 _0x4386b6=T(this['context']),_0xcd5335=_0x4386b6['plugins']['has']('RealTimeCollaborationClient')&&_0x4386b6['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0xcd5335||_0x48eb5e();}return this['_sessionId'];}async['getDocumentData'](){const _0xb5b1d5=T(this['context']),_0x323777=_0xb5b1d5['model'],_0x33df85=_0xb5b1d5['data']['toView'](_0x323777['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x3d3827=new Dt(_0xb5b1d5['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x33df85,_0x3d3827);let _0x4a2161=await this['_getDocumentDataStringFromView'](_0x33df85);const _0x4596ce=this['_getMarkersInDocumentOrder'](),_0x1cf69b=[];for(const _0x5697f8 of _0x4596ce){const _0x52937b='<'+_0x5697f8['name']+':start></'+_0x5697f8['name']+':start>',_0xd207e3=_0x4a2161['indexOf'](_0x52937b);_0x4a2161=_0x4a2161['substring'](0x0,_0xd207e3)+_0x4a2161['substring'](_0xd207e3+_0x52937b['length']);const _0x15e452='<'+_0x5697f8['name']+':end></'+_0x5697f8['name']+':end>',_0x4e071a=_0x4a2161['indexOf'](_0x15e452);_0x4a2161=_0x4a2161['substring'](0x0,_0x4e071a)+_0x4a2161['substring'](_0x4e071a+_0x15e452['length']),_0x1cf69b['push']({'markerName':_0x5697f8['name'],'start':_0xd207e3,'end':_0x4e071a,'htmlFragment':_0x4a2161['substring'](_0xd207e3,_0x4e071a)});}return{'content':_0x4a2161,'version':_0xb5b1d5['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x1cf69b};}async['afterInit'](){this['context']instanceof _0x2cda04?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x5cbf86,_0x330b36)=>{_0x330b36['on']('ready',()=>{this['_integrateEditor'](_0x330b36);});});}['_setOutputDataProcessor'](_0x2bae05){this['_outputDataProcessor']=_0x2bae05;}async['_getDocumentDataStringFromView'](_0x48133d){let _0x2e66cb;const _0x25e0eb=T(this['context']);if(this['_outputDataProcessor']){const _0x3f715d=_0x25e0eb['data']['processor']['domConverter']['viewToDom'](_0x48133d),_0x4bc2dc=await this['_outputDataProcessor'](_0x3f715d);_0x2e66cb=_0x25e0eb['data']['processor']['htmlWriter']['getHtml'](_0x4bc2dc);}else _0x2e66cb=_0x25e0eb['data']['processor']['toData'](_0x48133d);return _0x2e66cb;}['_integrateEditor'](_0x49d0d8){_0x49d0d8['conversion']['for']('editingDowncast')['markerToHighlight']({'model':R,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x49d0d8['conversion']['for']('dataDowncast')['markerToElement']({'model':R,'view':(_0x22664b,{writer:_0x28ab47,options:_0x100988})=>_0x100988['convertAiChatSelectionMarker']?_0x28ab47['createUIElement'](_0x22664b['markerName']+':'+(_0x22664b['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x59e0db,_0x56626e,_0xcfed46=!0x1,_0x474df9=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x474df9)return!0x1;const _0x7c7abd=T(this['context'])['model'];return _0x7c7abd['change'](_0x40406e=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x56626e,this['_displayedFakeSelectionLocked']=_0xcfed46;let _0x309037=0x0;for(let _0x1586a6 of _0x59e0db){const _0x16f7a7=R+':'+_0x309037;if(_0x1586a6['start']['isAtEnd']){const _0x491755=_0x1586a6['start']['getLastMatchingPosition'](({item:_0x19dc0f})=>!_0x7c7abd['schema']['isContent'](_0x19dc0f),{'boundaries':_0x1586a6});_0x1586a6=_0x40406e['createRange'](_0x491755,_0x1586a6['end']);}_0x40406e['addMarker'](_0x16f7a7,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1586a6}),_0x309037++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x1d9c4e){if(this['_displayedFakeSelectionId']!=_0x1d9c4e)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x29e24c=T(this['context']),_0x1c0113=_0x29e24c['model']['markers']['getMarkersGroup'](R);return _0x29e24c['model']['change'](_0x24ac11=>{for(const _0x3aaa62 of _0x1c0113)_0x24ac11['removeMarker'](_0x3aaa62);}),!0x0;}async['modelToDataWithIds'](_0x127ab9){const _0x25f290=T(this['context']),_0x48e1dc=_0x25f290['data']['toView'](_0x127ab9),_0x3e3f72=new Dt(_0x25f290['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x48e1dc,_0x3e3f72),this['_getDocumentDataStringFromView'](_0x48e1dc);}['_setDataIdsOnChildren'](_0x2d419b,_0x474fb8){let _0x3edf6a=!0x1;const _0x2b8fc1=new Set();for(const _0x5df101 of _0x2d419b['getChildren']()){const _0x40bca6=_0x5df101['is']('emptyElement')||_0x5df101['is']('containerElement');if(!_0x5df101['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x5df101,_0x474fb8)||_0x40bca6)&&(_0x474fb8['setAttribute']('data-id',this['_nextDataId'](_0x2b8fc1),_0x5df101),_0x3edf6a=!0x0);}return _0x3edf6a;}['_nextDataId'](_0x367ccb){let _0x5d4dd3;do{_0x5d4dd3='';for(let _0x1f54ef=0x0;_0x1f54ef<0x4;_0x1f54ef++)_0x5d4dd3+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x367ccb['has'](_0x5d4dd3));return _0x367ccb['add'](_0x5d4dd3),_0x5d4dd3;}['getSelectionText'](){const {model:_0x5a411a}=T(this['context']),_0x408c6e=_0x5a411a['document']['selection'],_0x1ba024=[];for(const _0x99df91 of _0x408c6e['getRanges']())for(const _0x21255b of _0x99df91['getItems']())_0x21255b['is']('$textProxy')?_0x1ba024['push'](_0x21255b['data']):_0x21255b['is']('element')&&_0x1ba024['length']>0x0&&'\x20'!==_0x1ba024[_0x1ba024['length']-0x1]&&_0x1ba024['push']('\x20');return _0x1ba024['length']?'\x22'+_0x1ba024['join']('')['trim']()+'\x22':i(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_getMarkersInDocumentOrder'](){const _0x15e40d=T(this['context'])['model'];return Array['from'](_0x15e40d['markers']['getMarkersGroup'](R))['sort']((_0x443077,_0x574af1)=>_0x443077['getStart']()['isBefore'](_0x574af1['getStart']())?-0x1:_0x443077['getStart']()['isAfter'](_0x574af1['getStart']())?0x1:0x0);}}const W=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],Rt=[...W,'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(_0x365b5c){this['options']={'delay':_0x365b5c['delay']??0x14,'textNodeStyle':_0x365b5c['textNodeStyle'],'onStreamUpdate':_0x365b5c['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x4030cc,targetElement:_0x477134,abortSignal:_0xf4fe89}){this['isStreaming']&&this['stop'](),_0xf4fe89?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x38bb01(_0x4030cc,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x432da7=0x0;_0x432da7<this['currentIndex'];_0x432da7++)this['nodesList'][_0x432da7]['shouldBeStreamed']=!0x0;do{const _0x45ac59=Date['now'](),_0x2cc4fd=this['nodesList'][this['currentIndex']],_0x3e08be=_0x45ac59-this['lastUpdateTime'];if(_0x2cc4fd){_0x2cc4fd['shouldBeStreamed']=!0x0;let _0x4a82ed=_0x2cc4fd['parent'];for(;_0x4a82ed;)_0x4a82ed['shouldBeStreamed']=!0x0,_0x4a82ed=_0x4a82ed['parent'];}if(_0x3e08be<this['options']['delay'])try{const {promise:_0x2c4981,abortController:_0x3a88c8}=Cs(this['options']['delay']-_0x3e08be);this['timeoutAbortController']=_0x3a88c8,await _0x2c4981;}catch(_0x4d72e2){return;}_0x352e48(_0x477134,'<'+_0x477134['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x477134['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:_0x41a659}){Array['from'](_0x41a659['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x121f1b=>{_0x121f1b['replaceWith'](_0x121f1b['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x62e4b9){let _0x323aab='';if(function(_0x221ef0){return _0x82e93c(_0x221ef0);}(_0x62e4b9)){for(const _0x5761d4 of _0x62e4b9['children'])_0x323aab+=this['renderNode'](_0x5761d4);}else{if(Ts(_0x62e4b9)){if(!_0x62e4b9['shouldBeStreamed'])return'';const _0x7ada32=_0x62e4b9,_0x3cc99e=Object['entries'](_0x7ada32['attribs'])['map'](([_0x1ae261,_0xcef3b3])=>_0x1ae261+'=\x22'+_0xcef3b3+'\x22')['join']('\x20');_0x323aab+='<'+_0x7ada32['tagName']+(_0x3cc99e?'\x20'+_0x3cc99e:'')+'>';for(const _0x58039c of _0x3a470b(_0x7ada32))_0x323aab+=this['renderNode'](_0x58039c);_0x323aab+='</'+_0x7ada32['tagName']+'>';}else{if(!Ss(_0x62e4b9))return'';if(!_0x62e4b9['shouldBeStreamed'])return'';!function(_0x21f8cb){if(!_0x21f8cb['parent']||!Ts(_0x21f8cb['parent']))return!0x1;if(!ys['includes'](_0x21f8cb['parent']['tagName']))return!0x1;return!_0x1099ea(_0x21f8cb)['match'](/^\s*[<>]\s*$/);}(_0x62e4b9)?_0x323aab+=_0x17e525(_0x62e4b9):_0x323aab+=_0x17e525(new _0x504ef3('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x62e4b9]));}}return _0x323aab;}['getParsedDocumentNodeList'](){const _0x17ef8a=[];return function(_0x543cfa,_0x18b8df){const _0x8ce5a5=_0x4751a1=>{if(_0x18b8df(_0x4751a1),_0x4751a1 instanceof _0x409cd6)for(let _0x1da74e=0x0;_0x1da74e<_0x4751a1['children']['length'];_0x1da74e++){const _0x419288=_0x4751a1['children'][_0x1da74e];_0x8ce5a5(_0x419288);}};for(let _0x536a3b=0x0;_0x536a3b<_0x543cfa['children']['length'];_0x536a3b++)_0x8ce5a5(_0x543cfa['children'][_0x536a3b]);}(this['document'],_0x49586e=>{if(Ss(_0x49586e)){const _0x7788e0=this['splitTextNodeIntoWordNodes'](_0x49586e);_0x7788e0['length']&&_0x17ef8a['push'](..._0x7788e0);}_0x49586e['isWordSplitSource']||_0x49586e['isWordSplitResult']||_0x17ef8a['push'](_0x49586e);}),_0x17ef8a;}['splitTextNodeIntoWordNodes'](_0x25d855){if(_0x25d855['isWordSplitSource']||_0x25d855['isWordSplitResult'])return[];const _0x285621=_0x1099ea(_0x25d855)['match'](/(?:\s*\S+\s*)/g),_0x10b76b=[];if(_0x285621&&_0x285621['length']>0x1){for(const _0x4f1ee7 of _0x285621){const _0x2fa4a5=new _0x201b94(_0x4f1ee7);_0x2fa4a5['isWordSplitResult']=!0x0,_0x4856b5(_0x25d855,_0x2fa4a5),_0x10b76b['push'](_0x2fa4a5);}_0x25d855['isWordSplitSource']=!0x0,_0x12acc3(_0x25d855);}return _0x10b76b;}}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(_0x18b744){return _0x207546(_0x18b744);}function Ts(_0x1fe6cf){return _0x40e032(_0x1fe6cf);}function Cs(_0x48d47a){const _0x541820=new AbortController();return{'promise':new Promise((_0x243cc0,_0x449cc8)=>{const _0x3cb0ad=setTimeout(_0x243cc0,_0x48d47a);_0x541820['signal']['addEventListener']('abort',()=>{clearTimeout(_0x3cb0ad),_0x449cc8();});}),'abortController':_0x541820};}class Fr extends _0xc3e5b1{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x5ad6ac){super();const _0x6c3aab=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']=_0x5ad6ac,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x6c3aab['if']('isDone','ck-ai-chat__feed__item_done'),_0x6c3aab['if']('isVisible','ck-hidden',_0x320f92=>!_0x320f92),'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'](_0x3ff700=>{_0x3ff700['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x4755b9,_0x2d3d80,_0x5f3125){await this['htmlStreamer']['stream']({'document':_0x4755b9,'targetElement':_0x2d3d80,'abortSignal':_0x5f3125});}}class oa extends _0xc3e5b1{['showChangesToggleView'];constructor(_0x23811a,_0x521813){super(_0x23811a),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new ShowChangesToggleView(_0x23811a),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':i(_0x23811a,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x521813['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x96c591=>_0x96c591?_0x2f2c13:_0x189462),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x421a92=new _0x59b3d9();_0x421a92['content']=_0x53a0ad,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x521813['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x421a92,{'tag':'span','children':[i(_0x23811a,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class ShowChangesToggleView extends _0x2cf640{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const $n={'accepted':_0x327ee4,'rejected':_0x1e26a1,'outdated':_0x1e26a1};class mi extends _0xc3e5b1{['stateIconView'];constructor(_0x18b52c){super(_0x18b52c);const _0x574aec=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new StateIconView(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x574aec['to']('state',_0x482f74=>'ck-ai-suggestion__content-part-state_'+_0x482f74),_0x574aec['if']('isVisible','ck-hidden',_0x5dae83=>!_0x5dae83)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x574aec['to']('state',_0x12806c=>{switch(_0x12806c){case'accepted':return i(_0x18b52c,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return i(_0x18b52c,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return i(_0x18b52c,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x3a6fce){this['state']=_0x3a6fce;}}class StateIconView extends _0x59b3d9{constructor(){super(),this['set']('state','accepted'),this['content']=$n[this['state']],this['on']('change:state',()=>{this['content']=$n[this['state']];});}}class gi extends _0x14c71e{['_applyButton'];['_suggestButton'];constructor(_0x341770,_0x2c90b2,_0x3e185e){super(_0x341770);const _0x8b124e=Boolean(_0x3e185e);this['set']('isEnabled',!_0x8b124e),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x4c9972=[];if(_0x8b124e){const _0x517c0a=new _0x2cf640(_0x341770);_0x517c0a['set']({'label':i(_0x341770,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x169d70}),_0x4c9972['push'](_0x517c0a);}else{_0x2c90b2['includes']('applySuggestion')&&(this['_applyButton']=new _0x2cf640(_0x341770),this['_applyButton']['set']({'label':i(_0x341770,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x327ee4}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x4c9972['push'](this['_applyButton'])),_0x2c90b2['includes']('insertSuggestion')&&(this['_suggestButton']=new _0x2cf640(_0x341770),this['_suggestButton']['set']({'label':i(_0x341770,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x40fbce}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x4c9972['push'](this['_suggestButton']));const _0x4b14e8=new _0x2cf640(_0x341770);_0x4b14e8['set']({'label':i(_0x341770,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x1e26a1}),_0x4b14e8['bind']('isEnabled')['to'](this),_0x4b14e8['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x4c9972['push'](_0x4b14e8);}this['items']['addMany'](_0x4c9972);const _0x104cab=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x104cab['if']('isVisible','ck-hidden',_0x7f3cb1=>!_0x7f3cb1)]}});}['setButtonsVisibility']({showApplyButton:_0x11a217,showSuggestButton:_0x48619f}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x11a217),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x48619f);}}class vn extends _0xc3e5b1{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x500072,{part:_0x58bb2c,uiIndex:_0x4c6484,availableActions:_0x288e9f,areActionsDisabled:_0x525e3b}){super(_0x500072),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new gi(_0x500072,_0x288e9f,_0x525e3b),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x58bb2c['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x58bb2c['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x58bb2c['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new mi(_0x500072),this['titleLabelView']=new AISuggestionBodyContentPartTitleLabelView(_0x500072,_0x4c6484),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',(_0x3fee5f,_0x3eb841,_0x4b83d2,_0x1656d6)=>{'pending'===_0x1656d6?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x4b83d2?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x4b83d2),this['children']['add'](this['stateView']));});}}class AISuggestionBodyContentPartTitleLabelView extends _0xc3e5b1{constructor(_0x156a90,_0x520eb6){super(_0x156a90),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[i(_0x156a90,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x520eb6['toString']())]});}}class ui extends _0xc3e5b1{['htmlStreamer'];constructor(_0x427dfe){super(_0x427dfe),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:_0x40d5e9,renderingStrategy:_0x262276,abortSignal:_0x24fe31}){'streaming'===_0x262276?await this['htmlStreamer']['stream']({'document':_0x40d5e9['content'],'targetElement':this['element'],'abortSignal':_0x24fe31}):this['element']['innerHTML']=pt(_0x40d5e9['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class na extends _0xc3e5b1{['_children'];['_headerView'];['_streamableContentView'];constructor(_0xbc28a9,{part:_0x2b1760,uiIndex:_0x14425f,areActionsDisabled:_0x563617,availableActions:_0x158087}){super(_0xbc28a9);const _0x3cb8ca=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x15a7a4=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x563617;};this['on']('change:state',_0x15a7a4),this['on']('change:isDone',_0x15a7a4),_0x15a7a4(),this['_children']=this['createCollection'](),this['_headerView']=new vn(_0xbc28a9,{'part':_0x2b1760,'uiIndex':_0x14425f,'availableActions':_0x158087,'areActionsDisabled':_0x563617}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...W)['to'](this),this['_streamableContentView']=new ui(_0xbc28a9),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x3cb8ca['to']('state',_0x2bbf80=>'ck-ai-suggestion__body__content-part_'+_0x2bbf80),_0x3cb8ca['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x3cb8ca['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x3cb8ca['if']('isVisible','ck-hidden',_0x4c4b43=>!_0x4c4b43)]},'children':this['_children'],'on':{'mouseenter':_0x3cb8ca['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x2b1760['index']});}),'mouseleave':_0x3cb8ca['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x2b1760['index']});}),'click':_0x3cb8ca['to'](_0x438a6c=>{const _0x43d18e=_0x438a6c['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x43d18e)&&this['fire']('showChangeInText',{'index':_0x2b1760['index']});})}});}async['updateContent']({part:_0x4abd6d,renderingStrategy:_0x44f2fd,showUnchangedParts:_0xbf0ae0=!0x1,abortSignal:_0x3d34b9}){this['partDefinition']=_0x4abd6d,this['isVisible']=this['partDefinition']['hasChanges']||_0xbf0ae0,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x4abd6d,'renderingStrategy':_0x44f2fd,'abortSignal':_0x3d34b9});}['markAsDone'](){this['isDone']=!0x0;}}class St extends _0x5bd7c6(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x5042a6){const _0x2d58a7=this['createTask'](_0x5042a6);return this['queue']['push'](_0x2d58a7),this['_processQueue'](),_0x2d58a7['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(_0x593eb7=>{this['once']('_queueEmpty',()=>{_0x593eb7();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x425428=this['queue']['shift']();try{await _0x425428['callback'](this['_abortController']['signal']),_0x425428['resolve']();}catch(_0x190278){_0x425428['reject'](_0x190278);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x1b445b){let _0x1272fd,_0x1e9995;const _0x3d5d5b=new Promise((_0x424fc1,_0x1a4218)=>{_0x1272fd=_0x424fc1,_0x1e9995=_0x1a4218;});return{'callback':_0x1b445b,'resolve':_0x1272fd,'reject':_0x1e9995,'completePromise':_0x3d5d5b};}}class Ke extends Fr{constructor(_0x3c48d2){super(_0x3c48d2),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x3c48d2['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x260b86){this['element']['innerHTML']=_0x260b86;}}const J=['applySuggestion','insertSuggestion'];class ra extends _0xc3e5b1{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x5cd18a,_0xd652a0=[...J],_0x531441){super(_0x5cd18a);const _0x28c80d=this['bindTemplate'],_0xe1400b=Boolean(_0x531441);if(this['set']('isEnabled',!_0xe1400b),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0xe1400b){const _0x1f211e=new _0x2cf640(_0x5cd18a);_0x1f211e['set']({'label':i(_0x5cd18a,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x169d70});const _0xf7cc9e=new _0xc3e5b1(_0x5cd18a);_0xf7cc9e['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[i(_0x5cd18a,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x1f211e]}]}),this['children']['add'](_0xf7cc9e);}else this['_applyChangesButton']=new _0x2cf640(_0x5cd18a),this['_applyChangesButton']['set']({'label':i(_0x5cd18a,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0xd652a0['includes']('applySuggestion'),'class':'ck-ai-button-primary'}),this['_insertSuggestionsButton']=new _0x2cf640(_0x5cd18a),this['_insertSuggestionsButton']['set']({'label':i(_0x5cd18a,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0xd652a0['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'](_0x190cca=>{_0x190cca['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',_0x28c80d['if']('isVisible','ck-hidden',_0x3fea59=>!_0x3fea59)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x1829fa){this['isVisible']=_0x1829fa;}['_switchButtonLabelsPlurality'](_0x33b2d3){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x33b2d3?(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 _0xc3e5b1{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x2182e1,_0x3accb9){super(_0x2182e1),this['bodyCollection']=_0x3accb9,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',_0x156fda=>!_0x156fda)]},'children':this['children']});const _0x384079=new _0xc3e5b1(this['locale']),_0x34f21b=new _0x59b3d9();_0x34f21b['content']=_0xd8346c,_0x384079['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x34f21b,{'tag':'span','children':[{'text':i(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x384079),this['_setupBalloonPanel'](_0x2182e1);}['addSource'](_0x54d776){this['children']['add'](new qr(this['locale'],_0x54d776,this['balloonPanelView']));}['_setupBalloonPanel'](_0x302bf2){this['balloonPanelView']=new _0x5442ef(_0x302bf2),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class qr extends _0x2cf640{['balloonPanelView'];['source'];constructor(_0x2d7979,_0x4f3a6e,_0x5d9d89){super(_0x2d7979),this['source']=_0x4f3a6e,this['balloonPanelView']=_0x5d9d89,this['set']({'label':_0x4f3a6e['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x19f8b6=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x19f8b6['to'](()=>{window['open'](_0x4f3a6e['url'],'_blank');}),'mouseenter':_0x19f8b6['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x19f8b6['to'](()=>{this['_hideTooltip']();})}}),_0x4f3a6e['favicon']){const _0x1e60b4=new _0xc3e5b1(_0x2d7979);_0x1e60b4['setTemplate']({'tag':'img','attributes':{'src':_0x4f3a6e['favicon']||_0xd8346c,'alt':_0x4f3a6e['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x1e60b4);}else this['set']('icon',_0xd8346c);}['_createTooltipContentView'](_0x3a0dbe,_0x156f30){const _0x40e53a=new _0xc3e5b1(_0x3a0dbe),_0x59da62=[];let _0x5e1c30;_0x156f30?.['favicon']?(_0x5e1c30=new _0xc3e5b1(_0x3a0dbe),_0x5e1c30['setTemplate']({'tag':'img','attributes':{'src':_0x156f30['favicon'],'alt':_0x156f30['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x5e1c30=new _0x59b3d9(),_0x5e1c30['content']=_0xd8346c,_0x5e1c30['extendTemplate']({'attributes':{'alt':_0x156f30['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x59da62['push'](_0x5e1c30);const _0x6756f5=new _0xc3e5b1(_0x3a0dbe);_0x6756f5['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x156f30['url']},'children':[{'text':new URL(_0x156f30['url'])?.['hostname']}]}),_0x59da62['push'](_0x6756f5);const _0x36664f=new _0xc3e5b1(_0x3a0dbe);_0x36664f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x59da62});const _0x4a2eca=new _0xc3e5b1(_0x3a0dbe);return _0x4a2eca['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x156f30['title']['length']>0x190?_0x156f30['title']['substring'](0x0,0x190)+'...':_0x156f30['title']}]}),_0x40e53a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x36664f,_0x4a2eca]}),_0x40e53a;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[_0x5442ef['defaultPositions']['northArrowSouth'],_0x5442ef['defaultPositions']['northArrowSouthWest'],_0x5442ef['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 _0x24721c=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x24721c);}}class ca extends _0xc3e5b1{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x45d769,_0x37e670){super(_0x45d769);const {areActionsDisabled:_0x57702f,showUnchangedParts:_0x51b3d3,availableActions:_0x4d2f55}=_0x37e670;this['_areActionsDisabled']=_0x57702f,this['_showUnchangedParts']=_0x51b3d3,this['_availableActions']=_0x4d2f55,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new St(),this['_emptyPartsWarningView']=new Ke({'id':'empty-parts-warning','initialContent':i(_0x45d769,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new ra(_0x45d769,_0x37e670['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sr(this['locale'],_0x37e670['bodyCollection']),_0x37e670['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...W)['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:_0x3570c1,renderingStrategy:_0xedc685,abortSignal:_0x162321}){this['_children']['length']?_0x3570c1['forEach'](_0x52fcdc=>{const _0x294743=this['_cachedContentParts']['findIndex'](_0x289be9=>_0x289be9['index']==_0x52fcdc['index']);-0x1===_0x294743?this['_cachedContentParts']['push'](_0x52fcdc):this['_cachedContentParts'][_0x294743]=_0x52fcdc;}):this['_cachedContentParts']=_0x3570c1;const _0xcabc86=this['_showUnchangedParts']?_0x3570c1:_0x3570c1['filter'](_0x12237b=>_0x12237b['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0xcabc86['length']>0x1);for(const _0x4ecc12 of _0xcabc86)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x13374c=>{let _0x4864a4=this['getPartView'](_0x4ecc12['index']);_0x4864a4||(_0x4864a4=new na(this['locale'],{'part':_0x4ecc12,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x4864a4['delegate'](...W)['to'](this),this['_children']['add'](_0x4864a4),this['hasPendingParts']=!0x0),await _0x4864a4['updateContent']({'part':_0x4ecc12,'renderingStrategy':_0xedc685,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x13374c}),_0x4864a4['markAsDone']();});return _0x162321?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x4d68f0,_0x9982eb){const _0x70a07f=this['getPartView'](_0x4d68f0);_0x70a07f&&(_0x70a07f['state']=_0x9982eb),this['hasPendingParts']='pending'==_0x9982eb||Array['from'](this['_children'])['some'](_0x3e0a2b=>'pending'==_0x3e0a2b['state']);}['setPartActive'](_0x4c913f,_0x115a4a){if(!0x1===_0x4c913f){for(const _0x5eb0d3 of this['_children'])_0x5eb0d3['isActive']=!0x1;}else{const _0x5c711e=this['getPartView'](_0x4c913f);_0x5c711e&&(_0x5c711e['isActive']=_0x115a4a);}}['updateSources'](_0x10444d){_0x10444d['forEach'](_0x2ce349=>this['_sourcesView']['addSource'](_0x2ce349)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x115609){return this['_children']['find'](_0x4fbafb=>_0x4fbafb['partDefinition']['index']==_0x115609)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x1bc851=!this['_cachedContentParts']['find'](({hasChanges:_0x3447dc})=>_0x3447dc),_0x1ac007=!!this['_cachedContentParts']['find'](({hasChanges:_0x2c396a})=>!_0x2c396a);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x1ac007,_0x1bc851?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'](_0x1179df=>_0x1179df['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0x1b3d21=>_0x1b3d21['partDefinition']['hasChanges'])['length']>0x0;}}class gn extends _0xc3e5b1{['bodyView'];['children'];['headerView'];constructor(_0x1634dd,_0x5bb1fa,_0x439d2b){super(_0x1634dd);const {showDiff:_0x458d91,areActionsDisabled:_0x41f554,showUnchangedParts:_0x2f9fd5,availableActions:_0x48ff53}=_0x5bb1fa;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new oa(_0x1634dd,{'showDiff':_0x458d91}),this['headerView']['on']('toggleShowChanges',(_0xc2c474,_0x16c491)=>{this['areChangesVisible']=_0x16c491['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x16c491['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new ca(_0x1634dd,{'areActionsDisabled':_0x41f554,'showUnchangedParts':!!_0x2f9fd5,'availableActions':_0x48ff53,'bodyCollection':_0x439d2b}),this['bodyView']['delegate'](...W)['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'](_0x52a8f1){await this['bodyView']['updateContentParts'](_0x52a8f1);}['updateSources'](_0x545852){this['bodyView']['updateSources'](_0x545852);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Be extends Fr{['containerView'];constructor(_0x31e95a,_0x3f0924,_0x49f86b){super(_0x3f0924),this['set']('isTrackChangesOn',!0x1),this['containerView']=new gn(_0x31e95a,{'showDiff':_0x3f0924['showDiff'],'areActionsDisabled':_0x3f0924['areActionsDisabled'],'availableActions':_0x3f0924['availableActions']},_0x49f86b),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x18a7eb,_0x37634e)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x37634e['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',(_0x373685,{index:_0xb26f})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0xb26f});}),this['containerView']['on']('applySuggestion',(_0x3550c5,{index:_0x3c86b0}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x3c86b0});}),this['containerView']['on']('insertSuggestion',(_0x5909c4,{index:_0x26cd1c}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x26cd1c});}),this['containerView']['on']('rejectSuggestion',(_0x41c36a,{index:_0x3ab450})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3ab450});}),this['containerView']['on']('mouseOverSuggestion',(_0x5bc32b,{index:_0x164b53})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x164b53});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x2a817c,{index:_0x44a4b5})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x44a4b5});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x195231){await this['containerView']['updateContent'](_0x195231);}['updatePartState'](_0x30fd77,_0x327b35){this['containerView']['bodyView']['updatePartState'](_0x30fd77,_0x327b35);}['setPartActive'](_0x1be93a,_0x36d16b){!0x1===_0x1be93a?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x1be93a,_0x36d16b);}['updateSources'](_0x109313){this['containerView']['updateSources'](_0x109313);}['getPartView'](_0x12484c){return this['containerView']['bodyView']['getPartView'](_0x12484c);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class qe extends Fr{['replyContainer'];['_bodyCollection'];constructor(_0x1a3666,_0x56159a,_0x11f031){super(_0x56159a),this['_bodyCollection']=_0x11f031,this['locale']=_0x1a3666,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0xc3e5b1(),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':Wi(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x32395e,renderingStrategy:_0x51281f,abortSignal:_0x4e30d4}){'streaming'===_0x51281f?await this['streamIntoElement'](_0x32395e,this['replyContainer']['element'],_0x4e30d4):this['replyContainer']['element']['innerHTML']=_0x17e525(_0x32395e);}['updateSources'](_0x19d54d){const _0x58459c=new Sr(this['locale'],this['_bodyCollection']);_0x58459c['children']['addMany'](_0x19d54d['map'](_0x20783d=>new qr(this['locale'],_0x20783d,_0x58459c['balloonPanelView']))),_0x58459c['isVisible']=!0x0,this['children']['add'](_0x58459c);}}class Ze extends _0x559c75{constructor(_0x20efd7=void 0x0){super();const _0x1b6e37=_0x20efd7?'ck-ai-spinner_'+_0x20efd7:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x1b6e37]}});}}const xn={'file':_0x4d62fe,'document':_0x2ff8c2,'web-resource':_0xa0ac3e,'text':_0x4d62fe,'selection':_0x413c92,'mcp-tool-context':_0x2ff8c2},qn='ck-ai-chat-context-chip',Qn='ck-ai-chat-context-chip_wide',Xn='ck-ai-chat-context-chip_document',zn='ck-ai-chat-context-chip__label',Jn='ck-ai-chat-context-chip__type-icon',Zn='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class vo extends _0x2cf640{constructor(_0x4cb9ea,_0xc869ac,_0x5b2971,_0x1cf2af,_0x41966f=!0x1){super(_0x4cb9ea),this['_isAnimationOnEnterEnabled']=_0x1cf2af,this['_initializeProperties'](_0xc869ac,_0x5b2971,_0x41966f),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'](_0x7e8983,_0x487c89,_0x1f3222){this['set']('label',_0x7e8983['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x7e8983['type']),this['set']('id',_0x7e8983['uiId']),this['set']('readonly',_0x487c89),this['set']('isLoading',_0x1f3222);}['_setupTemplate'](){const _0x26ef5c=this['_createIconView'](),_0x13c83f=this['_createRemoveButton'](),_0x23603f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x23603f),'children':this['_createTemplateChildren'](_0x26ef5c,_0x13c83f,_0x23603f)});}['_createTemplateAttributes'](_0xca3c48){return{'class':[qn,_0xca3c48['if']('itemType',Xn,_0x61dec1=>'document'==_0x61dec1),_0xca3c48['if']('itemType',Qn,_0x3cfbb9=>'selection'==_0x3cfbb9)],'data-cke-tooltip-text':_0xca3c48['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':Zn};}['_createTemplateChildren'](_0x43014c,_0xc55fdc,_0x537bbd){const _0x466a2d=this['_createLabelElement'](_0x537bbd),_0x436511=this['_createLoaderIcon']();return this['readonly']?[_0x43014c,_0x466a2d]:[_0x43014c,_0x436511,_0x466a2d,_0xc55fdc];}['_createLabelElement'](_0x48c92e){return{'tag':'span','attributes':{'class':zn},'children':[{'text':_0x48c92e['to']('label')}]};}['_createRemoveButton'](){const _0x4e41cd=new _0x2cf640(this['locale']);return _0x4e41cd['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x3daaaf}),this['_setupRemoveButtonEvent'](_0x4e41cd),_0x4e41cd;}['_setupRemoveButtonEvent'](_0x584c0c){_0x584c0c['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x3bd552=this['bindTemplate'],_0x325f75=new _0x59b3d9();return _0x325f75['content']=xn[this['itemType']],_0x325f75['extendTemplate']({'attributes':{'class':[Jn,_0x3bd552['if']('isLoading','ck-hidden',_0x8e78ad=>_0x8e78ad)]}}),_0x325f75;}['_handleAnimationEndOnce'](_0x7df12,_0x5d54ec){if(!_0x7df12)return;const _0x18bd5e=()=>{_0x5d54ec(),_0x7df12['removeEventListener']('animationend',_0x18bd5e),_0x7df12['removeEventListener']('webkitAnimationEnd',_0x18bd5e);};_0x7df12['addEventListener']('animationend',_0x18bd5e),_0x7df12['addEventListener']('webkitAnimationEnd',_0x18bd5e);}['_createLoaderIcon'](){const _0x4e326b=new Ze('small');return _0x4e326b['bind']('isVisible')['to'](this,'isLoading',_0x4a8be7=>_0x4a8be7),_0x4e326b;}}function In(_0x70814f){if(!_0x70814f)return _0x70814f;if(_0x70814f['length']<=0x78)return _0x70814f;const _0xa3e229=_0x70814f['slice'](0x0,0x78),_0x44b50a=_0xa3e229['lastIndexOf']('\x20');return(_0x44b50a>0x0?_0xa3e229['slice'](0x0,_0x44b50a):_0xa3e229)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},an='300px';class Io{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x55ee8b,_0x559355,_0x2c547e,_0x2cc194,_0x5aaf31){this['_locale']=_0x55ee8b,this['_visibleChips']=_0x559355,this['_config']={...hn,..._0x2c547e,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x2c547e['cssClasses']}},this['_overflowChips']=new _0x7916ba(),this['_bodyCollection']=_0x2cc194,this['_parentView']=_0x5aaf31||null;}['setContainerElement'](_0x2baf85){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x2baf85,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 _0x3eb9ad=[...this['_visibleChips'],...this['_overflowChips']],_0x5d785c=this['_createCalculationContainer'](),_0x3dfd6a=this['_calculateOverflowInContainer'](_0x5d785c,_0x3eb9ad),_0x22a8b7=_0x5d785c['_ancestorsToRestore'];_0x22a8b7&&this['_restoreAncestorVisibility'](_0x22a8b7),_0x5d785c['remove'](),this['_applyOverflowResults'](_0x3eb9ad,_0x3dfd6a);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x1d212b({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0xa509fa=new _0x2cf640(this['_locale']);_0xa509fa['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x5f4e3d=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x5f4e3d['push'](this['_config']['cssClasses']['controlsButton']),_0xa509fa['extendTemplate']({'attributes':{'class':_0x5f4e3d}}),_0xa509fa;}['_createShowMoreBalloonPanelView'](){const _0x13dd96=new _0x5442ef(this['_locale']);return _0x13dd96['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x13dd96),_0x13dd96;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x34a2c3=>{_0x34a2c3['disableAnimationOnEnter']();});const _0x406db6=new _0xc3e5b1(this['_locale']);_0x406db6['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x406db6);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x3034a0=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x3034a0?'':'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'](_0x126909){const _0x331034=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x3029ca=this['_containerElement']?.['classList'];if(_0x3029ca){const _0x2ca3e7=_0x3029ca[0x0]||'',_0x2476d4=_0x126909['querySelector']('.'+_0x2ca3e7),_0x428d3a=_0x126909['querySelector'](_0x331034);return _0x2476d4||_0x428d3a||_0x126909;}return _0x126909['querySelector'](_0x331034)||_0x126909;}['_calculateContainerWidth'](){const _0x3b9049=this['_parentView']?.['element']||this['_containerElement'];if(!_0x3b9049)return an;const _0x31233a=window['getComputedStyle'](_0x3b9049)['width'];if('auto'===_0x31233a||'0px'===_0x31233a||!_0x31233a){const _0x4ed139=_0x3b9049['parentElement'];if(_0x4ed139){const _0x50c440=window['getComputedStyle'](_0x4ed139);return'auto'!==_0x50c440['width']?_0x50c440['width']:an;}return an;}return _0x31233a;}['_applyCalculationStyles'](_0x4cad33,_0xf438b3){this['_config']['cssClasses']['calculationContainer']&&_0x4cad33['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x4cad33['style']['width']=_0xf438b3,_0x4cad33['style']['position']='absolute',_0x4cad33['style']['top']='-9999px',_0x4cad33['style']['left']='-9999px',_0x4cad33['style']['opacity']='0',_0x4cad33['style']['pointerEvents']='none',_0x4cad33['style']['zIndex']='-1',_0x4cad33['style']['visibility']='visible\x20!important',_0x4cad33['style']['display']='block\x20!important',_0x4cad33['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x137f19){_0x137f19['forEach'](({element:_0x53784d,originalDisplay:_0x533337,originalVisibility:_0x16cf31})=>{_0x53784d['style']['display']=_0x533337,_0x53784d['style']['visibility']=_0x16cf31;});}['_makeAncestorsVisible'](_0x4f49b7){const _0x4df9e8=[];let _0x34bb49=_0x4f49b7;for(;_0x34bb49&&_0x34bb49!==document['body'];){const _0x2e1489=window['getComputedStyle'](_0x34bb49);'none'!==_0x2e1489['display']&&'hidden'!==_0x2e1489['visibility']||(_0x4df9e8['push']({'element':_0x34bb49,'originalDisplay':_0x34bb49['style']['display'],'originalVisibility':_0x34bb49['style']['visibility']}),_0x34bb49['style']['display']='block',_0x34bb49['style']['visibility']='visible'),_0x34bb49=_0x34bb49['parentElement'];}return _0x4df9e8;}['_createContainerElements'](){let _0x4902d7,_0x365d41;return this['_parentView']?.['element']?(_0x4902d7=this['_parentView']['element']['cloneNode'](!0x0),_0x365d41=this['_findTargetContainer'](_0x4902d7)):(_0x4902d7=document['createElement']('div'),_0x365d41=_0x4902d7),{'calculationContainer':_0x4902d7,'targetContainer':_0x365d41};}['_createCalculationContainer'](){const {calculationContainer:_0x1e097c,targetContainer:_0x53b086}=this['_createContainerElements'](),_0x3327bb=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x1e097c,_0x3327bb);const _0x49354c=this['_parentView']?.['element']||this['_containerElement'],_0x1df882=_0x49354c?.['parentElement'];_0x1df882?_0x1df882['appendChild'](_0x1e097c):document['body']['appendChild'](_0x1e097c),_0x1e097c['_targetContainer']=_0x53b086;const _0x3fe92d=this['_makeAncestorsVisible'](_0x1df882||null);return _0x1e097c['offsetWidth'],_0x1e097c['_ancestorsToRestore']=_0x3fe92d,_0x1e097c;}['_calculateOverflowInContainer'](_0x248f81,_0x56bb58){const _0x1faf11=_0x248f81['_targetContainer']||_0x248f81,_0x58f0a4=[],{rowCount:_0x50441b}=this['_renderChipsAndCountRows'](_0x1faf11,_0x56bb58);if(_0x50441b<=this['_config']['maxVisibleRows'])return _0x58f0a4;const _0x33cdfd=_0x56bb58['slice']();for(;_0x33cdfd['length']>0x0;){if(this['_testButtonFit'](_0x248f81,_0x1faf11,_0x33cdfd)){const _0x1f98c0=_0x56bb58['filter'](_0x2e1ee1=>!_0x33cdfd['includes'](_0x2e1ee1));_0x58f0a4['push'](..._0x1f98c0);break;}if(!_0x33cdfd['pop']())break;}return _0x58f0a4;}['_renderChipsAndCountRows'](_0x567480,_0x2ff4ba){_0x567480['innerHTML']='',_0x2ff4ba['forEach'](_0x27545f=>{if(_0x27545f['element']){const _0x22e54b=_0x27545f['element']['cloneNode'](!0x0);_0x567480['appendChild'](_0x22e54b);}}),_0x567480['offsetWidth'];const _0x3f1059=_0x567480['children'],_0x2c5d99=[];return Array['from'](_0x3f1059)['forEach'](_0x36d731=>{const _0x20edf4=_0x36d731['getBoundingClientRect']()['top'];_0x2c5d99['some'](_0x23d965=>Math['abs'](_0x23d965-_0x20edf4)<this['_config']['rowDetectionTolerance'])||_0x2c5d99['push'](_0x20edf4);}),{'rowCount':_0x2c5d99['length']};}['_createMockButton'](){const _0x5860db=document['createElement']('button');return _0x5860db['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x5860db['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x5860db['textContent']='+\x201',_0x5860db;}['_testButtonFit'](_0x86de32,_0x25bbaa,_0x46fc38){this['_renderChipsAndCountRows'](_0x25bbaa,_0x46fc38);const _0x254a9b=this['_createMockButton']();_0x86de32['appendChild'](_0x254a9b),_0x86de32['offsetWidth'];const _0x20fe1b=[..._0x25bbaa['children'],_0x254a9b],_0x250a27=[];_0x20fe1b['forEach'](_0x5512cd=>{const _0x15ff4c=_0x5512cd['getBoundingClientRect']()['top'];_0x250a27['some'](_0x1111a4=>Math['abs'](_0x1111a4-_0x15ff4c)<this['_config']['rowDetectionTolerance'])||_0x250a27['push'](_0x15ff4c);});const _0x4591d7=_0x250a27['length'];return _0x254a9b['remove'](),_0x4591d7<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x1d1904,_0x575bcd){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x1d1904['forEach'](_0x4db0f0=>{_0x575bcd['includes'](_0x4db0f0)?this['_overflowChips']['add'](_0x4db0f0):this['_visibleChips']['add'](_0x4db0f0);});}['_updateOverflowUI'](_0x1d53af){if(_0x1d53af>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x1d53af>0x0&&this['_showMoreButtonView']){const _0x324813=''+this['_config']['showMoreLabelPrefix']+(_0x1d53af<0x63?_0x1d53af:'99');this['_showMoreButtonView']['label']=_0x324813;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x41e103,_0x2ded91){this['_distributeChips'](_0x41e103,_0x2ded91),this['_updateOverflowUI'](_0x2ded91['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x123b95=>{_0x123b95[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 _0x9606f1=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x9606f1['width']||0x0===_0x9606f1['height'])return!0x1;const _0x286d7e=window['innerHeight']||document['documentElement']['clientHeight'],_0x364459=window['innerWidth']||document['documentElement']['clientWidth'],_0x5b927b=0xc8;return _0x9606f1['bottom']>=-0xc8&&_0x9606f1['top']<=_0x286d7e+_0x5b927b&&_0x9606f1['right']>=-0xc8&&_0x9606f1['left']<=_0x364459+_0x5b927b;}}const Or='ck-ai-chat__feed__context-chips',Nr='ck-ai-chat-context-chips-wrapper',Ur='ck-ai-chat-context-chips-wrapper-balloon',Wr='ck-ai-chat-controls-button',Yr='ck-ai-chat-controls_context_show-more-button',$r='ck-ai-chat-context-controls__show-more-balloon-panel';class _h extends _0xc3e5b1{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x2f0fce,_0x45d302,_0x492cfe){super(_0x2f0fce),this['_bodyCollection']=_0x492cfe,this['_createContextChips'](_0x45d302);const _0x2b195b={'cssClasses':{'showMoreButton':Yr,'showMoreBalloon':$r,'overflowContainer':Ur,'controlsButton':Wr}};this['_overflowManager']=new Io(_0x2f0fce,this['_contextChips'],_0x2b195b,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Or,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Nr},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x32e04c=this['element']['querySelector']('.'+Nr);_0x32e04c&&(this['_overflowManager']['setContainerElement'](_0x32e04c),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x5cbd3c){for(const _0x4f9105 of _0x5cbd3c){const _0x5c23f1=new vo(this['locale'],_0x4f9105,!0x0,!0x1);this['_contextChips']['add'](_0x5c23f1);}}}class Ge extends Fr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x4b5e74,_0x107a47,_0x679bb4){super(_0x107a47),this['_locale']=_0x4b5e74,this['_bodyCollection']=_0x679bb4,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'](_0x18194b=>!_0x18194b['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0xc3e5b1(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 Ct extends Fr{['capabilities'];constructor(_0x5eecb5,_0x302648){super(_0x302648);const {isWebSearchEnabled:_0x5d733d,isReasoningEnabled:_0x14d26e}=_0x302648['capabilities'],_0x51fbd5=[];let _0x3975fb='';_0x5d733d&&_0x14d26e?(_0x3975fb=i(_0x5eecb5,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x51fbd5['push'](aa(_0xd8346c)),_0x51fbd5['push'](aa(_0xd8dd72))):_0x5d733d?(_0x3975fb=i(_0x5eecb5,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x51fbd5['push'](aa(_0xd8346c))):_0x14d26e&&(_0x3975fb=i(_0x5eecb5,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x51fbd5['push'](aa(_0xd8dd72))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x3975fb?'':'ck-hidden']}});const _0x209698=new _0xc3e5b1();_0x209698['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x51fbd5,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x3975fb]}]}),this['children']['add'](_0x209698),this['capabilities']=_0x302648['capabilities'];}}function aa(_0x2e5f43){const _0x111bb4=new _0x59b3d9();return _0x111bb4['content']=_0x2e5f43,_0x111bb4;}const Fs=['wheel','touchstart','pointerdown','keydown'],Us=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class Qe{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x3fb3c0){this['element']=_0x3fb3c0,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x3f6a56 of Fs){const _0x518f72='keydown'!==_0x3f6a56;this['element']['addEventListener'](_0x3f6a56,this['_onUserEvent']['bind'](this),{'passive':_0x518f72,'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'](_0x2e0882){if(this['isRunning']){if('keydown'===_0x2e0882['type']){const _0x26b902=_0x2e0882['key'];if(!Us['includes'](_0x26b902))return;}_0x2e0882 instanceof WheelEvent?_0x2e0882['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x3681ed,scrollHeight:_0x33282b,clientHeight:_0x2989e0}=this['element'];return _0x33282b-_0x3681ed-_0x2989e0<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class Xe extends _0xc3e5b1{constructor(_0x506561,_0x2f2294){super(_0x506561),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x2f2294)});}['_createSkeletonItems'](_0x110212){const _0x45d924=['ck','ck-ai-skeleton__item'];return _0x110212['map'](_0x1052f8=>{let _0x145889='';switch(_0x1052f8['attributes']['align']){case'right':_0x145889='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x145889='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x145889='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x1052f8['tag'],'attributes':{'class':[..._0x45d924,_0x1052f8['attributes']['class']?_0x1052f8['attributes']['class']:''],'style':'width:\x20'+_0x1052f8['attributes']['width']+';\x20height:\x20'+_0x1052f8['attributes']['height']+';'+_0x145889}};});}}const Ye={'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(_0x4511e0,_0x565ddd,_0x3e49b6,_0x417c19){return new Array(_0x4511e0)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x565ddd,'height':_0x3e49b6,'align':_0x417c19}}));}class $e extends Fr{constructor(_0x38efbf){super(_0x38efbf),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 di extends _0xc3e5b1{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x4c25d1,_0x101320){super(_0x4c25d1),this['_bodyCollection']=_0x101320,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Rt)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new Qe(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x5e2f3c,_0x4d9bff){let _0x3a7246;return'ai-reply'===_0x5e2f3c?_0x3a7246=new qe(this['locale'],_0x4d9bff,this['_bodyCollection']):'ai-suggestion-reply'===_0x5e2f3c?(_0x3a7246=new Be(this['locale'],_0x4d9bff,this['_bodyCollection']),_0x3a7246['bind']('isTrackChangesOn')['to'](this)):_0x3a7246='user-message'===_0x5e2f3c?new Ge(this['locale'],_0x4d9bff,this['_bodyCollection']):'interaction-header'===_0x5e2f3c?new Ct(this['locale'],_0x4d9bff):'custom-element'===_0x5e2f3c?new $e(_0x4d9bff):new Ke(_0x4d9bff),this['children']['add'](_0x3a7246),_0x3a7246;}async['updateReplyItem']({id:_0x460e70,parsedContent:_0x27555b,renderingStrategy:_0x455a39,abortSignal:_0x27b087}){const _0x502e50=this['getItemById'](_0x460e70);if(!(_0x502e50 instanceof qe))throw new _0x563e6a('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x502e50,'id':_0x460e70,'parsedContent':_0x27555b});await _0x502e50['updateContent']({'parsedContent':_0x27555b,'renderingStrategy':_0x455a39,'abortSignal':_0x27b087});}async['updateWebSources'](_0x190537,_0x305fb6){const _0x3793cd=this['getItemById'](_0x190537);if(_0x3793cd instanceof Be)_0x3793cd['updateSources'](_0x305fb6);else{if(!(_0x3793cd instanceof qe))throw new _0x563e6a('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x3793cd,'id':_0x190537,'sources':_0x305fb6});_0x3793cd['updateSources'](_0x305fb6);}}async['updateSuggestionItem']({id:_0x1e3906,parts:_0x46e941,renderingStrategy:_0x4b4735,abortSignal:_0x1f094f}){const _0x25fadf=this['getItemById'](_0x1e3906);if(!(_0x25fadf instanceof Be))throw new _0x563e6a('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x25fadf,'id':_0x1e3906,'parts':_0x46e941});await _0x25fadf['updateContent']({'parts':_0x46e941,'renderingStrategy':_0x4b4735,'abortSignal':_0x1f094f});}['updateSuggestionPartState']({id:_0x2ea8a8,index:_0x3d1d83,state:_0x55b355}){const _0x242d5a=this['getItemById'](_0x2ea8a8);if(!(_0x242d5a instanceof Be))throw new _0x563e6a('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x2ea8a8});_0x242d5a['updatePartState'](_0x3d1d83,_0x55b355);}['setSuggestionPartActive']({id:_0x5231e7,index:_0x219b9d,isActive:_0x190f9d}){const _0xc3241d=this['getItemById'](_0x5231e7);if(!(_0xc3241d instanceof Be))throw new _0x563e6a('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x5231e7});this['children']['filter'](_0x2f98d1=>_0x2f98d1 instanceof Be)['forEach'](_0x5ea295=>{_0x5ea295['setPartActive'](!0x1);}),_0xc3241d['setPartActive'](_0x219b9d,_0x190f9d);}['markItemAsDone'](_0x18df6c){this['getItemById'](_0x18df6c)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x71740e=>_0x71740e['options']['id']);}['removeItem'](_0x5dba64){this['children']['remove'](this['getItemById'](_0x5dba64));}['hasItem'](_0x91283e){return!!this['children']['find'](_0x20bb64=>_0x20bb64['options']['id']['includes'](_0x91283e));}['scrollToSuggestion'](_0x3e5c13,_0x541af0){const _0x1c0125=this['getItemById'](_0x3e5c13);if(!(_0x1c0125 instanceof Be))return void _0xa8aac2('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x3e5c13,'partIndex':_0x541af0});const _0xa58dcf=_0x1c0125['getPartView'](_0x541af0);_0xa58dcf?_0x54a145(_0xa58dcf['element'],0x14,this['element']['parentElement'],!0x0,!0x0):_0xa8aac2('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x3e5c13,'partIndex':_0x541af0});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x407867=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x407867,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x432923=new Xe(this['locale'],Ye['aiFeed']);return _0x432923['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x5c4756=>!_0x5c4756)]}}),_0x432923;}['_createFeedItems'](){const _0x1be631=new _0xc3e5b1(this['locale']);return _0x1be631['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x1be631;}['_createFeedLoader'](){const _0x29fbd3=new _0xc3e5b1(this['locale']);return _0x29fbd3['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0xc3d1d9=>!_0xc3d1d9)]},'children':this['_createLoaderChildren']()}),_0x29fbd3;}['_createLoaderChildren'](){const _0xd3b4e6=new Ze();return _0xd3b4e6['isVisible']=!0x0,[_0xd3b4e6,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x1473d5){const _0x516e75=this['children']['find'](_0x5f2c59=>_0x5f2c59['options']['id']['includes'](_0x1473d5));if(!_0x516e75)throw new _0x563e6a('ai-chat-feed-view-item-not-found',this,{'id':_0x1473d5});return _0x516e75;}['setLoadingMessage'](_0x51ad78){this['set']('loadingMessage',_0x51ad78);}['toggleLoadingSkeleton'](_0x2e2f30){this['set']('isLoadingSkeletonVisible',_0x2e2f30);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class nh extends _0x163c9e{['filter'](){let _0x338b7c=0x0;for(const _0x52a697 of this['items'])_0x338b7c+=_0x52a697['items']['length'];return{'resultsCount':_0x338b7c,'totalItemsCount':_0x338b7c};}}const ah='ck-ai-chat__prompt-input_highlighted';class cs extends _0xf03a68{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x5bea9b,_0x29ea1d){super(_0x5bea9b,{'queryView':{'label':'','creator':_0xbfd767,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new nh(_0x5bea9b),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x29ea1d,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=cs['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=cs['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',(_0x141ad6,_0x2ab647)=>!_0x141ad6&&!_0x2ab647),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x346729,_0x50d6b9)=>{this['isUploadInProgress']||this['isEmpty']||_0x346729['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x50d6b9());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0xc20a62=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0xc20a62)return this['queryView']['errorText']=i(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x528b46=_0x528e40(_0xc20a62);this['fire']('sendUserMessage',_0x528b46),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x305882){this['queryView']['fieldView']['set']('placeholder',_0x305882);}['focus'](_0x228e8b=!0x1){super['focus'](),_0x228e8b&&(this['element']['classList']['contains'](ah)||(this['element']['classList']['add'](ah),setTimeout(()=>{this['element']['classList']['remove'](ah);},0x320)));}['_createSubmitButton'](){const _0x44377b=new _0x2cf640(this['locale']);return _0x44377b['set']({'icon':_0x40c783,'label':i(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x44377b['on']('execute',()=>{this['submit']();}),_0x44377b;}['setIsUploadInProgress'](_0x201d86){this['isUploadInProgress']=_0x201d86;}['_setUpAddContextButtonPositioning'](){const _0x30a01b=this['locale'],_0x5cceda=()=>{_0x44426a['window']['requestAnimationFrame'](()=>{if(_0x334b9e(this['element'])){const _0x54118d=new _0x4b725e(this['queryView']['fieldView']['element']),_0x3d60a7=new _0x4b725e(this['_addContextButtonView']['element']),_0x2e7d7d=_0x54118d['width'],_0x4b15ed='rtl'===_0x30a01b['uiLanguageDirection']?'right':'left';_0x54118d['excludeScrollbarsAndBorders']();const _0x2e2f0f=_0x2e7d7d-_0x54118d['width']+0x1;this['_addContextButtonView']['element']['style'][_0x4b15ed]='calc('+(_0x2e7d7d-_0x3d60a7['width']-_0x2e2f0f)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x5cceda),this['on']('render',()=>{_0x5cceda(),this['_queryViewResizeObserver']=new _0x592694(this['queryView']['fieldView']['element'],()=>{_0x5cceda();});});}}const Qr='ck-ai-chat__prompt-capabilities',Xr='ck-ai-chat-controls-button',Zr='ck-ai-chat-controls-button--commands',la='ck-ai-button-tertiary',ua='ck-ai-chat-controls__model-selection',da='ck-ai-chat-controls__model-selection__item-name',_a='ck-ai-chat-controls__model-selection__item-description',Aa='ck-ai-chat-controls__model-selection__item-capabilities',Ia='n';class rs extends _0xc3e5b1{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x42b47e){super(_0x42b47e),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',_0x3d9a8b=>'selector'===_0x3d9a8b),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x26bdbc=>_0x26bdbc?this['_modelSelectionDropdown']['buttonView']['label']:i(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x58eb25=>_0x58eb25),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x16bc75=>_0x16bc75),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x12ef46=>i(this['locale'],_0x12ef46?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x494ddc=>_0x494ddc),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x424e0d=>i(this['locale'],_0x424e0d?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[Qr]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x7916ba(),_0x5aa31c(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x5790f2,_0x540848){if(_0x540848)this['set']('modelDisplayMode','hidden');else{const _0x3508b3=0x1===_0x5790f2['length'];this['set']('modelDisplayMode',_0x3508b3?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x5790f2?.['length'])for(const _0x8259fa of _0x5790f2){const _0xbaaa0e=new _0x201273({'label':_0x8259fa['name'],'withText':!0x0,'role':'menuitemradio','id':_0x8259fa['id'],'model':_0x8259fa});_0xbaaa0e['bind']('isOn')['to'](this,'activeModelId',_0x3cdf4d=>_0x3cdf4d===_0x8259fa['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0xbaaa0e,'labelView':new ga(this['locale'],_0x8259fa)});}}['setWebSearch'](_0x3a0225){this['set']('webSearchActive',_0x3a0225);}['setReasoning'](_0x48af50){this['set']('reasoningActive',_0x48af50);}['setModel'](_0x40e996){if(!_0x40e996)return;this['activeModelId']=_0x40e996['id'],this['activeModelName']=_0x40e996['name']||_0x40e996['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x40e996['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x40e996['name']);const _0x23bf1b=_0x40e996['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x23bf1b),this['_webSearchButton']['set']('isVisible',_0x23bf1b);const _0x866e0e=_0x40e996['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x866e0e),this['_reasoningButton']['set']('isVisible',_0x866e0e);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x421109){this['set']('modelSelectorEnabled',!0x1),_0x421109&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x170fa6=new _0x2cf640();return _0x170fa6['set']({'label':i(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0xd8346c,'class':Xr,'isToggleable':!0x0,'tooltipPosition':Ia}),_0x170fa6['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x170fa6;}['_createReasoningButton'](){const _0x2f5b47=new _0x2cf640();return _0x2f5b47['set']({'label':i(this['locale'],'AI_CHAT_REASONING'),'icon':_0xd8dd72,'class':Xr,'isToggleable':!0x0,'tooltipPosition':Ia}),_0x2f5b47['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x2f5b47;}['_createCommandsButton'](){const _0x5e8db7=new _0x2cf640();return _0x5e8db7['set']({'label':i(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x51d4bb,'withText':!0x0,'class':Xr,'isToggleable':!0x0,'tooltip':i(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':Ia}),_0x5e8db7['extendTemplate']({'attributes':{'class':[Zr]}}),_0x5e8db7['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x5e8db7;}['_createModelSelectionDropdown'](){const _0x95ca1b=_0x3e48f8(this['locale']);return _0x95ca1b['set']({'panelPosition':'ne','class':[ua]}),_0x95ca1b['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Ia,'class':la}),this['listenTo'](_0x95ca1b,'execute',_0x6c0523=>{this['fire']('selectModel',_0x6c0523['source']['model']);}),_0x95ca1b;}['_createModelNameView'](){const _0x45e4a2=new Ca(this['locale']);return _0x45e4a2['bind']('text')['to'](this,'activeModelName',_0x3a03d4=>_0x3a03d4??''),_0x45e4a2['bind']('isVisible')['to'](this,'modelDisplayMode',_0x14b0fb=>'name'===_0x14b0fb),_0x45e4a2;}}let ga=class ModelButtonLabelView extends _0x23a78e{constructor(_0x312a9d,_0x34be0b){super();const _0x1d0db2=this['bindTemplate'],_0x417416=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x1d0db2['to']('style'),'id':_0x1d0db2['to']('id')},'children':[{'tag':'div','attributes':{'class':[da]},'children':[{'text':_0x1d0db2['to']('text')}]},{'tag':'div','attributes':{'class':[_a]},'children':[{'tag':'span','children':[{'text':_0x34be0b['description']}]}]},{'tag':'div','attributes':{'class':[Aa]},'children':_0x417416}]}),_0x417416['addMany'](this['_getCapabilityParts'](_0x312a9d,_0xd8346c,'AI_CHAT_SEARCH_WEB',_0x34be0b['capabilities']['webSearch']?.['enabled']??!0x1)),_0x417416['addMany'](this['_getCapabilityParts'](_0x312a9d,_0xd8dd72,'AI_CHAT_REASONING',_0x34be0b['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x39ada6,_0x137287,_0x5e7468,_0x424852){const _0xd3abd1=new _0x59b3d9();_0xd3abd1['content']=_0x137287;const _0x8f875f=new _0xc3e5b1(_0x39ada6);_0x8f875f['setTemplate']({'tag':'span','children':[{'text':i(_0x39ada6,_0x5e7468)+':\x20'}]});const _0x5161d4=new _0xc3e5b1(_0x39ada6);return _0x5161d4['setTemplate']({'tag':'span','children':[{'text':i(_0x39ada6,_0x424852?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0xd3abd1,_0x8f875f,_0x5161d4];}},Ca=class ModelNameView extends _0xc3e5b1{constructor(_0x210d1b){super(_0x210d1b),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x350b73=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x350b73['if']('isVisible','ck-hidden',_0x5d5041=>!_0x5d5041)]},'children':[{'text':_0x350b73['to']('text')}]});}};const Ea='ck-ai-chat-context-controls__url-form',pa='ck-ai-chat-context-controls__url-input-section';class Vo extends _0xc3e5b1{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x20495b){super(_0x20495b),this['focusTracker']=new _0x5f2dfb(),this['keystrokes']=new _0x15425(),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 _0x1af4a5({'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'](_0x21daf4=>{this['focusTracker']['add'](_0x21daf4['element']),this['keystrokes']['listenTo'](_0x21daf4['element']);}),_0x28e7fc({'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'](_0xcb3ba6){this['urlInputField']['errorText']=_0xcb3ba6,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x15fce7=new _0x2cf640(this['locale']);return _0x15fce7['set']({'icon':_0x5d4f8c,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x25c3a0,_0x6c2d11,_0x3020d4)=>{_0x15fce7['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x3020d4?'':'\x20ck-hidden')]});}),_0x15fce7;}['_createUrlInputField'](){const _0x14cb80=new _0x16298f(this['locale'],th);return _0x14cb80['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x14cb80['fieldView']['set']({'placeholder':i(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x14cb80;}['_createConfirmButton'](){const _0x440b6=new _0x2cf640(this['locale']);return _0x440b6['set']({'icon':_0x2b7211,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x440b6;}['_setupTemplate'](){const _0xfc8b85=new _0x1e299f(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'});_0xfc8b85['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Ea,'tabindex':'-1'},'children':[_0xfc8b85,{'tag':'div','attributes':{'class':pa},'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',_0x2cdf93=>{_0x2cdf93['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x4511f9,_0x2bec9b)=>{this['clear'](),this['fire']('cancel'),_0x2bec9b();});}['_handleSubmit'](){const _0x1970a5=this['getValue']()['trim']();_0x1970a5?this['_isValidUrl'](_0x1970a5)?(this['clearError'](),this['fire']('submitUrl',_0x1970a5)):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0xd01727=this['getValue']()['trim'](),_0x517796=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0xd01727['length']>0x0&&!_0x517796;}['_isValidUrl'](_0x54f4dc){try{return!!new URL(_0x54f4dc);}catch{return!0x1;}}}const Ta='ck-ai-chat-resources__item',ma='ck-ai-chat-resources__item--in-context',wa='ck-ai-chat-resources__item-title',fa='ck-ai-chat-resources__item__icon';class hc extends _0x663ac1{['resource'];['_titleView'];['_iconView'];constructor(_0x4995ee,_0x37a4e9){super(_0x4995ee),this['resource']=_0x37a4e9,this['set']('isInContext',!!_0x37a4e9['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x36b4e6){if(_0x36b4e6['isInContext'])return _0x2b7211;switch(_0x36b4e6['type']){case xe['DOCUMENT']:return _0x2ff8c2;case xe['URL']:return _0xa0ac3e;case xe['FILE']:case xe['TEXT']:return _0x4d62fe;default:return _0x5313d0;}}['highlightText'](_0x961bbc){if(!_0x961bbc||''===_0x961bbc['trim']())return void this['_titleView']['highlightText'](null);const _0x383a55=new RegExp(_0x15b1ec(_0x961bbc),'gi');this['_titleView']['highlightText'](_0x383a55);}['updateResourceState'](_0xba2365){this['resource']['isInContext']=_0xba2365,this['isInContext']=_0xba2365,this['_updateIcon']();}['_createTitleView'](){const _0x1de1a0=new _0x19afdf();return _0x1de1a0['text']=this['resource']['label'],_0x1de1a0['extendTemplate']({'tag':'span','attributes':{'class':[wa]}}),_0x1de1a0;}['_createIconView'](){const _0x240cdc=new _0x59b3d9();return _0x240cdc['content']=this['getResourceIcon'](this['resource']),_0x240cdc;}['_setupTemplate'](){const _0x10d455=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[Ta,_0x10d455['if']('isVisible','ck-hidden',_0x35bb7e=>!_0x35bb7e),_0x10d455['if']('isInContext',ma)]},'children':[{'tag':'div','attributes':{'class':[fa]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x10d455['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const Sa='ck-ai-chat-resources__list';class Lr extends _0x163c9e{['_source'];constructor(_0x44dd3a,_0x3ee963){super(_0x44dd3a),this['_source']=_0x3ee963,this['extendTemplate']({'attributes':{'class':[Sa]}});}['setResources'](_0xde6a10,_0x363790){this['items']['clear']();let _0x2c0da4=_0xde6a10;if(this['_source']['useDefaultFiltering']&&_0x363790&&''!==_0x363790['trim']()){const _0x5c3d03=new RegExp(_0x363790['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x2c0da4=_0xde6a10['filter'](_0x4f5bec=>_0x5c3d03['test'](_0x4f5bec['label']));}for(const _0x54cc9d of _0x2c0da4){const _0x50baae=new hc(this['locale'],_0x54cc9d);_0x50baae['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x54cc9d);}),this['items']['add'](_0x50baae);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x363790);}['highlightText'](_0x5a4c6e){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x2b0694=>{_0x2b0694['highlightText'](_0x5a4c6e);});}['updateResourceState'](_0xf252e6,_0xce96d){for(const _0x51ca27 of this['items']){const _0xf550ff=_0x51ca27;_0xf550ff['resource']['id']===_0xf252e6&&_0xf550ff['updateResourceState'](_0xce96d);}}['_handleResourceSelection'](_0x50672d,_0x3e2757){this['fire']('addResourceToContext',{'source':_0x50672d,'resource':_0x3e2757});}}class Tr extends _0x16298f{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x2a9731){const t=_0x2a9731['t'],_0x63be30={'showResetButton':!0x0,'showIcon':!0x0,'creator':th,'label':i(_0x2a9731,'AI_CHAT_SEARCH_RESOURCES')};super(_0x2a9731,_0x63be30['creator']),this['label']=_0x63be30['label'],this['_viewConfig']=_0x63be30,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x2a9731,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x15ea79){this['fire']('search',_0x15ea79);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x59b3d9(),this['iconView']['content']=_0x4c94fe,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x64f4d2,t){this['resetButtonView']=new _0x2cf640(_0x64f4d2),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x4718d2,'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',_0x404878=>!_0x404878),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 _0xc3e5b1{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x55c3a6,_0xde1a7d){super(_0x55c3a6),this['_source']=_0xde1a7d['source'],this['_searchInputVisibleFrom']=_0xde1a7d['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 _0xf5a45d([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 _0x4289b9=new _0xc3e5b1(this['locale']);return _0x4289b9['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x55e9bc,_0x18a41f)=>{this['loadResources'](_0x18a41f),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x18a41f);}),_0x4289b9;}['_createResourcesListView'](){const _0x9c438b=new Lr(this['locale'],this['_source']);return _0x9c438b['delegate']('addResourceToContext')['to'](this),_0x9c438b['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x9c438b;}['_createSkeletonView'](){const _0x16be19=new Xe(this['locale'],Ye['aiChatResources']);return _0x16be19['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x2c8cd5=>!_0x2c8cd5)]}}),_0x16be19;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x275cfe){const _0x552196=_0x48eb5e();this['_latestLoadResourcesUid']=_0x552196,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x275cfe,'uid':_0x552196}),this['isLoading']=!0x0;}['setResources'](_0x202511,_0x3ef417){if(_0x3ef417&&_0x3ef417!==this['_latestLoadResourcesUid'])return;const _0x4e7f52=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x202511,_0x4e7f52),_0x202511['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x5a18f3,_0x31a6ab){this['_resourcesListView']['updateResourceState'](_0x5a18f3,_0x31a6ab);}}const Ra='ck-ai-chat-context-controls__source-balloon-panel',ba='ck-button-icon\x20ck-button-back',Oa='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Po{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x107ec9,_0x3e7393,_0x33d77b){this['_locale']=_0x107ec9,this['_bodyCollection']=_0x3e7393,this['_config']=_0x33d77b;}['showSourceResourcesBalloon']({source:_0x5d459f,withBackButton:_0x50ba5c}){let _0x34fc48=this['_sourceResourceBalloons']['get'](_0x5d459f['id']);_0x34fc48||(_0x34fc48=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x5d459f['id'],_0x34fc48),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x34fc48)),this['_addSourceResourceContent']({'balloonPanel':_0x34fc48,'source':_0x5d459f,'withBackButton':_0x50ba5c}),_0x34fc48['show']();const _0xcf82fc=this['_config']['getTargetElement']();_0xcf82fc&&_0x34fc48['pin']({'target':_0xcf82fc,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x14a1e7,_0x4e0b13,_0x149c9f){const _0x405762=this['_sourceResourceBalloons']['get'](_0x14a1e7);if(!_0x405762)return;const _0x459fe6=this['_getResourcesViewFromBalloon'](_0x405762);_0x459fe6&&(_0x459fe6['setResources'](_0x4e0b13,_0x149c9f),_0x459fe6['once']('change:isLoading',()=>{_0x405762['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x403b4b){const _0x4cf3fa=this['_sourceResourceBalloons']['get'](_0x403b4b);_0x4cf3fa&&requestAnimationFrame(()=>{_0x4cf3fa['hide'](),this['_sourceResourceBalloons']['delete'](_0x403b4b),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x33e15a of this['_sourceResourceBalloons']['values']())if(_0x33e15a['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x509de2,_0x50c630,_0x4e6cd0){const _0x171853=this['_sourceResourceBalloons']['get'](_0x509de2);if(!_0x171853||!_0x171853['isVisible'])return;const _0xde27c7=this['_config']['getTargetElement']();if(!_0xde27c7)return;_0x171853['pin']({'target':_0xde27c7,'limiter':this['_config']['getLimiterElement']()});const _0x39e3be=this['_getResourcesViewFromBalloon'](_0x171853);_0x39e3be&&_0x39e3be['updateResourceState'](_0x50c630,_0x4e6cd0);}['destroy'](){for(const _0xc53493 of this['_sourceResourceBalloons']['values']())_0xc53493['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x4bbd0d=new _0x5442ef(this['_locale']);return _0x4bbd0d['extendTemplate']({'attributes':{'class':Ra}}),this['_bodyCollection']['add'](_0x4bbd0d),_0x4bbd0d;}['_addSourceResourceContent']({balloonPanel:_0x539405,source:_0x3a5b0d,withBackButton:_0x1c0cb7}){_0x539405['content']['clear']();const _0x5100a2=this['_createBalloonHeader']({'balloonPanel':_0x539405,'source':_0x3a5b0d,'withBackButton':_0x1c0cb7});_0x539405['content']['add'](_0x5100a2);const _0x58b55e=this['_createBalloonResourcesView'](_0x3a5b0d);_0x539405['content']['add'](_0x58b55e);}['_createBalloonHeader']({balloonPanel:_0x54c178,source:_0x1c09a7,withBackButton:_0x580c35}){const _0x3bce9=new _0x1e299f(this['_locale'],{'label':_0x1c09a7['label'],'class':Oa});return _0x580c35&&_0x3bce9['children']['add'](this['_createBackButton'](_0x54c178),0x0),_0x3bce9;}['_createBackButton'](_0x545156){const _0x41fcf8=new _0x2cf640(this['_locale']);return _0x41fcf8['set']({'icon':_0x5d4f8c,'tooltip':i(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':ba}),_0x41fcf8['on']('execute',()=>{_0x545156['hide'](),this['_config']['onBackToContext']();}),_0x41fcf8;}['_createBalloonResourcesView'](_0x20b59f){const _0x14304a=new lc(this['_locale'],{'source':_0x20b59f,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x14304a['on']('loadSourceResources',(_0x26c26f,_0x46337e)=>{this['_config']['onLoadSourceResources'](_0x46337e);}),_0x14304a['on']('addResourceToContext',(_0x2cac08,_0x3e5871)=>{this['_config']['onResourceSelected'](_0x3e5871['source'],_0x3e5871['resource']),this['closeSourceResourceBalloon'](_0x20b59f['id']);}),_0x14304a;}['_getResourcesViewFromBalloon'](_0x10a1a5){const _0x5af1b6=_0x10a1a5['content']['get'](0x1);return _0x5af1b6 instanceof lc?_0x5af1b6:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x54b766){_0x1d212b({'emitter':_0x54b766,'contextElements':[_0x54b766['element']],'callback':()=>{_0x54b766['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x54b766['isVisible']});}}const ps=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Ro='ck-ai-chat-context-controls',Oo='ck-ai-chat-context-controls__pending-contexts',Uo='ck-ai-chat-context-controls__add-context-balloon-panel',Lo='ck-ai-chat-context-controls__add-context-button',No='ck-ai-chat-context-controls__url-balloon-panel',Mo='ck-ai-chat-context-controls__balloon-button',Ho='ck-ai-chat-context-controls__balloon-button-source',jo='ck-ai-chat-controls-button',Fo='ck-ai-chat-context-chips-wrapper-balloon',Xo='ck-ai-chat-controls_context_show-more-button',yo='ck-ai-chat-context-controls__show-more-balloon-panel',Do='ck-ai-chat',$o=[_0x5442ef['defaultPositions']['northArrowSouthWest'],_0x5442ef['defaultPositions']['northArrowSouth'],_0x5442ef['defaultPositions']['northArrowSouthEast'],_0x5442ef['defaultPositions']['southArrowNorthWest'],_0x5442ef['defaultPositions']['southArrowNorth'],_0x5442ef['defaultPositions']['southArrowNorthEast']];class ls extends _0xc3e5b1{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x29d334,_0x1d70e6){super(_0x29d334),this['bodyCollection']=_0x1d70e6['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x29d334),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x29d334),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x29d334),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x29d334,_0x1d70e6);const _0x5758b6={'cssClasses':{'showMoreButton':Xo,'showMoreBalloon':yo,'overflowContainer':Fo,'controlsButton':jo}};this['_overflowManager']=new Io(_0x29d334,this['_currentContextsChips'],_0x5758b6,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'](_0x47bec4,_0x592ff3){const _0x5c1c99=this['_createContextButton'](_0x47bec4,'current',!0x0,_0x592ff3);this['_addContextToCollection'](_0x5c1c99,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x2fd001){this['_removeContextFromCollection'](_0x2fd001,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x2fd001,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x9ae22d,_0x955346){let _0x7af6ea=this['_currentContextsChips']['find'](_0x53c82a=>_0x53c82a['id']===_0x9ae22d);_0x7af6ea||(_0x7af6ea=this['_overflowManager']['overflowChips']['find'](_0x2a3605=>_0x2a3605['id']===_0x9ae22d)),_0x7af6ea&&(_0x7af6ea['isLoading']=_0x955346);}['setConversationContext'](_0x3adc9c){this['_conversationContextsChips']['clear']();for(const _0x39f298 of _0x3adc9c){const _0x49eda0=this['_createContextButton'](_0x39f298,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x49eda0,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x854fab,_0x4e8587,_0x1b8ac1){this['_resourcesBalloonView']['updateResourceState'](_0x854fab,_0x4e8587,_0x1b8ac1);}['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:_0x1c7ad8,withBackButton:_0x4a1133}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x1c7ad8,'withBackButton':_0x4a1133}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x75058d,_0x379420,_0x237a0d,_0x458b15){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x75058d,_0x237a0d,_0x458b15);}['closeSourceResourceBalloon'](_0x2da6df){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x2da6df),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x405a25){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x405a25),this['_setAddContextButtonEnabled'](_0x405a25);}['_setAddContextButtonEnabled'](_0x1265db){const _0x214172=!_0x1265db['document']['isHidden']&&_0x1265db['document']['enabled'],_0x4c940d=_0x1265db['urls']['enabled'],_0x448c7b=_0x1265db['files']['enabled'],_0x231ddb=_0x1265db['sources']['length']>0x0,_0x46118c=_0x1265db['customItems']&&_0x1265db['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x214172||_0x4c940d||_0x448c7b||_0x231ddb||_0x46118c;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Ro,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Oo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x1054e6){const _0x55dfa6=new _0x2cf640(_0x1054e6);return _0x55dfa6['set']({'label':i(_0x1054e6,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':jo+'\x20'+Lo,'icon':_0x3b2e9c,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x55dfa6;}['_createAddContextBalloonPanelView'](_0x54c90a){return this['_createBaseBalloonPanel'](_0x54c90a,Uo);}['_createUrlBalloonPanelView'](_0x40294a){const _0x29a1d1=this['_createBaseBalloonPanel'](_0x40294a,No);return this['_addUrlContent'](_0x29a1d1,_0x40294a),_0x29a1d1;}['_createResourcesBalloonView'](_0x4ac093,_0x5243b6){const _0x2580a9={'searchInputVisibleFrom':_0x5243b6['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':$o});},'onResourceSelected':(_0x5be715,_0x4c7445)=>{this['fire']('addResourceToContext',{'source':_0x5be715,'resource':_0x4c7445});},'onLoadSourceResources':_0x5803f0=>{this['fire']('loadSourceResources',_0x5803f0);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Po(_0x4ac093,_0x5243b6['bodyCollection'],_0x2580a9);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Do)||document['body'];}['_createBaseBalloonPanel'](_0x1be3d2,_0x160e78){const _0xd42378=new _0x5442ef(_0x1be3d2);return _0xd42378['extendTemplate']({'attributes':{'class':_0x160e78}}),this['bodyCollection']['add'](_0xd42378),_0xd42378;}['_setBalloonPanelContent'](_0x3b2b4c,_0x22e88f,_0xcfdbfb){if(_0x3b2b4c['content']['clear'](),!_0xcfdbfb['document']['isHidden']&&_0xcfdbfb['document']['enabled']){const _0xb882a5=this['_createBalloonButton'](_0x22e88f,{'label':i(_0x22e88f,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x2ff8c2});_0xb882a5['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x3b2b4c['content']['add'](_0xb882a5);}if(_0xcfdbfb['urls']['enabled']){const _0x438511=this['_createBalloonButton'](_0x22e88f,{'label':i(_0x22e88f,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0xa0ac3e});_0x438511['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':$o}),this['_urlInputView']['focus']();}),_0x3b2b4c['content']['add'](_0x438511);}if(_0xcfdbfb['files']['enabled']){const _0x139155=new _0x538cbe(_0x22e88f);_0x139155['set']({'label':i(_0x22e88f,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x3e59fd,'withText':!0x0,'tooltip':!0x0,'class':Mo,'allowMultipleFiles':!0x0}),_0x139155['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x139155['on']('done',(_0x159190,_0x484350)=>{this['fire']('addFileToContext',_0x484350);}),_0x139155['tooltip']=!0x0,_0x3b2b4c['content']['add'](_0x139155);}for(const _0x57b513 of _0xcfdbfb['sources']){const _0x364f9f=this['_createBalloonButton'](_0x22e88f,{'label':_0x57b513['label'],'icon':_0x57b513['icon']||_0x5313d0,'type':'source'});_0x3b2b4c['content']['add'](_0x364f9f),_0x364f9f['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x57b513,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x49bdc0 of _0xcfdbfb['customItems']||[]){const _0x21ec86=this['_createBalloonButton'](_0x22e88f,{'label':_0x49bdc0['label'],'icon':_0x49bdc0['icon']||_0x5313d0,'type':'customItem'});_0x3b2b4c['content']['add'](_0x21ec86),_0x21ec86['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x49bdc0);});}this['_hasExactlyOneSource']=0x1===_0x3b2b4c['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x3130fe,_0x39ad51){this['_urlInputView']=new Vo(_0x39ad51),this['_urlInputView']['on']('submitUrl',(_0x3adf81,_0x94ac52)=>{this['_handleUrlSubmit'](_0x94ac52);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':$o}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':$o});}),_0x3130fe['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x3158eb,_0x5c9556){const _0x54de2='source'===_0x5c9556['type']?new SourcesBalloonButtonView(_0x3158eb):new _0x2cf640(_0x3158eb);return _0x54de2['set']({'label':_0x5c9556['label'],'icon':_0x5c9556['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Mo}),_0x54de2;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x1d212b({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x31b722){const _0x228404=this['_addContextBalloonConfig'];_0x228404['buttonView']['isOn']=_0x31b722,_0x31b722?_0x228404['balloonView']['show']():_0x228404['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x935612,buttonView:_0x58c68b,hideMethod:_0x5ea1d4}=this['_addContextBalloonConfig'];_0x1d212b({'emitter':_0x935612,'contextElements':[_0x935612['element'],_0x58c68b['element']],'callback':()=>{_0x5ea1d4();},'activator':()=>_0x58c68b['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x14e662,_0x2609b3,_0x2401e6=!0x1,_0x3a6d1d=!0x1){const _0x1237d3='conversation'===_0x2609b3||!0x0===_0x14e662['isReadOnly'],_0x12ec18=new vo(this['locale'],_0x14e662,_0x1237d3,_0x2401e6,_0x3a6d1d);return _0x1237d3||_0x12ec18['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x12ec18['id']);}),_0x12ec18;}['_addContextToCollection'](_0x28a405,_0x138d67){_0x138d67['add'](_0x28a405,0x0);}['_removeContextFromCollection'](_0x253cd1,_0x44294a){const _0x1edb28=_0x44294a['find'](_0x1c4429=>_0x1c4429['id']===_0x253cd1);_0x1edb28&&_0x44294a['remove'](_0x1edb28);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':$o}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x2e578b){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x2e578b);}}class SourcesBalloonButtonView extends _0x2cf640{['arrowView'];constructor(_0x517ee4){super(_0x517ee4),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Ho]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x5e4ca4=new _0x59b3d9();return _0x5e4ca4['content']=_0x468b06,_0x5e4ca4['extendTemplate']({'attributes':{'class':Ho+'__arrow'}}),_0x5e4ca4;}}class ds extends _0xc3e5b1{['_cancelButtonView'];['_loaderView'];constructor(_0x482c0c){super(_0x482c0c),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 _0x3f8f95=new _0x2cf640(this['locale']);return _0x3f8f95['set']({'label':i(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x197784}),_0x3f8f95['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x3f8f95;}['_createLoaderView'](){const _0x54a950=new _0xc3e5b1(this['locale']);return _0x54a950['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')}]}),_0x54a950;}}class ji extends _0xc3e5b1{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x4720e1,_0x22755e){super(_0x4720e1),this['_contextPanelView']=this['_createContextPanelView'](_0x4720e1,{'bodyCollection':_0x22755e['bodyCollection'],'searchInputVisibleFrom':_0x22755e['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x4720e1),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x4720e1),this['_loaderView']=this['_createLoaderView'](_0x4720e1),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x4720e1),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'](...ps)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x153b57=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x153b57['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x153b57['if']('isLoading','ck-hidden',_0x32c614=>_0x32c614||!this['isModelAvailable']),_0x153b57['if']('isModelAvailable','ck-hidden',_0x19290a=>!_0x19290a||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x153b57['if']('isLoading','ck-hidden',_0x3331f1=>!_0x3331f1)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x153b57['if']('isModelAvailable','ck-hidden',_0x5dc297=>_0x5dc297)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x1d212b({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x280368,_0x21293a){return new ls(_0x280368,_0x21293a);}['_createPromptInputView'](_0x517fd2){return new cs(_0x517fd2,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x56f242){return new rs(_0x56f242);}['_createLoaderView'](_0x56f67b){return new ds(_0x56f67b);}['_createModelUnavailableMessageView'](_0x37f3fb){const _0x4702cd=new AIChatModelUnavailableMessageView(_0x37f3fb);return _0x4702cd['delegate']('startConversation')['to'](this),_0x4702cd;}['_handlePromptInputFocus'](_0x1ee248,_0x2397e9,_0x551039){_0x551039?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x1dd225,_0x569249){this['_contextPanelView']['addContextItem'](_0x1dd225,_0x569249);}['removeContextItem'](_0x9ff51){this['_contextPanelView']['removeContextItem'](_0x9ff51);}['setContextItemLoading'](_0x42efe0,_0x5eb45b){this['_contextPanelView']['setContextItemLoading'](_0x42efe0,_0x5eb45b);}['setIsUploadInProgress'](_0xc38dc4){this['_promptInputView']['setIsUploadInProgress'](_0xc38dc4);}['setConversationContext'](_0x1026aa){this['_contextPanelView']['setConversationContext'](_0x1026aa);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x2e1061,_0x40ef04,_0x327112){this['_contextPanelView']['updateResourceState'](_0x2e1061,_0x40ef04,_0x327112);}['setWebSearch'](_0x20ce8a){this['_promptCapabilitiesView']['setWebSearch'](_0x20ce8a);}['setReasoning'](_0x3d4745){this['_promptCapabilitiesView']['setReasoning'](_0x3d4745);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x2bfec8){this['_contextPanelView']['setAddContextOptions'](_0x2bfec8);}['setInputPlaceholder'](_0x43b154){this['_promptInputView']['setPlaceholderText'](_0x43b154);}['setModelList'](_0x5ca2ce,_0x10fa88){this['_promptCapabilitiesView']['setModelList'](_0x5ca2ce,_0x10fa88);}['setModel'](_0x474f0b){_0x474f0b?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x474f0b)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x503063){this['_promptCapabilitiesView']['disableModelSelector'](_0x503063);}['populateSourceResourceBalloon'](_0x46756f,_0x4344e1,_0x324600,_0x250358){this['_contextPanelView']['populateSourceResourceBalloon'](_0x46756f,_0x4344e1,_0x324600,_0x250358);}['closeSourceResourceBalloon'](_0x5e8acd){this['_contextPanelView']['closeSourceResourceBalloon'](_0x5e8acd);}['focusPromptInput'](_0x541354=!0x1){this['_promptInputView']['focus'](_0x541354);}['setPromptInputValue'](_0x20ffd8){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x20ffd8;}}class AIChatModelUnavailableMessageView extends _0xc3e5b1{constructor(_0xb8b7c0){super(_0xb8b7c0);const _0x447b56=new _0x2cf640(_0xb8b7c0);_0x447b56['set']({'label':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x447b56['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'},_0x447b56]}]});}}class ki extends _0x1e299f{['conversationStartButton'];['resizeButton'];constructor(_0x1ff210,_0x1d153f){super(_0x1ff210,{'label':i(_0x1ff210,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':Et}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x1ff210),this['children']['add'](this['conversationStartButton']),_0x1d153f&&(this['resizeButton']=us(_0x1ff210,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x5d825){const _0x3859b4=new _0x2cf640(_0x5d825);return _0x3859b4['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x1fce8d,'class':'ck-ai-chat__start-conversation'}),_0x3859b4['on']('execute',()=>{this['fire']('startConversation');}),_0x3859b4;}}class vi extends _0xc3e5b1{constructor(_0x3f874a){super(_0x3f874a),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':i(_0x3f874a,'AI_DISCLAIMER_TEXT')}]}]});}}class At extends _0xc3e5b1{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x43637b,_0x5e56c4){super(_0x43637b),this['_bodyCollection']=new _0x340c25(_0x43637b),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new ki(_0x43637b,_0x5e56c4['showResizeButton']),this['chatHeader']['delegate'](...Rt)['to'](this),this['chatFeed']=new di(_0x43637b,this['_bodyCollection']),this['chatFeed']['delegate'](...Rt)['to'](this),this['chatControls']=new ji(_0x43637b,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x5e56c4['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...Rt)['to'](this),this['chatDisclaimer']=new vi(_0x43637b),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x43637b['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x5e3af8,_0x1b0e21,_0x583bb2,_0x17eac7){this['chatControls']['populateSourceResourceBalloon'](_0x5e3af8,_0x1b0e21,_0x583bb2,_0x17eac7);}['closeSourceResourceBalloon'](_0x58abd2){this['chatControls']['closeSourceResourceBalloon'](_0x58abd2);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class z extends _0x3a5602{static get['requires'](){return[it];}['_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(_0x42e474){super(_0x42e474);const _0x2e4db9=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new St(),this['_view']=new At(this['context']['locale'],{'showResizeButton':_0x2e4db9['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...Rt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x3a7024,{showDiff:_0xdc2250})=>{this['showDiff']=_0xdc2250;}),_0x2e4db9['view']['addTab']({'id':'chat','buttonLabel':i(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':Et,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x480a4e=>_0x480a4e),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x529fba=>_0x529fba),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x50b9f4){const _0x2411b9=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'](_0x50b9f4['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x2411b9}),this['fire']('conversationCreated');}['addFeedItemStaticMessage']({id:_0xa137f2,staticMessage:_0x2994bd}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0xa137f2,'initialContent':'<p>'+_0x2994bd+'</p>'});}['addFeedItemUserMessage'](_0x509a43){const _0x2bc53b=_0x509a43['attributes']?.['displayedPrompt']||_0x509a43['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x509a43['contextItems']['values']()),'initialContent':'<p>'+_0x2bc53b+'</p>','id':_0x509a43['id']});}['addFeedItemError']({errorMessage:_0x27fcc6,id:_0x17eb8d}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x27fcc6+'</p>','id':_0x17eb8d});}['addFeedItemAIReply'](_0x546ae6){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x546ae6['interactionId']+':'+_0x546ae6['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x4c0f61){const _0x5959a6=T(this['context']);let _0x43ac91=_0x5959a6['config']['get']('ai.availableReplyActions')||[...J];if(_0x5959a6['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x923eb4=_0x5959a6['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x923eb4,'value');}}else _0x43ac91=_0x43ac91['filter'](_0xd8559a=>'insertSuggestion'!=_0xd8559a);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x4c0f61['interactionId']+':'+_0x4c0f61['id'],'areActionsDisabled':_0x4c0f61['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x43ac91}),this['clearLoadingMessage']();});}['addFeedInteractionHeader'](_0x58842c,_0x1045b6){const _0x4983d3=this['_view']['chatFeed']['children']['last'];if(_0x4983d3 instanceof Ct)return this['_view']['chatFeed']['children']['remove'](_0x4983d3),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x58842c['id'],'capabilities':{'isWebSearchEnabled':_0x4983d3['capabilities']['isWebSearchEnabled']||_0x1045b6['isWebSearchEnabled'],'isReasoningEnabled':_0x4983d3['capabilities']['isReasoningEnabled']||_0x1045b6['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x58842c['id'],'capabilities':_0x1045b6});}async['addFeedItemCustomElement'](_0x5056d5,_0x1166f7){let _0xeb7ccf;return await this['_promiseQueue']['enqueue'](async()=>{_0xeb7ccf=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x5056d5,'id':_0x1166f7});}),_0xeb7ccf;}['removeFeedItem'](_0x22c391){this['_view']['chatFeed']['removeItem'](_0x22c391);}['hasFeedItem'](_0x344c6a){return this['_view']['chatFeed']['hasItem'](_0x344c6a);}['updateFeedInteractionHeader'](_0x2281a3){const _0x3a78a7=this['_view']['chatFeed']['children']['find'](_0x2c30de=>_0x2c30de['options']['id']==_0x2281a3['id']&&_0x2c30de instanceof Ct);_0x3a78a7&&_0x3a78a7['set']('isVisible',_0x2281a3['isVisible']);}async['updateFeedItemAIReplyContent'](_0x15c48e){const _0x3a858e=_0x15c48e['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x384f0c=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x15c48e,'abortSignal':_0x384f0c,'renderingStrategy':_0x3a858e}),_0x15c48e['isDone']&&this['markFeedItemAsDone'](_0x15c48e['id']);});}['updateFeedItemAIReplySources'](_0x5395d5,_0x5966a0){this['_view']['chatFeed']['updateWebSources'](_0x5395d5,_0x5966a0);}async['updateFeedItemAIReplySuggestionContent'](_0x321447){const _0x12acab=_0x321447['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x4e962c=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x321447,'abortSignal':_0x4e962c,'renderingStrategy':_0x12acab}),_0x321447['isDone']&&this['markFeedItemAsDone'](_0x321447['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x2cf78c){this['_view']['chatFeed']['updateSuggestionPartState'](_0x2cf78c);}['setFeedItemAIReplySuggestionPartActive'](_0x25d536){this['_view']['chatFeed']['setSuggestionPartActive'](_0x25d536);}['markFeedItemAsDone'](_0x2c9098){this['_view']['chatFeed']['markItemAsDone'](_0x2c9098);}['removeFeedInteraction'](_0xf67b72){this['_view']['chatFeed']['getItemIds']()['filter'](_0x55aca0=>_0x55aca0['startsWith'](_0xf67b72))['forEach'](_0x5252c7=>this['_view']['chatFeed']['removeItem'](_0x5252c7));}['startInteraction'](){const _0x5d8842=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x5d8842),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x3238f5){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x331da3=>_0x331da3['startsWith'](_0x3238f5['id']))['forEach'](_0x5a5de6=>this['markFeedItemAsDone'](_0x5a5de6)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x6da17a,_0x483a4a){this['_view']['chatControls']['addContextItem'](_0x6da17a,_0x483a4a);}['removeContextItem'](_0x5a5b7c){this['_view']['chatControls']['removeContextItem'](_0x5a5b7c);}['setContextItemLoading'](_0x1f65fd,_0x2c4e00){this['_view']['chatControls']['setContextItemLoading'](_0x1f65fd,_0x2c4e00);}['setIsUploadInProgress'](_0x3dc4de){this['_view']['chatControls']['setIsUploadInProgress'](_0x3dc4de);}['setConversationContext'](_0x9a3379){this['_view']['chatControls']['setConversationContext'](_0x9a3379);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x2d7027,_0x543935,_0x6265dc){this['_view']['chatControls']['updateResourceState'](_0x2d7027,_0x543935,_0x6265dc);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x1e192a){this['_view']['chatControls']['setAddContextOptions'](_0x1e192a);}['updateCapabilities'](_0x4e8c04){this['_view']['chatControls']['setWebSearch'](_0x4e8c04['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x4e8c04['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x4e8c04));}['setSelectedModel'](_0x3baf45,_0x12bbfa){this['_view']['chatControls']['setModel'](_0x3baf45),_0x12bbfa&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x1523d7){this['feedItemRenderingStrategy']=_0x1523d7;}['toggleLoadingSkeleton'](_0x5cc772){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x5cc772);}['resetConversationTitle'](){this['setConversationTitle'](i(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x2bfec3,_0x27c151=!0x1){if(_0x27c151&&!mt()&&_0x2bfec3['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x2bfec3);this['_view']['chatHeader']['label']=_0x2bfec3;}['setLoadingMessage'](_0x4498b4){this['_view']['chatFeed']['setLoadingMessage'](_0x4498b4);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x90b1a){let _0x4c3a28=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x90b1a[_0x4c3a28],_0x4c3a28++,_0x4c3a28===_0x90b1a['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x5c8af9){this['_view']['chatHeader']['isMaximized']=_0x5c8af9;}['prepareLoadingMessage'](_0x172432){return _0x172432['isWebSearchEnabled']&&_0x172432['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x172432['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x172432['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x7730b1){return _0x7730b1?_0x7730b1['isWebSearchEnabled']&&_0x7730b1['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x7730b1['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x7730b1['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'](_0x5f4cf6,_0x4c2be2,_0x18eba9,_0x1ab823){this['_view']['populateSourceResourceBalloon'](_0x5f4cf6,_0x4c2be2,_0x18eba9,_0x1ab823);}['closeSourceResourceBalloon'](_0x223c14){this['_view']['closeSourceResourceBalloon'](_0x223c14);}['setPromptInputValue'](_0x40c0f6){this['_view']['chatControls']['setPromptInputValue'](_0x40c0f6);}['focusPromptInput'](_0x2e8220=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x2e8220);}['scrollFeedToSuggestion'](_0x4150c5,_0x22df87){this['_view']['chatFeed']['scrollToSuggestion'](_0x4150c5,_0x22df87);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class Li extends _0x163c9e{['sections'];constructor(_0x51fd2a,_0x2a3d8c){super(_0x51fd2a),this['sections']=_0x2a3d8c,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x8894bb){let _0x30d2a1=0x0,_0x5137a9=0x0;for(const _0x56613e of this['sections']){const {resultsCount:_0x3d48e5,totalItemsCount:_0x1d886a}=_0x56613e['filter'](_0x8894bb);_0x30d2a1+=_0x3d48e5,_0x5137a9+=_0x1d886a;}return{'resultsCount':_0x30d2a1,'totalItemsCount':_0x5137a9};}}class Yi extends _0x663ac1{['title'];['itemsViews'];['_itemsListView'];constructor(_0x543fc2,{title:_0x5b8e26,items:_0x4288ae}){super(_0x543fc2);const _0xa58407=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x5b8e26,this['itemsViews']=_0x4288ae;const _0x5baeb3=new _0xc3e5b1(_0x543fc2);_0x5baeb3['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x163c9e(_0x543fc2),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0xa58407['if']('isVisible','ck-hidden',_0x4e34dc=>!_0x4e34dc)]},'children':[_0x5baeb3,this['_itemsListView']]});}['filter'](_0x2c07a2){const _0x233ee5=this['itemsViews']['length'];let _0x8e01f9=0x0;for(const _0x359ac7 of this['itemsViews']){if(_0x2c07a2){const _0x174a1d=_0x359ac7['isMatching'](_0x2c07a2);_0x359ac7['isVisible']=!!_0x174a1d,_0x359ac7['highlightText'](_0x2c07a2);}else _0x359ac7['isVisible']=!0x0,_0x359ac7['highlightText'](null);_0x359ac7['isVisible']&&_0x8e01f9++;}return this['isVisible']=_0x8e01f9>0x0,{'resultsCount':_0x8e01f9,'totalItemsCount':_0x233ee5};}['getItem'](_0x27cd6f){return this['itemsViews']['find'](_0x29de0e=>_0x29de0e['id']===_0x27cd6f);}['removeItem'](_0x38c860){const _0xa9d9fa=this['itemsViews']['indexOf'](_0x38c860);-0x1!==_0xa9d9fa&&(this['itemsViews']['splice'](_0xa9d9fa,0x1),this['_itemsListView']['items']['remove'](_0x38c860));}}class Di extends/* #__PURE__ -- @preserve */
27
+ _0x28ab1a(_0x663ac1){['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(_0x413617,_0x3c116c){super(_0x413617);const _0x365678=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x3c116c['pinned']),this['set']('loadingState',null),this['id']=_0x3c116c['id'];const {title:_0x171abf,createdAt:_0x1d132e,active:_0x5509b4=!0x1}=_0x3c116c;this['_titleView']=new _0x19afdf(),this['_titleView']['text']=_0x171abf,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x52ac5a=this['_createCheckView'](),_0x4e7591=this['_createPinButtonView'](_0x413617),_0x20ebf5=this['_createMenuDropdownView'](),_0x247ec2=this['_createEditInputView'](_0x413617,_0x171abf),_0x38baba=this['_createAcceptEditButtonView'](_0x413617,_0x247ec2),_0xeb2c47=this['_createCancelEditButtonView'](_0x413617,_0x247ec2);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x4e7591),this['actions']['add'](_0x20ebf5),this['on']('change:isEdit',(_0x4ea3f6,_0x3e6c02,_0x448533)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x448533?(this['actions']['add'](_0x38baba),this['actions']['add'](_0xeb2c47),this['mainContent']['add'](_0x247ec2),_0x247ec2['element']['focus']()):(this['actions']['add'](_0x4e7591),this['actions']['add'](_0x20ebf5),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x5509b4?'ck-ai-chat-history__item--active':'',_0x365678['if']('isVisible','ck-hidden',_0x2e9b21=>!_0x2e9b21),_0x365678['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',_0x365678['if']('loadingState','ck-hidden',_0x8cdf24=>!!_0x8cdf24)]},'children':_0x5509b4?[_0x52ac5a]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x365678['if']('loadingState','ck-hidden',_0x2182a9=>!_0x2182a9)]},'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',_0x365678['if']('loadingState','ck-hidden',_0x38f687=>!!_0x38f687)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x365678['if']('loadingState','ck-hidden',_0x283d9a=>!_0x283d9a)]},'children':[{'text':_0x365678['to']('loadingState',_0x2fd505=>_0x2fd505?i(this['locale'],Di['LOADING_LABELS'][_0x2fd505]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x1d132e]}]},{'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'](_0x3757a1){this['_titleView']['text']=_0x528e40(_0x3757a1);}['updateLoadingState'](_0x1c21c8,_0x31f21b){this['set']('loadingState',_0x31f21b?_0x1c21c8:null);}['_createCheckView'](){const _0x580e27=new _0x59b3d9();return _0x580e27['set']({'content':_0x24d29c}),_0x580e27;}['_createPinButtonView'](_0x41768d){const _0x5e5be0=new _0x2cf640(_0x41768d);return _0x5e5be0['set']({'label':i(_0x41768d,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x404f94,'withText':!0x1,'tooltip':!0x0}),_0x5e5be0['bind']('isOn')['to'](this,'pinned'),_0x5e5be0['on']('execute',()=>{const _0xa6ae97=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0xa6ae97});}),_0x5e5be0;}['_createMenuDropdownView'](){const _0x37019b=_0x3e48f8(this['locale'],_0x3c46f6),_0x3992ba=_0x37019b['panelView']['children'];_0x37019b['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x214ca4}),_0x37019b['panelPosition']='sw';const _0x1eb028=new _0x2cf640(this['locale']);_0x1eb028['label']=i(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x1eb028['withText']=!0x0,_0x1eb028['on']('execute',()=>{this['isEdit']=!0x0;});const _0x3a2a1e=new _0x2cf640(this['locale']);_0x3a2a1e['label']=i(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x3a2a1e['withText']=!0x0,_0x3a2a1e['on']('execute',()=>{this['showConfirm'](i(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x5f04c5=new _0x163c9e(this['locale']),_0x145988=new _0x663ac1(this['locale']);_0x145988['children']['add'](_0x1eb028);const _0x420b17=new _0x663ac1(this['locale']);return _0x420b17['children']['add'](_0x3a2a1e),_0x5f04c5['items']['addMany']([_0x145988,_0x420b17]),_0x3992ba['add'](_0x5f04c5),_0x37019b;}['_createEditInputView'](_0x3963e1,_0x1c28a4){const _0x28a723=new _0x4a24d0(_0x3963e1),_0x3b0637=_0x28a723['bindTemplate'];return _0x28a723['value']=_0x1c28a4,_0x28a723['extendTemplate']({'on':{'keydown':_0x3b0637['to'](_0x7132d1=>{'Enter'==_0x7132d1['key']&&this['_commitEditInputValue'](_0x28a723);})}}),_0x28a723;}['_createAcceptEditButtonView'](_0x3fee94,_0x53bc3f){const _0xa07358=new _0x2cf640(_0x3fee94);return _0xa07358['set']({'icon':_0x24d29c,'withText':!0x1,'tooltip':i(_0x3fee94,'AI_CHAT_HISTORY_ACCEPT')}),_0xa07358['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0xa07358['on']('execute',()=>{this['_commitEditInputValue'](_0x53bc3f);}),_0xa07358;}['_commitEditInputValue'](_0x11a1bb){const _0xfe55b6=_0x11a1bb['element']['value']||'';this['_titleView']['text']=_0xfe55b6,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0xfe55b6});}['_createCancelEditButtonView'](_0xff322,_0x454c56){const _0x3d00cc=new _0x2cf640(_0xff322);return _0x3d00cc['set']({'icon':_0x4718d2,'withText':!0x1,'tooltip':i(_0xff322,'AI_CHAT_HISTORY_CANCEL')}),_0x3d00cc['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x3d00cc['on']('execute',()=>{this['isEdit']=!0x1,_0x454c56['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x3d00cc;}['_createSpinnerView'](){const _0x43f5de=new Ze('tiny');return _0x43f5de['isVisible']=!0x0,_0x43f5de;}['isMatching'](_0x55b277){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x55b277)?{'title':!0x0}:null;}['highlightText'](_0x380e07){this['_titleView']['highlightText'](_0x380e07);}}class Ot extends _0xc3e5b1{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x29914f,_0x5f171c){super(_0x29914f),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 _0x51d723=new _0x1e299f(_0x29914f,{'label':i(_0x29914f,'AI_CHAT_HISTORY_HEADING'),'icon':Nt,'class':'ck-ai-header\x20ck-ai-header_history'});_0x5f171c&&(this['resizeButton']=us(_0x29914f,this),_0x51d723['children']['add'](this['resizeButton'])),this['sectionsView']=new Li(_0x29914f,[]),this['sectionsView']['delegate'](...zi)['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',_0x3a6fd1=>!_0x3a6fd1)]}}),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':[_0x51d723,{'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 _0x3c121d=new _0x56da7a(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x330494=>i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x330494),'secondary':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x28ecf8=this['_createErrorView']();return _0x28ecf8['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x560987=>!_0x560987)]}}),_0x3c121d['on']('render',()=>{_0x3c121d['children']['add'](_0x28ecf8,0x1);}),_0x3c121d['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x4e0004=>!_0x4e0004)]}}),_0x3c121d;}['_createSkeletonView'](){const _0x48761a=new Xe(this['locale'],Ye['aiHistory']);return _0x48761a['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x8293ce=>!_0x8293ce)]}}),_0x48761a;}['_createErrorView'](){const _0x1c9b39=new _0xc3e5b1(this['locale']),_0x27e2fd=new _0x2cf640(this['locale']);_0x27e2fd['set']({'withText':!0x1,'icon':_0x4718d2,'class':'ck-ai-notification_error__dismiss-button'}),_0x27e2fd['bind']('isVisible')['to'](this,'hasItems',_0x17f565=>!!_0x17f565),_0x27e2fd['on']('execute',()=>{this['errorMessage']='';});const _0x46d483=this['bindTemplate'];return _0x1c9b39['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x46d483['to']('errorMessage')}]},_0x27e2fd]}),_0x1c9b39;}['_createEmptyStateView'](){const _0x15c3f1=new _0x2cf640(this['locale']);_0x15c3f1['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x1fce8d,'class':'ck-ai-chat__start-conversation'}),_0x15c3f1['on']('execute',()=>{this['fire']('openChat');});const _0x20b9a5=new _0xc3e5b1(this['locale']);return _0x20b9a5['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x33b3fd=>!_0x33b3fd)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[i(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x15c3f1]}),_0x20b9a5;}['_createListItemViews'](_0x32eef8,_0x4f7ee8){const _0x1f0043=[];for(const _0x444499 of _0x32eef8){const _0x4fb005=new Di(_0x4f7ee8,_0x444499);_0x4fb005['delegate'](...zi)['to'](this),_0x1f0043['push'](_0x4fb005);}return _0x1f0043;}['updateHistoryItemsWithCategories'](_0x156866){const _0x4cca51=this['locale']||'en',_0x14ff93=[];for(const _0x2deb0c of _0x156866){const _0x5768a5=this['_createListItemViews'](_0x2deb0c['items'],_0x4cca51);_0x14ff93['push'](new Yi(_0x4cca51,{'title':_0x2deb0c['title'],'items':_0x5768a5}));}this['sectionsView']['sections']=_0x14ff93,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x14ff93),this['hasItems']=_0x156866['some'](_0x532f6b=>_0x532f6b['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x3bf6cd){for(const _0x172a37 of this['sectionsView']['sections']){const _0x24dd8c=_0x172a37['getItem'](_0x3bf6cd);if(_0x24dd8c){if(_0x172a37['removeItem'](_0x24dd8c),0x0===_0x172a37['itemsViews']['length']){const _0x5643c3=this['sectionsView']['sections']['indexOf'](_0x172a37);-0x1!==_0x5643c3&&(this['sectionsView']['sections']['splice'](_0x5643c3,0x1),this['sectionsView']['items']['remove'](_0x172a37));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x90009d,_0x3c2556){for(const _0x5bcb6d of this['sectionsView']['sections']){const _0x3ce47b=_0x5bcb6d['getItem'](_0x90009d);if(_0x3ce47b){_0x3ce47b['updateTitle'](_0x3c2556);break;}}}['updateItemLoadingState'](_0x3f0a82,_0x3f8d42,_0x346590){for(const _0x3fc4ee of this['sectionsView']['sections']){const _0x5e32a2=_0x3fc4ee['getItem'](_0x3f0a82);if(_0x5e32a2){_0x5e32a2['updateLoadingState'](_0x3f8d42,_0x346590);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x2adf40=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x2adf40);}}}const zi=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class xt extends _0x3a5602{static get['requires'](){return[it];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x496e4d){super(_0x496e4d);const _0x2d6deb=this['context']['plugins']['get']('AITabs');this['_historyView']=new Ot(this['context']['locale'],_0x2d6deb['showResizeButton']),this['_historyView']['delegate'](...zi)['to'](this),_0x2d6deb['view']['addTab']({'id':'history','buttonLabel':i(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Nt,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x36ee68){this['_historyView']['removeHistoryItem'](_0x36ee68);}['updateItems'](_0x1548b5){this['_historyView']['updateHistoryItemsWithCategories'](_0x1548b5);}['updateItemTitle'](_0x1910fa,_0x88598f){this['_historyView']['updateItemTitle'](_0x1910fa,_0x88598f);}['updateItemLoadingState'](_0x531aec,_0x7888d7,_0x424f44){this['_historyView']['updateItemLoadingState'](_0x531aec,_0x7888d7,_0x424f44);}['setLoadingSkeleton'](_0x593142){this['_historyView']['isLoading']=_0x593142;}['showError'](_0x179065){this['_historyView']['errorMessage']=_0x179065;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x34902e){this['_historyView']['isMaximized']=_0x34902e;}}class nr extends ts(){['id'];['createdAt'];constructor({id:_0x10a3d1,title:_0x211fa5,createdAt:_0x2a39e8,updatedAt:_0x1983d7,pinned:_0x410eb4}){super(),this['id']=_0x10a3d1,this['createdAt']=new Date(_0x2a39e8),this['set']('title',_0x211fa5),this['set']('updatedAt',_0x1983d7?new Date(_0x1983d7):null),this['set']('pinned',_0x410eb4||!0x1);}['updateTitle'](_0xccdcb5){this['set']('title',_0x528e40(_0xccdcb5)),this['updatedAt']=new Date();}['updatePinned'](_0x26f2e9){this['set']('pinned',_0x26f2e9),this['updatedAt']=new Date();}}class Ht extends _0x5bd7c6(){['items']=[];['connector'];['group'];constructor({connector:_0x2d49a5,group:_0x4efb62}){super(),this['connector']=_0x2d49a5,this['group']=_0x4efb62;}async['init'](){try{const _0x395cc8=this['connector']['fetchConversations'](this['group']),_0xc0d375=await _0x395cc8['getConversations']();this['loadItems'](_0xc0d375);}catch(_0x15ed98){this['fire']('error',{'error':_0x15ed98,'operation':'init'});}}['addItem'](_0x16427f){this['items']['push'](_0x16427f);}async['removeItem'](_0x859e8c){const _0x166b0f=this['items']['findIndex'](_0x2ede3e=>_0x2ede3e['id']===_0x859e8c);if(-0x1===_0x166b0f)return!0x1;try{return await this['connector']['deleteConversation'](_0x859e8c)['execute'](),this['items']['splice'](_0x166b0f,0x1),this['fire']('itemRemoved',{'itemId':_0x859e8c}),!0x0;}catch(_0x17c02d){return this['fire']('error',{'error':_0x17c02d,'operation':'removeItem','itemId':_0x859e8c}),!0x1;}}['getItem'](_0x407d0f){return this['items']['find'](_0x1ca105=>_0x1ca105['id']===_0x407d0f);}async['updateItemTitle'](_0x43fd99,_0x2e726f){const _0x1342b4=this['getItem'](_0x43fd99);if(!_0x1342b4)return!0x1;try{return await this['connector']['updateConversation'](_0x43fd99,{'title':_0x2e726f})['getResult'](),_0x1342b4['updateTitle'](_0x2e726f),this['fire']('itemUpdated',{'itemId':_0x43fd99,'updates':{'title':_0x2e726f}}),!0x0;}catch(_0x41c085){return this['fire']('error',{'error':_0x41c085,'operation':'updateItemTitle','itemId':_0x43fd99}),!0x1;}}async['updateItemPinned'](_0xd76156,_0x33f25f){const _0x4a5241=this['getItem'](_0xd76156);if(!_0x4a5241)return!0x1;try{return await this['connector']['updateConversation'](_0xd76156,{'pinned':_0x33f25f})['getResult'](),_0x4a5241['updatePinned'](_0x33f25f),this['fire']('itemUpdated',{'itemId':_0xd76156,'updates':{'pinned':_0x33f25f}}),!0x0;}catch(_0x58d175){return this['fire']('error',{'error':_0x58d175,'operation':'updateItemPinned','itemId':_0xd76156}),!0x1;}}['loadItems'](_0x4c9b11){try{this['items']=[],_0x4c9b11['map'](_0x561ad0=>{this['addItem'](new nr(_0x561ad0));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x4307ac){this['fire']('error',{'error':_0x4307ac,'operation':'loadItems'});}}['getItems'](_0x58bfe9={}){const _0x2849af=void 0x0!==_0x58bfe9['pinned']&&_0x58bfe9['pinned'],_0x5caac8=_0x58bfe9['from']?new Date(_0x58bfe9['from']['getFullYear'](),_0x58bfe9['from']['getMonth'](),_0x58bfe9['from']['getDate']()):null,_0x52754f=_0x58bfe9['to']?new Date(_0x58bfe9['to']['getFullYear'](),_0x58bfe9['to']['getMonth'](),_0x58bfe9['to']['getDate']()):null;return this['items']['filter'](_0x1e7442=>{if(_0x1e7442['pinned']!==_0x2849af)return!0x1;if(_0x52754f){const _0x5c531d=new Date(_0x1e7442['createdAt']['getFullYear'](),_0x1e7442['createdAt']['getMonth'](),_0x1e7442['createdAt']['getDate']());return _0x5caac8?_0x5caac8['getTime']()===_0x52754f['getTime']()?_0x5c531d['getTime']()===_0x5caac8['getTime']():_0x5c531d<_0x52754f&&_0x5c531d>=_0x5caac8:_0x5c531d<_0x52754f;}return!0x0;});}}class jt extends _0x3a5602{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[tt,q,xt,it];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](tt),this['_aiChatHistoryUi']=this['context']['plugins']['get'](xt),this['_aiChatController']=this['context']['plugins']['get'](q);const _0x2f2c9c=this['context']['plugins']['get'](it);try{const _0xfb7f14=this['_aiChatController']['getGroupId']();this['history']=new Ht({'connector':this['_aiConnector'],'group':_0xfb7f14}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x3ea6ee,_0x221ae9)=>{this['_setItemLoading'](_0x221ae9['id'],'remove'),this['_handleRemove'](_0x221ae9['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x928c02,_0x2662e4)=>{this['_setItemLoading'](_0x2662e4['id'],'rename'),this['_handleEditTitle'](_0x2662e4['id'],_0x2662e4['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x542ced,_0xfb7310)=>{void 0x0!==_0xfb7310['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0xfb7310['itemId'],_0xfb7310['updates']['title']),void 0x0!==_0xfb7310['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0xfb7310['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x5cd81b,_0x242d4b)=>{this['_aiChatController']['handleRemovedConversation'](_0x242d4b['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x242d4b['itemId']),this['_clearItemLoading'](_0x242d4b['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x3900cb,_0x3c7dcb)=>{this['_handleHistoryErrorUI'](_0x3c7dcb['error'],_0x3c7dcb['operation'],_0x3c7dcb['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0xf69c3e,_0x9a8b47)=>{this['_handleSelectConversation'](_0x9a8b47['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x2aecfb,_0x48c538)=>{const _0x14fdf3=_0x48c538['pinned']?'pin':'unpin';this['_setItemLoading'](_0x48c538['id'],_0x14fdf3),this['_handleTogglePin'](_0x48c538['id'],_0x48c538['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x2f2c9c['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x2f2c9c['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x2f2c9c,'resizedTabs',(_0x6837dd,_0x2decfc)=>{this['_setIsMaximized'](_0x2decfc);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x2f2c9c['resize']();});}catch(_0x7ca17b){this['_handleHistoryErrorUI'](_0x7ca17b,'init');}}async['_handleEditTitle'](_0x2cff7f,_0x1d9691){await this['history']['updateItemTitle'](_0x2cff7f,_0x1d9691);}async['_handleTogglePin'](_0x4297cd,_0x46c5d7){await this['history']['updateItemPinned'](_0x4297cd,_0x46c5d7);}async['_handleRemove'](_0x5420c6){await this['history']['removeItem'](_0x5420c6);}async['_handleSelectConversation'](_0x4c2b56){await this['_aiChatController']['loadConversation'](_0x4c2b56);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x205048=this['_aiChatController']['activeConversation']?.['id'],_0x967bc8=this['_getCategorizedItems']()['map'](_0x3f04fd=>({'title':_0x3f04fd['title'],'items':_0x3f04fd['items']['map'](_0x4f33de=>({'id':_0x4f33de['id'],'title':_0x4f33de['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x4f33de['createdAt'])['toLocaleDateString'](),'active':_0x4f33de['id']===_0x205048,'pinned':_0x4f33de['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x967bc8);}['_setItemLoading'](_0x10d157,_0x16bdb8){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x10d157,_0x16bdb8,!0x0);}['_clearItemLoading'](_0x38e496){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x38e496,null,!0x1);}['_handleHistoryErrorUI'](_0x17c06a,_0x49024a,_0x27e9d3){const _0x5d4fc1=this['_generateErrorMessage'](_0x49024a,_0x27e9d3);this['_aiChatHistoryUi']['showError'](_0x5d4fc1),_0x27e9d3&&this['_clearItemLoading'](_0x27e9d3),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x43f132,_0x447d7d){const _0x1996b4=_0x447d7d?this['history']['getItem'](_0x447d7d):null,_0x3f9c50=_0x1996b4?.['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x43f132){case'updateItemTitle':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x3f9c50);case'updateItemPinned':{const _0x349907=i(this['context']['locale'],_0x1996b4?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x349907,_0x3f9c50]);}case'removeItem':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x3f9c50);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 _0x53c852=new Date(),_0x5591d8=new Date(_0x53c852['getFullYear'](),_0x53c852['getMonth'](),_0x53c852['getDate']()),_0x3b7597=new Date(_0x5591d8);_0x3b7597['setDate'](_0x3b7597['getDate']()-0x1);const _0x1bb199=new Date(_0x5591d8);_0x1bb199['setDate'](_0x1bb199['getDate']()-0xe);const _0x316328=this['history']['getItems']({'pinned':!0x0}),_0x11209d=this['history']['getItems']({'from':_0x5591d8,'to':_0x5591d8}),_0x4747e7=this['history']['getItems']({'from':_0x3b7597,'to':_0x3b7597}),_0x223e34=this['history']['getItems']({'from':_0x1bb199,'to':_0x3b7597}),_0x2410dc=this['history']['getItems']({'to':_0x1bb199}),_0x46b217=[];return _0x316328['length']>0x0&&_0x46b217['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x316328}),_0x11209d['length']>0x0&&_0x46b217['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x11209d}),_0x4747e7['length']>0x0&&_0x46b217['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x4747e7}),_0x223e34['length']>0x0&&_0x46b217['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x223e34}),_0x2410dc['length']>0x0&&_0x46b217['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x2410dc}),_0x46b217;}['_setIsMaximized'](_0x1cdc87){this['_aiChatHistoryUi']['setIsMaximized'](_0x1cdc87);}}class G extends _0x3a5602{static get['requires'](){return[jt,xt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class AIChat extends _0x3a5602{static get['requires'](){return[q,D,z,G];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x41542c){super(_0x41542c),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'](q)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](q)['startConversation']();}async['sendMessage']({message:_0x2bad14,attributes:_0x3ba2a8}){await this['context']['plugins']['get'](q)['sendMessage']({'message':_0x2bad14,'attributes':_0x3ba2a8});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](q)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](q)['focusPromptInput']();}['registerToolDataCallback'](_0x3b7b51){this['context']['plugins']['get'](q)['_registerToolDataCallback'](_0x3b7b51);}}class ws extends _0x2cf640{['id'];constructor(_0x4b6acb,_0x430800){super(_0x4b6acb);const {id:_0x42c59e,type:_0x4c72a8,icon:_0x826ea5}=_0x430800;this['id']=_0x42c59e,this['set']({'label':_0x430800['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x430800['id']}}),_0x826ea5?this['icon']=_0x826ea5:'chat'===_0x4c72a8?this['icon']=_0x382801:'review'===_0x4c72a8?this['icon']=_0x17e3b2:'translate'===_0x4c72a8&&(this['icon']=Vt);}}class Mt extends _0xc3e5b1{['listView'];constructor(_0x36dc40,_0x38a5b4){super(_0x36dc40);const _0x1d234a=_0x38a5b4['map'](_0x160daa=>{const _0x5e7226=new _0x663ac1(this['locale']),_0x101be9=new ws(this['locale'],_0x160daa);return _0x5e7226['children']['add'](_0x101be9),_0x101be9['delegate']('execute')['to'](this),_0x5e7226;});this['listView']=new _0x163c9e(this['locale']),this['listView']['items']['addMany'](_0x1d234a),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const Ut='chat-shortcuts';var ka=function(_0x2d5486){return _0x2d5486['CHAT']='chat',_0x2d5486['REVIEW']='review',_0x2d5486['TRANSLATE']='translate',_0x2d5486;}({});class AIChatShortcuts extends _0x3a5602{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[z];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](z),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x20e50d=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x20e50d['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x20e50d,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x3d9dfc=Object['values'](ka);this['_shortcuts']['forEach'](_0x242f98=>{let _0x169d25=!0x0;if(_0x242f98['id']&&_0x242f98['label']&&_0x3d9dfc['includes'](_0x242f98['type'])?'chat'===_0x242f98['type']&&(_0x169d25='string'==typeof _0x242f98['prompt']):_0x169d25=!0x1,!_0x169d25)throw new _0x563e6a('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x242f98});});}['_injectShortcuts'](){const _0x1d90af=this['context']['plugins']['get'](z);this['_shortcutsView']=new Mt(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x1d90af['addFeedItemCustomElement'](this['_shortcutsView']['element'],Ut),this['_shortcutsView']['on']('execute',_0xa63d35=>{const _0x56bb18=_0xa63d35['source']['id'];this['_executeShortcut'](_0x56bb18);});}['_removeShortcuts'](){const _0x30407b=this['context']['plugins']['get'](z);_0x30407b['hasFeedItem'](Ut)&&_0x30407b['removeFeedItem'](Ut),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x4b000f){const _0x781ca9=this['_shortcuts']['find'](_0x504919=>_0x504919['id']===_0x4b000f),_0x3b5230=_0x781ca9['type'];'chat'===_0x3b5230?this['_runChatShortcut'](_0x781ca9):'review'===_0x3b5230?_0x781ca9['check']?this['_runReviewShortcut'](_0x781ca9):this['_switchTab']('reviewMode'):'translate'===_0x3b5230&&(_0x781ca9['language']?this['_runTranslateShortcut'](_0x781ca9):this['_switchTab']('translate'));}['_switchTab'](_0x2ca6f6){if(!this['context']['plugins']['has']('AITabs'))throw new _0x563e6a('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x2ca6f6});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x2ca6f6);}async['_runChatShortcut']({prompt:_0x2a35f4,draftMode:_0x4e94e3,useWebSearch:_0x5ab1f1=!0x1,useReasoning:_0x5c9fae=!0x1,model:_0x5e2803}){const _0x419bb8=this['context']['plugins']['get']('AIChat'),_0x2f9f91=this['context']['plugins']['get']('AIChatController'),_0x43765b=_0x2f9f91['activeConversation'];let _0x3d1eef;_0x3d1eef=_0x5e2803?await _0x43765b['chatModels']['getModel'](_0x5e2803):await _0x43765b['chatModels']['getDefault'](),_0x3d1eef&&await _0x43765b['setModel'](_0x3d1eef),_0x43765b['setWebSearch'](_0x5ab1f1),_0x43765b['setReasoning'](_0x5c9fae),_0x2f9f91['addCurrentDocumentToChatContext'](),_0x4e94e3?(this['_aiChatUI']['setPromptInputValue'](_0x2a35f4),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x419bb8['sendMessage']({'message':_0x2a35f4});}['_runReviewShortcut']({check:_0x14c37f,model:_0x5dae70,prompt:_0x5cc038,params:_0x1c517e}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new _0x563e6a('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x150dab={'id':_0x14c37f,'isCustom':'custom'===_0x14c37f};_0x5dae70&&_0x5cc038&&(_0x150dab['args']={'model':_0x5dae70,'prompt':_0x5cc038}),_0x1c517e&&(_0x150dab['params']=_0x1c517e),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x150dab);}['_runTranslateShortcut']({language:_0x54a7dd}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new _0x563e6a('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x54a7dd,'args':{'language':_0x54a7dd}});}}class io extends Lt{constructor(_0xdfa794){super(_0xdfa794);const _0x3d4a78=_0xdfa794['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x3d4a78,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x33399b=this['editor']['plugins']['get']('AITabs')['view'];_0x33399b['isVisible']=!_0x33399b['isVisible'];}}class Pt extends _0x361c0d{static get['requires'](){return[it];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x1dea3c=this['editor'];_0x1dea3c['commands']['add']('toggleAi',new io(_0x1dea3c)),_0x1dea3c['ui']['componentFactory']['add']('toggleAi',()=>{const _0x4ecce9=this['_createAIUIButton'](_0x2cf640);return _0x4ecce9['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x4ecce9;}),_0x1dea3c['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x1239a6=this['_createAIUIButton'](_0x226c2e);return _0x1239a6['set']({'role':'menuitemcheckbox'}),_0x1239a6;});}['_createAIUIButton'](_0x1f6eb7){const _0x545b4e=this['editor'],_0x2a8b9f=_0x545b4e['commands']['get']('toggleAi'),_0x49d3bc=new _0x1f6eb7(_0x545b4e['locale']);return _0x49d3bc['set']({'label':i(_0x545b4e['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x2ab699,'isToggleable':!0x0}),_0x49d3bc['bind']('isEnabled')['to'](_0x2a8b9f),_0x49d3bc['bind']('isOn')['to'](_0x2a8b9f,'value',_0x490a31=>!!_0x490a31),this['listenTo'](_0x49d3bc,'execute',()=>{_0x2a8b9f['execute']();}),_0x49d3bc;}}const F=['applySuggestion','insertSuggestion','showNext','showPrevious'];class pi extends _0xc3e5b1{['_errorView'];constructor(_0x103fd8){super(_0x103fd8),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x16d3bd){this['showError'](_0x16d3bd);}['showError'](_0xb1c343){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0xb1c343,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x21ef9f=new _0xc3e5b1(this['locale']),_0x3c4557=new _0xc3e5b1(this['locale']);return _0x3c4557['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x21ef9f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x461677=>!_0x461677)]},'children':[_0x3c4557]}),_0x21ef9f;}}const $=0xa;class H extends _0x3a5602{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'](_0x407c82){const {id:_0x1c49d7}=this['_currentConfig']??{};this['_currentConfig']=_0x407c82;const {id:_0x2813aa}=this['_currentConfig'];this['isOpen']&&_0x1c49d7===_0x2813aa?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x1eff3c=T(this['context'])['plugins']['get']('Dialog');_0x1eff3c['isOpen']&&this['_currentConfig']&&_0x1eff3c['id']===this['_currentConfig']['id']&&_0x1eff3c['hide']();}['_updateDialog'](){const _0x55f730=T(this['context'])['plugins']['get']('Dialog'),{icon:_0x118734,title:_0x2707d2}=this['_currentConfig'];_0x55f730['view']?.['headerView']&&(_0x55f730['view']['headerView']['label']=_0x2707d2,_0x55f730['view']['headerView']['iconView']&&_0x118734&&(_0x55f730['view']['headerView']['iconView']['content']=_0x118734)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x55f730['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](D)['showFakeVisualSelection'](this['_currentConfig']['ranges'],'ai-balloon-'+this['_currentConfig']['index'],!0x0,!0x0);}['_hideFakeVisualSelection'](_0x861d8c){this['context']['plugins']['get'](D)['hideFakeVisualSelection']('ai-balloon-'+_0x861d8c);}['_showDialog'](){const _0x29df73=T(this['context'])['plugins']['get']('Dialog'),{id:_0x47729f,title:_0x5ea44b,icon:_0x4ca317,class:_0x389a7c,mainView:_0x3e21ad}=this['_currentConfig'];_0x3e21ad['delegate'](...F)['to'](this),_0x29df73['show']({'title':_0x5ea44b,'icon':_0x4ca317,'hasCloseButton':!0x0,'id':_0x47729f,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x389a7c||''),'content':_0x3e21ad,'onShow':_0x1f6434=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x5b1f19=this['_getSelectionElements']();_0x5b1f19&&_0x5b1f19[0x0]&&_0x1fa956({'target':_0x5b1f19[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x1f6434['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x47729f});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](this['_currentConfig']['index']),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x47729f}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x47b804,_0x3f28f6){if(!_0x3f28f6)return null;const _0x434406=this['_getSelectionElements']();if(!_0x434406||0x0===_0x434406['length'])return{'left':Math['round'](_0x3f28f6['left']+_0x3f28f6['width']/0x2-_0x47b804['width']/0x2),'top':Math['round'](_0x3f28f6['top']+_0x3f28f6['height']/0x2-_0x47b804['height']/0x2)};const _0x5346a0=Math['round'](_0x3f28f6['left']+_0x3f28f6['width']/0x2-_0x47b804['width']/0x2),_0x4cde34=_0x434406['map'](_0x240969=>new _0x4b725e(_0x240969)),_0x473a9a=_0x47b804['height'];return{'left':_0x5346a0,'top':this['_calculateOptimalTopPosition'](_0x4cde34,_0x473a9a,_0x3f28f6)};}['_calculateOptimalTopPosition'](_0x20eb3a,_0x2b0d16,_0x7c880e){const _0x3e36c9=new _0x4b725e(_0x44426a['window']),_0x57e27f=_0x20eb3a['map'](_0x4162a9=>_0x4162a9['getVisible']())['filter'](_0xadecb9=>_0xadecb9),_0x17a8cd=_0x4b725e['getBoundingRect'](_0x57e27f);if(!_0x17a8cd)return Math['round'](_0x7c880e['top']+_0x7c880e['height']/0x2);const _0x406f0d=_0x3e36c9['getIntersection'](_0x17a8cd);if(!_0x406f0d)return Math['round'](_0x7c880e['top']+_0x7c880e['height']/0x2);const _0x494129=_0x7c880e['getVisible'](),_0x34e6a0=_0x494129&&_0x17a8cd['height']>_0x494129['height'],_0x517751=_0x406f0d['top'],_0x4b770a=_0x406f0d['bottom'];if(_0x34e6a0){const _0x3ac14b=(_0x494129||_0x3e36c9)['height']/0x2-_0x2b0d16/0x2,_0x24cd5a=_0x517751-$-_0x7c880e['top'],_0x154d52=_0x7c880e['bottom']-_0x4b770a-$;return _0x24cd5a>=_0x2b0d16?Math['max']($,_0x517751-_0x2b0d16-$):_0x154d52>=_0x2b0d16?_0x4b770a+$:Math['max']($,_0x3ac14b);}const _0x3a4612=_0x517751-_0x2b0d16,_0xa87e72=_0x7c880e['bottom']-_0x4b770a-$,_0x4a9c53=_0x517751-$-_0x7c880e['top'];let _0xdcce1b;if(_0xa87e72>=_0x2b0d16)_0xdcce1b=_0x4b770a+$;else{if(_0x4a9c53>=_0x2b0d16)_0xdcce1b=_0x3a4612-$;else _0xdcce1b=_0x517751+_0x17a8cd['height']/0x2-_0x2b0d16/0x2;}return _0xdcce1b;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x2d9125=T(this['context']);this['listenTo'](_0x2d9125['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0xeb823c,data:{newRange:_0x12154a}}of _0x2d9125['model']['document']['differ']['getChangedMarkers']())if(_0xeb823c['startsWith'](R+':')&&(_0x12154a&&(_0x12154a['start']['isEqual'](_0x12154a['end'])||'$graveyard'==_0x12154a['root']['rootName'])||null==_0x12154a)){const _0xb70d2b=i(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0xb70d2b),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x14008e=T(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x14008e['model']['document']);}['_getSelectionElements'](){const _0x3aa7ab=T(this['context']);return _0x18a8b5(_0x3aa7ab['editing'],[..._0x3aa7ab['model']['markers']['getMarkersGroup']('ai-selection'),..._0x3aa7ab['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class wi extends _0x14c71e{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x548633,_0x3b1d6f={}){super(_0x548633),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x3b1d6f};const _0x283781=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x283781?'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'](_0x5aa6b7){this['showChangesButton']['isEnabled']=_0x5aa6b7;}['_setupRatingButtons'](){this['likeButton']=new _0x2cf640(this['locale']),this['likeButton']['set']({'icon':_0x2ea5c6,'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 _0x2cf640(this['locale']),this['dislikeButton']['set']({'icon':_0x427eb3,'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 _0x2cf640(this['locale']),this['copyButton']['set']({'icon':_0x571e92,'label':i(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x2805de=new _0x59b3d9();_0x2805de['set']({'content':_0x2b7211}),_0x2805de['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'](_0x2805de);}['_setupShowChangesButton'](){this['showChangesButton']=new _0x2cf640(this['locale']),this['showChangesButton']['set']({'icon':_0x1c481d,'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',_0x32735b=>_0x32735b?_0x339447:_0x1c481d),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class Q extends pi{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0xf247af,_0xdd6ce2){super(_0xf247af);const _0x509870=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new _0x5f2dfb(),this['_keystrokes']=new _0x15425(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x1af4a5({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0xdd6ce2,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new ui(_0xf247af),this['_partToolbarView']=new gi(_0xf247af,_0xdd6ce2['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0xdd6ce2),this['_stateView']=new mi(_0xf247af),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new wi(_0xf247af,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new AIChatBalloonToolbarContainerView(_0xf247af,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x3cf55e,_0x5dcb3d,_0x24620a,_0x135757)=>{let _0x4e5026,_0x2b035c;'pending'===_0x135757?(_0x4e5026=this['_partToolbarView'],_0x2b035c=this['_stateView']):(_0x4e5026=this['_stateView'],_0x2b035c=this['_partToolbarView']),this['_stateView']['setState'](_0x24620a),_0x4e5026['isVisible']=!0x1,_0x2b035c['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x509870['to']('_state',_0x578c8a=>'ck-ai-chat-balloon-main_state_'+_0x578c8a)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0xdd6ce2);});}['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'](_0x44944b){_0x44944b?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x44944b);}['setState'](_0x4990c1){this['_state']=_0x4990c1;}['showError'](_0x19d038){super['showError'](_0x19d038),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x1d5db1){super['showBlockingError'](_0x1d5db1),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x4eb942){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x4eb942;}['togglePartToolbarEnabled'](_0x2f2e72){this['_partToolbarView']['isEnabled']=_0x2f2e72;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x167706,showSuggestButton:_0x4da5f6}){_0x167706=_0x167706&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x4da5f6=_0x4da5f6&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x167706,'showSuggestButton':_0x4da5f6});}['_createNextButtonView'](){const _0x5edaf1=new _0x2cf640(this['locale']);return _0x5edaf1['set']({'icon':_0x179898,'label':i(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x5edaf1['on']('execute',()=>{this['fire']('showNext');}),_0x5edaf1;}['_createPreviousButtonView'](){const _0x3c0577=new _0x2cf640(this['locale']);return _0x3c0577['set']({'icon':_0x2ca36b,'label':i(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x3c0577['on']('execute',()=>{this['fire']('showPrevious');}),_0x3c0577;}}class AIChatBalloonToolbarContainerView extends _0xc3e5b1{constructor(_0x5c9354,_0x3a386d){super(_0x5c9354),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x3a386d});}}class qt extends _0x361c0d{static get['requires'](){return[_0x3a1450,H];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x603eae){super(_0x603eae),this['set']('showDiff',!0x1);}['open'](_0x23edb5){const _0x5a6004=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x5a6004['plugins']['get']('AIBalloon')['open']({..._0x23edb5,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x23edb5['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x23edb5['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0xa7d7c5){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0xa7d7c5);}['setState'](_0x17509c){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x17509c);}['_createChatBalloonView'](){const _0x4e9af3=this['editor'],_0x452fad=_0x4e9af3['plugins']['get']('AIBalloon'),_0x2bf02c=_0x4e9af3['commands']['get']('trackChanges');let _0x5ee80=_0x4e9af3['config']['get']('ai.availableReplyActions')||[...J];_0x4e9af3['plugins']['has']('TrackChanges')||(_0x5ee80=_0x5ee80['filter'](_0x2c4259=>'insertSuggestion'!=_0x2c4259));const _0x28de5f=new Q(_0x4e9af3['locale'],{'availableActions':_0x5ee80,'showApplyButton':!0x0,'showSuggestButton':!!_0x2bf02c});return _0x28de5f['bind']('showDiff')['to'](this),_0x28de5f['delegate'](...W)['to'](this),_0x28de5f['delegate']('showPrevious','showNext')['to'](this),_0x452fad['delegate']('dialogClosed')['to'](this),_0x28de5f['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x28de5f['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x28de5f['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x2bf02c&&_0x28de5f['bind']('isTrackChangesOn')['to'](_0x2bf02c,'value'),_0x28de5f['render'](),_0x28de5f;}['_toggleRotatorButtonsInDialogHeader'](_0x22a8b4){const _0x145099=this['editor'],_0x49040b=_0x145099['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x22a8b4),_0x49040b['has'](this['_chatBalloonView']['previousButtonView'])||(_0x49040b['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x145099['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x49040b['remove'](this['_chatBalloonView']['previousButtonView']),_0x49040b['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class AIEditorIntegration extends _0x361c0d{static get['requires'](){return[Pt,qt,zt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Zt(_0x46b734){const {editor:_0x5a83b6,action:_0xc822ad,withText:_0x3b5700=!0x1,withIcon:_0x50bd81=!0x0,isInDropdown:_0x144280=!0x0,shouldPreventFocus:_0x1097b6=!0x1}=_0x46b734;return()=>{const _0x55dee1=_0x5a83b6['locale'],_0x54610b=new _0x2cf640(_0x55dee1),_0x308e17=_0x54610b['bindTemplate'];_0x144280&&_0x54610b['extendTemplate']({'on':{'mouseenter':_0x308e17['to'](()=>{_0x1097b6&&_0x1097b6()||_0x54610b['focus']();})}});const _0x2943df=_0xc822ad['icon']??_0xc822ad['parent']?.['icon'];return _0x54610b['set']({'label':_0xc822ad['displayedPrompt'],'withText':_0x3b5700,'role':'menuitem','icon':_0x50bd81?_0x2943df??yt:void 0x0,'tooltip':!_0x3b5700,'class':'ck-ai-quick-actions-button','isEnabled':_0xc822ad['isEnabled']}),_0x54610b['on']('execute',()=>{_0x5a83b6['editing']['view']['focus'](),_0x5a83b6['commands']['execute']('aiQuickAction',_0xc822ad);}),_0x54610b;};}class Ps extends _0x4e6947{['arrowView'];constructor(_0x401c71,_0x705e26){super(_0x401c71,_0x705e26);const _0x3473c5=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',_0x34f9c8=>String(_0x34f9c8)),'data-cke-tooltip-disabled':_0x3473c5['to']('isOn')},'on':{'mouseenter':_0x3473c5['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0xe69d46=new _0x59b3d9();return _0xe69d46['content']=_0x468b06,_0xe69d46['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0xe69d46;}}class Ls extends _0x163c9e{['_allListItems'];['_allSearchableItems'];constructor(_0x4c9aa3,_0x45ce8d,_0x302c8e){super(_0x4c9aa3),this['_allListItems']=_0x45ce8d,this['_allSearchableItems']=_0x302c8e;}['filter'](_0x5baf7f){if(!_0x5baf7f)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x512e3b=_0x5baf7f['source']['toLowerCase']()['trim'](),_0x1b1cbd=this['_allSearchableItems']['filter'](_0x1d81b2=>(_0x1d81b2['groupLabel']?_0x1d81b2['label']+'\x20('+_0x1d81b2['groupLabel']+')':_0x1d81b2['label'])['toLowerCase']()['includes'](_0x512e3b));return this['items']['clear'](),this['items']['addMany'](_0x1b1cbd['sort']((_0x58d713,_0x302cf9)=>{const _0x1a82c7=_0x58d713['groupLabel'],_0x7bab25=_0x302cf9['groupLabel'];return _0x1a82c7||_0x7bab25?_0x1a82c7?0x1:-0x1:0x0;})['map'](_0x1d0226=>_0x1d0226['item'])),this['_highlightQuery'](_0x512e3b,_0x1b1cbd),{'resultsCount':_0x1b1cbd['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x205719,_0x328c29){if(!_0x205719)return;const _0x317ca1=new RegExp(_0x15b1ec(_0x205719),'gi');_0x328c29['forEach'](_0x1b220a=>{_0x1b220a['highlightViews']&&_0x1b220a['highlightViews']['forEach'](_0x372eb9=>{'function'==typeof _0x372eb9['highlightText']&&_0x372eb9['highlightText'](_0x317ca1);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0xc7e70=>{_0xc7e70['highlightViews']&&_0xc7e70['highlightViews']['forEach'](_0x317d49=>{'function'==typeof _0x317d49['highlightText']&&_0x317d49['highlightText'](null);});});}}const Qs='menu',Gs='menuitem';class co extends _0xc3e5b1{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x1b99a0,_0x4a17a3,_0x407546,_0x3be597,_0x4889a3=!0x1){const _0x1955ac=_0x1b99a0['locale'];super(_0x1955ac),this['_bodyCollection']=_0x3be597,this['_hasSearch']=_0x4889a3;const _0x2525ec=this['_createListItems'](_0x1b99a0,_0x4a17a3,_0x407546);this['optionsListView']=new Ls(_0x1955ac,_0x2525ec,this['_allSearchableItems']),this['optionsListView']['role']=Qs,this['optionsListView']['items']['addMany'](_0x2525ec),this['focusTracker']=new _0x5f2dfb(),this['keystrokes']=new _0x15425(),_0x4889a3&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x2525ec,this['focusCycler']=new _0x1af4a5({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x4889a3&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0xb7e9=_0x4889a3&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0xf5a45d(_0xb7e9),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x1955ac['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x56da7a(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 _0x213036=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x213036);}['_createListItems'](_0x1e3d4b,_0x41f0d4,_0x30e576){const _0x30bfab=new _0xf5a45d();return _0x41f0d4['forEach'](_0x506acd=>{if('actions'in _0x506acd){const {listItem:_0x59ad6e}=this['_createActionGroupButton'](_0x1e3d4b,_0x506acd,_0x30e576);_0x30bfab['add'](_0x59ad6e),_0x506acd['actions']['forEach'](_0x6db175=>{this['_createActionButton'](_0x1e3d4b,_0x6db175,_0x506acd['label'],_0x506acd['icon']);const {listItem:_0x19f4aa,highlightViews:_0x36f3e8}=this['_createSearchResultActionButton'](_0x1e3d4b,_0x6db175,_0x506acd['label'],_0x506acd['icon']);this['_allSearchableItems']['push']({'item':_0x19f4aa,'label':_0x6db175['displayedPrompt'],'groupLabel':_0x506acd['label'],'highlightViews':_0x36f3e8});});}else{const {listItem:_0x350128}=this['_createActionButton'](_0x1e3d4b,_0x506acd);_0x30bfab['add'](_0x350128);const _0x54d369=_0x350128['children']['first'];if(_0x54d369){const {listItem:_0x42319d,highlightViews:_0x3381ab}=this['_createSearchResultActionButton'](_0x1e3d4b,_0x506acd);this['_allSearchableItems']['push']({'item':_0x42319d,'label':_0x54d369['label']||'','highlightViews':_0x3381ab});}}}),_0x30bfab;}['_createActionButton'](_0xa5c8f3,_0x26f572,_0x808dc,_0x2c8ef4){const _0x763dd2=new _0x663ac1(this['locale']);if(_0x808dc&&_0x2c8ef4){const _0x452815=new _0x2cf640(this['locale']),_0xbdd418=_0x452815['bindTemplate'],_0x3e47d6=new _0x19afdf();_0x3e47d6['text']=_0x26f572['displayedPrompt'];const _0x3d43c1=new _0x19afdf();_0x3d43c1['text']=_0x808dc;const _0x5e23aa=new _0x59b3d9();_0x5e23aa['content']=_0x2c8ef4,_0x5e23aa['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x19521a=new _0xc3e5b1(this['locale']);_0x19521a['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x4f718f=new _0xc3e5b1(this['locale']);return _0x4f718f['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x452815['set']({'label':_0x26f572['displayedPrompt']+'\x20('+_0x808dc+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x452815['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':[_0x3e47d6,_0x19521a,_0x5e23aa,_0x3d43c1,_0x4f718f],'on':{'mouseenter':_0xbdd418['to'](()=>{this['_isSearchFocused']()||_0x452815['focus']();}),'click':_0xbdd418['to'](()=>{_0x452815['fire']('execute');})}}),_0x452815['on']('execute',()=>{_0xa5c8f3['editing']['view']['focus'](),_0xa5c8f3['commands']['execute']('aiQuickAction',_0x26f572);}),_0x763dd2['children']['add'](_0x452815),{'listItem':_0x763dd2,'highlightViews':[_0x3e47d6,_0x3d43c1]};}{const _0x4f00ef=new _0x49352c(),_0x25f354=new _0x2cf640(this['locale'],_0x4f00ef),_0x539849=_0x25f354['bindTemplate'],_0x4115e5=_0x26f572['icon']??_0x26f572['parent']?.['icon'],_0x553bc2=void 0x0!==_0x26f572['icon'];return _0x25f354['set']({'label':_0x26f572['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':_0x553bc2?_0x4115e5??yt:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x25f354['extendTemplate']({'on':{'mouseenter':_0x539849['to'](()=>{this['_isSearchFocused']()||_0x25f354['focus']();})}}),_0x25f354['on']('execute',()=>{_0xa5c8f3['editing']['view']['focus'](),_0xa5c8f3['commands']['execute']('aiQuickAction',_0x26f572);}),_0x763dd2['children']['add'](_0x25f354),{'listItem':_0x763dd2,'highlightViews':[_0x4f00ef]};}}['_createSearchResultActionButton'](_0x4495ad,_0x35a78c,_0x42eb1e,_0x13031b){return _0x42eb1e&&_0x13031b?this['_createSearchResultGroupedActionButton'](_0x4495ad,_0x35a78c,_0x42eb1e,_0x13031b):this['_createSearchResultIndividualActionButton'](_0x4495ad,_0x35a78c);}['_createSearchResultGroupedActionButton'](_0x3270c6,_0x470f83,_0x293b95,_0x201a72){const _0x18782c=new _0x663ac1(this['locale']),_0x267d9e=new _0x2cf640(this['locale']),_0x11a5ea=_0x267d9e['bindTemplate'],{view:_0xc6109d,highlightView:_0x5527ac}=this['_createSearchResultGroupRow'](_0x293b95,_0x201a72),{view:_0x148700,highlightView:_0x534066}=this['_createSearchResultActionRow'](_0x470f83['displayedPrompt']),_0x5da2dc=this['_createSearchResultContentView'](_0xc6109d,_0x148700);return _0x267d9e['set']({'label':_0x470f83['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}),_0x267d9e['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':[_0x5da2dc],'on':{'mouseenter':_0x11a5ea['to'](()=>{this['_isSearchFocused']()||_0x267d9e['focus']();}),'click':_0x11a5ea['to'](()=>{this['_handleSearchResultButtonClick'](_0x267d9e);})}}),this['_setupActionButtonExecution'](_0x267d9e,_0x3270c6,_0x470f83),_0x18782c['children']['add'](_0x267d9e),{'listItem':_0x18782c,'highlightViews':[_0x5527ac,_0x534066]};}['_createSearchResultIndividualActionButton'](_0x158acc,_0x133cbd){const _0xdd610=new _0x663ac1(this['locale']),_0x5565c5=new _0x49352c(),_0x1e9d35=new _0x2cf640(this['locale'],_0x5565c5),_0x317233=_0x1e9d35['bindTemplate'];return _0x1e9d35['set']({'label':_0x133cbd['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x1e9d35['extendTemplate']({'on':{'mouseenter':_0x317233['to'](()=>{this['_isSearchFocused']()||_0x1e9d35['focus']();})}}),this['_setupActionButtonExecution'](_0x1e9d35,_0x158acc,_0x133cbd),_0xdd610['children']['add'](_0x1e9d35),{'listItem':_0xdd610,'highlightViews':[_0x5565c5]};}['_createSearchResultGroupRow'](_0x56fb92,_0x11f3c1){const _0x579709=new _0xc3e5b1(this['locale']),_0x33fcd5=new _0x59b3d9();_0x33fcd5['content']=_0x11f3c1,_0x33fcd5['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x25be7c=new _0x19afdf();return _0x25be7c['text']=_0x56fb92,_0x579709['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x33fcd5,_0x25be7c]}),{'view':_0x579709,'highlightView':_0x25be7c};}['_createSearchResultActionRow'](_0x18429e){const _0xf9c7eb=new _0xc3e5b1(this['locale']),_0x3a017f=new _0x19afdf();return _0x3a017f['text']=_0x18429e,_0xf9c7eb['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x3a017f]}),{'view':_0xf9c7eb,'highlightView':_0x3a017f};}['_createSearchResultContentView'](_0x525ae7,_0x8a9c15){const _0x3e3cf8=new _0xc3e5b1(this['locale']);return _0x3e3cf8['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x525ae7,_0x8a9c15]}),_0x3e3cf8;}['_setupActionButtonExecution'](_0x18d183,_0x5817cf,_0x3d7ca0){_0x18d183['on']('execute',()=>{_0x5817cf['editing']['view']['focus'](),_0x5817cf['commands']['execute']('aiQuickAction',_0x3d7ca0);});}['_createActionGroupButton'](_0x5b9471,_0x5a5f51,_0xa299c7){const _0x2922a7=new _0x663ac1(this['locale']),_0x57bf85=new _0x49352c(),_0x4971aa=new Ps(this['locale'],_0x57bf85),_0x233216=_0x4971aa['bindTemplate'],_0x5f47f3=this['_getPanelKeystroke'](_0xa299c7),_0x516cc3=this['_createGroupActionsList'](_0x5b9471,_0x5a5f51['actions'],_0xa299c7);_0x4971aa['set']({'label':_0x5a5f51['label'],'withText':!0x0,'role':Gs,'icon':_0x5a5f51['icon']??yt,'isEnabled':_0x5a5f51['actions']['some'](_0x586a30=>_0x586a30['isEnabled'])}),_0x4971aa['extendTemplate']({'on':{'mouseenter':_0x233216['to'](()=>{this['_isSearchFocused']()||_0x4971aa['focus']();})}});const _0x24416c=new _0x5442ef(this['locale']);return _0x24416c['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x233216['to'](_0x7758e3=>{this['_handlePanelKeydown'](_0x7758e3,_0x5f47f3,_0x4971aa,_0x24416c);})}}),_0x4971aa['bind']('isOn')['to'](_0x24416c,'isVisible'),this['_bodyCollection']['add'](_0x24416c),_0x24416c['content']['add'](_0x516cc3),this['_setupGroupMenuBehavior'](_0x4971aa,_0x24416c),_0x2922a7['children']['add'](_0x4971aa),{'listItem':_0x2922a7,'highlightView':_0x57bf85};}['_createGroupActionsList'](_0xa7c351,_0x5d7c9c,_0x241123){const _0x4690b0=new _0x163c9e(this['locale']);return _0x4690b0['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x5d7c9c['forEach'](_0x37dfaa=>{const _0x2b5921=new _0x663ac1(this['locale']),_0x41ad67=Zt({'editor':_0xa7c351,'action':_0x37dfaa,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x2b5921['children']['add'](_0x41ad67),_0x241123['focusTracker']['add'](_0x41ad67),_0x4690b0['items']['add'](_0x2b5921);}),_0x4690b0;}['_setupGroupMenuBehavior'](_0x6c065d,_0x242177){const _0x36db90=_0x6c065d['bindTemplate'],_0x38045e=this['_getButtonKeystroke'](_0x6c065d);_0x6c065d['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x36db90['to'](()=>{this['_showNestedPanel'](_0x242177,_0x6c065d);}),'mouseleave':_0x36db90['to'](_0x12ffdb=>{const _0xd364f1=_0x12ffdb['relatedTarget'];this['_isMovingToNestedMenu'](_0xd364f1,_0x242177)||this['_hideNestedPanel'](_0x242177);}),'keydown':_0x36db90['to'](_0x3f5b32=>{_0x3f5b32['key']==_0x38045e&&(this['_showNestedPanel'](_0x242177,_0x6c065d),_0x242177['content']['get'](0x0)['focus']());})}}),_0x242177['on']('render',()=>{_0x242177['element']?.['addEventListener']('mouseleave',_0x260204=>{const _0x3976bb=_0x260204['relatedTarget'];_0x6c065d['element']?.['contains'](_0x3976bb)||this['_isMovingToNestedMenu'](_0x3976bb,_0x242177)||this['_hideNestedPanel'](_0x242177);});});}['_showNestedPanel'](_0x4bb850,_0x45f4cf){this['_openNestedPanels']['forEach'](_0xc1da15=>{_0xc1da15!==_0x4bb850&&_0xc1da15['isVisible']&&_0xc1da15['hide']();}),_0x4bb850['show'](),_0x4bb850['pin']({'positions':[_0x3770f5['eastSouth']],'target':_0x45f4cf['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x4bb850);}['_hideNestedPanel'](_0x17240a){_0x17240a['hide'](),this['_openNestedPanels']['delete'](_0x17240a);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x79b9b9=>_0x79b9b9['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x46eca2,_0x1facf7){if(!_0x46eca2)return!0x1;if(_0x1facf7['element']?.['contains'](_0x46eca2))return!0x0;const _0x1c4eb8=_0x46eca2;return _0x1c4eb8['closest']&&(null!==_0x1c4eb8['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x1c4eb8['closest']('.ck-ai-quick-actions-group-list')||null!==_0x1c4eb8['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'](_0x3dc55e){return'rtl'===_0x3dc55e['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x4e2265){return'rtl'===_0x4e2265['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x21b517,_0x36e23f,_0x5e65f0,_0x30209c){_0x21b517['key']==_0x36e23f&&(_0x5e65f0['focus'](),this['_hideNestedPanel'](_0x30209c));}['_handleSearchResultButtonClick'](_0x46c3ce){_0x46c3ce['fire']('execute');}}function Xt(_0x2a2ee4){const {editor:_0x43ff24,content:_0x203d34,buttonDefinition:_0x56f59a,bodyCollection:_0x58c06c,hasSearch:_0xb071bb=!0x1}=_0x2a2ee4;return()=>{const _0x50decf=_0x43ff24['locale'],_0x4222be=_0x3e48f8(_0x50decf);_0x4222be['buttonView']['set']({'icon':_0x56f59a['icon']??yt,'label':_0x56f59a['label'],'tooltip':!0x0}),_0x4222be['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x4e59d1=new co(_0x43ff24,_0x203d34,_0x4222be,_0x58c06c,_0xb071bb);if(_0x4222be['panelView']['children']['add'](_0x4e59d1),_0xb071bb){const _0x32c25e='ai-quick-actions-dropdown-selection';_0x4222be['on']('change:isOpen',(_0x210ce7,_0x5a74fc,_0x2bd892)=>{if(_0x2bd892){if(_0x43ff24['plugins']['has']('AIEditing')){const _0x48101c=_0x43ff24['plugins']['get'](D),_0x4fa74c=_0x43ff24['model']['document']['selection'],_0xbc72b9=Array['from'](_0x4fa74c['getRanges']());_0xbc72b9['length']>0x0&&_0x48101c['showFakeVisualSelection'](_0xbc72b9,_0x32c25e,!0x1,!0x0);}}else _0x43ff24['plugins']['has']('AIEditing')&&_0x43ff24['plugins']['get'](D)['hideFakeVisualSelection'](_0x32c25e),_0x4e59d1['resetSearch']();});}return _0x4222be;};}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(_0xe40bcd){return _0xe40bcd['CHAT']='CHAT',_0xe40bcd['ACTION']='ACTION',_0xe40bcd['REVIEW']='REVIEW',_0xe40bcd;}({}),va=function(_0x2d8fb0){return _0x2d8fb0['CHAT']='AIChat',_0x2d8fb0['ACTION']='AIActions',_0x2d8fb0['REVIEW']='AIReviewMode',_0x2d8fb0;}({});class ii extends _0x361c0d{static get['requires'](){return[te,tt];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x5f56a1=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x5f56a1),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x5e96fd){return function(_0x2696b3){const _0x307a29=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x2696b3['uiLanguage']),_0x16d77a=_0x307a29||'English',_0x10bcee=[{'id':'ask-ai','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Gt},{'id':'chat-commands','label':i(_0x2696b3,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Gt,'actions':[{'id':'explain','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':ee['replace']('%0',_0x16d77a),'type':'CHAT'},{'id':'summarize','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':ie['replace']('%0',_0x16d77a),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':ne['replace']('%0',_0x16d77a),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Bt},{'id':'continue','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Ft},{'id':'fix-grammar','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Wt},{'id':'adjust-length','label':i(_0x2696b3,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Kt,'actions':[{'id':'make-shorter','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':i(_0x2696b3,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Yt,'actions':[{'id':'make-tone-casual','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Vt,'actions':[{'id':'translate-to-english','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':i(_0x2696b3,'AI_QUICK_ACTIONS_OTHER'),'icon':Jt,'actions':[]}];return _0x10bcee;}(_0x5e96fd);}async['_getDefaultAndCustomActions'](){const _0x32ff41=ii['getDefaultQuickActions'](this['editor']['locale']),_0x2db346=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x42d863=[];try{_0x42d863=await new et({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0x173d6a){const _0xad54aa=new _0x563e6a('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x173d6a});_0x4e5dbd(_0xad54aa['message']);}finally{const _0xe191f4=_0x2db346['map'](_0xaef8bc=>({..._0xaef8bc,'icon':void 0x0}));_0x32ff41['find'](_0x528f7b=>'other'===_0x528f7b['id'])['actions']['push'](..._0xe191f4),_0x32ff41['forEach'](_0x1438b1=>{if('actions'in _0x1438b1)_0x1438b1['actions']['forEach'](_0x1fd2fd=>{if(_0x1fd2fd['isEnabled']=!!_0x42d863['find'](_0x17c046=>_0x17c046['id']===_0x1fd2fd['model'])||void 0x0===_0x1fd2fd['model'],!_0x1fd2fd['isEnabled']){const _0xe15711=new _0x563e6a('ai-quick-actions-unavailable-model',this,{'actionId':_0x1fd2fd['id'],'modelId':_0x1fd2fd['model']});_0x4e5dbd(_0xe15711['message']);}});else{if(_0x1438b1['isEnabled']=!!_0x42d863['find'](_0x2b4cb7=>_0x2b4cb7['id']===_0x1438b1['model'])||void 0x0===_0x1438b1['model'],!_0x1438b1['isEnabled']){const _0x4c63e1=new _0x563e6a('ai-quick-actions-unavailable-model',this,{'actionId':_0x1438b1['id'],'modelId':_0x1438b1['model']});_0x4e5dbd(_0x4c63e1['message']);}}});}return _0x32ff41;}['_initializeQuickActionsComponentsAndCommands'](){const _0x689a0=new _0x340c25(this['editor']['locale']);_0x689a0['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x689a0),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x689a0);}['_initializeQuickActionsDropdown'](_0x21e35f){const _0x43d17f=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Xt({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':yt,'label':i(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x21e35f,'hasSearch':_0x43d17f}));}['_prepareQuickActionsDefinition'](_0x3f7009){this['_quickActionsDefinition']=_0x3f7009['map'](_0x295004=>{if('actions'in _0x295004){const _0x395cd2=_0x295004;return{..._0x395cd2,'actions':_0x395cd2['actions']['map'](_0x1d5828=>{const {actions:_0x88eaf4,..._0x41cc81}=_0x395cd2;return{..._0x1d5828,'parent':_0x41cc81};})['filter'](_0xb1549d=>this['_shouldIncludeAction'](_0xb1549d))};}return _0x295004;})['filter'](_0x2de977=>'actions'in _0x2de977?_0x2de977['actions']['length']>0x0:this['_shouldIncludeAction'](_0x2de977));}['_shouldIncludeAction'](_0x1265eb){const _0xc21b=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](va[_0x1265eb['type']])&&!_0xc21b['includes'](_0x1265eb['id'])&&!('CHAT'===_0x1265eb['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x4d3361){this['_quickActionsDefinition']['forEach'](_0x2fb7aa=>{if('actions'in _0x2fb7aa){const _0x50692e=Xt({'editor':this['editor'],'content':_0x2fb7aa['actions'],'buttonDefinition':_0x2fb7aa,'bodyCollection':_0x4d3361});this['editor']['ui']['componentFactory']['add'](_0x2fb7aa['id'],_0x50692e),_0x2fb7aa['actions']['forEach'](_0x4572d2=>{const _0x36d179=Zt({'editor':this['editor'],'action':_0x4572d2});this['editor']['ui']['componentFactory']['add'](_0x4572d2['id'],_0x36d179);});}else{const _0x5d9c84=Zt({'editor':this['editor'],'action':_0x2fb7aa,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x2fb7aa['id'],_0x5d9c84);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x586367=>{const _0x37ef7b=new _0x580086(_0x586367),_0x4b2ac1=i(_0x586367,'AI_QUICK_ACTIONS_HEADING');_0x37ef7b['buttonView']['set']({'label':_0x4b2ac1,'icon':yt});const _0x171431=new _0x3dd394(_0x586367);_0x171431['set']({'ariaLabel':_0x4b2ac1,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x27653e=>{if('actions'in _0x27653e){const _0x426d0f=_0x27653e,_0x4f5ecf=new _0x30af6d(_0x586367,_0x37ef7b),_0x38ce47=new _0x580086(_0x586367),_0x285163=new _0x3dd394(_0x586367);_0x38ce47['buttonView']['set']({'label':_0x426d0f['label'],'icon':_0x426d0f['icon']}),_0x426d0f['actions']['forEach'](_0x2ad858=>{const _0x263384=new _0x30af6d(_0x586367,_0x38ce47),_0x3448b8=new _0x226c2e(_0x586367);_0x3448b8['set']({'label':_0x2ad858['displayedPrompt'],'icon':_0x2ad858['icon'],'role':'menuitem','isEnabled':_0x2ad858['isEnabled']}),_0x3448b8['on']('execute',()=>{this['_executeQuickAction'](_0x2ad858);}),_0x3448b8['delegate']('execute')['to'](_0x38ce47),_0x263384['children']['add'](_0x3448b8),_0x285163['items']['add'](_0x263384);}),_0x38ce47['panelView']['children']['add'](_0x285163),_0x4f5ecf['children']['add'](_0x38ce47),_0x171431['items']['add'](_0x4f5ecf);}else{const _0x60e745=_0x27653e,_0xf6397f=new _0x30af6d(_0x586367,_0x37ef7b),_0x23e568=new _0x226c2e(_0x586367);_0x23e568['set']({'label':_0x60e745['displayedPrompt'],'icon':_0x60e745['icon'],'role':'menuitem','isEnabled':_0x60e745['isEnabled']}),_0x23e568['on']('execute',()=>{this['_executeQuickAction'](_0x60e745);}),_0x23e568['delegate']('execute')['to'](_0x37ef7b),_0xf6397f['children']['add'](_0x23e568),_0x171431['items']['add'](_0xf6397f);}});const _0x4f95d1=Object['values'](va)['some'](_0x1a2514=>this['editor']['plugins']['has'](_0x1a2514));return _0x37ef7b['set']({'isEnabled':_0x4f95d1}),_0x37ef7b['panelView']['children']['add'](_0x171431),_0x37ef7b;});}['_executeQuickAction'](_0x5e4a8a){const _0x34930c=this['editor'];_0x34930c['editing']['view']['focus'](),_0x34930c['commands']['execute']('aiQuickAction',_0x5e4a8a);const _0x3f855a=_0x34930c['ui']['view']['menuBarView'];_0x3f855a&&_0x3f855a['close']&&_0x3f855a['close']();}}class ci extends Lt{['execute'](_0x43c141){switch(this['_expandSelectionIfCollapsed'](),_0x43c141['type']){case Qt['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x5bf322=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x563e6a('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5bf322});}this['_handleAIChatAction'](_0x43c141);break;case Qt['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x47e110=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x563e6a('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x47e110});}this['_handleAIActionsAction'](_0x43c141);break;case Qt['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x6cb88e=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x563e6a('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x6cb88e});}this['_handleAIReviewAction'](_0x43c141);}}async['_handleAIChatAction'](_0x52ad2e){const _0x5e3c04=this['editor']['plugins']['get']('AIChat'),_0x2f5e10=this['editor']['plugins']['get']('AIChatController'),_0x557572=this['editor']['plugins']['get']('AITabs')['view'];if(_0x557572['isVisible']||(_0x557572['isVisible']=!0x0),'chat'!==_0x557572['activeTab']&&_0x557572['activateTab']('chat'),'ask-ai'===_0x52ad2e['id'])_0x2f5e10['removeSelectionFromChatContext'](),await _0x5e3c04['addSelectionToChatContext'](),_0x5e3c04['focusPromptInput']();else await _0x5e3c04['startConversation'](),_0x2f5e10['removeSelectionFromChatContext'](),await _0x5e3c04['addSelectionToChatContext'](),_0x5e3c04['focusPromptInput'](),await _0x5e3c04['sendMessage']({'message':_0x52ad2e['prompt']||_0x52ad2e['displayedPrompt'],'attributes':{'quickActionData':{'id':_0x52ad2e['id']},'displayedPrompt':_0x52ad2e['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x2de3da=this['editor'],_0x135595=_0x2de3da['model']['document']['selection'];if(!_0x135595['isCollapsed'])return;const _0x74579c=_0x42aa06(_0x135595['getSelectedBlocks']())||_0x2de3da['model']['schema']['getLimitElement'](_0x135595);_0x2de3da['model']['change'](_0x5c8601=>{_0x5c8601['setSelection'](_0x74579c,'in');});}['_handleAIActionsActionLabel'](_0x59fbcb){return _0x59fbcb['parent']?.['label']&&'other'!==_0x59fbcb['parent']?.['id']?_0x59fbcb['parent']['label']+':\x20'+_0x59fbcb['displayedPrompt']:_0x59fbcb['displayedPrompt'];}async['_handleAIActionsAction'](_0x500d6e){const _0x487e64=this['editor']['plugins']['get']('AIActions'),_0xa1f8c3=_0x500d6e['prompt']?{'userMessage':_0x500d6e['prompt'],'model':_0x500d6e['model']}:{'actionName':_0x500d6e['actionName']||_0x500d6e['id'],'args':_0x500d6e['args']},_0x47e271=this['_handleAIActionsActionLabel'](_0x500d6e);await _0x487e64['executeAction'](_0xa1f8c3,_0x47e271,_0x500d6e['icon']);}async['_handleAIReviewAction'](_0x29ad2d){console['log']('handleAIReviewAction',_0x29ad2d);}}class ti extends _0x361c0d{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x327d7d=this['editor'],_0x17867f=new ci(this['editor']);if(_0x327d7d['commands']['add']('aiQuickAction',_0x17867f),_0x327d7d['plugins']['has']('AIChat')){const _0x1ad575=this['editor']['plugins']['get']('AIChat');_0x327d7d['model']['document']['selection']['on']('change:range',(_0x13fc09,_0x4e31f2)=>{_0x4e31f2['directChange']&&_0x1ad575['removeSelectionFromChatContext']();});}}}class gs extends xi{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x5ed329=this['documentContextContent']['children']['map'](_0x1e0138=>({'node':_0x1e0138,'id':ut(_0x1e0138,'data-id')})),_0x40f9bb=this['parsedMergedContent']['children']['map'](_0x13b29b=>({'node':_0x13b29b,'id':ut(_0x13b29b,'data-id')||_0x48eb5e()})),_0x1af15b=_0x411a1f(_0x5ed329,_0x40f9bb,{'comparator':(_0x59f3e5,_0x57072b)=>_0x59f3e5['id']==_0x57072b['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x1af15b['length']&&_0x1af15b[_0x1af15b['length']-0x1]['removed'];)_0x1af15b['pop']();}const _0x857260=_0x1af15b['map'](_0x5146bd=>{const _0x473733=_0x5146bd['added']?'new':_0x5146bd['removed']?'removed':'modified';return{'node':_0x5146bd['value'][0x0]['node'],'type':_0x473733,'id':_0x5146bd['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x857260,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x566509,_0x52a27c){return _0x52a27c;}}class ft extends os{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x2330d8){super(_0x2330d8),this['content']=_0x2330d8['content'],this['version']=_0x2330d8['version'],this['actionName']=_0x2330d8['actionName'],this['args']=_0x2330d8['args'],this['userMessage']=_0x2330d8['userMessage'],this['model']=_0x2330d8['model'];}async['sendRequest'](){return this['actionName']?this['connector']['executeAction']({'content':this['content'],'actionName':this['actionName'],'args':this['args']}):this['connector']['executeCustomAction']({'content':this['content'],'message':this['userMessage'],'model':this['model'],'outputFormat':'html'});}['getDocumentContext'](){return{'type':xe['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x5a4959){const _0x93d611=new gs({'editor':this['editor'],'documentContextContent':this['content'],..._0x5a4959});return this['replies']['push'](_0x93d611),_0x93d611['delegate'](...De)['to'](this),this['fire']('replyCreated',_0x93d611),_0x93d611;}}class Bn extends _0x14c71e{constructor(_0x4b0f1a,_0x9ac714=!0x0,_0x2a6768=!0x0){super(_0x4b0f1a),this['set']('isEnabled',!0x1),_0x9ac714&&(this['applyButton']=this['_createButton'](i(_0x4b0f1a,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x2a6768&&(this['suggestButton']=this['_createButton'](i(_0x4b0f1a,'AI_BALLOON_SUGGEST_BUTTON'),_0x9ac714?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x9ac714,'showSuggestButton':_0x2a6768}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x3f0a4e,showSuggestButton:_0x3ff4fe}){this['applyButton']&&(this['applyButton']['isVisible']=_0x3f0a4e),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x3ff4fe);}['_createButton'](_0xd5209d,_0xd67b98){const _0x64226b=new _0x2cf640(this['locale']);return _0x64226b['set']({'label':_0xd5209d,'class':_0xd67b98,'isVisible':!0x0,'withText':!0x0}),_0x64226b;}}class yn extends _0xc3e5b1{constructor(_0x53d478){super(_0x53d478),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(_0x53d478,'AI_DISCLAIMER_TEXT')}]}]});}}class Nn extends _0xc3e5b1{constructor(_0x112b89){super(_0x112b89),this['set']('isVisible',!0x0);const _0x27ef00=new Ze('small');_0x27ef00['isVisible']=!0x0;const _0x12146c=new _0xc3e5b1(this['locale']);_0x12146c['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',_0x40efbb=>!_0x40efbb)]},'children':[_0x27ef00,_0x12146c]});}}class Tt extends pi{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0xf7bf0d,_0x384af7){super(_0xf7bf0d),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x384af7,this['_focusTracker']=new _0x5f2dfb(),this['_keystrokes']=new _0x15425(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x1af4a5({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0xf5a45d(),this['_addContentWrapper'](_0x384af7),this['_addDisclaimerView'](),this['_addToolbar'](_0x384af7),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'](_0x384af7);});}['render'](){super['render']();for(const _0x248ca2 of this['_focusables'])this['_focusTracker']['add'](_0x248ca2['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x140cab){-0x1===_0x140cab?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x20418b){this['_isLoading']=_0x20418b;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x130398){super['showError'](_0x130398),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x699e57){super['showBlockingError'](_0x699e57),this['setErrorState']();}['addMiniToolbarItem'](_0x59174c){this['_miniToolbarView']['items']['has'](_0x59174c)||this['_miniToolbarView']['items']['add'](_0x59174c);}['removeMiniToolbarItem'](_0x174d17){this['_miniToolbarView']['items']['has'](_0x174d17)&&this['_miniToolbarView']['items']['remove'](_0x174d17);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x46db8a,showSuggestButton:_0x2d797f}){_0x46db8a=_0x46db8a&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x2d797f=_0x2d797f&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x46db8a,'showSuggestButton':_0x2d797f});}async['updateContent'](_0x270ab4){await this['_streamableContentView']['update'](_0x270ab4);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x46c4d8){this['_contentWrapper']=new _0xc3e5b1(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'](_0x46c4d8['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new yn(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x449065,showSuggestButton:_0x3abbfa}){this['_toolbarView']=new Bn(this['locale'],_0x449065,_0x3abbfa),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',(_0x2a7633,_0x161b62,_0x3b32e4)=>!(_0x2a7633||_0x161b62||_0x3b32e4)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x449065,'showSuggestButton':_0x3abbfa}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x91c38d){return this['_miniToolbarView']=new wi(this['locale'],_0x91c38d),this['_miniToolbarView']['delegate'](...W)['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',(_0x5e28e2,_0x211a1d)=>!(_0x5e28e2||_0x211a1d)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new Nn(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new ui(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x5a3620=new _0x2cf640(this['locale']),_0x2480e8=new _0x2cf640(this['locale']),_0x2fdff9=new AIActionsBalloonNavigationCounterView(this['locale']),_0x3f564=new _0x2cf640(this['locale']);_0x5a3620['set']({'icon':_0x42e42d,'label':i(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x2480e8['set']({'icon':_0x5d4f8c,'tooltip':i(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x3f564['set']({'icon':_0x254ba8,'tooltip':i(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x5a3620['bind']('isEnabled')['to'](this,'isBusy',_0x37b23a=>!_0x37b23a),_0x5a3620['on']('execute',()=>{this['fire']('tryAgain');}),_0x2480e8['bind']('isEnabled')['to'](this,'isBusy',_0x36e150=>!_0x36e150),_0x2480e8['on']('execute',()=>{this['fire']('showPrevious');}),_0x3f564['bind']('isEnabled')['to'](this,'isBusy',_0x4c4f09=>!_0x4c4f09),_0x3f564['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x2480e8,this['_navigationCounter']=_0x2fdff9,this['_navigationNextButton']=_0x3f564,this['_navigationTryAgainButton']=_0x5a3620;}['updateMiniToolbarButtons'](_0x5af9c7,_0x17d5ba){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x40c8dd=_0x5af9c7>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x40c8dd){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x1d8e0f=_0x5af9c7-_0x17d5ba;this['_navigationCounter']['setInteractionCount'](_0x1d8e0f+'/'+_0x5af9c7),this['_navigationPreviousButton']['isEnabled']=_0x17d5ba<_0x5af9c7-0x1,this['_navigationNextButton']['isEnabled']=_0x17d5ba>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'](_0x1c1950){this['_isLoading']=_0x1c1950;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x24b7b4=this['_getScrollableElement']();_0x24b7b4&&!this['_scrollManager']&&(this['_scrollManager']=new Qe(_0x24b7b4));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class AIActionsBalloonNavigationCounterView extends _0xc3e5b1{constructor(_0x28280e){super(_0x28280e);const _0x1778aa=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x1778aa['to']('interactionCount')}]});}['setInteractionCount'](_0x6e8e99){this['set']('interactionCount',_0x6e8e99);}}class ri extends _0x361c0d{static get['requires'](){return[tt,_0x3a1450,D,H,ot];}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(_0x44927d){super(_0x44927d),this['_bodyCollection']=new _0x340c25(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new St();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x5ce5ad,_0x309b9c,_0x2175af){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x47d2a9,anchorData:_0x4e381f}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x5ce5ad,_0x47d2a9,_0x4e381f,_0x309b9c,_0x2175af);}}const {modelFragment:_0x349672,anchorData:_0x2fc015}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x5ce5ad,_0x349672,_0x2fc015,_0x309b9c,_0x2175af);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x2d909d=this['editor']['plugins']['has']('TrackChanges');let _0x1b2637=this['editor']['config']['get']('ai.availableReplyActions')||[...J];_0x2d909d||(_0x1b2637=_0x1b2637['filter'](_0x35865c=>'insertSuggestion'!=_0x35865c));const _0x147ca4=this['editor']['commands']['get']('trackChanges'),_0x5d3b38=new Tt(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x2d909d,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x1b2637});return _0x5d3b38['bind']('isBusy')['to'](this),_0x147ca4&&_0x5d3b38['bind']('isTrackChangesOn')['to'](_0x147ca4,'value'),_0x5d3b38['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x5d3b38['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x5d3b38['on']('showNext',()=>{this['_navigateToNext']();}),_0x5d3b38;}['_getExecuteDataRegular'](){const _0xcd128a=this['editor']['model']['document']['selection'];if(_0xcd128a['isCollapsed']){const _0x4ccfb7=_0x42aa06(_0xcd128a['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0xcd128a);this['editor']['model']['change'](_0x32a840=>{_0x32a840['setSelection'](_0x4ccfb7,'in');});}const _0x4f8228=_0xcd128a['getFirstRange'](),_0x3eb8fe=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0xcd128a),_0x4f8228['start'],_0x4f8228['end']);this['_copyMarkersToFragment'](_0x3eb8fe,_0xcd128a,{'isTableSelection':!0x1});const _0x5677dc=_0xcd128a['getFirstRange']()['start'],_0x4512ec=new Map();let _0x5a9cf7=_0x3eb8fe;for(let _0x445646=0x0;_0x445646<_0x5677dc['path']['length'];_0x445646++)_0x4512ec['set'](_0x5a9cf7,_0x5677dc['path'][_0x445646]),_0x5a9cf7=_0x5a9cf7['getChild'](0x0);return{'modelFragment':_0x3eb8fe,'anchorData':_0x4512ec};}['_getExecuteDataInTable'](){const _0x1e2d8c=this['editor']['model']['document']['selection'],_0x4fd866=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0xb7d20e=_0x1e2d8c['getFirstRange']()['start']['parent']['parent'],_0x59fa84=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0xb7d20e),this['editor']['model']['createPositionAfter'](_0xb7d20e)),_0x5779e9=this['_wrapWithCommonAncestors'](_0x4fd866,_0x59fa84['start'],_0x59fa84['end']);this['_copyMarkersToFragment'](_0x5779e9,_0x1e2d8c,{'isTableSelection':!0x0});const _0x402685=_0x1e2d8c['getFirstRange']()['start'],_0x22f60c=new Map();let _0x5e4ae2=_0x5779e9;for(let _0x12f94d=0x0;_0x12f94d<_0x402685['path']['length'];_0x12f94d++)if(_0x22f60c['set'](_0x5e4ae2,_0x402685['path'][_0x12f94d]),_0x12f94d<_0x402685['path']['length']-0x1)_0x5e4ae2=_0x5e4ae2['getChild'](0x0);else{let _0x5f4030=_0x5e4ae2['nextSibling'];for(;_0x5f4030;)_0x22f60c['set'](_0x5f4030,_0x402685['path'][_0x12f94d]),_0x5f4030=_0x5f4030['nextSibling'];}return{'modelFragment':_0x5779e9,'anchorData':_0x22f60c};}async['_executeAction'](_0x53c330,_0x11a0be,_0x27ea7c,_0x380795,_0x490d09){const _0x2aae89=this['editor']['plugins']['get'](D),_0x30df0d=this['editor']['plugins']['get'](H),_0xcf83c7=this['editor']['model']['document']['selection'],_0x25be3d=await _0x2aae89['modelToDataWithIds'](_0x11a0be),_0x311669=this['editor']['model']['document']['version'],_0x4f6906=[..._0xcf83c7['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),_0x30df0d['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x380795,'icon':_0x490d09||yt,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x4f6906,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x30df0d),this['_interactionParams']={'action':_0x53c330,'content':_0x25be3d,'version':_0x311669,'aiBalloon':_0x30df0d,'modelFragment':_0x11a0be,'anchorData':_0x27ea7c},this['_setupApplyListeners'](),this['listenTo'](_0x30df0d,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x30df0d,'dialogClosed',(_0x56c444,{id:_0x5bef28})=>{if('aiActionsBalloon'===_0x5bef28){if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x427ef0=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x215ae6=_0x427ef0['changeGroups'][0x0];_0x215ae6&&'pending'===_0x215ae6['state']&&_0x427ef0['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x30df0d);}}),this['_createInteraction'](_0x25be3d,_0x311669,_0x30df0d,_0x53c330);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x2ac4f2,anchorData:_0x48b73c}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x2ac4f2,_0x48b73c,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x2ac4f2,_0x48b73c,!0x0);});}['_wrapWithCommonAncestors'](_0x5b08f6,_0x72d138,_0x48ae3a){const _0x19338d=this['editor']['model']['createRange'](_0x72d138,_0x48ae3a)['getCommonAncestor'](),_0xac423c=_0x19338d['is']('documentFragment')?[]:_0x19338d['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0xac423c['length']){const _0x4e5b13=_0xac423c['map'](_0x4819ec=>_0x4819ec['_clone'](!0x1));for(let _0x432e29=0x1;_0x432e29<_0x4e5b13['length'];_0x432e29++)_0x4e5b13[_0x432e29-0x1]['_appendChild'](_0x4e5b13[_0x432e29]);return _0x4e5b13[_0x4e5b13['length']-0x1]['_appendChild'](_0x5b08f6),new bt(_0x4e5b13[0x0]);}return _0x5b08f6;}['_copyMarkersToFragment'](_0x34352a,_0x3a5ace,_0x5b2609={'isTableSelection':!0x1}){const _0x3b9265=this['editor']['model'],_0x228775=Array['from'](_0x3a5ace['getRanges']()),_0x491e8f=_0x3a5ace['getFirstRange']()['start'];for(const _0x1c5a2b of _0x3b9265['markers']){if(_0x1c5a2b['name']['startsWith'](R)||!_0x1c5a2b['affectsData'])continue;const _0x4ff181=_0x1c5a2b['getRange']();if(!_0x228775['some'](_0x37fae0=>_0x37fae0['containsRange'](_0x4ff181,!0x0)))continue;const _0x174a37=this['_regularCalculateMarkerPath'](_0x4ff181['start'],_0x491e8f,_0x5b2609['isTableSelection']),_0x5b4f96=this['_regularCalculateMarkerPath'](_0x4ff181['end'],_0x491e8f,_0x5b2609['isTableSelection']),_0x2e5e4d=_0x3b9265['createPositionFromPath'](_0x34352a,_0x174a37),_0xfaaf61=_0x3b9265['createPositionFromPath'](_0x34352a,_0x5b4f96);if(!_0x2e5e4d['isEqual'](_0xfaaf61)){const _0x29bbf8=_0x3b9265['createRange'](_0x2e5e4d,_0xfaaf61);_0x34352a['markers']['set'](_0x1c5a2b['name'],_0x29bbf8);}}}['_regularCalculateMarkerPath'](_0x57a5bb,_0x146a4a,_0x20fb5e=!0x1){const _0x3e8d45=[..._0x57a5bb['path']['slice']()];for(let _0x571c8c=0x0;_0x571c8c<Math['max'](_0x146a4a['path']['length'],_0x57a5bb['path']['length']);_0x571c8c++){const _0x52f1f6=_0x146a4a['path'][_0x571c8c]||0x0,_0x2aed4c=(_0x57a5bb['path'][_0x571c8c]||0x0)-_0x52f1f6;if(_0x3e8d45[_0x571c8c]=_0x2aed4c,0x0!==_0x2aed4c&&!_0x20fb5e)break;}return _0x3e8d45;}async['_createInteraction'](_0x2c9739,_0x3a2b61,_0x535cf3,_0x267f6e){const _0x4f9c95=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x267f6e,'content':_0x2c9739,'version':_0x3a2b61,'aiBalloon':_0x535cf3,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x5ca080=new ft({'connector':this['_aiConnector'],'editor':_0x4f9c95,'content':_0x2c9739,'version':_0x3a2b61,..._0x267f6e});this['_interactions']['push'](_0x5ca080);const _0x23443c=(_0x4e65ce,_0x4d542d=!0x1,_0x3bdaa1='streaming')=>this['_promiseQueue']['enqueue'](async _0x4d8274=>{try{const _0xf7b426=wt({'editor':_0x4f9c95,'changeGroups':_0x4e65ce['changeGroups'],'documentContextContent':_0x4e65ce['documentContextContent'],'showDiff':_0x4d542d,'trimUnchanged':!0x1});_0xf7b426['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0xf7b426[0x0],'renderingStrategy':_0x3bdaa1,'abortSignal':_0x4d8274});}catch(_0x381fd2){if(this['_isAbortError'](_0x381fd2))return;throw _0x381fd2;}});this['_interaction']['on']('replyCreated',(_0x469806,_0x21af90)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x23443c(_0x21af90)['catch'](_0xad27a5=>{this['_isAbortError'](_0xad27a5)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0xad27a5),this['_setErrorState'](_0x5ca080));});}),this['_interaction']['on']('replyContentUpdated',(_0x222638,_0x541f39)=>{_0x23443c(_0x541f39)['catch'](_0x4f234a=>{this['_isAbortError'](_0x4f234a)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x4f234a),this['_setErrorState'](_0x5ca080));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x5d6861){this['_isAbortError'](_0x5d6861)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x5d6861),this['_setErrorState'](_0x5ca080));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x16434a,{showDiff:_0x462154})=>{try{this['_balloonShowDiff']=_0x462154;const _0x4e4476=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x4e4476&&await _0x23443c(_0x4e4476,_0x462154,'static');}catch(_0x2c23de){this['_isAbortError'](_0x2c23de)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x2c23de),this['_setErrorState'](_0x5ca080));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x133fa3,{reply:_0x3e8eb0})=>{const _0x3df1c2={'positiveCount':_0x3e8eb0['changeGroups']['filter'](_0x5ca5ae=>'accepted'===_0x5ca5ae['state'])['length'],'totalCount':_0x3e8eb0['changeGroups']['length']},_0x441ec4=this['_interaction']['actionCallId'],_0x234870=this['_interaction']['actionName'];_0x234870?this['_aiConnector']['upsertAIActionRating'](_0x234870,_0x441ec4,_0x3df1c2):this['_aiConnector']['upsertCustomAIActionRating'](_0x441ec4,_0x3df1c2);}),this['_setLoadingState']();try{const _0x522e75=await this['_interaction']['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x522e75;}catch(_0x4d8d70){if(this['_isAbortError'](_0x4d8d70))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x5ca080);}}['_applyChanges'](_0x46fa4c,_0x418567,_0x4e4908){const _0x584e71=this['editor'];if(_0x4e4908&&!_0x584e71['plugins']['has']('TrackChanges'))throw new _0x563e6a('ai-no-track-changes',null);const _0x2511d1=this['editor']['plugins']['get'](ot),_0x4d5d3d=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x4d5d3d||!_0x4d5d3d['replies']['length'])return;const _0x38a9d5=_0x4d5d3d['replies'][_0x4d5d3d['replies']['length']-0x1],_0x5f2666=_0x38a9d5['changeGroups'];_0x38a9d5['setChangeGroupState'](0x0,'accepted');let _0x519df1=at({'editor':_0x584e71,'reply':_0x38a9d5,'interaction':_0x4d5d3d,'groups':_0x5f2666,'transform':!0x1,'documentCompare':_0x2511d1,'documentCompareOptions':{'anchor':_0x584e71['model']['createPositionAt'](_0x46fa4c,0x0),'markDeletions':_0x4e4908}});_0x519df1=this['_filterOperationsOutsideRange'](_0x519df1,_0x418567);for(const _0x1a6fc6 of _0x519df1)this['_anchorOperation'](_0x418567,_0x1a6fc6,_0x584e71['model']['document']['getRoot']());const _0x34ef35=_0x4d5d3d['getDocumentContext']()['version'],_0x190633=_0x584e71['model']['document']['history']['getOperations'](_0x34ef35),_0x45febd={'document':_0x584e71['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0xfd69c1=kt(_0x519df1,_0x190633,_0x45febd)['operationsA'];_0x584e71['model']['change'](_0x44739a=>{if(_0x44739a['setSelection'](_0x584e71['model']['document']['selection']['focus']),_0x4e4908)_0x584e71['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0xfd69c1);else{for(const _0x174842 of _0xfd69c1)_0x174842['baseVersion']=_0x584e71['model']['document']['version'],rt(_0x584e71,_0x174842),_0x44739a['batch']['addOperation'](_0x174842),_0x584e71['model']['applyOperation'](_0x174842);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x53c8b9,_0x483a58){return _0x53c8b9['filter'](_0x16fea7=>{if('rename'==_0x16fea7['type']){const _0x5c5a4e=_0x16fea7['position']['nodeAfter'];return!_0x483a58['has'](_0x5c5a4e);}if(_0x16fea7['type']['indexOf']('Attribute')>-0x1){const _0x60661e=_0x16fea7['range']['start']['nodeAfter'];return!_0x483a58['has'](_0x60661e);}return!0x0;});}['_anchorOperation'](_0x2258e5,_0x61d3b8,_0x32f2be){const _0x5a5443=_0x61d3b8['clone']();for(const _0x396151 in _0x61d3b8){const _0x56e8cb=_0x61d3b8[_0x396151];_0x56e8cb instanceof dt?_0x61d3b8[_0x396151]=new dt(_0x5d42bb(_0x56e8cb['start']),_0x5d42bb(_0x56e8cb['end'])):_0x56e8cb instanceof vt&&(_0x61d3b8[_0x396151]=_0x5d42bb(_0x56e8cb));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x5a5443['type'])){if(_0x5a5443['isDocumentOperation']=!0x1,_0x5a5443['baseVersion']=null,'remove'==_0x5a5443['type']){const _0x3aaabc=_0x5a5443['sourcePosition'],_0x4e96b9=_0x5a5443['howMany'];new lt(_0x3aaabc,_0x4e96b9)['_execute']();}else _0x5a5443['_execute']();}function _0x5d42bb(_0x26f033){if('$graveyard'==_0x26f033['root']['rootName'])return _0x26f033;const _0x1470b9=[];let _0x5ba2f3=_0x26f033['root'];for(let _0x3915a3=0x0;_0x3915a3<_0x26f033['path']['length'];_0x3915a3++){const _0x1f1c61=_0x2258e5['get'](_0x5ba2f3)||0x0;_0x1470b9[_0x3915a3]=_0x26f033['path'][_0x3915a3]+_0x1f1c61,_0x5ba2f3=_0x5ba2f3['getChildAtOffset'](_0x26f033['path'][_0x3915a3]);}return new vt(_0x32f2be,_0x1470b9,_0x26f033['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x4b70ae,content:_0xd89bda,version:_0x58fe8c,aiBalloon:_0x47080e}=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'](_0xd89bda,_0x58fe8c,_0x47080e,_0x4b70ae)['catch'](_0x5b96e8=>{this['_isAbortError'](_0x5b96e8)||console['error']('Error\x20refreshing\x20interaction:',_0x5b96e8);});}['_isAbortError'](_0x4af103){return!!_0x4af103['message']&&_0x4af103['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 _0x36f719=this['_interactions']['length'];this['_currentInteractionIndex']<_0x36f719-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x40464f){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x40464f;const _0x5284a7=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x5284a7)return;if(_0x5284a7['hasError'])return this['_setErrorState'](_0x5284a7),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x5284a7['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x10018f=_0x5284a7['replies'][_0x5284a7['replies']['length']-0x1];if(_0x10018f){const _0x28bb96=this['editor'];try{const _0x4a57d2=wt({'editor':_0x28bb96,'changeGroups':_0x10018f['changeGroups'],'documentContextContent':_0x10018f['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x3a7b13=>setTimeout(_0x3a7b13,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x4a57d2[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0xb1a739){this['_isAbortError'](_0xb1a739)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0xb1a739);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x572dff){const _0x183419=i(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x183419),_0x572dff['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 AIQuickActions extends _0x361c0d{static get['requires'](){return[ii,ti,ri];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1771bc){super(_0x1771bc),_0x1771bc['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class Ws extends _0xc3e5b1{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x9955c3,_0x4508a0){super(_0x9955c3),this['id']=_0x4508a0,this['set']('status','pending'),this['set']('changeId',_0x4508a0),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',(_0xd45693,_0xe44a6f)=>{_0xe44a6f&&_0xe44a6f['target']&&'A'===_0xe44a6f['target']['tagName']&&_0xe44a6f['preventDefault'](),this['fire']('activateChange',{'id':_0x4508a0,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x4508a0,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x4508a0,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x1b63c0=new _0xc3e5b1(this['locale']);return _0x1b63c0['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',_0x1d02c5=>!_0x1d02c5)]}}),_0x1b63c0;}['_createAcceptButtonView'](){const _0x3b3f73=new _0x2cf640(this['locale']);return _0x3b3f73['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x3b3f73['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x513494=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x513494['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x37c590=>'pending'!==_0x37c590&&'accepted'!==_0x37c590),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-accept-button',_0x5df6ec=>'pending'===_0x5df6ec),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x3f3675=>'accepted'===_0x3f3675)]}}),this['on']('change:status',(_0x17a0f6,_0x14fc0c,_0x497532)=>{_0x3b3f73['isEnabled']='pending'===_0x497532,'accepted'===_0x497532&&(_0x3b3f73['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x3b3f73['icon']=_0x24d29c);}),_0x3b3f73;}['_createDismissButtonView'](){const _0x8bc189=new _0x2cf640(this['locale']);return _0x8bc189['set']({'label':i(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x8bc189['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x21020a=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x21020a['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary',this['bindTemplate']['if']('status','ck-hidden',_0x599e14=>'pending'!==_0x599e14&&'rejected'!==_0x599e14),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x14fbc9=>'pending'===_0x14fbc9),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x42ee49=>'rejected'===_0x42ee49)]}}),this['on']('change:status',(_0x2ee46a,_0x41691e,_0x40369e)=>{_0x8bc189['isEnabled']='pending'===_0x40369e,'rejected'===_0x40369e&&(_0x8bc189['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x8bc189['icon']=_0x4718d2);}),_0x8bc189;}['_createInfoButtonView'](){const _0x7ca6ca=new _0x2cf640(this['locale']);return _0x7ca6ca['set']({'label':i(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x169d70,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x7ca6ca['bind']('isOn')['to'](this,'isInfoToggleOn',_0x372ab9=>_0x372ab9),_0x7ca6ca['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x7ca6ca;}['_createOutdatedButtonView'](){const _0x35d218=new _0x2cf640(this['locale']);return _0x35d218['set']({'label':i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':_0x42666d,'withText':!0x0,'isEnabled':!0x1}),_0x35d218['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x4c28d6=>'outdated'!==_0x4c28d6)],'disabled':'disabled'}}),_0x35d218;}}class me extends _0x5442ef{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x445864,_0x5b1b85){super(_0x445864),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']()),_0x5b1b85['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x409839){this['resultItemView']['changeId']=_0x409839['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x409839['contentDiffed'];}['showBalloon'](_0x27b679,_0x1b2b1d,_0x4a6ab8,_0x3b8760,_0x1ccb5b,_0x387cbd){const _0x5eab9a=_0x1b2b1d();if(!_0x5eab9a)return;this['updateContent'](_0x27b679),this['show']();const _0x276b39=Array['from'](_0x5eab9a['getClientRects']())['reverse'](),_0x4b9283=this['_getPointedRectIndexFromEvent'](_0x4a6ab8,_0x276b39),_0x3e6539=_0x276b39[_0x4b9283??0x0];'click'===_0x3b8760?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x1b2b1d(),_0x4b9283,_0x27b679['id'],_0x1ccb5b,_0x387cbd)||_0x3e6539})):'hover'===_0x3b8760&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x1b2b1d(),_0x4b9283,_0x27b679['id'])||_0x3e6539}));}['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'](){_0x1d212b({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x1bab4e=[this['element']];return this['_pinnedTargetElement']&&_0x1bab4e['push'](this['_pinnedTargetElement']),_0x1bab4e;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x46bb4b=new _0xc3e5b1();return this['resultItemView']=new Ws(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x46bb4b['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']]}]}),_0x46bb4b;}['_getBestRectPositionOnClick'](_0x54011a,_0x4e41e6,_0x49d815,_0x341c50,_0x30c860){if(!_0x54011a)return null;const _0x5d4195=this['position']['replace']('arrow_',''),_0x541f76=Array['from'](_0x54011a['getClientRects']());let _0x1c4cfa,_0x11a27e=_0x541f76['reverse']();return void 0x0!==_0x4e41e6&&this['_isPinnedRectVisible'](_0x11a27e[_0x4e41e6],_0x341c50,_0x30c860)?(_0x1c4cfa=_0x11a27e[_0x4e41e6],this['_pinnedRectIndex']=_0x4e41e6):this['_isPinnedRectVisible'](_0x11a27e[0x0],_0x341c50,_0x30c860)&&void 0x0===_0x4e41e6?_0x1c4cfa=_0x11a27e[0x0]:(_0x11a27e='s'==_0x5d4195[0x0]?[..._0x541f76]['reverse']():_0x541f76,_0x11a27e['forEach'](_0x1e0b4e=>{this['_isPinnedRectVisible'](_0x1e0b4e,_0x341c50,_0x30c860)&&(_0x1c4cfa=_0x1e0b4e);})),this['_pinnedTargetChangeId']=_0x49d815,this['_pinnedTargetElement']=_0x54011a,_0x1c4cfa||_0x54011a['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x35c6d6,_0x7fd629,_0x1c43ad){if(!_0x35c6d6)return null;const _0x3e287a=Array['from'](_0x35c6d6['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x7fd629&&this['_pinnedTargetChangeId']!==_0x1c43ad)return this['_pinnedRectIndex']=_0x7fd629,this['_pinnedTargetElement']=_0x35c6d6,this['_pinnedTargetChangeId']=_0x1c43ad,_0x3e287a[_0x7fd629];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x1c43ad){if(_0x35c6d6!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x3e287a[this['_pinnedRectIndex']];}return void 0x0!==_0x7fd629&&this['_pinnedTargetChangeId']!==_0x1c43ad?(this['_pinnedRectIndex']=_0x7fd629,this['_pinnedTargetElement']=_0x35c6d6,this['_pinnedTargetChangeId']=_0x1c43ad,_0x3e287a[_0x7fd629]):_0x35c6d6['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x171f9c,_0x19d418){if(_0x171f9c)for(let _0x398aae=0x0;_0x398aae<_0x19d418['length'];_0x398aae++){const _0x22c356=_0x19d418[_0x398aae];if(_0x171f9c['clientX']>=_0x22c356['left']-0x3&&_0x171f9c['clientX']<=_0x22c356['right']+0x3&&_0x171f9c['clientY']>=_0x22c356['top']-0x3&&_0x171f9c['clientY']<=_0x22c356['bottom']+0x3)return _0x398aae;}}['_isPinnedRectVisible'](_0x18aa90,_0x3e6d6d,_0x2f85b5){const _0xb7715=new _0x4b725e(_0x18aa90),_0x5a3a56=_0x3e6d6d||document['documentElement'],_0x359946=_0xb7715['getIntersection'](_0x117236(_0x2f85b5)),_0x794fb1=new _0x4b725e(_0x5a3a56)['getIntersection'](_0xb7715);return!!(_0x359946&&_0x794fb1&&_0xb7715['width']>0x0);}}const ih=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class Me extends _0x3a5602{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[it];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x30add6){super(_0x30add6),this['_bodyCollection']=new _0x340c25(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 _0x4d308f=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x4d308f);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0xd43695){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x399cba=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0xd43695,_0x399cba);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x59f013){_0x59f013&&('error-general'!==_0x59f013['status']?'error-chunk'!==_0x59f013['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x374d73){this['_mainView']['addCheckRunResult'](_0x374d73);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x2c4b40){this['_mainView']['showGeneralReviewCoreErrorView'](_0x2c4b40??i(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x19d4ac,_0x53c87f){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x19d4ac,_0x53c87f);}['setActiveStateInResults'](_0x58ddc2){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x1f61da=>{_0x1f61da['id']===_0x58ddc2&&_0x1f61da['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x4c8381=>_0x4c8381['setItemAsInactive']());}['updateChangeState'](_0x47f780,_0x371a44){'accepted'===_0x371a44||'rejected'===_0x371a44||'outdated'===_0x371a44?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x47f780,_0x371a44):this['_mainView']['reviewCheckResultsView']['showResult'](_0x47f780,_0x371a44);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x223196,_0x5a10f,_0x3c3906,_0x38c665,_0x2bf4c9,_0x26a534){this['_balloonSuggestionView']['showBalloon'](_0x223196,_0x5a10f,_0x3c3906,_0x38c665,_0x2bf4c9,_0x26a534);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x54e96c){const _0x46ab32=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x274198=>_0x274198['id']===_0x54e96c);return _0x46ab32?_0x46ab32['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class sh extends _0xc3e5b1{constructor(_0x40d4e6){super(_0x40d4e6),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x125219=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x125219['if']('isVisible','ck-hidden',_0x57f780=>!_0x57f780)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x125219['to']('errorMessage')}]}]});}}class Ae extends _0xc3e5b1{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x2c1ed3,_0x470a29){super(_0x2c1ed3),this['reviewCoreHeader']=_0x470a29['header'],this['generalErrorView']=new sh(_0x2c1ed3),this['reviewCheckListView']=_0x470a29['list'],this['reviewCheckListView']['delegate'](...ih)['to'](this),this['reviewCheckResultsView']=_0x470a29['results'],this['reviewCheckResultsView']['delegate'](...ih)['to'](this),this['reviewCompletedView']=_0x470a29['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'](_0x4baba7){this['reviewCheckResultsView']['addResult'](_0x4baba7),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'](_0x5d129c){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x5d129c;}['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 _0x2cf640{constructor(_0x381f58,_0x427530){super(_0x427530),this['set']({'label':_0x381f58,'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class Ve extends _0x663ac1{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x1ea600,_0x1b5ad7){super(_0x1ea600),this['_contents']=_0x1b5ad7,this['_resultViews']=new _0xf5a45d(),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 vi(_0x1ea600),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 _0x49415a=this['_createCombinedSkeletonLoader'](),_0x28bf8b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x28bf8b['if']('isLoading','ck-ai_review__check-run_loading',_0x4e4228=>_0x4e4228),_0x28bf8b['if']('isResultReady','ck-ai_review__check-run_ready',_0x537021=>_0x537021),_0x28bf8b['if']('isVisible','ck-hidden',_0x31824b=>!_0x31824b)]},'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',_0x3b685f=>_0x3b685f)]},'children':this['_resultViews']},_0x49415a]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x2e5f3f){const _0x2c9a24=new Ws(this['locale'],_0x2e5f3f['id']);_0x2c9a24['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x2c9a24),_0x2c9a24['resultResponseView']['element']['innerHTML']=_0x2e5f3f['contentDiffed'];}['hideResult'](_0xe51d41,_0x2a924c){if('pending'===_0x2a924c)return;const _0x5ee87d=this['_resultViews']['find'](_0x2090f1=>_0x2090f1['id']===_0xe51d41);_0x5ee87d&&(_0x5ee87d['status']=_0x2a924c,_0x5ee87d['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x28f995,_0xc91c1){if('pending'!==_0xc91c1)return;const _0xb23ef9=this['_resultViews']['find'](_0x3f5e5d=>_0x3f5e5d['id']===_0x28f995);_0xb23ef9&&(_0xb23ef9['status']=_0xc91c1,_0xb23ef9['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x42de15,_0x2e9324){this['headerTitle']=_0x42de15,this['headerSubtitle']=_0x2e9324||'';}['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 Xe(this['locale'],Ye['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x3a8048=new _0xc3e5b1(this['locale']),_0x39fc10=[];for(let _0x149900=0x0;_0x149900<0x10;_0x149900++){const _0x5b5298=this['_createSkeletonLoader']();_0x5b5298['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x39fc10['push'](_0x5b5298);}return _0x3a8048['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x418f9a=>!_0x418f9a)]},'children':_0x39fc10}),_0x3a8048;}['_createErrorView'](){const _0x4c4996=new _0xc3e5b1(this['locale']),_0x271679=new _0x2cf640(this['locale']),t=this['locale']['t'];return _0x4c4996['delegate']('retryReview')['to'](this),_0x271679['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai_review__check-run-error-retry-button'}),_0x271679['on']('execute',()=>{this['fire']('retryReview');}),_0x4c4996['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x51033b=>!_0x51033b),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x388c6f=>'chunk'===_0x388c6f)]},'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',_0x3fdc7f=>'chunk'===_0x3fdc7f)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x295bcd=>'general'!==_0x295bcd)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x4c3561=>'chunk'!==_0x4c3561)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x271679]}),_0x4c4996;}['_createCancelButtonView'](){const _0x2f27e4=new _0x2cf640(this['locale']);return _0x2f27e4['set']({'label':i(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x197784}),_0x2f27e4['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x4674c0=>_0x4674c0),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x315905=>_0x315905)]}}),_0x2f27e4['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x2f27e4;}['_createToggleDiffButtonView'](){const _0x3a6b51=new _0x2cf640(this['locale']);_0x3a6b51['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x3a6b51['bind']('isEnabled')['to'](this,'isError',_0x242d59=>!_0x242d59),_0x3a6b51['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x332a9f=>!_0x332a9f),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3775c1=>_0x3775c1)]}});const _0x79717c=i(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x2856ec=i(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x3a6b51['bind']('isOn')['to'](this,'isToggleDiffOn',_0x27cc5d=>_0x27cc5d),_0x3a6b51['bind']('icon')['to'](this,'isToggleDiffOn',_0x384ad2=>_0x384ad2?_0x59f2c5:_0x359228),_0x3a6b51['bind']('label')['to'](this,'isToggleDiffOn',_0x131f2b=>_0x131f2b?_0x79717c:_0x2856ec),_0x3a6b51['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x3a6b51;}['_createAcceptAllButtonView'](){const _0x4a2025=new _0x2cf640(this['locale']);return _0x4a2025['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x4a2025['bind']('isEnabled')['to'](this,'isError',_0x1758c4=>!_0x1758c4),_0x4a2025['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x24f0a8=>!_0x24f0a8),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4e5f0d=>_0x4e5f0d)]}}),_0x4a2025['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x4a2025;}['_createExitReviewButtonView'](){const _0x4f1dd5=new _0x2cf640(this['locale']);return _0x4f1dd5['set']({'label':i(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x4f1dd5['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary','ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x3cf9fc=>!_0x3cf9fc),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3b705f=>_0x3b705f)]}}),_0x4f1dd5['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x4f1dd5;}['_createResultHeaderView'](){const _0x6f2edf=new _0xc3e5b1(this['locale']),_0x5d190c=this['_createTitleView']();return _0x6f2edf['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x5d51d3=>_0x5d51d3)]},'children':[_0x5d190c,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x6f2edf;}['_createTitleView'](){const _0xa0da5b=new _0xc3e5b1(this['locale']),_0x2cc273=new Ze();return _0x2cc273['bind']('isVisible')['to'](this,'isResultReady',_0x114f17=>!_0x114f17),_0xa0da5b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x2cc273,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1f60da=>_0x1f60da)]},'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',_0x1638ab=>!_0x1638ab)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0xa0da5b;}['_createFinishReviewButtonView'](){const _0x3b99ab=new vr(i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x3b99ab['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2f32a2=>!_0x2f32a2)]}}),_0x3b99ab['delegate']('finishReview')['to'](this),_0x3b99ab;}}class be extends _0x663ac1{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x81aaa1,_0x9c482f){super(_0x81aaa1),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x9c482f['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x9c482f['headerText']);const _0x9a62b5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x9a62b5['if']('isVisible','ck-hidden',_0x55f576=>!_0x55f576)]},'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':_0x9c482f['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x3791de){const _0x33378c=new vr(_0x3791de,this['locale']);return _0x33378c['delegate']('finishReview')['to'](this),_0x33378c;}['_createResultHeaderView'](_0x51c95f){const _0x45ff60=new _0xc3e5b1(this['locale']);return _0x45ff60['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':_0x51c95f}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x45ff60;}}class Dr extends _0xc3e5b1{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x53b102,_0x345248){super(_0x53b102),this['_defaultValue']=_0x345248['default']||(_0x345248['data']['length']>0x0?_0x345248['data'][0x0]['id']:''),this['_defaultLabel']=_0x345248['data']['find'](_0x2920fe=>_0x2920fe['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x3e48f8(this['locale']);const _0x458bc6=this['_prepareListOptions'](_0x345248['data']);_0x5aa31c(this['_dropdownView'],_0x458bc6,{'role':'menu','ariaLabel':_0x345248['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x28bf2f=>{_0x28bf2f['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x4d863d=>{this['formValue']=_0x4d863d['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x4d863d['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'](_0x533a23=[]){const _0x2f3c09=new _0x7916ba();this['resetToDefault']();for(const _0x5e2d6e of _0x533a23){const _0x1fb2e4=new _0x201273({'label':_0x5e2d6e['label'],'withText':!0x0,'role':'menuitemradio','id':_0x5e2d6e['id'],'model':_0x5e2d6e});_0x1fb2e4['bind']('isOn')['to'](this,'formValue',_0x193c27=>_0x193c27===_0x1fb2e4['id']);const _0x5a7132={'type':'button','model':_0x1fb2e4};_0x2f3c09['add'](_0x5a7132);}return _0x2f3c09;}}class tc extends _0x663ac1{['_formItem']=null;constructor(_0x565811,_0x1847ae,_0x29909c){super(_0x565811),this['argsKey']=_0x1847ae?.['argsKey'];if('dropdown'===_0x1847ae['formType'])this['_formItem']=new Dr(this['locale'],_0x1847ae);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x28e5ff=new _0x42755e(this['locale'],{'children':[this['_formItem']],'class':[_0x29909c?'ck-form__row_with-submit':'']});_0x29909c&&_0x28e5ff['children']['add'](_0x29909c),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x28e5ff]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class wo extends _0x2fe62a{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x2ca56e){super(_0x2ca56e),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x15425(),this['minRows']=wo['MIN_ROWS'],this['maxRows']=wo['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 sc extends _0xc3e5b1{['focusTracker']=new _0x5f2dfb();['keystrokes']=new _0x15425();['focusCycler'];['_focusables']=new _0xf5a45d();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x3a6030,_0xa59078,_0x22c2fd=!0x1){super(_0x3a6030),this['_check']=_0xa59078,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0xa59078['defaultModel']?_0xa59078['defaultModel']['id']:'',this['_defaultLabel']=_0xa59078['defaultModel']?_0xa59078['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x16298f(this['locale'],()=>new wo(_0x3a6030)),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 _0x7916ba(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x22c2fd),_0x5aa31c(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x42755e(this['locale'],{'children':[this['promptInputView']]}),new _0x42755e(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x16daa4,_0x408866)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x408866()):_0x408866();}),this['focusCycler']=new _0x1af4a5({'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'](_0x314834=>{this['_focusables']['add'](_0x314834),this['focusTracker']['add'](_0x314834['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 _0x2f1437 of this['_getFormValidators']()){const _0x48a5ae=_0x2f1437();if(_0x48a5ae)return this['promptInputView']['errorText']=_0x48a5ae,!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 _0x16e051=new _0x2cf640(this['locale']),t=this['locale']['t'];return _0x16e051['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x16e051['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x16e051;}['_createCancelButtonView'](){const _0x1901d3=new _0x2cf640(this['locale']),t=this['locale']['t'];return _0x1901d3['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary'}),_0x1901d3['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x45c602=>{_0x45c602['stopPropagation']();})}}),_0x1901d3['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x1901d3;}['_setModelList'](_0x49b723){this['_modelSelectionDropdownItems']['clear']();const _0x28021a=this['_check']['models'];if(_0x49b723)this['set']('modelDisplayMode','hidden');else{const _0x5cdcf1=0x1===_0x28021a['length'];this['set']('modelDisplayMode',_0x5cdcf1?'name':'selector');}if(this['resetToDefault'](),_0x28021a?.['length']){0x1===_0x28021a['length']&&this['set']('activeModelName',_0x28021a[0x0]['name']||_0x28021a[0x0]['id']);for(const _0x591f2d of _0x28021a){const _0xe5db87=new _0x201273({'label':_0x591f2d['name'],'withText':!0x0,'role':'menuitemradio','id':_0x591f2d['id'],'model':_0x591f2d});_0xe5db87['bind']('isOn')['to'](this,'modelId',_0x5a48b0=>_0x5a48b0===_0x591f2d['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0xe5db87,'labelView':new ModelButtonLabelView(this['locale'],_0x591f2d)});}}}['_createModelSelectionDropdown'](){const _0x6cc730=_0x3e48f8(this['locale']);return _0x6cc730['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x6cc730['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),_0x6cc730['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x4f46ce=>'selector'===_0x4f46ce),this['listenTo'](_0x6cc730,'execute',_0x3aad2f=>{this['modelId']=_0x3aad2f['source']['model']['id'],_0x6cc730['buttonView']['label']=_0x3aad2f['source']['label'];}),_0x6cc730;}['_createModelNameView'](){const _0xca5d2c=new ModelNameView(this['locale']);return _0xca5d2c['bind']('text')['to'](this,'activeModelName',_0x1335c8=>_0x1335c8??''),_0xca5d2c['bind']('isVisible')['to'](this,'modelDisplayMode',_0x49fd5e=>'name'===_0x49fd5e),_0xca5d2c;}['_createActionsFooterView'](){const _0x3fadac=new _0xc3e5b1(this['locale']);return _0x3fadac['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']]}]}),_0x3fadac;}}class ModelNameView extends _0xc3e5b1{constructor(_0x45c91b){super(_0x45c91b),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x13b832=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x13b832['if']('isVisible','ck-hidden',_0x38ce37=>!_0x38ce37)]},'children':[{'text':_0x13b832['to']('text')}]});}}class ModelButtonLabelView extends _0x23a78e{constructor(_0x44bb35,_0x3efd7e){super();const _0x1bfd09=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x1bfd09['to']('style'),'id':_0x1bfd09['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x1bfd09['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x3efd7e['description']||'']}]}]});}}class ec extends _0x663ac1{['_formItemsCollection']=new _0xf5a45d();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x55ba4f,_0x1d531e,_0x10b515,_0x4f52b5=!0x1){super(_0x55ba4f),this['_hideModels']=_0x4f52b5,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x1d531e['isParameterized']);const _0x422ad6=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',_0x2ab9bb=>_0x2ab9bb),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x515294=>_0x515294)],'style':{'--ck-ai-review-check-list-item-index':_0x10b515}},'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':_0x1d531e['title']}]},_0x422ad6]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x1d531e['description']?[{'text':_0x1d531e['description']}]:[]}]}]},..._0x1d531e['isParameterized']?[this['_createParameterizedView'](_0x1d531e)]:[],...'custom'===_0x1d531e['id']?[this['_createCustomView'](_0x1d531e,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x1d531e['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x1d531e['id'],'args':_0x1d531e['useArgs']?_0x1d531e['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x1d212b({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0xfefc0f=>{_0xfefc0f['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x493c3c=new _0x59b3d9();return _0x493c3c['content']=_0x215c94,_0x493c3c['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x493c3c;}['_createParameterizedView'](_0x42bfca){const _0x57d56e=new _0xc3e5b1(),_0x5ae5f4=this['_createFormView'](_0x42bfca);return _0x57d56e['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x5ce014=>!_0x5ce014)]},'children':[_0x5ae5f4]}),_0x57d56e;}['_createFormView'](_0x57750d){const _0x50229b=new _0xc3e5b1(),_0x4179a1=Array['isArray'](_0x57750d['options'])?_0x57750d['options']:[],_0x18bbff=new _0x2cf640(this['locale']),t=this['locale']['t'];_0x18bbff['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x18bbff['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2b754c=>{_0x2b754c['stopPropagation']();})}}),_0x18bbff['on']('execute',()=>{const _0x3b8057=[],_0x597e78={};this['_formItemsCollection']['forEach'](_0x1c9292=>{_0x3b8057['push'](_0x1c9292['value']),_0x57750d['useArgs']&&_0x57750d['options']&&(_0x597e78[_0x1c9292['argsKey']]=_0x1c9292['value']);}),this['fire']('runReviewCheck',{'id':_0x57750d['id'],'params':_0x3b8057['length']?_0x3b8057:void 0x0,'args':Object['keys'](_0x597e78)['length']?_0x597e78:void 0x0});});const _0x18362f=_0x4179a1['length'];return _0x4179a1['forEach']((_0x50d469,_0x5038fa)=>{const _0x1ff311=_0x5038fa===_0x18362f-0x1;this['_formItemsCollection']['add'](new tc(this['locale'],_0x50d469,_0x1ff311?_0x18bbff:null));}),_0x50229b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x50229b;}['_createCustomView'](_0x2e4897,_0x479826=!0x1){return this['_customCheckView']=new sc(this['locale'],_0x2e4897,_0x479826),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',_0xbe2e6d=>!_0xbe2e6d)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x95e05f,_0x17e583,_0x57dcee)=>{_0x57dcee||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class je extends _0x663ac1{['_checkViews'];constructor(_0x27ec6f){super(_0x27ec6f),this['_checkViews']=new _0xf5a45d(),this['_setupTemplate']();}['setChecks'](_0x440de8,_0xe5be6d=!0x1){this['_checkViews']['clear']();for(const [_0x502d51,_0x2dadec]of _0x440de8['entries']()){const _0x5800cb=new ec(this['locale'],_0x2dadec,_0x502d51,_0xe5be6d);_0x5800cb['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x5800cb);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x32e3dc of this['_checkViews'])_0x32e3dc instanceof ec&&_0x32e3dc['resetToDefault']();}['_setupTemplate'](){const _0x4cb18e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x4cb18e['if']('isVisible','ck-hidden',_0x22e425=>!_0x22e425)]},'children':this['_checkViews']});}}class ge extends Me{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x28c302=this['context']['locale'],_0x48cc47=new _0x1e299f(_0x28c302,{'label':i(_0x28c302,'AI_REVIEW_MODE'),'icon':_0x4081d8,'class':'ck-ai-header\x20ck-ai-header_review'});return new Ae(this['context']['locale'],{'header':_0x48cc47,'list':new je(_0x28c302),'results':new Ve(_0x28c302,{'generalErrorText':i(_0x28c302,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new be(_0x28c302,{'headerText':i(_0x28c302,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':i(_0x28c302,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0x28c302,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x12f5dd=this['context']['plugins']['get']('AITabs');_0x12f5dd['view']['on']('activateTab',(_0x40e2c3,_0x291611)=>{'reviewMode'===_0x291611?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x12f5dd['view']['addTab']({'id':'reviewMode','buttonLabel':i(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x4081d8,'order':0x0,'content':this['_mainView']});}}const fe='review-';class de extends _0x3a5602{static get['requires'](){return[ot,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(_0x5ca19c){super(_0x5ca19c),this['_domEmitter']=new(_0x3423db())(),this['_eventEmitter']=new(_0x5bd7c6())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0xbda1d2=T(this['context']);_0xbda1d2['conversion']['for']('editingDowncast')['markerToElement']({'model':fe+'insert','view':(_0x39ff71,{writer:_0x5b503c})=>{const _0x3b45c1=this['_markers']['get'](_0x39ff71['markerName']),_0x26c4d4={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x3b45c1?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x39ff71['markerName']};return _0x5b503c['createUIElement']('span',_0x26c4d4,function(_0x3067df){const _0x5d58e5=this['toDomElement'](_0x3067df);return _0x5d58e5['innerHTML']=_0x3b45c1?.['content']?.['asString']||'',_0x5d58e5;});}}),_0xbda1d2['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-only','view':_0x1b0b24=>{const _0x3fcf97=this['_markers']['get'](_0x1b0b24['markerName']),_0x51f874=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x3fcf97?.['id']||'')&&_0x51f874['push']('ck-ai_review__change_active'),{'classes':_0x51f874,'attributes':{'data-marker-id':_0x1b0b24['markerName']}};}}),_0xbda1d2['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-context','view':_0xed934e=>{const _0x5ebee6=this['_markers']['get'](_0xed934e['markerName']),_0x2c1ff3=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x5ebee6?.['id']||'')&&_0x2c1ff3['push']('ck-ai_review__change_active'),{'classes':_0x2c1ff3,'attributes':{'data-marker-id':_0xed934e['markerName']}};}}),_0xbda1d2['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-text','view':_0x2d3c1b=>{const _0x29c2df=this['_markers']['get'](_0x2d3c1b['markerName']),_0xaae9d3=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x29c2df?.['id']||'')&&_0xaae9d3['push']('ck-ai_review__change_active'),{'classes':_0xaae9d3,'attributes':{'data-marker-id':_0x2d3c1b['markerName']}};}}),_0xbda1d2['conversion']['for']('dataDowncast')['markerToElement']({'model':fe+'suggestion-context','view':(_0x83c0ae,{writer:_0x22ec98})=>_0x22ec98['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x83c0ae['isOpening']?'start':'end')})}),_0xbda1d2['conversion']['for']('downcast')['attributeToAttribute']({'model':nt,'view':_0x5b56f8});const _0x23e5e0=_0xbda1d2['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x23e5e0,'mouseup',(_0x3fcda4,_0x1434da)=>{const _0x1c5ce1=_0x1434da['target'],_0x4be22f=this['_findMarkerElement'](_0x1c5ce1);if(!_0x4be22f)return;const _0x216ad3=_0x4be22f['getAttribute']('data-marker-id'),_0x2ec452=_0x216ad3['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x216ad3,'changeId':_0x2ec452,'markerElement':()=>this['_findMarkerElementById'](_0x216ad3),'domEvent':_0x1434da});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x23e5e0,'mouseover',(_0x53a328,_0x421fb0)=>{const _0x34e187=_0x421fb0['target'],_0x21d21a=_0x421fb0['relatedTarget'];let _0xe71331=this['_findMarkerElement'](_0x34e187);if(!_0xe71331&&_0x21d21a&&(_0xe71331=this['_findMarkerElement'](_0x21d21a)),!_0xe71331)return;const _0x57f325=_0xe71331['getAttribute']('data-marker-id'),_0x52d272=_0x57f325['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x52d272,'markerElement':()=>this['_findMarkerElementById'](_0x57f325),'domEvent':_0x421fb0});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x49634e((_0x3dda20,_0x316843)=>{const _0x24644c=_0x316843['target'];if(this['_findMarkerElement'](_0x24644c))return;_0x24644c['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0xbda1d2['model']['document']['registerPostFixer'](_0x567983=>this['_validateMarkers'](_0xbda1d2,_0x567983)),_0xbda1d2['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0xbda1d2));}['getDocumentData'](){const _0x229f00=this['context']['plugins']['get']('AIEditing'),_0x531437=T(this['context']),_0x31f385=_0x531437['model'],_0x1f82d8=new bt();for(const _0x8d0aaa of _0x31f385['document']['getRoot']()['getChildren']()){const _0x25ab32=_0x8d0aaa['_clone'](!0x0);_0x1f82d8['_appendChild'](_0x25ab32);}for(const _0x50c370 of _0x31f385['markers'])_0x1f82d8['markers']['set'](_0x50c370['name'],this['_changeRangeOwnerDocument'](_0x50c370['getRange']()['clone'](),_0x1f82d8));const _0x2bc3d5=new _0x1f3d99({'ignoreElementEnd':!0x0,'startPosition':_0x31f385['createPositionAt'](_0x1f82d8,0x0)}),_0x1331ac=new Set(),_0x568598=new Map();for(const {item:_0x4c840a}of _0x2bc3d5){if(!_0x4c840a['is']('$textProxy'))continue;const _0x3ac31d=_0x4c840a['parent'];if(_0x3ac31d&&_0x3ac31d['is']('element')){const _0x475ab8=this['_upsertDataId'](_0x3ac31d,()=>_0x229f00['_nextDataId'](_0x1331ac));_0x1331ac['add'](_0x475ab8);for(const _0x193943 of _0x3ac31d['getChildren']())_0x193943['is']('element')&&_0x1331ac['add'](this['_upsertDataId'](_0x193943,()=>_0x229f00['_nextDataId'](_0x1331ac)));let _0x2ed68f=_0x3ac31d;for(;_0x2ed68f['parent']&&!_0x2ed68f['parent']['is']('documentFragment');)_0x2ed68f=_0x2ed68f['parent'],_0x2ed68f['hasAttribute'](nt)&&_0x2ed68f['_removeAttribute'](nt);_0x568598['set'](_0x475ab8,{'path':_0x3ac31d['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x2ed68f['_clone'](!0x0),_0x475ab8,_0x531437['data'])}),_0x2bc3d5['jumpTo'](_0x31f385['createPositionAfter'](_0x3ac31d));}}return{'content':_0x531437['data']['processor']['toData'](_0x531437['data']['toView'](_0x1f82d8)),'version':_0x531437['model']['document']['version'],'elements':_0x568598};}['diffContent'](_0x5b9d90,_0x502630,_0x38ae07=!0x1){const _0x5883a8=[],_0x441157=T(this['context']),_0x4659cd=_0x441157['data']['parse'](_0x502630,'$documentFragment'),_0x5269b3=_0x441157['data']['parse'](_0x5b9d90,'$documentFragment'),_0x4c07cf=_0x441157['model']['createPositionAt'](_0x5269b3,0x0);if(this['_haveSingleTopLevelElement'](_0x4659cd)){if(!this['_hasSameTopLevelElement'](_0x5269b3,_0x4659cd))return _0x5883a8;}else{const _0x3cfacf=_0x441157['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x5269b3,_0x3cfacf)||!this['_haveOnlyInlineContent'](_0x4659cd,_0x3cfacf))return _0x5883a8;}const _0x522a3b=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x5b9d90,_0x502630,{'anchor':_0x4c07cf,'markDeletions':!0x0})['getOperations']()['filter'](_0x1fdc11=>'insert'===_0x1fdc11['type']||'marker'===_0x1fdc11['type']&&_0x1fdc11['name']['startsWith']('$markedRemove')),_0x38b62e=this['_groupAdjacentOperations'](_0x522a3b),_0x20935e=[];if(_0x38ae07){if(_0x38b62e['length']){const _0x43b6b5=_0x38b62e[0x0]['operations'][0x0],_0x128f37='insert'===_0x43b6b5['type']?_0x43b6b5['position']:_0x43b6b5['newRange']['start'],_0x42ebc6=this['_getPositionLimitingRange'](_0x128f37,_0x441157,'inside'),_0x2c0c56=_0x42ebc6?_0x4659cd['getChild'](0x0)['getChildren']():_0x4659cd['getChildren'](),_0x375e27=_0x42ebc6||_0x441157['model']['createRangeIn'](_0x5269b3),_0x2e5126=[new _0x2a897f('$markedRemove:synthetic'+_0x48eb5e(),null,_0x375e27,_0x441157['model']['document']['model']['markers'],!0x0,_0x441157['model']['document']['version']+0x1),new _0x4675cd(_0x375e27['end'],_0x2c0c56,_0x441157['model']['document']['version']+0x2)];_0x20935e['push']({'operations':_0x2e5126,'operationsIsolated':_0x2e5126,'groupOffset':0x0});}}else _0x20935e['push'](..._0x38b62e);let _0x3ab0a6=0x0;return _0x441157['model']['change'](_0x3b4bb1=>{for(let _0x460123=0x0;_0x460123<_0x20935e['length'];_0x460123++){const _0x3c2374=_0x20935e[_0x460123],_0x35a6b5=_0x3b4bb1['createDocumentFragment']();for(const _0x378dc0 of _0x5269b3['getChildren']())_0x3b4bb1['append'](_0x378dc0['_clone'](!0x0),_0x35a6b5);for(const _0x407a6f of _0x3c2374['operationsIsolated'])if('insert'===_0x407a6f['type']){const _0x436122=_0x407a6f;_0x436122['baseVersion']=null,_0x436122['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x436122,_0x35a6b5),_0x3b4bb1['batch']['addOperation'](_0x407a6f),_0x441157['model']['applyOperation'](_0x407a6f);const _0x4ec7f9='suggestion:insertion:id:authorId:'+_0x3ab0a6++,_0x5225a8=_0x441157['model']['createRange'](_0x436122['position'],_0x436122['position']['getShiftedBy'](_0x436122['howMany']));_0x35a6b5['markers']['set'](_0x4ec7f9,_0x5225a8);}else{if('marker'===_0x407a6f['type']&&_0x407a6f['name']['startsWith']('$markedRemove')){const _0x4dccaa=_0x407a6f,_0x344d22='suggestion:deletion:id:authorId:'+_0x3ab0a6++;this['_changeOperationOwnerDocument'](_0x4dccaa,_0x35a6b5),_0x35a6b5['markers']['set'](_0x344d22,_0x4dccaa['newRange']);}}if(_0x38ae07)_0x5883a8['push']({..._0x3c2374,'context':this['_createGetContentFn'](_0x5269b3,_0x441157['data']),'content':this['_createGetContentFn'](_0x5269b3,_0x441157['data'])});else{const _0x59aa60=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x3c2374['operationsIsolated'][0x0]),_0x35a6b5),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x3c2374['operationsIsolated'][_0x3c2374['operationsIsolated']['length']-0x1]),_0x35a6b5));_0x35a6b5['markers']['set'](fe+'suggestion-context',new dt(_0x59aa60['start'],_0x59aa60['end'])),_0x5883a8['push']({..._0x3c2374,'context':this['_createGetContextFn'](_0x35a6b5,_0x441157['data'],{'ellipsisBefore':_0x59aa60['hasContentBefore'],'ellipsisAfter':_0x59aa60['hasContentAfter']}),'content':this['_createGetContentFn'](_0x35a6b5,_0x441157['data'])});}}}),_0x5883a8;}['markChangePositionInEditorContent'](_0x5be518,_0x3a2c54){if(!_0x5be518['length'])return;const _0x14b491=_0x5be518[0x0]['parent']['id'],_0x4cba6c=_0x3a2c54['elements']['get'](_0x14b491);if(!_0x4cba6c)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x14b491);const _0x329548=_0x4cba6c['path'],_0x13ed3d=T(this['context']),_0x289ecc=_0x13ed3d['model']['document']['history']['getOperations'](_0x3a2c54['version']),_0x314b61=[];for(const _0x20ffa5 of _0x5be518){const _0x1c8ef7=_0x20ffa5['operationsIsolated']['map'](_0x44cc5d=>this['_translateOperationToEditorContent'](_0x44cc5d,_0x329548,_0x13ed3d['model']['document']['getRoots']()[0x0]));if(!_0x1c8ef7||!_0x1c8ef7['length'])continue;const _0x427d0e=_0x1c8ef7['every'](_0x356db2=>'marker'===_0x356db2['type']&&_0x356db2['name']['startsWith']('$markedRemove')),_0x3aefb2={'document':_0x13ed3d['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x236643=kt(_0x1c8ef7,_0x289ecc,_0x3aefb2)['operationsA'];for(const _0x1ad196 of _0x236643)if('insert'===_0x1ad196['type']){const _0x1934e5=_0x1ad196,_0x5afc3e=_0x1934e5['nodes'];_0x13ed3d['model']['change'](_0x5138dc=>{const _0x28fa68=_0x5138dc['createDocumentFragment']();for(const _0x34936a of _0x5afc3e)_0x5138dc['append'](_0x34936a['_clone'](!0x0),_0x28fa68);_0x314b61['push']({'start':_0x1934e5['position'],'end':_0x1934e5['position'],'type':'insert','groupId':_0x20ffa5['id'],'content':{'asString':this['_createGetContentFn'](_0x28fa68,_0x13ed3d['data'])(),'asFragment':_0x28fa68}});});}else{if('marker'===_0x1ad196['type']&&_0x1ad196['name']['startsWith']('$markedRemove')){const _0x28d463=_0x1ad196;let _0x5752c4='remove-text';if(_0x427d0e){const _0x5a12b9=this['_findAdjacentContextDistance'](_0x28d463['newRange']['start'],'backward',_0x13ed3d['model']['schema']),_0x236acd=this['_findAdjacentContextDistance'](_0x28d463['newRange']['end'],'forward',_0x13ed3d['model']['schema']);if(_0x5a12b9||_0x236acd){const _0x4d847b=_0x28d463['newRange']['start']['getShiftedBy'](-_0x5a12b9),_0x3c1419=_0x28d463['newRange']['end']['getShiftedBy'](_0x236acd);_0x314b61['push']({'start':_0x4d847b,'end':_0x3c1419,'groupId':_0x20ffa5['id'],'type':'remove-context'});}else _0x5752c4='remove-only';}_0x314b61['push']({'start':_0x28d463['newRange']['start'],'end':_0x28d463['newRange']['end'],'groupId':_0x20ffa5['id'],'type':_0x5752c4});}}}this['_insertMarkers'](_0x314b61);}['clearAllMarkers'](){const _0x528517=T(this['context']);_0x528517['model']['change'](_0x54147e=>{for(const _0x1f30d1 of this['_markers']['keys']())_0x528517['model']['markers']['get'](_0x1f30d1)&&_0x54147e['removeMarker'](_0x1f30d1);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){T(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){T(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x133e40){const _0x1a31e0=T(this['context']),_0x3240f9=_0x1a31e0['model'],_0x2805b1=_0x133e40['map'](_0x100c68=>this['_getMarkersDataForGroup'](_0x100c68))['flat']();_0x3240f9['change'](_0x21d31e=>{for(const _0x2ba3e9 of _0x2805b1){const _0x538204=_0x1a31e0['model']['markers']['get'](_0x2ba3e9['id']);if(_0x538204){if('insert'===_0x2ba3e9['type']){if(!_0x2ba3e9['content'])continue;_0x3240f9['insertContent'](_0x2ba3e9['content']['asFragment']||null,_0x538204['getRange']()['start']);}else'remove-text'!==_0x2ba3e9['type']&&'remove-only'!==_0x2ba3e9['type']||_0x3240f9['deleteContent'](_0x3240f9['createSelection'](_0x538204['getRange']()));_0x21d31e['removeMarker'](_0x2ba3e9['id']),this['_markers']['delete'](_0x2ba3e9['id']);}}});}['rejectChange'](_0x342f9e){const _0x2dd22d=T(this['context']),_0x1879ef=this['_getMarkersDataForGroup'](_0x342f9e);_0x2dd22d['model']['change'](_0x5cb9ca=>{for(const _0x27eb0e of _0x1879ef)_0x5cb9ca['removeMarker'](_0x27eb0e['id']),this['_markers']['delete'](_0x27eb0e['id']);});}['getEditor'](){return T(this['context']);}['getMarkerElementForChange'](_0x28e3f0){const _0x3c8e61=Array['from'](this['_markers']['values']())['filter'](_0x4baaa2=>_0x4baaa2['groupId']===_0x28e3f0);if(!_0x3c8e61['length'])return null;const _0x561218=0x1===_0x3c8e61['length']?_0x3c8e61[0x0]:this['_sortMarkers'](_0x3c8e61)[0x0],_0xd10a3a=T(this['context'])['model']['markers']['get'](_0x561218['id']);if(!_0xd10a3a)return null;return{'modelRange':_0xd10a3a['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x561218['id'])};}['getContentElementForChange'](_0x43a03f){const _0x1aa7cb=Array['from'](this['_markers']['values']())['filter'](_0x11b513=>_0x11b513['groupId']===_0x43a03f);if(!_0x1aa7cb['length'])return null;const _0x209226=0x1===_0x1aa7cb['length']?_0x1aa7cb[0x0]:this['_sortMarkers'](_0x1aa7cb)[0x0],_0x165816=T(this['context']),_0x76d05a=_0x165816['model']['markers']['get'](_0x209226['id']);if(!_0x76d05a)return null;const _0x314604=_0x76d05a['getRange'](),_0x327fe9=_0x165816['editing']['view']['getDomRoot']();if(!_0x327fe9||!_0x314604)return null;let _0x125be9=_0x314604['start']['parent'];for(;_0x125be9['parent']&&'$root'!==_0x125be9['parent']['name'];)_0x125be9=_0x125be9['parent'];if(!_0x125be9||!_0x125be9['name'])return null;const _0x110c78=_0x327fe9['querySelector']('[data-marker-id=\x22'+_0x209226['id']+'\x22]');if(!_0x110c78)return null;let _0x12ef88=null;_0x165816['model']['change'](_0xe8ec5=>{_0x12ef88=_0xe8ec5['createDocumentFragment'](),_0xe8ec5['append'](_0x125be9['_clone'](!0x0),_0x12ef88);});const _0x5a89da=_0x165816['data']['toView'](_0x12ef88)['getChild'](0x0);return _0x110c78['closest'](_0x5a89da['name']);}['reactivateMarkers'](_0x39182f){const _0x587f1f=this['_getMarkersDataForGroup'](_0x39182f);if(!_0x587f1f['length'])return;const _0x189a2e=Array['from'](this['_activeMarkers'])['sort'](),_0x748ad5=Array['from'](new Set(_0x587f1f['map'](_0x17168f=>_0x17168f['id'])))['sort']();_0x189a2e['join']('|')!==_0x748ad5['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x39182f));}['setMarkersInElementAsActive'](_0x204767){const _0x42843c=this['_getMarkersDataForGroup'](_0x204767);if(!_0x42843c['length'])return;const _0x3df55a=T(this['context']),_0x1f2bd1=new Set(_0x42843c['map'](_0x3280b5=>_0x3280b5['id'])),_0x5dcaff=Array['from'](_0x1f2bd1['values']())['map'](_0x3931fb=>_0x3df55a['model']['markers']['get'](_0x3931fb))['filter'](_0x9bc136=>!!_0x9bc136);_0x1f2bd1['forEach'](_0x5ec832=>{this['_activeMarkers']['add'](_0x5ec832);}),_0x3df55a['model']['change'](()=>{_0x5dcaff['forEach'](_0x30a4b8=>{_0x3df55a['editing']['reconvertMarker'](_0x30a4b8);});});}['setAllMarkersAsInactive'](){const _0xf4af1=Array['from'](this['_activeMarkers']);if(!_0xf4af1['length'])return;this['_activeMarkers']['clear']();const _0x201562=T(this['context']),_0x5b7649=_0xf4af1['map'](_0x5f3489=>_0x201562['model']['markers']['get'](_0x5f3489))['filter'](_0x40a23e=>!!_0x40a23e);_0x201562['model']['change'](()=>{_0x5b7649['forEach'](_0x96e86d=>{_0x201562['editing']['reconvertMarker'](_0x96e86d);});});}['_getPositionLimitingRange'](_0x429e79,_0x35322b,_0x373661='outside'){if(!_0x429e79)return null;let _0x3e37cd=_0x429e79['parent'];for(;_0x3e37cd&&_0x3e37cd['parent']&&'$root'!==_0x3e37cd['parent']['name']&&!_0x35322b['model']['schema']['isLimit'](_0x3e37cd)&&!_0x35322b['model']['schema']['isBlock'](_0x3e37cd);)_0x3e37cd=_0x3e37cd['parent'];if(!_0x3e37cd||!_0x3e37cd['name']||'$root'===_0x3e37cd['name'])return null;let _0x3cf867=null;return _0x35322b['model']['change'](_0x2bebd3=>{_0x3cf867='inside'===_0x373661?_0x2bebd3['createRangeIn'](_0x3e37cd):_0x2bebd3['createRangeOn'](_0x3e37cd);}),_0x3cf867;}['_validateMarkers'](_0x4d0e73,_0x3c9a47){const _0x823dc8=Array['from'](this['_markers']['keys']()),_0x3aba87=new Map();for(const _0x2533f4 of _0x823dc8){const _0x2c989d=_0x4d0e73['model']['markers']['get'](_0x2533f4);if(!_0x2c989d)continue;const _0xfd944c=_0x2c989d['getStart']()['path'][0x0];_0x3aba87['has'](_0xfd944c)||_0x3aba87['set'](_0xfd944c,[]),_0x3aba87['get'](_0xfd944c)['push'](_0x2c989d);}const _0xeb3f97=new Set();for(const _0x522833 of _0x4d0e73['model']['document']['differ']['getChanges']()){let _0xde98fe=-0x1,_0x1b6ea8=null;if('insert'===_0x522833['type'])_0x1b6ea8=new dt(_0x522833['position'],_0x522833['position']['getShiftedBy'](_0x522833['length'])),_0xde98fe=_0x522833['position']['path'][0x0];else{if('remove'!==_0x522833['type'])continue;_0x1b6ea8=new dt(_0x522833['position']),_0xde98fe=_0x522833['position']['path'][0x0];}const _0x152409=_0x3aba87['get'](_0xde98fe)||[];if(_0x152409['length']){for(const _0x468a39 of _0x152409)if(_0x1b6ea8['root']['rootName']===_0x468a39['getRange']()['root']['rootName']&&('insert'!==_0x522833['type']||!_0x1b6ea8['containsRange'](_0x468a39['getRange']()))&&(_0x1b6ea8['isIntersecting'](_0x468a39['getRange']())||_0x1b6ea8['start']['isTouching'](_0x468a39['getRange']()['end'])||_0x1b6ea8['end']['isTouching'](_0x468a39['getRange']()['start']))){const _0x452129=this['_parseMarkerName'](_0x468a39['name']);Array['from'](this['_markers']['values']())['filter'](_0x353781=>_0x353781['groupId']===_0x452129['groupId'])['forEach'](_0x294980=>_0xeb3f97['add'](_0x294980['id']));}}}if(_0xeb3f97['size']){for(const _0x255bf4 of _0xeb3f97)_0x3c9a47['removeMarker'](_0x255bf4);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x39130d){for(const {name:_0x148209,data:_0xbb8117}of _0x39130d['model']['document']['differ']['getChangedMarkers']()){if(!_0x148209['startsWith'](fe))continue;const _0x351e8e=_0xbb8117['oldRange'],_0x3e9756=_0xbb8117['newRange'],_0x18bca1=_0x351e8e&&'$graveyard'===_0x351e8e['root']['rootName'],_0x5bb75a=_0x3e9756&&'$graveyard'===_0x3e9756['root']['rootName'];if(_0x18bca1&&_0x5bb75a)continue;const _0x338fe6=this['_parseMarkerName'](_0x148209);this['_markers']['get'](_0x148209)&&(_0x5bb75a||!_0x3e9756?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x148209,'changeId':_0x338fe6['groupId']}):_0x18bca1&&_0x3e9756&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x148209,'changeId':_0x338fe6['groupId']}));}}['_parseMarkerName'](_0x2001ac){const _0x43a8b9=_0x2001ac['split'](':'),_0x39185c=(_0x43a8b9[0x1]||'')['split']('_');return{'prefix':_0x43a8b9[0x0],'groupId':_0x39185c[0x0],'suffix':_0x39185c[0x1]};}['_translateOperationToEditorContent'](_0x3a2101,_0x13ddbc,_0x38fba6){if('insert'===_0x3a2101['type']){const _0x56137c=_0x3a2101;return new _0x4675cd(this['_changePosition'](_0x13ddbc['concat'](_0x56137c['position']['offset']),_0x38fba6),_0x56137c['nodes'],_0x56137c['baseVersion']);}if('marker'===_0x3a2101['type']&&_0x3a2101['name']['startsWith']('$markedRemove')){const _0x5e4a40=_0x3a2101;return new _0x2a897f(_0x5e4a40['name'],_0x5e4a40['oldRange'],this['_changeRange'](_0x5e4a40['newRange'],_0x13ddbc['concat'](_0x5e4a40['newRange']['start']['offset']),_0x13ddbc['concat'](_0x5e4a40['newRange']['end']['offset']),_0x38fba6),_0x5e4a40['_markers'],_0x5e4a40['affectsData'],_0x5e4a40['baseVersion']);}return _0x3a2101;}['_groupAdjacentOperations'](_0x50702c){if(!_0x50702c['length'])return[];const _0xcea915=[];let _0x118105=0x0,_0x56fae0=0x0,_0x3fea21=[];for(let _0x25aec1=0x0;_0x25aec1<=_0x50702c['length'];_0x25aec1++){const _0x286f2c=_0x50702c[_0x25aec1],_0x3621ea=_0x50702c[_0x25aec1-0x1];!_0x286f2c||_0x3621ea&&!this['_getOperationEnd'](_0x3621ea)['isTouching'](this['_getOperationStart'](_0x286f2c))?(_0xcea915['push']({'operations':_0x3fea21,'operationsIsolated':_0x3fea21['map'](_0x1678d8=>this['_shiftOperation'](_0x1678d8['clone'](),-_0x56fae0)),'groupOffset':_0x118105}),_0x3fea21=_0x286f2c?[_0x286f2c]:[],_0x56fae0+=_0x118105,_0x118105=0x0):_0x3fea21['push'](_0x286f2c),_0x286f2c&&'insert'===_0x286f2c['type']&&(_0x118105+=_0x286f2c['howMany']);}return _0xcea915;}['_findAdjacentContextDistance'](_0x52acde,_0x14f496,_0x26a714,_0x396eb2=0x1){const _0x5e986a=new _0x1f3d99({'startPosition':_0x52acde,'direction':_0x14f496});let _0x126e11=0x0;for(let _0x3225eb=0x0;_0x3225eb<_0x396eb2;_0x3225eb++){let _0x5c9b33=0x0,_0x18fcbd=!0x1,_0x2f4f22='forward'===_0x14f496?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x240246}of _0x5e986a)if(_0x240246['is']('$textProxy')){const _0x5c04da=_0x2f4f22['exec'](_0x240246['data']);if(_0x5c04da&&_0x5c04da['length']){if(_0x5c9b33+='forward'===_0x14f496?_0x5c04da['index']+_0x5c04da[0x0]['length']:_0x240246['data']['length']-_0x5c04da['index'],_0x5c04da[0x0]['length']!==_0x240246['data']['length'])break;_0x18fcbd=!0x0,_0x2f4f22='forward'===_0x14f496?/^\w+/:/\w+$/;}else{if(_0x18fcbd)break;_0x5c9b33+=_0x240246['offsetSize'];}}else{if(_0x240246['is']('element')){_0x26a714['isInline'](_0x240246)&&!_0x18fcbd&&(_0x5c9b33+=0x1);break;}}_0x126e11+=_0x5c9b33,_0x5e986a['jumpTo'](_0x52acde['getShiftedBy']('forward'===_0x14f496?_0x126e11:-_0x126e11));}return _0x126e11;}['_getChangeContext'](_0x11189b,_0xc6b5ed){const _0x5b40a2=T(this['context'])['model']['schema'],_0x1681bb=this['_findAdjacentContextDistance'](_0x11189b,'backward',_0x5b40a2,0x6),_0x430f5f=this['_findAdjacentContextDistance'](_0xc6b5ed,'forward',_0x5b40a2,0x6),_0x1bf9a8=_0x11189b['getShiftedBy'](-_0x1681bb),_0x215894=_0xc6b5ed['getShiftedBy'](_0x430f5f);return{'start':_0x1bf9a8,'end':_0x215894,'hasContentBefore':!_0x1bf9a8['isAtStart'],'hasContentAfter':!_0x215894['isAtEnd']};}['_insertMarkers'](_0x2bda01){const _0x58337a=this['context']['plugins']['get']('AIEditing'),_0x221492=new Set();T(this['context'])['model']['change'](_0x537ff7=>{for(const _0x2cb3fe of _0x2bda01){const _0x52f2d9=''+fe+_0x2cb3fe['type']+':'+_0x2cb3fe['groupId']+'_'+_0x58337a['_nextDataId'](_0x221492);this['_markers']['set'](_0x52f2d9,{'id':_0x52f2d9,'groupId':_0x2cb3fe['groupId'],'type':_0x2cb3fe['type'],'content':_0x2cb3fe['content']}),_0x537ff7['addMarker'](_0x52f2d9,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x537ff7['createRange'](_0x2cb3fe['start'],_0x2cb3fe['end'])});}});}['_createGetContextFn'](_0x520038,_0xda4e9b,_0x233e1c){let _0x179c2d='';return()=>{if(!_0x179c2d){const _0x51a567=_0xda4e9b['toView'](_0x520038,{'showSuggestionHighlights':!0x0});let _0x67af03=_0x51a567['getChild'](0x0);if(_0x67af03['is']('containerElement')||(_0x67af03=_0x51a567),!_0x67af03)return'';let _0x11d55c=!0x1;const _0x476ff3=[];for(const _0x16b5bc of _0x67af03['getChildren']())_0x16b5bc['is']('element','span')&&_0x16b5bc['hasClass']('ck-ai_review-marker_context-end')&&(_0x11d55c=!0x1),_0x11d55c&&_0x476ff3['push'](_0x16b5bc),_0x16b5bc['is']('element','span')&&_0x16b5bc['hasClass']('ck-ai_review-marker_context-start')&&(_0x11d55c=!0x0);_0x67af03['_removeChildren'](0x0,_0x67af03['childCount']),_0x233e1c?.['ellipsisBefore']&&_0x67af03['_appendChild']('…'),_0x67af03['_appendChild'](_0x476ff3),_0x233e1c?.['ellipsisAfter']&&_0x67af03['_appendChild']('…');const _0x1ba116=_0xda4e9b['htmlProcessor']['domConverter']['viewToDom'](_0x51a567),_0x373936=_0xda4e9b['htmlProcessor']['htmlWriter']['getHtml'](_0x1ba116);_0x179c2d=_0x373936;}return _0x179c2d;};}['_createGetContentFn'](_0x1d913b,_0x13d411){let _0xecd8c5='';return()=>(_0xecd8c5||(_0xecd8c5=_0x13d411['stringify'](_0x1d913b,{'showSuggestionHighlights':!0x0})),_0xecd8c5);}['_createGetContentUsingDataIdFn'](_0xde4a46,_0x3460df,_0xf6b8ab){let _0x164373='';return()=>{if(!_0x164373){const _0x1e6574=_0xf6b8ab['toView'](new bt(_0xde4a46)),_0x371799=_0xf6b8ab['htmlProcessor']['domConverter']['viewToDom'](_0x1e6574)['querySelector']('[data-id=\x22'+_0x3460df+'\x22]');_0x164373=_0x371799?.['outerHTML']||'';}return _0x164373;};}['_findMarkerElement'](_0x4d530c,_0x258566=0x5){let _0x21c9e9=_0x4d530c,_0x3de4f3=null;for(let _0x2ab434=0x0;_0x2ab434<_0x258566&&_0x21c9e9;_0x2ab434++){if(!_0x21c9e9['className']){_0x21c9e9=_0x21c9e9['parentElement'];continue;}if(!(''+_0x21c9e9['className'])['includes']('ck-ai_review-marker_')){_0x21c9e9=_0x21c9e9['parentElement'];continue;}if(!_0x21c9e9['getAttribute']('data-marker-id'))break;_0x3de4f3=_0x21c9e9;break;}return _0x3de4f3;}['_findMarkerElementById'](_0x4353d9){const _0x11a196=T(this['context']),_0x50a0a2=_0x11a196['model']['markers']['get'](_0x4353d9);return _0x50a0a2?_0xce5e3b(_0x11a196['editing'],_0x50a0a2):null;}['_getMarkersDataForGroup'](_0x8e40f8){return Array['from'](this['_markers']['values']())['filter'](_0x4b4318=>_0x4b4318['groupId']===_0x8e40f8);}['_getOperationStart'](_0x195b74){return'insert'===_0x195b74['type']?_0x195b74['position']:_0x195b74['newRange']['start'];}['_getOperationEnd'](_0x310c92,_0x101561=!0x1){return'insert'===_0x310c92['type']?_0x101561?_0x310c92['position']:_0x310c92['position']['getShiftedBy'](_0x310c92['howMany']):_0x310c92['newRange']['end'];}['_shiftOperation'](_0x1bc0ef,_0x319d3f){return'insert'===_0x1bc0ef['type']?_0x1bc0ef['position']=_0x1bc0ef['position']['getShiftedBy'](_0x319d3f):'marker'===_0x1bc0ef['type']&&_0x1bc0ef['newRange']&&(_0x1bc0ef['newRange']=new dt(_0x1bc0ef['newRange']['start']['getShiftedBy'](_0x319d3f),_0x1bc0ef['newRange']['end']['getShiftedBy'](_0x319d3f))),_0x1bc0ef;}['_changeOperationOwnerDocument'](_0x820e4e,_0x3079f4){'insert'===_0x820e4e['type']?_0x820e4e['position']=this['_changePositionOwnerDocument'](_0x820e4e['position'],_0x3079f4):'marker'===_0x820e4e['type']&&_0x820e4e['newRange']&&(_0x820e4e['newRange']=this['_changeRangeOwnerDocument'](_0x820e4e['newRange'],_0x3079f4));}['_changePositionOwnerDocument'](_0x2b069e,_0x142ac7){return new vt(_0x142ac7,_0x2b069e['path']);}['_changeRangeOwnerDocument'](_0x10dbd9,_0x3633c5){return new dt(this['_changePositionOwnerDocument'](_0x10dbd9['start'],_0x3633c5),this['_changePositionOwnerDocument'](_0x10dbd9['end'],_0x3633c5));}['_changePosition'](_0x135ce0,_0x437840){return new vt(_0x437840,[..._0x135ce0]);}['_changeRange'](_0x195866,_0x525cd2,_0xff3fd0,_0x332086){return new dt(this['_changePosition'](_0x525cd2,_0x332086),this['_changePosition'](_0xff3fd0,_0x332086));}['_sortMarkers'](_0x1de88e){const _0x394651=_0x2ab5a0=>{switch(_0x2ab5a0){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x1de88e['sort']((_0xf21889,_0x1b6bd8)=>_0x394651(_0xf21889['type'])-_0x394651(_0x1b6bd8['type']));}['_hasSameTopLevelElement'](_0x4b7be0,_0x147c4d){const _0x403226=_0x4b7be0['getChild'](0x0),_0x2ca8dd=_0x147c4d['getChild'](0x0);return!(!_0x403226||!_0x2ca8dd)&&((!_0x403226['is']('element')||!_0x2ca8dd['is']('element')||_0x403226['name']===_0x2ca8dd['name'])&&!(_0x403226['is']('element')&&!_0x2ca8dd['is']('element')||!_0x403226['is']('element')&&_0x2ca8dd['is']('element')));}['_haveSingleTopLevelElement'](_0x2cafd8){return 0x1===_0x2cafd8['childCount'];}['_haveOnlyInlineContent'](_0xeff190,_0x12978b){for(const _0x101381 of _0xeff190['getChildren']())if(_0x101381['is']('element')&&!_0x12978b['isInline'](_0x101381))return!0x1;return!0x0;}['_upsertDataId'](_0x115a23,_0x28dc23){let _0x487618=_0x115a23['getAttribute'](nt);return _0x487618||(_0x487618=_0x28dc23(),_0x115a23['_setAttribute'](nt,_0x487618)),_0x487618;}}class Ms extends _0x5bd7c6(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0xe4c636,contentNew:_0x6428dd,contentInitial:_0x1b6ffc,documentVersion:_0x2f4a36}){super(),this['id']=_0xe4c636,this['contentNew']=_0x6428dd,this['contentInitial']=_0x1b6ffc,this['documentVersion']=_0x2f4a36;}}class Os extends ts(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x1d7cc9,_0x14baf1,_0x2c9f0a){super(),this['id']=_0x1d7cc9,this['parent']=_0x2c9f0a,this['_data']=_0x14baf1,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 Js extends ts(){['id']=_0x48eb5e();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x5e04ca,_0x52e982,_0x11e5e8,_0x3acd14,_0x5701f2){super(),this['_sourceCheck']=_0x52e982,this['_documentData']=_0x5e04ca,this['_aiConnector']=_0x11e5e8,this['_reviewParams']=_0x3acd14,this['_reviewArgs']=_0x5701f2,this['on']('change:status',(_0xd3b665,_0x285ef7,_0x5619d9)=>{'aborted'==_0x5619d9&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x5619d9,'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'](_0x5108dd=>'pending'===_0x5108dd['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x2d06bc){this['_documentData']=_0x2d06bc;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x4d4771=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x50169c of _0x4d4771)'unmodified'!==_0x50169c['data']['operation']&&('error'!==_0x50169c['data']['operation']?'review-metadata'!==_0x50169c['event']?this['_addReviewCheckResult'](_0x50169c['data']['dataId'],_0x50169c['data']['textDelta']):this['callId']=_0x50169c['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(_0x31e00f){this['_currentError']=_0x31e00f,_0x31e00f instanceof Error&&_0x31e00f['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'](_0x47733d,_0x51a746){const _0x58b678=this['_results']['get'](_0x47733d);if(!_0x58b678)return;if(0x0===_0x51a746['length'])return;const _0x26037e=[];_0x51a746['forEach']((_0x33d6e2,_0xeeb3cd)=>{const _0x41e7a9=new Os(_0x58b678['id']+'-'+_0xeeb3cd,_0x33d6e2,_0x58b678);_0x41e7a9['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x41e7a9,'status':_0x41e7a9['status']});}),_0x41e7a9['on']('change:isActivated',()=>{_0x41e7a9['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x41e7a9}):this['fire']('reviewCheckResultDeactivated',{'change':_0x41e7a9});}),this['_changes']['push'](_0x41e7a9),_0x26037e['push'](_0x41e7a9);}),this['fire']('reviewCheckResultReady',{'changes':_0x26037e,'result':_0x58b678,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x83c651){const _0xe65eba=this['_changes']['find'](_0x83be17=>_0x83be17['id']===_0x83c651);return!(!_0xe65eba||'pending'!==_0xe65eba['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x19162b=>!0x0===_0x19162b['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x52f4c6=>'pending'===_0x52f4c6['status']);}['getChangeById'](_0xddfddd){return this['_changes']['find'](_0x14dc01=>_0x14dc01['id']===_0xddfddd);}['markAllChangesAsAccepted'](){for(const _0x449ccf of this['_changes'])'pending'===_0x449ccf['status']&&(_0x449ccf['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x38c440){const _0x4445b2=this['_changes']['find'](_0x269b05=>_0x269b05['id']===_0x38c440);_0x4445b2&&'pending'===_0x4445b2['status']&&(_0x4445b2['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x16947b){const _0x4be4b8=this['_changes']['find'](_0x231c45=>_0x231c45['id']===_0x16947b);_0x4be4b8&&'pending'===_0x4be4b8['status']&&(_0x4be4b8['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x91082c){const _0x31089f=this['_changes']['find'](_0xffe695=>_0xffe695['id']===_0x91082c);_0x31089f&&'pending'===_0x31089f['status']&&(_0x31089f['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x379dbe){const _0x2cd9e9=this['_changes']['find'](_0x24dfbc=>_0x24dfbc['id']===_0x379dbe);_0x2cd9e9&&'outdated'===_0x2cd9e9['status']&&(_0x2cd9e9['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x26bfa1){this['_changes']['filter'](_0x2b3e9d=>_0x2b3e9d['isActivated']&&_0x2b3e9d['id']!==_0x26bfa1)['forEach'](_0xdd5160=>{_0xdd5160['isActivated']=!0x1;});const _0x4edb82=this['_changes']['find'](_0x4472f9=>_0x4472f9['id']===_0x26bfa1);_0x4edb82&&'pending'===_0x4edb82['status']&&(_0x4edb82['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x1b67b1=>_0x1b67b1['isActivated'])['forEach'](_0x128839=>{_0x128839['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x4bdd19){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x7309b8;if(_0x4bdd19){const _0x2f050b=this['_changes']['find'](_0x4e72e0=>_0x4e72e0['id']===_0x4bdd19);if(_0x2f050b&&_0x2f050b['isRated'])return;_0x2f050b&&(_0x7309b8=_0x2f050b['parent']['id'],_0x2f050b['isRated']=!0x0);}const _0x55b4f5={'positiveCount':this['_changes']['filter'](_0x5495a9=>'accepted'===_0x5495a9['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x55b4f5,this['callId'],_0x7309b8);}['_addReviewCheckResult'](_0x12b2ac,_0x54bac1){const _0x51713c=this['_documentData']['elements']['get'](_0x12b2ac);if(!_0x51713c)return;const _0x37d586=_0x51713c['getContent']();if(_0x37d586===_0x54bac1)return;const _0x1b7940=new Ms({'id':_0x12b2ac,'contentInitial':_0x37d586,'contentNew':_0x54bac1,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x1b7940['id'],_0x1b7940),this['fire']('reviewCheckResultAdded',{'result':_0x1b7940,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x574d8f=>'pending'===_0x574d8f['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x37ff5c=>'pending'===_0x37ff5c['status'])['length']&&(this['status']='finished'));}}class si extends Js{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0xe77f8c=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x172257=0x0;_0x172257<this['_reviewParams']['length'];_0x172257++){if(!this['_reviewParams'][_0x172257]||!this['_sourceCheck']['options'][_0x172257])continue;const _0xcb4ff4=this['_sourceCheck']['options'][_0x172257],_0x12d477=_0xcb4ff4['data']?.['find'](_0x21e5a5=>_0x21e5a5['id']===this['_reviewParams'][_0x172257]);_0x12d477&&_0xe77f8c['push'](_0x12d477['label']);}return _0xe77f8c['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x2f4dca,_0x149c14,_0x49e3f1){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x149c14,_0x2f4dca,_0x49e3f1);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class ve extends _0x3a5602{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[tt];}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(_0x8f717d,_0x368ba3)=>{const _0x233b38=this['_aiReviewCheckList']['getCheckById'](_0x368ba3['id']);if(_0x233b38){this['_onReviewCheckRun'](_0x368ba3),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x368ba3,_0x233b38),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x49ca2b,_0xf9939)=>{switch(_0xf9939['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0xf9939);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 _0x563e6a('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new _0x563e6a('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'!==_0xf9939['status']&&'error-chunk'!==_0xf9939['status']&&'error-general'!==_0xf9939['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x710dff,_0x43d28b)=>{if(!this['_currentReviewCheckRun'])throw new _0x563e6a('ai-review-mode-no-current-check-run',this);const _0x38d3a1=this['_diffContent'](_0x43d28b['result']['contentInitial'],_0x43d28b['result']['contentNew']);_0x43d28b['source']['addResultChanges'](_0x43d28b['result']['id'],_0x38d3a1);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x3bf9d6,_0x9b102d)=>{for(const _0xf565c2 of _0x9b102d['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0xf565c2);this['_markChangePositionInEditorContent'](_0x9b102d['changes'],_0x9b102d['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x127414,_0x7cb648)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x7cb648['change']['id'],_0x7cb648['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x37b5b4,_0x5485f3)=>{this['_onReviewCheckResultActivated'](_0x5485f3);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x4a7e81){_0x4a7e81 instanceof Error&&_0x4a7e81['message']['includes']('ai-request-aborted')||(_0x4a7e81 instanceof _0x563e6a?this['_logError'](_0x4a7e81):this['_logError'](new _0x563e6a('ai-review-mode-check-run-failed',this,void 0x0,_0x4a7e81)));}}else this['_logError'](new _0x563e6a('ai-review-mode-source-check-not-found',this,{'checkId':_0x368ba3['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 _0x1cda1b=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x1cda1b['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x1cda1b['map'](_0x7fb44e=>_0x7fb44e['id']));const _0x51d24f=this['_currentReviewCheckRun'];_0x51d24f['markAllChangesAsAccepted'](),_0x51d24f['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x14ece4,_0x38c6a3)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x38c6a3['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x38c6a3['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x38c6a3['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x38c6a3['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x47f046,_0x4c68af)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x4c68af['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x4c68af['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x4c68af['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x4c68af['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',(_0x5d6a48,_0x264368)=>{this['_onActivateChange'](_0x264368);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x89a650,_0x11c693)=>{this['_onDeactivateChange'](_0x11c693);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x376614,_0x5588c1)=>{this['_onChangeMarkerClicked'](_0x376614,_0x5588c1);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x4cdc77,_0x441a04)=>{this['_onChangeMarkerHovered'](_0x4cdc77,_0x441a04);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0xa00ce1,_0x3c787f)=>{this['_onChangeMarkerRemoved'](_0xa00ce1,_0x3c787f);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0xdf0f5e,_0x1746ab)=>{this['_onChangeMarkerRestored'](_0xdf0f5e,_0x1746ab);});}['_createReviewCheckRun'](_0x1d9345,_0x3b6394){return new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0x3b6394,this['_aiConnector'],_0x1d9345['params'],_0x1d9345['args']);}['_onChangeMarkerRemoved'](_0x547aed,_0x2fa5bc){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x2fa5bc['changeId']);}['_onChangeMarkerRestored'](_0x49acfb,_0x1c640f){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x1c640f['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x3799da=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x3799da&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x585abf=this['_aiReviewCoreEditing']['getEditor']();_0x585abf&&_0x585abf['editing']['view']['change'](_0x397f47=>{const _0x126b6b=_0x585abf['editing']['view']['document']['getRoot']();_0x397f47['removeClass']('ck-ai_review-diff',_0x126b6b),_0x397f47['removeClass']('ck-ai_review-highlights',_0x126b6b),_0x397f47['removeClass']('ck-ai-translate-mode-content',_0x126b6b);});}['_getTranslationWithDefault'](_0x282f88,_0x43bb35){const _0x58e076=i(this['context']['locale'],_0x282f88);return _0x58e076===_0x282f88?_0x43bb35:_0x58e076;}['_logError'](_0x31b711,_0x591ff6=!0x1){_0x4e5dbd(_0x31b711['message']),_0x591ff6||(_0x31b711['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x4cb74c){if('content'===this['_changeActivationSource']){const _0xfcc3d6=this['_aiReviewCoreUi']['getChangeElement'](_0x4cb74c);_0xfcc3d6&&_0x54a145(_0xfcc3d6['closest']('.ck-ai_review__check-run-result')||_0xfcc3d6);}else{if('panel'===this['_changeActivationSource']){const _0x45cd3d=this['_getChangeContentElement'](_0x4cb74c);if(!_0x45cd3d)return;_0x1fa956({'target':_0x45cd3d,'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 Ds{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x8586ea){this['id']=_0x8586ea['id'],this['commandId']=_0x8586ea['commandId'],this['title']=_0x8586ea['title'],this['description']=_0x8586ea['description'],this['isParameterized']=_0x8586ea['isParameterized'],this['useArgs']=_0x8586ea['useArgs'],this['options']=_0x8586ea['options'],this['args']=_0x8586ea['args'];}}class po extends ts(){['_checks']=[];['setupChecks'](_0x1237ba){this['_checks']=_0x1237ba['map'](_0x599ca2=>new Ds(_0x599ca2));}get['checks'](){return this['_checks'];}['getCheckById'](_0x57b9c8){return this['checks']['find'](_0x12a742=>_0x12a742['id']===_0x57b9c8);}['removeCheckById'](_0x57b88c){this['_checks']=this['_checks']['filter'](_0x4302c2=>_0x4302c2['id']!==_0x57b88c);}}class ke extends Ds{['_models']=[];['_defaultModel']=null;constructor(_0x46f5d1,_0x4fb78b,_0x3c04cb){super(_0x46f5d1),this['_models']=_0x4fb78b,this['_defaultModel']=_0x3c04cb;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class Ie extends Ds{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x4ffceb,_0x2ad203,_0x29567c){super(_0x4ffceb),this['prompt']=_0x4ffceb['prompt'],this['model']=_0x4ffceb['model'],this['model']?this['_defaultModel']=_0x2ad203['find'](_0xf2be51=>_0xf2be51['id']===this['model'])||null:this['_defaultModel']=_0x29567c;}get['defaultModel'](){return this['_defaultModel'];}}class _e extends po{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x28173c,_0xcdd2f0,_0x4342d2){super(),this['_allModels']=_0x28173c,this['_recommendedModels']=_0xcdd2f0,this['_defaultModel']=_0x4342d2;}['setupChecks'](_0x56ab64){this['_checks']=_0x56ab64['map'](_0x5a8cd6=>!0x0===_0x5a8cd6['isExtra']?new Ie(_0x5a8cd6,this['_allModels'],this['_defaultModel']):'custom'===_0x5a8cd6['id']?new ke(_0x5a8cd6,this['_recommendedModels'],this['_defaultModel']):new Ds(_0x5a8cd6));}}class Ce extends Js{['_prompt'];['_model'];constructor(_0x304524,_0x594f2d,_0x4b8660,_0x5161b0,_0x56c167){super(_0x4b8660,_0x5161b0,_0x56c167),this['_prompt']=_0x304524,this['_model']=_0x594f2d;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x224826,_0x1846e1,_0xfb980d){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x1846e1,_0x224826,_0xfb980d);}}class Re extends Ce{get['subTitle'](){return'';}set['prompt'](_0x4d32bf){this['_prompt']=_0x4d32bf;}set['model'](_0x2b1f6f){this['_model']=_0x2b1f6f;}}class pe extends ve{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x394279){super(_0x394279),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',we['map'](_0x46a402=>_0x46a402['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x798a96,_0x9e7858)=>{this['_isDiffOn']=_0x9e7858['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x308012,_0x5392d6){return _0x308012['isCustom']?new Ce(_0x308012['args']['prompt'],_0x308012['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x5392d6,this['_aiConnector']):_0x5392d6['isExtra']?new Re(_0x5392d6['prompt'],_0x5392d6['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x5392d6,this['_aiConnector']):new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0x5392d6,this['_aiConnector'],_0x308012['params'],_0x308012['args']);}['_onReviewCheckResultActivated'](_0x297926){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x297926['change']['id']),this['_scrollToChange'](_0x297926['change']['id']);const _0x28d761=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x297926['change']['id']);if(!_0x28d761)return;const _0xe4199d=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x297926['change'],()=>_0x28d761['getElement'](),void 0x0,'click',_0xe4199d?.['editing']?.['view']?.['getDomRoot'](),_0xe4199d?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x297926['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x10603a){this['_currentReviewCheckRun']&&'click'===_0x10603a['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x10603a['id']));}['_onDeactivateChange'](_0x271d37){this['_currentReviewCheckRun']&&'balloon'===_0x271d37['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x11e906,_0x441404){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x441404['changeId']);const _0x18b226=this['_currentReviewCheckRun']['getChangeById'](_0x441404['changeId']);if(!_0x18b226)return;const _0x59db7f=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x18b226,_0x441404['markerElement'],_0x441404['domEvent'],'click',_0x59db7f?.['editing']?.['view']?.['getDomRoot'](),_0x59db7f?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x8995a0,_0x573a2b){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x415bf9=this['_currentReviewCheckRun']['getChangeById'](_0x573a2b['changeId']);if(!_0x415bf9)return;const _0x111326=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x415bf9,_0x573a2b['markerElement'],_0x573a2b['domEvent'],'hover',_0x111326?.['editing']?.['view']?.['getDomRoot'](),_0x111326?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x2e018f){const _0x40da54=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x2e018f);return _0x40da54?_0x40da54['getElement']():null;}['_markChangePositionInEditorContent'](_0x15eb24,_0x598933){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x15eb24,_0x598933);}['_diffContent'](_0x3afb1f,_0x4c1b3c){return this['_aiReviewCoreEditing']['diffContent'](_0x3afb1f,_0x4c1b3c);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x582c29){const _0x4a8196=this['_aiReviewCoreEditing']['getEditor']();_0x582c29?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x4a8196&&_0x4a8196['editing']['view']['change'](_0x56d74d=>{const _0x4f0131=_0x4a8196['editing']['view']['document']['getRoot']();for(const _0x3aa9f3 of _0x4f0131['getClassNames']())_0x3aa9f3['startsWith']('ck-ai_review-')&&_0x56d74d['removeClass'](_0x3aa9f3,_0x4f0131);_0x56d74d['addClass'](_0x582c29?'ck-ai_review-diff':'ck-ai_review-highlights',_0x4f0131);});}async['_getChecksList'](){const _0x408bf9=[...we,...this['_getExtraChecks']()],_0x2cce87=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x2cce87,_0x408bf9);let _0x17335d=_0x408bf9;this['_hasDefaultAvailableCommands']||(_0x17335d=_0x2cce87['map'](_0x5c9c11=>_0x408bf9['find'](_0x10d51a=>_0x10d51a['id']===_0x5c9c11))['filter'](_0x54745f=>!!_0x54745f)),_0x17335d=_0x17335d['map'](_0x312937=>_0x312937['isExtra']?_0x312937:this['_translateReviewCheck'](_0x312937));const _0x3aa875=_0x17335d['some'](_0x156b81=>_0x156b81['isExtra']||'custom'===_0x156b81['id']);let _0x367611=[],_0x2b28b4=[],_0x14be59=null;if(_0x3aa875){const _0x11c6b8=await this['_getModels']();_0x367611=_0x11c6b8['all'],_0x2b28b4=_0x11c6b8['recommended'],_0x14be59=_0x11c6b8['default'];}const _0x19067e=new _e(_0x367611,_0x2b28b4,_0x14be59);return _0x19067e['setupChecks'](_0x17335d),_0x3aa875&&this['_filterChecksWithMissingModel'](_0x19067e),_0x19067e;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x41805e=>({'id':_0x41805e['id'],'commandId':_0x41805e['id'],'title':_0x41805e['label'],'description':_0x41805e['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x41805e['prompt'],'model':_0x41805e['model']}));}['_logErrorForNonExistentChecks'](_0x3c8f6b,_0x565814){const _0x4ed4fb=_0x3c8f6b['filter'](_0x309d40=>!_0x565814['some'](_0x39143b=>_0x39143b['id']===_0x309d40));_0x4ed4fb['length']&&this['_logError'](new _0x563e6a('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x4ed4fb['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x3ff680=new et({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x3ff680['getAll'](),'recommended':await _0x3ff680['getAvailableModels'](),'default':await _0x3ff680['getDefault']()};}catch(_0x5c516c){return this['_logError'](new _0x563e6a('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x5c516c)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x2a8d10){const _0x339ce0='AI_REVIEW_CHECK_'+_0x2a8d10['id']['toUpperCase']()['replaceAll']('-','_'),_0x103f43={..._0x2a8d10,'title':this['_getTranslationWithDefault'](_0x339ce0+'_TITLE',_0x2a8d10['title']),'description':this['_getTranslationWithDefault'](_0x339ce0+'_DESCRIPTION',_0x2a8d10['description'])};return _0x2a8d10['options']&&(_0x103f43['options']=_0x2a8d10['options']['map'](_0xccf7c7=>({..._0xccf7c7,'label':this['_getTranslationWithDefault'](_0x339ce0+'_OPTIONS_LABEL',_0xccf7c7['label']||''),'data':_0xccf7c7['data']?_0xccf7c7['data']['map'](_0x446e19=>({..._0x446e19,'label':this['_getTranslationWithDefault'](_0x339ce0+'_OPTIONS_DATA_'+_0x446e19['id']['toUpperCase'](),_0x446e19['label'])})):void 0x0}))),_0x103f43;}['_filterChecksWithMissingModel'](_0x2b91d0){const _0x4f05ee=[];_0x2b91d0['checks']['forEach'](_0x152905=>{(_0x152905 instanceof Ie&&!_0x152905['defaultModel']||_0x152905 instanceof ke&&!_0x152905['models']['length'])&&_0x4f05ee['push'](_0x152905['id']);}),_0x4f05ee['length']&&_0x4f05ee['forEach'](_0x4e8685=>{_0x2b91d0['removeCheckById'](_0x4e8685),this['_logError'](new _0x563e6a('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x4e8685}),!0x0);});}}class AIReviewMode extends _0x3a5602{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 Ds{get['apiId'](){return'translate';}}class Pe extends po{['setupChecks'](_0x159e82){this['_checks']=_0x159e82['map'](_0x5670e=>new jr(_0x5670e));}}class Se extends si{['_title'];constructor(_0x55e1e5,_0x554016,_0x36e9b7,_0x3a9394,_0x577479,_0x44ef87){super(_0x55e1e5,_0x554016,_0x36e9b7,_0x577479,_0x44ef87),this['_title']=_0x3a9394;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class rr extends ve{static get['pluginName'](){return'AITranslateController';}constructor(_0x42083e){super(_0x42083e),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'](_0x282308,_0x3b3f05){return new Se(this['_aiReviewCoreEditing']['getDocumentData'](),_0x3b3f05,this['_aiConnector'],i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x282308['params'],_0x282308['args']);}['_onReviewCheckResultActivated'](_0xb5bb5f){this['_aiReviewCoreUi']['setActiveStateInResults'](_0xb5bb5f['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0xb5bb5f['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x3dbffe){this['_currentReviewCheckRun']&&('hover'===_0x3dbffe['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x3dbffe['id'])),'click'===_0x3dbffe['uiInteraction']&&this['_scrollToChange'](_0x3dbffe['id']));}['_onDeactivateChange'](_0x4d2c21){this['_currentReviewCheckRun']&&'panel'===_0x4d2c21['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x190d74,_0x1fe837){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x1fe837['changeId']),this['_scrollToChange'](_0x1fe837['changeId']));}['_onChangeMarkerHovered'](_0xbb9df,_0x3ec9f1){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x3ec9f1['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x3ec9f1['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x51934b){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x51934b);}['_markChangePositionInEditorContent'](_0x3d5ecd,_0x9bab64){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x3d5ecd,_0x9bab64);}['_diffContent'](_0x5bfa4d,_0x3aec26){return this['_aiReviewCoreEditing']['diffContent'](_0x5bfa4d,_0x3aec26,!0x0);}['_onReviewCheckRun'](){const _0x148417=this['_aiReviewCoreEditing']['getEditor']();_0x148417&&_0x148417['editing']['view']['change'](_0xe4b745=>{const _0x3727f2=_0x148417['editing']['view']['document']['getRoot']();for(const _0x5152cb of _0x3727f2['getClassNames']())(_0x5152cb['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0x5152cb)&&_0xe4b745['removeClass'](_0x5152cb,_0x3727f2);_0xe4b745['addClass']('ck-ai-translate-mode-content',_0x3727f2);});}async['_getChecksList'](){const _0x5a860b=[],_0x10c653=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x2be335 of _0x10c653)_0x5a860b['push']({'title':_0x2be335['label'],'id':_0x2be335['id'],'commandId':_0x2be335['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x2be335['id']}});const _0x2b6874=new Pe();return _0x2b6874['setupChecks'](this['_translateChecks'](_0x5a860b)),_0x2b6874;}['_translateChecks'](_0x3a8ea3){return _0x3a8ea3['map'](_0x383d03=>{const _0x70679e='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x383d03['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x383d03,'title':this['_getTranslationWithDefault'](_0x70679e,_0x383d03['title'])};});}}class Le extends Ve{constructor(_0x296769,_0x290d92){super(_0x296769,_0x290d92),this['on']('set:isLoading',(_0x5baaa5,_0x13c0f7,_0x27dcc7)=>{_0x27dcc7&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x2e4c25,_0x3fb283,_0x243509)=>{_0x243509&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x12b61c=super['_createAcceptAllButtonView']();return _0x12b61c['set']('label',i(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x12b61c;}['_createExitReviewButtonView'](){const _0x5baa50=super['_createExitReviewButtonView']();return _0x5baa50['set']('label',i(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x5baa50;}}class Ne extends je{['_setupTemplate'](){const _0x347623=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x347623['if']('isVisible','ck-hidden',_0x1bec6f=>!_0x1bec6f)]},'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',_0x347623['if']('isVisible','ck-hidden',_0x4651bf=>!_0x4651bf)]},'children':this['_checkViews']}]});}}class tr extends Me{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x213c13=this['context']['locale'],_0x55bb7d=new _0x1e299f(_0x213c13,{'label':i(_0x213c13,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x20e0a0,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x3ea4af=new Ae(_0x213c13,{'header':_0x55bb7d,'list':new Ne(_0x213c13),'results':new Le(_0x213c13,{'generalErrorText':i(_0x213c13,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new be(_0x213c13,{'headerText':i(_0x213c13,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':i(_0x213c13,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0x213c13,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x3ea4af['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x3ea4af;}['registerTab'](){const _0x268913=this['context']['plugins']['get']('AITabs');_0x268913['view']['on']('activateTab',(_0x5dc725,_0x5de284)=>{'translate'===_0x5de284?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x268913['view']['addTab']({'id':'translate','buttonLabel':i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x20e0a0,'order':0x0,'content':this['_mainView']});}}class AITranslate extends _0x3a5602{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,AIAssistant,n as AIAssistantUI,H as AIBalloon,AIChat,q as AIChatController,G as AIChatHistory,jt as AIChatHistoryController,xt as AIChatHistoryUI,AIChatShortcuts,z as AIChatUI,tt as AIConnector,D as AIEditing,AIEditorIntegration,Qt as AIQuickActionType,AIQuickActions,ii as AIQuickActionsUI,er as AIRequestError,Ds as AIReviewCheck,Ms as AIReviewCheckResult,Js as AIReviewCheckRun,AIReviewMode,ve as AIReviewModeController,de as AIReviewModeEditing,ge as AIReviewModeUI,it as AITabs,ar as AITextAdapter,Pt as AIToggleButtonUI,AITranslate,rr as AITranslateController,tr as AITranslateUI,AWSTextAdapter,OpenAITextAdapter,E as ShowAIAssistantCommand,io as ToggleAICommand,us as createResizeButton,Wn as getDefaultAICommands};